/** grapesjs - 0.22.10 */
!function (t, e) {
    'object' == typeof exports && 'object' == typeof module ? module.exports = e() : 'function' == typeof define && define.amd ? define([], e) : 'object' == typeof exports ? exports["grapesjs"] = e() : t["grapesjs"] = e()
}('undefined' != typeof globalThis ? globalThis : 'undefined' != typeof window ? window : this, (() => (() => {
    var t = {
        4729: (t, e, n) => {
            var o, r, i;
            1 && (r = [n(5706), n(4193)], void 0 === (i = 'function' == typeof (o = function (t, e) {
                var n = Array.prototype.slice;

                function o(t, e, n) {
                    return n.length <= 4 ? t.call(e, n[0], n[1], n[2], n[3]) : t.apply(e, n)
                }

                function r(t, e) {
                    return n.call(t, e)
                }

                function i(e, n) {
                    return null != e && (t.isArray(n) || (n = r(arguments, 1)), t.all(n, (function (t) {
                        return t in e
                    })))
                }

                var a = function () {
                    var e = !1, n = -1;

                    function o() {
                        n++, e = !0, t.defer((function () {
                            e = !1
                        }))
                    }

                    return function () {
                        return e || o(), n
                    }
                }();

                function s() {
                    this.registeredObjects = [], this.cidIndexes = []
                }

                function l(e, n, o, r) {
                    for (var i, a = 0, s = n.length; a < s; a++) if (i = n[a]) {
                        if ("on" === e) {
                            if (!r.objectRegistry.register(i)) continue
                        } else if (!r.objectRegistry.unregister(i)) continue;
                        t.isFunction(i[e]) && i[e]("all", o, r)
                    }
                }

                function c(e, n) {
                    var o = n.type, r = n.undoTypes, i = !r[o] || r[o][e];
                    t.isFunction(i) && i(n.object, n.before, n.after, n.options)
                }

                function u(e, o, r, i, a) {
                    if (!(r.isCurrentlyUndoRedoing || "undo" === e && -1 === r.pointer || "redo" === e && r.pointer === r.length - 1)) {
                        r.isCurrentlyUndoRedoing = !0;
                        var s, l, c = "undo" === e;
                        for (a ? l = c && r.pointer === r.length - 1 || !c && -1 === r.pointer ? t.clone(r.models) : n.apply(r.models, c ? [0, r.pointer] : [r.pointer, r.length - 1]) : (s = r.at(c ? r.pointer : r.pointer + 1), l = i ? r.where({magicFusionIndex: s.get("magicFusionIndex")}) : [s]), r.pointer += (c ? -1 : 1) * l.length; s = c ? l.pop() : l.shift();) s[e]();
                        r.isCurrentlyUndoRedoing = !1, o.trigger(e, o)
                    }
                }

                function p(t, e) {
                    var n = t.condition, r = typeof n;
                    return "function" === r ? !!o(n, t, e) : "boolean" !== r || n
                }

                function d(t, e, n, r) {
                    if (t.track && !t.isCurrentlyUndoRedoing && e in r && p(r[e], n)) {
                        var s = o(r[e]["on"], r[e], n);
                        if (i(s, "object", "before", "after")) {
                            if (s.type = e, s.magicFusionIndex = a(), s.undoTypes = r, t.pointer < t.length - 1) for (var l = t.length - t.pointer - 1; l--;) t.pop();
                            t.pointer = t.length, t.add(s), t.length > t.maximumStackLength && (t.shift(), t.pointer--)
                        }
                    }
                }

                s.prototype = {
                    isRegistered: function (e) {
                        return e && e.cid ? this.registeredObjects[e.cid] : t.contains(this.registeredObjects, e)
                    }, register: function (t) {
                        return !this.isRegistered(t) && (t && t.cid ? (this.registeredObjects[t.cid] = t, this.cidIndexes.push(t.cid)) : this.registeredObjects.push(t), !0)
                    }, unregister: function (e) {
                        if (this.isRegistered(e)) {
                            if (e && e.cid) delete this.registeredObjects[e.cid], this.cidIndexes.splice(t.indexOf(this.cidIndexes, e.cid), 1); else {
                                var n = t.indexOf(this.registeredObjects, e);
                                this.registeredObjects.splice(n, 1)
                            }
                            return !0
                        }
                        return !1
                    }, get: function () {
                        return t.map(this.cidIndexes, (function (t) {
                            return this.registeredObjects[t]
                        }), this).concat(this.registeredObjects)
                    }
                };
                var f = {
                    add: {
                        undo: function (t, e, n, o) {
                            t.remove(n, o)
                        }, redo: function (t, e, n, o) {
                            o.index && (o.at = o.index), t.add(n, o)
                        }, on: function (e, n, o) {
                            return {object: n, before: void 0, after: e, options: t.clone(o)}
                        }
                    }, remove: {
                        undo: function (t, e, n, o) {
                            "index" in o && (o.at = o.index), t.add(e, o)
                        }, redo: function (t, e, n, o) {
                            t.remove(e, o)
                        }, on: function (e, n, o) {
                            return {object: n, before: e, after: void 0, options: t.clone(o)}
                        }
                    }, change: {
                        undo: function (e, n, o, r) {
                            t.isEmpty(n) ? t.each(t.keys(o), e.unset, e) : (e.set(n), r && r.unsetData && r.unsetData.before && r.unsetData.before.length && t.each(r.unsetData.before, e.unset, e))
                        }, redo: function (e, n, o, r) {
                            t.isEmpty(o) ? t.each(t.keys(n), e.unset, e) : (e.set(o), r && r.unsetData && r.unsetData.after && r.unsetData.after.length && t.each(r.unsetData.after, e.unset, e))
                        }, on: function (e, n) {
                            var o = e.changedAttributes(), r = t.keys(o), i = t.pick(e.previousAttributes(), r),
                                a = t.keys(i), s = (n || (n = {})).unsetData = {after: [], before: []};
                            return r.length != a.length && (r.length > a.length ? t.each(r, (function (t) {
                                t in i || s.before.push(t)
                            }), this) : t.each(a, (function (t) {
                                t in o || s.after.push(t)
                            }))), {object: e, before: i, after: o, options: t.clone(n)}
                        }
                    }, reset: {
                        undo: function (t, e, n) {
                            t.reset(e)
                        }, redo: function (t, e, n) {
                            t.reset(n)
                        }, on: function (e, n) {
                            return {object: e, before: n.previousModels, after: t.clone(e.models)}
                        }
                    }
                };

                function h() {
                }

                function v(e, n, o, r) {
                    if ("object" == typeof n) return t.each(n, (function (t, n) {
                        2 === e ? v(e, t, o, r) : v(e, n, t, o)
                    }));
                    switch (e) {
                        case 0:
                            i(o, "undo", "redo", "on") && t.all(t.pick(o, "undo", "redo", "on"), t.isFunction) && (r[n] = o);
                            break;
                        case 1:
                            r[n] && t.isObject(o) && (r[n] = t.extend({}, r[n], o));
                            break;
                        case 2:
                            delete r[n]
                    }
                    return this
                }

                h.prototype = f;
                var g = e.Model.extend({
                    defaults: {
                        type: null,
                        object: null,
                        before: null,
                        after: null,
                        magicFusionIndex: null
                    }, undo: function (t) {
                        c("undo", this.attributes)
                    }, redo: function (t) {
                        c("redo", this.attributes)
                    }
                }), y = e.Collection.extend({
                    model: g,
                    pointer: -1,
                    track: !1,
                    isCurrentlyUndoRedoing: !1,
                    maximumStackLength: 1 / 0,
                    setMaxLength: function (t) {
                        this.maximumStackLength = t
                    }
                }), m = e.Model.extend({
                    defaults: {maximumStackLength: 1 / 0, track: !1}, initialize: function (e) {
                        this.stack = new y, this.objectRegistry = new s, this.undoTypes = new h, this.stack.setMaxLength(this.get("maximumStackLength")), this.on("change:maximumStackLength", (function (t, e) {
                            this.stack.setMaxLength(e)
                        }), this), e && e.track && this.startTracking(), e && e.register && (t.isArray(e.register) || t.isArguments(e.register) ? o(this.register, this, e.register) : this.register(e.register))
                    }, startTracking: function () {
                        this.set("track", !0), this.stack.track = !0
                    }, stopTracking: function () {
                        this.set("track", !1), this.stack.track = !1
                    }, isTracking: function () {
                        return this.get("track")
                    }, _addToStack: function (t) {
                        d(this.stack, t, r(arguments, 1), this.undoTypes)
                    }, register: function () {
                        l("on", arguments, this._addToStack, this)
                    }, unregister: function () {
                        l("off", arguments, this._addToStack, this)
                    }, unregisterAll: function () {
                        o(this.unregister, this, this.objectRegistry.get())
                    }, undo: function (t) {
                        u("undo", this, this.stack, t)
                    }, undoAll: function () {
                        u("undo", this, this.stack, !1, !0)
                    }, redo: function (t) {
                        u("redo", this, this.stack, t)
                    }, redoAll: function () {
                        u("redo", this, this.stack, !1, !0)
                    }, isAvailable: function (t) {
                        var e = this.stack, n = e.length;
                        switch (t) {
                            case"undo":
                                return n > 0 && e.pointer > -1;
                            case"redo":
                                return n > 0 && e.pointer < n - 1;
                            default:
                                return !1
                        }
                    }, merge: function (e) {
                        for (var n, o = t.isArray(e) ? e : r(arguments); n = o.pop();) n instanceof m && n.stack instanceof y && (n.stack = this.stack)
                    }, addUndoType: function (t, e) {
                        v(0, t, e, this.undoTypes)
                    }, changeUndoType: function (t, e) {
                        v(1, t, e, this.undoTypes)
                    }, removeUndoType: function (t) {
                        v(2, t, void 0, this.undoTypes)
                    }, clear: function () {
                        this.stack.reset(), this.stack.pointer = -1
                    }
                });
                return t.extend(m, {
                    defaults: function (e) {
                        t.extend(m.prototype.defaults, e)
                    }, addUndoType: function (t, e) {
                        v(0, t, e, f)
                    }, changeUndoType: function (t, e) {
                        v(1, t, e, f)
                    }, removeUndoType: function (t) {
                        v(2, t, void 0, f)
                    }
                }), e.UndoManager = m
            }) ? o.apply(e, r) : o) || (t.exports = i))
        }, 4193: (t, e, n) => {
            var o, r;
            !function () {
                var i = 'object' == typeof self && self.self === self && self || 'object' == typeof n.g && n.g.global === n.g && n.g;
                if (1) o = [n(5706), n(7774), e], r = function (t, e, n) {
                    i.Backbone = function (t, e, n, o) {
                        var r = t.Backbone, i = Array.prototype.slice;
                        e.VERSION = '1.4.1', e.$ = o, e.noConflict = function () {
                            return t.Backbone = r, this
                        }, e.emulateHTTP = !1, e.emulateJSON = !1;
                        var a, s = e.Events = {}, l = /\s+/, c = function (t, e, o, r, i) {
                            var a, s = 0;
                            if (o && 'object' == typeof o) {
                                void 0 !== r && 'context' in i && void 0 === i.context && (i.context = r);
                                for (a = n.keys(o); s < a.length; s++) e = c(t, e, a[s], o[a[s]], i)
                            } else if (o && l.test(o)) for (a = o.split(l); s < a.length; s++) e = t(e, a[s], r, i); else e = t(e, o, r, i);
                            return e
                        };
                        s.on = function (t, e, n) {
                            (this._events = c(u, this._events || {}, t, e, {
                                context: n,
                                ctx: this,
                                listening: a
                            }), a) && ((this._listeners || (this._listeners = {}))[a.id] = a, a.interop = !1);
                            return this
                        }, s.listenTo = function (t, e, o) {
                            if (!t) return this;
                            var r = t._listenId || (t._listenId = n.uniqueId('l')),
                                i = this._listeningTo || (this._listeningTo = {}), s = a = i[r];
                            s || (this._listenId || (this._listenId = n.uniqueId('l')), s = a = i[r] = new g(this, t));
                            var l = p(t, e, o, this);
                            if (a = void 0, l) throw l;
                            return s.interop && s.on(e, o), this
                        };
                        var u = function (t, e, n, o) {
                            if (n) {
                                var r = t[e] || (t[e] = []), i = o.context, a = o.ctx, s = o.listening;
                                s && s.count++, r.push({callback: n, context: i, ctx: i || a, listening: s})
                            }
                            return t
                        }, p = function (t, e, n, o) {
                            try {
                                t.on(e, n, o)
                            } catch (t) {
                                return t
                            }
                        };
                        s.off = function (t, e, n) {
                            return this._events ? (this._events = c(d, this._events, t, e, {
                                context: n,
                                listeners: this._listeners
                            }), this) : this
                        }, s.stopListening = function (t, e, o) {
                            var r = this._listeningTo;
                            if (!r) return this;
                            for (var i = t ? [t._listenId] : n.keys(r), a = 0; a < i.length; a++) {
                                var s = r[i[a]];
                                if (!s) break;
                                s.obj.off(e, o, this), s.interop && s.off(e, o)
                            }
                            return n.isEmpty(r) && (this._listeningTo = void 0), this
                        };
                        var d = function (t, e, o, r) {
                            if (t) {
                                var i, a = r.context, s = r.listeners, l = 0;
                                if (e || a || o) {
                                    for (i = e ? [e] : n.keys(t); l < i.length; l++) {
                                        var c = t[e = i[l]];
                                        if (!c) break;
                                        for (var u = [], p = 0; p < c.length; p++) {
                                            var d = c[p];
                                            if (o && o !== d.callback && o !== d.callback._callback || a && a !== d.context) u.push(d); else {
                                                var f = d.listening;
                                                f && f.off(e, o)
                                            }
                                        }
                                        u.length ? t[e] = u : delete t[e]
                                    }
                                    return t
                                }
                                for (i = n.keys(s); l < i.length; l++) s[i[l]].cleanup()
                            }
                        };
                        s.once = function (t, e, n) {
                            var o = c(f, {}, t, e, this.off.bind(this));
                            return 'string' == typeof t && null == n && (e = void 0), this.on(o, e, n)
                        }, s.listenToOnce = function (t, e, n) {
                            var o = c(f, {}, e, n, this.stopListening.bind(this, t));
                            return this.listenTo(t, o)
                        };
                        var f = function (t, e, o, r) {
                            if (o) {
                                var i = t[e] = n.once((function () {
                                    r(e, i), o.apply(this, arguments)
                                }));
                                i._callback = o
                            }
                            return t
                        };
                        s.trigger = function (t) {
                            if (!this._events) return this;
                            for (var e = Math.max(0, arguments.length - 1), n = Array(e), o = 0; o < e; o++) n[o] = arguments[o + 1];
                            return c(h, this._events, t, void 0, n), this
                        };
                        var h = function (t, e, n, o) {
                            if (t) {
                                var r = t[e], i = t.all;
                                r && i && (i = i.slice()), r && v(r, o), i && v(i, [e].concat(o))
                            }
                            return t
                        }, v = function (t, e) {
                            var n, o = -1, r = t.length, i = e[0], a = e[1], s = e[2];
                            switch (e.length) {
                                case 0:
                                    for (; ++o < r;) (n = t[o]).callback.call(n.ctx);
                                    return;
                                case 1:
                                    for (; ++o < r;) (n = t[o]).callback.call(n.ctx, i);
                                    return;
                                case 2:
                                    for (; ++o < r;) (n = t[o]).callback.call(n.ctx, i, a);
                                    return;
                                case 3:
                                    for (; ++o < r;) (n = t[o]).callback.call(n.ctx, i, a, s);
                                    return;
                                default:
                                    for (; ++o < r;) (n = t[o]).callback.apply(n.ctx, e);
                                    return
                            }
                        }, g = function (t, e) {
                            this.id = t._listenId, this.listener = t, this.obj = e, this.interop = !0, this.count = 0, this._events = void 0
                        };
                        g.prototype.on = s.on, g.prototype.off = function (t, e) {
                            var n;
                            this.interop ? (this._events = c(d, this._events, t, e, {
                                context: void 0,
                                listeners: void 0
                            }), n = !this._events) : (this.count--, n = 0 === this.count), n && this.cleanup()
                        }, g.prototype.cleanup = function () {
                            delete this.listener._listeningTo[this.obj._listenId], this.interop || delete this.obj._listeners[this.id]
                        }, s.bind = s.on, s.unbind = s.off, n.extend(e, s);
                        var y = e.Model = function (t, e) {
                            var o = t || {};
                            e || (e = {}), this.preinitialize.apply(this, arguments), this.cid = n.uniqueId(this.cidPrefix), this.attributes = {}, e.collection && (this.collection = e.collection), e.parse && (o = this.parse(o, e) || {});
                            var r = n.result(this, 'defaults');
                            o = n.defaults(n.extend({}, r, o), r), this.set(o, e), this.changed = {}, this.initialize.apply(this, arguments)
                        };
                        n.extend(y.prototype, s, {
                            changed: null,
                            validationError: null,
                            idAttribute: 'id',
                            cidPrefix: 'c',
                            preinitialize: function () {
                            },
                            initialize: function () {
                            },
                            toJSON: function (t) {
                                return n.clone(this.attributes)
                            },
                            sync: function () {
                                return e.sync.apply(this, arguments)
                            },
                            get: function (t) {
                                return this.attributes[t]
                            },
                            escape: function (t) {
                                return n.escape(this.get(t))
                            },
                            has: function (t) {
                                return null != this.get(t)
                            },
                            matches: function (t) {
                                return !!n.iteratee(t, this)(this.attributes)
                            },
                            set: function (t, e, o) {
                                if (null == t) return this;
                                var r;
                                if ('object' == typeof t ? (r = t, o = e) : (r = {})[t] = e, o || (o = {}), !this._validate(r, o)) return !1;
                                var i = o.unset, a = o.silent, s = [], l = this._changing;
                                this._changing = !0, l || (this._previousAttributes = n.clone(this.attributes), this.changed = {});
                                var c = this.attributes, u = this.changed, p = this._previousAttributes;
                                for (var d in r) e = r[d], n.isEqual(c[d], e) || s.push(d), n.isEqual(p[d], e) ? delete u[d] : u[d] = e, i ? delete c[d] : c[d] = e;
                                if (this.idAttribute in r) {
                                    var f = this.id;
                                    this.id = this.get(this.idAttribute), this.trigger('changeId', this, f, o)
                                }
                                if (!a) {
                                    s.length && (this._pending = o);
                                    for (var h = 0; h < s.length; h++) this.trigger('change:' + s[h], this, c[s[h]], o)
                                }
                                if (l) return this;
                                if (!a) for (; this._pending;) o = this._pending, this._pending = !1, this.trigger('change', this, o);
                                return this._pending = !1, this._changing = !1, this
                            },
                            unset: function (t, e) {
                                return this.set(t, void 0, n.extend({}, e, {unset: !0}))
                            },
                            clear: function (t) {
                                var e = {};
                                for (var o in this.attributes) e[o] = void 0;
                                return this.set(e, n.extend({}, t, {unset: !0}))
                            },
                            hasChanged: function (t) {
                                return null == t ? !n.isEmpty(this.changed) : n.has(this.changed, t)
                            },
                            changedAttributes: function (t) {
                                if (!t) return !!this.hasChanged() && n.clone(this.changed);
                                var e, o = this._changing ? this._previousAttributes : this.attributes, r = {};
                                for (var i in t) {
                                    var a = t[i];
                                    n.isEqual(o[i], a) || (r[i] = a, e = !0)
                                }
                                return !!e && r
                            },
                            previous: function (t) {
                                return null != t && this._previousAttributes ? this._previousAttributes[t] : null
                            },
                            previousAttributes: function () {
                                return n.clone(this._previousAttributes)
                            },
                            fetch: function (t) {
                                t = n.extend({parse: !0}, t);
                                var e = this, o = t.success;
                                return t.success = function (n) {
                                    var r = t.parse ? e.parse(n, t) : n;
                                    if (!e.set(r, t)) return !1;
                                    o && o.call(t.context, e, n, t), e.trigger('sync', e, n, t)
                                }, K(this, t), this.sync('read', this, t)
                            },
                            save: function (t, e, o) {
                                var r;
                                null == t || 'object' == typeof t ? (r = t, o = e) : (r = {})[t] = e;
                                var i = (o = n.extend({validate: !0, parse: !0}, o)).wait;
                                if (r && !i) {
                                    if (!this.set(r, o)) return !1
                                } else if (!this._validate(r, o)) return !1;
                                var a = this, s = o.success, l = this.attributes;
                                o.success = function (t) {
                                    a.attributes = l;
                                    var e = o.parse ? a.parse(t, o) : t;
                                    if (i && (e = n.extend({}, r, e)), e && !a.set(e, o)) return !1;
                                    s && s.call(o.context, a, t, o), a.trigger('sync', a, t, o)
                                }, K(this, o), r && i && (this.attributes = n.extend({}, l, r));
                                var c = this.isNew() ? 'create' : o.patch ? 'patch' : 'update';
                                'patch' !== c || o.attrs || (o.attrs = r);
                                var u = this.sync(c, this, o);
                                return this.attributes = l, u
                            },
                            destroy: function (t) {
                                t = t ? n.clone(t) : {};
                                var e = this, o = t.success, r = t.wait, i = function () {
                                    e.stopListening(), e.trigger('destroy', e, e.collection, t)
                                };
                                t.success = function (n) {
                                    r && i(), o && o.call(t.context, e, n, t), e.isNew() || e.trigger('sync', e, n, t)
                                };
                                var a = !1;
                                return this.isNew() ? n.defer(t.success) : (K(this, t), a = this.sync('delete', this, t)), r || i(), a
                            },
                            url: function () {
                                var t = n.result(this, 'urlRoot') || n.result(this.collection, 'url') || G();
                                if (this.isNew()) return t;
                                var e = this.get(this.idAttribute);
                                return t.replace(/[^\/]$/, '$&/') + encodeURIComponent(e)
                            },
                            parse: function (t, e) {
                                return t
                            },
                            clone: function () {
                                return new this.constructor(this.attributes)
                            },
                            isNew: function () {
                                return !this.has(this.idAttribute)
                            },
                            isValid: function (t) {
                                return this._validate({}, n.extend({}, t, {validate: !0}))
                            },
                            _validate: function (t, e) {
                                if (!e.validate || !this.validate) return !0;
                                t = n.extend({}, this.attributes, t);
                                var o = this.validationError = this.validate(t, e) || null;
                                return !o || (this.trigger('invalid', this, o, n.extend(e, {validationError: o})), !1)
                            }
                        });
                        var m = e.Collection = function (t, e) {
                            e || (e = {}), this.preinitialize.apply(this, arguments), e.model && (this.model = e.model), void 0 !== e.comparator && (this.comparator = e.comparator), this._reset(), this.initialize.apply(this, arguments), t && this.reset(t, n.extend({silent: !0}, e))
                        }, b = {add: !0, remove: !0, merge: !0}, _ = {add: !0, remove: !1}, w = function (t, e, n) {
                            n = Math.min(Math.max(n, 0), t.length);
                            var o, r = Array(t.length - n), i = e.length;
                            for (o = 0; o < r.length; o++) r[o] = t[o + n];
                            for (o = 0; o < i; o++) t[o + n] = e[o];
                            for (o = 0; o < r.length; o++) t[o + i + n] = r[o]
                        };
                        n.extend(m.prototype, s, {
                            model: y, preinitialize: function () {
                            }, initialize: function () {
                            }, toJSON: function (t) {
                                return this.map((function (e) {
                                    return e.toJSON(t)
                                }))
                            }, sync: function () {
                                return e.sync.apply(this, arguments)
                            }, add: function (t, e) {
                                return this.set(t, n.extend({merge: !1}, e, _))
                            }, remove: function (t, e) {
                                e = n.extend({}, e);
                                var o = !n.isArray(t);
                                t = o ? [t] : t.slice();
                                var r = this._removeModels(t, e);
                                return !e.silent && r.length && (e.changes = {
                                    added: [],
                                    merged: [],
                                    removed: r
                                }, this.trigger('update', this, e)), o ? r[0] : r
                            }, set: function (t, e) {
                                if (null != t) {
                                    (e = n.extend({}, b, e)).parse && !this._isModel(t) && (t = this.parse(t, e) || []);
                                    var o = !n.isArray(t);
                                    t = o ? [t] : t.slice();
                                    var r = e.at;
                                    null != r && (r = +r), r > this.length && (r = this.length), r < 0 && (r += this.length + 1);
                                    var i, a, s = [], l = [], c = [], u = [], p = {}, d = e.add, f = e.merge,
                                        h = e.remove, v = !1, g = this.comparator && null == r && !1 !== e.sort,
                                        y = n.isString(this.comparator) ? this.comparator : null;
                                    for (a = 0; a < t.length; a++) {
                                        i = t[a];
                                        var m = this.get(i);
                                        if (m) {
                                            if (f && i !== m) {
                                                var _ = this._isModel(i) ? i.attributes : i;
                                                e.parse && (_ = m.parse(_, e)), m.set(_, e), c.push(m), g && !v && (v = m.hasChanged(y))
                                            }
                                            p[m.cid] || (p[m.cid] = !0, s.push(m)), t[a] = m
                                        } else d && (i = t[a] = this._prepareModel(i, e)) && (l.push(i), this._addReference(i, e), p[i.cid] = !0, s.push(i))
                                    }
                                    if (h) {
                                        for (a = 0; a < this.length; a++) p[(i = this.models[a]).cid] || u.push(i);
                                        u.length && this._removeModels(u, e)
                                    }
                                    var x = !1, C = !g && d && h;
                                    if (s.length && C ? (x = this.length !== s.length || n.some(this.models, (function (t, e) {
                                        return t !== s[e]
                                    })), this.models.length = 0, w(this.models, s, 0), this.length = this.models.length) : l.length && (g && (v = !0), w(this.models, l, null == r ? this.length : r), this.length = this.models.length), v && this.sort({silent: !0}), !e.silent) {
                                        for (a = 0; a < l.length; a++) null != r && (e.index = r + a), (i = l[a]).trigger('add', i, this, e);
                                        (v || x) && this.trigger('sort', this, e), (l.length || u.length || c.length) && (e.changes = {
                                            added: l,
                                            removed: u,
                                            merged: c
                                        }, this.trigger('update', this, e))
                                    }
                                    return o ? t[0] : t
                                }
                            }, reset: function (t, e) {
                                e = e ? n.clone(e) : {};
                                for (var o = 0; o < this.models.length; o++) this._removeReference(this.models[o], e);
                                return e.previousModels = this.models, this._reset(), t = this.add(t, n.extend({silent: !0}, e)), e.silent || this.trigger('reset', this, e), t
                            }, push: function (t, e) {
                                return this.add(t, n.extend({at: this.length}, e))
                            }, pop: function (t) {
                                var e = this.at(this.length - 1);
                                return this.remove(e, t)
                            }, unshift: function (t, e) {
                                return this.add(t, n.extend({at: 0}, e))
                            }, shift: function (t) {
                                var e = this.at(0);
                                return this.remove(e, t)
                            }, slice: function () {
                                return i.apply(this.models, arguments)
                            }, get: function (t) {
                                if (null != t) return this._byId[t] || this._byId[this.modelId(this._isModel(t) ? t.attributes : t, t.idAttribute)] || t.cid && this._byId[t.cid]
                            }, has: function (t) {
                                return null != this.get(t)
                            }, at: function (t) {
                                return t < 0 && (t += this.length), this.models[t]
                            }, where: function (t, e) {
                                return this[e ? 'find' : 'filter'](t)
                            }, findWhere: function (t) {
                                return this.where(t, !0)
                            }, sort: function (t) {
                                var e = this.comparator;
                                if (!e) throw new Error('Cannot sort a set without a comparator');
                                t || (t = {});
                                var o = e.length;
                                return n.isFunction(e) && (e = e.bind(this)), 1 === o || n.isString(e) ? this.models = this.sortBy(e) : this.models.sort(e), t.silent || this.trigger('sort', this, t), this
                            }, pluck: function (t) {
                                return this.map(t + '')
                            }, fetch: function (t) {
                                var e = (t = n.extend({parse: !0}, t)).success, o = this;
                                return t.success = function (n) {
                                    var r = t.reset ? 'reset' : 'set';
                                    o[r](n, t), e && e.call(t.context, o, n, t), o.trigger('sync', o, n, t)
                                }, K(this, t), this.sync('read', this, t)
                            }, create: function (t, e) {
                                var o = (e = e ? n.clone(e) : {}).wait;
                                if (!(t = this._prepareModel(t, e))) return !1;
                                o || this.add(t, e);
                                var r = this, i = e.success;
                                return e.success = function (t, e, n) {
                                    o && r.add(t, n), i && i.call(n.context, t, e, n)
                                }, t.save(null, e), t
                            }, parse: function (t, e) {
                                return t
                            }, clone: function () {
                                return new this.constructor(this.models, {
                                    model: this.model,
                                    comparator: this.comparator
                                })
                            }, modelId: function (t, e) {
                                return t[e || 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 (t, e) {
                                return this._isModel(t) ? (t.collection || (t.collection = this), t) : ((e = e ? n.clone(e) : {}).collection = this, (o = this.model.prototype ? new this.model(t, e) : this.model(t, e)).validationError ? (this.trigger('invalid', this, o.validationError, e), !1) : o);
                                var o
                            }, _removeModels: function (t, e) {
                                for (var n = [], o = 0; o < t.length; o++) {
                                    var r = this.get(t[o]);
                                    if (r) {
                                        var i = this.indexOf(r);
                                        this.models.splice(i, 1), this.length--, delete this._byId[r.cid];
                                        var a = this.modelId(r.attributes, r.idAttribute);
                                        null != a && delete this._byId[a], e.silent || (e.index = i, r.trigger('remove', r, this, e)), n.push(r), this._removeReference(r, e)
                                    }
                                }
                                return n
                            }, _isModel: function (t) {
                                return t instanceof y
                            }, _addReference: function (t, e) {
                                this._byId[t.cid] = t;
                                var n = this.modelId(t.attributes, t.idAttribute);
                                null != n && (this._byId[n] = t), t.on('all', this._onModelEvent, this)
                            }, _removeReference: function (t, e) {
                                delete this._byId[t.cid];
                                var n = this.modelId(t.attributes, t.idAttribute);
                                null != n && delete this._byId[n], this === t.collection && delete t.collection, t.off('all', this._onModelEvent, this)
                            }, _onModelEvent: function (t, e, n, o) {
                                if (e) {
                                    if (('add' === t || 'remove' === t) && n !== this) return;
                                    if ('destroy' === t && this.remove(e, o), 'changeId' === t) {
                                        var r = this.modelId(e.previousAttributes(), e.idAttribute),
                                            i = this.modelId(e.attributes, e.idAttribute);
                                        null != r && delete this._byId[r], null != i && (this._byId[i] = e)
                                    }
                                }
                                this.trigger.apply(this, arguments)
                            }
                        });
                        var x = 'function' == typeof Symbol && Symbol.iterator;
                        x && (m.prototype[x] = m.prototype.values);
                        var C = function (t, e) {
                            this._collection = t, this._kind = e, 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 t, e = this._collection.at(this._index);
                                    if (this._index++, this._kind === S) t = e; else {
                                        var n = this._collection.modelId(e.attributes, e.idAttribute);
                                        t = this._kind === O ? n : [n, e]
                                    }
                                    return {value: t, done: !1}
                                }
                                this._collection = void 0
                            }
                            return {value: void 0, done: !0}
                        };
                        var P = e.View = function (t) {
                                this.cid = n.uniqueId('view'), this.preinitialize.apply(this, arguments), n.extend(this, n.pick(t, k)), this._ensureElement(), this.initialize.apply(this, arguments)
                            }, E = /^(\S+)\s*(.*)$/,
                            k = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
                        n.extend(P.prototype, s, {
                            tagName: 'div', $: function (t) {
                                return this.$el.find(t)
                            }, preinitialize: function () {
                            }, initialize: function () {
                            }, render: function () {
                                return this
                            }, remove: function () {
                                return this._removeElement(), this.stopListening(), this
                            }, _removeElement: function () {
                                this.$el.remove()
                            }, setElement: function (t) {
                                return this.undelegateEvents(), this._setElement(t), this.delegateEvents(), this
                            }, _setElement: function (t) {
                                this.$el = t instanceof e.$ ? t : e.$(t), this.el = this.$el[0]
                            }, delegateEvents: function (t) {
                                if (t || (t = n.result(this, 'events')), !t) return this;
                                for (var e in this.undelegateEvents(), t) {
                                    var o = t[e];
                                    if (n.isFunction(o) || (o = this[o]), o) {
                                        var r = e.match(E);
                                        this.delegate(r[1], r[2], o.bind(this))
                                    }
                                }
                                return this
                            }, delegate: function (t, e, n) {
                                return this.$el.on(t + '.delegateEvents' + this.cid, e, n), this
                            }, undelegateEvents: function () {
                                return this.$el && this.$el.off('.delegateEvents' + this.cid), this
                            }, undelegate: function (t, e, n) {
                                return this.$el.off(t + '.delegateEvents' + this.cid, e, n), this
                            }, _createElement: function (t) {
                                return document.createElement(t)
                            }, _ensureElement: function () {
                                if (this.el) this.setElement(n.result(this, 'el')); else {
                                    var t = n.extend({}, n.result(this, 'attributes'));
                                    this.id && (t.id = n.result(this, 'id')), this.className && (t['class'] = n.result(this, 'className')), this.setElement(this._createElement(n.result(this, 'tagName'))), this._setAttributes(t)
                                }
                            }, _setAttributes: function (t) {
                                this.$el.attr(t)
                            }
                        });
                        var A = function (t, e, n, o) {
                            switch (e) {
                                case 1:
                                    return function () {
                                        return t[n](this[o])
                                    };
                                case 2:
                                    return function (e) {
                                        return t[n](this[o], e)
                                    };
                                case 3:
                                    return function (e, r) {
                                        return t[n](this[o], M(e, this), r)
                                    };
                                case 4:
                                    return function (e, r, i) {
                                        return t[n](this[o], M(e, this), r, i)
                                    };
                                default:
                                    return function () {
                                        var e = i.call(arguments);
                                        return e.unshift(this[o]), t[n].apply(t, e)
                                    }
                            }
                        }, j = function (t, e, o, r) {
                            n.each(o, (function (n, o) {
                                e[o] && (t.prototype[o] = A(e, n, o, r))
                            }))
                        }, M = function (t, e) {
                            return n.isFunction(t) ? t : n.isObject(t) && !e._isModel(t) ? D(t) : n.isString(t) ? function (e) {
                                return e.get(t)
                            } : t
                        }, D = function (t) {
                            var e = n.matches(t);
                            return function (t) {
                                return e(t.attributes)
                            }
                        }, L = {
                            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
                        }, I = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0, omit: 0, chain: 1, isEmpty: 1};
                        n.each([[m, L, 'models'], [y, I, 'attributes']], (function (t) {
                            var e = t[0], o = t[1], r = t[2];
                            e.mixin = function (t) {
                                var o = n.reduce(n.functions(t), (function (t, e) {
                                    return t[e] = 0, t
                                }), {});
                                j(e, t, o, r)
                            }, j(e, n, o, r)
                        })), e.sync = function (t, o, r) {
                            var i = N[t];
                            n.defaults(r || (r = {}), {emulateHTTP: e.emulateHTTP, emulateJSON: e.emulateJSON});
                            var a = {type: i, dataType: 'json'};
                            if (r.url || (a.url = n.result(o, 'url') || G()), null != r.data || !o || 'create' !== t && 'update' !== t && 'patch' !== t || (a.contentType = 'application/json', a.data = JSON.stringify(r.attrs || o.toJSON(r))), r.emulateJSON && (a.contentType = 'application/x-www-form-urlencoded', a.data = a.data ? {model: a.data} : {}), r.emulateHTTP && ('PUT' === i || 'DELETE' === i || 'PATCH' === i)) {
                                a.type = 'POST', r.emulateJSON && (a.data._method = i);
                                var s = r.beforeSend;
                                r.beforeSend = function (t) {
                                    if (t.setRequestHeader('X-HTTP-Method-Override', i), s) return s.apply(this, arguments)
                                }
                            }
                            'GET' === a.type || r.emulateJSON || (a.processData = !1);
                            var l = r.error;
                            r.error = function (t, e, n) {
                                r.textStatus = e, r.errorThrown = n, l && l.call(r.context, t, e, n)
                            };
                            var c = r.xhr = e.ajax(n.extend(a, r));
                            return o.trigger('request', o, c, r), c
                        };
                        var N = {create: 'POST', update: 'PUT', patch: 'PATCH', delete: 'DELETE', read: 'GET'};
                        e.ajax = function () {
                            return e.$.ajax.apply(e.$, arguments)
                        };
                        var R = e.Router = function (t) {
                            t || (t = {}), this.preinitialize.apply(this, arguments), t.routes && (this.routes = t.routes), this._bindRoutes(), this.initialize.apply(this, arguments)
                        }, V = /\((.*?)\)/g, F = /(\(\?)?:\w+/g, H = /\*\w+/g, U = /[\-{}\[\]+?.,\\\^$|#\s]/g;
                        n.extend(R.prototype, s, {
                            preinitialize: function () {
                            }, initialize: function () {
                            }, route: function (t, o, r) {
                                n.isRegExp(t) || (t = this._routeToRegExp(t)), n.isFunction(o) && (r = o, o = ''), r || (r = this[o]);
                                var i = this;
                                return e.history.route(t, (function (n) {
                                    var a = i._extractParameters(t, n);
                                    !1 !== i.execute(r, a, o) && (i.trigger.apply(i, ['route:' + o].concat(a)), i.trigger('route', o, a), e.history.trigger('route', i, o, a))
                                })), this
                            }, execute: function (t, e, n) {
                                t && t.apply(this, e)
                            }, navigate: function (t, n) {
                                return e.history.navigate(t, n), this
                            }, _bindRoutes: function () {
                                if (this.routes) {
                                    this.routes = n.result(this, 'routes');
                                    for (var t, e = n.keys(this.routes); null != (t = e.pop());) this.route(t, this.routes[t])
                                }
                            }, _routeToRegExp: function (t) {
                                return t = t.replace(U, '\\$&').replace(V, '(?:$1)?').replace(F, (function (t, e) {
                                    return e ? t : '([^/?]+)'
                                })).replace(H, '([^?]*?)'), new RegExp('^' + t + '(?:\\?([\\s\\S]*))?$')
                            }, _extractParameters: function (t, e) {
                                var o = t.exec(e).slice(1);
                                return n.map(o, (function (t, e) {
                                    return e === o.length - 1 ? t || null : t ? decodeURIComponent(t) : null
                                }))
                            }
                        });
                        var z = e.History = function () {
                            this.handlers = [], this.checkUrl = this.checkUrl.bind(this), 'undefined' != typeof window && (this.location = window.location, this.history = window.history)
                        }, B = /^[#\/]|\s+$/g, W = /^\/+|\/+$/g, $ = /#.*$/;
                        z.started = !1, n.extend(z.prototype, s, {
                            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 (t) {
                                return decodeURI(t.replace(/%25/g, '%2525'))
                            }, getSearch: function () {
                                var t = this.location.href.replace(/#.*/, '').match(/\?.+/);
                                return t ? t[0] : ''
                            }, getHash: function (t) {
                                var e = (t || this).location.href.match(/#(.*)$/);
                                return e ? e[1] : ''
                            }, getPath: function () {
                                var t = this.decodeFragment(this.location.pathname + this.getSearch()).slice(this.root.length - 1);
                                return '/' === t.charAt(0) ? t.slice(1) : t
                            }, getFragment: function (t) {
                                return null == t && (t = this._usePushState || !this._wantsHashChange ? this.getPath() : this.getHash()), t.replace(B, '')
                            }, start: function (t) {
                                if (z.started) throw new Error('Backbone.history has already been started');
                                if (z.started = !0, this.options = n.extend({root: '/'}, this.options, t), this.root = this.options.root, this._wantsHashChange = !1 !== 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 e = this.root.slice(0, -1) || '/';
                                        return this.location.replace(e + '#' + this.getPath()), !0
                                    }
                                    this._hasPushState && this.atRoot() && this.navigate(this.getHash(), {replace: !0})
                                }
                                if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {
                                    this.iframe = document.createElement('iframe'), this.iframe.src = 'javascript:0', this.iframe.style.display = 'none', this.iframe.tabIndex = -1;
                                    var o = document.body, r = o.insertBefore(this.iframe, o.firstChild).contentWindow;
                                    r.document.open(), r.document.close(), r.location.hash = '#' + this.fragment
                                }
                                var i = window.addEventListener || function (t, e) {
                                    return attachEvent('on' + t, e)
                                };
                                if (this._usePushState ? i('popstate', this.checkUrl, !1) : this._useHashChange && !this.iframe ? i('hashchange', this.checkUrl, !1) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), !this.options.silent) return this.loadUrl()
                            }, stop: function () {
                                var t = window.removeEventListener || function (t, e) {
                                    return detachEvent('on' + t, e)
                                };
                                this._usePushState ? t('popstate', this.checkUrl, !1) : this._useHashChange && !this.iframe && t('hashchange', this.checkUrl, !1), this.iframe && (document.body.removeChild(this.iframe), this.iframe = null), this._checkUrlInterval && clearInterval(this._checkUrlInterval), z.started = !1
                            }, route: function (t, e) {
                                this.handlers.unshift({route: t, callback: e})
                            }, checkUrl: function (t) {
                                var e = this.getFragment();
                                if (e === this.fragment && this.iframe && (e = this.getHash(this.iframe.contentWindow)), e === this.fragment) return !1;
                                this.iframe && this.navigate(e), this.loadUrl()
                            }, loadUrl: function (t) {
                                return !!this.matchRoot() && (t = this.fragment = this.getFragment(t), n.some(this.handlers, (function (e) {
                                    if (e.route.test(t)) return e.callback(t), !0
                                })))
                            }, navigate: function (t, e) {
                                if (!z.started) return !1;
                                e && !0 !== e || (e = {trigger: !!e}), t = this.getFragment(t || '');
                                var n = this.root;
                                '' !== t && '?' !== t.charAt(0) || (n = n.slice(0, -1) || '/');
                                var o = n + t;
                                t = t.replace($, '');
                                var r = this.decodeFragment(t);
                                if (this.fragment !== r) {
                                    if (this.fragment = r, this._usePushState) this.history[e.replace ? 'replaceState' : 'pushState']({}, document.title, o); else {
                                        if (!this._wantsHashChange) return this.location.assign(o);
                                        if (this._updateHash(this.location, t, e.replace), this.iframe && t !== this.getHash(this.iframe.contentWindow)) {
                                            var i = this.iframe.contentWindow;
                                            e.replace || (i.document.open(), i.document.close()), this._updateHash(i.location, t, e.replace)
                                        }
                                    }
                                    return e.trigger ? this.loadUrl(t) : void 0
                                }
                            }, _updateHash: function (t, e, n) {
                                if (n) {
                                    var o = t.href.replace(/(javascript:|#).*$/, '');
                                    t.replace(o + '#' + e)
                                } else t.hash = '#' + e
                            }
                        }), e.history = new z;
                        var q = function (t, e) {
                            var o, r = this;
                            return o = t && n.has(t, 'constructor') ? t.constructor : function () {
                                return r.apply(this, arguments)
                            }, n.extend(o, r, e), o.prototype = n.create(r.prototype, t), o.prototype.constructor = o, o.__super__ = r.prototype, o
                        };
                        y.extend = m.extend = R.extend = P.extend = z.extend = q;
                        var G = function () {
                            throw new Error('A "url" property or function must be specified')
                        }, K = function (t, e) {
                            var n = e.error;
                            e.error = function (o) {
                                n && n.call(e.context, t, o, e), t.trigger('error', t, o, e)
                            }
                        };
                        return e
                    }(i, n, t, e)
                }.apply(e, o), void 0 === r || (t.exports = r); else ;
            }()
        }, 3640: (t, e, n) => {
            1 && function (t) {
                t.extendMode("css", {
                    commentStart: "/*", commentEnd: "*/", newlineAfterToken: function (t, e) {
                        return /^[;{}]$/.test(e)
                    }
                }), t.extendMode("javascript", {
                    commentStart: "/*",
                    commentEnd: "*/",
                    newlineAfterToken: function (t, e, n, o) {
                        return this.jsonMode ? /^[\[,{]$/.test(e) || /^}/.test(n) : (";" != e || !o.lexical || ")" != o.lexical.type) && /^[;{}]$/.test(e) && !/^;/.test(n)
                    }
                });
                var e = /^(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)$/;
                t.extendMode("xml", {
                    commentStart: "\x3c!--",
                    commentEnd: "--\x3e",
                    newlineAfterToken: function (t, n, o, r) {
                        var i = !1;
                        return "html" == this.configuration && (i = !!r.context && e.test(r.context.tagName)), !i && ("tag" == t && />$/.test(n) && r.context || /^</.test(o))
                    }
                }), t.defineExtension("commentRange", (function (e, n, o) {
                    var r = this, i = t.innerMode(r.getMode(), r.getTokenAt(n).state).mode;
                    r.operation((function () {
                        if (e) r.replaceRange(i.commentEnd, o), r.replaceRange(i.commentStart, n), n.line == o.line && n.ch == o.ch && r.setCursor(n.line, n.ch + i.commentStart.length); else {
                            var t = r.getRange(n, o), a = t.indexOf(i.commentStart), s = t.lastIndexOf(i.commentEnd);
                            a > -1 && s > -1 && s > a && (t = t.substr(0, a) + t.substring(a + i.commentStart.length, s) + t.substr(s + i.commentEnd.length)), r.replaceRange(t, n, o)
                        }
                    }))
                })), t.defineExtension("autoIndentRange", (function (t, e) {
                    var n = this;
                    this.operation((function () {
                        for (var o = t.line; o <= e.line; o++) n.indentLine(o, "smart")
                    }))
                })), t.defineExtension("autoFormatRange", (function (e, n) {
                    var o = this, r = o.getMode(), i = o.getRange(e, n).split("\n"),
                        a = t.copyState(r, o.getTokenAt(e).state), s = o.getOption("tabSize"), l = "", c = 0,
                        u = 0 === e.ch;

                    function p() {
                        l += "\n", u = !0, ++c
                    }

                    for (var d = 0; d < i.length; ++d) {
                        for (var f = new t.StringStream(i[d], s); !f.eol();) {
                            var h = t.innerMode(r, a), v = r.token(f, a), g = f.current();
                            f.start = f.pos, u && !/\S/.test(g) || (l += g, u = !1), !u && h.mode.newlineAfterToken && h.mode.newlineAfterToken(v, g, f.string.slice(f.pos) || i[d + 1] || "", h.state) && p()
                        }
                        !f.pos && r.blankLine && r.blankLine(a), !u && d < i.length - 1 && p()
                    }
                    o.operation((function () {
                        o.replaceRange(l, e, n);
                        for (var t = e.line + 1, r = e.line + c; t <= r; ++t) o.indentLine(t, "smart");
                        o.setSelection(e, o.getCursor(!1))
                    }))
                }))
            }(n(4408))
        }, 4408: function (t) {
            1 && (t.exports = function () {
                'use strict';
                var t = navigator.userAgent, e = navigator.platform, n = /gecko\/\d/i.test(t), o = /MSIE \d/.test(t),
                    r = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t), i = /Edge\/(\d+)/.exec(t), a = o || r || i,
                    s = a && (o ? document.documentMode || 6 : +(i || r)[1]), l = !i && /WebKit\//.test(t),
                    c = l && /Qt\/\d+\.\d+/.test(t), u = !i && /Chrome\//.test(t), p = /Opera\//.test(t),
                    d = /Apple Computer/.test(navigator.vendor), f = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),
                    h = /PhantomJS/.test(t), v = d && (/Mobile\/\w+/.test(t) || navigator.maxTouchPoints > 2),
                    g = /Android/.test(t), y = v || g || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),
                    m = v || /Mac/.test(e), b = /\bCrOS\b/.test(t), _ = /win/i.test(e),
                    w = p && t.match(/Version\/(\d*\.\d*)/);
                w && (w = Number(w[1])), w && w >= 15 && (p = !1, l = !0);
                var x = m && (c || p && (null == w || w < 12.11)), C = n || a && s >= 9;

                function S(t) {
                    return new RegExp("(^|\\s)" + t + "(?:$|\\s)\\s*")
                }

                var O, T = function (t, e) {
                    var n = t.className, o = S(e).exec(n);
                    if (o) {
                        var r = n.slice(o.index + o[0].length);
                        t.className = n.slice(0, o.index) + (r ? o[1] + r : "")
                    }
                };

                function P(t) {
                    for (var e = t.childNodes.length; e > 0; --e) t.removeChild(t.firstChild);
                    return t
                }

                function E(t, e) {
                    return P(t).appendChild(e)
                }

                function k(t, e, n, o) {
                    var r = document.createElement(t);
                    if (n && (r.className = n), o && (r.style.cssText = o), "string" == typeof e) r.appendChild(document.createTextNode(e)); else if (e) for (var i = 0; i < e.length; ++i) r.appendChild(e[i]);
                    return r
                }

                function A(t, e, n, o) {
                    var r = k(t, e, n, o);
                    return r.setAttribute("role", "presentation"), r
                }

                function j(t, e) {
                    if (3 == e.nodeType && (e = e.parentNode), t.contains) return t.contains(e);
                    do {
                        if (11 == e.nodeType && (e = e.host), e == t) return !0
                    } while (e = e.parentNode)
                }

                function M() {
                    var t;
                    try {
                        t = document.activeElement
                    } catch (e) {
                        t = document.body || null
                    }
                    for (; t && t.shadowRoot && t.shadowRoot.activeElement;) t = t.shadowRoot.activeElement;
                    return t
                }

                function D(t, e) {
                    var n = t.className;
                    S(e).test(n) || (t.className += (n ? " " : "") + e)
                }

                function L(t, e) {
                    for (var n = t.split(" "), o = 0; o < n.length; o++) n[o] && !S(n[o]).test(e) && (e += " " + n[o]);
                    return e
                }

                O = document.createRange ? function (t, e, n, o) {
                    var r = document.createRange();
                    return r.setEnd(o || t, n), r.setStart(t, e), r
                } : function (t, e, n) {
                    var o = document.body.createTextRange();
                    try {
                        o.moveToElementText(t.parentNode)
                    } catch (t) {
                        return o
                    }
                    return o.collapse(!0), o.moveEnd("character", n), o.moveStart("character", e), o
                };
                var I = function (t) {
                    t.select()
                };

                function N(t) {
                    var e = Array.prototype.slice.call(arguments, 1);
                    return function () {
                        return t.apply(null, e)
                    }
                }

                function R(t, e, n) {
                    for (var o in e || (e = {}), t) !t.hasOwnProperty(o) || !1 === n && e.hasOwnProperty(o) || (e[o] = t[o]);
                    return e
                }

                function V(t, e, n, o, r) {
                    null == e && -1 == (e = t.search(/[^\s\u00a0]/)) && (e = t.length);
                    for (var i = o || 0, a = r || 0; ;) {
                        var s = t.indexOf("\t", i);
                        if (s < 0 || s >= e) return a + (e - i);
                        a += s - i, a += n - a % n, i = s + 1
                    }
                }

                v ? I = function (t) {
                    t.selectionStart = 0, t.selectionEnd = t.value.length
                } : a && (I = function (t) {
                    try {
                        t.select()
                    } catch (t) {
                    }
                });
                var F = function () {
                    this.id = null, this.f = null, this.time = 0, this.handler = N(this.onTimeout, this)
                };

                function H(t, e) {
                    for (var n = 0; n < t.length; ++n) if (t[n] == e) return n;
                    return -1
                }

                F.prototype.onTimeout = function (t) {
                    t.id = 0, t.time <= +new Date ? t.f() : setTimeout(t.handler, t.time - +new Date)
                }, F.prototype.set = function (t, e) {
                    this.f = e;
                    var n = +new Date + t;
                    (!this.id || n < this.time) && (clearTimeout(this.id), this.id = setTimeout(this.handler, t), this.time = n)
                };
                var U = 50, z = {
                    toString: function () {
                        return "CodeMirror.Pass"
                    }
                }, B = {scroll: !1}, W = {origin: "*mouse"}, $ = {origin: "+move"};

                function q(t, e, n) {
                    for (var o = 0, r = 0; ;) {
                        var i = t.indexOf("\t", o);
                        -1 == i && (i = t.length);
                        var a = i - o;
                        if (i == t.length || r + a >= e) return o + Math.min(a, e - r);
                        if (r += i - o, o = i + 1, (r += n - r % n) >= e) return o
                    }
                }

                var G = [""];

                function K(t) {
                    for (; G.length <= t;) G.push(Y(G) + " ");
                    return G[t]
                }

                function Y(t) {
                    return t[t.length - 1]
                }

                function X(t, e) {
                    for (var n = [], o = 0; o < t.length; o++) n[o] = e(t[o], o);
                    return n
                }

                function J(t, e, n) {
                    for (var o = 0, r = n(e); o < t.length && n(t[o]) <= r;) o++;
                    t.splice(o, 0, e)
                }

                function Z() {
                }

                function Q(t, e) {
                    var n;
                    return Object.create ? n = Object.create(t) : (Z.prototype = t, n = new Z), e && R(e, n), n
                }

                var tt = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;

                function et(t) {
                    return /\w/.test(t) || t > "" && (t.toUpperCase() != t.toLowerCase() || tt.test(t))
                }

                function nt(t, e) {
                    return e ? !!(e.source.indexOf("\\w") > -1 && et(t)) || e.test(t) : et(t)
                }

                function ot(t) {
                    for (var e in t) if (t.hasOwnProperty(e) && t[e]) return !1;
                    return !0
                }

                var rt = /[\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 it(t) {
                    return t.charCodeAt(0) >= 768 && rt.test(t)
                }

                function at(t, e, n) {
                    for (; (n < 0 ? e > 0 : e < t.length) && it(t.charAt(e));) e += n;
                    return e
                }

                function st(t, e, n) {
                    for (var o = e > n ? -1 : 1; ;) {
                        if (e == n) return e;
                        var r = (e + n) / 2, i = o < 0 ? Math.ceil(r) : Math.floor(r);
                        if (i == e) return t(i) ? e : n;
                        t(i) ? n = i : e = i + o
                    }
                }

                function lt(t, e, n, o) {
                    if (!t) return o(e, n, "ltr", 0);
                    for (var r = !1, i = 0; i < t.length; ++i) {
                        var a = t[i];
                        (a.from < n && a.to > e || e == n && a.to == e) && (o(Math.max(a.from, e), Math.min(a.to, n), 1 == a.level ? "rtl" : "ltr", i), r = !0)
                    }
                    r || o(e, n, "ltr")
                }

                var ct = null;

                function ut(t, e, n) {
                    var o;
                    ct = null;
                    for (var r = 0; r < t.length; ++r) {
                        var i = t[r];
                        if (i.from < e && i.to > e) return r;
                        i.to == e && (i.from != i.to && "before" == n ? o = r : ct = r), i.from == e && (i.from != i.to && "before" != n ? o = r : ct = r)
                    }
                    return null != o ? o : ct
                }

                var pt = function () {
                    var t = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",
                        e = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";

                    function n(n) {
                        return n <= 247 ? t.charAt(n) : 1424 <= n && n <= 1524 ? "R" : 1536 <= n && n <= 1785 ? e.charAt(n - 1536) : 1774 <= n && n <= 2220 ? "r" : 8192 <= n && n <= 8203 ? "w" : 8204 == n ? "b" : "L"
                    }

                    var o = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/, r = /[stwN]/, i = /[LRr]/, a = /[Lb1n]/,
                        s = /[1n]/;

                    function l(t, e, n) {
                        this.level = t, this.from = e, this.to = n
                    }

                    return function (t, e) {
                        var c = "ltr" == e ? "L" : "R";
                        if (0 == t.length || "ltr" == e && !o.test(t)) return !1;
                        for (var u = t.length, p = [], d = 0; d < u; ++d) p.push(n(t.charCodeAt(d)));
                        for (var f = 0, h = c; f < u; ++f) {
                            var v = p[f];
                            "m" == v ? p[f] = h : h = v
                        }
                        for (var g = 0, y = c; g < u; ++g) {
                            var m = p[g];
                            "1" == m && "r" == y ? p[g] = "n" : i.test(m) && (y = m, "r" == m && (p[g] = "R"))
                        }
                        for (var b = 1, _ = p[0]; b < u - 1; ++b) {
                            var w = p[b];
                            "+" == w && "1" == _ && "1" == p[b + 1] ? p[b] = "1" : "," != w || _ != p[b + 1] || "1" != _ && "n" != _ || (p[b] = _), _ = w
                        }
                        for (var x = 0; x < u; ++x) {
                            var C = p[x];
                            if ("," == C) p[x] = "N"; else if ("%" == C) {
                                var S = void 0;
                                for (S = x + 1; S < u && "%" == p[S]; ++S) ;
                                for (var O = x && "!" == p[x - 1] || S < u && "1" == p[S] ? "1" : "N", T = x; T < S; ++T) p[T] = O;
                                x = S - 1
                            }
                        }
                        for (var P = 0, E = c; P < u; ++P) {
                            var k = p[P];
                            "L" == E && "1" == k ? p[P] = "L" : i.test(k) && (E = k)
                        }
                        for (var A = 0; A < u; ++A) if (r.test(p[A])) {
                            var j = void 0;
                            for (j = A + 1; j < u && r.test(p[j]); ++j) ;
                            for (var M = "L" == (A ? p[A - 1] : c), D = M == ("L" == (j < u ? p[j] : c)) ? M ? "L" : "R" : c, L = A; L < j; ++L) p[L] = D;
                            A = j - 1
                        }
                        for (var I, N = [], R = 0; R < u;) if (a.test(p[R])) {
                            var V = R;
                            for (++R; R < u && a.test(p[R]); ++R) ;
                            N.push(new l(0, V, R))
                        } else {
                            var F = R, H = N.length, U = "rtl" == e ? 1 : 0;
                            for (++R; R < u && "L" != p[R]; ++R) ;
                            for (var z = F; z < R;) if (s.test(p[z])) {
                                F < z && (N.splice(H, 0, new l(1, F, z)), H += U);
                                var B = z;
                                for (++z; z < R && s.test(p[z]); ++z) ;
                                N.splice(H, 0, new l(2, B, z)), H += U, F = z
                            } else ++z;
                            F < R && N.splice(H, 0, new l(1, F, R))
                        }
                        return "ltr" == e && (1 == N[0].level && (I = t.match(/^\s+/)) && (N[0].from = I[0].length, N.unshift(new l(0, 0, I[0].length))), 1 == Y(N).level && (I = t.match(/\s+$/)) && (Y(N).to -= I[0].length, N.push(new l(0, u - I[0].length, u)))), "rtl" == e ? N.reverse() : N
                    }
                }();

                function dt(t, e) {
                    var n = t.order;
                    return null == n && (n = t.order = pt(t.text, e)), n
                }

                var ft = [], ht = function (t, e, n) {
                    if (t.addEventListener) t.addEventListener(e, n, !1); else if (t.attachEvent) t.attachEvent("on" + e, n); else {
                        var o = t._handlers || (t._handlers = {});
                        o[e] = (o[e] || ft).concat(n)
                    }
                };

                function vt(t, e) {
                    return t._handlers && t._handlers[e] || ft
                }

                function gt(t, e, n) {
                    if (t.removeEventListener) t.removeEventListener(e, n, !1); else if (t.detachEvent) t.detachEvent("on" + e, n); else {
                        var o = t._handlers, r = o && o[e];
                        if (r) {
                            var i = H(r, n);
                            i > -1 && (o[e] = r.slice(0, i).concat(r.slice(i + 1)))
                        }
                    }
                }

                function yt(t, e) {
                    var n = vt(t, e);
                    if (n.length) for (var o = Array.prototype.slice.call(arguments, 2), r = 0; r < n.length; ++r) n[r].apply(null, o)
                }

                function mt(t, e, n) {
                    return "string" == typeof e && (e = {
                        type: e, preventDefault: function () {
                            this.defaultPrevented = !0
                        }
                    }), yt(t, n || e.type, t, e), St(e) || e.codemirrorIgnore
                }

                function bt(t) {
                    var e = t._handlers && t._handlers.cursorActivity;
                    if (e) for (var n = t.curOp.cursorActivityHandlers || (t.curOp.cursorActivityHandlers = []), o = 0; o < e.length; ++o) -1 == H(n, e[o]) && n.push(e[o])
                }

                function _t(t, e) {
                    return vt(t, e).length > 0
                }

                function wt(t) {
                    t.prototype.on = function (t, e) {
                        ht(this, t, e)
                    }, t.prototype.off = function (t, e) {
                        gt(this, t, e)
                    }
                }

                function xt(t) {
                    t.preventDefault ? t.preventDefault() : t.returnValue = !1
                }

                function Ct(t) {
                    t.stopPropagation ? t.stopPropagation() : t.cancelBubble = !0
                }

                function St(t) {
                    return null != t.defaultPrevented ? t.defaultPrevented : 0 == t.returnValue
                }

                function Ot(t) {
                    xt(t), Ct(t)
                }

                function Tt(t) {
                    return t.target || t.srcElement
                }

                function Pt(t) {
                    var e = t.which;
                    return null == e && (1 & t.button ? e = 1 : 2 & t.button ? e = 3 : 4 & t.button && (e = 2)), m && t.ctrlKey && 1 == e && (e = 3), e
                }

                var Et, kt, At = function () {
                    if (a && s < 9) return !1;
                    var t = k('div');
                    return "draggable" in t || "dragDrop" in t
                }();

                function jt(t) {
                    if (null == Et) {
                        var e = k("span", "");
                        E(t, k("span", [e, document.createTextNode("x")])), 0 != t.firstChild.offsetHeight && (Et = e.offsetWidth <= 1 && e.offsetHeight > 2 && !(a && s < 8))
                    }
                    var n = Et ? k("span", "") : k("span", " ", null, "display: inline-block; width: 1px; margin-right: -1px");
                    return n.setAttribute("cm-text", ""), n
                }

                function Mt(t) {
                    if (null != kt) return kt;
                    var e = E(t, document.createTextNode("AخA")), n = O(e, 0, 1).getBoundingClientRect(),
                        o = O(e, 1, 2).getBoundingClientRect();
                    return P(t), !(!n || n.left == n.right) && (kt = o.right - n.right < 3)
                }

                var Dt, Lt = 3 != "\n\nb".split(/\n/).length ? function (t) {
                        for (var e = 0, n = [], o = t.length; e <= o;) {
                            var r = t.indexOf("\n", e);
                            -1 == r && (r = t.length);
                            var i = t.slice(e, "\r" == t.charAt(r - 1) ? r - 1 : r), a = i.indexOf("\r");
                            -1 != a ? (n.push(i.slice(0, a)), e += a + 1) : (n.push(i), e = r + 1)
                        }
                        return n
                    } : function (t) {
                        return t.split(/\r\n?|\n/)
                    }, It = window.getSelection ? function (t) {
                        try {
                            return t.selectionStart != t.selectionEnd
                        } catch (t) {
                            return !1
                        }
                    } : function (t) {
                        var e;
                        try {
                            e = t.ownerDocument.selection.createRange()
                        } catch (t) {
                        }
                        return !(!e || e.parentElement() != t) && 0 != e.compareEndPoints("StartToEnd", e)
                    },
                    Nt = "oncopy" in (Dt = k("div")) || (Dt.setAttribute("oncopy", "return;"), "function" == typeof Dt.oncopy),
                    Rt = null;

                function Vt(t) {
                    if (null != Rt) return Rt;
                    var e = E(t, k("span", "x")), n = e.getBoundingClientRect(), o = O(e, 0, 1).getBoundingClientRect();
                    return Rt = Math.abs(n.left - o.left) > 1
                }

                var Ft = {}, Ht = {};

                function Ut(t, e) {
                    arguments.length > 2 && (e.dependencies = Array.prototype.slice.call(arguments, 2)), Ft[t] = e
                }

                function zt(t, e) {
                    Ht[t] = e
                }

                function Bt(t) {
                    if ("string" == typeof t && Ht.hasOwnProperty(t)) t = Ht[t]; else if (t && "string" == typeof t.name && Ht.hasOwnProperty(t.name)) {
                        var e = Ht[t.name];
                        "string" == typeof e && (e = {name: e}), (t = Q(e, t)).name = e.name
                    } else {
                        if ("string" == typeof t && /^[\w\-]+\/[\w\-]+\+xml$/.test(t)) return Bt("application/xml");
                        if ("string" == typeof t && /^[\w\-]+\/[\w\-]+\+json$/.test(t)) return Bt("application/json")
                    }
                    return "string" == typeof t ? {name: t} : t || {name: "null"}
                }

                function Wt(t, e) {
                    e = Bt(e);
                    var n = Ft[e.name];
                    if (!n) return Wt(t, "text/plain");
                    var o = n(t, e);
                    if ($t.hasOwnProperty(e.name)) {
                        var r = $t[e.name];
                        for (var i in r) r.hasOwnProperty(i) && (o.hasOwnProperty(i) && (o["_" + i] = o[i]), o[i] = r[i])
                    }
                    if (o.name = e.name, e.helperType && (o.helperType = e.helperType), e.modeProps) for (var a in e.modeProps) o[a] = e.modeProps[a];
                    return o
                }

                var $t = {};

                function qt(t, e) {
                    R(e, $t.hasOwnProperty(t) ? $t[t] : $t[t] = {})
                }

                function Gt(t, e) {
                    if (!0 === e) return e;
                    if (t.copyState) return t.copyState(e);
                    var n = {};
                    for (var o in e) {
                        var r = e[o];
                        r instanceof Array && (r = r.concat([])), n[o] = r
                    }
                    return n
                }

                function Kt(t, e) {
                    for (var n; t.innerMode && (n = t.innerMode(e)) && n.mode != t;) e = n.state, t = n.mode;
                    return n || {mode: t, state: e}
                }

                function Yt(t, e, n) {
                    return !t.startState || t.startState(e, n)
                }

                var Xt = function (t, e, n) {
                    this.pos = this.start = 0, this.string = t, this.tabSize = e || 8, this.lastColumnPos = this.lastColumnValue = 0, this.lineStart = 0, this.lineOracle = n
                };

                function Jt(t, e) {
                    if ((e -= t.first) < 0 || e >= t.size) throw new Error("There is no line " + (e + t.first) + " in the document.");
                    for (var n = t; !n.lines;) for (var o = 0; ; ++o) {
                        var r = n.children[o], i = r.chunkSize();
                        if (e < i) {
                            n = r;
                            break
                        }
                        e -= i
                    }
                    return n.lines[e]
                }

                function Zt(t, e, n) {
                    var o = [], r = e.line;
                    return t.iter(e.line, n.line + 1, (function (t) {
                        var i = t.text;
                        r == n.line && (i = i.slice(0, n.ch)), r == e.line && (i = i.slice(e.ch)), o.push(i), ++r
                    })), o
                }

                function Qt(t, e, n) {
                    var o = [];
                    return t.iter(e, n, (function (t) {
                        o.push(t.text)
                    })), o
                }

                function te(t, e) {
                    var n = e - t.height;
                    if (n) for (var o = t; o; o = o.parent) o.height += n
                }

                function ee(t) {
                    if (null == t.parent) return null;
                    for (var e = t.parent, n = H(e.lines, t), o = e.parent; o; e = o, o = o.parent) for (var r = 0; o.children[r] != e; ++r) n += o.children[r].chunkSize();
                    return n + e.first
                }

                function ne(t, e) {
                    var n = t.first;
                    t:do {
                        for (var o = 0; o < t.children.length; ++o) {
                            var r = t.children[o], i = r.height;
                            if (e < i) {
                                t = r;
                                continue t
                            }
                            e -= i, n += r.chunkSize()
                        }
                        return n
                    } while (!t.lines);
                    for (var a = 0; a < t.lines.length; ++a) {
                        var s = t.lines[a].height;
                        if (e < s) break;
                        e -= s
                    }
                    return n + a
                }

                function oe(t, e) {
                    return e >= t.first && e < t.first + t.size
                }

                function re(t, e) {
                    return String(t.lineNumberFormatter(e + t.firstLineNumber))
                }

                function ie(t, e, n) {
                    if (void 0 === n && (n = null), !(this instanceof ie)) return new ie(t, e, n);
                    this.line = t, this.ch = e, this.sticky = n
                }

                function ae(t, e) {
                    return t.line - e.line || t.ch - e.ch
                }

                function se(t, e) {
                    return t.sticky == e.sticky && 0 == ae(t, e)
                }

                function le(t) {
                    return ie(t.line, t.ch)
                }

                function ce(t, e) {
                    return ae(t, e) < 0 ? e : t
                }

                function ue(t, e) {
                    return ae(t, e) < 0 ? t : e
                }

                function pe(t, e) {
                    return Math.max(t.first, Math.min(e, t.first + t.size - 1))
                }

                function de(t, e) {
                    if (e.line < t.first) return ie(t.first, 0);
                    var n = t.first + t.size - 1;
                    return e.line > n ? ie(n, Jt(t, n).text.length) : fe(e, Jt(t, e.line).text.length)
                }

                function fe(t, e) {
                    var n = t.ch;
                    return null == n || n > e ? ie(t.line, e) : n < 0 ? ie(t.line, 0) : t
                }

                function he(t, e) {
                    for (var n = [], o = 0; o < e.length; o++) n[o] = de(t, e[o]);
                    return n
                }

                Xt.prototype.eol = function () {
                    return this.pos >= this.string.length
                }, Xt.prototype.sol = function () {
                    return this.pos == this.lineStart
                }, Xt.prototype.peek = function () {
                    return this.string.charAt(this.pos) || void 0
                }, Xt.prototype.next = function () {
                    if (this.pos < this.string.length) return this.string.charAt(this.pos++)
                }, Xt.prototype.eat = function (t) {
                    var e = this.string.charAt(this.pos);
                    if ("string" == typeof t ? e == t : e && (t.test ? t.test(e) : t(e))) return ++this.pos, e
                }, Xt.prototype.eatWhile = function (t) {
                    for (var e = this.pos; this.eat(t);) ;
                    return this.pos > e
                }, Xt.prototype.eatSpace = function () {
                    for (var t = this.pos; /[\s\u00a0]/.test(this.string.charAt(this.pos));) ++this.pos;
                    return this.pos > t
                }, Xt.prototype.skipToEnd = function () {
                    this.pos = this.string.length
                }, Xt.prototype.skipTo = function (t) {
                    var e = this.string.indexOf(t, this.pos);
                    if (e > -1) return this.pos = e, !0
                }, Xt.prototype.backUp = function (t) {
                    this.pos -= t
                }, Xt.prototype.column = function () {
                    return this.lastColumnPos < this.start && (this.lastColumnValue = V(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue), this.lastColumnPos = this.start), this.lastColumnValue - (this.lineStart ? V(this.string, this.lineStart, this.tabSize) : 0)
                }, Xt.prototype.indentation = function () {
                    return V(this.string, null, this.tabSize) - (this.lineStart ? V(this.string, this.lineStart, this.tabSize) : 0)
                }, Xt.prototype.match = function (t, e, n) {
                    if ("string" != typeof t) {
                        var o = this.string.slice(this.pos).match(t);
                        return o && o.index > 0 ? null : (o && !1 !== e && (this.pos += o[0].length), o)
                    }
                    var r = function (t) {
                        return n ? t.toLowerCase() : t
                    };
                    if (r(this.string.substr(this.pos, t.length)) == r(t)) return !1 !== e && (this.pos += t.length), !0
                }, Xt.prototype.current = function () {
                    return this.string.slice(this.start, this.pos)
                }, Xt.prototype.hideFirstChars = function (t, e) {
                    this.lineStart += t;
                    try {
                        return e()
                    } finally {
                        this.lineStart -= t
                    }
                }, Xt.prototype.lookAhead = function (t) {
                    var e = this.lineOracle;
                    return e && e.lookAhead(t)
                }, Xt.prototype.baseToken = function () {
                    var t = this.lineOracle;
                    return t && t.baseToken(this.pos)
                };
                var ve = function (t, e) {
                    this.state = t, this.lookAhead = e
                }, ge = function (t, e, n, o) {
                    this.state = e, this.doc = t, this.line = n, this.maxLookAhead = o || 0, this.baseTokens = null, this.baseTokenPos = 1
                };

                function ye(t, e, n, o) {
                    var r = [t.state.modeGen], i = {};
                    Te(t, e.text, t.doc.mode, n, (function (t, e) {
                        return r.push(t, e)
                    }), i, o);
                    for (var a = n.state, s = function (o) {
                        n.baseTokens = r;
                        var s = t.state.overlays[o], l = 1, c = 0;
                        n.state = !0, Te(t, e.text, s.mode, n, (function (t, e) {
                            for (var n = l; c < t;) {
                                var o = r[l];
                                o > t && r.splice(l, 1, t, r[l + 1], o), l += 2, c = Math.min(t, o)
                            }
                            if (e) if (s.opaque) r.splice(n, l - n, t, "overlay " + e), l = n + 2; else for (; n < l; n += 2) {
                                var i = r[n + 1];
                                r[n + 1] = (i ? i + " " : "") + "overlay " + e
                            }
                        }), i), n.state = a, n.baseTokens = null, n.baseTokenPos = 1
                    }, l = 0; l < t.state.overlays.length; ++l) s(l);
                    return {styles: r, classes: i.bgClass || i.textClass ? i : null}
                }

                function me(t, e, n) {
                    if (!e.styles || e.styles[0] != t.state.modeGen) {
                        var o = be(t, ee(e)),
                            r = e.text.length > t.options.maxHighlightLength && Gt(t.doc.mode, o.state),
                            i = ye(t, e, o);
                        r && (o.state = r), e.stateAfter = o.save(!r), e.styles = i.styles, i.classes ? e.styleClasses = i.classes : e.styleClasses && (e.styleClasses = null), n === t.doc.highlightFrontier && (t.doc.modeFrontier = Math.max(t.doc.modeFrontier, ++t.doc.highlightFrontier))
                    }
                    return e.styles
                }

                function be(t, e, n) {
                    var o = t.doc, r = t.display;
                    if (!o.mode.startState) return new ge(o, !0, e);
                    var i = Pe(t, e, n), a = i > o.first && Jt(o, i - 1).stateAfter,
                        s = a ? ge.fromSaved(o, a, i) : new ge(o, Yt(o.mode), i);
                    return o.iter(i, e, (function (n) {
                        _e(t, n.text, s);
                        var o = s.line;
                        n.stateAfter = o == e - 1 || o % 5 == 0 || o >= r.viewFrom && o < r.viewTo ? s.save() : null, s.nextLine()
                    })), n && (o.modeFrontier = s.line), s
                }

                function _e(t, e, n, o) {
                    var r = t.doc.mode, i = new Xt(e, t.options.tabSize, n);
                    for (i.start = i.pos = o || 0, "" == e && we(r, n.state); !i.eol();) xe(r, i, n.state), i.start = i.pos
                }

                function we(t, e) {
                    if (t.blankLine) return t.blankLine(e);
                    if (t.innerMode) {
                        var n = Kt(t, e);
                        return n.mode.blankLine ? n.mode.blankLine(n.state) : void 0
                    }
                }

                function xe(t, e, n, o) {
                    for (var r = 0; r < 10; r++) {
                        o && (o[0] = Kt(t, n).mode);
                        var i = t.token(e, n);
                        if (e.pos > e.start) return i
                    }
                    throw new Error("Mode " + t.name + " failed to advance stream.")
                }

                ge.prototype.lookAhead = function (t) {
                    var e = this.doc.getLine(this.line + t);
                    return null != e && t > this.maxLookAhead && (this.maxLookAhead = t), e
                }, ge.prototype.baseToken = function (t) {
                    if (!this.baseTokens) return null;
                    for (; this.baseTokens[this.baseTokenPos] <= t;) this.baseTokenPos += 2;
                    var e = this.baseTokens[this.baseTokenPos + 1];
                    return {type: e && e.replace(/( |^)overlay .*/, ""), size: this.baseTokens[this.baseTokenPos] - t}
                }, ge.prototype.nextLine = function () {
                    this.line++, this.maxLookAhead > 0 && this.maxLookAhead--
                }, ge.fromSaved = function (t, e, n) {
                    return e instanceof ve ? new ge(t, Gt(t.mode, e.state), n, e.lookAhead) : new ge(t, Gt(t.mode, e), n)
                }, ge.prototype.save = function (t) {
                    var e = !1 !== t ? Gt(this.doc.mode, this.state) : this.state;
                    return this.maxLookAhead > 0 ? new ve(e, this.maxLookAhead) : e
                };
                var Ce = function (t, e, n) {
                    this.start = t.start, this.end = t.pos, this.string = t.current(), this.type = e || null, this.state = n
                };

                function Se(t, e, n, o) {
                    var r, i, a = t.doc, s = a.mode, l = Jt(a, (e = de(a, e)).line), c = be(t, e.line, n),
                        u = new Xt(l.text, t.options.tabSize, c);
                    for (o && (i = []); (o || u.pos < e.ch) && !u.eol();) u.start = u.pos, r = xe(s, u, c.state), o && i.push(new Ce(u, r, Gt(a.mode, c.state)));
                    return o ? i : new Ce(u, r, c.state)
                }

                function Oe(t, e) {
                    if (t) for (; ;) {
                        var n = t.match(/(?:^|\s+)line-(background-)?(\S+)/);
                        if (!n) break;
                        t = t.slice(0, n.index) + t.slice(n.index + n[0].length);
                        var o = n[1] ? "bgClass" : "textClass";
                        null == e[o] ? e[o] = n[2] : new RegExp("(?:^|\\s)" + n[2] + "(?:$|\\s)").test(e[o]) || (e[o] += " " + n[2])
                    }
                    return t
                }

                function Te(t, e, n, o, r, i, a) {
                    var s = n.flattenSpans;
                    null == s && (s = t.options.flattenSpans);
                    var l, c = 0, u = null, p = new Xt(e, t.options.tabSize, o), d = t.options.addModeClass && [null];
                    for ("" == e && Oe(we(n, o.state), i); !p.eol();) {
                        if (p.pos > t.options.maxHighlightLength ? (s = !1, a && _e(t, e, o, p.pos), p.pos = e.length, l = null) : l = Oe(xe(n, p, o.state, d), i), d) {
                            var f = d[0].name;
                            f && (l = "m-" + (l ? f + " " + l : f))
                        }
                        if (!s || u != l) {
                            for (; c < p.start;) r(c = Math.min(p.start, c + 5e3), u);
                            u = l
                        }
                        p.start = p.pos
                    }
                    for (; c < p.pos;) {
                        var h = Math.min(p.pos, c + 5e3);
                        r(h, u), c = h
                    }
                }

                function Pe(t, e, n) {
                    for (var o, r, i = t.doc, a = n ? -1 : e - (t.doc.mode.innerMode ? 1e3 : 100), s = e; s > a; --s) {
                        if (s <= i.first) return i.first;
                        var l = Jt(i, s - 1), c = l.stateAfter;
                        if (c && (!n || s + (c instanceof ve ? c.lookAhead : 0) <= i.modeFrontier)) return s;
                        var u = V(l.text, null, t.options.tabSize);
                        (null == r || o > u) && (r = s - 1, o = u)
                    }
                    return r
                }

                function Ee(t, e) {
                    if (t.modeFrontier = Math.min(t.modeFrontier, e), !(t.highlightFrontier < e - 10)) {
                        for (var n = t.first, o = e - 1; o > n; o--) {
                            var r = Jt(t, o).stateAfter;
                            if (r && (!(r instanceof ve) || o + r.lookAhead < e)) {
                                n = o + 1;
                                break
                            }
                        }
                        t.highlightFrontier = Math.min(t.highlightFrontier, n)
                    }
                }

                var ke = !1, Ae = !1;

                function je() {
                    ke = !0
                }

                function Me() {
                    Ae = !0
                }

                function De(t, e, n) {
                    this.marker = t, this.from = e, this.to = n
                }

                function Le(t, e) {
                    if (t) for (var n = 0; n < t.length; ++n) {
                        var o = t[n];
                        if (o.marker == e) return o
                    }
                }

                function Ie(t, e) {
                    for (var n, o = 0; o < t.length; ++o) t[o] != e && (n || (n = [])).push(t[o]);
                    return n
                }

                function Ne(t, e, n) {
                    var o = n && window.WeakSet && (n.markedSpans || (n.markedSpans = new WeakSet));
                    o && o.has(t.markedSpans) ? t.markedSpans.push(e) : (t.markedSpans = t.markedSpans ? t.markedSpans.concat([e]) : [e], o && o.add(t.markedSpans)), e.marker.attachLine(t)
                }

                function Re(t, e, n) {
                    var o;
                    if (t) for (var r = 0; r < t.length; ++r) {
                        var i = t[r], a = i.marker;
                        if (null == i.from || (a.inclusiveLeft ? i.from <= e : i.from < e) || i.from == e && "bookmark" == a.type && (!n || !i.marker.insertLeft)) {
                            var s = null == i.to || (a.inclusiveRight ? i.to >= e : i.to > e);
                            (o || (o = [])).push(new De(a, i.from, s ? null : i.to))
                        }
                    }
                    return o
                }

                function Ve(t, e, n) {
                    var o;
                    if (t) for (var r = 0; r < t.length; ++r) {
                        var i = t[r], a = i.marker;
                        if (null == i.to || (a.inclusiveRight ? i.to >= e : i.to > e) || i.from == e && "bookmark" == a.type && (!n || i.marker.insertLeft)) {
                            var s = null == i.from || (a.inclusiveLeft ? i.from <= e : i.from < e);
                            (o || (o = [])).push(new De(a, s ? null : i.from - e, null == i.to ? null : i.to - e))
                        }
                    }
                    return o
                }

                function Fe(t, e) {
                    if (e.full) return null;
                    var n = oe(t, e.from.line) && Jt(t, e.from.line).markedSpans,
                        o = oe(t, e.to.line) && Jt(t, e.to.line).markedSpans;
                    if (!n && !o) return null;
                    var r = e.from.ch, i = e.to.ch, a = 0 == ae(e.from, e.to), s = Re(n, r, a), l = Ve(o, i, a),
                        c = 1 == e.text.length, u = Y(e.text).length + (c ? r : 0);
                    if (s) for (var p = 0; p < s.length; ++p) {
                        var d = s[p];
                        if (null == d.to) {
                            var f = Le(l, d.marker);
                            f ? c && (d.to = null == f.to ? null : f.to + u) : d.to = r
                        }
                    }
                    if (l) for (var h = 0; h < l.length; ++h) {
                        var v = l[h];
                        null != v.to && (v.to += u), null == v.from ? Le(s, v.marker) || (v.from = u, c && (s || (s = [])).push(v)) : (v.from += u, c && (s || (s = [])).push(v))
                    }
                    s && (s = He(s)), l && l != s && (l = He(l));
                    var g = [s];
                    if (!c) {
                        var y, m = e.text.length - 2;
                        if (m > 0 && s) for (var b = 0; b < s.length; ++b) null == s[b].to && (y || (y = [])).push(new De(s[b].marker, null, null));
                        for (var _ = 0; _ < m; ++_) g.push(y);
                        g.push(l)
                    }
                    return g
                }

                function He(t) {
                    for (var e = 0; e < t.length; ++e) {
                        var n = t[e];
                        null != n.from && n.from == n.to && !1 !== n.marker.clearWhenEmpty && t.splice(e--, 1)
                    }
                    return t.length ? t : null
                }

                function Ue(t, e, n) {
                    var o = null;
                    if (t.iter(e.line, n.line + 1, (function (t) {
                        if (t.markedSpans) for (var e = 0; e < t.markedSpans.length; ++e) {
                            var n = t.markedSpans[e].marker;
                            !n.readOnly || o && -1 != H(o, n) || (o || (o = [])).push(n)
                        }
                    })), !o) return null;
                    for (var r = [{
                        from: e,
                        to: n
                    }], i = 0; i < o.length; ++i) for (var a = o[i], s = a.find(0), l = 0; l < r.length; ++l) {
                        var c = r[l];
                        if (!(ae(c.to, s.from) < 0 || ae(c.from, s.to) > 0)) {
                            var u = [l, 1], p = ae(c.from, s.from), d = ae(c.to, s.to);
                            (p < 0 || !a.inclusiveLeft && !p) && u.push({
                                from: c.from,
                                to: s.from
                            }), (d > 0 || !a.inclusiveRight && !d) && u.push({
                                from: s.to,
                                to: c.to
                            }), r.splice.apply(r, u), l += u.length - 3
                        }
                    }
                    return r
                }

                function ze(t) {
                    var e = t.markedSpans;
                    if (e) {
                        for (var n = 0; n < e.length; ++n) e[n].marker.detachLine(t);
                        t.markedSpans = null
                    }
                }

                function Be(t, e) {
                    if (e) {
                        for (var n = 0; n < e.length; ++n) e[n].marker.attachLine(t);
                        t.markedSpans = e
                    }
                }

                function We(t) {
                    return t.inclusiveLeft ? -1 : 0
                }

                function $e(t) {
                    return t.inclusiveRight ? 1 : 0
                }

                function qe(t, e) {
                    var n = t.lines.length - e.lines.length;
                    if (0 != n) return n;
                    var o = t.find(), r = e.find(), i = ae(o.from, r.from) || We(t) - We(e);
                    if (i) return -i;
                    var a = ae(o.to, r.to) || $e(t) - $e(e);
                    return a || e.id - t.id
                }

                function Ge(t, e) {
                    var n, o = Ae && t.markedSpans;
                    if (o) for (var r = void 0, i = 0; i < o.length; ++i) (r = o[i]).marker.collapsed && null == (e ? r.from : r.to) && (!n || qe(n, r.marker) < 0) && (n = r.marker);
                    return n
                }

                function Ke(t) {
                    return Ge(t, !0)
                }

                function Ye(t) {
                    return Ge(t, !1)
                }

                function Xe(t, e) {
                    var n, o = Ae && t.markedSpans;
                    if (o) for (var r = 0; r < o.length; ++r) {
                        var i = o[r];
                        i.marker.collapsed && (null == i.from || i.from < e) && (null == i.to || i.to > e) && (!n || qe(n, i.marker) < 0) && (n = i.marker)
                    }
                    return n
                }

                function Je(t, e, n, o, r) {
                    var i = Jt(t, e), a = Ae && i.markedSpans;
                    if (a) for (var s = 0; s < a.length; ++s) {
                        var l = a[s];
                        if (l.marker.collapsed) {
                            var c = l.marker.find(0), u = ae(c.from, n) || We(l.marker) - We(r),
                                p = ae(c.to, o) || $e(l.marker) - $e(r);
                            if (!(u >= 0 && p <= 0 || u <= 0 && p >= 0) && (u <= 0 && (l.marker.inclusiveRight && r.inclusiveLeft ? ae(c.to, n) >= 0 : ae(c.to, n) > 0) || u >= 0 && (l.marker.inclusiveRight && r.inclusiveLeft ? ae(c.from, o) <= 0 : ae(c.from, o) < 0))) return !0
                        }
                    }
                }

                function Ze(t) {
                    for (var e; e = Ke(t);) t = e.find(-1, !0).line;
                    return t
                }

                function Qe(t) {
                    for (var e; e = Ye(t);) t = e.find(1, !0).line;
                    return t
                }

                function tn(t) {
                    for (var e, n; e = Ye(t);) t = e.find(1, !0).line, (n || (n = [])).push(t);
                    return n
                }

                function en(t, e) {
                    var n = Jt(t, e), o = Ze(n);
                    return n == o ? e : ee(o)
                }

                function nn(t, e) {
                    if (e > t.lastLine()) return e;
                    var n, o = Jt(t, e);
                    if (!on(t, o)) return e;
                    for (; n = Ye(o);) o = n.find(1, !0).line;
                    return ee(o) + 1
                }

                function on(t, e) {
                    var n = Ae && e.markedSpans;
                    if (n) for (var o = void 0, r = 0; r < n.length; ++r) if ((o = n[r]).marker.collapsed) {
                        if (null == o.from) return !0;
                        if (!o.marker.widgetNode && 0 == o.from && o.marker.inclusiveLeft && rn(t, e, o)) return !0
                    }
                }

                function rn(t, e, n) {
                    if (null == n.to) {
                        var o = n.marker.find(1, !0);
                        return rn(t, o.line, Le(o.line.markedSpans, n.marker))
                    }
                    if (n.marker.inclusiveRight && n.to == e.text.length) return !0;
                    for (var r = void 0, i = 0; i < e.markedSpans.length; ++i) if ((r = e.markedSpans[i]).marker.collapsed && !r.marker.widgetNode && r.from == n.to && (null == r.to || r.to != n.from) && (r.marker.inclusiveLeft || n.marker.inclusiveRight) && rn(t, e, r)) return !0
                }

                function an(t) {
                    for (var e = 0, n = (t = Ze(t)).parent, o = 0; o < n.lines.length; ++o) {
                        var r = n.lines[o];
                        if (r == t) break;
                        e += r.height
                    }
                    for (var i = n.parent; i; i = (n = i).parent) for (var a = 0; a < i.children.length; ++a) {
                        var s = i.children[a];
                        if (s == n) break;
                        e += s.height
                    }
                    return e
                }

                function sn(t) {
                    if (0 == t.height) return 0;
                    for (var e, n = t.text.length, o = t; e = Ke(o);) {
                        var r = e.find(0, !0);
                        o = r.from.line, n += r.from.ch - r.to.ch
                    }
                    for (o = t; e = Ye(o);) {
                        var i = e.find(0, !0);
                        n -= o.text.length - i.from.ch, n += (o = i.to.line).text.length - i.to.ch
                    }
                    return n
                }

                function ln(t) {
                    var e = t.display, n = t.doc;
                    e.maxLine = Jt(n, n.first), e.maxLineLength = sn(e.maxLine), e.maxLineChanged = !0, n.iter((function (t) {
                        var n = sn(t);
                        n > e.maxLineLength && (e.maxLineLength = n, e.maxLine = t)
                    }))
                }

                var cn = function (t, e, n) {
                    this.text = t, Be(this, e), this.height = n ? n(this) : 1
                };

                function un(t, e, n, o) {
                    t.text = e, t.stateAfter && (t.stateAfter = null), t.styles && (t.styles = null), null != t.order && (t.order = null), ze(t), Be(t, n);
                    var r = o ? o(t) : 1;
                    r != t.height && te(t, r)
                }

                function pn(t) {
                    t.parent = null, ze(t)
                }

                cn.prototype.lineNo = function () {
                    return ee(this)
                }, wt(cn);
                var dn = {}, fn = {};

                function hn(t, e) {
                    if (!t || /^\s*$/.test(t)) return null;
                    var n = e.addModeClass ? fn : dn;
                    return n[t] || (n[t] = t.replace(/\S+/g, "cm-$&"))
                }

                function vn(t, e) {
                    var n = A("span", null, null, l ? "padding-right: .1px" : null), o = {
                        pre: A("pre", [n], "CodeMirror-line"),
                        content: n,
                        col: 0,
                        pos: 0,
                        cm: t,
                        trailingSpace: !1,
                        splitSpaces: t.getOption("lineWrapping")
                    };
                    e.measure = {};
                    for (var r = 0; r <= (e.rest ? e.rest.length : 0); r++) {
                        var i = r ? e.rest[r - 1] : e.line, a = void 0;
                        o.pos = 0, o.addToken = yn, Mt(t.display.measure) && (a = dt(i, t.doc.direction)) && (o.addToken = bn(o.addToken, a)), o.map = [], wn(i, o, me(t, i, e != t.display.externalMeasured && ee(i))), i.styleClasses && (i.styleClasses.bgClass && (o.bgClass = L(i.styleClasses.bgClass, o.bgClass || "")), i.styleClasses.textClass && (o.textClass = L(i.styleClasses.textClass, o.textClass || ""))), 0 == o.map.length && o.map.push(0, 0, o.content.appendChild(jt(t.display.measure))), 0 == r ? (e.measure.map = o.map, e.measure.cache = {}) : ((e.measure.maps || (e.measure.maps = [])).push(o.map), (e.measure.caches || (e.measure.caches = [])).push({}))
                    }
                    if (l) {
                        var s = o.content.lastChild;
                        (/\bcm-tab\b/.test(s.className) || s.querySelector && s.querySelector(".cm-tab")) && (o.content.className = "cm-tab-wrap-hack")
                    }
                    return yt(t, "renderLine", t, e.line, o.pre), o.pre.className && (o.textClass = L(o.pre.className, o.textClass || "")), o
                }

                function gn(t) {
                    var e = k("span", "•", "cm-invalidchar");
                    return e.title = "\\u" + t.charCodeAt(0).toString(16), e.setAttribute("aria-label", e.title), e
                }

                function yn(t, e, n, o, r, i, l) {
                    if (e) {
                        var c, u = t.splitSpaces ? mn(e, t.trailingSpace) : e, p = t.cm.state.specialChars, d = !1;
                        if (p.test(e)) {
                            c = document.createDocumentFragment();
                            for (var f = 0; 1;) {
                                p.lastIndex = f;
                                var h = p.exec(e), v = h ? h.index - f : e.length - f;
                                if (v) {
                                    var g = document.createTextNode(u.slice(f, f + v));
                                    a && s < 9 ? c.appendChild(k("span", [g])) : c.appendChild(g), t.map.push(t.pos, t.pos + v, g), t.col += v, t.pos += v
                                }
                                if (!h) break;
                                f += v + 1;
                                var y = void 0;
                                if ("\t" == h[0]) {
                                    var m = t.cm.options.tabSize, b = m - t.col % m;
                                    (y = c.appendChild(k("span", K(b), "cm-tab"))).setAttribute("role", "presentation"), y.setAttribute("cm-text", "\t"), t.col += b
                                } else "\r" == h[0] || "\n" == h[0] ? ((y = c.appendChild(k("span", "\r" == h[0] ? "␍" : "␤", "cm-invalidchar"))).setAttribute("cm-text", h[0]), t.col += 1) : ((y = t.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text", h[0]), a && s < 9 ? c.appendChild(k("span", [y])) : c.appendChild(y), t.col += 1);
                                t.map.push(t.pos, t.pos + 1, y), t.pos++
                            }
                        } else t.col += e.length, c = document.createTextNode(u), t.map.push(t.pos, t.pos + e.length, c), a && s < 9 && (d = !0), t.pos += e.length;
                        if (t.trailingSpace = 32 == u.charCodeAt(e.length - 1), n || o || r || d || i || l) {
                            var _ = n || "";
                            o && (_ += o), r && (_ += r);
                            var w = k("span", [c], _, i);
                            if (l) for (var x in l) l.hasOwnProperty(x) && "style" != x && "class" != x && w.setAttribute(x, l[x]);
                            return t.content.appendChild(w)
                        }
                        t.content.appendChild(c)
                    }
                }

                function mn(t, e) {
                    if (t.length > 1 && !/  /.test(t)) return t;
                    for (var n = e, o = "", r = 0; r < t.length; r++) {
                        var i = t.charAt(r);
                        " " != i || !n || r != t.length - 1 && 32 != t.charCodeAt(r + 1) || (i = " "), o += i, n = " " == i
                    }
                    return o
                }

                function bn(t, e) {
                    return function (n, o, r, i, a, s, l) {
                        r = r ? r + " cm-force-border" : "cm-force-border";
                        for (var c = n.pos, u = c + o.length; ;) {
                            for (var p = void 0, d = 0; d < e.length && !((p = e[d]).to > c && p.from <= c); d++) ;
                            if (p.to >= u) return t(n, o, r, i, a, s, l);
                            t(n, o.slice(0, p.to - c), r, i, null, s, l), i = null, o = o.slice(p.to - c), c = p.to
                        }
                    }
                }

                function _n(t, e, n, o) {
                    var r = !o && n.widgetNode;
                    r && t.map.push(t.pos, t.pos + e, r), !o && t.cm.display.input.needsContentAttribute && (r || (r = t.content.appendChild(document.createElement("span"))), r.setAttribute("cm-marker", n.id)), r && (t.cm.display.input.setUneditable(r), t.content.appendChild(r)), t.pos += e, t.trailingSpace = !1
                }

                function wn(t, e, n) {
                    var o = t.markedSpans, r = t.text, i = 0;
                    if (o) for (var a, s, l, c, u, p, d, f = r.length, h = 0, v = 1, g = "", y = 0; ;) {
                        if (y == h) {
                            l = c = u = s = "", d = null, p = null, y = 1 / 0;
                            for (var m = [], b = void 0, _ = 0; _ < o.length; ++_) {
                                var w = o[_], x = w.marker;
                                if ("bookmark" == x.type && w.from == h && x.widgetNode) m.push(x); else if (w.from <= h && (null == w.to || w.to > h || x.collapsed && w.to == h && w.from == h)) {
                                    if (null != w.to && w.to != h && y > w.to && (y = w.to, c = ""), x.className && (l += " " + x.className), x.css && (s = (s ? s + ";" : "") + x.css), x.startStyle && w.from == h && (u += " " + x.startStyle), x.endStyle && w.to == y && (b || (b = [])).push(x.endStyle, w.to), x.title && ((d || (d = {})).title = x.title), x.attributes) for (var C in x.attributes) (d || (d = {}))[C] = x.attributes[C];
                                    x.collapsed && (!p || qe(p.marker, x) < 0) && (p = w)
                                } else w.from > h && y > w.from && (y = w.from)
                            }
                            if (b) for (var S = 0; S < b.length; S += 2) b[S + 1] == y && (c += " " + b[S]);
                            if (!p || p.from == h) for (var O = 0; O < m.length; ++O) _n(e, 0, m[O]);
                            if (p && (p.from || 0) == h) {
                                if (_n(e, (null == p.to ? f + 1 : p.to) - h, p.marker, null == p.from), null == p.to) return;
                                p.to == h && (p = !1)
                            }
                        }
                        if (h >= f) break;
                        for (var T = Math.min(f, y); 1;) {
                            if (g) {
                                var P = h + g.length;
                                if (!p) {
                                    var E = P > T ? g.slice(0, T - h) : g;
                                    e.addToken(e, E, a ? a + l : l, u, h + E.length == y ? c : "", s, d)
                                }
                                if (P >= T) {
                                    g = g.slice(T - h), h = T;
                                    break
                                }
                                h = P, u = ""
                            }
                            g = r.slice(i, i = n[v++]), a = hn(n[v++], e.cm.options)
                        }
                    } else for (var k = 1; k < n.length; k += 2) e.addToken(e, r.slice(i, i = n[k]), hn(n[k + 1], e.cm.options))
                }

                function xn(t, e, n) {
                    this.line = e, this.rest = tn(e), this.size = this.rest ? ee(Y(this.rest)) - n + 1 : 1, this.node = this.text = null, this.hidden = on(t, e)
                }

                function Cn(t, e, n) {
                    for (var o, r = [], i = e; i < n; i = o) {
                        var a = new xn(t.doc, Jt(t.doc, i), i);
                        o = i + a.size, r.push(a)
                    }
                    return r
                }

                var Sn = null;

                function On(t) {
                    Sn ? Sn.ops.push(t) : t.ownsGroup = Sn = {ops: [t], delayedCallbacks: []}
                }

                function Tn(t) {
                    var e = t.delayedCallbacks, n = 0;
                    do {
                        for (; n < e.length; n++) e[n].call(null);
                        for (var o = 0; o < t.ops.length; o++) {
                            var r = t.ops[o];
                            if (r.cursorActivityHandlers) for (; r.cursorActivityCalled < r.cursorActivityHandlers.length;) r.cursorActivityHandlers[r.cursorActivityCalled++].call(null, r.cm)
                        }
                    } while (n < e.length)
                }

                function Pn(t, e) {
                    var n = t.ownsGroup;
                    if (n) try {
                        Tn(n)
                    } finally {
                        Sn = null, e(n)
                    }
                }

                var En = null;

                function kn(t, e) {
                    var n = vt(t, e);
                    if (n.length) {
                        var o, r = Array.prototype.slice.call(arguments, 2);
                        Sn ? o = Sn.delayedCallbacks : En ? o = En : (o = En = [], setTimeout(An, 0));
                        for (var i = function (t) {
                            o.push((function () {
                                return n[t].apply(null, r)
                            }))
                        }, a = 0; a < n.length; ++a) i(a)
                    }
                }

                function An() {
                    var t = En;
                    En = null;
                    for (var e = 0; e < t.length; ++e) t[e]()
                }

                function jn(t, e, n, o) {
                    for (var r = 0; r < e.changes.length; r++) {
                        var i = e.changes[r];
                        "text" == i ? In(t, e) : "gutter" == i ? Rn(t, e, n, o) : "class" == i ? Nn(t, e) : "widget" == i && Vn(t, e, o)
                    }
                    e.changes = null
                }

                function Mn(t) {
                    return t.node == t.text && (t.node = k("div", null, null, "position: relative"), t.text.parentNode && t.text.parentNode.replaceChild(t.node, t.text), t.node.appendChild(t.text), a && s < 8 && (t.node.style.zIndex = 2)), t.node
                }

                function Dn(t, e) {
                    var n = e.bgClass ? e.bgClass + " " + (e.line.bgClass || "") : e.line.bgClass;
                    if (n && (n += " CodeMirror-linebackground"), e.background) n ? e.background.className = n : (e.background.parentNode.removeChild(e.background), e.background = null); else if (n) {
                        var o = Mn(e);
                        e.background = o.insertBefore(k("div", null, n), o.firstChild), t.display.input.setUneditable(e.background)
                    }
                }

                function Ln(t, e) {
                    var n = t.display.externalMeasured;
                    return n && n.line == e.line ? (t.display.externalMeasured = null, e.measure = n.measure, n.built) : vn(t, e)
                }

                function In(t, e) {
                    var n = e.text.className, o = Ln(t, e);
                    e.text == e.node && (e.node = o.pre), e.text.parentNode.replaceChild(o.pre, e.text), e.text = o.pre, o.bgClass != e.bgClass || o.textClass != e.textClass ? (e.bgClass = o.bgClass, e.textClass = o.textClass, Nn(t, e)) : n && (e.text.className = n)
                }

                function Nn(t, e) {
                    Dn(t, e), e.line.wrapClass ? Mn(e).className = e.line.wrapClass : e.node != e.text && (e.node.className = "");
                    var n = e.textClass ? e.textClass + " " + (e.line.textClass || "") : e.line.textClass;
                    e.text.className = n || ""
                }

                function Rn(t, e, n, o) {
                    if (e.gutter && (e.node.removeChild(e.gutter), e.gutter = null), e.gutterBackground && (e.node.removeChild(e.gutterBackground), e.gutterBackground = null), e.line.gutterClass) {
                        var r = Mn(e);
                        e.gutterBackground = k("div", null, "CodeMirror-gutter-background " + e.line.gutterClass, "left: " + (t.options.fixedGutter ? o.fixedPos : -o.gutterTotalWidth) + "px; width: " + o.gutterTotalWidth + "px"), t.display.input.setUneditable(e.gutterBackground), r.insertBefore(e.gutterBackground, e.text)
                    }
                    var i = e.line.gutterMarkers;
                    if (t.options.lineNumbers || i) {
                        var a = Mn(e),
                            s = e.gutter = k("div", null, "CodeMirror-gutter-wrapper", "left: " + (t.options.fixedGutter ? o.fixedPos : -o.gutterTotalWidth) + "px");
                        if (s.setAttribute("aria-hidden", "true"), t.display.input.setUneditable(s), a.insertBefore(s, e.text), e.line.gutterClass && (s.className += " " + e.line.gutterClass), !t.options.lineNumbers || i && i["CodeMirror-linenumbers"] || (e.lineNumber = s.appendChild(k("div", re(t.options, n), "CodeMirror-linenumber CodeMirror-gutter-elt", "left: " + o.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + t.display.lineNumInnerWidth + "px"))), i) for (var l = 0; l < t.display.gutterSpecs.length; ++l) {
                            var c = t.display.gutterSpecs[l].className, u = i.hasOwnProperty(c) && i[c];
                            u && s.appendChild(k("div", [u], "CodeMirror-gutter-elt", "left: " + o.gutterLeft[c] + "px; width: " + o.gutterWidth[c] + "px"))
                        }
                    }
                }

                function Vn(t, e, n) {
                    e.alignable && (e.alignable = null);
                    for (var o = S("CodeMirror-linewidget"), r = e.node.firstChild, i = void 0; r; r = i) i = r.nextSibling, o.test(r.className) && e.node.removeChild(r);
                    Hn(t, e, n)
                }

                function Fn(t, e, n, o) {
                    var r = Ln(t, e);
                    return e.text = e.node = r.pre, r.bgClass && (e.bgClass = r.bgClass), r.textClass && (e.textClass = r.textClass), Nn(t, e), Rn(t, e, n, o), Hn(t, e, o), e.node
                }

                function Hn(t, e, n) {
                    if (Un(t, e.line, e, n, !0), e.rest) for (var o = 0; o < e.rest.length; o++) Un(t, e.rest[o], e, n, !1)
                }

                function Un(t, e, n, o, r) {
                    if (e.widgets) for (var i = Mn(n), a = 0, s = e.widgets; a < s.length; ++a) {
                        var l = s[a],
                            c = k("div", [l.node], "CodeMirror-linewidget" + (l.className ? " " + l.className : ""));
                        l.handleMouseEvents || c.setAttribute("cm-ignore-events", "true"), zn(l, c, n, o), t.display.input.setUneditable(c), r && l.above ? i.insertBefore(c, n.gutter || n.text) : i.appendChild(c), kn(l, "redraw")
                    }
                }

                function zn(t, e, n, o) {
                    if (t.noHScroll) {
                        (n.alignable || (n.alignable = [])).push(e);
                        var r = o.wrapperWidth;
                        e.style.left = o.fixedPos + "px", t.coverGutter || (r -= o.gutterTotalWidth, e.style.paddingLeft = o.gutterTotalWidth + "px"), e.style.width = r + "px"
                    }
                    t.coverGutter && (e.style.zIndex = 5, e.style.position = "relative", t.noHScroll || (e.style.marginLeft = -o.gutterTotalWidth + "px"))
                }

                function Bn(t) {
                    if (null != t.height) return t.height;
                    var e = t.doc.cm;
                    if (!e) return 0;
                    if (!j(document.body, t.node)) {
                        var n = "position: relative;";
                        t.coverGutter && (n += "margin-left: -" + e.display.gutters.offsetWidth + "px;"), t.noHScroll && (n += "width: " + e.display.wrapper.clientWidth + "px;"), E(e.display.measure, k("div", [t.node], null, n))
                    }
                    return t.height = t.node.parentNode.offsetHeight
                }

                function Wn(t, e) {
                    for (var n = Tt(e); n != t.wrapper; n = n.parentNode) if (!n || 1 == n.nodeType && "true" == n.getAttribute("cm-ignore-events") || n.parentNode == t.sizer && n != t.mover) return !0
                }

                function $n(t) {
                    return t.lineSpace.offsetTop
                }

                function qn(t) {
                    return t.mover.offsetHeight - t.lineSpace.offsetHeight
                }

                function Gn(t) {
                    if (t.cachedPaddingH) return t.cachedPaddingH;
                    var e = E(t.measure, k("pre", "x", "CodeMirror-line-like")),
                        n = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle,
                        o = {left: parseInt(n.paddingLeft), right: parseInt(n.paddingRight)};
                    return isNaN(o.left) || isNaN(o.right) || (t.cachedPaddingH = o), o
                }

                function Kn(t) {
                    return U - t.display.nativeBarWidth
                }

                function Yn(t) {
                    return t.display.scroller.clientWidth - Kn(t) - t.display.barWidth
                }

                function Xn(t) {
                    return t.display.scroller.clientHeight - Kn(t) - t.display.barHeight
                }

                function Jn(t, e, n) {
                    var o = t.options.lineWrapping, r = o && Yn(t);
                    if (!e.measure.heights || o && e.measure.width != r) {
                        var i = e.measure.heights = [];
                        if (o) {
                            e.measure.width = r;
                            for (var a = e.text.firstChild.getClientRects(), s = 0; s < a.length - 1; s++) {
                                var l = a[s], c = a[s + 1];
                                Math.abs(l.bottom - c.bottom) > 2 && i.push((l.bottom + c.top) / 2 - n.top)
                            }
                        }
                        i.push(n.bottom - n.top)
                    }
                }

                function Zn(t, e, n) {
                    if (t.line == e) return {map: t.measure.map, cache: t.measure.cache};
                    for (var o = 0; o < t.rest.length; o++) if (t.rest[o] == e) return {
                        map: t.measure.maps[o],
                        cache: t.measure.caches[o]
                    };
                    for (var r = 0; r < t.rest.length; r++) if (ee(t.rest[r]) > n) return {
                        map: t.measure.maps[r],
                        cache: t.measure.caches[r],
                        before: !0
                    }
                }

                function Qn(t, e) {
                    var n = ee(e = Ze(e)), o = t.display.externalMeasured = new xn(t.doc, e, n);
                    o.lineN = n;
                    var r = o.built = vn(t, o);
                    return o.text = r.pre, E(t.display.lineMeasure, r.pre), o
                }

                function to(t, e, n, o) {
                    return oo(t, no(t, e), n, o)
                }

                function eo(t, e) {
                    if (e >= t.display.viewFrom && e < t.display.viewTo) return t.display.view[Ro(t, e)];
                    var n = t.display.externalMeasured;
                    return n && e >= n.lineN && e < n.lineN + n.size ? n : void 0
                }

                function no(t, e) {
                    var n = ee(e), o = eo(t, n);
                    o && !o.text ? o = null : o && o.changes && (jn(t, o, n, Mo(t)), t.curOp.forceUpdate = !0), o || (o = Qn(t, e));
                    var r = Zn(o, e, n);
                    return {line: e, view: o, rect: null, map: r.map, cache: r.cache, before: r.before, hasHeights: !1}
                }

                function oo(t, e, n, o, r) {
                    e.before && (n = -1);
                    var i, a = n + (o || "");
                    return e.cache.hasOwnProperty(a) ? i = e.cache[a] : (e.rect || (e.rect = e.view.text.getBoundingClientRect()), e.hasHeights || (Jn(t, e.view, e.rect), e.hasHeights = !0), (i = lo(t, e, n, o)).bogus || (e.cache[a] = i)), {
                        left: i.left,
                        right: i.right,
                        top: r ? i.rtop : i.top,
                        bottom: r ? i.rbottom : i.bottom
                    }
                }

                var ro, io = {left: 0, right: 0, top: 0, bottom: 0};

                function ao(t, e, n) {
                    for (var o, r, i, a, s, l, c = 0; c < t.length; c += 3) if (s = t[c], l = t[c + 1], e < s ? (r = 0, i = 1, a = "left") : e < l ? i = (r = e - s) + 1 : (c == t.length - 3 || e == l && t[c + 3] > e) && (r = (i = l - s) - 1, e >= l && (a = "right")), null != r) {
                        if (o = t[c + 2], s == l && n == (o.insertLeft ? "left" : "right") && (a = n), "left" == n && 0 == r) for (; c && t[c - 2] == t[c - 3] && t[c - 1].insertLeft;) o = t[(c -= 3) + 2], a = "left";
                        if ("right" == n && r == l - s) for (; c < t.length - 3 && t[c + 3] == t[c + 4] && !t[c + 5].insertLeft;) o = t[(c += 3) + 2], a = "right";
                        break
                    }
                    return {node: o, start: r, end: i, collapse: a, coverStart: s, coverEnd: l}
                }

                function so(t, e) {
                    var n = io;
                    if ("left" == e) for (var o = 0; o < t.length && (n = t[o]).left == n.right; o++) ; else for (var r = t.length - 1; r >= 0 && (n = t[r]).left == n.right; r--) ;
                    return n
                }

                function lo(t, e, n, o) {
                    var r, i = ao(e.map, n, o), l = i.node, c = i.start, u = i.end, p = i.collapse;
                    if (3 == l.nodeType) {
                        for (var d = 0; d < 4; d++) {
                            for (; c && it(e.line.text.charAt(i.coverStart + c));) --c;
                            for (; i.coverStart + u < i.coverEnd && it(e.line.text.charAt(i.coverStart + u));) ++u;
                            if ((r = a && s < 9 && 0 == c && u == i.coverEnd - i.coverStart ? l.parentNode.getBoundingClientRect() : so(O(l, c, u).getClientRects(), o)).left || r.right || 0 == c) break;
                            u = c, c -= 1, p = "right"
                        }
                        a && s < 11 && (r = co(t.display.measure, r))
                    } else {
                        var f;
                        c > 0 && (p = o = "right"), r = t.options.lineWrapping && (f = l.getClientRects()).length > 1 ? f["right" == o ? f.length - 1 : 0] : l.getBoundingClientRect()
                    }
                    if (a && s < 9 && !c && (!r || !r.left && !r.right)) {
                        var h = l.parentNode.getClientRects()[0];
                        r = h ? {left: h.left, right: h.left + jo(t.display), top: h.top, bottom: h.bottom} : io
                    }
                    for (var v = r.top - e.rect.top, g = r.bottom - e.rect.top, y = (v + g) / 2, m = e.view.measure.heights, b = 0; b < m.length - 1 && !(y < m[b]); b++) ;
                    var _ = b ? m[b - 1] : 0, w = m[b], x = {
                        left: ("right" == p ? r.right : r.left) - e.rect.left,
                        right: ("left" == p ? r.left : r.right) - e.rect.left,
                        top: _,
                        bottom: w
                    };
                    return r.left || r.right || (x.bogus = !0), t.options.singleCursorHeightPerLine || (x.rtop = v, x.rbottom = g), x
                }

                function co(t, e) {
                    if (!window.screen || null == screen.logicalXDPI || screen.logicalXDPI == screen.deviceXDPI || !Vt(t)) return e;
                    var n = screen.logicalXDPI / screen.deviceXDPI, o = screen.logicalYDPI / screen.deviceYDPI;
                    return {left: e.left * n, right: e.right * n, top: e.top * o, bottom: e.bottom * o}
                }

                function uo(t) {
                    if (t.measure && (t.measure.cache = {}, t.measure.heights = null, t.rest)) for (var e = 0; e < t.rest.length; e++) t.measure.caches[e] = {}
                }

                function po(t) {
                    t.display.externalMeasure = null, P(t.display.lineMeasure);
                    for (var e = 0; e < t.display.view.length; e++) uo(t.display.view[e])
                }

                function fo(t) {
                    po(t), t.display.cachedCharWidth = t.display.cachedTextHeight = t.display.cachedPaddingH = null, t.options.lineWrapping || (t.display.maxLineChanged = !0), t.display.lineNumChars = null
                }

                function ho() {
                    return u && g ? -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) : window.pageXOffset || (document.documentElement || document.body).scrollLeft
                }

                function vo() {
                    return u && g ? -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) : window.pageYOffset || (document.documentElement || document.body).scrollTop
                }

                function go(t) {
                    var e = 0;
                    if (t.widgets) for (var n = 0; n < t.widgets.length; ++n) t.widgets[n].above && (e += Bn(t.widgets[n]));
                    return e
                }

                function yo(t, e, n, o, r) {
                    if (!r) {
                        var i = go(e);
                        n.top += i, n.bottom += i
                    }
                    if ("line" == o) return n;
                    o || (o = "local");
                    var a = an(e);
                    if ("local" == o ? a += $n(t.display) : a -= t.display.viewOffset, "page" == o || "window" == o) {
                        var s = t.display.lineSpace.getBoundingClientRect();
                        a += s.top + ("window" == o ? 0 : vo());
                        var l = s.left + ("window" == o ? 0 : ho());
                        n.left += l, n.right += l
                    }
                    return n.top += a, n.bottom += a, n
                }

                function mo(t, e, n) {
                    if ("div" == n) return e;
                    var o = e.left, r = e.top;
                    if ("page" == n) o -= ho(), r -= vo(); else if ("local" == n || !n) {
                        var i = t.display.sizer.getBoundingClientRect();
                        o += i.left, r += i.top
                    }
                    var a = t.display.lineSpace.getBoundingClientRect();
                    return {left: o - a.left, top: r - a.top}
                }

                function bo(t, e, n, o, r) {
                    return o || (o = Jt(t.doc, e.line)), yo(t, o, to(t, o, e.ch, r), n)
                }

                function _o(t, e, n, o, r, i) {
                    function a(e, a) {
                        var s = oo(t, r, e, a ? "right" : "left", i);
                        return a ? s.left = s.right : s.right = s.left, yo(t, o, s, n)
                    }

                    o = o || Jt(t.doc, e.line), r || (r = no(t, o));
                    var s = dt(o, t.doc.direction), l = e.ch, c = e.sticky;
                    if (l >= o.text.length ? (l = o.text.length, c = "before") : l <= 0 && (l = 0, c = "after"), !s) return a("before" == c ? l - 1 : l, "before" == c);

                    function u(t, e, n) {
                        return a(n ? t - 1 : t, 1 == s[e].level != n)
                    }

                    var p = ut(s, l, c), d = ct, f = u(l, p, "before" == c);
                    return null != d && (f.other = u(l, d, "before" != c)), f
                }

                function wo(t, e) {
                    var n = 0;
                    e = de(t.doc, e), t.options.lineWrapping || (n = jo(t.display) * e.ch);
                    var o = Jt(t.doc, e.line), r = an(o) + $n(t.display);
                    return {left: n, right: n, top: r, bottom: r + o.height}
                }

                function xo(t, e, n, o, r) {
                    var i = ie(t, e, n);
                    return i.xRel = r, o && (i.outside = o), i
                }

                function Co(t, e, n) {
                    var o = t.doc;
                    if ((n += t.display.viewOffset) < 0) return xo(o.first, 0, null, -1, -1);
                    var r = ne(o, n), i = o.first + o.size - 1;
                    if (r > i) return xo(o.first + o.size - 1, Jt(o, i).text.length, null, 1, 1);
                    e < 0 && (e = 0);
                    for (var a = Jt(o, r); ;) {
                        var s = Po(t, a, r, e, n), l = Xe(a, s.ch + (s.xRel > 0 || s.outside > 0 ? 1 : 0));
                        if (!l) return s;
                        var c = l.find(1);
                        if (c.line == r) return c;
                        a = Jt(o, r = c.line)
                    }
                }

                function So(t, e, n, o) {
                    o -= go(e);
                    var r = e.text.length, i = st((function (e) {
                        return oo(t, n, e - 1).bottom <= o
                    }), r, 0);
                    return {
                        begin: i, end: r = st((function (e) {
                            return oo(t, n, e).top > o
                        }), i, r)
                    }
                }

                function Oo(t, e, n, o) {
                    return n || (n = no(t, e)), So(t, e, n, yo(t, e, oo(t, n, o), "line").top)
                }

                function To(t, e, n, o) {
                    return !(t.bottom <= n) && (t.top > n || (o ? t.left : t.right) > e)
                }

                function Po(t, e, n, o, r) {
                    r -= an(e);
                    var i = no(t, e), a = go(e), s = 0, l = e.text.length, c = !0, u = dt(e, t.doc.direction);
                    if (u) {
                        var p = (t.options.lineWrapping ? ko : Eo)(t, e, n, i, u, o, r);
                        s = (c = 1 != p.level) ? p.from : p.to - 1, l = c ? p.to : p.from - 1
                    }
                    var d, f, h = null, v = null, g = st((function (e) {
                        var n = oo(t, i, e);
                        return n.top += a, n.bottom += a, !!To(n, o, r, !1) && (n.top <= r && n.left <= o && (h = e, v = n), !0)
                    }), s, l), y = !1;
                    if (v) {
                        var m = o - v.left < v.right - o, b = m == c;
                        g = h + (b ? 0 : 1), f = b ? "after" : "before", d = m ? v.left : v.right
                    } else {
                        c || g != l && g != s || g++, f = 0 == g ? "after" : g == e.text.length ? "before" : oo(t, i, g - (c ? 1 : 0)).bottom + a <= r == c ? "after" : "before";
                        var _ = _o(t, ie(n, g, f), "line", e, i);
                        d = _.left, y = r < _.top ? -1 : r >= _.bottom ? 1 : 0
                    }
                    return xo(n, g = at(e.text, g, 1), f, y, o - d)
                }

                function Eo(t, e, n, o, r, i, a) {
                    var s = st((function (s) {
                        var l = r[s], c = 1 != l.level;
                        return To(_o(t, ie(n, c ? l.to : l.from, c ? "before" : "after"), "line", e, o), i, a, !0)
                    }), 0, r.length - 1), l = r[s];
                    if (s > 0) {
                        var c = 1 != l.level, u = _o(t, ie(n, c ? l.from : l.to, c ? "after" : "before"), "line", e, o);
                        To(u, i, a, !0) && u.top > a && (l = r[s - 1])
                    }
                    return l
                }

                function ko(t, e, n, o, r, i, a) {
                    var s = So(t, e, o, a), l = s.begin, c = s.end;
                    /\s/.test(e.text.charAt(c - 1)) && c--;
                    for (var u = null, p = null, d = 0; d < r.length; d++) {
                        var f = r[d];
                        if (!(f.from >= c || f.to <= l)) {
                            var h = oo(t, o, 1 != f.level ? Math.min(c, f.to) - 1 : Math.max(l, f.from)).right,
                                v = h < i ? i - h + 1e9 : h - i;
                            (!u || p > v) && (u = f, p = v)
                        }
                    }
                    return u || (u = r[r.length - 1]), u.from < l && (u = {
                        from: l,
                        to: u.to,
                        level: u.level
                    }), u.to > c && (u = {from: u.from, to: c, level: u.level}), u
                }

                function Ao(t) {
                    if (null != t.cachedTextHeight) return t.cachedTextHeight;
                    if (null == ro) {
                        ro = k("pre", null, "CodeMirror-line-like");
                        for (var e = 0; e < 49; ++e) ro.appendChild(document.createTextNode("x")), ro.appendChild(k("br"));
                        ro.appendChild(document.createTextNode("x"))
                    }
                    E(t.measure, ro);
                    var n = ro.offsetHeight / 50;
                    return n > 3 && (t.cachedTextHeight = n), P(t.measure), n || 1
                }

                function jo(t) {
                    if (null != t.cachedCharWidth) return t.cachedCharWidth;
                    var e = k("span", "xxxxxxxxxx"), n = k("pre", [e], "CodeMirror-line-like");
                    E(t.measure, n);
                    var o = e.getBoundingClientRect(), r = (o.right - o.left) / 10;
                    return r > 2 && (t.cachedCharWidth = r), r || 10
                }

                function Mo(t) {
                    for (var e = t.display, n = {}, o = {}, r = e.gutters.clientLeft, i = e.gutters.firstChild, a = 0; i; i = i.nextSibling, ++a) {
                        var s = t.display.gutterSpecs[a].className;
                        n[s] = i.offsetLeft + i.clientLeft + r, o[s] = i.clientWidth
                    }
                    return {
                        fixedPos: Do(e),
                        gutterTotalWidth: e.gutters.offsetWidth,
                        gutterLeft: n,
                        gutterWidth: o,
                        wrapperWidth: e.wrapper.clientWidth
                    }
                }

                function Do(t) {
                    return t.scroller.getBoundingClientRect().left - t.sizer.getBoundingClientRect().left
                }

                function Lo(t) {
                    var e = Ao(t.display), n = t.options.lineWrapping,
                        o = n && Math.max(5, t.display.scroller.clientWidth / jo(t.display) - 3);
                    return function (r) {
                        if (on(t.doc, r)) return 0;
                        var i = 0;
                        if (r.widgets) for (var a = 0; a < r.widgets.length; a++) r.widgets[a].height && (i += r.widgets[a].height);
                        return n ? i + (Math.ceil(r.text.length / o) || 1) * e : i + e
                    }
                }

                function Io(t) {
                    var e = t.doc, n = Lo(t);
                    e.iter((function (t) {
                        var e = n(t);
                        e != t.height && te(t, e)
                    }))
                }

                function No(t, e, n, o) {
                    var r = t.display;
                    if (!n && "true" == Tt(e).getAttribute("cm-not-content")) return null;
                    var i, a, s = r.lineSpace.getBoundingClientRect();
                    try {
                        i = e.clientX - s.left, a = e.clientY - s.top
                    } catch (t) {
                        return null
                    }
                    var l, c = Co(t, i, a);
                    if (o && c.xRel > 0 && (l = Jt(t.doc, c.line).text).length == c.ch) {
                        var u = V(l, l.length, t.options.tabSize) - l.length;
                        c = ie(c.line, Math.max(0, Math.round((i - Gn(t.display).left) / jo(t.display)) - u))
                    }
                    return c
                }

                function Ro(t, e) {
                    if (e >= t.display.viewTo) return null;
                    if ((e -= t.display.viewFrom) < 0) return null;
                    for (var n = t.display.view, o = 0; o < n.length; o++) if ((e -= n[o].size) < 0) return o
                }

                function Vo(t, e, n, o) {
                    null == e && (e = t.doc.first), null == n && (n = t.doc.first + t.doc.size), o || (o = 0);
                    var r = t.display;
                    if (o && n < r.viewTo && (null == r.updateLineNumbers || r.updateLineNumbers > e) && (r.updateLineNumbers = e), t.curOp.viewChanged = !0, e >= r.viewTo) Ae && en(t.doc, e) < r.viewTo && Ho(t); else if (n <= r.viewFrom) Ae && nn(t.doc, n + o) > r.viewFrom ? Ho(t) : (r.viewFrom += o, r.viewTo += o); else if (e <= r.viewFrom && n >= r.viewTo) Ho(t); else if (e <= r.viewFrom) {
                        var i = Uo(t, n, n + o, 1);
                        i ? (r.view = r.view.slice(i.index), r.viewFrom = i.lineN, r.viewTo += o) : Ho(t)
                    } else if (n >= r.viewTo) {
                        var a = Uo(t, e, e, -1);
                        a ? (r.view = r.view.slice(0, a.index), r.viewTo = a.lineN) : Ho(t)
                    } else {
                        var s = Uo(t, e, e, -1), l = Uo(t, n, n + o, 1);
                        s && l ? (r.view = r.view.slice(0, s.index).concat(Cn(t, s.lineN, l.lineN)).concat(r.view.slice(l.index)), r.viewTo += o) : Ho(t)
                    }
                    var c = r.externalMeasured;
                    c && (n < c.lineN ? c.lineN += o : e < c.lineN + c.size && (r.externalMeasured = null))
                }

                function Fo(t, e, n) {
                    t.curOp.viewChanged = !0;
                    var o = t.display, r = t.display.externalMeasured;
                    if (r && e >= r.lineN && e < r.lineN + r.size && (o.externalMeasured = null), !(e < o.viewFrom || e >= o.viewTo)) {
                        var i = o.view[Ro(t, e)];
                        if (null != i.node) {
                            var a = i.changes || (i.changes = []);
                            -1 == H(a, n) && a.push(n)
                        }
                    }
                }

                function Ho(t) {
                    t.display.viewFrom = t.display.viewTo = t.doc.first, t.display.view = [], t.display.viewOffset = 0
                }

                function Uo(t, e, n, o) {
                    var r, i = Ro(t, e), a = t.display.view;
                    if (!Ae || n == t.doc.first + t.doc.size) return {index: i, lineN: n};
                    for (var s = t.display.viewFrom, l = 0; l < i; l++) s += a[l].size;
                    if (s != e) {
                        if (o > 0) {
                            if (i == a.length - 1) return null;
                            r = s + a[i].size - e, i++
                        } else r = s - e;
                        e += r, n += r
                    }
                    for (; en(t.doc, n) != n;) {
                        if (i == (o < 0 ? 0 : a.length - 1)) return null;
                        n += o * a[i - (o < 0 ? 1 : 0)].size, i += o
                    }
                    return {index: i, lineN: n}
                }

                function zo(t, e, n) {
                    var o = t.display;
                    0 == o.view.length || e >= o.viewTo || n <= o.viewFrom ? (o.view = Cn(t, e, n), o.viewFrom = e) : (o.viewFrom > e ? o.view = Cn(t, e, o.viewFrom).concat(o.view) : o.viewFrom < e && (o.view = o.view.slice(Ro(t, e))), o.viewFrom = e, o.viewTo < n ? o.view = o.view.concat(Cn(t, o.viewTo, n)) : o.viewTo > n && (o.view = o.view.slice(0, Ro(t, n)))), o.viewTo = n
                }

                function Bo(t) {
                    for (var e = t.display.view, n = 0, o = 0; o < e.length; o++) {
                        var r = e[o];
                        r.hidden || r.node && !r.changes || ++n
                    }
                    return n
                }

                function Wo(t) {
                    t.display.input.showSelection(t.display.input.prepareSelection())
                }

                function $o(t, e) {
                    void 0 === e && (e = !0);
                    for (var n = t.doc, o = {}, r = o.cursors = document.createDocumentFragment(), i = o.selection = document.createDocumentFragment(), a = 0; a < n.sel.ranges.length; a++) if (e || a != n.sel.primIndex) {
                        var s = n.sel.ranges[a];
                        if (!(s.from().line >= t.display.viewTo || s.to().line < t.display.viewFrom)) {
                            var l = s.empty();
                            (l || t.options.showCursorWhenSelecting) && qo(t, s.head, r), l || Ko(t, s, i)
                        }
                    }
                    return o
                }

                function qo(t, e, n) {
                    var o = _o(t, e, "div", null, null, !t.options.singleCursorHeightPerLine),
                        r = n.appendChild(k("div", " ", "CodeMirror-cursor"));
                    if (r.style.left = o.left + "px", r.style.top = o.top + "px", r.style.height = Math.max(0, o.bottom - o.top) * t.options.cursorHeight + "px", /\bcm-fat-cursor\b/.test(t.getWrapperElement().className)) {
                        var i = bo(t, e, "div", null, null);
                        i.right - i.left > 0 && (r.style.width = i.right - i.left + "px")
                    }
                    if (o.other) {
                        var a = n.appendChild(k("div", " ", "CodeMirror-cursor CodeMirror-secondarycursor"));
                        a.style.display = "", a.style.left = o.other.left + "px", a.style.top = o.other.top + "px", a.style.height = .85 * (o.other.bottom - o.other.top) + "px"
                    }
                }

                function Go(t, e) {
                    return t.top - e.top || t.left - e.left
                }

                function Ko(t, e, n) {
                    var o = t.display, r = t.doc, i = document.createDocumentFragment(), a = Gn(t.display), s = a.left,
                        l = Math.max(o.sizerWidth, Yn(t) - o.sizer.offsetLeft) - a.right, c = "ltr" == r.direction;

                    function u(t, e, n, o) {
                        e < 0 && (e = 0), e = Math.round(e), o = Math.round(o), i.appendChild(k("div", null, "CodeMirror-selected", "position: absolute; left: " + t + "px;\n                             top: " + e + "px; width: " + (null == n ? l - t : n) + "px;\n                             height: " + (o - e) + "px"))
                    }

                    function p(e, n, o) {
                        var i, a, p = Jt(r, e), d = p.text.length;

                        function f(n, o) {
                            return bo(t, ie(e, n), "div", p, o)
                        }

                        function h(e, n, o) {
                            var r = Oo(t, p, null, e), i = "ltr" == n == ("after" == o) ? "left" : "right";
                            return f("after" == o ? r.begin : r.end - (/\s/.test(p.text.charAt(r.end - 1)) ? 2 : 1), i)[i]
                        }

                        var v = dt(p, r.direction);
                        return lt(v, n || 0, null == o ? d : o, (function (t, e, r, p) {
                            var g = "ltr" == r, y = f(t, g ? "left" : "right"), m = f(e - 1, g ? "right" : "left"),
                                b = null == n && 0 == t, _ = null == o && e == d, w = 0 == p,
                                x = !v || p == v.length - 1;
                            if (m.top - y.top <= 3) {
                                var C = (c ? _ : b) && x, S = (c ? b : _) && w ? s : (g ? y : m).left,
                                    O = C ? l : (g ? m : y).right;
                                u(S, y.top, O - S, y.bottom)
                            } else {
                                var T, P, E, k;
                                g ? (T = c && b && w ? s : y.left, P = c ? l : h(t, r, "before"), E = c ? s : h(e, r, "after"), k = c && _ && x ? l : m.right) : (T = c ? h(t, r, "before") : s, P = !c && b && w ? l : y.right, E = !c && _ && x ? s : m.left, k = c ? h(e, r, "after") : l), u(T, y.top, P - T, y.bottom), y.bottom < m.top && u(s, y.bottom, null, m.top), u(E, m.top, k - E, m.bottom)
                            }
                            (!i || Go(y, i) < 0) && (i = y), Go(m, i) < 0 && (i = m), (!a || Go(y, a) < 0) && (a = y), Go(m, a) < 0 && (a = m)
                        })), {start: i, end: a}
                    }

                    var d = e.from(), f = e.to();
                    if (d.line == f.line) p(d.line, d.ch, f.ch); else {
                        var h = Jt(r, d.line), v = Jt(r, f.line), g = Ze(h) == Ze(v),
                            y = p(d.line, d.ch, g ? h.text.length + 1 : null).end,
                            m = p(f.line, g ? 0 : null, f.ch).start;
                        g && (y.top < m.top - 2 ? (u(y.right, y.top, null, y.bottom), u(s, m.top, m.left, m.bottom)) : u(y.right, y.top, m.left - y.right, y.bottom)), y.bottom < m.top && u(s, y.bottom, null, m.top)
                    }
                    n.appendChild(i)
                }

                function Yo(t) {
                    if (t.state.focused) {
                        var e = t.display;
                        clearInterval(e.blinker);
                        var n = !0;
                        e.cursorDiv.style.visibility = "", t.options.cursorBlinkRate > 0 ? e.blinker = setInterval((function () {
                            t.hasFocus() || Qo(t), e.cursorDiv.style.visibility = (n = !n) ? "" : "hidden"
                        }), t.options.cursorBlinkRate) : t.options.cursorBlinkRate < 0 && (e.cursorDiv.style.visibility = "hidden")
                    }
                }

                function Xo(t) {
                    t.hasFocus() || (t.display.input.focus(), t.state.focused || Zo(t))
                }

                function Jo(t) {
                    t.state.delayingBlurEvent = !0, setTimeout((function () {
                        t.state.delayingBlurEvent && (t.state.delayingBlurEvent = !1, t.state.focused && Qo(t))
                    }), 100)
                }

                function Zo(t, e) {
                    t.state.delayingBlurEvent && !t.state.draggingText && (t.state.delayingBlurEvent = !1), "nocursor" != t.options.readOnly && (t.state.focused || (yt(t, "focus", t, e), t.state.focused = !0, D(t.display.wrapper, "CodeMirror-focused"), t.curOp || t.display.selForContextMenu == t.doc.sel || (t.display.input.reset(), l && setTimeout((function () {
                        return t.display.input.reset(!0)
                    }), 20)), t.display.input.receivedFocus()), Yo(t))
                }

                function Qo(t, e) {
                    t.state.delayingBlurEvent || (t.state.focused && (yt(t, "blur", t, e), t.state.focused = !1, T(t.display.wrapper, "CodeMirror-focused")), clearInterval(t.display.blinker), setTimeout((function () {
                        t.state.focused || (t.display.shift = !1)
                    }), 150))
                }

                function tr(t) {
                    for (var e = t.display, n = e.lineDiv.offsetTop, o = Math.max(0, e.scroller.getBoundingClientRect().top), r = e.lineDiv.getBoundingClientRect().top, i = 0, l = 0; l < e.view.length; l++) {
                        var c = e.view[l], u = t.options.lineWrapping, p = void 0, d = 0;
                        if (!c.hidden) {
                            if (r += c.line.height, a && s < 8) {
                                var f = c.node.offsetTop + c.node.offsetHeight;
                                p = f - n, n = f
                            } else {
                                var h = c.node.getBoundingClientRect();
                                p = h.bottom - h.top, !u && c.text.firstChild && (d = c.text.firstChild.getBoundingClientRect().right - h.left - 1)
                            }
                            var v = c.line.height - p;
                            if ((v > .005 || v < -.005) && (r < o && (i -= v), te(c.line, p), er(c.line), c.rest)) for (var g = 0; g < c.rest.length; g++) er(c.rest[g]);
                            if (d > t.display.sizerWidth) {
                                var y = Math.ceil(d / jo(t.display));
                                y > t.display.maxLineLength && (t.display.maxLineLength = y, t.display.maxLine = c.line, t.display.maxLineChanged = !0)
                            }
                        }
                    }
                    Math.abs(i) > 2 && (e.scroller.scrollTop += i)
                }

                function er(t) {
                    if (t.widgets) for (var e = 0; e < t.widgets.length; ++e) {
                        var n = t.widgets[e], o = n.node.parentNode;
                        o && (n.height = o.offsetHeight)
                    }
                }

                function nr(t, e, n) {
                    var o = n && null != n.top ? Math.max(0, n.top) : t.scroller.scrollTop;
                    o = Math.floor(o - $n(t));
                    var r = n && null != n.bottom ? n.bottom : o + t.wrapper.clientHeight, i = ne(e, o), a = ne(e, r);
                    if (n && n.ensure) {
                        var s = n.ensure.from.line, l = n.ensure.to.line;
                        s < i ? (i = s, a = ne(e, an(Jt(e, s)) + t.wrapper.clientHeight)) : Math.min(l, e.lastLine()) >= a && (i = ne(e, an(Jt(e, l)) - t.wrapper.clientHeight), a = l)
                    }
                    return {from: i, to: Math.max(a, i + 1)}
                }

                function or(t, e) {
                    if (!mt(t, "scrollCursorIntoView")) {
                        var n = t.display, o = n.sizer.getBoundingClientRect(), r = null;
                        if (e.top + o.top < 0 ? r = !0 : e.bottom + o.top > (window.innerHeight || document.documentElement.clientHeight) && (r = !1), null != r && !h) {
                            var i = k("div", "", null, "position: absolute;\n                         top: " + (e.top - n.viewOffset - $n(t.display)) + "px;\n                         height: " + (e.bottom - e.top + Kn(t) + n.barHeight) + "px;\n                         left: " + e.left + "px; width: " + Math.max(2, e.right - e.left) + "px;");
                            t.display.lineSpace.appendChild(i), i.scrollIntoView(r), t.display.lineSpace.removeChild(i)
                        }
                    }
                }

                function rr(t, e, n, o) {
                    var r;
                    null == o && (o = 0), t.options.lineWrapping || e != n || (n = "before" == e.sticky ? ie(e.line, e.ch + 1, "before") : e, e = e.ch ? ie(e.line, "before" == e.sticky ? e.ch - 1 : e.ch, "after") : e);
                    for (var i = 0; i < 5; i++) {
                        var a = !1, s = _o(t, e), l = n && n != e ? _o(t, n) : s, c = ar(t, r = {
                            left: Math.min(s.left, l.left),
                            top: Math.min(s.top, l.top) - o,
                            right: Math.max(s.left, l.left),
                            bottom: Math.max(s.bottom, l.bottom) + o
                        }), u = t.doc.scrollTop, p = t.doc.scrollLeft;
                        if (null != c.scrollTop && (fr(t, c.scrollTop), Math.abs(t.doc.scrollTop - u) > 1 && (a = !0)), null != c.scrollLeft && (vr(t, c.scrollLeft), Math.abs(t.doc.scrollLeft - p) > 1 && (a = !0)), !a) break
                    }
                    return r
                }

                function ir(t, e) {
                    var n = ar(t, e);
                    null != n.scrollTop && fr(t, n.scrollTop), null != n.scrollLeft && vr(t, n.scrollLeft)
                }

                function ar(t, e) {
                    var n = t.display, o = Ao(t.display);
                    e.top < 0 && (e.top = 0);
                    var r = t.curOp && null != t.curOp.scrollTop ? t.curOp.scrollTop : n.scroller.scrollTop, i = Xn(t),
                        a = {};
                    e.bottom - e.top > i && (e.bottom = e.top + i);
                    var s = t.doc.height + qn(n), l = e.top < o, c = e.bottom > s - o;
                    if (e.top < r) a.scrollTop = l ? 0 : e.top; else if (e.bottom > r + i) {
                        var u = Math.min(e.top, (c ? s : e.bottom) - i);
                        u != r && (a.scrollTop = u)
                    }
                    var p = t.options.fixedGutter ? 0 : n.gutters.offsetWidth,
                        d = t.curOp && null != t.curOp.scrollLeft ? t.curOp.scrollLeft : n.scroller.scrollLeft - p,
                        f = Yn(t) - n.gutters.offsetWidth, h = e.right - e.left > f;
                    return h && (e.right = e.left + f), e.left < 10 ? a.scrollLeft = 0 : e.left < d ? a.scrollLeft = Math.max(0, e.left + p - (h ? 0 : 10)) : e.right > f + d - 3 && (a.scrollLeft = e.right + (h ? 0 : 10) - f), a
                }

                function sr(t, e) {
                    null != e && (pr(t), t.curOp.scrollTop = (null == t.curOp.scrollTop ? t.doc.scrollTop : t.curOp.scrollTop) + e)
                }

                function lr(t) {
                    pr(t);
                    var e = t.getCursor();
                    t.curOp.scrollToPos = {from: e, to: e, margin: t.options.cursorScrollMargin}
                }

                function cr(t, e, n) {
                    null == e && null == n || pr(t), null != e && (t.curOp.scrollLeft = e), null != n && (t.curOp.scrollTop = n)
                }

                function ur(t, e) {
                    pr(t), t.curOp.scrollToPos = e
                }

                function pr(t) {
                    var e = t.curOp.scrollToPos;
                    e && (t.curOp.scrollToPos = null, dr(t, wo(t, e.from), wo(t, e.to), e.margin))
                }

                function dr(t, e, n, o) {
                    var r = ar(t, {
                        left: Math.min(e.left, n.left),
                        top: Math.min(e.top, n.top) - o,
                        right: Math.max(e.right, n.right),
                        bottom: Math.max(e.bottom, n.bottom) + o
                    });
                    cr(t, r.scrollLeft, r.scrollTop)
                }

                function fr(t, e) {
                    Math.abs(t.doc.scrollTop - e) < 2 || (n || Wr(t, {top: e}), hr(t, e, !0), n && Wr(t), Nr(t, 100))
                }

                function hr(t, e, n) {
                    e = Math.max(0, Math.min(t.display.scroller.scrollHeight - t.display.scroller.clientHeight, e)), (t.display.scroller.scrollTop != e || n) && (t.doc.scrollTop = e, t.display.scrollbars.setScrollTop(e), t.display.scroller.scrollTop != e && (t.display.scroller.scrollTop = e))
                }

                function vr(t, e, n, o) {
                    e = Math.max(0, Math.min(e, t.display.scroller.scrollWidth - t.display.scroller.clientWidth)), (n ? e == t.doc.scrollLeft : Math.abs(t.doc.scrollLeft - e) < 2) && !o || (t.doc.scrollLeft = e, Kr(t), t.display.scroller.scrollLeft != e && (t.display.scroller.scrollLeft = e), t.display.scrollbars.setScrollLeft(e))
                }

                function gr(t) {
                    var e = t.display, n = e.gutters.offsetWidth, o = Math.round(t.doc.height + qn(t.display));
                    return {
                        clientHeight: e.scroller.clientHeight,
                        viewHeight: e.wrapper.clientHeight,
                        scrollWidth: e.scroller.scrollWidth,
                        clientWidth: e.scroller.clientWidth,
                        viewWidth: e.wrapper.clientWidth,
                        barLeft: t.options.fixedGutter ? n : 0,
                        docHeight: o,
                        scrollHeight: o + Kn(t) + e.barHeight,
                        nativeBarWidth: e.nativeBarWidth,
                        gutterWidth: n
                    }
                }

                var yr = function (t, e, n) {
                    this.cm = n;
                    var o = this.vert = k("div", [k("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"),
                        r = this.horiz = k("div", [k("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar");
                    o.tabIndex = r.tabIndex = -1, t(o), t(r), ht(o, "scroll", (function () {
                        o.clientHeight && e(o.scrollTop, "vertical")
                    })), ht(r, "scroll", (function () {
                        r.clientWidth && e(r.scrollLeft, "horizontal")
                    })), this.checkedZeroWidth = !1, a && s < 8 && (this.horiz.style.minHeight = this.vert.style.minWidth = "18px")
                };
                yr.prototype.update = function (t) {
                    var e = t.scrollWidth > t.clientWidth + 1, n = t.scrollHeight > t.clientHeight + 1,
                        o = t.nativeBarWidth;
                    if (n) {
                        this.vert.style.display = "block", this.vert.style.bottom = e ? o + "px" : "0";
                        var r = t.viewHeight - (e ? o : 0);
                        this.vert.firstChild.style.height = Math.max(0, t.scrollHeight - t.clientHeight + r) + "px"
                    } else this.vert.style.display = "", this.vert.firstChild.style.height = "0";
                    if (e) {
                        this.horiz.style.display = "block", this.horiz.style.right = n ? o + "px" : "0", this.horiz.style.left = t.barLeft + "px";
                        var i = t.viewWidth - t.barLeft - (n ? o : 0);
                        this.horiz.firstChild.style.width = Math.max(0, t.scrollWidth - t.clientWidth + i) + "px"
                    } else this.horiz.style.display = "", this.horiz.firstChild.style.width = "0";
                    return !this.checkedZeroWidth && t.clientHeight > 0 && (0 == o && this.zeroWidthHack(), this.checkedZeroWidth = !0), {
                        right: n ? o : 0,
                        bottom: e ? o : 0
                    }
                }, yr.prototype.setScrollLeft = function (t) {
                    this.horiz.scrollLeft != t && (this.horiz.scrollLeft = t), this.disableHoriz && this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz")
                }, yr.prototype.setScrollTop = function (t) {
                    this.vert.scrollTop != t && (this.vert.scrollTop = t), this.disableVert && this.enableZeroWidthBar(this.vert, this.disableVert, "vert")
                }, yr.prototype.zeroWidthHack = function () {
                    var t = m && !f ? "12px" : "18px";
                    this.horiz.style.height = this.vert.style.width = t, this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none", this.disableHoriz = new F, this.disableVert = new F
                }, yr.prototype.enableZeroWidthBar = function (t, e, n) {
                    function o() {
                        var r = t.getBoundingClientRect();
                        ("vert" == n ? document.elementFromPoint(r.right - 1, (r.top + r.bottom) / 2) : document.elementFromPoint((r.right + r.left) / 2, r.bottom - 1)) != t ? t.style.pointerEvents = "none" : e.set(1e3, o)
                    }

                    t.style.pointerEvents = "auto", e.set(1e3, o)
                }, yr.prototype.clear = function () {
                    var t = this.horiz.parentNode;
                    t.removeChild(this.horiz), t.removeChild(this.vert)
                };
                var mr = function () {
                };

                function br(t, e) {
                    e || (e = gr(t));
                    var n = t.display.barWidth, o = t.display.barHeight;
                    _r(t, e);
                    for (var r = 0; r < 4 && n != t.display.barWidth || o != t.display.barHeight; r++) n != t.display.barWidth && t.options.lineWrapping && tr(t), _r(t, gr(t)), n = t.display.barWidth, o = t.display.barHeight
                }

                function _r(t, e) {
                    var n = t.display, o = n.scrollbars.update(e);
                    n.sizer.style.paddingRight = (n.barWidth = o.right) + "px", n.sizer.style.paddingBottom = (n.barHeight = o.bottom) + "px", n.heightForcer.style.borderBottom = o.bottom + "px solid transparent", o.right && o.bottom ? (n.scrollbarFiller.style.display = "block", n.scrollbarFiller.style.height = o.bottom + "px", n.scrollbarFiller.style.width = o.right + "px") : n.scrollbarFiller.style.display = "", o.bottom && t.options.coverGutterNextToScrollbar && t.options.fixedGutter ? (n.gutterFiller.style.display = "block", n.gutterFiller.style.height = o.bottom + "px", n.gutterFiller.style.width = e.gutterWidth + "px") : n.gutterFiller.style.display = ""
                }

                mr.prototype.update = function () {
                    return {bottom: 0, right: 0}
                }, mr.prototype.setScrollLeft = function () {
                }, mr.prototype.setScrollTop = function () {
                }, mr.prototype.clear = function () {
                };
                var wr = {native: yr, null: mr};

                function xr(t) {
                    t.display.scrollbars && (t.display.scrollbars.clear(), t.display.scrollbars.addClass && T(t.display.wrapper, t.display.scrollbars.addClass)), t.display.scrollbars = new wr[t.options.scrollbarStyle]((function (e) {
                        t.display.wrapper.insertBefore(e, t.display.scrollbarFiller), ht(e, "mousedown", (function () {
                            t.state.focused && setTimeout((function () {
                                return t.display.input.focus()
                            }), 0)
                        })), e.setAttribute("cm-not-content", "true")
                    }), (function (e, n) {
                        "horizontal" == n ? vr(t, e) : fr(t, e)
                    }), t), t.display.scrollbars.addClass && D(t.display.wrapper, t.display.scrollbars.addClass)
                }

                var Cr = 0;

                function Sr(t) {
                    t.curOp = {
                        cm: t,
                        viewChanged: !1,
                        startHeight: t.doc.height,
                        forceUpdate: !1,
                        updateInput: 0,
                        typing: !1,
                        changeObjs: null,
                        cursorActivityHandlers: null,
                        cursorActivityCalled: 0,
                        selectionChanged: !1,
                        updateMaxLine: !1,
                        scrollLeft: null,
                        scrollTop: null,
                        scrollToPos: null,
                        focus: !1,
                        id: ++Cr,
                        markArrays: null
                    }, On(t.curOp)
                }

                function Or(t) {
                    var e = t.curOp;
                    e && Pn(e, (function (t) {
                        for (var e = 0; e < t.ops.length; e++) t.ops[e].cm.curOp = null;
                        Tr(t)
                    }))
                }

                function Tr(t) {
                    for (var e = t.ops, n = 0; n < e.length; n++) Pr(e[n]);
                    for (var o = 0; o < e.length; o++) Er(e[o]);
                    for (var r = 0; r < e.length; r++) kr(e[r]);
                    for (var i = 0; i < e.length; i++) Ar(e[i]);
                    for (var a = 0; a < e.length; a++) jr(e[a])
                }

                function Pr(t) {
                    var e = t.cm, n = e.display;
                    Fr(e), t.updateMaxLine && ln(e), t.mustUpdate = t.viewChanged || t.forceUpdate || null != t.scrollTop || t.scrollToPos && (t.scrollToPos.from.line < n.viewFrom || t.scrollToPos.to.line >= n.viewTo) || n.maxLineChanged && e.options.lineWrapping, t.update = t.mustUpdate && new Vr(e, t.mustUpdate && {
                        top: t.scrollTop,
                        ensure: t.scrollToPos
                    }, t.forceUpdate)
                }

                function Er(t) {
                    t.updatedDisplay = t.mustUpdate && zr(t.cm, t.update)
                }

                function kr(t) {
                    var e = t.cm, n = e.display;
                    t.updatedDisplay && tr(e), t.barMeasure = gr(e), n.maxLineChanged && !e.options.lineWrapping && (t.adjustWidthTo = to(e, n.maxLine, n.maxLine.text.length).left + 3, e.display.sizerWidth = t.adjustWidthTo, t.barMeasure.scrollWidth = Math.max(n.scroller.clientWidth, n.sizer.offsetLeft + t.adjustWidthTo + Kn(e) + e.display.barWidth), t.maxScrollLeft = Math.max(0, n.sizer.offsetLeft + t.adjustWidthTo - Yn(e))), (t.updatedDisplay || t.selectionChanged) && (t.preparedSelection = n.input.prepareSelection())
                }

                function Ar(t) {
                    var e = t.cm;
                    null != t.adjustWidthTo && (e.display.sizer.style.minWidth = t.adjustWidthTo + "px", t.maxScrollLeft < e.doc.scrollLeft && vr(e, Math.min(e.display.scroller.scrollLeft, t.maxScrollLeft), !0), e.display.maxLineChanged = !1);
                    var n = t.focus && t.focus == M();
                    t.preparedSelection && e.display.input.showSelection(t.preparedSelection, n), (t.updatedDisplay || t.startHeight != e.doc.height) && br(e, t.barMeasure), t.updatedDisplay && Gr(e, t.barMeasure), t.selectionChanged && Yo(e), e.state.focused && t.updateInput && e.display.input.reset(t.typing), n && Xo(t.cm)
                }

                function jr(t) {
                    var e = t.cm, n = e.display, o = e.doc;
                    t.updatedDisplay && Br(e, t.update), null == n.wheelStartX || null == t.scrollTop && null == t.scrollLeft && !t.scrollToPos || (n.wheelStartX = n.wheelStartY = null), null != t.scrollTop && hr(e, t.scrollTop, t.forceScroll), null != t.scrollLeft && vr(e, t.scrollLeft, !0, !0), t.scrollToPos && or(e, rr(e, de(o, t.scrollToPos.from), de(o, t.scrollToPos.to), t.scrollToPos.margin));
                    var r = t.maybeHiddenMarkers, i = t.maybeUnhiddenMarkers;
                    if (r) for (var a = 0; a < r.length; ++a) r[a].lines.length || yt(r[a], "hide");
                    if (i) for (var s = 0; s < i.length; ++s) i[s].lines.length && yt(i[s], "unhide");
                    n.wrapper.offsetHeight && (o.scrollTop = e.display.scroller.scrollTop), t.changeObjs && yt(e, "changes", e, t.changeObjs), t.update && t.update.finish()
                }

                function Mr(t, e) {
                    if (t.curOp) return e();
                    Sr(t);
                    try {
                        return e()
                    } finally {
                        Or(t)
                    }
                }

                function Dr(t, e) {
                    return function () {
                        if (t.curOp) return e.apply(t, arguments);
                        Sr(t);
                        try {
                            return e.apply(t, arguments)
                        } finally {
                            Or(t)
                        }
                    }
                }

                function Lr(t) {
                    return function () {
                        if (this.curOp) return t.apply(this, arguments);
                        Sr(this);
                        try {
                            return t.apply(this, arguments)
                        } finally {
                            Or(this)
                        }
                    }
                }

                function Ir(t) {
                    return function () {
                        var e = this.cm;
                        if (!e || e.curOp) return t.apply(this, arguments);
                        Sr(e);
                        try {
                            return t.apply(this, arguments)
                        } finally {
                            Or(e)
                        }
                    }
                }

                function Nr(t, e) {
                    t.doc.highlightFrontier < t.display.viewTo && t.state.highlight.set(e, N(Rr, t))
                }

                function Rr(t) {
                    var e = t.doc;
                    if (!(e.highlightFrontier >= t.display.viewTo)) {
                        var n = +new Date + t.options.workTime, o = be(t, e.highlightFrontier), r = [];
                        e.iter(o.line, Math.min(e.first + e.size, t.display.viewTo + 500), (function (i) {
                            if (o.line >= t.display.viewFrom) {
                                var a = i.styles,
                                    s = i.text.length > t.options.maxHighlightLength ? Gt(e.mode, o.state) : null,
                                    l = ye(t, i, o, !0);
                                s && (o.state = s), i.styles = l.styles;
                                var c = i.styleClasses, u = l.classes;
                                u ? i.styleClasses = u : c && (i.styleClasses = null);
                                for (var p = !a || a.length != i.styles.length || c != u && (!c || !u || c.bgClass != u.bgClass || c.textClass != u.textClass), d = 0; !p && d < a.length; ++d) p = a[d] != i.styles[d];
                                p && r.push(o.line), i.stateAfter = o.save(), o.nextLine()
                            } else i.text.length <= t.options.maxHighlightLength && _e(t, i.text, o), i.stateAfter = o.line % 5 == 0 ? o.save() : null, o.nextLine();
                            if (+new Date > n) return Nr(t, t.options.workDelay), !0
                        })), e.highlightFrontier = o.line, e.modeFrontier = Math.max(e.modeFrontier, o.line), r.length && Mr(t, (function () {
                            for (var e = 0; e < r.length; e++) Fo(t, r[e], "text")
                        }))
                    }
                }

                var Vr = function (t, e, n) {
                    var o = t.display;
                    this.viewport = e, this.visible = nr(o, t.doc, e), this.editorIsHidden = !o.wrapper.offsetWidth, this.wrapperHeight = o.wrapper.clientHeight, this.wrapperWidth = o.wrapper.clientWidth, this.oldDisplayWidth = Yn(t), this.force = n, this.dims = Mo(t), this.events = []
                };

                function Fr(t) {
                    var e = t.display;
                    !e.scrollbarsClipped && e.scroller.offsetWidth && (e.nativeBarWidth = e.scroller.offsetWidth - e.scroller.clientWidth, e.heightForcer.style.height = Kn(t) + "px", e.sizer.style.marginBottom = -e.nativeBarWidth + "px", e.sizer.style.borderRightWidth = Kn(t) + "px", e.scrollbarsClipped = !0)
                }

                function Hr(t) {
                    if (t.hasFocus()) return null;
                    var e = M();
                    if (!e || !j(t.display.lineDiv, e)) return null;
                    var n = {activeElt: e};
                    if (window.getSelection) {
                        var o = window.getSelection();
                        o.anchorNode && o.extend && j(t.display.lineDiv, o.anchorNode) && (n.anchorNode = o.anchorNode, n.anchorOffset = o.anchorOffset, n.focusNode = o.focusNode, n.focusOffset = o.focusOffset)
                    }
                    return n
                }

                function Ur(t) {
                    if (t && t.activeElt && t.activeElt != M() && (t.activeElt.focus(), !/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName) && t.anchorNode && j(document.body, t.anchorNode) && j(document.body, t.focusNode))) {
                        var e = window.getSelection(), n = document.createRange();
                        n.setEnd(t.anchorNode, t.anchorOffset), n.collapse(!1), e.removeAllRanges(), e.addRange(n), e.extend(t.focusNode, t.focusOffset)
                    }
                }

                function zr(t, e) {
                    var n = t.display, o = t.doc;
                    if (e.editorIsHidden) return Ho(t), !1;
                    if (!e.force && e.visible.from >= n.viewFrom && e.visible.to <= n.viewTo && (null == n.updateLineNumbers || n.updateLineNumbers >= n.viewTo) && n.renderedView == n.view && 0 == Bo(t)) return !1;
                    Yr(t) && (Ho(t), e.dims = Mo(t));
                    var r = o.first + o.size, i = Math.max(e.visible.from - t.options.viewportMargin, o.first),
                        a = Math.min(r, e.visible.to + t.options.viewportMargin);
                    n.viewFrom < i && i - n.viewFrom < 20 && (i = Math.max(o.first, n.viewFrom)), n.viewTo > a && n.viewTo - a < 20 && (a = Math.min(r, n.viewTo)), Ae && (i = en(t.doc, i), a = nn(t.doc, a));
                    var s = i != n.viewFrom || a != n.viewTo || n.lastWrapHeight != e.wrapperHeight || n.lastWrapWidth != e.wrapperWidth;
                    zo(t, i, a), n.viewOffset = an(Jt(t.doc, n.viewFrom)), t.display.mover.style.top = n.viewOffset + "px";
                    var l = Bo(t);
                    if (!s && 0 == l && !e.force && n.renderedView == n.view && (null == n.updateLineNumbers || n.updateLineNumbers >= n.viewTo)) return !1;
                    var c = Hr(t);
                    return l > 4 && (n.lineDiv.style.display = "none"), $r(t, n.updateLineNumbers, e.dims), l > 4 && (n.lineDiv.style.display = ""), n.renderedView = n.view, Ur(c), P(n.cursorDiv), P(n.selectionDiv), n.gutters.style.height = n.sizer.style.minHeight = 0, s && (n.lastWrapHeight = e.wrapperHeight, n.lastWrapWidth = e.wrapperWidth, Nr(t, 400)), n.updateLineNumbers = null, !0
                }

                function Br(t, e) {
                    for (var n = e.viewport, o = !0; ; o = !1) {
                        if (o && t.options.lineWrapping && e.oldDisplayWidth != Yn(t)) o && (e.visible = nr(t.display, t.doc, n)); else if (n && null != n.top && (n = {top: Math.min(t.doc.height + qn(t.display) - Xn(t), n.top)}), e.visible = nr(t.display, t.doc, n), e.visible.from >= t.display.viewFrom && e.visible.to <= t.display.viewTo) break;
                        if (!zr(t, e)) break;
                        tr(t);
                        var r = gr(t);
                        Wo(t), br(t, r), Gr(t, r), e.force = !1
                    }
                    e.signal(t, "update", t), t.display.viewFrom == t.display.reportedViewFrom && t.display.viewTo == t.display.reportedViewTo || (e.signal(t, "viewportChange", t, t.display.viewFrom, t.display.viewTo), t.display.reportedViewFrom = t.display.viewFrom, t.display.reportedViewTo = t.display.viewTo)
                }

                function Wr(t, e) {
                    var n = new Vr(t, e);
                    if (zr(t, n)) {
                        tr(t), Br(t, n);
                        var o = gr(t);
                        Wo(t), br(t, o), Gr(t, o), n.finish()
                    }
                }

                function $r(t, e, n) {
                    var o = t.display, r = t.options.lineNumbers, i = o.lineDiv, a = i.firstChild;

                    function s(e) {
                        var n = e.nextSibling;
                        return l && m && t.display.currentWheelTarget == e ? e.style.display = "none" : e.parentNode.removeChild(e), n
                    }

                    for (var c = o.view, u = o.viewFrom, p = 0; p < c.length; p++) {
                        var d = c[p];
                        if (d.hidden) ; else if (d.node && d.node.parentNode == i) {
                            for (; a != d.node;) a = s(a);
                            var f = r && null != e && e <= u && d.lineNumber;
                            d.changes && (H(d.changes, "gutter") > -1 && (f = !1), jn(t, d, u, n)), f && (P(d.lineNumber), d.lineNumber.appendChild(document.createTextNode(re(t.options, u)))), a = d.node.nextSibling
                        } else {
                            var h = Fn(t, d, u, n);
                            i.insertBefore(h, a)
                        }
                        u += d.size
                    }
                    for (; a;) a = s(a)
                }

                function qr(t) {
                    var e = t.gutters.offsetWidth;
                    t.sizer.style.marginLeft = e + "px", kn(t, "gutterChanged", t)
                }

                function Gr(t, e) {
                    t.display.sizer.style.minHeight = e.docHeight + "px", t.display.heightForcer.style.top = e.docHeight + "px", t.display.gutters.style.height = e.docHeight + t.display.barHeight + Kn(t) + "px"
                }

                function Kr(t) {
                    var e = t.display, n = e.view;
                    if (e.alignWidgets || e.gutters.firstChild && t.options.fixedGutter) {
                        for (var o = Do(e) - e.scroller.scrollLeft + t.doc.scrollLeft, r = e.gutters.offsetWidth, i = o + "px", a = 0; a < n.length; a++) if (!n[a].hidden) {
                            t.options.fixedGutter && (n[a].gutter && (n[a].gutter.style.left = i), n[a].gutterBackground && (n[a].gutterBackground.style.left = i));
                            var s = n[a].alignable;
                            if (s) for (var l = 0; l < s.length; l++) s[l].style.left = i
                        }
                        t.options.fixedGutter && (e.gutters.style.left = o + r + "px")
                    }
                }

                function Yr(t) {
                    if (!t.options.lineNumbers) return !1;
                    var e = t.doc, n = re(t.options, e.first + e.size - 1), o = t.display;
                    if (n.length != o.lineNumChars) {
                        var r = o.measure.appendChild(k("div", [k("div", n)], "CodeMirror-linenumber CodeMirror-gutter-elt")),
                            i = r.firstChild.offsetWidth, a = r.offsetWidth - i;
                        return o.lineGutter.style.width = "", o.lineNumInnerWidth = Math.max(i, o.lineGutter.offsetWidth - a) + 1, o.lineNumWidth = o.lineNumInnerWidth + a, o.lineNumChars = o.lineNumInnerWidth ? n.length : -1, o.lineGutter.style.width = o.lineNumWidth + "px", qr(t.display), !0
                    }
                    return !1
                }

                function Xr(t, e) {
                    for (var n = [], o = !1, r = 0; r < t.length; r++) {
                        var i = t[r], a = null;
                        if ("string" != typeof i && (a = i.style, i = i.className), "CodeMirror-linenumbers" == i) {
                            if (!e) continue;
                            o = !0
                        }
                        n.push({className: i, style: a})
                    }
                    return e && !o && n.push({className: "CodeMirror-linenumbers", style: null}), n
                }

                function Jr(t) {
                    var e = t.gutters, n = t.gutterSpecs;
                    P(e), t.lineGutter = null;
                    for (var o = 0; o < n.length; ++o) {
                        var r = n[o], i = r.className, a = r.style,
                            s = e.appendChild(k("div", null, "CodeMirror-gutter " + i));
                        a && (s.style.cssText = a), "CodeMirror-linenumbers" == i && (t.lineGutter = s, s.style.width = (t.lineNumWidth || 1) + "px")
                    }
                    e.style.display = n.length ? "" : "none", qr(t)
                }

                function Zr(t) {
                    Jr(t.display), Vo(t), Kr(t)
                }

                function Qr(t, e, o, r) {
                    var i = this;
                    this.input = o, i.scrollbarFiller = k("div", null, "CodeMirror-scrollbar-filler"), i.scrollbarFiller.setAttribute("cm-not-content", "true"), i.gutterFiller = k("div", null, "CodeMirror-gutter-filler"), i.gutterFiller.setAttribute("cm-not-content", "true"), i.lineDiv = A("div", null, "CodeMirror-code"), i.selectionDiv = k("div", null, null, "position: relative; z-index: 1"), i.cursorDiv = k("div", null, "CodeMirror-cursors"), i.measure = k("div", null, "CodeMirror-measure"), i.lineMeasure = k("div", null, "CodeMirror-measure"), i.lineSpace = A("div", [i.measure, i.lineMeasure, i.selectionDiv, i.cursorDiv, i.lineDiv], null, "position: relative; outline: none");
                    var c = A("div", [i.lineSpace], "CodeMirror-lines");
                    i.mover = k("div", [c], null, "position: relative"), i.sizer = k("div", [i.mover], "CodeMirror-sizer"), i.sizerWidth = null, i.heightForcer = k("div", null, null, "position: absolute; height: " + U + "px; width: 1px;"), i.gutters = k("div", null, "CodeMirror-gutters"), i.lineGutter = null, i.scroller = k("div", [i.sizer, i.heightForcer, i.gutters], "CodeMirror-scroll"), i.scroller.setAttribute("tabIndex", "-1"), i.wrapper = k("div", [i.scrollbarFiller, i.gutterFiller, i.scroller], "CodeMirror"), i.wrapper.setAttribute('translate', 'no'), a && s < 8 && (i.gutters.style.zIndex = -1, i.scroller.style.paddingRight = 0), l || n && y || (i.scroller.draggable = !0), t && (t.appendChild ? t.appendChild(i.wrapper) : t(i.wrapper)), i.viewFrom = i.viewTo = e.first, i.reportedViewFrom = i.reportedViewTo = e.first, i.view = [], i.renderedView = null, i.externalMeasured = null, i.viewOffset = 0, i.lastWrapHeight = i.lastWrapWidth = 0, i.updateLineNumbers = null, i.nativeBarWidth = i.barHeight = i.barWidth = 0, i.scrollbarsClipped = !1, i.lineNumWidth = i.lineNumInnerWidth = i.lineNumChars = null, i.alignWidgets = !1, i.cachedCharWidth = i.cachedTextHeight = i.cachedPaddingH = null, i.maxLine = null, i.maxLineLength = 0, i.maxLineChanged = !1, i.wheelDX = i.wheelDY = i.wheelStartX = i.wheelStartY = null, i.shift = !1, i.selForContextMenu = null, i.activeTouch = null, i.gutterSpecs = Xr(r.gutters, r.lineNumbers), Jr(i), o.init(i)
                }

                Vr.prototype.signal = function (t, e) {
                    _t(t, e) && this.events.push(arguments)
                }, Vr.prototype.finish = function () {
                    for (var t = 0; t < this.events.length; t++) yt.apply(null, this.events[t])
                };
                var ti = 0, ei = null;

                function ni(t) {
                    var e = t.wheelDeltaX, n = t.wheelDeltaY;
                    return null == e && t.detail && t.axis == t.HORIZONTAL_AXIS && (e = t.detail), null == n && t.detail && t.axis == t.VERTICAL_AXIS ? n = t.detail : null == n && (n = t.wheelDelta), {
                        x: e,
                        y: n
                    }
                }

                function oi(t) {
                    var e = ni(t);
                    return e.x *= ei, e.y *= ei, e
                }

                function ri(t, e) {
                    var o = ni(e), r = o.x, i = o.y, a = t.display, s = a.scroller, c = s.scrollWidth > s.clientWidth,
                        u = s.scrollHeight > s.clientHeight;
                    if (r && c || i && u) {
                        if (i && m && l) t:for (var d = e.target, f = a.view; d != s; d = d.parentNode) for (var h = 0; h < f.length; h++) if (f[h].node == d) {
                            t.display.currentWheelTarget = d;
                            break t
                        }
                        if (r && !n && !p && null != ei) return i && u && fr(t, Math.max(0, s.scrollTop + i * ei)), vr(t, Math.max(0, s.scrollLeft + r * ei)), (!i || i && u) && xt(e), void (a.wheelStartX = null);
                        if (i && null != ei) {
                            var v = i * ei, g = t.doc.scrollTop, y = g + a.wrapper.clientHeight;
                            v < 0 ? g = Math.max(0, g + v - 50) : y = Math.min(t.doc.height, y + v + 50), Wr(t, {
                                top: g,
                                bottom: y
                            })
                        }
                        ti < 20 && (null == a.wheelStartX ? (a.wheelStartX = s.scrollLeft, a.wheelStartY = s.scrollTop, a.wheelDX = r, a.wheelDY = i, setTimeout((function () {
                            if (null != a.wheelStartX) {
                                var t = s.scrollLeft - a.wheelStartX, e = s.scrollTop - a.wheelStartY,
                                    n = e && a.wheelDY && e / a.wheelDY || t && a.wheelDX && t / a.wheelDX;
                                a.wheelStartX = a.wheelStartY = null, n && (ei = (ei * ti + n) / (ti + 1), ++ti)
                            }
                        }), 200)) : (a.wheelDX += r, a.wheelDY += i))
                    }
                }

                a ? ei = -.53 : n ? ei = 15 : u ? ei = -.7 : d && (ei = -1 / 3);
                var ii = function (t, e) {
                    this.ranges = t, this.primIndex = e
                };
                ii.prototype.primary = function () {
                    return this.ranges[this.primIndex]
                }, ii.prototype.equals = function (t) {
                    if (t == this) return !0;
                    if (t.primIndex != this.primIndex || t.ranges.length != this.ranges.length) return !1;
                    for (var e = 0; e < this.ranges.length; e++) {
                        var n = this.ranges[e], o = t.ranges[e];
                        if (!se(n.anchor, o.anchor) || !se(n.head, o.head)) return !1
                    }
                    return !0
                }, ii.prototype.deepCopy = function () {
                    for (var t = [], e = 0; e < this.ranges.length; e++) t[e] = new ai(le(this.ranges[e].anchor), le(this.ranges[e].head));
                    return new ii(t, this.primIndex)
                }, ii.prototype.somethingSelected = function () {
                    for (var t = 0; t < this.ranges.length; t++) if (!this.ranges[t].empty()) return !0;
                    return !1
                }, ii.prototype.contains = function (t, e) {
                    e || (e = t);
                    for (var n = 0; n < this.ranges.length; n++) {
                        var o = this.ranges[n];
                        if (ae(e, o.from()) >= 0 && ae(t, o.to()) <= 0) return n
                    }
                    return -1
                };
                var ai = function (t, e) {
                    this.anchor = t, this.head = e
                };

                function si(t, e, n) {
                    var o = t && t.options.selectionsMayTouch, r = e[n];
                    e.sort((function (t, e) {
                        return ae(t.from(), e.from())
                    })), n = H(e, r);
                    for (var i = 1; i < e.length; i++) {
                        var a = e[i], s = e[i - 1], l = ae(s.to(), a.from());
                        if (o && !a.empty() ? l > 0 : l >= 0) {
                            var c = ue(s.from(), a.from()), u = ce(s.to(), a.to()),
                                p = s.empty() ? a.from() == a.head : s.from() == s.head;
                            i <= n && --n, e.splice(--i, 2, new ai(p ? u : c, p ? c : u))
                        }
                    }
                    return new ii(e, n)
                }

                function li(t, e) {
                    return new ii([new ai(t, e || t)], 0)
                }

                function ci(t) {
                    return t.text ? ie(t.from.line + t.text.length - 1, Y(t.text).length + (1 == t.text.length ? t.from.ch : 0)) : t.to
                }

                function ui(t, e) {
                    if (ae(t, e.from) < 0) return t;
                    if (ae(t, e.to) <= 0) return ci(e);
                    var n = t.line + e.text.length - (e.to.line - e.from.line) - 1, o = t.ch;
                    return t.line == e.to.line && (o += ci(e).ch - e.to.ch), ie(n, o)
                }

                function pi(t, e) {
                    for (var n = [], o = 0; o < t.sel.ranges.length; o++) {
                        var r = t.sel.ranges[o];
                        n.push(new ai(ui(r.anchor, e), ui(r.head, e)))
                    }
                    return si(t.cm, n, t.sel.primIndex)
                }

                function di(t, e, n) {
                    return t.line == e.line ? ie(n.line, t.ch - e.ch + n.ch) : ie(n.line + (t.line - e.line), t.ch)
                }

                function fi(t, e, n) {
                    for (var o = [], r = ie(t.first, 0), i = r, a = 0; a < e.length; a++) {
                        var s = e[a], l = di(s.from, r, i), c = di(ci(s), r, i);
                        if (r = s.to, i = c, "around" == n) {
                            var u = t.sel.ranges[a], p = ae(u.head, u.anchor) < 0;
                            o[a] = new ai(p ? c : l, p ? l : c)
                        } else o[a] = new ai(l, l)
                    }
                    return new ii(o, t.sel.primIndex)
                }

                function hi(t) {
                    t.doc.mode = Wt(t.options, t.doc.modeOption), vi(t)
                }

                function vi(t) {
                    t.doc.iter((function (t) {
                        t.stateAfter && (t.stateAfter = null), t.styles && (t.styles = null)
                    })), t.doc.modeFrontier = t.doc.highlightFrontier = t.doc.first, Nr(t, 100), t.state.modeGen++, t.curOp && Vo(t)
                }

                function gi(t, e) {
                    return 0 == e.from.ch && 0 == e.to.ch && "" == Y(e.text) && (!t.cm || t.cm.options.wholeLineUpdateBefore)
                }

                function yi(t, e, n, o) {
                    function r(t) {
                        return n ? n[t] : null
                    }

                    function i(t, n, r) {
                        un(t, n, r, o), kn(t, "change", t, e)
                    }

                    function a(t, e) {
                        for (var n = [], i = t; i < e; ++i) n.push(new cn(c[i], r(i), o));
                        return n
                    }

                    var s = e.from, l = e.to, c = e.text, u = Jt(t, s.line), p = Jt(t, l.line), d = Y(c),
                        f = r(c.length - 1), h = l.line - s.line;
                    if (e.full) t.insert(0, a(0, c.length)), t.remove(c.length, t.size - c.length); else if (gi(t, e)) {
                        var v = a(0, c.length - 1);
                        i(p, p.text, f), h && t.remove(s.line, h), v.length && t.insert(s.line, v)
                    } else if (u == p) if (1 == c.length) i(u, u.text.slice(0, s.ch) + d + u.text.slice(l.ch), f); else {
                        var g = a(1, c.length - 1);
                        g.push(new cn(d + u.text.slice(l.ch), f, o)), i(u, u.text.slice(0, s.ch) + c[0], r(0)), t.insert(s.line + 1, g)
                    } else if (1 == c.length) i(u, u.text.slice(0, s.ch) + c[0] + p.text.slice(l.ch), r(0)), t.remove(s.line + 1, h); else {
                        i(u, u.text.slice(0, s.ch) + c[0], r(0)), i(p, d + p.text.slice(l.ch), f);
                        var y = a(1, c.length - 1);
                        h > 1 && t.remove(s.line + 1, h - 1), t.insert(s.line + 1, y)
                    }
                    kn(t, "change", t, e)
                }

                function mi(t, e, n) {
                    function o(t, r, i) {
                        if (t.linked) for (var a = 0; a < t.linked.length; ++a) {
                            var s = t.linked[a];
                            if (s.doc != r) {
                                var l = i && s.sharedHist;
                                n && !l || (e(s.doc, l), o(s.doc, t, l))
                            }
                        }
                    }

                    o(t, null, !0)
                }

                function bi(t, e) {
                    if (e.cm) throw new Error("This document is already in use.");
                    t.doc = e, e.cm = t, Io(t), hi(t), _i(t), t.options.direction = e.direction, t.options.lineWrapping || ln(t), t.options.mode = e.modeOption, Vo(t)
                }

                function _i(t) {
                    ("rtl" == t.doc.direction ? D : T)(t.display.lineDiv, "CodeMirror-rtl")
                }

                function wi(t) {
                    Mr(t, (function () {
                        _i(t), Vo(t)
                    }))
                }

                function xi(t) {
                    this.done = [], this.undone = [], this.undoDepth = t ? t.undoDepth : 1 / 0, this.lastModTime = this.lastSelTime = 0, this.lastOp = this.lastSelOp = null, this.lastOrigin = this.lastSelOrigin = null, this.generation = this.maxGeneration = t ? t.maxGeneration : 1
                }

                function Ci(t, e) {
                    var n = {from: le(e.from), to: ci(e), text: Zt(t, e.from, e.to)};
                    return Ai(t, n, e.from.line, e.to.line + 1), mi(t, (function (t) {
                        return Ai(t, n, e.from.line, e.to.line + 1)
                    }), !0), n
                }

                function Si(t) {
                    for (; t.length && Y(t).ranges;) t.pop()
                }

                function Oi(t, e) {
                    return e ? (Si(t.done), Y(t.done)) : t.done.length && !Y(t.done).ranges ? Y(t.done) : t.done.length > 1 && !t.done[t.done.length - 2].ranges ? (t.done.pop(), Y(t.done)) : void 0
                }

                function Ti(t, e, n, o) {
                    var r = t.history;
                    r.undone.length = 0;
                    var i, a, s = +new Date;
                    if ((r.lastOp == o || r.lastOrigin == e.origin && e.origin && ("+" == e.origin.charAt(0) && r.lastModTime > s - (t.cm ? t.cm.options.historyEventDelay : 500) || "*" == e.origin.charAt(0))) && (i = Oi(r, r.lastOp == o))) a = Y(i.changes), 0 == ae(e.from, e.to) && 0 == ae(e.from, a.to) ? a.to = ci(e) : i.changes.push(Ci(t, e)); else {
                        var l = Y(r.done);
                        for (l && l.ranges || ki(t.sel, r.done), i = {
                            changes: [Ci(t, e)],
                            generation: r.generation
                        }, r.done.push(i); r.done.length > r.undoDepth;) r.done.shift(), r.done[0].ranges || r.done.shift()
                    }
                    r.done.push(n), r.generation = ++r.maxGeneration, r.lastModTime = r.lastSelTime = s, r.lastOp = r.lastSelOp = o, r.lastOrigin = r.lastSelOrigin = e.origin, a || yt(t, "historyAdded")
                }

                function Pi(t, e, n, o) {
                    var r = e.charAt(0);
                    return "*" == r || "+" == r && n.ranges.length == o.ranges.length && n.somethingSelected() == o.somethingSelected() && new Date - t.history.lastSelTime <= (t.cm ? t.cm.options.historyEventDelay : 500)
                }

                function Ei(t, e, n, o) {
                    var r = t.history, i = o && o.origin;
                    n == r.lastSelOp || i && r.lastSelOrigin == i && (r.lastModTime == r.lastSelTime && r.lastOrigin == i || Pi(t, i, Y(r.done), e)) ? r.done[r.done.length - 1] = e : ki(e, r.done), r.lastSelTime = +new Date, r.lastSelOrigin = i, r.lastSelOp = n, o && !1 !== o.clearRedo && Si(r.undone)
                }

                function ki(t, e) {
                    var n = Y(e);
                    n && n.ranges && n.equals(t) || e.push(t)
                }

                function Ai(t, e, n, o) {
                    var r = e["spans_" + t.id], i = 0;
                    t.iter(Math.max(t.first, n), Math.min(t.first + t.size, o), (function (n) {
                        n.markedSpans && ((r || (r = e["spans_" + t.id] = {}))[i] = n.markedSpans), ++i
                    }))
                }

                function ji(t) {
                    if (!t) return null;
                    for (var e, n = 0; n < t.length; ++n) t[n].marker.explicitlyCleared ? e || (e = t.slice(0, n)) : e && e.push(t[n]);
                    return e ? e.length ? e : null : t
                }

                function Mi(t, e) {
                    var n = e["spans_" + t.id];
                    if (!n) return null;
                    for (var o = [], r = 0; r < e.text.length; ++r) o.push(ji(n[r]));
                    return o
                }

                function Di(t, e) {
                    var n = Mi(t, e), o = Fe(t, e);
                    if (!n) return o;
                    if (!o) return n;
                    for (var r = 0; r < n.length; ++r) {
                        var i = n[r], a = o[r];
                        if (i && a) t:for (var s = 0; s < a.length; ++s) {
                            for (var l = a[s], c = 0; c < i.length; ++c) if (i[c].marker == l.marker) continue t;
                            i.push(l)
                        } else a && (n[r] = a)
                    }
                    return n
                }

                function Li(t, e, n) {
                    for (var o = [], r = 0; r < t.length; ++r) {
                        var i = t[r];
                        if (i.ranges) o.push(n ? ii.prototype.deepCopy.call(i) : i); else {
                            var a = i.changes, s = [];
                            o.push({changes: s});
                            for (var l = 0; l < a.length; ++l) {
                                var c = a[l], u = void 0;
                                if (s.push({
                                    from: c.from,
                                    to: c.to,
                                    text: c.text
                                }), e) for (var p in c) (u = p.match(/^spans_(\d+)$/)) && H(e, Number(u[1])) > -1 && (Y(s)[p] = c[p], delete c[p])
                            }
                        }
                    }
                    return o
                }

                function Ii(t, e, n, o) {
                    if (o) {
                        var r = t.anchor;
                        if (n) {
                            var i = ae(e, r) < 0;
                            i != ae(n, r) < 0 ? (r = e, e = n) : i != ae(e, n) < 0 && (e = n)
                        }
                        return new ai(r, e)
                    }
                    return new ai(n || e, e)
                }

                function Ni(t, e, n, o, r) {
                    null == r && (r = t.cm && (t.cm.display.shift || t.extend)), zi(t, new ii([Ii(t.sel.primary(), e, n, r)], 0), o)
                }

                function Ri(t, e, n) {
                    for (var o = [], r = t.cm && (t.cm.display.shift || t.extend), i = 0; i < t.sel.ranges.length; i++) o[i] = Ii(t.sel.ranges[i], e[i], null, r);
                    zi(t, si(t.cm, o, t.sel.primIndex), n)
                }

                function Vi(t, e, n, o) {
                    var r = t.sel.ranges.slice(0);
                    r[e] = n, zi(t, si(t.cm, r, t.sel.primIndex), o)
                }

                function Fi(t, e, n, o) {
                    zi(t, li(e, n), o)
                }

                function Hi(t, e, n) {
                    var o = {
                        ranges: e.ranges, update: function (e) {
                            this.ranges = [];
                            for (var n = 0; n < e.length; n++) this.ranges[n] = new ai(de(t, e[n].anchor), de(t, e[n].head))
                        }, origin: n && n.origin
                    };
                    return yt(t, "beforeSelectionChange", t, o), t.cm && yt(t.cm, "beforeSelectionChange", t.cm, o), o.ranges != e.ranges ? si(t.cm, o.ranges, o.ranges.length - 1) : e
                }

                function Ui(t, e, n) {
                    var o = t.history.done, r = Y(o);
                    r && r.ranges ? (o[o.length - 1] = e, Bi(t, e, n)) : zi(t, e, n)
                }

                function zi(t, e, n) {
                    Bi(t, e, n), Ei(t, t.sel, t.cm ? t.cm.curOp.id : NaN, n)
                }

                function Bi(t, e, n) {
                    (_t(t, "beforeSelectionChange") || t.cm && _t(t.cm, "beforeSelectionChange")) && (e = Hi(t, e, n));
                    var o = n && n.bias || (ae(e.primary().head, t.sel.primary().head) < 0 ? -1 : 1);
                    Wi(t, qi(t, e, o, !0)), n && !1 === n.scroll || !t.cm || "nocursor" == t.cm.getOption("readOnly") || lr(t.cm)
                }

                function Wi(t, e) {
                    e.equals(t.sel) || (t.sel = e, t.cm && (t.cm.curOp.updateInput = 1, t.cm.curOp.selectionChanged = !0, bt(t.cm)), kn(t, "cursorActivity", t))
                }

                function $i(t) {
                    Wi(t, qi(t, t.sel, null, !1))
                }

                function qi(t, e, n, o) {
                    for (var r, i = 0; i < e.ranges.length; i++) {
                        var a = e.ranges[i], s = e.ranges.length == t.sel.ranges.length && t.sel.ranges[i],
                            l = Ki(t, a.anchor, s && s.anchor, n, o), c = Ki(t, a.head, s && s.head, n, o);
                        (r || l != a.anchor || c != a.head) && (r || (r = e.ranges.slice(0, i)), r[i] = new ai(l, c))
                    }
                    return r ? si(t.cm, r, e.primIndex) : e
                }

                function Gi(t, e, n, o, r) {
                    var i = Jt(t, e.line);
                    if (i.markedSpans) for (var a = 0; a < i.markedSpans.length; ++a) {
                        var s = i.markedSpans[a], l = s.marker, c = "selectLeft" in l ? !l.selectLeft : l.inclusiveLeft,
                            u = "selectRight" in l ? !l.selectRight : l.inclusiveRight;
                        if ((null == s.from || (c ? s.from <= e.ch : s.from < e.ch)) && (null == s.to || (u ? s.to >= e.ch : s.to > e.ch))) {
                            if (r && (yt(l, "beforeCursorEnter"), l.explicitlyCleared)) {
                                if (i.markedSpans) {
                                    --a;
                                    continue
                                }
                                break
                            }
                            if (!l.atomic) continue;
                            if (n) {
                                var p = l.find(o < 0 ? 1 : -1), d = void 0;
                                if ((o < 0 ? u : c) && (p = Yi(t, p, -o, p && p.line == e.line ? i : null)), p && p.line == e.line && (d = ae(p, n)) && (o < 0 ? d < 0 : d > 0)) return Gi(t, p, e, o, r)
                            }
                            var f = l.find(o < 0 ? -1 : 1);
                            return (o < 0 ? c : u) && (f = Yi(t, f, o, f.line == e.line ? i : null)), f ? Gi(t, f, e, o, r) : null
                        }
                    }
                    return e
                }

                function Ki(t, e, n, o, r) {
                    var i = o || 1,
                        a = Gi(t, e, n, i, r) || !r && Gi(t, e, n, i, !0) || Gi(t, e, n, -i, r) || !r && Gi(t, e, n, -i, !0);
                    return a || (t.cantEdit = !0, ie(t.first, 0))
                }

                function Yi(t, e, n, o) {
                    return n < 0 && 0 == e.ch ? e.line > t.first ? de(t, ie(e.line - 1)) : null : n > 0 && e.ch == (o || Jt(t, e.line)).text.length ? e.line < t.first + t.size - 1 ? ie(e.line + 1, 0) : null : new ie(e.line, e.ch + n)
                }

                function Xi(t) {
                    t.setSelection(ie(t.firstLine(), 0), ie(t.lastLine()), B)
                }

                function Ji(t, e, n) {
                    var o = {
                        canceled: !1, from: e.from, to: e.to, text: e.text, origin: e.origin, cancel: function () {
                            return o.canceled = !0
                        }
                    };
                    return n && (o.update = function (e, n, r, i) {
                        e && (o.from = de(t, e)), n && (o.to = de(t, n)), r && (o.text = r), void 0 !== i && (o.origin = i)
                    }), yt(t, "beforeChange", t, o), t.cm && yt(t.cm, "beforeChange", t.cm, o), o.canceled ? (t.cm && (t.cm.curOp.updateInput = 2), null) : {
                        from: o.from,
                        to: o.to,
                        text: o.text,
                        origin: o.origin
                    }
                }

                function Zi(t, e, n) {
                    if (t.cm) {
                        if (!t.cm.curOp) return Dr(t.cm, Zi)(t, e, n);
                        if (t.cm.state.suppressEdits) return
                    }
                    if (!(_t(t, "beforeChange") || t.cm && _t(t.cm, "beforeChange")) || (e = Ji(t, e, !0))) {
                        var o = ke && !n && Ue(t, e.from, e.to);
                        if (o) for (var r = o.length - 1; r >= 0; --r) Qi(t, {
                            from: o[r].from,
                            to: o[r].to,
                            text: r ? [""] : e.text,
                            origin: e.origin
                        }); else Qi(t, e)
                    }
                }

                function Qi(t, e) {
                    if (1 != e.text.length || "" != e.text[0] || 0 != ae(e.from, e.to)) {
                        var n = pi(t, e);
                        Ti(t, e, n, t.cm ? t.cm.curOp.id : NaN), na(t, e, n, Fe(t, e));
                        var o = [];
                        mi(t, (function (t, n) {
                            n || -1 != H(o, t.history) || (sa(t.history, e), o.push(t.history)), na(t, e, null, Fe(t, e))
                        }))
                    }
                }

                function ta(t, e, n) {
                    var o = t.cm && t.cm.state.suppressEdits;
                    if (!o || n) {
                        for (var r, i = t.history, a = t.sel, s = "undo" == e ? i.done : i.undone, l = "undo" == e ? i.undone : i.done, c = 0; c < s.length && (r = s[c], n ? !r.ranges || r.equals(t.sel) : r.ranges); c++) ;
                        if (c != s.length) {
                            for (i.lastOrigin = i.lastSelOrigin = null; ;) {
                                if (!(r = s.pop()).ranges) {
                                    if (o) return void s.push(r);
                                    break
                                }
                                if (ki(r, l), n && !r.equals(t.sel)) return void zi(t, r, {clearRedo: !1});
                                a = r
                            }
                            var u = [];
                            ki(a, l), l.push({
                                changes: u,
                                generation: i.generation
                            }), i.generation = r.generation || ++i.maxGeneration;
                            for (var p = _t(t, "beforeChange") || t.cm && _t(t.cm, "beforeChange"), d = function (n) {
                                var o = r.changes[n];
                                if (o.origin = e, p && !Ji(t, o, !1)) return s.length = 0, {};
                                u.push(Ci(t, o));
                                var i = n ? pi(t, o) : Y(s);
                                na(t, o, i, Di(t, o)), !n && t.cm && t.cm.scrollIntoView({from: o.from, to: ci(o)});
                                var a = [];
                                mi(t, (function (t, e) {
                                    e || -1 != H(a, t.history) || (sa(t.history, o), a.push(t.history)), na(t, o, null, Di(t, o))
                                }))
                            }, f = r.changes.length - 1; f >= 0; --f) {
                                var h = d(f);
                                if (h) return h.v
                            }
                        }
                    }
                }

                function ea(t, e) {
                    if (0 != e && (t.first += e, t.sel = new ii(X(t.sel.ranges, (function (t) {
                        return new ai(ie(t.anchor.line + e, t.anchor.ch), ie(t.head.line + e, t.head.ch))
                    })), t.sel.primIndex), t.cm)) {
                        Vo(t.cm, t.first, t.first - e, e);
                        for (var n = t.cm.display, o = n.viewFrom; o < n.viewTo; o++) Fo(t.cm, o, "gutter")
                    }
                }

                function na(t, e, n, o) {
                    if (t.cm && !t.cm.curOp) return Dr(t.cm, na)(t, e, n, o);
                    if (e.to.line < t.first) ea(t, e.text.length - 1 - (e.to.line - e.from.line)); else if (!(e.from.line > t.lastLine())) {
                        if (e.from.line < t.first) {
                            var r = e.text.length - 1 - (t.first - e.from.line);
                            ea(t, r), e = {
                                from: ie(t.first, 0),
                                to: ie(e.to.line + r, e.to.ch),
                                text: [Y(e.text)],
                                origin: e.origin
                            }
                        }
                        var i = t.lastLine();
                        e.to.line > i && (e = {
                            from: e.from,
                            to: ie(i, Jt(t, i).text.length),
                            text: [e.text[0]],
                            origin: e.origin
                        }), e.removed = Zt(t, e.from, e.to), n || (n = pi(t, e)), t.cm ? oa(t.cm, e, o) : yi(t, e, o), Bi(t, n, B), t.cantEdit && Ki(t, ie(t.firstLine(), 0)) && (t.cantEdit = !1)
                    }
                }

                function oa(t, e, n) {
                    var o = t.doc, r = t.display, i = e.from, a = e.to, s = !1, l = i.line;
                    t.options.lineWrapping || (l = ee(Ze(Jt(o, i.line))), o.iter(l, a.line + 1, (function (t) {
                        if (t == r.maxLine) return s = !0, !0
                    }))), o.sel.contains(e.from, e.to) > -1 && bt(t), yi(o, e, n, Lo(t)), t.options.lineWrapping || (o.iter(l, i.line + e.text.length, (function (t) {
                        var e = sn(t);
                        e > r.maxLineLength && (r.maxLine = t, r.maxLineLength = e, r.maxLineChanged = !0, s = !1)
                    })), s && (t.curOp.updateMaxLine = !0)), Ee(o, i.line), Nr(t, 400);
                    var c = e.text.length - (a.line - i.line) - 1;
                    e.full ? Vo(t) : i.line != a.line || 1 != e.text.length || gi(t.doc, e) ? Vo(t, i.line, a.line + 1, c) : Fo(t, i.line, "text");
                    var u = _t(t, "changes"), p = _t(t, "change");
                    if (p || u) {
                        var d = {from: i, to: a, text: e.text, removed: e.removed, origin: e.origin};
                        p && kn(t, "change", t, d), u && (t.curOp.changeObjs || (t.curOp.changeObjs = [])).push(d)
                    }
                    t.display.selForContextMenu = null
                }

                function ra(t, e, n, o, r) {
                    var i;
                    o || (o = n), ae(o, n) < 0 && (n = (i = [o, n])[0], o = i[1]), "string" == typeof e && (e = t.splitLines(e)), Zi(t, {
                        from: n,
                        to: o,
                        text: e,
                        origin: r
                    })
                }

                function ia(t, e, n, o) {
                    n < t.line ? t.line += o : e < t.line && (t.line = e, t.ch = 0)
                }

                function aa(t, e, n, o) {
                    for (var r = 0; r < t.length; ++r) {
                        var i = t[r], a = !0;
                        if (i.ranges) {
                            i.copied || ((i = t[r] = i.deepCopy()).copied = !0);
                            for (var s = 0; s < i.ranges.length; s++) ia(i.ranges[s].anchor, e, n, o), ia(i.ranges[s].head, e, n, o)
                        } else {
                            for (var l = 0; l < i.changes.length; ++l) {
                                var c = i.changes[l];
                                if (n < c.from.line) c.from = ie(c.from.line + o, c.from.ch), c.to = ie(c.to.line + o, c.to.ch); else if (e <= c.to.line) {
                                    a = !1;
                                    break
                                }
                            }
                            a || (t.splice(0, r + 1), r = 0)
                        }
                    }
                }

                function sa(t, e) {
                    var n = e.from.line, o = e.to.line, r = e.text.length - (o - n) - 1;
                    aa(t.done, n, o, r), aa(t.undone, n, o, r)
                }

                function la(t, e, n, o) {
                    var r = e, i = e;
                    return "number" == typeof e ? i = Jt(t, pe(t, e)) : r = ee(e), null == r ? null : (o(i, r) && t.cm && Fo(t.cm, r, n), i)
                }

                function ca(t) {
                    this.lines = t, this.parent = null;
                    for (var e = 0, n = 0; n < t.length; ++n) t[n].parent = this, e += t[n].height;
                    this.height = e
                }

                function ua(t) {
                    this.children = t;
                    for (var e = 0, n = 0, o = 0; o < t.length; ++o) {
                        var r = t[o];
                        e += r.chunkSize(), n += r.height, r.parent = this
                    }
                    this.size = e, this.height = n, this.parent = null
                }

                ai.prototype.from = function () {
                    return ue(this.anchor, this.head)
                }, ai.prototype.to = function () {
                    return ce(this.anchor, this.head)
                }, ai.prototype.empty = function () {
                    return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch
                }, ca.prototype = {
                    chunkSize: function () {
                        return this.lines.length
                    }, removeInner: function (t, e) {
                        for (var n = t, o = t + e; n < o; ++n) {
                            var r = this.lines[n];
                            this.height -= r.height, pn(r), kn(r, "delete")
                        }
                        this.lines.splice(t, e)
                    }, collapse: function (t) {
                        t.push.apply(t, this.lines)
                    }, insertInner: function (t, e, n) {
                        this.height += n, this.lines = this.lines.slice(0, t).concat(e).concat(this.lines.slice(t));
                        for (var o = 0; o < e.length; ++o) e[o].parent = this
                    }, iterN: function (t, e, n) {
                        for (var o = t + e; t < o; ++t) if (n(this.lines[t])) return !0
                    }
                }, ua.prototype = {
                    chunkSize: function () {
                        return this.size
                    }, removeInner: function (t, e) {
                        this.size -= e;
                        for (var n = 0; n < this.children.length; ++n) {
                            var o = this.children[n], r = o.chunkSize();
                            if (t < r) {
                                var i = Math.min(e, r - t), a = o.height;
                                if (o.removeInner(t, i), this.height -= a - o.height, r == i && (this.children.splice(n--, 1), o.parent = null), 0 == (e -= i)) break;
                                t = 0
                            } else t -= r
                        }
                        if (this.size - e < 25 && (this.children.length > 1 || !(this.children[0] instanceof ca))) {
                            var s = [];
                            this.collapse(s), this.children = [new ca(s)], this.children[0].parent = this
                        }
                    }, collapse: function (t) {
                        for (var e = 0; e < this.children.length; ++e) this.children[e].collapse(t)
                    }, insertInner: function (t, e, n) {
                        this.size += e.length, this.height += n;
                        for (var o = 0; o < this.children.length; ++o) {
                            var r = this.children[o], i = r.chunkSize();
                            if (t <= i) {
                                if (r.insertInner(t, e, n), r.lines && r.lines.length > 50) {
                                    for (var a = r.lines.length % 25 + 25, s = a; s < r.lines.length;) {
                                        var l = new ca(r.lines.slice(s, s += 25));
                                        r.height -= l.height, this.children.splice(++o, 0, l), l.parent = this
                                    }
                                    r.lines = r.lines.slice(0, a), this.maybeSpill()
                                }
                                break
                            }
                            t -= i
                        }
                    }, maybeSpill: function () {
                        if (!(this.children.length <= 10)) {
                            var t = this;
                            do {
                                var e = new ua(t.children.splice(t.children.length - 5, 5));
                                if (t.parent) {
                                    t.size -= e.size, t.height -= e.height;
                                    var n = H(t.parent.children, t);
                                    t.parent.children.splice(n + 1, 0, e)
                                } else {
                                    var o = new ua(t.children);
                                    o.parent = t, t.children = [o, e], t = o
                                }
                                e.parent = t.parent
                            } while (t.children.length > 10);
                            t.parent.maybeSpill()
                        }
                    }, iterN: function (t, e, n) {
                        for (var o = 0; o < this.children.length; ++o) {
                            var r = this.children[o], i = r.chunkSize();
                            if (t < i) {
                                var a = Math.min(e, i - t);
                                if (r.iterN(t, a, n)) return !0;
                                if (0 == (e -= a)) break;
                                t = 0
                            } else t -= i
                        }
                    }
                };
                var pa = function (t, e, n) {
                    if (n) for (var o in n) n.hasOwnProperty(o) && (this[o] = n[o]);
                    this.doc = t, this.node = e
                };

                function da(t, e, n) {
                    an(e) < (t.curOp && t.curOp.scrollTop || t.doc.scrollTop) && sr(t, n)
                }

                function fa(t, e, n, o) {
                    var r = new pa(t, n, o), i = t.cm;
                    return i && r.noHScroll && (i.display.alignWidgets = !0), la(t, e, "widget", (function (e) {
                        var n = e.widgets || (e.widgets = []);
                        if (null == r.insertAt ? n.push(r) : n.splice(Math.min(n.length, Math.max(0, r.insertAt)), 0, r), r.line = e, i && !on(t, e)) {
                            var o = an(e) < t.scrollTop;
                            te(e, e.height + Bn(r)), o && sr(i, r.height), i.curOp.forceUpdate = !0
                        }
                        return !0
                    })), i && kn(i, "lineWidgetAdded", i, r, "number" == typeof e ? e : ee(e)), r
                }

                pa.prototype.clear = function () {
                    var t = this.doc.cm, e = this.line.widgets, n = this.line, o = ee(n);
                    if (null != o && e) {
                        for (var r = 0; r < e.length; ++r) e[r] == this && e.splice(r--, 1);
                        e.length || (n.widgets = null);
                        var i = Bn(this);
                        te(n, Math.max(0, n.height - i)), t && (Mr(t, (function () {
                            da(t, n, -i), Fo(t, o, "widget")
                        })), kn(t, "lineWidgetCleared", t, this, o))
                    }
                }, pa.prototype.changed = function () {
                    var t = this, e = this.height, n = this.doc.cm, o = this.line;
                    this.height = null;
                    var r = Bn(this) - e;
                    r && (on(this.doc, o) || te(o, o.height + r), n && Mr(n, (function () {
                        n.curOp.forceUpdate = !0, da(n, o, r), kn(n, "lineWidgetChanged", n, t, ee(o))
                    })))
                }, wt(pa);
                var ha = 0, va = function (t, e) {
                    this.lines = [], this.type = e, this.doc = t, this.id = ++ha
                };

                function ga(t, e, n, o, r) {
                    if (o && o.shared) return ma(t, e, n, o, r);
                    if (t.cm && !t.cm.curOp) return Dr(t.cm, ga)(t, e, n, o, r);
                    var i = new va(t, r), a = ae(e, n);
                    if (o && R(o, i, !1), a > 0 || 0 == a && !1 !== i.clearWhenEmpty) return i;
                    if (i.replacedWith && (i.collapsed = !0, i.widgetNode = A("span", [i.replacedWith], "CodeMirror-widget"), o.handleMouseEvents || i.widgetNode.setAttribute("cm-ignore-events", "true"), o.insertLeft && (i.widgetNode.insertLeft = !0)), i.collapsed) {
                        if (Je(t, e.line, e, n, i) || e.line != n.line && Je(t, n.line, e, n, i)) throw new Error("Inserting collapsed marker partially overlapping an existing one");
                        Me()
                    }
                    i.addToHistory && Ti(t, {from: e, to: n, origin: "markText"}, t.sel, NaN);
                    var s, l = e.line, c = t.cm;
                    if (t.iter(l, n.line + 1, (function (o) {
                        c && i.collapsed && !c.options.lineWrapping && Ze(o) == c.display.maxLine && (s = !0), i.collapsed && l != e.line && te(o, 0), Ne(o, new De(i, l == e.line ? e.ch : null, l == n.line ? n.ch : null), t.cm && t.cm.curOp), ++l
                    })), i.collapsed && t.iter(e.line, n.line + 1, (function (e) {
                        on(t, e) && te(e, 0)
                    })), i.clearOnEnter && ht(i, "beforeCursorEnter", (function () {
                        return i.clear()
                    })), i.readOnly && (je(), (t.history.done.length || t.history.undone.length) && t.clearHistory()), i.collapsed && (i.id = ++ha, i.atomic = !0), c) {
                        if (s && (c.curOp.updateMaxLine = !0), i.collapsed) Vo(c, e.line, n.line + 1); else if (i.className || i.startStyle || i.endStyle || i.css || i.attributes || i.title) for (var u = e.line; u <= n.line; u++) Fo(c, u, "text");
                        i.atomic && $i(c.doc), kn(c, "markerAdded", c, i)
                    }
                    return i
                }

                va.prototype.clear = function () {
                    if (!this.explicitlyCleared) {
                        var t = this.doc.cm, e = t && !t.curOp;
                        if (e && Sr(t), _t(this, "clear")) {
                            var n = this.find();
                            n && kn(this, "clear", n.from, n.to)
                        }
                        for (var o = null, r = null, i = 0; i < this.lines.length; ++i) {
                            var a = this.lines[i], s = Le(a.markedSpans, this);
                            t && !this.collapsed ? Fo(t, ee(a), "text") : t && (null != s.to && (r = ee(a)), null != s.from && (o = ee(a))), a.markedSpans = Ie(a.markedSpans, s), null == s.from && this.collapsed && !on(this.doc, a) && t && te(a, Ao(t.display))
                        }
                        if (t && this.collapsed && !t.options.lineWrapping) for (var l = 0; l < this.lines.length; ++l) {
                            var c = Ze(this.lines[l]), u = sn(c);
                            u > t.display.maxLineLength && (t.display.maxLine = c, t.display.maxLineLength = u, t.display.maxLineChanged = !0)
                        }
                        null != o && t && this.collapsed && Vo(t, o, r + 1), this.lines.length = 0, this.explicitlyCleared = !0, this.atomic && this.doc.cantEdit && (this.doc.cantEdit = !1, t && $i(t.doc)), t && kn(t, "markerCleared", t, this, o, r), e && Or(t), this.parent && this.parent.clear()
                    }
                }, va.prototype.find = function (t, e) {
                    var n, o;
                    null == t && "bookmark" == this.type && (t = 1);
                    for (var r = 0; r < this.lines.length; ++r) {
                        var i = this.lines[r], a = Le(i.markedSpans, this);
                        if (null != a.from && (n = ie(e ? i : ee(i), a.from), -1 == t)) return n;
                        if (null != a.to && (o = ie(e ? i : ee(i), a.to), 1 == t)) return o
                    }
                    return n && {from: n, to: o}
                }, va.prototype.changed = function () {
                    var t = this, e = this.find(-1, !0), n = this, o = this.doc.cm;
                    e && o && Mr(o, (function () {
                        var r = e.line, i = ee(e.line), a = eo(o, i);
                        if (a && (uo(a), o.curOp.selectionChanged = o.curOp.forceUpdate = !0), o.curOp.updateMaxLine = !0, !on(n.doc, r) && null != n.height) {
                            var s = n.height;
                            n.height = null;
                            var l = Bn(n) - s;
                            l && te(r, r.height + l)
                        }
                        kn(o, "markerChanged", o, t)
                    }))
                }, va.prototype.attachLine = function (t) {
                    if (!this.lines.length && this.doc.cm) {
                        var e = this.doc.cm.curOp;
                        e.maybeHiddenMarkers && -1 != H(e.maybeHiddenMarkers, this) || (e.maybeUnhiddenMarkers || (e.maybeUnhiddenMarkers = [])).push(this)
                    }
                    this.lines.push(t)
                }, va.prototype.detachLine = function (t) {
                    if (this.lines.splice(H(this.lines, t), 1), !this.lines.length && this.doc.cm) {
                        var e = this.doc.cm.curOp;
                        (e.maybeHiddenMarkers || (e.maybeHiddenMarkers = [])).push(this)
                    }
                }, wt(va);
                var ya = function (t, e) {
                    this.markers = t, this.primary = e;
                    for (var n = 0; n < t.length; ++n) t[n].parent = this
                };

                function ma(t, e, n, o, r) {
                    (o = R(o)).shared = !1;
                    var i = [ga(t, e, n, o, r)], a = i[0], s = o.widgetNode;
                    return mi(t, (function (t) {
                        s && (o.widgetNode = s.cloneNode(!0)), i.push(ga(t, de(t, e), de(t, n), o, r));
                        for (var l = 0; l < t.linked.length; ++l) if (t.linked[l].isParent) return;
                        a = Y(i)
                    })), new ya(i, a)
                }

                function ba(t) {
                    return t.findMarks(ie(t.first, 0), t.clipPos(ie(t.lastLine())), (function (t) {
                        return t.parent
                    }))
                }

                function _a(t, e) {
                    for (var n = 0; n < e.length; n++) {
                        var o = e[n], r = o.find(), i = t.clipPos(r.from), a = t.clipPos(r.to);
                        if (ae(i, a)) {
                            var s = ga(t, i, a, o.primary, o.primary.type);
                            o.markers.push(s), s.parent = o
                        }
                    }
                }

                function wa(t) {
                    for (var e = function (e) {
                        var n = t[e], o = [n.primary.doc];
                        mi(n.primary.doc, (function (t) {
                            return o.push(t)
                        }));
                        for (var r = 0; r < n.markers.length; r++) {
                            var i = n.markers[r];
                            -1 == H(o, i.doc) && (i.parent = null, n.markers.splice(r--, 1))
                        }
                    }, n = 0; n < t.length; n++) e(n)
                }

                ya.prototype.clear = function () {
                    if (!this.explicitlyCleared) {
                        this.explicitlyCleared = !0;
                        for (var t = 0; t < this.markers.length; ++t) this.markers[t].clear();
                        kn(this, "clear")
                    }
                }, ya.prototype.find = function (t, e) {
                    return this.primary.find(t, e)
                }, wt(ya);
                var xa = 0, Ca = function (t, e, n, o, r) {
                    if (!(this instanceof Ca)) return new Ca(t, e, n, o, r);
                    null == n && (n = 0), ua.call(this, [new ca([new cn("", null)])]), this.first = n, this.scrollTop = this.scrollLeft = 0, this.cantEdit = !1, this.cleanGeneration = 1, this.modeFrontier = this.highlightFrontier = n;
                    var i = ie(n, 0);
                    this.sel = li(i), this.history = new xi(null), this.id = ++xa, this.modeOption = e, this.lineSep = o, this.direction = "rtl" == r ? "rtl" : "ltr", this.extend = !1, "string" == typeof t && (t = this.splitLines(t)), yi(this, {
                        from: i,
                        to: i,
                        text: t
                    }), zi(this, li(i), B)
                };
                Ca.prototype = Q(ua.prototype, {
                    constructor: Ca, iter: function (t, e, n) {
                        n ? this.iterN(t - this.first, e - t, n) : this.iterN(this.first, this.first + this.size, t)
                    }, insert: function (t, e) {
                        for (var n = 0, o = 0; o < e.length; ++o) n += e[o].height;
                        this.insertInner(t - this.first, e, n)
                    }, remove: function (t, e) {
                        this.removeInner(t - this.first, e)
                    }, getValue: function (t) {
                        var e = Qt(this, this.first, this.first + this.size);
                        return !1 === t ? e : e.join(t || this.lineSeparator())
                    }, setValue: Ir((function (t) {
                        var e = ie(this.first, 0), n = this.first + this.size - 1;
                        Zi(this, {
                            from: e,
                            to: ie(n, Jt(this, n).text.length),
                            text: this.splitLines(t),
                            origin: "setValue",
                            full: !0
                        }, !0), this.cm && cr(this.cm, 0, 0), zi(this, li(e), B)
                    })), replaceRange: function (t, e, n, o) {
                        ra(this, t, e = de(this, e), n = n ? de(this, n) : e, o)
                    }, getRange: function (t, e, n) {
                        var o = Zt(this, de(this, t), de(this, e));
                        return !1 === n ? o : '' === n ? o.join('') : o.join(n || this.lineSeparator())
                    }, getLine: function (t) {
                        var e = this.getLineHandle(t);
                        return e && e.text
                    }, getLineHandle: function (t) {
                        if (oe(this, t)) return Jt(this, t)
                    }, getLineNumber: function (t) {
                        return ee(t)
                    }, getLineHandleVisualStart: function (t) {
                        return "number" == typeof t && (t = Jt(this, t)), Ze(t)
                    }, lineCount: function () {
                        return this.size
                    }, firstLine: function () {
                        return this.first
                    }, lastLine: function () {
                        return this.first + this.size - 1
                    }, clipPos: function (t) {
                        return de(this, t)
                    }, getCursor: function (t) {
                        var e = this.sel.primary();
                        return null == t || "head" == t ? e.head : "anchor" == t ? e.anchor : "end" == t || "to" == t || !1 === t ? e.to() : e.from()
                    }, listSelections: function () {
                        return this.sel.ranges
                    }, somethingSelected: function () {
                        return this.sel.somethingSelected()
                    }, setCursor: Ir((function (t, e, n) {
                        Fi(this, de(this, "number" == typeof t ? ie(t, e || 0) : t), null, n)
                    })), setSelection: Ir((function (t, e, n) {
                        Fi(this, de(this, t), de(this, e || t), n)
                    })), extendSelection: Ir((function (t, e, n) {
                        Ni(this, de(this, t), e && de(this, e), n)
                    })), extendSelections: Ir((function (t, e) {
                        Ri(this, he(this, t), e)
                    })), extendSelectionsBy: Ir((function (t, e) {
                        Ri(this, he(this, X(this.sel.ranges, t)), e)
                    })), setSelections: Ir((function (t, e, n) {
                        if (t.length) {
                            for (var o = [], r = 0; r < t.length; r++) o[r] = new ai(de(this, t[r].anchor), de(this, t[r].head || t[r].anchor));
                            null == e && (e = Math.min(t.length - 1, this.sel.primIndex)), zi(this, si(this.cm, o, e), n)
                        }
                    })), addSelection: Ir((function (t, e, n) {
                        var o = this.sel.ranges.slice(0);
                        o.push(new ai(de(this, t), de(this, e || t))), zi(this, si(this.cm, o, o.length - 1), n)
                    })), getSelection: function (t) {
                        for (var e, n = this.sel.ranges, o = 0; o < n.length; o++) {
                            var r = Zt(this, n[o].from(), n[o].to());
                            e = e ? e.concat(r) : r
                        }
                        return !1 === t ? e : e.join(t || this.lineSeparator())
                    }, getSelections: function (t) {
                        for (var e = [], n = this.sel.ranges, o = 0; o < n.length; o++) {
                            var r = Zt(this, n[o].from(), n[o].to());
                            !1 !== t && (r = r.join(t || this.lineSeparator())), e[o] = r
                        }
                        return e
                    }, replaceSelection: function (t, e, n) {
                        for (var o = [], r = 0; r < this.sel.ranges.length; r++) o[r] = t;
                        this.replaceSelections(o, e, n || "+input")
                    }, replaceSelections: Ir((function (t, e, n) {
                        for (var o = [], r = this.sel, i = 0; i < r.ranges.length; i++) {
                            var a = r.ranges[i];
                            o[i] = {from: a.from(), to: a.to(), text: this.splitLines(t[i]), origin: n}
                        }
                        for (var s = e && "end" != e && fi(this, o, e), l = o.length - 1; l >= 0; l--) Zi(this, o[l]);
                        s ? Ui(this, s) : this.cm && lr(this.cm)
                    })), undo: Ir((function () {
                        ta(this, "undo")
                    })), redo: Ir((function () {
                        ta(this, "redo")
                    })), undoSelection: Ir((function () {
                        ta(this, "undo", !0)
                    })), redoSelection: Ir((function () {
                        ta(this, "redo", !0)
                    })), setExtending: function (t) {
                        this.extend = t
                    }, getExtending: function () {
                        return this.extend
                    }, historySize: function () {
                        for (var t = this.history, e = 0, n = 0, o = 0; o < t.done.length; o++) t.done[o].ranges || ++e;
                        for (var r = 0; r < t.undone.length; r++) t.undone[r].ranges || ++n;
                        return {undo: e, redo: n}
                    }, clearHistory: function () {
                        var t = this;
                        this.history = new xi(this.history), mi(this, (function (e) {
                            return e.history = t.history
                        }), !0)
                    }, markClean: function () {
                        this.cleanGeneration = this.changeGeneration(!0)
                    }, changeGeneration: function (t) {
                        return t && (this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null), this.history.generation
                    }, isClean: function (t) {
                        return this.history.generation == (t || this.cleanGeneration)
                    }, getHistory: function () {
                        return {done: Li(this.history.done), undone: Li(this.history.undone)}
                    }, setHistory: function (t) {
                        var e = this.history = new xi(this.history);
                        e.done = Li(t.done.slice(0), null, !0), e.undone = Li(t.undone.slice(0), null, !0)
                    }, setGutterMarker: Ir((function (t, e, n) {
                        return la(this, t, "gutter", (function (t) {
                            var o = t.gutterMarkers || (t.gutterMarkers = {});
                            return o[e] = n, !n && ot(o) && (t.gutterMarkers = null), !0
                        }))
                    })), clearGutter: Ir((function (t) {
                        var e = this;
                        this.iter((function (n) {
                            n.gutterMarkers && n.gutterMarkers[t] && la(e, n, "gutter", (function () {
                                return n.gutterMarkers[t] = null, ot(n.gutterMarkers) && (n.gutterMarkers = null), !0
                            }))
                        }))
                    })), lineInfo: function (t) {
                        var e;
                        if ("number" == typeof t) {
                            if (!oe(this, t)) return null;
                            if (e = t, !(t = Jt(this, t))) return null
                        } else if (null == (e = ee(t))) return null;
                        return {
                            line: e,
                            handle: t,
                            text: t.text,
                            gutterMarkers: t.gutterMarkers,
                            textClass: t.textClass,
                            bgClass: t.bgClass,
                            wrapClass: t.wrapClass,
                            widgets: t.widgets
                        }
                    }, addLineClass: Ir((function (t, e, n) {
                        return la(this, t, "gutter" == e ? "gutter" : "class", (function (t) {
                            var o = "text" == e ? "textClass" : "background" == e ? "bgClass" : "gutter" == e ? "gutterClass" : "wrapClass";
                            if (t[o]) {
                                if (S(n).test(t[o])) return !1;
                                t[o] += " " + n
                            } else t[o] = n;
                            return !0
                        }))
                    })), removeLineClass: Ir((function (t, e, n) {
                        return la(this, t, "gutter" == e ? "gutter" : "class", (function (t) {
                            var o = "text" == e ? "textClass" : "background" == e ? "bgClass" : "gutter" == e ? "gutterClass" : "wrapClass",
                                r = t[o];
                            if (!r) return !1;
                            if (null == n) t[o] = null; else {
                                var i = r.match(S(n));
                                if (!i) return !1;
                                var a = i.index + i[0].length;
                                t[o] = r.slice(0, i.index) + (i.index && a != r.length ? " " : "") + r.slice(a) || null
                            }
                            return !0
                        }))
                    })), addLineWidget: Ir((function (t, e, n) {
                        return fa(this, t, e, n)
                    })), removeLineWidget: function (t) {
                        t.clear()
                    }, markText: function (t, e, n) {
                        return ga(this, de(this, t), de(this, e), n, n && n.type || "range")
                    }, setBookmark: function (t, e) {
                        var n = {
                            replacedWith: e && (null == e.nodeType ? e.widget : e),
                            insertLeft: e && e.insertLeft,
                            clearWhenEmpty: !1,
                            shared: e && e.shared,
                            handleMouseEvents: e && e.handleMouseEvents
                        };
                        return ga(this, t = de(this, t), t, n, "bookmark")
                    }, findMarksAt: function (t) {
                        var e = [], n = Jt(this, (t = de(this, t)).line).markedSpans;
                        if (n) for (var o = 0; o < n.length; ++o) {
                            var r = n[o];
                            (null == r.from || r.from <= t.ch) && (null == r.to || r.to >= t.ch) && e.push(r.marker.parent || r.marker)
                        }
                        return e
                    }, findMarks: function (t, e, n) {
                        t = de(this, t), e = de(this, e);
                        var o = [], r = t.line;
                        return this.iter(t.line, e.line + 1, (function (i) {
                            var a = i.markedSpans;
                            if (a) for (var s = 0; s < a.length; s++) {
                                var l = a[s];
                                null != l.to && r == t.line && t.ch >= l.to || null == l.from && r != t.line || null != l.from && r == e.line && l.from >= e.ch || n && !n(l.marker) || o.push(l.marker.parent || l.marker)
                            }
                            ++r
                        })), o
                    }, getAllMarks: function () {
                        var t = [];
                        return this.iter((function (e) {
                            var n = e.markedSpans;
                            if (n) for (var o = 0; o < n.length; ++o) null != n[o].from && t.push(n[o].marker)
                        })), t
                    }, posFromIndex: function (t) {
                        var e, n = this.first, o = this.lineSeparator().length;
                        return this.iter((function (r) {
                            var i = r.text.length + o;
                            if (i > t) return e = t, !0;
                            t -= i, ++n
                        })), de(this, ie(n, e))
                    }, indexFromPos: function (t) {
                        var e = (t = de(this, t)).ch;
                        if (t.line < this.first || t.ch < 0) return 0;
                        var n = this.lineSeparator().length;
                        return this.iter(this.first, t.line, (function (t) {
                            e += t.text.length + n
                        })), e
                    }, copy: function (t) {
                        var e = new Ca(Qt(this, this.first, this.first + this.size), this.modeOption, this.first, this.lineSep, this.direction);
                        return e.scrollTop = this.scrollTop, e.scrollLeft = this.scrollLeft, e.sel = this.sel, e.extend = !1, t && (e.history.undoDepth = this.history.undoDepth, e.setHistory(this.getHistory())), e
                    }, linkedDoc: function (t) {
                        t || (t = {});
                        var e = this.first, n = this.first + this.size;
                        null != t.from && t.from > e && (e = t.from), null != t.to && t.to < n && (n = t.to);
                        var o = new Ca(Qt(this, e, n), t.mode || this.modeOption, e, this.lineSep, this.direction);
                        return t.sharedHist && (o.history = this.history), (this.linked || (this.linked = [])).push({
                            doc: o,
                            sharedHist: t.sharedHist
                        }), o.linked = [{doc: this, isParent: !0, sharedHist: t.sharedHist}], _a(o, ba(this)), o
                    }, unlinkDoc: function (t) {
                        if (t instanceof Rs && (t = t.doc), this.linked) for (var e = 0; e < this.linked.length; ++e) if (this.linked[e].doc == t) {
                            this.linked.splice(e, 1), t.unlinkDoc(this), wa(ba(this));
                            break
                        }
                        if (t.history == this.history) {
                            var n = [t.id];
                            mi(t, (function (t) {
                                return n.push(t.id)
                            }), !0), t.history = new xi(null), t.history.done = Li(this.history.done, n), t.history.undone = Li(this.history.undone, n)
                        }
                    }, iterLinkedDocs: function (t) {
                        mi(this, t)
                    }, getMode: function () {
                        return this.mode
                    }, getEditor: function () {
                        return this.cm
                    }, splitLines: function (t) {
                        return this.lineSep ? t.split(this.lineSep) : Lt(t)
                    }, lineSeparator: function () {
                        return this.lineSep || "\n"
                    }, setDirection: Ir((function (t) {
                        "rtl" != t && (t = "ltr"), t != this.direction && (this.direction = t, this.iter((function (t) {
                            return t.order = null
                        })), this.cm && wi(this.cm))
                    }))
                }), Ca.prototype.eachLine = Ca.prototype.iter;
                var Sa = 0;

                function Oa(t) {
                    var e = this;
                    if (Ea(e), !mt(e, t) && !Wn(e.display, t)) {
                        xt(t), a && (Sa = +new Date);
                        var n = No(e, t, !0), o = t.dataTransfer.files;
                        if (n && !e.isReadOnly()) if (o && o.length && window.FileReader && window.File) for (var r = o.length, i = Array(r), s = 0, l = function () {
                            ++s == r && Dr(e, (function () {
                                var t = {
                                    from: n = de(e.doc, n), to: n, text: e.doc.splitLines(i.filter((function (t) {
                                        return null != t
                                    })).join(e.doc.lineSeparator())), origin: "paste"
                                };
                                Zi(e.doc, t), Ui(e.doc, li(de(e.doc, n), de(e.doc, ci(t))))
                            }))()
                        }, c = function (t, n) {
                            if (e.options.allowDropFileTypes && -1 == H(e.options.allowDropFileTypes, t.type)) l(); else {
                                var o = new FileReader;
                                o.onerror = function () {
                                    return l()
                                }, o.onload = function () {
                                    var t = o.result;
                                    /[\x00-\x08\x0e-\x1f]{2}/.test(t) || (i[n] = t), l()
                                }, o.readAsText(t)
                            }
                        }, u = 0; u < o.length; u++) c(o[u], u); else {
                            if (e.state.draggingText && e.doc.sel.contains(n) > -1) return e.state.draggingText(t), void setTimeout((function () {
                                return e.display.input.focus()
                            }), 20);
                            try {
                                var p = t.dataTransfer.getData("Text");
                                if (p) {
                                    var d;
                                    if (e.state.draggingText && !e.state.draggingText.copy && (d = e.listSelections()), Bi(e.doc, li(n, n)), d) for (var f = 0; f < d.length; ++f) ra(e.doc, "", d[f].anchor, d[f].head, "drag");
                                    e.replaceSelection(p, "around", "paste"), e.display.input.focus()
                                }
                            } catch (t) {
                            }
                        }
                    }
                }

                function Ta(t, e) {
                    if (a && (!t.state.draggingText || +new Date - Sa < 100)) Ot(e); else if (!mt(t, e) && !Wn(t.display, e) && (e.dataTransfer.setData("Text", t.getSelection()), e.dataTransfer.effectAllowed = "copyMove", e.dataTransfer.setDragImage && !d)) {
                        var n = k("img", null, null, "position: fixed; left: 0; top: 0;");
                        n.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", p && (n.width = n.height = 1, t.display.wrapper.appendChild(n), n._top = n.offsetTop), e.dataTransfer.setDragImage(n, 0, 0), p && n.parentNode.removeChild(n)
                    }
                }

                function Pa(t, e) {
                    var n = No(t, e);
                    if (n) {
                        var o = document.createDocumentFragment();
                        qo(t, n, o), t.display.dragCursor || (t.display.dragCursor = k("div", null, "CodeMirror-cursors CodeMirror-dragcursors"), t.display.lineSpace.insertBefore(t.display.dragCursor, t.display.cursorDiv)), E(t.display.dragCursor, o)
                    }
                }

                function Ea(t) {
                    t.display.dragCursor && (t.display.lineSpace.removeChild(t.display.dragCursor), t.display.dragCursor = null)
                }

                function ka(t) {
                    if (document.getElementsByClassName) {
                        for (var e = document.getElementsByClassName("CodeMirror"), n = [], o = 0; o < e.length; o++) {
                            var r = e[o].CodeMirror;
                            r && n.push(r)
                        }
                        n.length && n[0].operation((function () {
                            for (var e = 0; e < n.length; e++) t(n[e])
                        }))
                    }
                }

                var Aa = !1;

                function ja() {
                    Aa || (Ma(), Aa = !0)
                }

                function Ma() {
                    var t;
                    ht(window, "resize", (function () {
                        null == t && (t = setTimeout((function () {
                            t = null, ka(Da)
                        }), 100))
                    })), ht(window, "blur", (function () {
                        return ka(Qo)
                    }))
                }

                function Da(t) {
                    var e = t.display;
                    e.cachedCharWidth = e.cachedTextHeight = e.cachedPaddingH = null, e.scrollbarsClipped = !1, t.setSize()
                }

                for (var La = {
                    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"
                }, Ia = 0; Ia < 10; Ia++) La[Ia + 48] = La[Ia + 96] = String(Ia);
                for (var Na = 65; Na <= 90; Na++) La[Na] = String.fromCharCode(Na);
                for (var Ra = 1; Ra <= 12; Ra++) La[Ra + 111] = La[Ra + 63235] = "F" + Ra;
                var Va = {};

                function Fa(t) {
                    var e, n, o, r, i = t.split(/-(?!$)/);
                    t = i[i.length - 1];
                    for (var a = 0; a < i.length - 1; a++) {
                        var s = i[a];
                        if (/^(cmd|meta|m)$/i.test(s)) r = !0; else if (/^a(lt)?$/i.test(s)) e = !0; else if (/^(c|ctrl|control)$/i.test(s)) n = !0; else {
                            if (!/^s(hift)?$/i.test(s)) throw new Error("Unrecognized modifier name: " + s);
                            o = !0
                        }
                    }
                    return e && (t = "Alt-" + t), n && (t = "Ctrl-" + t), r && (t = "Cmd-" + t), o && (t = "Shift-" + t), t
                }

                function Ha(t) {
                    var e = {};
                    for (var n in t) if (t.hasOwnProperty(n)) {
                        var o = t[n];
                        if (/^(name|fallthrough|(de|at)tach)$/.test(n)) continue;
                        if ("..." == o) {
                            delete t[n];
                            continue
                        }
                        for (var r = X(n.split(" "), Fa), i = 0; i < r.length; i++) {
                            var a = void 0, s = void 0;
                            i == r.length - 1 ? (s = r.join(" "), a = o) : (s = r.slice(0, i + 1).join(" "), a = "...");
                            var l = e[s];
                            if (l) {
                                if (l != a) throw new Error("Inconsistent bindings for " + s)
                            } else e[s] = a
                        }
                        delete t[n]
                    }
                    for (var c in e) t[c] = e[c];
                    return t
                }

                function Ua(t, e, n, o) {
                    var r = (e = $a(e)).call ? e.call(t, o) : e[t];
                    if (!1 === r) return "nothing";
                    if ("..." === r) return "multi";
                    if (null != r && n(r)) return "handled";
                    if (e.fallthrough) {
                        if ("[object Array]" != Object.prototype.toString.call(e.fallthrough)) return Ua(t, e.fallthrough, n, o);
                        for (var i = 0; i < e.fallthrough.length; i++) {
                            var a = Ua(t, e.fallthrough[i], n, o);
                            if (a) return a
                        }
                    }
                }

                function za(t) {
                    var e = "string" == typeof t ? t : La[t.keyCode];
                    return "Ctrl" == e || "Alt" == e || "Shift" == e || "Mod" == e
                }

                function Ba(t, e, n) {
                    var o = t;
                    return e.altKey && "Alt" != o && (t = "Alt-" + t), (x ? e.metaKey : e.ctrlKey) && "Ctrl" != o && (t = "Ctrl-" + t), (x ? e.ctrlKey : e.metaKey) && "Mod" != o && (t = "Cmd-" + t), !n && e.shiftKey && "Shift" != o && (t = "Shift-" + t), t
                }

                function Wa(t, e) {
                    if (p && 34 == t.keyCode && t["char"]) return !1;
                    var n = La[t.keyCode];
                    return null != n && !t.altGraphKey && (3 == t.keyCode && t.code && (n = t.code), Ba(n, t, e))
                }

                function $a(t) {
                    return "string" == typeof t ? Va[t] : t
                }

                function qa(t, e) {
                    for (var n = t.doc.sel.ranges, o = [], r = 0; r < n.length; r++) {
                        for (var i = e(n[r]); o.length && ae(i.from, Y(o).to) <= 0;) {
                            var a = o.pop();
                            if (ae(a.from, i.from) < 0) {
                                i.from = a.from;
                                break
                            }
                        }
                        o.push(i)
                    }
                    Mr(t, (function () {
                        for (var e = o.length - 1; e >= 0; e--) ra(t.doc, "", o[e].from, o[e].to, "+delete");
                        lr(t)
                    }))
                }

                function Ga(t, e, n) {
                    var o = at(t.text, e + n, n);
                    return o < 0 || o > t.text.length ? null : o
                }

                function Ka(t, e, n) {
                    var o = Ga(t, e.ch, n);
                    return null == o ? null : new ie(e.line, o, n < 0 ? "after" : "before")
                }

                function Ya(t, e, n, o, r) {
                    if (t) {
                        "rtl" == e.doc.direction && (r = -r);
                        var i = dt(n, e.doc.direction);
                        if (i) {
                            var a, s = r < 0 ? Y(i) : i[0], l = r < 0 == (1 == s.level) ? "after" : "before";
                            if (s.level > 0 || "rtl" == e.doc.direction) {
                                var c = no(e, n);
                                a = r < 0 ? n.text.length - 1 : 0;
                                var u = oo(e, c, a).top;
                                a = st((function (t) {
                                    return oo(e, c, t).top == u
                                }), r < 0 == (1 == s.level) ? s.from : s.to - 1, a), "before" == l && (a = Ga(n, a, 1))
                            } else a = r < 0 ? s.to : s.from;
                            return new ie(o, a, l)
                        }
                    }
                    return new ie(o, r < 0 ? n.text.length : 0, r < 0 ? "before" : "after")
                }

                function Xa(t, e, n, o) {
                    var r = dt(e, t.doc.direction);
                    if (!r) return Ka(e, n, o);
                    n.ch >= e.text.length ? (n.ch = e.text.length, n.sticky = "before") : n.ch <= 0 && (n.ch = 0, n.sticky = "after");
                    var i = ut(r, n.ch, n.sticky), a = r[i];
                    if ("ltr" == t.doc.direction && a.level % 2 == 0 && (o > 0 ? a.to > n.ch : a.from < n.ch)) return Ka(e, n, o);
                    var s, l = function (t, n) {
                        return Ga(e, t instanceof ie ? t.ch : t, n)
                    }, c = function (n) {
                        return t.options.lineWrapping ? (s = s || no(t, e), Oo(t, e, s, n)) : {
                            begin: 0,
                            end: e.text.length
                        }
                    }, u = c("before" == n.sticky ? l(n, -1) : n.ch);
                    if ("rtl" == t.doc.direction || 1 == a.level) {
                        var p = 1 == a.level == o < 0, d = l(n, p ? 1 : -1);
                        if (null != d && (p ? d <= a.to && d <= u.end : d >= a.from && d >= u.begin)) {
                            var f = p ? "before" : "after";
                            return new ie(n.line, d, f)
                        }
                    }
                    var h = function (t, e, o) {
                        for (var i = function (t, e) {
                            return e ? new ie(n.line, l(t, 1), "before") : new ie(n.line, t, "after")
                        }; t >= 0 && t < r.length; t += e) {
                            var a = r[t], s = e > 0 == (1 != a.level), c = s ? o.begin : l(o.end, -1);
                            if (a.from <= c && c < a.to) return i(c, s);
                            if (c = s ? a.from : l(a.to, -1), o.begin <= c && c < o.end) return i(c, s)
                        }
                    }, v = h(i + o, o, u);
                    if (v) return v;
                    var g = o > 0 ? u.end : l(u.begin, -1);
                    return null == g || o > 0 && g == e.text.length || !(v = h(o > 0 ? 0 : r.length - 1, o, c(g))) ? null : v
                }

                Va.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"
                }, Va.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"
                }, Va.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"
                }, Va.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"]
                }, Va["default"] = m ? Va.macDefault : Va.pcDefault;
                var Ja = {
                    selectAll: Xi, singleSelection: function (t) {
                        return t.setSelection(t.getCursor("anchor"), t.getCursor("head"), B)
                    }, killLine: function (t) {
                        return qa(t, (function (e) {
                            if (e.empty()) {
                                var n = Jt(t.doc, e.head.line).text.length;
                                return e.head.ch == n && e.head.line < t.lastLine() ? {
                                    from: e.head,
                                    to: ie(e.head.line + 1, 0)
                                } : {from: e.head, to: ie(e.head.line, n)}
                            }
                            return {from: e.from(), to: e.to()}
                        }))
                    }, deleteLine: function (t) {
                        return qa(t, (function (e) {
                            return {from: ie(e.from().line, 0), to: de(t.doc, ie(e.to().line + 1, 0))}
                        }))
                    }, delLineLeft: function (t) {
                        return qa(t, (function (t) {
                            return {from: ie(t.from().line, 0), to: t.from()}
                        }))
                    }, delWrappedLineLeft: function (t) {
                        return qa(t, (function (e) {
                            var n = t.charCoords(e.head, "div").top + 5;
                            return {from: t.coordsChar({left: 0, top: n}, "div"), to: e.from()}
                        }))
                    }, delWrappedLineRight: function (t) {
                        return qa(t, (function (e) {
                            var n = t.charCoords(e.head, "div").top + 5,
                                o = t.coordsChar({left: t.display.lineDiv.offsetWidth + 100, top: n}, "div");
                            return {from: e.from(), to: o}
                        }))
                    }, undo: function (t) {
                        return t.undo()
                    }, redo: function (t) {
                        return t.redo()
                    }, undoSelection: function (t) {
                        return t.undoSelection()
                    }, redoSelection: function (t) {
                        return t.redoSelection()
                    }, goDocStart: function (t) {
                        return t.extendSelection(ie(t.firstLine(), 0))
                    }, goDocEnd: function (t) {
                        return t.extendSelection(ie(t.lastLine()))
                    }, goLineStart: function (t) {
                        return t.extendSelectionsBy((function (e) {
                            return Za(t, e.head.line)
                        }), {origin: "+move", bias: 1})
                    }, goLineStartSmart: function (t) {
                        return t.extendSelectionsBy((function (e) {
                            return ts(t, e.head)
                        }), {origin: "+move", bias: 1})
                    }, goLineEnd: function (t) {
                        return t.extendSelectionsBy((function (e) {
                            return Qa(t, e.head.line)
                        }), {origin: "+move", bias: -1})
                    }, goLineRight: function (t) {
                        return t.extendSelectionsBy((function (e) {
                            var n = t.cursorCoords(e.head, "div").top + 5;
                            return t.coordsChar({left: t.display.lineDiv.offsetWidth + 100, top: n}, "div")
                        }), $)
                    }, goLineLeft: function (t) {
                        return t.extendSelectionsBy((function (e) {
                            var n = t.cursorCoords(e.head, "div").top + 5;
                            return t.coordsChar({left: 0, top: n}, "div")
                        }), $)
                    }, goLineLeftSmart: function (t) {
                        return t.extendSelectionsBy((function (e) {
                            var n = t.cursorCoords(e.head, "div").top + 5, o = t.coordsChar({left: 0, top: n}, "div");
                            return o.ch < t.getLine(o.line).search(/\S/) ? ts(t, e.head) : o
                        }), $)
                    }, goLineUp: function (t) {
                        return t.moveV(-1, "line")
                    }, goLineDown: function (t) {
                        return t.moveV(1, "line")
                    }, goPageUp: function (t) {
                        return t.moveV(-1, "page")
                    }, goPageDown: function (t) {
                        return t.moveV(1, "page")
                    }, goCharLeft: function (t) {
                        return t.moveH(-1, "char")
                    }, goCharRight: function (t) {
                        return t.moveH(1, "char")
                    }, goColumnLeft: function (t) {
                        return t.moveH(-1, "column")
                    }, goColumnRight: function (t) {
                        return t.moveH(1, "column")
                    }, goWordLeft: function (t) {
                        return t.moveH(-1, "word")
                    }, goGroupRight: function (t) {
                        return t.moveH(1, "group")
                    }, goGroupLeft: function (t) {
                        return t.moveH(-1, "group")
                    }, goWordRight: function (t) {
                        return t.moveH(1, "word")
                    }, delCharBefore: function (t) {
                        return t.deleteH(-1, "codepoint")
                    }, delCharAfter: function (t) {
                        return t.deleteH(1, "char")
                    }, delWordBefore: function (t) {
                        return t.deleteH(-1, "word")
                    }, delWordAfter: function (t) {
                        return t.deleteH(1, "word")
                    }, delGroupBefore: function (t) {
                        return t.deleteH(-1, "group")
                    }, delGroupAfter: function (t) {
                        return t.deleteH(1, "group")
                    }, indentAuto: function (t) {
                        return t.indentSelection("smart")
                    }, indentMore: function (t) {
                        return t.indentSelection("add")
                    }, indentLess: function (t) {
                        return t.indentSelection("subtract")
                    }, insertTab: function (t) {
                        return t.replaceSelection("\t")
                    }, insertSoftTab: function (t) {
                        for (var e = [], n = t.listSelections(), o = t.options.tabSize, r = 0; r < n.length; r++) {
                            var i = n[r].from(), a = V(t.getLine(i.line), i.ch, o);
                            e.push(K(o - a % o))
                        }
                        t.replaceSelections(e)
                    }, defaultTab: function (t) {
                        t.somethingSelected() ? t.indentSelection("add") : t.execCommand("insertTab")
                    }, transposeChars: function (t) {
                        return Mr(t, (function () {
                            for (var e = t.listSelections(), n = [], o = 0; o < e.length; o++) if (e[o].empty()) {
                                var r = e[o].head, i = Jt(t.doc, r.line).text;
                                if (i) if (r.ch == i.length && (r = new ie(r.line, r.ch - 1)), r.ch > 0) r = new ie(r.line, r.ch + 1), t.replaceRange(i.charAt(r.ch - 1) + i.charAt(r.ch - 2), ie(r.line, r.ch - 2), r, "+transpose"); else if (r.line > t.doc.first) {
                                    var a = Jt(t.doc, r.line - 1).text;
                                    a && (r = new ie(r.line, 1), t.replaceRange(i.charAt(0) + t.doc.lineSeparator() + a.charAt(a.length - 1), ie(r.line - 1, a.length - 1), r, "+transpose"))
                                }
                                n.push(new ai(r, r))
                            }
                            t.setSelections(n)
                        }))
                    }, newlineAndIndent: function (t) {
                        return Mr(t, (function () {
                            for (var e = t.listSelections(), n = e.length - 1; n >= 0; n--) t.replaceRange(t.doc.lineSeparator(), e[n].anchor, e[n].head, "+input");
                            e = t.listSelections();
                            for (var o = 0; o < e.length; o++) t.indentLine(e[o].from().line, null, !0);
                            lr(t)
                        }))
                    }, openLine: function (t) {
                        return t.replaceSelection("\n", "start")
                    }, toggleOverwrite: function (t) {
                        return t.toggleOverwrite()
                    }
                };

                function Za(t, e) {
                    var n = Jt(t.doc, e), o = Ze(n);
                    return o != n && (e = ee(o)), Ya(!0, t, o, e, 1)
                }

                function Qa(t, e) {
                    var n = Jt(t.doc, e), o = Qe(n);
                    return o != n && (e = ee(o)), Ya(!0, t, n, e, -1)
                }

                function ts(t, e) {
                    var n = Za(t, e.line), o = Jt(t.doc, n.line), r = dt(o, t.doc.direction);
                    if (!r || 0 == r[0].level) {
                        var i = Math.max(n.ch, o.text.search(/\S/)), a = e.line == n.line && e.ch <= i && e.ch;
                        return ie(n.line, a ? 0 : i, n.sticky)
                    }
                    return n
                }

                function es(t, e, n) {
                    if ("string" == typeof e && !(e = Ja[e])) return !1;
                    t.display.input.ensurePolled();
                    var o = t.display.shift, r = !1;
                    try {
                        t.isReadOnly() && (t.state.suppressEdits = !0), n && (t.display.shift = !1), r = e(t) != z
                    } finally {
                        t.display.shift = o, t.state.suppressEdits = !1
                    }
                    return r
                }

                function ns(t, e, n) {
                    for (var o = 0; o < t.state.keyMaps.length; o++) {
                        var r = Ua(e, t.state.keyMaps[o], n, t);
                        if (r) return r
                    }
                    return t.options.extraKeys && Ua(e, t.options.extraKeys, n, t) || Ua(e, t.options.keyMap, n, t)
                }

                var os = new F;

                function rs(t, e, n, o) {
                    var r = t.state.keySeq;
                    if (r) {
                        if (za(e)) return "handled";
                        if (/\'$/.test(e) ? t.state.keySeq = null : os.set(50, (function () {
                            t.state.keySeq == r && (t.state.keySeq = null, t.display.input.reset())
                        })), is(t, r + " " + e, n, o)) return !0
                    }
                    return is(t, e, n, o)
                }

                function is(t, e, n, o) {
                    var r = ns(t, e, o);
                    return "multi" == r && (t.state.keySeq = e), "handled" == r && kn(t, "keyHandled", t, e, n), "handled" != r && "multi" != r || (xt(n), Yo(t)), !!r
                }

                function as(t, e) {
                    var n = Wa(e, !0);
                    return !!n && (e.shiftKey && !t.state.keySeq ? rs(t, "Shift-" + n, e, (function (e) {
                        return es(t, e, !0)
                    })) || rs(t, n, e, (function (e) {
                        if ("string" == typeof e ? /^go[A-Z]/.test(e) : e.motion) return es(t, e)
                    })) : rs(t, n, e, (function (e) {
                        return es(t, e)
                    })))
                }

                function ss(t, e, n) {
                    return rs(t, "'" + n + "'", e, (function (e) {
                        return es(t, e, !0)
                    }))
                }

                var ls = null;

                function cs(t) {
                    var e = this;
                    if (!(t.target && t.target != e.display.input.getField() || (e.curOp.focus = M(), mt(e, t)))) {
                        a && s < 11 && 27 == t.keyCode && (t.returnValue = !1);
                        var o = t.keyCode;
                        e.display.shift = 16 == o || t.shiftKey;
                        var r = as(e, t);
                        p && (ls = r ? o : null, r || 88 != o || Nt || !(m ? t.metaKey : t.ctrlKey) || e.replaceSelection("", null, "cut")), n && !m && !r && 46 == o && t.shiftKey && !t.ctrlKey && document.execCommand && document.execCommand("cut"), 18 != o || /\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className) || us(e)
                    }
                }

                function us(t) {
                    var e = t.display.lineDiv;

                    function n(t) {
                        18 != t.keyCode && t.altKey || (T(e, "CodeMirror-crosshair"), gt(document, "keyup", n), gt(document, "mouseover", n))
                    }

                    D(e, "CodeMirror-crosshair"), ht(document, "keyup", n), ht(document, "mouseover", n)
                }

                function ps(t) {
                    16 == t.keyCode && (this.doc.sel.shift = !1), mt(this, t)
                }

                function ds(t) {
                    var e = this;
                    if (!(t.target && t.target != e.display.input.getField() || Wn(e.display, t) || mt(e, t) || t.ctrlKey && !t.altKey || m && t.metaKey)) {
                        var n = t.keyCode, o = t.charCode;
                        if (p && n == ls) return ls = null, void xt(t);
                        if (!p || t.which && !(t.which < 10) || !as(e, t)) {
                            var r = String.fromCharCode(null == o ? n : o);
                            "\b" != r && (ss(e, t, r) || e.display.input.onKeyPress(t))
                        }
                    }
                }

                var fs, hs, vs = 400, gs = function (t, e, n) {
                    this.time = t, this.pos = e, this.button = n
                };

                function ys(t, e) {
                    var n = +new Date;
                    return hs && hs.compare(n, t, e) ? (fs = hs = null, "triple") : fs && fs.compare(n, t, e) ? (hs = new gs(n, t, e), fs = null, "double") : (fs = new gs(n, t, e), hs = null, "single")
                }

                function ms(t) {
                    var e = this, n = e.display;
                    if (!(mt(e, t) || n.activeTouch && n.input.supportsTouch())) if (n.input.ensurePolled(), n.shift = t.shiftKey, Wn(n, t)) l || (n.scroller.draggable = !1, setTimeout((function () {
                        return n.scroller.draggable = !0
                    }), 100)); else if (!Ps(e, t)) {
                        var o = No(e, t), r = Pt(t), i = o ? ys(o, r) : "single";
                        window.focus(), 1 == r && e.state.selectingText && e.state.selectingText(t), o && bs(e, r, o, i, t) || (1 == r ? o ? ws(e, o, i, t) : Tt(t) == n.scroller && xt(t) : 2 == r ? (o && Ni(e.doc, o), setTimeout((function () {
                            return n.input.focus()
                        }), 20)) : 3 == r && (C ? e.display.input.onContextMenu(t) : Jo(e)))
                    }
                }

                function bs(t, e, n, o, r) {
                    var i = "Click";
                    return "double" == o ? i = "Double" + i : "triple" == o && (i = "Triple" + i), rs(t, Ba(i = (1 == e ? "Left" : 2 == e ? "Middle" : "Right") + i, r), r, (function (e) {
                        if ("string" == typeof e && (e = Ja[e]), !e) return !1;
                        var o = !1;
                        try {
                            t.isReadOnly() && (t.state.suppressEdits = !0), o = e(t, n) != z
                        } finally {
                            t.state.suppressEdits = !1
                        }
                        return o
                    }))
                }

                function _s(t, e, n) {
                    var o = t.getOption("configureMouse"), r = o ? o(t, e, n) : {};
                    if (null == r.unit) {
                        var i = b ? n.shiftKey && n.metaKey : n.altKey;
                        r.unit = i ? "rectangle" : "single" == e ? "char" : "double" == e ? "word" : "line"
                    }
                    return (null == r.extend || t.doc.extend) && (r.extend = t.doc.extend || n.shiftKey), null == r.addNew && (r.addNew = m ? n.metaKey : n.ctrlKey), null == r.moveOnDrag && (r.moveOnDrag = !(m ? n.altKey : n.ctrlKey)), r
                }

                function ws(t, e, n, o) {
                    a ? setTimeout(N(Xo, t), 0) : t.curOp.focus = M();
                    var r, i = _s(t, n, o), s = t.doc.sel;
                    t.options.dragDrop && At && !t.isReadOnly() && "single" == n && (r = s.contains(e)) > -1 && (ae((r = s.ranges[r]).from(), e) < 0 || e.xRel > 0) && (ae(r.to(), e) > 0 || e.xRel < 0) ? xs(t, o, e, i) : Ss(t, o, e, i)
                }

                function xs(t, e, n, o) {
                    var r = t.display, i = !1, c = Dr(t, (function (e) {
                        l && (r.scroller.draggable = !1), t.state.draggingText = !1, t.state.delayingBlurEvent && (t.hasFocus() ? t.state.delayingBlurEvent = !1 : Jo(t)), gt(r.wrapper.ownerDocument, "mouseup", c), gt(r.wrapper.ownerDocument, "mousemove", u), gt(r.scroller, "dragstart", p), gt(r.scroller, "drop", c), i || (xt(e), o.addNew || Ni(t.doc, n, null, null, o.extend), l && !d || a && 9 == s ? setTimeout((function () {
                            r.wrapper.ownerDocument.body.focus({preventScroll: !0}), r.input.focus()
                        }), 20) : r.input.focus())
                    })), u = function (t) {
                        i = i || Math.abs(e.clientX - t.clientX) + Math.abs(e.clientY - t.clientY) >= 10
                    }, p = function () {
                        return i = !0
                    };
                    l && (r.scroller.draggable = !0), t.state.draggingText = c, c.copy = !o.moveOnDrag, ht(r.wrapper.ownerDocument, "mouseup", c), ht(r.wrapper.ownerDocument, "mousemove", u), ht(r.scroller, "dragstart", p), ht(r.scroller, "drop", c), t.state.delayingBlurEvent = !0, setTimeout((function () {
                        return r.input.focus()
                    }), 20), r.scroller.dragDrop && r.scroller.dragDrop()
                }

                function Cs(t, e, n) {
                    if ("char" == n) return new ai(e, e);
                    if ("word" == n) return t.findWordAt(e);
                    if ("line" == n) return new ai(ie(e.line, 0), de(t.doc, ie(e.line + 1, 0)));
                    var o = n(t, e);
                    return new ai(o.from, o.to)
                }

                function Ss(t, e, n, o) {
                    a && Jo(t);
                    var r = t.display, i = t.doc;
                    xt(e);
                    var s, l, c = i.sel, u = c.ranges;
                    if (o.addNew && !o.extend ? (l = i.sel.contains(n), s = l > -1 ? u[l] : new ai(n, n)) : (s = i.sel.primary(), l = i.sel.primIndex), "rectangle" == o.unit) o.addNew || (s = new ai(n, n)), n = No(t, e, !0, !0), l = -1; else {
                        var p = Cs(t, n, o.unit);
                        s = o.extend ? Ii(s, p.anchor, p.head, o.extend) : p
                    }
                    o.addNew ? -1 == l ? (l = u.length, zi(i, si(t, u.concat([s]), l), {
                        scroll: !1,
                        origin: "*mouse"
                    })) : u.length > 1 && u[l].empty() && "char" == o.unit && !o.extend ? (zi(i, si(t, u.slice(0, l).concat(u.slice(l + 1)), 0), {
                        scroll: !1,
                        origin: "*mouse"
                    }), c = i.sel) : Vi(i, l, s, W) : (l = 0, zi(i, new ii([s], 0), W), c = i.sel);
                    var d = n;

                    function f(e) {
                        if (0 != ae(d, e)) if (d = e, "rectangle" == o.unit) {
                            for (var r = [], a = t.options.tabSize, u = V(Jt(i, n.line).text, n.ch, a), p = V(Jt(i, e.line).text, e.ch, a), f = Math.min(u, p), h = Math.max(u, p), v = Math.min(n.line, e.line), g = Math.min(t.lastLine(), Math.max(n.line, e.line)); v <= g; v++) {
                                var y = Jt(i, v).text, m = q(y, f, a);
                                f == h ? r.push(new ai(ie(v, m), ie(v, m))) : y.length > m && r.push(new ai(ie(v, m), ie(v, q(y, h, a))))
                            }
                            r.length || r.push(new ai(n, n)), zi(i, si(t, c.ranges.slice(0, l).concat(r), l), {
                                origin: "*mouse",
                                scroll: !1
                            }), t.scrollIntoView(e)
                        } else {
                            var b, _ = s, w = Cs(t, e, o.unit), x = _.anchor;
                            ae(w.anchor, x) > 0 ? (b = w.head, x = ue(_.from(), w.anchor)) : (b = w.anchor, x = ce(_.to(), w.head));
                            var C = c.ranges.slice(0);
                            C[l] = Os(t, new ai(de(i, x), b)), zi(i, si(t, C, l), W)
                        }
                    }

                    var h = r.wrapper.getBoundingClientRect(), v = 0;

                    function g(e) {
                        var n = ++v, a = No(t, e, !0, "rectangle" == o.unit);
                        if (a) if (0 != ae(a, d)) {
                            t.curOp.focus = M(), f(a);
                            var s = nr(r, i);
                            (a.line >= s.to || a.line < s.from) && setTimeout(Dr(t, (function () {
                                v == n && g(e)
                            })), 150)
                        } else {
                            var l = e.clientY < h.top ? -20 : e.clientY > h.bottom ? 20 : 0;
                            l && setTimeout(Dr(t, (function () {
                                v == n && (r.scroller.scrollTop += l, g(e))
                            })), 50)
                        }
                    }

                    function y(e) {
                        t.state.selectingText = !1, v = 1 / 0, e && (xt(e), r.input.focus()), gt(r.wrapper.ownerDocument, "mousemove", m), gt(r.wrapper.ownerDocument, "mouseup", b), i.history.lastSelOrigin = null
                    }

                    var m = Dr(t, (function (t) {
                        0 !== t.buttons && Pt(t) ? g(t) : y(t)
                    })), b = Dr(t, y);
                    t.state.selectingText = b, ht(r.wrapper.ownerDocument, "mousemove", m), ht(r.wrapper.ownerDocument, "mouseup", b)
                }

                function Os(t, e) {
                    var n = e.anchor, o = e.head, r = Jt(t.doc, n.line);
                    if (0 == ae(n, o) && n.sticky == o.sticky) return e;
                    var i = dt(r);
                    if (!i) return e;
                    var a = ut(i, n.ch, n.sticky), s = i[a];
                    if (s.from != n.ch && s.to != n.ch) return e;
                    var l, c = a + (s.from == n.ch == (1 != s.level) ? 0 : 1);
                    if (0 == c || c == i.length) return e;
                    if (o.line != n.line) l = (o.line - n.line) * ("ltr" == t.doc.direction ? 1 : -1) > 0; else {
                        var u = ut(i, o.ch, o.sticky), p = u - a || (o.ch - n.ch) * (1 == s.level ? -1 : 1);
                        l = u == c - 1 || u == c ? p < 0 : p > 0
                    }
                    var d = i[c + (l ? -1 : 0)], f = l == (1 == d.level), h = f ? d.from : d.to,
                        v = f ? "after" : "before";
                    return n.ch == h && n.sticky == v ? e : new ai(new ie(n.line, h, v), o)
                }

                function Ts(t, e, n, o) {
                    var r, i;
                    if (e.touches) r = e.touches[0].clientX, i = e.touches[0].clientY; else try {
                        r = e.clientX, i = e.clientY
                    } catch (t) {
                        return !1
                    }
                    if (r >= Math.floor(t.display.gutters.getBoundingClientRect().right)) return !1;
                    o && xt(e);
                    var a = t.display, s = a.lineDiv.getBoundingClientRect();
                    if (i > s.bottom || !_t(t, n)) return St(e);
                    i -= s.top - a.viewOffset;
                    for (var l = 0; l < t.display.gutterSpecs.length; ++l) {
                        var c = a.gutters.childNodes[l];
                        if (c && c.getBoundingClientRect().right >= r) return yt(t, n, t, ne(t.doc, i), t.display.gutterSpecs[l].className, e), St(e)
                    }
                }

                function Ps(t, e) {
                    return Ts(t, e, "gutterClick", !0)
                }

                function Es(t, e) {
                    Wn(t.display, e) || ks(t, e) || mt(t, e, "contextmenu") || C || t.display.input.onContextMenu(e)
                }

                function ks(t, e) {
                    return !!_t(t, "gutterContextMenu") && Ts(t, e, "gutterContextMenu", !1)
                }

                function As(t) {
                    t.display.wrapper.className = t.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + t.options.theme.replace(/(^|\s)\s*/g, " cm-s-"), fo(t)
                }

                gs.prototype.compare = function (t, e, n) {
                    return this.time + vs > t && 0 == ae(e, this.pos) && n == this.button
                };
                var js = {
                    toString: function () {
                        return "CodeMirror.Init"
                    }
                }, Ms = {}, Ds = {};

                function Ls(t) {
                    var e = t.optionHandlers;

                    function n(n, o, r, i) {
                        t.defaults[n] = o, r && (e[n] = i ? function (t, e, n) {
                            n != js && r(t, e, n)
                        } : r)
                    }

                    t.defineOption = n, t.Init = js, n("value", "", (function (t, e) {
                        return t.setValue(e)
                    }), !0), n("mode", null, (function (t, e) {
                        t.doc.modeOption = e, hi(t)
                    }), !0), n("indentUnit", 2, hi, !0), n("indentWithTabs", !1), n("smartIndent", !0), n("tabSize", 4, (function (t) {
                        vi(t), fo(t), Vo(t)
                    }), !0), n("lineSeparator", null, (function (t, e) {
                        if (t.doc.lineSep = e, e) {
                            var n = [], o = t.doc.first;
                            t.doc.iter((function (t) {
                                for (var r = 0; ;) {
                                    var i = t.text.indexOf(e, r);
                                    if (-1 == i) break;
                                    r = i + e.length, n.push(ie(o, i))
                                }
                                o++
                            }));
                            for (var r = n.length - 1; r >= 0; r--) ra(t.doc, e, n[r], ie(n[r].line, n[r].ch + e.length))
                        }
                    })), n("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, (function (t, e, n) {
                        t.state.specialChars = new RegExp(e.source + (e.test("\t") ? "" : "|\t"), "g"), n != js && t.refresh()
                    })), n("specialCharPlaceholder", gn, (function (t) {
                        return t.refresh()
                    }), !0), n("electricChars", !0), n("inputStyle", y ? "contenteditable" : "textarea", (function () {
                        throw new Error("inputStyle can not (yet) be changed in a running editor")
                    }), !0), n("spellcheck", !1, (function (t, e) {
                        return t.getInputField().spellcheck = e
                    }), !0), n("autocorrect", !1, (function (t, e) {
                        return t.getInputField().autocorrect = e
                    }), !0), n("autocapitalize", !1, (function (t, e) {
                        return t.getInputField().autocapitalize = e
                    }), !0), n("rtlMoveVisually", !_), n("wholeLineUpdateBefore", !0), n("theme", "default", (function (t) {
                        As(t), Zr(t)
                    }), !0), n("keyMap", "default", (function (t, e, n) {
                        var o = $a(e), r = n != js && $a(n);
                        r && r.detach && r.detach(t, o), o.attach && o.attach(t, r || null)
                    })), n("extraKeys", null), n("configureMouse", null), n("lineWrapping", !1, Ns, !0), n("gutters", [], (function (t, e) {
                        t.display.gutterSpecs = Xr(e, t.options.lineNumbers), Zr(t)
                    }), !0), n("fixedGutter", !0, (function (t, e) {
                        t.display.gutters.style.left = e ? Do(t.display) + "px" : "0", t.refresh()
                    }), !0), n("coverGutterNextToScrollbar", !1, (function (t) {
                        return br(t)
                    }), !0), n("scrollbarStyle", "native", (function (t) {
                        xr(t), br(t), t.display.scrollbars.setScrollTop(t.doc.scrollTop), t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)
                    }), !0), n("lineNumbers", !1, (function (t, e) {
                        t.display.gutterSpecs = Xr(t.options.gutters, e), Zr(t)
                    }), !0), n("firstLineNumber", 1, Zr, !0), n("lineNumberFormatter", (function (t) {
                        return t
                    }), Zr, !0), n("showCursorWhenSelecting", !1, Wo, !0), n("resetSelectionOnContextMenu", !0), n("lineWiseCopyCut", !0), n("pasteLinesPerSelection", !0), n("selectionsMayTouch", !1), n("readOnly", !1, (function (t, e) {
                        "nocursor" == e && (Qo(t), t.display.input.blur()), t.display.input.readOnlyChanged(e)
                    })), n("screenReaderLabel", null, (function (t, e) {
                        e = '' === e ? null : e, t.display.input.screenReaderLabelChanged(e)
                    })), n("disableInput", !1, (function (t, e) {
                        e || t.display.input.reset()
                    }), !0), n("dragDrop", !0, Is), n("allowDropFileTypes", null), n("cursorBlinkRate", 530), n("cursorScrollMargin", 0), n("cursorHeight", 1, Wo, !0), n("singleCursorHeightPerLine", !0, Wo, !0), n("workTime", 100), n("workDelay", 100), n("flattenSpans", !0, vi, !0), n("addModeClass", !1, vi, !0), n("pollInterval", 100), n("undoDepth", 200, (function (t, e) {
                        return t.doc.history.undoDepth = e
                    })), n("historyEventDelay", 1250), n("viewportMargin", 10, (function (t) {
                        return t.refresh()
                    }), !0), n("maxHighlightLength", 1e4, vi, !0), n("moveInputWithCursor", !0, (function (t, e) {
                        e || t.display.input.resetPosition()
                    })), n("tabindex", null, (function (t, e) {
                        return t.display.input.getField().tabIndex = e || ""
                    })), n("autofocus", null), n("direction", "ltr", (function (t, e) {
                        return t.doc.setDirection(e)
                    }), !0), n("phrases", null)
                }

                function Is(t, e, n) {
                    if (!e != !(n && n != js)) {
                        var o = t.display.dragFunctions, r = e ? ht : gt;
                        r(t.display.scroller, "dragstart", o.start), r(t.display.scroller, "dragenter", o.enter), r(t.display.scroller, "dragover", o.over), r(t.display.scroller, "dragleave", o.leave), r(t.display.scroller, "drop", o.drop)
                    }
                }

                function Ns(t) {
                    t.options.lineWrapping ? (D(t.display.wrapper, "CodeMirror-wrap"), t.display.sizer.style.minWidth = "", t.display.sizerWidth = null) : (T(t.display.wrapper, "CodeMirror-wrap"), ln(t)), Io(t), Vo(t), fo(t), setTimeout((function () {
                        return br(t)
                    }), 100)
                }

                function Rs(t, e) {
                    var n = this;
                    if (!(this instanceof Rs)) return new Rs(t, e);
                    this.options = e = e ? R(e) : {}, R(Ms, e, !1);
                    var o = e.value;
                    "string" == typeof o ? o = new Ca(o, e.mode, null, e.lineSeparator, e.direction) : e.mode && (o.modeOption = e.mode), this.doc = o;
                    var r = new Rs.inputStyles[e.inputStyle](this), i = this.display = new Qr(t, o, r, e);
                    for (var c in i.wrapper.CodeMirror = this, As(this), e.lineWrapping && (this.display.wrapper.className += " CodeMirror-wrap"), xr(this), this.state = {
                        keyMaps: [],
                        overlays: [],
                        modeGen: 0,
                        overwrite: !1,
                        delayingBlurEvent: !1,
                        focused: !1,
                        suppressEdits: !1,
                        pasteIncoming: -1,
                        cutIncoming: -1,
                        selectingText: !1,
                        draggingText: !1,
                        highlight: new F,
                        keySeq: null,
                        specialChars: null
                    }, e.autofocus && !y && i.input.focus(), a && s < 11 && setTimeout((function () {
                        return n.display.input.reset(!0)
                    }), 20), Vs(this), ja(), Sr(this), this.curOp.forceUpdate = !0, bi(this, o), e.autofocus && !y || this.hasFocus() ? setTimeout((function () {
                        n.hasFocus() && !n.state.focused && Zo(n)
                    }), 20) : Qo(this), Ds) Ds.hasOwnProperty(c) && Ds[c](this, e[c], js);
                    Yr(this), e.finishInit && e.finishInit(this);
                    for (var u = 0; u < Fs.length; ++u) Fs[u](this);
                    Or(this), l && e.lineWrapping && "optimizelegibility" == getComputedStyle(i.lineDiv).textRendering && (i.lineDiv.style.textRendering = "auto")
                }

                function Vs(t) {
                    var e = t.display;
                    ht(e.scroller, "mousedown", Dr(t, ms)), ht(e.scroller, "dblclick", a && s < 11 ? Dr(t, (function (e) {
                        if (!mt(t, e)) {
                            var n = No(t, e);
                            if (n && !Ps(t, e) && !Wn(t.display, e)) {
                                xt(e);
                                var o = t.findWordAt(n);
                                Ni(t.doc, o.anchor, o.head)
                            }
                        }
                    })) : function (e) {
                        return mt(t, e) || xt(e)
                    }), ht(e.scroller, "contextmenu", (function (e) {
                        return Es(t, e)
                    })), ht(e.input.getField(), "contextmenu", (function (n) {
                        e.scroller.contains(n.target) || Es(t, n)
                    }));
                    var n, o = {end: 0};

                    function r() {
                        e.activeTouch && (n = setTimeout((function () {
                            return e.activeTouch = null
                        }), 1e3), (o = e.activeTouch).end = +new Date)
                    }

                    function i(t) {
                        if (1 != t.touches.length) return !1;
                        var e = t.touches[0];
                        return e.radiusX <= 1 && e.radiusY <= 1
                    }

                    function l(t, e) {
                        if (null == e.left) return !0;
                        var n = e.left - t.left, o = e.top - t.top;
                        return n * n + o * o > 20 * 20
                    }

                    ht(e.scroller, "touchstart", (function (r) {
                        if (!mt(t, r) && !i(r) && !Ps(t, r)) {
                            e.input.ensurePolled(), clearTimeout(n);
                            var a = +new Date;
                            e.activeTouch = {
                                start: a,
                                moved: !1,
                                prev: a - o.end <= 300 ? o : null
                            }, 1 == r.touches.length && (e.activeTouch.left = r.touches[0].pageX, e.activeTouch.top = r.touches[0].pageY)
                        }
                    })), ht(e.scroller, "touchmove", (function () {
                        e.activeTouch && (e.activeTouch.moved = !0)
                    })), ht(e.scroller, "touchend", (function (n) {
                        var o = e.activeTouch;
                        if (o && !Wn(e, n) && null != o.left && !o.moved && new Date - o.start < 300) {
                            var i, a = t.coordsChar(e.activeTouch, "page");
                            i = !o.prev || l(o, o.prev) ? new ai(a, a) : !o.prev.prev || l(o, o.prev.prev) ? t.findWordAt(a) : new ai(ie(a.line, 0), de(t.doc, ie(a.line + 1, 0))), t.setSelection(i.anchor, i.head), t.focus(), xt(n)
                        }
                        r()
                    })), ht(e.scroller, "touchcancel", r), ht(e.scroller, "scroll", (function () {
                        e.scroller.clientHeight && (fr(t, e.scroller.scrollTop), vr(t, e.scroller.scrollLeft, !0), yt(t, "scroll", t))
                    })), ht(e.scroller, "mousewheel", (function (e) {
                        return ri(t, e)
                    })), ht(e.scroller, "DOMMouseScroll", (function (e) {
                        return ri(t, e)
                    })), ht(e.wrapper, "scroll", (function () {
                        return e.wrapper.scrollTop = e.wrapper.scrollLeft = 0
                    })), e.dragFunctions = {
                        enter: function (e) {
                            mt(t, e) || Ot(e)
                        }, over: function (e) {
                            mt(t, e) || (Pa(t, e), Ot(e))
                        }, start: function (e) {
                            return Ta(t, e)
                        }, drop: Dr(t, Oa), leave: function (e) {
                            mt(t, e) || Ea(t)
                        }
                    };
                    var c = e.input.getField();
                    ht(c, "keyup", (function (e) {
                        return ps.call(t, e)
                    })), ht(c, "keydown", Dr(t, cs)), ht(c, "keypress", Dr(t, ds)), ht(c, "focus", (function (e) {
                        return Zo(t, e)
                    })), ht(c, "blur", (function (e) {
                        return Qo(t, e)
                    }))
                }

                Rs.defaults = Ms, Rs.optionHandlers = Ds;
                var Fs = [];

                function Hs(t, e, n, o) {
                    var r, i = t.doc;
                    null == n && (n = "add"), "smart" == n && (i.mode.indent ? r = be(t, e).state : n = "prev");
                    var a = t.options.tabSize, s = Jt(i, e), l = V(s.text, null, a);
                    s.stateAfter && (s.stateAfter = null);
                    var c, u = s.text.match(/^\s*/)[0];
                    if (o || /\S/.test(s.text)) {
                        if ("smart" == n && ((c = i.mode.indent(r, s.text.slice(u.length), s.text)) == z || c > 150)) {
                            if (!o) return;
                            n = "prev"
                        }
                    } else c = 0, n = "not";
                    "prev" == n ? c = e > i.first ? V(Jt(i, e - 1).text, null, a) : 0 : "add" == n ? c = l + t.options.indentUnit : "subtract" == n ? c = l - t.options.indentUnit : "number" == typeof n && (c = l + n), c = Math.max(0, c);
                    var p = "", d = 0;
                    if (t.options.indentWithTabs) for (var f = Math.floor(c / a); f; --f) d += a, p += "\t";
                    if (d < c && (p += K(c - d)), p != u) return ra(i, p, ie(e, 0), ie(e, u.length), "+input"), s.stateAfter = null, !0;
                    for (var h = 0; h < i.sel.ranges.length; h++) {
                        var v = i.sel.ranges[h];
                        if (v.head.line == e && v.head.ch < u.length) {
                            var g = ie(e, u.length);
                            Vi(i, h, new ai(g, g));
                            break
                        }
                    }
                }

                Rs.defineInitHook = function (t) {
                    return Fs.push(t)
                };
                var Us = null;

                function zs(t) {
                    Us = t
                }

                function Bs(t, e, n, o, r) {
                    var i = t.doc;
                    t.display.shift = !1, o || (o = i.sel);
                    var a = +new Date - 200, s = "paste" == r || t.state.pasteIncoming > a, l = Lt(e), c = null;
                    if (s && o.ranges.length > 1) if (Us && Us.text.join("\n") == e) {
                        if (o.ranges.length % Us.text.length == 0) {
                            c = [];
                            for (var u = 0; u < Us.text.length; u++) c.push(i.splitLines(Us.text[u]))
                        }
                    } else l.length == o.ranges.length && t.options.pasteLinesPerSelection && (c = X(l, (function (t) {
                        return [t]
                    })));
                    for (var p = t.curOp.updateInput, d = o.ranges.length - 1; d >= 0; d--) {
                        var f = o.ranges[d], h = f.from(), v = f.to();
                        f.empty() && (n && n > 0 ? h = ie(h.line, h.ch - n) : t.state.overwrite && !s ? v = ie(v.line, Math.min(Jt(i, v.line).text.length, v.ch + Y(l).length)) : s && Us && Us.lineWise && Us.text.join("\n") == l.join("\n") && (h = v = ie(h.line, 0)));
                        var g = {
                            from: h,
                            to: v,
                            text: c ? c[d % c.length] : l,
                            origin: r || (s ? "paste" : t.state.cutIncoming > a ? "cut" : "+input")
                        };
                        Zi(t.doc, g), kn(t, "inputRead", t, g)
                    }
                    e && !s && $s(t, e), lr(t), t.curOp.updateInput < 2 && (t.curOp.updateInput = p), t.curOp.typing = !0, t.state.pasteIncoming = t.state.cutIncoming = -1
                }

                function Ws(t, e) {
                    var n = t.clipboardData && t.clipboardData.getData("Text");
                    if (n) return t.preventDefault(), e.isReadOnly() || e.options.disableInput || Mr(e, (function () {
                        return Bs(e, n, 0, null, "paste")
                    })), !0
                }

                function $s(t, e) {
                    if (t.options.electricChars && t.options.smartIndent) for (var n = t.doc.sel, o = n.ranges.length - 1; o >= 0; o--) {
                        var r = n.ranges[o];
                        if (!(r.head.ch > 100 || o && n.ranges[o - 1].head.line == r.head.line)) {
                            var i = t.getModeAt(r.head), a = !1;
                            if (i.electricChars) {
                                for (var s = 0; s < i.electricChars.length; s++) if (e.indexOf(i.electricChars.charAt(s)) > -1) {
                                    a = Hs(t, r.head.line, "smart");
                                    break
                                }
                            } else i.electricInput && i.electricInput.test(Jt(t.doc, r.head.line).text.slice(0, r.head.ch)) && (a = Hs(t, r.head.line, "smart"));
                            a && kn(t, "electricInput", t, r.head.line)
                        }
                    }
                }

                function qs(t) {
                    for (var e = [], n = [], o = 0; o < t.doc.sel.ranges.length; o++) {
                        var r = t.doc.sel.ranges[o].head.line, i = {anchor: ie(r, 0), head: ie(r + 1, 0)};
                        n.push(i), e.push(t.getRange(i.anchor, i.head))
                    }
                    return {text: e, ranges: n}
                }

                function Gs(t, e, n, o) {
                    t.setAttribute("autocorrect", n ? "" : "off"), t.setAttribute("autocapitalize", o ? "" : "off"), t.setAttribute("spellcheck", !!e)
                }

                function Ks() {
                    var t = k("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),
                        e = k("div", [t], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
                    return l ? t.style.width = "1000px" : t.setAttribute("wrap", "off"), v && (t.style.border = "1px solid black"), Gs(t), e
                }

                function Ys(t) {
                    var e = t.optionHandlers, n = t.helpers = {};
                    t.prototype = {
                        constructor: t,
                        focus: function () {
                            window.focus(), this.display.input.focus()
                        },
                        setOption: function (t, n) {
                            var o = this.options, r = o[t];
                            o[t] == n && "mode" != t || (o[t] = n, e.hasOwnProperty(t) && Dr(this, e[t])(this, n, r), yt(this, "optionChange", this, t))
                        },
                        getOption: function (t) {
                            return this.options[t]
                        },
                        getDoc: function () {
                            return this.doc
                        },
                        addKeyMap: function (t, e) {
                            this.state.keyMaps[e ? "push" : "unshift"]($a(t))
                        },
                        removeKeyMap: function (t) {
                            for (var e = this.state.keyMaps, n = 0; n < e.length; ++n) if (e[n] == t || e[n].name == t) return e.splice(n, 1), !0
                        },
                        addOverlay: Lr((function (e, n) {
                            var o = e.token ? e : t.getMode(this.options, e);
                            if (o.startState) throw new Error("Overlays may not be stateful.");
                            J(this.state.overlays, {
                                mode: o,
                                modeSpec: e,
                                opaque: n && n.opaque,
                                priority: n && n.priority || 0
                            }, (function (t) {
                                return t.priority
                            })), this.state.modeGen++, Vo(this)
                        })),
                        removeOverlay: Lr((function (t) {
                            for (var e = this.state.overlays, n = 0; n < e.length; ++n) {
                                var o = e[n].modeSpec;
                                if (o == t || "string" == typeof t && o.name == t) return e.splice(n, 1), this.state.modeGen++, void Vo(this)
                            }
                        })),
                        indentLine: Lr((function (t, e, n) {
                            "string" != typeof e && "number" != typeof e && (e = null == e ? this.options.smartIndent ? "smart" : "prev" : e ? "add" : "subtract"), oe(this.doc, t) && Hs(this, t, e, n)
                        })),
                        indentSelection: Lr((function (t) {
                            for (var e = this.doc.sel.ranges, n = -1, o = 0; o < e.length; o++) {
                                var r = e[o];
                                if (r.empty()) r.head.line > n && (Hs(this, r.head.line, t, !0), n = r.head.line, o == this.doc.sel.primIndex && lr(this)); else {
                                    var i = r.from(), a = r.to(), s = Math.max(n, i.line);
                                    n = Math.min(this.lastLine(), a.line - (a.ch ? 0 : 1)) + 1;
                                    for (var l = s; l < n; ++l) Hs(this, l, t);
                                    var c = this.doc.sel.ranges;
                                    0 == i.ch && e.length == c.length && c[o].from().ch > 0 && Vi(this.doc, o, new ai(i, c[o].to()), B)
                                }
                            }
                        })),
                        getTokenAt: function (t, e) {
                            return Se(this, t, e)
                        },
                        getLineTokens: function (t, e) {
                            return Se(this, ie(t), e, !0)
                        },
                        getTokenTypeAt: function (t) {
                            t = de(this.doc, t);
                            var e, n = me(this, Jt(this.doc, t.line)), o = 0, r = (n.length - 1) / 2, i = t.ch;
                            if (0 == i) e = n[2]; else for (; ;) {
                                var a = o + r >> 1;
                                if ((a ? n[2 * a - 1] : 0) >= i) r = a; else {
                                    if (!(n[2 * a + 1] < i)) {
                                        e = n[2 * a + 2];
                                        break
                                    }
                                    o = a + 1
                                }
                            }
                            var s = e ? e.indexOf("overlay ") : -1;
                            return s < 0 ? e : 0 == s ? null : e.slice(0, s - 1)
                        },
                        getModeAt: function (e) {
                            var n = this.doc.mode;
                            return n.innerMode ? t.innerMode(n, this.getTokenAt(e).state).mode : n
                        },
                        getHelper: function (t, e) {
                            return this.getHelpers(t, e)[0]
                        },
                        getHelpers: function (t, e) {
                            var o = [];
                            if (!n.hasOwnProperty(e)) return o;
                            var r = n[e], i = this.getModeAt(t);
                            if ("string" == typeof i[e]) r[i[e]] && o.push(r[i[e]]); else if (i[e]) for (var a = 0; a < i[e].length; a++) {
                                var s = r[i[e][a]];
                                s && o.push(s)
                            } else i.helperType && r[i.helperType] ? o.push(r[i.helperType]) : r[i.name] && o.push(r[i.name]);
                            for (var l = 0; l < r._global.length; l++) {
                                var c = r._global[l];
                                c.pred(i, this) && -1 == H(o, c.val) && o.push(c.val)
                            }
                            return o
                        },
                        getStateAfter: function (t, e) {
                            var n = this.doc;
                            return be(this, (t = pe(n, null == t ? n.first + n.size - 1 : t)) + 1, e).state
                        },
                        cursorCoords: function (t, e) {
                            var n = this.doc.sel.primary();
                            return _o(this, null == t ? n.head : "object" == typeof t ? de(this.doc, t) : t ? n.from() : n.to(), e || "page")
                        },
                        charCoords: function (t, e) {
                            return bo(this, de(this.doc, t), e || "page")
                        },
                        coordsChar: function (t, e) {
                            return Co(this, (t = mo(this, t, e || "page")).left, t.top)
                        },
                        lineAtHeight: function (t, e) {
                            return t = mo(this, {
                                top: t,
                                left: 0
                            }, e || "page").top, ne(this.doc, t + this.display.viewOffset)
                        },
                        heightAtLine: function (t, e, n) {
                            var o, r = !1;
                            if ("number" == typeof t) {
                                var i = this.doc.first + this.doc.size - 1;
                                t < this.doc.first ? t = this.doc.first : t > i && (t = i, r = !0), o = Jt(this.doc, t)
                            } else o = t;
                            return yo(this, o, {
                                top: 0,
                                left: 0
                            }, e || "page", n || r).top + (r ? this.doc.height - an(o) : 0)
                        },
                        defaultTextHeight: function () {
                            return Ao(this.display)
                        },
                        defaultCharWidth: function () {
                            return jo(this.display)
                        },
                        getViewport: function () {
                            return {from: this.display.viewFrom, to: this.display.viewTo}
                        },
                        addWidget: function (t, e, n, o, r) {
                            var i = this.display, a = (t = _o(this, de(this.doc, t))).bottom, s = t.left;
                            if (e.style.position = "absolute", e.setAttribute("cm-ignore-events", "true"), this.display.input.setUneditable(e), i.sizer.appendChild(e), "over" == o) a = t.top; else if ("above" == o || "near" == o) {
                                var l = Math.max(i.wrapper.clientHeight, this.doc.height),
                                    c = Math.max(i.sizer.clientWidth, i.lineSpace.clientWidth);
                                ('above' == o || t.bottom + e.offsetHeight > l) && t.top > e.offsetHeight ? a = t.top - e.offsetHeight : t.bottom + e.offsetHeight <= l && (a = t.bottom), s + e.offsetWidth > c && (s = c - e.offsetWidth)
                            }
                            e.style.top = a + "px", e.style.left = e.style.right = "", "right" == r ? (s = i.sizer.clientWidth - e.offsetWidth, e.style.right = "0px") : ("left" == r ? s = 0 : "middle" == r && (s = (i.sizer.clientWidth - e.offsetWidth) / 2), e.style.left = s + "px"), n && ir(this, {
                                left: s,
                                top: a,
                                right: s + e.offsetWidth,
                                bottom: a + e.offsetHeight
                            })
                        },
                        triggerOnKeyDown: Lr(cs),
                        triggerOnKeyPress: Lr(ds),
                        triggerOnKeyUp: ps,
                        triggerOnMouseDown: Lr(ms),
                        execCommand: function (t) {
                            if (Ja.hasOwnProperty(t)) return Ja[t].call(null, this)
                        },
                        triggerElectric: Lr((function (t) {
                            $s(this, t)
                        })),
                        findPosH: function (t, e, n, o) {
                            var r = 1;
                            e < 0 && (r = -1, e = -e);
                            for (var i = de(this.doc, t), a = 0; a < e && !(i = Xs(this.doc, i, r, n, o)).hitSide; ++a) ;
                            return i
                        },
                        moveH: Lr((function (t, e) {
                            var n = this;
                            this.extendSelectionsBy((function (o) {
                                return n.display.shift || n.doc.extend || o.empty() ? Xs(n.doc, o.head, t, e, n.options.rtlMoveVisually) : t < 0 ? o.from() : o.to()
                            }), $)
                        })),
                        deleteH: Lr((function (t, e) {
                            var n = this.doc.sel, o = this.doc;
                            n.somethingSelected() ? o.replaceSelection("", null, "+delete") : qa(this, (function (n) {
                                var r = Xs(o, n.head, t, e, !1);
                                return t < 0 ? {from: r, to: n.head} : {from: n.head, to: r}
                            }))
                        })),
                        findPosV: function (t, e, n, o) {
                            var r = 1, i = o;
                            e < 0 && (r = -1, e = -e);
                            for (var a = de(this.doc, t), s = 0; s < e; ++s) {
                                var l = _o(this, a, "div");
                                if (null == i ? i = l.left : l.left = i, (a = Js(this, l, r, n)).hitSide) break
                            }
                            return a
                        },
                        moveV: Lr((function (t, e) {
                            var n = this, o = this.doc, r = [],
                                i = !this.display.shift && !o.extend && o.sel.somethingSelected();
                            if (o.extendSelectionsBy((function (a) {
                                if (i) return t < 0 ? a.from() : a.to();
                                var s = _o(n, a.head, "div");
                                null != a.goalColumn && (s.left = a.goalColumn), r.push(s.left);
                                var l = Js(n, s, t, e);
                                return "page" == e && a == o.sel.primary() && sr(n, bo(n, l, "div").top - s.top), l
                            }), $), r.length) for (var a = 0; a < o.sel.ranges.length; a++) o.sel.ranges[a].goalColumn = r[a]
                        })),
                        findWordAt: function (t) {
                            var e = Jt(this.doc, t.line).text, n = t.ch, o = t.ch;
                            if (e) {
                                var r = this.getHelper(t, "wordChars");
                                "before" != t.sticky && o != e.length || !n ? ++o : --n;
                                for (var i = e.charAt(n), a = nt(i, r) ? function (t) {
                                    return nt(t, r)
                                } : /\s/.test(i) ? function (t) {
                                    return /\s/.test(t)
                                } : function (t) {
                                    return !/\s/.test(t) && !nt(t)
                                }; n > 0 && a(e.charAt(n - 1));) --n;
                                for (; o < e.length && a(e.charAt(o));) ++o
                            }
                            return new ai(ie(t.line, n), ie(t.line, o))
                        },
                        toggleOverwrite: function (t) {
                            null != t && t == this.state.overwrite || ((this.state.overwrite = !this.state.overwrite) ? D(this.display.cursorDiv, "CodeMirror-overwrite") : T(this.display.cursorDiv, "CodeMirror-overwrite"), yt(this, "overwriteToggle", this, this.state.overwrite))
                        },
                        hasFocus: function () {
                            return this.display.input.getField() == M()
                        },
                        isReadOnly: function () {
                            return !(!this.options.readOnly && !this.doc.cantEdit)
                        },
                        scrollTo: Lr((function (t, e) {
                            cr(this, t, e)
                        })),
                        getScrollInfo: function () {
                            var t = this.display.scroller;
                            return {
                                left: t.scrollLeft,
                                top: t.scrollTop,
                                height: t.scrollHeight - Kn(this) - this.display.barHeight,
                                width: t.scrollWidth - Kn(this) - this.display.barWidth,
                                clientHeight: Xn(this),
                                clientWidth: Yn(this)
                            }
                        },
                        scrollIntoView: Lr((function (t, e) {
                            null == t ? (t = {
                                from: this.doc.sel.primary().head,
                                to: null
                            }, null == e && (e = this.options.cursorScrollMargin)) : "number" == typeof t ? t = {
                                from: ie(t, 0),
                                to: null
                            } : null == t.from && (t = {
                                from: t,
                                to: null
                            }), t.to || (t.to = t.from), t.margin = e || 0, null != t.from.line ? ur(this, t) : dr(this, t.from, t.to, t.margin)
                        })),
                        setSize: Lr((function (t, e) {
                            var n = this, o = function (t) {
                                return "number" == typeof t || /^\d+$/.test(String(t)) ? t + "px" : t
                            };
                            null != t && (this.display.wrapper.style.width = o(t)), null != e && (this.display.wrapper.style.height = o(e)), this.options.lineWrapping && po(this);
                            var r = this.display.viewFrom;
                            this.doc.iter(r, this.display.viewTo, (function (t) {
                                if (t.widgets) for (var e = 0; e < t.widgets.length; e++) if (t.widgets[e].noHScroll) {
                                    Fo(n, r, "widget");
                                    break
                                }
                                ++r
                            })), this.curOp.forceUpdate = !0, yt(this, "refresh", this)
                        })),
                        operation: function (t) {
                            return Mr(this, t)
                        },
                        startOperation: function () {
                            return Sr(this)
                        },
                        endOperation: function () {
                            return Or(this)
                        },
                        refresh: Lr((function () {
                            var t = this.display.cachedTextHeight;
                            Vo(this), this.curOp.forceUpdate = !0, fo(this), cr(this, this.doc.scrollLeft, this.doc.scrollTop), qr(this.display), (null == t || Math.abs(t - Ao(this.display)) > .5 || this.options.lineWrapping) && Io(this), yt(this, "refresh", this)
                        })),
                        swapDoc: Lr((function (t) {
                            var e = this.doc;
                            return e.cm = null, this.state.selectingText && this.state.selectingText(), bi(this, t), fo(this), this.display.input.reset(), cr(this, t.scrollLeft, t.scrollTop), this.curOp.forceScroll = !0, kn(this, "swapDoc", this, e), e
                        })),
                        phrase: function (t) {
                            var e = this.options.phrases;
                            return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : t
                        },
                        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
                        }
                    }, wt(t), t.registerHelper = function (e, o, r) {
                        n.hasOwnProperty(e) || (n[e] = t[e] = {_global: []}), n[e][o] = r
                    }, t.registerGlobalHelper = function (e, o, r, i) {
                        t.registerHelper(e, o, i), n[e]._global.push({pred: r, val: i})
                    }
                }

                function Xs(t, e, n, o, r) {
                    var i = e, a = n, s = Jt(t, e.line), l = r && "rtl" == t.direction ? -n : n;

                    function c() {
                        var n = e.line + l;
                        return !(n < t.first || n >= t.first + t.size) && (e = new ie(n, e.ch, e.sticky), s = Jt(t, n))
                    }

                    function u(i) {
                        var a;
                        if ("codepoint" == o) {
                            var u = s.text.charCodeAt(e.ch + (n > 0 ? 0 : -1));
                            if (isNaN(u)) a = null; else {
                                var p = n > 0 ? u >= 55296 && u < 56320 : u >= 56320 && u < 57343;
                                a = new ie(e.line, Math.max(0, Math.min(s.text.length, e.ch + n * (p ? 2 : 1))), -n)
                            }
                        } else a = r ? Xa(t.cm, s, e, n) : Ka(s, e, n);
                        if (null == a) {
                            if (i || !c()) return !1;
                            e = Ya(r, t.cm, s, e.line, l)
                        } else e = a;
                        return !0
                    }

                    if ("char" == o || "codepoint" == o) u(); else if ("column" == o) u(!0); else if ("word" == o || "group" == o) for (var p = null, d = "group" == o, f = t.cm && t.cm.getHelper(e, "wordChars"), h = !0; !(n < 0) || u(!h); h = !1) {
                        var v = s.text.charAt(e.ch) || "\n",
                            g = nt(v, f) ? "w" : d && "\n" == v ? "n" : !d || /\s/.test(v) ? null : "p";
                        if (!d || h || g || (g = "s"), p && p != g) {
                            n < 0 && (n = 1, u(), e.sticky = "after");
                            break
                        }
                        if (g && (p = g), n > 0 && !u(!h)) break
                    }
                    var y = Ki(t, e, i, a, !0);
                    return se(i, y) && (y.hitSide = !0), y
                }

                function Js(t, e, n, o) {
                    var r, i, a = t.doc, s = e.left;
                    if ("page" == o) {
                        var l = Math.min(t.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight),
                            c = Math.max(l - .5 * Ao(t.display), 3);
                        r = (n > 0 ? e.bottom : e.top) + n * c
                    } else "line" == o && (r = n > 0 ? e.bottom + 3 : e.top - 3);
                    for (; (i = Co(t, s, r)).outside;) {
                        if (n < 0 ? r <= 0 : r >= a.height) {
                            i.hitSide = !0;
                            break
                        }
                        r += 5 * n
                    }
                    return i
                }

                var Zs = function (t) {
                    this.cm = t, this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null, this.polling = new F, this.composing = null, this.gracePeriod = !1, this.readDOMTimeout = null
                };

                function Qs(t, e) {
                    var n = eo(t, e.line);
                    if (!n || n.hidden) return null;
                    var o = Jt(t.doc, e.line), r = Zn(n, o, e.line), i = dt(o, t.doc.direction), a = "left";
                    i && (a = ut(i, e.ch) % 2 ? "right" : "left");
                    var s = ao(r.map, e.ch, a);
                    return s.offset = "right" == s.collapse ? s.end : s.start, s
                }

                function tl(t) {
                    for (var e = t; e; e = e.parentNode) if (/CodeMirror-gutter-wrapper/.test(e.className)) return !0;
                    return !1
                }

                function el(t, e) {
                    return e && (t.bad = !0), t
                }

                function nl(t, e, n, o, r) {
                    var i = "", a = !1, s = t.doc.lineSeparator(), l = !1;

                    function c(t) {
                        return function (e) {
                            return e.id == t
                        }
                    }

                    function u() {
                        a && (i += s, l && (i += s), a = l = !1)
                    }

                    function p(t) {
                        t && (u(), i += t)
                    }

                    function d(e) {
                        if (1 == e.nodeType) {
                            var n = e.getAttribute("cm-text");
                            if (n) return void p(n);
                            var i, f = e.getAttribute("cm-marker");
                            if (f) {
                                var h = t.findMarks(ie(o, 0), ie(r + 1, 0), c(+f));
                                return void (h.length && (i = h[0].find(0)) && p(Zt(t.doc, i.from, i.to).join(s)))
                            }
                            if ("false" == e.getAttribute("contenteditable")) return;
                            var v = /^(pre|div|p|li|table|br)$/i.test(e.nodeName);
                            if (!/^br$/i.test(e.nodeName) && 0 == e.textContent.length) return;
                            v && u();
                            for (var g = 0; g < e.childNodes.length; g++) d(e.childNodes[g]);
                            /^(pre|p)$/i.test(e.nodeName) && (l = !0), v && (a = !0)
                        } else 3 == e.nodeType && p(e.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " "))
                    }

                    for (; d(e), e != n;) e = e.nextSibling, l = !1;
                    return i
                }

                function ol(t, e, n) {
                    var o;
                    if (e == t.display.lineDiv) {
                        if (!(o = t.display.lineDiv.childNodes[n])) return el(t.clipPos(ie(t.display.viewTo - 1)), !0);
                        e = null, n = 0
                    } else for (o = e; ; o = o.parentNode) {
                        if (!o || o == t.display.lineDiv) return null;
                        if (o.parentNode && o.parentNode == t.display.lineDiv) break
                    }
                    for (var r = 0; r < t.display.view.length; r++) {
                        var i = t.display.view[r];
                        if (i.node == o) return rl(i, e, n)
                    }
                }

                function rl(t, e, n) {
                    var o = t.text.firstChild, r = !1;
                    if (!e || !j(o, e)) return el(ie(ee(t.line), 0), !0);
                    if (e == o && (r = !0, e = o.childNodes[n], n = 0, !e)) {
                        var i = t.rest ? Y(t.rest) : t.line;
                        return el(ie(ee(i), i.text.length), r)
                    }
                    var a = 3 == e.nodeType ? e : null, s = e;
                    for (a || 1 != e.childNodes.length || 3 != e.firstChild.nodeType || (a = e.firstChild, n && (n = a.nodeValue.length)); s.parentNode != o;) s = s.parentNode;
                    var l = t.measure, c = l.maps;

                    function u(e, n, o) {
                        for (var r = -1; r < (c ? c.length : 0); r++) for (var i = r < 0 ? l.map : c[r], a = 0; a < i.length; a += 3) {
                            var s = i[a + 2];
                            if (s == e || s == n) {
                                var u = ee(r < 0 ? t.line : t.rest[r]), p = i[a] + o;
                                return (o < 0 || s != e) && (p = i[a + (o ? 1 : 0)]), ie(u, p)
                            }
                        }
                    }

                    var p = u(a, s, n);
                    if (p) return el(p, r);
                    for (var d = s.nextSibling, f = a ? a.nodeValue.length - n : 0; d; d = d.nextSibling) {
                        if (p = u(d, d.firstChild, 0)) return el(ie(p.line, p.ch - f), r);
                        f += d.textContent.length
                    }
                    for (var h = s.previousSibling, v = n; h; h = h.previousSibling) {
                        if (p = u(h, h.firstChild, -1)) return el(ie(p.line, p.ch + v), r);
                        v += h.textContent.length
                    }
                }

                Zs.prototype.init = function (t) {
                    var e = this, n = this, o = n.cm, r = n.div = t.lineDiv;

                    function i(t) {
                        for (var e = t.target; e; e = e.parentNode) {
                            if (e == r) return !0;
                            if (/\bCodeMirror-(?:line)?widget\b/.test(e.className)) break
                        }
                        return !1
                    }

                    function a(t) {
                        if (i(t) && !mt(o, t)) {
                            if (o.somethingSelected()) zs({
                                lineWise: !1,
                                text: o.getSelections()
                            }), "cut" == t.type && o.replaceSelection("", null, "cut"); else {
                                if (!o.options.lineWiseCopyCut) return;
                                var e = qs(o);
                                zs({lineWise: !0, text: e.text}), "cut" == t.type && o.operation((function () {
                                    o.setSelections(e.ranges, 0, B), o.replaceSelection("", null, "cut")
                                }))
                            }
                            if (t.clipboardData) {
                                t.clipboardData.clearData();
                                var a = Us.text.join("\n");
                                if (t.clipboardData.setData("Text", a), t.clipboardData.getData("Text") == a) return void t.preventDefault()
                            }
                            var s = Ks(), l = s.firstChild;
                            o.display.lineSpace.insertBefore(s, o.display.lineSpace.firstChild), l.value = Us.text.join("\n");
                            var c = M();
                            I(l), setTimeout((function () {
                                o.display.lineSpace.removeChild(s), c.focus(), c == r && n.showPrimarySelection()
                            }), 50)
                        }
                    }

                    r.contentEditable = !0, Gs(r, o.options.spellcheck, o.options.autocorrect, o.options.autocapitalize), ht(r, "paste", (function (t) {
                        !i(t) || mt(o, t) || Ws(t, o) || s <= 11 && setTimeout(Dr(o, (function () {
                            return e.updateFromDOM()
                        })), 20)
                    })), ht(r, "compositionstart", (function (t) {
                        e.composing = {data: t.data, done: !1}
                    })), ht(r, "compositionupdate", (function (t) {
                        e.composing || (e.composing = {data: t.data, done: !1})
                    })), ht(r, "compositionend", (function (t) {
                        e.composing && (t.data != e.composing.data && e.readFromDOMSoon(), e.composing.done = !0)
                    })), ht(r, "touchstart", (function () {
                        return n.forceCompositionEnd()
                    })), ht(r, "input", (function () {
                        e.composing || e.readFromDOMSoon()
                    })), ht(r, "copy", a), ht(r, "cut", a)
                }, Zs.prototype.screenReaderLabelChanged = function (t) {
                    t ? this.div.setAttribute('aria-label', t) : this.div.removeAttribute('aria-label')
                }, Zs.prototype.prepareSelection = function () {
                    var t = $o(this.cm, !1);
                    return t.focus = M() == this.div, t
                }, Zs.prototype.showSelection = function (t, e) {
                    t && this.cm.display.view.length && ((t.focus || e) && this.showPrimarySelection(), this.showMultipleSelections(t))
                }, Zs.prototype.getSelection = function () {
                    return this.cm.display.wrapper.ownerDocument.getSelection()
                }, Zs.prototype.showPrimarySelection = function () {
                    var t = this.getSelection(), e = this.cm, o = e.doc.sel.primary(), r = o.from(), i = o.to();
                    if (e.display.viewTo == e.display.viewFrom || r.line >= e.display.viewTo || i.line < e.display.viewFrom) t.removeAllRanges(); else {
                        var a = ol(e, t.anchorNode, t.anchorOffset), s = ol(e, t.focusNode, t.focusOffset);
                        if (!a || a.bad || !s || s.bad || 0 != ae(ue(a, s), r) || 0 != ae(ce(a, s), i)) {
                            var l = e.display.view,
                                c = r.line >= e.display.viewFrom && Qs(e, r) || {node: l[0].measure.map[2], offset: 0},
                                u = i.line < e.display.viewTo && Qs(e, i);
                            if (!u) {
                                var p = l[l.length - 1].measure, d = p.maps ? p.maps[p.maps.length - 1] : p.map;
                                u = {node: d[d.length - 1], offset: d[d.length - 2] - d[d.length - 3]}
                            }
                            if (c && u) {
                                var f, h = t.rangeCount && t.getRangeAt(0);
                                try {
                                    f = O(c.node, c.offset, u.offset, u.node)
                                } catch (t) {
                                }
                                f && (!n && e.state.focused ? (t.collapse(c.node, c.offset), f.collapsed || (t.removeAllRanges(), t.addRange(f))) : (t.removeAllRanges(), t.addRange(f)), h && null == t.anchorNode ? t.addRange(h) : n && this.startGracePeriod()), this.rememberSelection()
                            } else t.removeAllRanges()
                        }
                    }
                }, Zs.prototype.startGracePeriod = function () {
                    var t = this;
                    clearTimeout(this.gracePeriod), this.gracePeriod = setTimeout((function () {
                        t.gracePeriod = !1, t.selectionChanged() && t.cm.operation((function () {
                            return t.cm.curOp.selectionChanged = !0
                        }))
                    }), 20)
                }, Zs.prototype.showMultipleSelections = function (t) {
                    E(this.cm.display.cursorDiv, t.cursors), E(this.cm.display.selectionDiv, t.selection)
                }, Zs.prototype.rememberSelection = function () {
                    var t = this.getSelection();
                    this.lastAnchorNode = t.anchorNode, this.lastAnchorOffset = t.anchorOffset, this.lastFocusNode = t.focusNode, this.lastFocusOffset = t.focusOffset
                }, Zs.prototype.selectionInEditor = function () {
                    var t = this.getSelection();
                    if (!t.rangeCount) return !1;
                    var e = t.getRangeAt(0).commonAncestorContainer;
                    return j(this.div, e)
                }, Zs.prototype.focus = function () {
                    "nocursor" != this.cm.options.readOnly && (this.selectionInEditor() && M() == this.div || this.showSelection(this.prepareSelection(), !0), this.div.focus())
                }, Zs.prototype.blur = function () {
                    this.div.blur()
                }, Zs.prototype.getField = function () {
                    return this.div
                }, Zs.prototype.supportsTouch = function () {
                    return !0
                }, Zs.prototype.receivedFocus = function () {
                    var t = this, e = this;

                    function n() {
                        e.cm.state.focused && (e.pollSelection(), e.polling.set(e.cm.options.pollInterval, n))
                    }

                    this.selectionInEditor() ? setTimeout((function () {
                        return t.pollSelection()
                    }), 20) : Mr(this.cm, (function () {
                        return e.cm.curOp.selectionChanged = !0
                    })), this.polling.set(this.cm.options.pollInterval, n)
                }, Zs.prototype.selectionChanged = function () {
                    var t = this.getSelection();
                    return t.anchorNode != this.lastAnchorNode || t.anchorOffset != this.lastAnchorOffset || t.focusNode != this.lastFocusNode || t.focusOffset != this.lastFocusOffset
                }, Zs.prototype.pollSelection = function () {
                    if (null == this.readDOMTimeout && !this.gracePeriod && this.selectionChanged()) {
                        var t = this.getSelection(), e = this.cm;
                        if (g && u && this.cm.display.gutterSpecs.length && tl(t.anchorNode)) return this.cm.triggerOnKeyDown({
                            type: "keydown",
                            keyCode: 8,
                            preventDefault: Math.abs
                        }), this.blur(), void this.focus();
                        if (!this.composing) {
                            this.rememberSelection();
                            var n = ol(e, t.anchorNode, t.anchorOffset), o = ol(e, t.focusNode, t.focusOffset);
                            n && o && Mr(e, (function () {
                                zi(e.doc, li(n, o), B), (n.bad || o.bad) && (e.curOp.selectionChanged = !0)
                            }))
                        }
                    }
                }, Zs.prototype.pollContent = function () {
                    null != this.readDOMTimeout && (clearTimeout(this.readDOMTimeout), this.readDOMTimeout = null);
                    var t, e, n, o = this.cm, r = o.display, i = o.doc.sel.primary(), a = i.from(), s = i.to();
                    if (0 == a.ch && a.line > o.firstLine() && (a = ie(a.line - 1, Jt(o.doc, a.line - 1).length)), s.ch == Jt(o.doc, s.line).text.length && s.line < o.lastLine() && (s = ie(s.line + 1, 0)), a.line < r.viewFrom || s.line > r.viewTo - 1) return !1;
                    a.line == r.viewFrom || 0 == (t = Ro(o, a.line)) ? (e = ee(r.view[0].line), n = r.view[0].node) : (e = ee(r.view[t].line), n = r.view[t - 1].node.nextSibling);
                    var l, c, u = Ro(o, s.line);
                    if (u == r.view.length - 1 ? (l = r.viewTo - 1, c = r.lineDiv.lastChild) : (l = ee(r.view[u + 1].line) - 1, c = r.view[u + 1].node.previousSibling), !n) return !1;
                    for (var p = o.doc.splitLines(nl(o, n, c, e, l)), d = Zt(o.doc, ie(e, 0), ie(l, Jt(o.doc, l).text.length)); p.length > 1 && d.length > 1;) if (Y(p) == Y(d)) p.pop(), d.pop(), l--; else {
                        if (p[0] != d[0]) break;
                        p.shift(), d.shift(), e++
                    }
                    for (var f = 0, h = 0, v = p[0], g = d[0], y = Math.min(v.length, g.length); f < y && v.charCodeAt(f) == g.charCodeAt(f);) ++f;
                    for (var m = Y(p), b = Y(d), _ = Math.min(m.length - (1 == p.length ? f : 0), b.length - (1 == d.length ? f : 0)); h < _ && m.charCodeAt(m.length - h - 1) == b.charCodeAt(b.length - h - 1);) ++h;
                    if (1 == p.length && 1 == d.length && e == a.line) for (; f && f > a.ch && m.charCodeAt(m.length - h - 1) == b.charCodeAt(b.length - h - 1);) f--, h++;
                    p[p.length - 1] = m.slice(0, m.length - h).replace(/^\u200b+/, ""), p[0] = p[0].slice(f).replace(/\u200b+$/, "");
                    var w = ie(e, f), x = ie(l, d.length ? Y(d).length - h : 0);
                    return p.length > 1 || p[0] || ae(w, x) ? (ra(o.doc, p, w, x, "+input"), !0) : void 0
                }, Zs.prototype.ensurePolled = function () {
                    this.forceCompositionEnd()
                }, Zs.prototype.reset = function () {
                    this.forceCompositionEnd()
                }, Zs.prototype.forceCompositionEnd = function () {
                    this.composing && (clearTimeout(this.readDOMTimeout), this.composing = null, this.updateFromDOM(), this.div.blur(), this.div.focus())
                }, Zs.prototype.readFromDOMSoon = function () {
                    var t = this;
                    null == this.readDOMTimeout && (this.readDOMTimeout = setTimeout((function () {
                        if (t.readDOMTimeout = null, t.composing) {
                            if (!t.composing.done) return;
                            t.composing = null
                        }
                        t.updateFromDOM()
                    }), 80))
                }, Zs.prototype.updateFromDOM = function () {
                    var t = this;
                    !this.cm.isReadOnly() && this.pollContent() || Mr(this.cm, (function () {
                        return Vo(t.cm)
                    }))
                }, Zs.prototype.setUneditable = function (t) {
                    t.contentEditable = "false"
                }, Zs.prototype.onKeyPress = function (t) {
                    0 == t.charCode || this.composing || (t.preventDefault(), this.cm.isReadOnly() || Dr(this.cm, Bs)(this.cm, String.fromCharCode(null == t.charCode ? t.keyCode : t.charCode), 0))
                }, Zs.prototype.readOnlyChanged = function (t) {
                    this.div.contentEditable = String("nocursor" != t)
                }, Zs.prototype.onContextMenu = function () {
                }, Zs.prototype.resetPosition = function () {
                }, Zs.prototype.needsContentAttribute = !0;
                var il = function (t) {
                    this.cm = t, this.prevInput = "", this.pollingFast = !1, this.polling = new F, this.hasSelection = !1, this.composing = null
                };

                function al(t, e) {
                    if ((e = e ? R(e) : {}).value = t.value, !e.tabindex && t.tabIndex && (e.tabindex = t.tabIndex), !e.placeholder && t.placeholder && (e.placeholder = t.placeholder), null == e.autofocus) {
                        var n = M();
                        e.autofocus = n == t || null != t.getAttribute("autofocus") && n == document.body
                    }

                    function o() {
                        t.value = s.getValue()
                    }

                    var r;
                    if (t.form && (ht(t.form, "submit", o), !e.leaveSubmitMethodAlone)) {
                        var i = t.form;
                        r = i.submit;
                        try {
                            var a = i.submit = function () {
                                o(), i.submit = r, i.submit(), i.submit = a
                            }
                        } catch (t) {
                        }
                    }
                    e.finishInit = function (n) {
                        n.save = o, n.getTextArea = function () {
                            return t
                        }, n.toTextArea = function () {
                            n.toTextArea = isNaN, o(), t.parentNode.removeChild(n.getWrapperElement()), t.style.display = "", t.form && (gt(t.form, "submit", o), e.leaveSubmitMethodAlone || "function" != typeof t.form.submit || (t.form.submit = r))
                        }
                    }, t.style.display = "none";
                    var s = Rs((function (e) {
                        return t.parentNode.insertBefore(e, t.nextSibling)
                    }), e);
                    return s
                }

                function sl(t) {
                    t.off = gt, t.on = ht, t.wheelEventPixels = oi, t.Doc = Ca, t.splitLines = Lt, t.countColumn = V, t.findColumn = q, t.isWordChar = et, t.Pass = z, t.signal = yt, t.Line = cn, t.changeEnd = ci, t.scrollbarModel = wr, t.Pos = ie, t.cmpPos = ae, t.modes = Ft, t.mimeModes = Ht, t.resolveMode = Bt, t.getMode = Wt, t.modeExtensions = $t, t.extendMode = qt, t.copyState = Gt, t.startState = Yt, t.innerMode = Kt, t.commands = Ja, t.keyMap = Va, t.keyName = Wa, t.isModifierKey = za, t.lookupKey = Ua, t.normalizeKeyMap = Ha, t.StringStream = Xt, t.SharedTextMarker = ya, t.TextMarker = va, t.LineWidget = pa, t.e_preventDefault = xt, t.e_stopPropagation = Ct, t.e_stop = Ot, t.addClass = D, t.contains = j, t.rmClass = T, t.keyNames = La
                }

                il.prototype.init = function (t) {
                    var e = this, n = this, o = this.cm;
                    this.createField(t);
                    var r = this.textarea;

                    function i(t) {
                        if (!mt(o, t)) {
                            if (o.somethingSelected()) zs({lineWise: !1, text: o.getSelections()}); else {
                                if (!o.options.lineWiseCopyCut) return;
                                var e = qs(o);
                                zs({
                                    lineWise: !0,
                                    text: e.text
                                }), "cut" == t.type ? o.setSelections(e.ranges, null, B) : (n.prevInput = "", r.value = e.text.join("\n"), I(r))
                            }
                            "cut" == t.type && (o.state.cutIncoming = +new Date)
                        }
                    }

                    t.wrapper.insertBefore(this.wrapper, t.wrapper.firstChild), v && (r.style.width = "0px"), ht(r, "input", (function () {
                        a && s >= 9 && e.hasSelection && (e.hasSelection = null), n.poll()
                    })), ht(r, "paste", (function (t) {
                        mt(o, t) || Ws(t, o) || (o.state.pasteIncoming = +new Date, n.fastPoll())
                    })), ht(r, "cut", i), ht(r, "copy", i), ht(t.scroller, "paste", (function (e) {
                        if (!Wn(t, e) && !mt(o, e)) {
                            if (!r.dispatchEvent) return o.state.pasteIncoming = +new Date, void n.focus();
                            var i = new Event("paste");
                            i.clipboardData = e.clipboardData, r.dispatchEvent(i)
                        }
                    })), ht(t.lineSpace, "selectstart", (function (e) {
                        Wn(t, e) || xt(e)
                    })), ht(r, "compositionstart", (function () {
                        var t = o.getCursor("from");
                        n.composing && n.composing.range.clear(), n.composing = {
                            start: t,
                            range: o.markText(t, o.getCursor("to"), {className: "CodeMirror-composing"})
                        }
                    })), ht(r, "compositionend", (function () {
                        n.composing && (n.poll(), n.composing.range.clear(), n.composing = null)
                    }))
                }, il.prototype.createField = function (t) {
                    this.wrapper = Ks(), this.textarea = this.wrapper.firstChild
                }, il.prototype.screenReaderLabelChanged = function (t) {
                    t ? this.textarea.setAttribute('aria-label', t) : this.textarea.removeAttribute('aria-label')
                }, il.prototype.prepareSelection = function () {
                    var t = this.cm, e = t.display, n = t.doc, o = $o(t);
                    if (t.options.moveInputWithCursor) {
                        var r = _o(t, n.sel.primary().head, "div"), i = e.wrapper.getBoundingClientRect(),
                            a = e.lineDiv.getBoundingClientRect();
                        o.teTop = Math.max(0, Math.min(e.wrapper.clientHeight - 10, r.top + a.top - i.top)), o.teLeft = Math.max(0, Math.min(e.wrapper.clientWidth - 10, r.left + a.left - i.left))
                    }
                    return o
                }, il.prototype.showSelection = function (t) {
                    var e = this.cm.display;
                    E(e.cursorDiv, t.cursors), E(e.selectionDiv, t.selection), null != t.teTop && (this.wrapper.style.top = t.teTop + "px", this.wrapper.style.left = t.teLeft + "px")
                }, il.prototype.reset = function (t) {
                    if (!this.contextMenuPending && !this.composing) {
                        var e = this.cm;
                        if (e.somethingSelected()) {
                            this.prevInput = "";
                            var n = e.getSelection();
                            this.textarea.value = n, e.state.focused && I(this.textarea), a && s >= 9 && (this.hasSelection = n)
                        } else t || (this.prevInput = this.textarea.value = "", a && s >= 9 && (this.hasSelection = null))
                    }
                }, il.prototype.getField = function () {
                    return this.textarea
                }, il.prototype.supportsTouch = function () {
                    return !1
                }, il.prototype.focus = function () {
                    if ("nocursor" != this.cm.options.readOnly && (!y || M() != this.textarea)) try {
                        this.textarea.focus()
                    } catch (t) {
                    }
                }, il.prototype.blur = function () {
                    this.textarea.blur()
                }, il.prototype.resetPosition = function () {
                    this.wrapper.style.top = this.wrapper.style.left = 0
                }, il.prototype.receivedFocus = function () {
                    this.slowPoll()
                }, il.prototype.slowPoll = function () {
                    var t = this;
                    this.pollingFast || this.polling.set(this.cm.options.pollInterval, (function () {
                        t.poll(), t.cm.state.focused && t.slowPoll()
                    }))
                }, il.prototype.fastPoll = function () {
                    var t = !1, e = this;

                    function n() {
                        e.poll() || t ? (e.pollingFast = !1, e.slowPoll()) : (t = !0, e.polling.set(60, n))
                    }

                    e.pollingFast = !0, e.polling.set(20, n)
                }, il.prototype.poll = function () {
                    var t = this, e = this.cm, n = this.textarea, o = this.prevInput;
                    if (this.contextMenuPending || !e.state.focused || It(n) && !o && !this.composing || e.isReadOnly() || e.options.disableInput || e.state.keySeq) return !1;
                    var r = n.value;
                    if (r == o && !e.somethingSelected()) return !1;
                    if (a && s >= 9 && this.hasSelection === r || m && /[\uf700-\uf7ff]/.test(r)) return e.display.input.reset(), !1;
                    if (e.doc.sel == e.display.selForContextMenu) {
                        var i = r.charCodeAt(0);
                        if (8203 != i || o || (o = ""), 8666 == i) return this.reset(), this.cm.execCommand("undo")
                    }
                    for (var l = 0, c = Math.min(o.length, r.length); l < c && o.charCodeAt(l) == r.charCodeAt(l);) ++l;
                    return Mr(e, (function () {
                        Bs(e, r.slice(l), o.length - l, null, t.composing ? "*compose" : null), r.length > 1e3 || r.indexOf("\n") > -1 ? n.value = t.prevInput = "" : t.prevInput = r, t.composing && (t.composing.range.clear(), t.composing.range = e.markText(t.composing.start, e.getCursor("to"), {className: "CodeMirror-composing"}))
                    })), !0
                }, il.prototype.ensurePolled = function () {
                    this.pollingFast && this.poll() && (this.pollingFast = !1)
                }, il.prototype.onKeyPress = function () {
                    a && s >= 9 && (this.hasSelection = null), this.fastPoll()
                }, il.prototype.onContextMenu = function (t) {
                    var e = this, n = e.cm, o = n.display, r = e.textarea;
                    e.contextMenuPending && e.contextMenuPending();
                    var i = No(n, t), c = o.scroller.scrollTop;
                    if (i && !p) {
                        n.options.resetSelectionOnContextMenu && -1 == n.doc.sel.contains(i) && Dr(n, zi)(n.doc, li(i), B);
                        var u, d = r.style.cssText, f = e.wrapper.style.cssText,
                            h = e.wrapper.offsetParent.getBoundingClientRect();
                        if (e.wrapper.style.cssText = "position: static", r.style.cssText = "position: absolute; width: 30px; height: 30px;\n      top: " + (t.clientY - h.top - 5) + "px; left: " + (t.clientX - h.left - 5) + "px;\n      z-index: 1000; background: " + (a ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);", l && (u = window.scrollY), o.input.focus(), l && window.scrollTo(null, u), o.input.reset(), n.somethingSelected() || (r.value = e.prevInput = " "), e.contextMenuPending = y, o.selForContextMenu = n.doc.sel, clearTimeout(o.detectingSelectAll), a && s >= 9 && g(), C) {
                            Ot(t);
                            var v = function () {
                                gt(window, "mouseup", v), setTimeout(y, 20)
                            };
                            ht(window, "mouseup", v)
                        } else setTimeout(y, 50)
                    }

                    function g() {
                        if (null != r.selectionStart) {
                            var t = n.somethingSelected(), i = "" + (t ? r.value : "");
                            r.value = "⇚", r.value = i, e.prevInput = t ? "" : "", r.selectionStart = 1, r.selectionEnd = i.length, o.selForContextMenu = n.doc.sel
                        }
                    }

                    function y() {
                        if (e.contextMenuPending == y && (e.contextMenuPending = !1, e.wrapper.style.cssText = f, r.style.cssText = d, a && s < 9 && o.scrollbars.setScrollTop(o.scroller.scrollTop = c), null != r.selectionStart)) {
                            (!a || a && s < 9) && g();
                            var t = 0, i = function () {
                                o.selForContextMenu == n.doc.sel && 0 == r.selectionStart && r.selectionEnd > 0 && "" == e.prevInput ? Dr(n, Xi)(n) : t++ < 10 ? o.detectingSelectAll = setTimeout(i, 500) : (o.selForContextMenu = null, o.input.reset())
                            };
                            o.detectingSelectAll = setTimeout(i, 200)
                        }
                    }
                }, il.prototype.readOnlyChanged = function (t) {
                    t || this.reset(), this.textarea.disabled = "nocursor" == t, this.textarea.readOnly = !!t
                }, il.prototype.setUneditable = function () {
                }, il.prototype.needsContentAttribute = !1, Ls(Rs), Ys(Rs);
                var ll = "iter insert remove copy getEditor constructor".split(" ");
                for (var cl in Ca.prototype) Ca.prototype.hasOwnProperty(cl) && H(ll, cl) < 0 && (Rs.prototype[cl] = function (t) {
                    return function () {
                        return t.apply(this.doc, arguments)
                    }
                }(Ca.prototype[cl]));
                return wt(Ca), Rs.inputStyles = {textarea: il, contenteditable: Zs}, Rs.defineMode = function (t) {
                    Rs.defaults.mode || "null" == t || (Rs.defaults.mode = t), Ut.apply(this, arguments)
                }, Rs.defineMIME = zt, Rs.defineMode("null", (function () {
                    return {
                        token: function (t) {
                            return t.skipToEnd()
                        }
                    }
                })), Rs.defineMIME("text/plain", "null"), Rs.defineExtension = function (t, e) {
                    Rs.prototype[t] = e
                }, Rs.defineDocExtension = function (t, e) {
                    Ca.prototype[t] = e
                }, Rs.fromTextArea = al, sl(Rs), Rs.version = "5.63.0", Rs
            }())
        }, 7389: (t, e, n) => {
            1 && function (t) {
                "use strict";

                function e(t) {
                    for (var e = {}, n = 0; n < t.length; ++n) e[t[n].toLowerCase()] = !0;
                    return e
                }

                t.defineMode("css", (function (e, n) {
                    var o = n.inline;
                    n.propertyKeywords || (n = t.resolveMode("text/css"));
                    var r, i, a = e.indentUnit, s = n.tokenHooks, l = n.documentTypes || {}, c = n.mediaTypes || {},
                        u = n.mediaFeatures || {}, p = n.mediaValueKeywords || {}, d = n.propertyKeywords || {},
                        f = n.nonStandardPropertyKeywords || {}, h = n.fontProperties || {},
                        v = n.counterDescriptors || {}, g = n.colorKeywords || {}, y = n.valueKeywords || {},
                        m = n.allowNested, b = n.lineComment, _ = !0 === n.supportsAtComponent,
                        w = !1 !== e.highlightNonStandardPropertyKeywords;

                    function x(t, e) {
                        return r = e, t
                    }

                    function C(t, e) {
                        var n = t.next();
                        if (s[n]) {
                            var o = s[n](t, e);
                            if (!1 !== o) return o
                        }
                        return "@" == n ? (t.eatWhile(/[\w\\\-]/), x("def", t.current())) : "=" == n || ("~" == n || "|" == n) && t.eat("=") ? x(null, "compare") : "\"" == n || "'" == n ? (e.tokenize = S(n), e.tokenize(t, e)) : "#" == n ? (t.eatWhile(/[\w\\\-]/), x("atom", "hash")) : "!" == n ? (t.match(/^\s*\w*/), x("keyword", "important")) : /\d/.test(n) || "." == n && t.eat(/\d/) ? (t.eatWhile(/[\w.%]/), x("number", "unit")) : "-" !== n ? /[,+>*\/]/.test(n) ? x(null, "select-op") : "." == n && t.match(/^-?[_a-z][_a-z0-9-]*/i) ? x("qualifier", "qualifier") : /[:;{}\[\]\(\)]/.test(n) ? x(null, n) : t.match(/^[\w-.]+(?=\()/) ? (/^(url(-prefix)?|domain|regexp)$/i.test(t.current()) && (e.tokenize = O), x("variable callee", "variable")) : /[\w\\\-]/.test(n) ? (t.eatWhile(/[\w\\\-]/), x("property", "word")) : x(null, null) : /[\d.]/.test(t.peek()) ? (t.eatWhile(/[\w.%]/), x("number", "unit")) : t.match(/^-[\w\\\-]*/) ? (t.eatWhile(/[\w\\\-]/), t.match(/^\s*:/, !1) ? x("variable-2", "variable-definition") : x("variable-2", "variable")) : t.match(/^\w+-/) ? x("meta", "meta") : void 0
                    }

                    function S(t) {
                        return function (e, n) {
                            for (var o, r = !1; null != (o = e.next());) {
                                if (o == t && !r) {
                                    ")" == t && e.backUp(1);
                                    break
                                }
                                r = !r && "\\" == o
                            }
                            return (o == t || !r && ")" != t) && (n.tokenize = null), x("string", "string")
                        }
                    }

                    function O(t, e) {
                        return t.next(), t.match(/^\s*[\"\')]/, !1) ? e.tokenize = null : e.tokenize = S(")"), x(null, "(")
                    }

                    function T(t, e, n) {
                        this.type = t, this.indent = e, this.prev = n
                    }

                    function P(t, e, n, o) {
                        return t.context = new T(n, e.indentation() + (!1 === o ? 0 : a), t.context), n
                    }

                    function E(t) {
                        return t.context.prev && (t.context = t.context.prev), t.context.type
                    }

                    function k(t, e, n) {
                        return M[n.context.type](t, e, n)
                    }

                    function A(t, e, n, o) {
                        for (var r = o || 1; r > 0; r--) n.context = n.context.prev;
                        return k(t, e, n)
                    }

                    function j(t) {
                        var e = t.current().toLowerCase();
                        i = y.hasOwnProperty(e) ? "atom" : g.hasOwnProperty(e) ? "keyword" : "variable"
                    }

                    var M = {
                        top: function (t, e, n) {
                            if ("{" == t) return P(n, e, "block");
                            if ("}" == t && n.context.prev) return E(n);
                            if (_ && /@component/i.test(t)) return P(n, e, "atComponentBlock");
                            if (/^@(-moz-)?document$/i.test(t)) return P(n, e, "documentTypes");
                            if (/^@(media|supports|(-moz-)?document|import)$/i.test(t)) return P(n, e, "atBlock");
                            if (/^@(font-face|counter-style)/i.test(t)) return n.stateArg = t, "restricted_atBlock_before";
                            if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t)) return "keyframes";
                            if (t && "@" == t.charAt(0)) return P(n, e, "at");
                            if ("hash" == t) i = "builtin"; else if ("word" == t) i = "tag"; else {
                                if ("variable-definition" == t) return "maybeprop";
                                if ("interpolation" == t) return P(n, e, "interpolation");
                                if (":" == t) return "pseudo";
                                if (m && "(" == t) return P(n, e, "parens")
                            }
                            return n.context.type
                        }, block: function (t, e, n) {
                            if ("word" == t) {
                                var o = e.current().toLowerCase();
                                return d.hasOwnProperty(o) ? (i = "property", "maybeprop") : f.hasOwnProperty(o) ? (i = w ? "string-2" : "property", "maybeprop") : m ? (i = e.match(/^\s*:(?:\s|$)/, !1) ? "property" : "tag", "block") : (i += " error", "maybeprop")
                            }
                            return "meta" == t ? "block" : m || "hash" != t && "qualifier" != t ? M.top(t, e, n) : (i = "error", "block")
                        }, maybeprop: function (t, e, n) {
                            return ":" == t ? P(n, e, "prop") : k(t, e, n)
                        }, prop: function (t, e, n) {
                            if (";" == t) return E(n);
                            if ("{" == t && m) return P(n, e, "propBlock");
                            if ("}" == t || "{" == t) return A(t, e, n);
                            if ("(" == t) return P(n, e, "parens");
                            if ("hash" != t || /^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e.current())) {
                                if ("word" == t) j(e); else if ("interpolation" == t) return P(n, e, "interpolation")
                            } else i += " error";
                            return "prop"
                        }, propBlock: function (t, e, n) {
                            return "}" == t ? E(n) : "word" == t ? (i = "property", "maybeprop") : n.context.type
                        }, parens: function (t, e, n) {
                            return "{" == t || "}" == t ? A(t, e, n) : ")" == t ? E(n) : "(" == t ? P(n, e, "parens") : "interpolation" == t ? P(n, e, "interpolation") : ("word" == t && j(e), "parens")
                        }, pseudo: function (t, e, n) {
                            return "meta" == t ? "pseudo" : "word" == t ? (i = "variable-3", n.context.type) : k(t, e, n)
                        }, documentTypes: function (t, e, n) {
                            return "word" == t && l.hasOwnProperty(e.current()) ? (i = "tag", n.context.type) : M.atBlock(t, e, n)
                        }, atBlock: function (t, e, n) {
                            if ("(" == t) return P(n, e, "atBlock_parens");
                            if ("}" == t || ";" == t) return A(t, e, n);
                            if ("{" == t) return E(n) && P(n, e, m ? "block" : "top");
                            if ("interpolation" == t) return P(n, e, "interpolation");
                            if ("word" == t) {
                                var o = e.current().toLowerCase();
                                i = "only" == o || "not" == o || "and" == o || "or" == o ? "keyword" : c.hasOwnProperty(o) ? "attribute" : u.hasOwnProperty(o) ? "property" : p.hasOwnProperty(o) ? "keyword" : d.hasOwnProperty(o) ? "property" : f.hasOwnProperty(o) ? w ? "string-2" : "property" : y.hasOwnProperty(o) ? "atom" : g.hasOwnProperty(o) ? "keyword" : "error"
                            }
                            return n.context.type
                        }, atComponentBlock: function (t, e, n) {
                            return "}" == t ? A(t, e, n) : "{" == t ? E(n) && P(n, e, m ? "block" : "top", !1) : ("word" == t && (i = "error"), n.context.type)
                        }, atBlock_parens: function (t, e, n) {
                            return ")" == t ? E(n) : "{" == t || "}" == t ? A(t, e, n, 2) : M.atBlock(t, e, n)
                        }, restricted_atBlock_before: function (t, e, n) {
                            return "{" == t ? P(n, e, "restricted_atBlock") : "word" == t && "@counter-style" == n.stateArg ? (i = "variable", "restricted_atBlock_before") : k(t, e, n)
                        }, restricted_atBlock: function (t, e, n) {
                            return "}" == t ? (n.stateArg = null, E(n)) : "word" == t ? (i = "@font-face" == n.stateArg && !h.hasOwnProperty(e.current().toLowerCase()) || "@counter-style" == n.stateArg && !v.hasOwnProperty(e.current().toLowerCase()) ? "error" : "property", "maybeprop") : "restricted_atBlock"
                        }, keyframes: function (t, e, n) {
                            return "word" == t ? (i = "variable", "keyframes") : "{" == t ? P(n, e, "top") : k(t, e, n)
                        }, at: function (t, e, n) {
                            return ";" == t ? E(n) : "{" == t || "}" == t ? A(t, e, n) : ("word" == t ? i = "tag" : "hash" == t && (i = "builtin"), "at")
                        }, interpolation: function (t, e, n) {
                            return "}" == t ? E(n) : "{" == t || ";" == t ? A(t, e, n) : ("word" == t ? i = "variable" : "variable" != t && "(" != t && ")" != t && (i = "error"), "interpolation")
                        }
                    };
                    return {
                        startState: function (t) {
                            return {
                                tokenize: null,
                                state: o ? "block" : "top",
                                stateArg: null,
                                context: new T(o ? "block" : "top", t || 0, null)
                            }
                        },
                        token: function (t, e) {
                            if (!e.tokenize && t.eatSpace()) return null;
                            var n = (e.tokenize || C)(t, e);
                            return n && "object" == typeof n && (r = n[1], n = n[0]), i = n, "comment" != r && (e.state = M[e.state](r, t, e)), i
                        },
                        indent: function (t, e) {
                            var n = t.context, o = e && e.charAt(0), r = n.indent;
                            return "prop" != n.type || "}" != o && ")" != o || (n = n.prev), n.prev && ("}" != o || "block" != n.type && "top" != n.type && "interpolation" != n.type && "restricted_atBlock" != n.type ? (")" != o || "parens" != n.type && "atBlock_parens" != n.type) && ("{" != o || "at" != n.type && "atBlock" != n.type) || (r = Math.max(0, n.indent - a)) : r = (n = n.prev).indent), r
                        },
                        electricChars: "}",
                        blockCommentStart: "/*",
                        blockCommentEnd: "*/",
                        blockCommentContinue: " * ",
                        lineComment: b,
                        fold: "brace"
                    }
                }));
                var n = ["domain", "regexp", "url", "url-prefix"], o = e(n),
                    r = ["all", "aural", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "embossed"],
                    i = e(r),
                    a = ["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"],
                    s = e(a),
                    l = ["landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", "interlace", "progressive", "dark", "light"],
                    c = e(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 = e(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 = e(d),
                    h = e(["font-display", "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", "font-stretch", "font-weight", "font-style"]),
                    v = e(["additive-symbols", "fallback", "negative", "pad", "prefix", "range", "speak-as", "suffix", "symbols", "system"]),
                    g = ["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 = e(g),
                    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", "button-bevel", "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", "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-controls-background", "media-current-time-display", "media-fullscreen-button", "media-mute-button", "media-play-button", "media-return-to-realtime-button", "media-rewind-button", "media-seek-back-button", "media-seek-forward-button", "media-slider", "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", "media-volume-slider-container", "media-volume-sliderthumb", "medium", "menu", "menulist", "menulist-button", "menulist-text", "menulist-textfield", "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", "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 = e(m), _ = n.concat(r).concat(a).concat(l).concat(u).concat(d).concat(g).concat(m);

                function w(t, e) {
                    for (var n, o = !1; null != (n = t.next());) {
                        if (o && "/" == n) {
                            e.tokenize = null;
                            break
                        }
                        o = "*" == n
                    }
                    return ["comment", "comment"]
                }

                t.registerHelper("hintWords", "css", _), t.defineMIME("text/css", {
                    documentTypes: o,
                    mediaTypes: i,
                    mediaFeatures: s,
                    mediaValueKeywords: c,
                    propertyKeywords: p,
                    nonStandardPropertyKeywords: f,
                    fontProperties: h,
                    counterDescriptors: v,
                    colorKeywords: y,
                    valueKeywords: b,
                    tokenHooks: {
                        "/": function (t, e) {
                            return !!t.eat("*") && (e.tokenize = w, w(t, e))
                        }
                    },
                    name: "css"
                }), t.defineMIME("text/x-scss", {
                    mediaTypes: i,
                    mediaFeatures: s,
                    mediaValueKeywords: c,
                    propertyKeywords: p,
                    nonStandardPropertyKeywords: f,
                    colorKeywords: y,
                    valueKeywords: b,
                    fontProperties: h,
                    allowNested: !0,
                    lineComment: "//",
                    tokenHooks: {
                        "/": function (t, e) {
                            return t.eat("/") ? (t.skipToEnd(), ["comment", "comment"]) : t.eat("*") ? (e.tokenize = w, w(t, e)) : ["operator", "operator"]
                        }, ":": function (t) {
                            return !!t.match(/^\s*\{/, !1) && [null, null]
                        }, $: function (t) {
                            return t.match(/^[\w-]+/), t.match(/^\s*:/, !1) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"]
                        }, "#": function (t) {
                            return !!t.eat("{") && [null, "interpolation"]
                        }
                    },
                    name: "css",
                    helperType: "scss"
                }), t.defineMIME("text/x-less", {
                    mediaTypes: i,
                    mediaFeatures: s,
                    mediaValueKeywords: c,
                    propertyKeywords: p,
                    nonStandardPropertyKeywords: f,
                    colorKeywords: y,
                    valueKeywords: b,
                    fontProperties: h,
                    allowNested: !0,
                    lineComment: "//",
                    tokenHooks: {
                        "/": function (t, e) {
                            return t.eat("/") ? (t.skipToEnd(), ["comment", "comment"]) : t.eat("*") ? (e.tokenize = w, w(t, e)) : ["operator", "operator"]
                        }, "@": function (t) {
                            return t.eat("{") ? [null, "interpolation"] : !t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, !1) && (t.eatWhile(/[\w\\\-]/), t.match(/^\s*:/, !1) ? ["variable-2", "variable-definition"] : ["variable-2", "variable"])
                        }, "&": function () {
                            return ["atom", "atom"]
                        }
                    },
                    name: "css",
                    helperType: "less"
                }), t.defineMIME("text/x-gss", {
                    documentTypes: o,
                    mediaTypes: i,
                    mediaFeatures: s,
                    propertyKeywords: p,
                    nonStandardPropertyKeywords: f,
                    fontProperties: h,
                    counterDescriptors: v,
                    colorKeywords: y,
                    valueKeywords: b,
                    supportsAtComponent: !0,
                    tokenHooks: {
                        "/": function (t, e) {
                            return !!t.eat("*") && (e.tokenize = w, w(t, e))
                        }
                    },
                    name: "css",
                    helperType: "gss"
                })
            }(n(4408))
        }, 8253: (t, e, n) => {
            1 && function (t) {
                "use strict";
                var e = {
                    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 n(t, e, n) {
                    var o = t.current(), r = o.search(e);
                    return r > -1 ? t.backUp(o.length - r) : o.match(/<\/?$/) && (t.backUp(o.length), t.match(e, !1) || t.match(o)), n
                }

                var o = {};

                function r(t) {
                    var e = o[t];
                    return e || (o[t] = new RegExp("\\s+" + t + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))
                }

                function i(t, e) {
                    var n = t.match(r(e));
                    return n ? /^\s*(.*?)\s*$/.exec(n[2])[1] : ""
                }

                function a(t, e) {
                    return new RegExp((e ? "^" : "") + "</s*" + t + "s*>", "i")
                }

                function s(t, e) {
                    for (var n in t) for (var o = e[n] || (e[n] = []), r = t[n], i = r.length - 1; i >= 0; i--) o.unshift(r[i])
                }

                function l(t, e) {
                    for (var n = 0; n < t.length; n++) {
                        var o = t[n];
                        if (!o[0] || o[1].test(i(e, o[0]))) return o[2]
                    }
                }

                t.defineMode("htmlmixed", (function (o, r) {
                    var i = t.getMode(o, {
                        name: "xml",
                        htmlMode: !0,
                        multilineTagIndentFactor: r.multilineTagIndentFactor,
                        multilineTagIndentPastTag: r.multilineTagIndentPastTag,
                        allowMissingTagName: r.allowMissingTagName
                    }), c = {}, u = r && r.tags, p = r && r.scriptTypes;
                    if (s(e, c), u && s(u, c), p) for (var d = p.length - 1; d >= 0; d--) c.script.unshift(["type", p[d].matches, p[d].mode]);

                    function f(e, r) {
                        var s, u = i.token(e, r.htmlState), p = /\btag\b/.test(u);
                        if (p && !/[<>\s\/]/.test(e.current()) && (s = r.htmlState.tagName && r.htmlState.tagName.toLowerCase()) && c.hasOwnProperty(s)) r.inTag = s + " "; else if (r.inTag && p && />$/.test(e.current())) {
                            var d = /^([\S]+) (.*)/.exec(r.inTag);
                            r.inTag = null;
                            var h = ">" == e.current() && l(c[d[1]], d[2]), v = t.getMode(o, h), g = a(d[1], !0),
                                y = a(d[1], !1);
                            r.token = function (t, e) {
                                return t.match(g, !1) ? (e.token = f, e.localState = e.localMode = null, null) : n(t, y, e.localMode.token(t, e.localState))
                            }, r.localMode = v, r.localState = t.startState(v, i.indent(r.htmlState, "", ""))
                        } else r.inTag && (r.inTag += e.current(), e.eol() && (r.inTag += " "));
                        return u
                    }

                    return {
                        startState: function () {
                            return {
                                token: f,
                                inTag: null,
                                localMode: null,
                                localState: null,
                                htmlState: t.startState(i)
                            }
                        }, copyState: function (e) {
                            var n;
                            return e.localState && (n = t.copyState(e.localMode, e.localState)), {
                                token: e.token,
                                inTag: e.inTag,
                                localMode: e.localMode,
                                localState: n,
                                htmlState: t.copyState(i, e.htmlState)
                            }
                        }, token: function (t, e) {
                            return e.token(t, e)
                        }, indent: function (e, n, o) {
                            return !e.localMode || /^\s*<\//.test(n) ? i.indent(e.htmlState, n, o) : e.localMode.indent ? e.localMode.indent(e.localState, n, o) : t.Pass
                        }, innerMode: function (t) {
                            return {state: t.localState || t.htmlState, mode: t.localMode || i}
                        }
                    }
                }), "xml", "javascript", "css"), t.defineMIME("text/html", "htmlmixed")
            }(n(4408), n(9701), n(6061), n(7389))
        }, 6061: (t, e, n) => {
            1 && function (t) {
                "use strict";
                t.defineMode("javascript", (function (e, n) {
                    var o, r, i = e.indentUnit, a = n.statementIndent, s = n.jsonld, l = n.json || s,
                        c = !1 !== n.trackScope, u = n.typescript, p = n.wordCharacters || /[\w$\xa1-\uffff]/,
                        d = function () {
                            function t(t) {
                                return {type: t, style: "keyword"}
                            }

                            var e = t("keyword a"), n = t("keyword b"), o = t("keyword c"), r = t("keyword d"),
                                i = t("operator"), a = {type: "atom", style: "atom"};
                            return {
                                if: t("if"),
                                while: e,
                                with: e,
                                else: n,
                                do: n,
                                try: n,
                                finally: n,
                                return: r,
                                break: r,
                                continue: r,
                                new: t("new"),
                                delete: o,
                                void: o,
                                throw: o,
                                debugger: t("debugger"),
                                var: t("var"),
                                const: t("var"),
                                let: t("var"),
                                function: t("function"),
                                catch: t("catch"),
                                for: t("for"),
                                switch: t("switch"),
                                case: t("case"),
                                default: t("default"),
                                in: i,
                                typeof: i,
                                instanceof: i,
                                true: a,
                                false: a,
                                null: a,
                                undefined: a,
                                NaN: a,
                                Infinity: a,
                                this: t("this"),
                                class: t("class"),
                                super: t("atom"),
                                yield: o,
                                export: t("export"),
                                import: t("import"),
                                extends: o,
                                await: o
                            }
                        }(), f = /[+\-*&%=<>!?|~^@]/,
                        h = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;

                    function v(t) {
                        for (var e, n = !1, o = !1; null != (e = t.next());) {
                            if (!n) {
                                if ("/" == e && !o) return;
                                "[" == e ? o = !0 : o && "]" == e && (o = !1)
                            }
                            n = !n && "\\" == e
                        }
                    }

                    function g(t, e, n) {
                        return o = t, r = n, e
                    }

                    function y(t, e) {
                        var n = t.next();
                        if ('"' == n || "'" == n) return e.tokenize = m(n), e.tokenize(t, e);
                        if ("." == n && t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) return g("number", "number");
                        if ("." == n && t.match("..")) return g("spread", "meta");
                        if (/[\[\]{}\(\),;\:\.]/.test(n)) return g(n);
                        if ("=" == n && t.eat(">")) return g("=>", "operator");
                        if ("0" == n && t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) return g("number", "number");
                        if (/\d/.test(n)) return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/), g("number", "number");
                        if ("/" == n) return t.eat("*") ? (e.tokenize = b, b(t, e)) : t.eat("/") ? (t.skipToEnd(), g("comment", "comment")) : re(t, e, 1) ? (v(t), t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/), g("regexp", "string-2")) : (t.eat("="), g("operator", "operator", t.current()));
                        if ("`" == n) return e.tokenize = _, _(t, e);
                        if ("#" == n && "!" == t.peek()) return t.skipToEnd(), g("meta", "meta");
                        if ("#" == n && t.eatWhile(p)) return g("variable", "property");
                        if ("<" == n && t.match("!--") || "-" == n && t.match("->") && !/\S/.test(t.string.slice(0, t.start))) return t.skipToEnd(), g("comment", "comment");
                        if (f.test(n)) return ">" == n && e.lexical && ">" == e.lexical.type || (t.eat("=") ? "!" != n && "=" != n || t.eat("=") : /[<>*+\-|&?]/.test(n) && (t.eat(n), ">" == n && t.eat(n))), "?" == n && t.eat(".") ? g(".") : g("operator", "operator", t.current());
                        if (p.test(n)) {
                            t.eatWhile(p);
                            var o = t.current();
                            if ("." != e.lastType) {
                                if (d.propertyIsEnumerable(o)) {
                                    var r = d[o];
                                    return g(r.type, r.style, o)
                                }
                                if ("async" == o && t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, !1)) return g("async", "keyword", o)
                            }
                            return g("variable", "variable", o)
                        }
                    }

                    function m(t) {
                        return function (e, n) {
                            var o, r = !1;
                            if (s && "@" == e.peek() && e.match(h)) return n.tokenize = y, g("jsonld-keyword", "meta");
                            for (; null != (o = e.next()) && (o != t || r);) r = !r && "\\" == o;
                            return r || (n.tokenize = y), g("string", "string")
                        }
                    }

                    function b(t, e) {
                        for (var n, o = !1; n = t.next();) {
                            if ("/" == n && o) {
                                e.tokenize = y;
                                break
                            }
                            o = "*" == n
                        }
                        return g("comment", "comment")
                    }

                    function _(t, e) {
                        for (var n, o = !1; null != (n = t.next());) {
                            if (!o && ("`" == n || "$" == n && t.eat("{"))) {
                                e.tokenize = y;
                                break
                            }
                            o = !o && "\\" == n
                        }
                        return g("quasi", "string-2", t.current())
                    }

                    var w = "([{}])";

                    function x(t, e) {
                        e.fatArrowAt && (e.fatArrowAt = null);
                        var n = t.string.indexOf("=>", t.start);
                        if (!(n < 0)) {
                            if (u) {
                                var o = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start, n));
                                o && (n = o.index)
                            }
                            for (var r = 0, i = !1, a = n - 1; a >= 0; --a) {
                                var s = t.string.charAt(a), l = w.indexOf(s);
                                if (l >= 0 && l < 3) {
                                    if (!r) {
                                        ++a;
                                        break
                                    }
                                    if (0 == --r) {
                                        "(" == s && (i = !0);
                                        break
                                    }
                                } else if (l >= 3 && l < 6) ++r; else if (p.test(s)) i = !0; else if (/["'\/`]/.test(s)) for (; ; --a) {
                                    if (0 == a) return;
                                    if (t.string.charAt(a - 1) == s && "\\" != t.string.charAt(a - 2)) {
                                        a--;
                                        break
                                    }
                                } else if (i && !r) {
                                    ++a;
                                    break
                                }
                            }
                            i && !r && (e.fatArrowAt = a)
                        }
                    }

                    var C = {
                        atom: !0,
                        number: !0,
                        variable: !0,
                        string: !0,
                        regexp: !0,
                        this: !0,
                        import: !0,
                        "jsonld-keyword": !0
                    };

                    function S(t, e, n, o, r, i) {
                        this.indented = t, this.column = e, this.type = n, this.prev = r, this.info = i, null != o && (this.align = o)
                    }

                    function O(t, e) {
                        if (!c) return !1;
                        for (var n = t.localVars; n; n = n.next) if (n.name == e) return !0;
                        for (var o = t.context; o; o = o.prev) for (n = o.vars; n; n = n.next) if (n.name == e) return !0
                    }

                    function T(t, e, n, o, r) {
                        var i = t.cc;
                        for (P.state = t, P.stream = r, P.marked = null, P.cc = i, P.style = e, t.lexical.hasOwnProperty("align") || (t.lexical.align = !0); 1;) if ((i.length ? i.pop() : l ? $ : B)(n, o)) {
                            for (; i.length && i[i.length - 1].lex;) i.pop()();
                            return P.marked ? P.marked : "variable" == n && O(t, o) ? "variable-2" : e
                        }
                    }

                    var P = {state: null, column: null, marked: null, cc: null};

                    function E() {
                        for (var t = arguments.length - 1; t >= 0; t--) P.cc.push(arguments[t])
                    }

                    function k() {
                        return E.apply(null, arguments), !0
                    }

                    function A(t, e) {
                        for (var n = e; n; n = n.next) if (n.name == t) return !0;
                        return !1
                    }

                    function j(t) {
                        var e = P.state;
                        if (P.marked = "def", c) {
                            if (e.context) if ("var" == e.lexical.info && e.context && e.context.block) {
                                var o = M(t, e.context);
                                if (null != o) return void (e.context = o)
                            } else if (!A(t, e.localVars)) return void (e.localVars = new I(t, e.localVars));
                            n.globalVars && !A(t, e.globalVars) && (e.globalVars = new I(t, e.globalVars))
                        }
                    }

                    function M(t, e) {
                        if (e) {
                            if (e.block) {
                                var n = M(t, e.prev);
                                return n ? n == e.prev ? e : new L(n, e.vars, !0) : null
                            }
                            return A(t, e.vars) ? e : new L(e.prev, new I(t, e.vars), !1)
                        }
                        return null
                    }

                    function D(t) {
                        return "public" == t || "private" == t || "protected" == t || "abstract" == t || "readonly" == t
                    }

                    function L(t, e, n) {
                        this.prev = t, this.vars = e, this.block = n
                    }

                    function I(t, e) {
                        this.name = t, this.next = e
                    }

                    var N = new I("this", new I("arguments", null));

                    function R() {
                        P.state.context = new L(P.state.context, P.state.localVars, !1), P.state.localVars = N
                    }

                    function V() {
                        P.state.context = new L(P.state.context, P.state.localVars, !0), P.state.localVars = null
                    }

                    function F() {
                        P.state.localVars = P.state.context.vars, P.state.context = P.state.context.prev
                    }

                    function H(t, e) {
                        var n = function () {
                            var n = P.state, o = n.indented;
                            if ("stat" == n.lexical.type) o = n.lexical.indented; else for (var r = n.lexical; r && ")" == r.type && r.align; r = r.prev) o = r.indented;
                            n.lexical = new S(o, P.stream.column(), t, null, n.lexical, e)
                        };
                        return n.lex = !0, n
                    }

                    function U() {
                        var t = P.state;
                        t.lexical.prev && (")" == t.lexical.type && (t.indented = t.lexical.indented), t.lexical = t.lexical.prev)
                    }

                    function z(t) {
                        function e(n) {
                            return n == t ? k() : ";" == t || "}" == n || ")" == n || "]" == n ? E() : k(e)
                        }

                        return e
                    }

                    function B(t, e) {
                        return "var" == t ? k(H("vardef", e), Et, z(";"), U) : "keyword a" == t ? k(H("form"), G, B, U) : "keyword b" == t ? k(H("form"), B, U) : "keyword d" == t ? P.stream.match(/^\s*$/, !1) ? k() : k(H("stat"), Y, z(";"), U) : "debugger" == t ? k(z(";")) : "{" == t ? k(H("}"), V, dt, U, F) : ";" == t ? k() : "if" == t ? ("else" == P.state.lexical.info && P.state.cc[P.state.cc.length - 1] == U && P.state.cc.pop()(), k(H("form"), G, B, U, Lt)) : "function" == t ? k(Vt) : "for" == t ? k(H("form"), V, It, B, F, U) : "class" == t || u && "interface" == e ? (P.marked = "keyword", k(H("form", "class" == t ? t : e), Bt, U)) : "variable" == t ? u && "declare" == e ? (P.marked = "keyword", k(B)) : u && ("module" == e || "enum" == e || "type" == e) && P.stream.match(/^\s*\w/, !1) ? (P.marked = "keyword", "enum" == e ? k(ee) : "type" == e ? k(Ht, z("operator"), yt, z(";")) : k(H("form"), kt, z("{"), H("}"), dt, U, U)) : u && "namespace" == e ? (P.marked = "keyword", k(H("form"), $, B, U)) : u && "abstract" == e ? (P.marked = "keyword", k(B)) : k(H("stat"), it) : "switch" == t ? k(H("form"), G, z("{"), H("}", "switch"), V, dt, U, U, F) : "case" == t ? k($, z(":")) : "default" == t ? k(z(":")) : "catch" == t ? k(H("form"), R, W, B, U, F) : "export" == t ? k(H("stat"), Gt, U) : "import" == t ? k(H("stat"), Yt, U) : "async" == t ? k(B) : "@" == e ? k($, B) : E(H("stat"), $, z(";"), U)
                    }

                    function W(t) {
                        if ("(" == t) return k(Ut, z(")"))
                    }

                    function $(t, e) {
                        return K(t, e, !1)
                    }

                    function q(t, e) {
                        return K(t, e, !0)
                    }

                    function G(t) {
                        return "(" != t ? E() : k(H(")"), Y, z(")"), U)
                    }

                    function K(t, e, n) {
                        if (P.state.fatArrowAt == P.stream.start) {
                            var o = n ? et : tt;
                            if ("(" == t) return k(R, H(")"), ut(Ut, ")"), U, z("=>"), o, F);
                            if ("variable" == t) return E(R, kt, z("=>"), o, F)
                        }
                        var r = n ? J : X;
                        return C.hasOwnProperty(t) ? k(r) : "function" == t ? k(Vt, r) : "class" == t || u && "interface" == e ? (P.marked = "keyword", k(H("form"), zt, U)) : "keyword c" == t || "async" == t ? k(n ? q : $) : "(" == t ? k(H(")"), Y, z(")"), U, r) : "operator" == t || "spread" == t ? k(n ? q : $) : "[" == t ? k(H("]"), te, U, r) : "{" == t ? pt(st, "}", null, r) : "quasi" == t ? E(Z, r) : "new" == t ? k(nt(n)) : k()
                    }

                    function Y(t) {
                        return t.match(/[;\}\)\],]/) ? E() : E($)
                    }

                    function X(t, e) {
                        return "," == t ? k(Y) : J(t, e, !1)
                    }

                    function J(t, e, n) {
                        var o = 0 == n ? X : J, r = 0 == n ? $ : q;
                        return "=>" == t ? k(R, n ? et : tt, F) : "operator" == t ? /\+\+|--/.test(e) || u && "!" == e ? k(o) : u && "<" == e && P.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, !1) ? k(H(">"), ut(yt, ">"), U, o) : "?" == e ? k($, z(":"), r) : k(r) : "quasi" == t ? E(Z, o) : ";" != t ? "(" == t ? pt(q, ")", "call", o) : "." == t ? k(at, o) : "[" == t ? k(H("]"), Y, z("]"), U, o) : u && "as" == e ? (P.marked = "keyword", k(yt, o)) : "regexp" == t ? (P.state.lastType = P.marked = "operator", P.stream.backUp(P.stream.pos - P.stream.start - 1), k(r)) : void 0 : void 0
                    }

                    function Z(t, e) {
                        return "quasi" != t ? E() : "${" != e.slice(e.length - 2) ? k(Z) : k(Y, Q)
                    }

                    function Q(t) {
                        if ("}" == t) return P.marked = "string-2", P.state.tokenize = _, k(Z)
                    }

                    function tt(t) {
                        return x(P.stream, P.state), E("{" == t ? B : $)
                    }

                    function et(t) {
                        return x(P.stream, P.state), E("{" == t ? B : q)
                    }

                    function nt(t) {
                        return function (e) {
                            return "." == e ? k(t ? rt : ot) : "variable" == e && u ? k(Ot, t ? J : X) : E(t ? q : $)
                        }
                    }

                    function ot(t, e) {
                        if ("target" == e) return P.marked = "keyword", k(X)
                    }

                    function rt(t, e) {
                        if ("target" == e) return P.marked = "keyword", k(J)
                    }

                    function it(t) {
                        return ":" == t ? k(U, B) : E(X, z(";"), U)
                    }

                    function at(t) {
                        if ("variable" == t) return P.marked = "property", k()
                    }

                    function st(t, e) {
                        return "async" == t ? (P.marked = "property", k(st)) : "variable" == t || "keyword" == P.style ? (P.marked = "property", "get" == e || "set" == e ? k(lt) : (u && P.state.fatArrowAt == P.stream.start && (n = P.stream.match(/^\s*:\s*/, !1)) && (P.state.fatArrowAt = P.stream.pos + n[0].length), k(ct))) : "number" == t || "string" == t ? (P.marked = s ? "property" : P.style + " property", k(ct)) : "jsonld-keyword" == t ? k(ct) : u && D(e) ? (P.marked = "keyword", k(st)) : "[" == t ? k($, ft, z("]"), ct) : "spread" == t ? k(q, ct) : "*" == e ? (P.marked = "keyword", k(st)) : ":" == t ? E(ct) : void 0;
                        var n
                    }

                    function lt(t) {
                        return "variable" != t ? E(ct) : (P.marked = "property", k(Vt))
                    }

                    function ct(t) {
                        return ":" == t ? k(q) : "(" == t ? E(Vt) : void 0
                    }

                    function ut(t, e, n) {
                        function o(r, i) {
                            if (n ? n.indexOf(r) > -1 : "," == r) {
                                var a = P.state.lexical;
                                return "call" == a.info && (a.pos = (a.pos || 0) + 1), k((function (n, o) {
                                    return n == e || o == e ? E() : E(t)
                                }), o)
                            }
                            return r == e || i == e ? k() : n && n.indexOf(";") > -1 ? E(t) : k(z(e))
                        }

                        return function (n, r) {
                            return n == e || r == e ? k() : E(t, o)
                        }
                    }

                    function pt(t, e, n) {
                        for (var o = 3; o < arguments.length; o++) P.cc.push(arguments[o]);
                        return k(H(e, n), ut(t, e), U)
                    }

                    function dt(t) {
                        return "}" == t ? k() : E(B, dt)
                    }

                    function ft(t, e) {
                        if (u) {
                            if (":" == t) return k(yt);
                            if ("?" == e) return k(ft)
                        }
                    }

                    function ht(t, e) {
                        if (u && (":" == t || "in" == e)) return k(yt)
                    }

                    function vt(t) {
                        if (u && ":" == t) return P.stream.match(/^\s*\w+\s+is\b/, !1) ? k($, gt, yt) : k(yt)
                    }

                    function gt(t, e) {
                        if ("is" == e) return P.marked = "keyword", k()
                    }

                    function yt(t, e) {
                        return "keyof" == e || "typeof" == e || "infer" == e || "readonly" == e ? (P.marked = "keyword", k("typeof" == e ? q : yt)) : "variable" == t || "void" == e ? (P.marked = "type", k(St)) : "|" == e || "&" == e ? k(yt) : "string" == t || "number" == t || "atom" == t ? k(St) : "[" == t ? k(H("]"), ut(yt, "]", ","), U, St) : "{" == t ? k(H("}"), bt, U, St) : "(" == t ? k(ut(Ct, ")"), mt, St) : "<" == t ? k(ut(yt, ">"), yt) : "quasi" == t ? E(wt, St) : void 0
                    }

                    function mt(t) {
                        if ("=>" == t) return k(yt)
                    }

                    function bt(t) {
                        return t.match(/[\}\)\]]/) ? k() : "," == t || ";" == t ? k(bt) : E(_t, bt)
                    }

                    function _t(t, e) {
                        return "variable" == t || "keyword" == P.style ? (P.marked = "property", k(_t)) : "?" == e || "number" == t || "string" == t ? k(_t) : ":" == t ? k(yt) : "[" == t ? k(z("variable"), ht, z("]"), _t) : "(" == t ? E(Ft, _t) : t.match(/[;\}\)\],]/) ? void 0 : k()
                    }

                    function wt(t, e) {
                        return "quasi" != t ? E() : "${" != e.slice(e.length - 2) ? k(wt) : k(yt, xt)
                    }

                    function xt(t) {
                        if ("}" == t) return P.marked = "string-2", P.state.tokenize = _, k(wt)
                    }

                    function Ct(t, e) {
                        return "variable" == t && P.stream.match(/^\s*[?:]/, !1) || "?" == e ? k(Ct) : ":" == t ? k(yt) : "spread" == t ? k(Ct) : E(yt)
                    }

                    function St(t, e) {
                        return "<" == e ? k(H(">"), ut(yt, ">"), U, St) : "|" == e || "." == t || "&" == e ? k(yt) : "[" == t ? k(yt, z("]"), St) : "extends" == e || "implements" == e ? (P.marked = "keyword", k(yt)) : "?" == e ? k(yt, z(":"), yt) : void 0
                    }

                    function Ot(t, e) {
                        if ("<" == e) return k(H(">"), ut(yt, ">"), U, St)
                    }

                    function Tt() {
                        return E(yt, Pt)
                    }

                    function Pt(t, e) {
                        if ("=" == e) return k(yt)
                    }

                    function Et(t, e) {
                        return "enum" == e ? (P.marked = "keyword", k(ee)) : E(kt, ft, Mt, Dt)
                    }

                    function kt(t, e) {
                        return u && D(e) ? (P.marked = "keyword", k(kt)) : "variable" == t ? (j(e), k()) : "spread" == t ? k(kt) : "[" == t ? pt(jt, "]") : "{" == t ? pt(At, "}") : void 0
                    }

                    function At(t, e) {
                        return "variable" != t || P.stream.match(/^\s*:/, !1) ? ("variable" == t && (P.marked = "property"), "spread" == t ? k(kt) : "}" == t ? E() : "[" == t ? k($, z(']'), z(':'), At) : k(z(":"), kt, Mt)) : (j(e), k(Mt))
                    }

                    function jt() {
                        return E(kt, Mt)
                    }

                    function Mt(t, e) {
                        if ("=" == e) return k(q)
                    }

                    function Dt(t) {
                        if ("," == t) return k(Et)
                    }

                    function Lt(t, e) {
                        if ("keyword b" == t && "else" == e) return k(H("form", "else"), B, U)
                    }

                    function It(t, e) {
                        return "await" == e ? k(It) : "(" == t ? k(H(")"), Nt, U) : void 0
                    }

                    function Nt(t) {
                        return "var" == t ? k(Et, Rt) : "variable" == t ? k(Rt) : E(Rt)
                    }

                    function Rt(t, e) {
                        return ")" == t ? k() : ";" == t ? k(Rt) : "in" == e || "of" == e ? (P.marked = "keyword", k($, Rt)) : E($, Rt)
                    }

                    function Vt(t, e) {
                        return "*" == e ? (P.marked = "keyword", k(Vt)) : "variable" == t ? (j(e), k(Vt)) : "(" == t ? k(R, H(")"), ut(Ut, ")"), U, vt, B, F) : u && "<" == e ? k(H(">"), ut(Tt, ">"), U, Vt) : void 0
                    }

                    function Ft(t, e) {
                        return "*" == e ? (P.marked = "keyword", k(Ft)) : "variable" == t ? (j(e), k(Ft)) : "(" == t ? k(R, H(")"), ut(Ut, ")"), U, vt, F) : u && "<" == e ? k(H(">"), ut(Tt, ">"), U, Ft) : void 0
                    }

                    function Ht(t, e) {
                        return "keyword" == t || "variable" == t ? (P.marked = "type", k(Ht)) : "<" == e ? k(H(">"), ut(Tt, ">"), U) : void 0
                    }

                    function Ut(t, e) {
                        return "@" == e && k($, Ut), "spread" == t ? k(Ut) : u && D(e) ? (P.marked = "keyword", k(Ut)) : u && "this" == t ? k(ft, Mt) : E(kt, ft, Mt)
                    }

                    function zt(t, e) {
                        return "variable" == t ? Bt(t, e) : Wt(t, e)
                    }

                    function Bt(t, e) {
                        if ("variable" == t) return j(e), k(Wt)
                    }

                    function Wt(t, e) {
                        return "<" == e ? k(H(">"), ut(Tt, ">"), U, Wt) : "extends" == e || "implements" == e || u && "," == t ? ("implements" == e && (P.marked = "keyword"), k(u ? yt : $, Wt)) : "{" == t ? k(H("}"), $t, U) : void 0
                    }

                    function $t(t, e) {
                        return "async" == t || "variable" == t && ("static" == e || "get" == e || "set" == e || u && D(e)) && P.stream.match(/^\s+[\w$\xa1-\uffff]/, !1) ? (P.marked = "keyword", k($t)) : "variable" == t || "keyword" == P.style ? (P.marked = "property", k(qt, $t)) : "number" == t || "string" == t ? k(qt, $t) : "[" == t ? k($, ft, z("]"), qt, $t) : "*" == e ? (P.marked = "keyword", k($t)) : u && "(" == t ? E(Ft, $t) : ";" == t || "," == t ? k($t) : "}" == t ? k() : "@" == e ? k($, $t) : void 0
                    }

                    function qt(t, e) {
                        if ("!" == e) return k(qt);
                        if ("?" == e) return k(qt);
                        if (":" == t) return k(yt, Mt);
                        if ("=" == e) return k(q);
                        var n = P.state.lexical.prev;
                        return E(n && "interface" == n.info ? Ft : Vt)
                    }

                    function Gt(t, e) {
                        return "*" == e ? (P.marked = "keyword", k(Qt, z(";"))) : "default" == e ? (P.marked = "keyword", k($, z(";"))) : "{" == t ? k(ut(Kt, "}"), Qt, z(";")) : E(B)
                    }

                    function Kt(t, e) {
                        return "as" == e ? (P.marked = "keyword", k(z("variable"))) : "variable" == t ? E(q, Kt) : void 0
                    }

                    function Yt(t) {
                        return "string" == t ? k() : "(" == t ? E($) : "." == t ? E(X) : E(Xt, Jt, Qt)
                    }

                    function Xt(t, e) {
                        return "{" == t ? pt(Xt, "}") : ("variable" == t && j(e), "*" == e && (P.marked = "keyword"), k(Zt))
                    }

                    function Jt(t) {
                        if ("," == t) return k(Xt, Jt)
                    }

                    function Zt(t, e) {
                        if ("as" == e) return P.marked = "keyword", k(Xt)
                    }

                    function Qt(t, e) {
                        if ("from" == e) return P.marked = "keyword", k($)
                    }

                    function te(t) {
                        return "]" == t ? k() : E(ut(q, "]"))
                    }

                    function ee() {
                        return E(H("form"), kt, z("{"), H("}"), ut(ne, "}"), U, U)
                    }

                    function ne() {
                        return E(kt, Mt)
                    }

                    function oe(t, e) {
                        return "operator" == t.lastType || "," == t.lastType || f.test(e.charAt(0)) || /[,.]/.test(e.charAt(0))
                    }

                    function re(t, e, n) {
                        return e.tokenize == y && /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType) || "quasi" == e.lastType && /\{\s*$/.test(t.string.slice(0, t.pos - (n || 0)))
                    }

                    return F.lex = !0, U.lex = !0, {
                        startState: function (t) {
                            var e = {
                                tokenize: y,
                                lastType: "sof",
                                cc: [],
                                lexical: new S((t || 0) - i, 0, "block", !1),
                                localVars: n.localVars,
                                context: n.localVars && new L(null, null, !1),
                                indented: t || 0
                            };
                            return n.globalVars && "object" == typeof n.globalVars && (e.globalVars = n.globalVars), e
                        },
                        token: function (t, e) {
                            if (t.sol() && (e.lexical.hasOwnProperty("align") || (e.lexical.align = !1), e.indented = t.indentation(), x(t, e)), e.tokenize != b && t.eatSpace()) return null;
                            var n = e.tokenize(t, e);
                            return "comment" == o ? n : (e.lastType = "operator" != o || "++" != r && "--" != r ? o : "incdec", T(e, n, o, r, t))
                        },
                        indent: function (e, o) {
                            if (e.tokenize == b || e.tokenize == _) return t.Pass;
                            if (e.tokenize != y) return 0;
                            var r, s = o && o.charAt(0), l = e.lexical;
                            if (!/^\s*else\b/.test(o)) for (var c = e.cc.length - 1; c >= 0; --c) {
                                var u = e.cc[c];
                                if (u == U) l = l.prev; else if (u != Lt && u != F) break
                            }
                            for (; ("stat" == l.type || "form" == l.type) && ("}" == s || (r = e.cc[e.cc.length - 1]) && (r == X || r == J) && !/^[,\.=+\-*:?[\(]/.test(o));) l = l.prev;
                            a && ")" == l.type && "stat" == l.prev.type && (l = l.prev);
                            var p = l.type, d = s == p;
                            return "vardef" == p ? l.indented + ("operator" == e.lastType || "," == e.lastType ? l.info.length + 1 : 0) : "form" == p && "{" == s ? l.indented : "form" == p ? l.indented + i : "stat" == p ? l.indented + (oe(e, o) ? a || i : 0) : "switch" != l.info || d || 0 == n.doubleIndentSwitch ? l.align ? l.column + (d ? 0 : 1) : l.indented + (d ? 0 : i) : l.indented + (/^(?:case|default)\b/.test(o) ? 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: s,
                        jsonMode: l,
                        expressionAllowed: re,
                        skipExpression: function (e) {
                            T(e, "atom", "atom", "true", new t.StringStream("", 2, null))
                        }
                    }
                })), t.registerHelper("wordChars", "javascript", /[\w$]/), t.defineMIME("text/javascript", "javascript"), t.defineMIME("text/ecmascript", "javascript"), t.defineMIME("application/javascript", "javascript"), t.defineMIME("application/x-javascript", "javascript"), t.defineMIME("application/ecmascript", "javascript"), t.defineMIME("application/json", {
                    name: "javascript",
                    json: !0
                }), t.defineMIME("application/x-json", {
                    name: "javascript",
                    json: !0
                }), t.defineMIME("application/manifest+json", {
                    name: "javascript",
                    json: !0
                }), t.defineMIME("application/ld+json", {
                    name: "javascript",
                    jsonld: !0
                }), t.defineMIME("text/typescript", {
                    name: "javascript",
                    typescript: !0
                }), t.defineMIME("application/typescript", {name: "javascript", typescript: !0})
            }(n(4408))
        }, 9701: (t, e, n) => {
            1 && function (t) {
                "use strict";
                var e = {
                    autoSelfClosers: {
                        area: !0,
                        base: !0,
                        br: !0,
                        col: !0,
                        command: !0,
                        embed: !0,
                        frame: !0,
                        hr: !0,
                        img: !0,
                        input: !0,
                        keygen: !0,
                        link: !0,
                        meta: !0,
                        param: !0,
                        source: !0,
                        track: !0,
                        wbr: !0,
                        menuitem: !0
                    },
                    implicitlyClosed: {
                        dd: !0,
                        li: !0,
                        optgroup: !0,
                        option: !0,
                        p: !0,
                        rp: !0,
                        rt: !0,
                        tbody: !0,
                        td: !0,
                        tfoot: !0,
                        th: !0,
                        tr: !0
                    },
                    contextGrabbers: {
                        dd: {dd: !0, dt: !0},
                        dt: {dd: !0, dt: !0},
                        li: {li: !0},
                        option: {option: !0, optgroup: !0},
                        optgroup: {optgroup: !0},
                        p: {
                            address: !0,
                            article: !0,
                            aside: !0,
                            blockquote: !0,
                            dir: !0,
                            div: !0,
                            dl: !0,
                            fieldset: !0,
                            footer: !0,
                            form: !0,
                            h1: !0,
                            h2: !0,
                            h3: !0,
                            h4: !0,
                            h5: !0,
                            h6: !0,
                            header: !0,
                            hgroup: !0,
                            hr: !0,
                            menu: !0,
                            nav: !0,
                            ol: !0,
                            p: !0,
                            pre: !0,
                            section: !0,
                            table: !0,
                            ul: !0
                        },
                        rp: {rp: !0, rt: !0},
                        rt: {rp: !0, rt: !0},
                        tbody: {tbody: !0, tfoot: !0},
                        td: {td: !0, th: !0},
                        tfoot: {tbody: !0},
                        th: {td: !0, th: !0},
                        thead: {tbody: !0, tfoot: !0},
                        tr: {tr: !0}
                    },
                    doNotIndent: {pre: !0},
                    allowUnquoted: !0,
                    allowMissing: !0,
                    caseFold: !0
                }, n = {
                    autoSelfClosers: {},
                    implicitlyClosed: {},
                    contextGrabbers: {},
                    doNotIndent: {},
                    allowUnquoted: !1,
                    allowMissing: !1,
                    allowMissingTagName: !1,
                    caseFold: !1
                };
                t.defineMode("xml", (function (o, r) {
                    var i, a, s = o.indentUnit, l = {}, c = r.htmlMode ? e : n;
                    for (var u in c) l[u] = c[u];
                    for (var u in r) l[u] = r[u];

                    function p(t, e) {
                        function n(n) {
                            return e.tokenize = n, n(t, e)
                        }

                        var o = t.next();
                        return "<" == o ? t.eat("!") ? t.eat("[") ? t.match("CDATA[") ? n(h("atom", "]]>")) : null : t.match("--") ? n(h("comment", "--\x3e")) : t.match("DOCTYPE", !0, !0) ? (t.eatWhile(/[\w\._\-]/), n(v(1))) : null : t.eat("?") ? (t.eatWhile(/[\w\._\-]/), e.tokenize = h("meta", "?>"), "meta") : (i = t.eat("/") ? "closeTag" : "openTag", e.tokenize = d, "tag bracket") : "&" == o ? (t.eat("#") ? t.eat("x") ? t.eatWhile(/[a-fA-F\d]/) && t.eat(";") : t.eatWhile(/[\d]/) && t.eat(";") : t.eatWhile(/[\w\.\-:]/) && t.eat(";")) ? "atom" : "error" : (t.eatWhile(/[^&<]/), null)
                    }

                    function d(t, e) {
                        var n = t.next();
                        if (">" == n || "/" == n && t.eat(">")) return e.tokenize = p, i = ">" == n ? "endTag" : "selfcloseTag", "tag bracket";
                        if ("=" == n) return i = "equals", null;
                        if ("<" == n) {
                            e.tokenize = p, e.state = _, e.tagName = e.tagStart = null;
                            var o = e.tokenize(t, e);
                            return o ? o + " tag error" : "tag error"
                        }
                        return /[\'\"]/.test(n) ? (e.tokenize = f(n), e.stringStartCol = t.column(), e.tokenize(t, e)) : (t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/), "word")
                    }

                    function f(t) {
                        var e = function (e, n) {
                            for (; !e.eol();) if (e.next() == t) {
                                n.tokenize = d;
                                break
                            }
                            return "string"
                        };
                        return e.isInAttribute = !0, e
                    }

                    function h(t, e) {
                        return function (n, o) {
                            for (; !n.eol();) {
                                if (n.match(e)) {
                                    o.tokenize = p;
                                    break
                                }
                                n.next()
                            }
                            return t
                        }
                    }

                    function v(t) {
                        return function (e, n) {
                            for (var o; null != (o = e.next());) {
                                if ("<" == o) return n.tokenize = v(t + 1), n.tokenize(e, n);
                                if (">" == o) {
                                    if (1 == t) {
                                        n.tokenize = p;
                                        break
                                    }
                                    return n.tokenize = v(t - 1), n.tokenize(e, n)
                                }
                            }
                            return "meta"
                        }
                    }

                    function g(t) {
                        return t && t.toLowerCase()
                    }

                    function y(t, e, n) {
                        this.prev = t.context, this.tagName = e || "", this.indent = t.indented, this.startOfLine = n, (l.doNotIndent.hasOwnProperty(e) || t.context && t.context.noIndent) && (this.noIndent = !0)
                    }

                    function m(t) {
                        t.context && (t.context = t.context.prev)
                    }

                    function b(t, e) {
                        for (var n; 1;) {
                            if (!t.context) return;
                            if (n = t.context.tagName, !l.contextGrabbers.hasOwnProperty(g(n)) || !l.contextGrabbers[g(n)].hasOwnProperty(g(e))) return;
                            m(t)
                        }
                    }

                    function _(t, e, n) {
                        return "openTag" == t ? (n.tagStart = e.column(), w) : "closeTag" == t ? x : _
                    }

                    function w(t, e, n) {
                        return "word" == t ? (n.tagName = e.current(), a = "tag", O) : l.allowMissingTagName && "endTag" == t ? (a = "tag bracket", O(t, e, n)) : (a = "error", w)
                    }

                    function x(t, e, n) {
                        if ("word" == t) {
                            var o = e.current();
                            return n.context && n.context.tagName != o && l.implicitlyClosed.hasOwnProperty(g(n.context.tagName)) && m(n), n.context && n.context.tagName == o || !1 === l.matchClosing ? (a = "tag", C) : (a = "tag error", S)
                        }
                        return l.allowMissingTagName && "endTag" == t ? (a = "tag bracket", C(t, e, n)) : (a = "error", S)
                    }

                    function C(t, e, n) {
                        return "endTag" != t ? (a = "error", C) : (m(n), _)
                    }

                    function S(t, e, n) {
                        return a = "error", C(t, e, n)
                    }

                    function O(t, e, n) {
                        if ("word" == t) return a = "attribute", T;
                        if ("endTag" == t || "selfcloseTag" == t) {
                            var o = n.tagName, r = n.tagStart;
                            return n.tagName = n.tagStart = null, "selfcloseTag" == t || l.autoSelfClosers.hasOwnProperty(g(o)) ? b(n, o) : (b(n, o), n.context = new y(n, o, r == n.indented)), _
                        }
                        return a = "error", O
                    }

                    function T(t, e, n) {
                        return "equals" == t ? P : (l.allowMissing || (a = "error"), O(t, e, n))
                    }

                    function P(t, e, n) {
                        return "string" == t ? E : "word" == t && l.allowUnquoted ? (a = "string", O) : (a = "error", O(t, e, n))
                    }

                    function E(t, e, n) {
                        return "string" == t ? E : O(t, e, n)
                    }

                    return p.isInText = !0, {
                        startState: function (t) {
                            var e = {
                                tokenize: p,
                                state: _,
                                indented: t || 0,
                                tagName: null,
                                tagStart: null,
                                context: null
                            };
                            return null != t && (e.baseIndent = t), e
                        },
                        token: function (t, e) {
                            if (!e.tagName && t.sol() && (e.indented = t.indentation()), t.eatSpace()) return null;
                            i = null;
                            var n = e.tokenize(t, e);
                            return (n || i) && "comment" != n && (a = null, e.state = e.state(i || n, t, e), a && (n = "error" == a ? n + " error" : a)), n
                        },
                        indent: function (e, n, o) {
                            var r = e.context;
                            if (e.tokenize.isInAttribute) return e.tagStart == e.indented ? e.stringStartCol + 1 : e.indented + s;
                            if (r && r.noIndent) return t.Pass;
                            if (e.tokenize != d && e.tokenize != p) return o ? o.match(/^(\s*)/)[0].length : 0;
                            if (e.tagName) return !1 !== l.multilineTagIndentPastTag ? e.tagStart + e.tagName.length + 2 : e.tagStart + s * (l.multilineTagIndentFactor || 1);
                            if (l.alignCDATA && /<!\[CDATA\[/.test(n)) return 0;
                            var i = n && /^<(\/)?([\w_:\.-]*)/.exec(n);
                            if (i && i[1]) for (; r;) {
                                if (r.tagName == i[2]) {
                                    r = r.prev;
                                    break
                                }
                                if (!l.implicitlyClosed.hasOwnProperty(g(r.tagName))) break;
                                r = r.prev
                            } else if (i) for (; r;) {
                                var a = l.contextGrabbers[g(r.tagName)];
                                if (!a || !a.hasOwnProperty(g(i[2]))) break;
                                r = r.prev
                            }
                            for (; r && r.prev && !r.startOfLine;) r = r.prev;
                            return r ? r.indent + s : e.baseIndent || 0
                        },
                        electricInput: /<\/[\s\w:]+>$/,
                        blockCommentStart: "\x3c!--",
                        blockCommentEnd: "--\x3e",
                        configuration: l.htmlMode ? "html" : "xml",
                        helperType: l.htmlMode ? "html" : "xml",
                        skipAttribute: function (t) {
                            t.state == P && (t.state = O)
                        },
                        xmlCurrentTag: function (t) {
                            return t.tagName ? {name: t.tagName, close: "closeTag" == t.type} : null
                        },
                        xmlCurrentContext: function (t) {
                            for (var e = [], n = t.context; n; n = n.prev) e.push(n.tagName);
                            return e.reverse()
                        }
                    }
                })), t.defineMIME("text/xml", "xml"), t.defineMIME("application/xml", "xml"), t.mimeModes.hasOwnProperty("text/html") || t.defineMIME("text/html", {
                    name: "xml",
                    htmlMode: !0
                })
            }(n(4408))
        }, 7058: (t, e, n) => {
            "use strict";
            n.d(e, {A: () => a});
            var o, r = n(9156), i = void 0 && (void 0).__extends || (o = function (t, e) {
                return o = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, o(t, e)
            }, function (t, e) {
                if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");

                function n() {
                    this.constructor = t
                }

                o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
            });
            const a = function (t) {
                function e(e, n, o) {
                    var r = t.call(this, n, o) || this;
                    return r._module = e, r
                }

                return i(e, t), Object.defineProperty(e.prototype, "module", {
                    get: function () {
                        return this._module
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(e.prototype, "config", {
                    get: function () {
                        return this._module.config
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(e.prototype, "em", {
                    get: function () {
                        return this._module.em
                    }, enumerable: !1, configurable: !0
                }), e
            }(r.Kx)
        }, 179: (t, e, n) => {
            "use strict";
            n.d(e, {A: () => s, F: () => r});
            var o, r, i = n(7058), a = void 0 && (void 0).__extends || (o = function (t, e) {
                return o = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, o(t, e)
            }, function (t, e) {
                if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");

                function n() {
                    this.constructor = t
                }

                o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
            });
            !function (t) {
                t["Select"] = "select", t["Hover"] = "hover", t["Spacing"] = "spacing", t["Target"] = "target", t["Resize"] = "resize"
            }(r || (r = {}));
            const s = function (t) {
                function e() {
                    return null !== t && t.apply(this, arguments) || this
                }

                return a(e, t), e.prototype.defaults = function () {
                    return {id: '', type: ''}
                }, Object.defineProperty(e.prototype, "type", {
                    get: function () {
                        return this.get('type') || ''
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(e.prototype, "component", {
                    get: function () {
                        var t;
                        return this.get('component') || (null === (t = this.get('componentView')) || void 0 === t ? void 0 : t.model)
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(e.prototype, "componentView", {
                    get: function () {
                        var t;
                        return this.get('componentView') || (null === (t = this.get('component')) || void 0 === t ? void 0 : t.getView())
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(e.prototype, "el", {
                    get: function () {
                        var t;
                        return null === (t = this.componentView) || void 0 === t ? void 0 : t.el
                    }, enumerable: !1, configurable: !0
                }), e.prototype.getBoxRect = function (t) {
                    var e = this.el, n = this.em.Canvas.getCanvasView(), o = this.get('boxRect');
                    return o || (e && n ? n.getElBoxRect(e, t) : {x: 0, y: 0, width: 0, height: 0})
                }, e.prototype.getStyle = function (t) {
                    void 0 === t && (t = {});
                    var e = t.boxRect || this.getBoxRect(t), n = e.width, o = e.height, r = e.x, i = e.y;
                    return {
                        width: "".concat(n, "px"),
                        height: "".concat(o, "px"),
                        top: '0',
                        left: '0',
                        position: 'absolute',
                        translate: "".concat(r, "px ").concat(i, "px")
                    }
                }, e.prototype.isType = function (t) {
                    return this.type === t
                }, e
            }(i.A)
        }, 1738: (t, e, n) => {
            "use strict";
            var o;
            n.d(e, {A: () => r}), function (t) {
                t["run"] = "command:run", t["runCommand"] = "command:run:", t["runBeforeCommand"] = "command:run:before:", t["abort"] = "command:abort:", t["stop"] = "command:stop", t["stopCommand"] = "command:stop:", t["stopBeforeCommand"] = "command:stop:before:", t["call"] = "command:call", t["callCommand"] = "command:call:"
            }(o || (o = {}));
            const r = o
        }, 9484: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => o});
            const o = {
                run: function (t) {
                    t.Components.clear(), t.Css.clear()
                }
            }
        }, 9516: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => a});
            var o = n(5706), r = n(9966), i = n(6294);
            const a = {
                run: function (t) {
                    (0, o.bindAll)(this, 'onKeyUp', 'enableDragger', 'disableDragger'), this.editor = t, this.canvasModel = this.canvas.getCanvasView().model, this.toggleMove(1)
                }, stop: function (t) {
                    this.toggleMove(), this.disableDragger()
                }, onKeyUp: function (t) {
                    ' ' === (0, i.Ch)(t) && this.editor.stopCommand(this.id)
                }, enableDragger: function (t) {
                    this.toggleDragger(1, t)
                }, disableDragger: function (t) {
                    this.toggleDragger(0, t)
                }, toggleDragger: function (t, e) {
                    var n = this.canvasModel, o = this.em, i = this.dragger, a = t ? 'add' : 'remove';
                    this.getCanvas().classList[a]("".concat(this.ppfx, "is__grabbing")), i || (i = new r.A({
                        getPosition: function () {
                            return {x: n.get('x'), y: n.get('y')}
                        }, setPosition: function (t) {
                            var e = t.x, o = t.y;
                            n.set({x: e, y: o})
                        }, onStart: function (t, e) {
                            o.trigger('canvas:move:start', e)
                        }, onDrag: function (t, e) {
                            o.trigger('canvas:move', e)
                        }, onEnd: function (t, e) {
                            o.trigger('canvas:move:end', e)
                        }
                    }), this.dragger = i), t ? i.start(e) : i.stop()
                }, toggleMove: function (t) {
                    var e = this.ppfx, n = t ? 'add' : 'remove', o = t ? 'on' : 'off', r = {on: i.on, off: i.AU},
                        a = this.getCanvas(), s = ["".concat(e, "is__grab")];
                    !t && s.push("".concat(e, "is__grabbing")), s.forEach((function (t) {
                        return a.classList[n](t)
                    })), r[o](document, 'keyup', this.onKeyUp), r[o](a, 'mousedown', this.enableDragger), r[o](document, 'mouseup', this.disableDragger)
                }
            }
        }, 9946: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => c, defineCommand: () => l});
            var o, r = n(9156), i = n(1738), a = void 0 && (void 0).__extends || (o = function (t, e) {
                return o = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, o(t, e)
            }, function (t, e) {
                if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");

                function n() {
                    this.constructor = t
                }

                o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
            }), s = void 0 && (void 0).__assign || function () {
                return s = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, s.apply(this, arguments)
            };

            function l(t) {
                return t
            }

            const c = function (t) {
                function e(e) {
                    var n = t.call(this, 0) || this;
                    n.config = e || {}, n.em = n.config.em || {};
                    var o = n.config.stylePrefix;
                    return n.pfx = o, n.ppfx = n.config.pStylePrefix, n.hoverClass = "".concat(o, "hover"), n.badgeClass = "".concat(o, "badge"), n.plhClass = "".concat(o, "placeholder"), n.freezClass = "".concat(n.ppfx, "freezed"), n.canvas = n.em.Canvas, n.init(n.config), n
                }

                return a(e, t), e.prototype.onFrameScroll = function (t) {
                }, e.prototype.getCanvas = function () {
                    return this.canvas.getElement()
                }, e.prototype.getCanvasBody = function () {
                    return this.canvas.getBody()
                }, e.prototype.getCanvasTools = function () {
                    return this.canvas.getToolsEl()
                }, e.prototype.offset = function (t) {
                    var e = t.getBoundingClientRect();
                    return {top: e.top + t.ownerDocument.body.scrollTop, left: e.left + t.ownerDocument.body.scrollLeft}
                }, e.prototype.init = function (t) {
                }, e.prototype.callRun = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.id;
                    if (t.trigger("".concat(i.A.runBeforeCommand).concat(n), {options: e}), !e.abort) {
                        var o = e.sender || t, r = this.run(t, o, e), a = {id: n, result: r, options: e},
                            l = s(s({}, a), {type: 'run'});
                        return this.noStop || (t.Commands.active[n] = r), t.trigger("".concat(i.A.runCommand).concat(n), a), t.trigger("".concat(i.A.callCommand).concat(n), l), t.trigger(i.A.run, a), t.trigger(i.A.call, l), r
                    }
                    t.trigger("".concat(i.A.abort).concat(n), {options: e})
                }, e.prototype.callStop = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.id, o = e.sender || t;
                    t.trigger("".concat(i.A.stopBeforeCommand).concat(n), {options: e});
                    var r = this.stop(t, o, e), a = {id: n, result: r, options: e}, l = s(s({}, a), {type: 'stop'});
                    return delete t.Commands.active[n], t.trigger("".concat(i.A.stopCommand).concat(n), a), t.trigger("".concat(i.A.callCommand).concat(n), l), t.trigger(i.A.stop, a), t.trigger(i.A.call, l), r
                }, e.prototype.stopCommand = function (t) {
                    this.em.Commands.stop(this.id, t)
                }, e.prototype.run = function (t, e, n) {
                }, e.prototype.stop = function (t, e, n) {
                }, e
            }(r.Kx)
        }, 7801: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => i});
            var o = n(5706), r = void 0 && (void 0).__spreadArray || function (t, e, n) {
                if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                return t.concat(o || Array.prototype.slice.call(e))
            };
            const i = {
                run: function (t, e, n) {
                    var i = this;
                    void 0 === n && (n = {});
                    var a = [], s = n.component || t.getSelectedAll();
                    return (s = (0, o.isArray)(s) ? r([], s, !0) : [s]).filter(Boolean).forEach((function (t) {
                        var e, n;
                        if (!t.get('removable')) return i.em.logWarning('The element is not removable', {component: t});
                        a.push(t), ((null === (n = null === (e = t.delegate) || void 0 === e ? void 0 : e.remove) || void 0 === n ? void 0 : n.call(e, t)) || t).remove()
                    })), t.selectRemove(a), a
                }
            }
        }, 4864: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => l});
            var o = n(5706), r = n(9966), i = n(1166), a = void 0 && (void 0).__assign || function () {
                return a = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, a.apply(this, arguments)
            }, s = 'dmode';
            const l = {
                run: function (t, e, n) {
                    var i, l, c = this;
                    if (void 0 === n && (n = {}), (0, o.bindAll)(this, 'setPosition', 'onStart', 'onDrag', 'onEnd', 'getPosition', 'getGuidesStatic', 'renderGuide', 'getGuidesTarget'), !n.target) throw new Error('Target option is required');
                    var u = a({
                        doc: null === (i = n.target.getEl()) || void 0 === i ? void 0 : i.ownerDocument,
                        onStart: this.onStart,
                        onEnd: this.onEnd,
                        onDrag: this.onDrag,
                        getPosition: this.getPosition,
                        setPosition: this.setPosition,
                        guidesStatic: function () {
                            var t;
                            return null !== (t = c.guidesStatic) && void 0 !== t ? t : []
                        },
                        guidesTarget: function () {
                            var t;
                            return null !== (t = c.guidesTarget) && void 0 !== t ? t : []
                        }
                    }, null !== (l = n.dragger) && void 0 !== l ? l : {});
                    this.setupGuides(), this.opts = n, this.editor = t, this.em = t.getModel(), this.target = n.target, this.isTran = 'translate' == n.mode, this.guidesContainer = this.getGuidesContainer(), this.guidesTarget = this.getGuidesTarget(), this.guidesStatic = this.getGuidesStatic();
                    var p = this.dragger;
                    return p ? p.setOptions(u) : (p = new r.A(u), this.dragger = p), n.event && p.start(n.event), this.toggleDrag(!0), this.em.trigger("".concat(s, ":start"), this.getEventOpts()), p
                }, getEventOpts: function () {
                    var t, e,
                        n = null !== (e = null === (t = this.guidesTarget) || void 0 === t ? void 0 : t.filter((function (t) {
                            return t.active
                        }))) && void 0 !== e ? e : [];
                    return {
                        mode: this.opts.mode,
                        component: this.target,
                        target: this.target,
                        guidesTarget: this.guidesTarget,
                        guidesStatic: this.guidesStatic,
                        guidesMatched: this.getGuidesMatched(n),
                        command: this
                    }
                }, stop: function () {
                    this.toggleDrag()
                }, setupGuides: function () {
                    var t;
                    (null !== (t = this.guides) && void 0 !== t ? t : []).forEach((function (t) {
                        var e, n = t.guide;
                        null === (e = null == n ? void 0 : n.parentNode) || void 0 === e || e.removeChild(n)
                    })), this.guides = []
                }, getGuidesContainer: function () {
                    var t, e, n, r, i = this, a = this.guidesEl;
                    if (!a) {
                        var s = this, l = s.editor, c = s.em, u = s.opts,
                            p = null !== (t = l.getConfig().stylePrefix) && void 0 !== t ? t : '',
                            d = document.createElement('div'), f = document.createElement('div'),
                            h = "<div class=\"".concat(p, "guide-info__line ").concat(p, "danger-bg\">\n        <div class=\"").concat(p, "guide-info__content ").concat(p, "danger-color\"></div>\n      </div>");
                        (a = document.createElement('div')).className = "".concat(p, "guides"), d.className = "".concat(p, "guide-info ").concat(p, "guide-info__x"), f.className = "".concat(p, "guide-info ").concat(p, "guide-info__y"), d.innerHTML = h, f.innerHTML = h, a.appendChild(d), a.appendChild(f), null === (e = l.Canvas.getGlobalToolsEl()) || void 0 === e || e.appendChild(a), this.guidesEl = a, this.elGuideInfoX = d, this.elGuideInfoY = f, this.elGuideInfoContentX = null !== (n = d.querySelector(".".concat(p, "guide-info__content"))) && void 0 !== n ? n : void 0, this.elGuideInfoContentY = null !== (r = f.querySelector(".".concat(p, "guide-info__content"))) && void 0 !== r ? r : void 0, c.on('canvas:update frame:scroll', (0, o.debounce)((function () {
                            var t;
                            i.updateGuides(), u.debug && (null === (t = i.guides) || void 0 === t || t.forEach((function (t) {
                                return i.renderGuide(t)
                            })))
                        }), 200))
                    }
                    return a
                }, getGuidesStatic: function () {
                    var t = this, e = [], n = this.target.getEl(), r = null == n ? void 0 : n.parentElement;
                    return r ? ((0, o.each)(r.children, (function (o) {
                        return e = e.concat(n !== o ? t.getElementGuides(o) : [])
                    })), e.concat(this.getElementGuides(r))) : []
                }, getGuidesTarget: function () {
                    return this.getElementGuides(this.target.getEl())
                }, updateGuides: function (t) {
                    var e, n, r, i = this;
                    (null !== (e = null != t ? t : this.guides) && void 0 !== e ? e : []).forEach((function (t) {
                        var e = t.origin, a = n === e ? r : i.getElementPos(e);
                        n = e, r = a, (0, o.each)(i.getGuidePosUpdate(t, a), (function (e, n) {
                            t[n] = e
                        })), t.originRect = a
                    }))
                }, getGuidePosUpdate: function (t, e) {
                    var n = {}, o = e.top, r = e.height, i = e.left, a = e.width;
                    switch (t.type) {
                        case't':
                            n.y = o;
                            break;
                        case'b':
                            n.y = o + r;
                            break;
                        case'l':
                            n.x = i;
                            break;
                        case'r':
                            n.x = i + a;
                            break;
                        case'x':
                            n.x = i + a / 2;
                            break;
                        case'y':
                            n.y = o + r / 2
                    }
                    return n
                }, renderGuide: function (t) {
                    var e, n;
                    if (!this.opts.skipGuidesRender) {
                        var o = null !== (e = t.guide) && void 0 !== e ? e : document.createElement('div'), r = 'px',
                            i = t.active ? 2 : 1;
                        if (o.style.cssText = "position: absolute; background-color: ".concat(t.active ? 'green' : 'red', ";"), !o.children.length) {
                            var a = document.createElement('div');
                            a.style.cssText = 'position: absolute; color: red; padding: 5px; top: 0; left: 0;', o.appendChild(a)
                        }
                        return t.y ? (o.style.width = '100%', o.style.height = "".concat(i).concat(r), o.style.top = "".concat(t.y).concat(r), o.style.left = '0') : (o.style.width = "".concat(i).concat(r), o.style.height = '100%', o.style.left = "".concat(t.x).concat(r), o.style.top = "0".concat(r)), !t.guide && (null === (n = this.guidesContainer) || void 0 === n || n.appendChild(o)), o
                    }
                }, getElementPos: function (t) {
                    return this.editor.Canvas.getElementPos(t, {noScroll: 1})
                }, getElementGuides: function (t) {
                    var e = this, n = this.opts, o = t, r = this.getElementPos(t), s = (0, i.getComponentModel)(t),
                        l = (0, i.getComponentView)(t), c = r.top, u = r.height, p = r.left, d = r.width,
                        f = [{type: 't', y: c}, {type: 'b', y: c + u}, {type: 'l', x: p}, {
                            type: 'r',
                            x: p + d
                        }, {type: 'x', x: p + d / 2}, {type: 'y', y: c + u / 2}].map((function (t) {
                            var i = n.debug ? e.renderGuide(t) : void 0;
                            return a(a({}, t), {
                                component: s,
                                componentView: l,
                                componentEl: o,
                                origin: o,
                                componentElRect: r,
                                originRect: r,
                                guideEl: i,
                                guide: i
                            })
                        }));
                    return f.forEach((function (t) {
                        var n;
                        return null === (n = e.guides) || void 0 === n ? void 0 : n.push(t)
                    })), f
                }, getTranslate: function (t, e) {
                    void 0 === e && (e = 'x');
                    var n = 0;
                    return (t || '').split(' ').forEach((function (t) {
                        var o = t.trim(), r = "translate".concat(e.toUpperCase(), "(");
                        0 === o.indexOf(r) && (n = parseFloat(o.replace(r, '')))
                    })), n
                }, setTranslate: function (t, e, n) {
                    var o = "translate".concat(e.toUpperCase(), "("), r = "".concat(o).concat(n, ")"),
                        i = (t || '').split(' ').map((function (t) {
                            return 0 === t.trim().indexOf(o) && (t = r), t
                        })).join(' ');
                    return i.indexOf(o) < 0 && (i += " ".concat(r)), i
                }, getPosition: function () {
                    var t = this.target, e = this.isTran, n = t.getStyle(), o = n.transform, r = n.left, i = n.top,
                        a = 0, s = 0;
                    return e && o ? (a = this.getTranslate(o), s = this.getTranslate(o, 'y')) : (a = parseFloat(null != r ? r : '0'), s = parseFloat(null != i ? i : '0')), {
                        x: a,
                        y: s
                    }
                }, setPosition: function (t) {
                    var e, n, r = t.x, i = t.y, a = t.end, s = t.position, l = t.width, c = t.height, u = this,
                        p = u.target, d = u.isTran, f = u.em, h = u.opts, v = 'px', g = !a,
                        y = "".concat(parseInt("".concat(r), 10)).concat(v),
                        m = "".concat(parseInt("".concat(i), 10)).concat(v), b = {};
                    if (d) {
                        var _ = null !== (n = null === (e = p.getStyle()) || void 0 === e ? void 0 : e.transform) && void 0 !== n ? n : '';
                        _ = this.setTranslate(_, 'x', y), b = {transform: _ = this.setTranslate(_, 'y', m), __p: g}
                    } else {
                        var w = {position: s, width: l, height: c}, x = {left: y, top: m, __p: g};
                        (0, o.keys)(w).forEach((function (t) {
                            var e = w[t];
                            e && (x[t] = e)
                        })), b = x
                    }
                    h.addStyle ? h.addStyle({
                        component: p,
                        styles: b,
                        partial: !a
                    }) : p.addStyle(b, {avoidStore: !a}), f.Styles.__emitCmpStyleUpdate(b, {components: f.getSelected()})
                }, _getDragData: function () {
                    var t = this.target;
                    return {target: t, parent: t.parent(), index: t.index()}
                }, onStart: function (t) {
                    var e, n = this, o = n.target, r = n.editor, i = n.isTran, a = n.opts, s = r.Canvas,
                        l = o.getStyle(), c = 'absolute', u = [c, 'relative'];
                    if (null === (e = a.onStart) || void 0 === e || e.call(a, this._getDragData()), !i) {
                        if (l.position !== c) {
                            var p = s.offset(o.getEl()), d = p.left, f = p.top, h = p.width, v = p.height,
                                g = o.parent(), y = null;
                            do {
                                var m = null == g ? void 0 : g.getStyle(), b = null == m ? void 0 : m.position;
                                b && (y = u.indexOf(b) >= 0 ? g : null), g = null == g ? void 0 : g.parent()
                            } while (g && !y);
                            if (a.center) {
                                var _ = s.getMouseRelativeCanvas(t);
                                d = _.x, f = _.y
                            } else if (y) {
                                var w = s.offset(y.getEl());
                                d -= w.left, f -= w.top
                            }
                            this.setPosition({
                                x: d,
                                y: f,
                                width: "".concat(h, "px"),
                                height: "".concat(v, "px"),
                                position: c
                            })
                        }
                        this.guidesStatic = this.getGuidesStatic()
                    }
                }, onDrag: function (t) {
                    var e, n, o = this, r = this.guidesTarget, i = this.opts;
                    this.updateGuides(r), i.debug && (null == r || r.forEach((function (t) {
                        return o.renderGuide(t)
                    }))), i.guidesInfo && this.renderGuideInfo(null !== (e = null == r ? void 0 : r.filter((function (t) {
                        return t.active
                    }))) && void 0 !== e ? e : []), null === (n = i.onDrag) || void 0 === n || n.call(i, this._getDragData()), this.opts.event = t, this.em.trigger("".concat(s, ":move"), this.getEventOpts())
                }, onEnd: function (t, e, n) {
                    var o, r = this, i = r.editor, l = r.opts, c = r.id;
                    null === (o = l.onEnd) || void 0 === o || o.call(l, t, n, a(a({event: t}, n), this._getDragData())), i.stopCommand("".concat(c)), this.hideGuidesInfo(), this.em.trigger("".concat(s, ":end"), this.getEventOpts())
                }, hideGuidesInfo: function () {
                    var t = this;
                    ['X', 'Y'].forEach((function (e) {
                        var n = t["elGuideInfo".concat(e)];
                        n && (n.style.display = 'none')
                    }))
                }, renderGuideInfo: function (t) {
                    var e = this;
                    void 0 === t && (t = []), this.hideGuidesInfo(), this.getGuidesMatched(t).forEach((function (t) {
                        e.opts.skipGuidesRender || e.renderSingleGuideInfo(t), e.em.trigger("".concat(s, ":active"), a(a({}, e.getEventOpts()), t))
                    }))
                }, renderSingleGuideInfo: function (t) {
                    var e = t.posFirst, n = t.posSecond, r = t.size, i = t.sizeRaw, a = t.guide, s = t.elGuideInfo,
                        l = t.elGuideInfoCnt, c = 'y' === ((0, o.isUndefined)(a.x) ? 'y' : 'x'), u = s.style;
                    u.display = '', u[c ? 'top' : 'left'] = "".concat(e, "px"), u[c ? 'left' : 'top'] = "".concat(n, "px"), u[c ? 'width' : 'height'] = "".concat(r, "px"), l.innerHTML = "".concat(Math.round(i), "px")
                }, getGuidesMatched: function (t) {
                    var e = this;
                    void 0 === t && (t = []);
                    var n = this.guidesStatic, r = void 0 === n ? [] : n;
                    return t.map((function (t) {
                        var n = t.origin, i = t.x, a = e.getElementPos(n), s = (0, o.isUndefined)(i) ? 'y' : 'x',
                            l = 'y' === s, c = a[l ? 'left' : 'top'], u = a.rect[l ? 'left' : 'top'],
                            p = l ? c + a.width : c + a.height, d = l ? u + a.rect.width : u + a.rect.height,
                            f = r.filter((function (e) {
                                var n;
                                return e.type === t.type || (null === (n = {
                                    l: ['r', 'x'],
                                    r: ['l', 'x'],
                                    x: ['l', 'r'],
                                    t: ['b', 'y'],
                                    b: ['t', 'y'],
                                    y: ['t', 'b']
                                }[t.type]) || void 0 === n ? void 0 : n.includes(e.type))
                            })).map((function (t) {
                                var e = t.originRect, n = e.left, o = e.width, r = e.top, i = e.height,
                                    a = l ? n + o : r + i;
                                return {gap: a < c ? c - a : (l ? n : r) - p, guide: t}
                            })).filter((function (t) {
                                return t.gap > 0
                            })).sort((function (t, e) {
                                return t.gap - e.gap
                            })).map((function (t) {
                                return t.guide
                            })).filter((function (e) {
                                switch (t.type) {
                                    case'l':
                                    case'r':
                                    case'x':
                                        return Math.abs(e.x - t.x) < 1;
                                    case't':
                                    case'b':
                                    case'y':
                                        return Math.abs(e.y - t.y) < 1;
                                    default:
                                        return !1
                                }
                            })), h = f[0];
                        if (h) {
                            var v = h.originRect, g = v.left, y = v.width, m = v.top, b = v.height, _ = v.rect,
                                w = l ? g < a.left : m < a.top, x = l ? g : m, C = l ? _.left : _.top,
                                S = l ? g + y : m + b, O = l ? _.left + _.width : _.top + _.height, T = l ? t.y : t.x,
                                P = w ? S : p, E = w ? c - S : x - p, k = w ? u - O : C - d,
                                A = e["elGuideInfo".concat(s.toUpperCase())],
                                j = e["elGuideInfoContent".concat(s.toUpperCase())];
                            return {
                                guide: t,
                                guidesStatic: r,
                                matched: h,
                                posFirst: T,
                                posSecond: P,
                                size: E,
                                sizeRaw: k,
                                elGuideInfo: A,
                                elGuideInfoCnt: j
                            }
                        }
                        return null
                    })).filter(Boolean)
                }, toggleDrag: function (t) {
                    var e = this.ppfx, n = this.editor, o = t ? 'add' : 'remove', r = ["".concat(e, "is__grabbing")],
                        i = n.Canvas, a = i.getBody();
                    r.forEach((function (t) {
                        return a.classList[o](t)
                    })), i[t ? 'startAutoscroll' : 'stopAutoscroll']()
                }, editor: void 0, em: void 0, opts: void 0, target: void 0
            }
        }, 6134: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => o});
            const o = {
                run: function (t) {
                    if (t.Canvas.hasFocus()) {
                        var e = [];
                        t.getSelectedAll().forEach((function (t) {
                            var n = t.components(), o = n && n.filter((function (t) {
                                return t.get('selectable')
                            }))[0];
                            o && e.push(o)
                        })), e.length && t.select(e)
                    }
                }
            }
        }, 914: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => o});
            const o = {
                run: function (t, e, n) {
                    if (void 0 === n && (n = {}), t.Canvas.hasFocus() || n.force) {
                        var o = [];
                        t.getSelectedAll().forEach((function (t) {
                            for (var e = t.parent(); e && !e.get('selectable');) e = e.parent();
                            e && o.push(e)
                        })), o.length && t.select(o)
                    }
                }
            }
        }, 5547: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => o});
            const o = {
                run: function (t) {
                    if (t.Canvas.hasFocus()) {
                        var e = [];
                        t.getSelectedAll().forEach((function (t) {
                            var n = t.parent();
                            if (n) {
                                var o, r = n.components().length, i = 0, a = 0;
                                do {
                                    i++, o = (a = t.index() + i) <= r ? n.getChildAt(a) : null
                                } while (o && !o.get('selectable'));
                                e.push(o || t)
                            }
                        })), e.length && t.select(e)
                    }
                }
            }
        }, 8655: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => o});
            const o = {
                run: function (t) {
                    if (t.Canvas.hasFocus()) {
                        var e = [];
                        t.getSelectedAll().forEach((function (t) {
                            var n = t.parent();
                            if (n) {
                                var o, r = 0, i = 0;
                                do {
                                    r++, o = (i = t.index() - r) >= 0 ? n.getChildAt(i) : null
                                } while (o && !o.get('selectable'));
                                e.push(o || t)
                            }
                        })), e.length && t.select(e)
                    }
                }
            }
        }, 7640: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => r});
            var o = n(5706);
            const r = {
                run: function (t, e, n) {
                    void 0 === n && (n = {});
                    var r = n.target, i = [];
                    if (!r.get('styles')) return i;
                    var a = r.get('type'), s = t.Pages.getAllWrappers();
                    if (!(0, o.flatten)(s.map((function (t) {
                        return t.findType(a)
                    }))).length) {
                        var l = t.CssComposer.getAll();
                        i = l.filter((function (t) {
                            return t.get('group') === "cmp:".concat(a)
                        })), l.remove(i)
                    }
                    return i
                }
            }
        }, 5837: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => r});
            var o = void 0 && (void 0).__spreadArray || function (t, e, n) {
                if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                return t.concat(o || Array.prototype.slice.call(e))
            };
            const r = {
                run: function (t) {
                    var e = t.getModel(), n = o([], t.getSelectedAll(), !0).map((function (t) {
                        var e, n;
                        return (null === (n = null === (e = t.delegate) || void 0 === e ? void 0 : e.copy) || void 0 === n ? void 0 : n.call(e, t)) || t
                    })).filter(Boolean);
                    n.length && e.set('clipboard', n)
                }
            }
        }, 6477: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => r});
            var o = n(6294);
            const r = {
                run: function (t, e, n) {
                    var r = this;
                    void 0 === n && (n = {}), e && e.set && e.set('active', 0);
                    var i = t.getConfig(), a = t.Modal, s = i.stylePrefix;
                    if (this.cm = t.CodeManager || null, !this.editors) {
                        var l = this.buildEditor('htmlmixed', 'hopscotch', 'HTML'),
                            c = this.buildEditor('css', 'hopscotch', 'CSS');
                        this.htmlEditor = l.model, this.cssEditor = c.model;
                        var u = (0, o.a_)('div', {class: "".concat(s, "export-dl")});
                        u.appendChild(l.el), u.appendChild(c.el), this.editors = u
                    }
                    a.open({title: i.textViewCode, content: this.editors}).getModel().once('change:open', (function () {
                        return t.stopCommand("".concat(r.id))
                    })), this.htmlEditor.setContent(t.getHtml(n.optsHtml)), this.cssEditor.setContent(t.getCss(n.optsCss))
                }, stop: function (t) {
                    var e = t.Modal;
                    e && e.close()
                }, buildEditor: function (t, e, n) {
                    var o = this.em.CodeManager, r = o.createViewer({label: n, codeName: t, theme: e});
                    return {model: r, el: new o.EditorView({model: r, config: o.getConfig()}).render().el}
                }
            }
        }, 1772: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => r});
            var o = n(5706);
            const r = {
                isEnabled: function () {
                    var t = document;
                    return !!(t.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement)
                }, enable: function (t) {
                    var e = '';
                    return t.requestFullscreen ? t.requestFullscreen() : t.webkitRequestFullscreen ? (e = 'webkit', t.webkitRequestFullscreen()) : t.mozRequestFullScreen ? (e = 'moz', t.mozRequestFullScreen()) : t.msRequestFullscreen && t.msRequestFullscreen(), e
                }, disable: function () {
                    var t = document;
                    this.isEnabled() && (t.exitFullscreen ? t.exitFullscreen() : t.webkitExitFullscreen ? t.webkitExitFullscreen() : t.mozCancelFullScreen ? t.mozCancelFullScreen() : t.msExitFullscreen && t.msExitFullscreen())
                }, fsChanged: function (t) {
                    this.isEnabled() || (this.stopCommand({sender: this.sender}), document.removeEventListener("".concat(t || '', "fullscreenchange"), this.fsChanged))
                }, run: function (t, e, n) {
                    void 0 === n && (n = {}), this.sender = e;
                    var r = n.target, i = (0, o.isElement)(r) ? r : document.querySelector(r),
                        a = this.enable(i || t.getContainer());
                    this.fsChanged = this.fsChanged.bind(this, a), document.addEventListener(a + 'fullscreenchange', this.fsChanged)
                }, stop: function (t, e) {
                    e && e.set && e.set('active', !1), this.disable()
                }
            }
        }, 741: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => l});
            var o = n(5706), r = n(7774), i = n(6294), a = n(9317), s = n(1406);
            const l = (0, o.extend)({}, s["default"], a["default"], {
                init: function (t) {
                    a["default"].init.apply(this, arguments), (0, o.bindAll)(this, 'initSorter', 'rollback', 'onEndMove'), this.opt = t, this.hoverClass = this.ppfx + 'highlighter-warning', this.badgeClass = this.ppfx + 'badge-warning', this.noSelClass = this.ppfx + 'no-select'
                }, enable: function () {
                    for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                    a["default"].enable.apply(this, t), this.getBadgeEl().addClass(this.badgeClass), this.getHighlighterEl().addClass(this.hoverClass);
                    var n = this.$wrapper;
                    n.css('cursor', 'move'), n.on('mousedown', this.initSorter), n.addClass(this.noSelClass)
                }, toggleClipboard: function () {
                }, initSorter: function (t) {
                    var e = (0, r["default"])(t.target).data('model').get('draggable');
                    e && (this.cacheEl = null, this.startSelectPosition(t.target, this.frameEl.contentDocument), this.sorter.draggable = e, this.sorter.eventHandlers.legacyOnEndMove = this.onEndMove.bind(this), this.stopSelectComponent(), this.$wrapper.off('mousedown', this.initSorter), (0, i.on)(this.getContentWindow(), 'keydown', this.rollback))
                }, initSorterFromModel: function (t) {
                    var e = t.get('draggable');
                    if (e) {
                        this.cacheEl = null;
                        var n = t.view.el;
                        this.startSelectPosition(n, this.frameEl.contentDocument), this.sorter.draggable = e, this.sorter.eventHandlers.legacyOnEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, i.on)(this.getContentWindow(), 'keydown', this.rollback)
                    }
                }, initSorterFromModels: function (t) {
                    this.cacheEl = null;
                    var e = t[t.length - 1], n = this.em.getCurrentFrame(),
                        o = e.getEl(null == n ? void 0 : n.model).ownerDocument, r = t.map((function (t) {
                            var e;
                            return null === (e = null == t ? void 0 : t.view) || void 0 === e ? void 0 : e.el
                        }));
                    this.startSelectPosition(r, o, {onStart: this.onStart}), this.sorter.eventHandlers.legacyOnMoveClb = this.onDrag, this.sorter.eventHandlers.legacyOnEndMove = this.onEndMoveFromModel.bind(this), this.stopSelectComponent(), (0, i.on)(this.getContentWindow(), 'keydown', this.rollback)
                }, onEndMoveFromModel: function () {
                    (0, i.AU)(this.getContentWindow(), 'keydown', this.rollback)
                }, onEndMove: function () {
                    this.enable(), (0, i.AU)(this.getContentWindow(), 'keydown', this.rollback)
                }, onSelect: function (t, e) {
                }, rollback: function (t, e) {
                    (27 == (t.which || t.keyCode) || e) && this.sorter.cancelDrag()
                }, 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 t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                    a["default"].stop.apply(this, t), this.getBadgeEl().removeClass(this.badgeClass), this.getHighlighterEl().removeClass(this.hoverClass), this.$wrapper.css('cursor', '').unbind().removeClass(this.noSelClass)
                }
            })
        }, 2924: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => i});
            var o = n(5706), r = n(6294);
            const i = {
                open: function (t) {
                    var e = this, n = this, r = n.editor, i = n.title, a = n.config, s = n.am, l = a.custom;
                    if ((0, o.isFunction)(l.open)) return l.open(s.__customData());
                    r.Modal.open({title: i, content: t}).onceClose((function () {
                        return r.stopCommand(e.id)
                    }))
                }, close: function () {
                    var t = this.config.custom;
                    if ((0, o.isFunction)(t.close)) return t.close(this.am.__customData());
                    var e = this.editor.Modal;
                    e && e.close()
                }, run: function (t, e, n) {
                    void 0 === n && (n = {});
                    var o = t.AssetManager, i = o.getConfig(), a = n.types, s = void 0 === a ? [] : a, l = n.accept,
                        c = n.select;
                    if (this.title = n.modalTitle || t.t('assetManager.modalTitle') || '', this.editor = t, this.config = i, this.am = o, o.setTarget(n.target), o.onClick(n.onClick), o.onDblClick(n.onDblClick), o.onSelect(n.onSelect), o.__behaviour({
                        select: c,
                        types: s,
                        options: n
                    }), i.custom) this.rendered = this.rendered || (0, r.a_)('div'), this.rendered.className = "".concat(i.stylePrefix, "custom-wrp"), o.__behaviour({container: this.rendered}), o.__trgCustom(); else {
                        if (!this.rendered || s) {
                            var u = o.getAll().filter((function (t) {
                                return t
                            }));
                            s && s.length && (u = u.filter((function (t) {
                                return -1 !== s.indexOf(t.get('type'))
                            }))), o.render(u), this.rendered = o.getContainer()
                        }
                        if (l) {
                            var p = this.rendered.querySelector("input#".concat(i.stylePrefix, "uploadFile"));
                            p && p.setAttribute('accept', l)
                        }
                    }
                    return this.open(this.rendered), this
                }, stop: function (t) {
                    this.editor = t, this.close(this.rendered)
                }
            }
        }, 3963: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => i});
            var o = n(5706), r = n(6294);
            const i = {
                open: function () {
                    var t = this, e = t.container, n = t.editor, r = t.bm, i = t.config, a = i.custom, s = i.appendTo;
                    if ((0, o.isFunction)(a.open)) return a.open(r.__customData());
                    if (this.firstRender && !s) {
                        var l = 'views-container', c = n.Panels;
                        (c.getPanel(l) || c.addPanel({id: l})).set('appendContent', e).trigger('change:appendContent'), a || e.appendChild(r.render())
                    }
                    e && (e.style.display = 'block')
                }, close: function () {
                    var t = this.container, e = this.config.custom;
                    if ((0, o.isFunction)(e.close)) return e.close(this.bm.__customData());
                    t && (t.style.display = 'none')
                }, run: function (t) {
                    var e = t.Blocks;
                    this.config = e.getConfig(), this.firstRender = !this.container, this.container = this.container || (0, r.a_)('div'), this.editor = t, this.bm = e;
                    var n = this.container;
                    e.__behaviour({container: n}), this.config.custom && e.__trgCustom(), this.open()
                }, stop: function () {
                    this.close()
                }
            }
        }, 1479: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => o});
            const o = {
                run: function (t) {
                    var e = t.LayerManager, n = t.Panels, o = e.getConfig();
                    if (!o.appendTo) {
                        if (!this.layers) {
                            var r = 'views-container', i = document.createElement('div'),
                                a = n.getPanel(r) || n.addPanel({id: r});
                            o.custom ? e.__trgCustom({container: i}) : i.appendChild(e.render()), a.set('appendContent', i).trigger('change:appendContent'), this.layers = i
                        }
                        this.layers.style.display = 'block'
                    }
                }, stop: function () {
                    var t = this.layers;
                    t && (t.style.display = 'none')
                }
            }
        }, 3473: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => r});
            var o = n(7774);
            const r = {
                run: function (t, e) {
                    if (this.sender = e, !this.$cnt) {
                        var n = t.getConfig(), r = t.Panels, i = t.DeviceManager, a = t.SelectorManager,
                            s = t.StyleManager, l = 'change:appendContent', c = (0, o["default"])('<div></div>'),
                            u = (0, o["default"])('<div></div>'), p = (0, o["default"])('<div></div>'),
                            d = (0, o["default"])('<div></div>');
                        if (this.$cnt = c, this.$cntInner = u, u.append(p), u.append(d), c.append(u), i && n.showDevices) {
                            var f = r.addPanel({id: 'devices-c'}), h = i.render();
                            f.set('appendContent', h).trigger(l)
                        }
                        var v = a.getConfig();
                        v.custom ? a.__trgCustom({container: p.get(0)}) : v.appendTo || p.append(a.render([])), this.sm = s;
                        var g = s.getConfig(), y = g.stylePrefix;
                        this.$header = (0, o["default"])("<div class=\"".concat(y, "header\">").concat(t.t('styleManager.empty'), "</div>")), c.append(this.$header), g.custom ? s.__trgCustom({container: d.get(0)}) : g.appendTo || d.append(s.render());
                        var m = 'views-container';
                        (r.getPanel(m) || r.addPanel({id: m})).set('appendContent', c).trigger(l);
                        var b = t.getModel();
                        this.listenTo(b, s.events.target, this.toggleSm)
                    }
                    this.toggleSm()
                }, toggleSm: function () {
                    var t = this, e = t.sender, n = t.sm, o = t.$cntInner, r = t.$header;
                    e && e.get && !e.get('active') || !n || (n.getSelected() ? (null == o || o.show(), null == r || r.hide()) : (null == o || o.hide(), null == r || r.show()))
                }, stop: function () {
                    var t, e;
                    null === (t = this.$cntInner) || void 0 === t || t.hide(), null === (e = this.$header) || void 0 === e || e.hide()
                }
            }
        }, 5054: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => r});
            var o = n(7774);
            const r = {
                run: function (t, e) {
                    this.sender = e;
                    var n, r = t.getModel(), i = t.Config.stylePrefix, a = t.TraitManager, s = a.getConfig();
                    if (!s.appendTo) {
                        if (!this.$cn) {
                            this.$cn = (0, o["default"])('<div></div>'), this.$cn2 = (0, o["default"])('<div></div>'), this.$cn.append(this.$cn2), this.$header = (0, o["default"])('<div>').append("<div class=\"".concat(s.stylePrefix, "header\">").concat(r.t('traitManager.empty'), "</div>")), this.$cn.append(this.$header), s.custom ? a.__trgCustom({container: this.$cn2.get(0)}) : (this.$cn2.append("<div class=\"".concat(i, "traits-label\">").concat(r.t('traitManager.label'), "</div>")), this.$cn2.append(a.render()));
                            var l = t.Panels;
                            null == (n = l.getPanel('views-container') ? l.getPanel('views-container') : l.addPanel({id: 'views-container'})) || n.set('appendContent', this.$cn.get(0)).trigger('change:appendContent'), this.target = t.getModel(), this.listenTo(this.target, 'component:toggled', this.toggleTm)
                        }
                        this.toggleTm()
                    }
                }, toggleTm: function () {
                    var t = this.sender;
                    t && t.get && !t.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()
                }
            }
        }, 6979: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => r});
            var o = n(5706);
            const r = {
                run: function (t, e, n) {
                    void 0 === n && (n = {});
                    var r = t.getModel(), a = r.get('clipboard'), s = t.getSelected();
                    (null == a ? void 0 : a.length) && s && (t.getSelectedAll().forEach((function (e) {
                        var s, l, c, u,
                            p = (null === (l = null === (s = e.delegate) || void 0 === s ? void 0 : s.copy) || void 0 === l ? void 0 : l.call(s, e)) || e,
                            d = p.collection;
                        if (d) {
                            var f = {at: p.index() + 1, action: n.action || 'paste-component'};
                            u = (0, o.contains)(a, p) && p.get('copyable') ? d.add(p.clone(), f) : i(t, a, p.parent(), f)
                        } else {
                            var h = null === (c = r.Pages.getSelected()) || void 0 === c ? void 0 : c.getMainComponent();
                            f = {
                                at: (null == h ? void 0 : h.components().length) || 0,
                                action: n.action || 'paste-component'
                            };
                            u = i(t, a, h, f)
                        }
                        (u = (0, o.isArray)(u) ? u : [u]).forEach((function (e) {
                            return t.trigger('component:paste', e)
                        }))
                    })), s.emitUpdate())
                }
            };

            function i(t, e, n, o) {
                var r = e.filter((function (t) {
                    return t.get('copyable')
                })).filter((function (e) {
                    return t.Components.canMove(n, e).result
                }));
                return n.components().add(r.map((function (t) {
                    return t.clone()
                })), o)
            }
        }, 4457: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => a});
            var o = n(5706), r = void 0 && (void 0).__spreadArray || function (t, e, n) {
                if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                return t.concat(o || Array.prototype.slice.call(e))
            }, i = 'core:component-outline';
            const a = {
                getPanels: function (t) {
                    return this.panels || (this.panels = t.Panels.getPanels()), this.panels
                }, preventDrag: function (t) {
                    t.abort = 1
                }, tglEffects: function (t) {
                    var e = this.em, n = t ? 'on' : 'off';
                    if (e) {
                        var r = e.Canvas, i = r.getBody(), a = r.getToolbarEl();
                        a && (a.style.display = t ? 'none' : '');
                        var s = i.querySelectorAll(".".concat(this.ppfx, "no-pointer"));
                        (0, o.each)(s, (function (e) {
                            return e.style.pointerEvents = t ? 'all' : ''
                        })), e[n]('run:tlb-move:before', this.preventDrag)
                    }
                }, run: function (t, e) {
                    var n = this;
                    this.sender = e, this.selected = r([], t.getSelectedAll(), !0), t.select(), this.shouldRunSwVisibility || (this.shouldRunSwVisibility = t.Commands.isActive(i)), this.shouldRunSwVisibility && t.stopCommand(i), t.getModel().stopDefault();
                    var o = this.getPanels(t), a = t.Canvas.getElement(), s = t.getEl(), l = t.Config.stylePrefix;
                    if (!this.helper) {
                        var c = document.createElement('span');
                        c.className = "".concat(l, "off-prv fa fa-eye-slash"), s.appendChild(c), c.onclick = function () {
                            return n.stopCommand()
                        }, this.helper = c
                    }
                    this.helper.style.display = 'inline-block', o.forEach((function (t) {
                        return t.set('visible', !1)
                    }));
                    var u = a.style;
                    u.width = '100%', u.height = '100%', u.top = '0', u.left = '0', u.padding = '0', u.margin = '0', t.refresh(), this.tglEffects(1)
                }, stop: function (t) {
                    var e = this.sender, n = void 0 === e ? {} : e, o = this.selected;
                    n.set && n.set('active', 0);
                    var r = this.getPanels(t);
                    this.shouldRunSwVisibility && (t.runCommand(i), this.shouldRunSwVisibility = !1), t.getModel().runDefault(), r.forEach((function (t) {
                        return t.set('visible', !0)
                    })), t.Canvas.getElement().setAttribute('style', ''), o && t.select(o), delete this.selected, this.helper && (this.helper.style.display = 'none'), t.refresh(), this.tglEffects()
                }
            }
        }, 5493: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {ConvertUnitsToPx: () => o, default: () => l});
            var o, r = n(2225), i = n(1166), a = void 0 && (void 0).__assign || function () {
                return a = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, a.apply(this, arguments)
            }, s = void 0 && (void 0).__rest || function (t, e) {
                var n = {};
                for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
                if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                    var r = 0;
                    for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
                }
                return n
            };
            !function (t) {
                t["pt"] = "pt", t["pc"] = "pc", t["in"] = "in", t["cm"] = "cm", t["mm"] = "mm", t["vw"] = "vw", t["vh"] = "vh", t["vmin"] = "vmin", t["vmax"] = "vmax", t["svw"] = "svw", t["lvw"] = "lvw", t["dvw"] = "dvw", t["svh"] = "svh", t["lvh"] = "lvh", t["dvh"] = "dvh", t["perc"] = "%"
            }(o || (o = {}));
            const l = {
                run: function (t, e, n) {
                    var o, l = this, c = t.Canvas, u = t.Utils, p = t.em, d = c.getCanvasView(),
                        f = p.config.stylePrefix || '', h = "".concat(f, "resizing"), v = n.onStart,
                        g = void 0 === v ? function () {
                        } : v, y = n.onMove, m = void 0 === y ? function () {
                        } : y, b = n.onEnd, _ = void 0 === b ? function () {
                        } : b, w = n.updateTarget, x = void 0 === w ? function () {
                        } : w, C = n.el, S = n.componentView, O = n.component, T = n.skipPositionUpdate,
                        P = s(n, ["onStart", "onMove", "onEnd", "updateTarget", "el", "componentView", "component", "skipPositionUpdate"]),
                        E = C || (null == S ? void 0 : S.el) || O.getEl(), k = {component: O, el: E},
                        A = function (t, e, n) {
                            var o = n.docs;
                            o && o.forEach((function (e) {
                                var n = e.body, o = n.className || '';
                                n.className = ('add' == t ? "".concat(o, " ").concat(h) : o.replace(h, '')).trim()
                            }))
                        }, j = a(a({
                            appendTo: c.getResizerEl(),
                            prefix: t.getConfig().stylePrefix,
                            posFetcher: d.getElementPos.bind(d),
                            mousePosFetcher: c.getMouseRelativePos.bind(c),
                            docs: [document],
                            onStart: function (e, s) {
                                var l;
                                g(e, s);
                                var c = s.el, u = s.config, d = s.resizer, f = u.keyHeight, h = u.keyWidth,
                                    v = u.currentUnit, y = u.keepAutoHeight, m = u.keepAutoWidth;
                                A('add', 0, s), o = p.Styles.getModelToStyle(O);
                                var b = getComputedStyle(c), _ = o.getStyle(), w = a({}, d.startDim), x = _[h];
                                u.autoWidth = m && 'auto' === x, isNaN(parseFloat(x)) && (x = b[h]);
                                var C = _[f];
                                u.autoHeight = y && 'auto' === C, isNaN(parseFloat(C)) && (C = b[f]);
                                var S = parseFloat(x), T = parseFloat(C), P = (0, i.getUnitFromValue)(x),
                                    E = (0, i.getUnitFromValue)(C);
                                v && (u.unitWidth = P, u.unitHeight = E);
                                var j = a(a({}, k), {
                                    event: e,
                                    rect: w,
                                    model: o,
                                    modelWidth: {value: x, property: h, number: S, unit: P},
                                    modelHeight: {value: C, property: f, number: T, unit: E}
                                });
                                t.trigger(r.I.resizeStart, j), t.trigger(r.I.resize, a(a({}, j), {type: 'start'})), null === (l = n.afterStart) || void 0 === l || l.call(n)
                            },
                            onMove: function (e, n) {
                                m(e, n);
                                var o = n.resizer,
                                    i = a(a({}, k), {event: e, delta: o.delta, pointer: o.currentPos, rect: o.rectDim});
                                t.trigger(r.I.resizeStart, i), t.trigger(r.I.resize, a(a({}, i), {type: 'move'}))
                            },
                            onEnd: function (e, o) {
                                var i;
                                _(e, o), A('remove', 0, o);
                                var s = o.resizer, l = a(a({}, k), {event: e, rect: s.rectDim, moved: s.moved});
                                t.trigger(r.I.resizeEnd, l), t.trigger(r.I.resize, a(a({}, k), {type: 'end'})), null === (i = n.afterEnd) || void 0 === i || i.call(n)
                            },
                            updateTarget: function (e, n, i) {
                                var s;
                                if (x(e, n, i), o) {
                                    var u = i.store, d = i.selectedHandler, f = i.config, h = i.resizer, v = i.event,
                                        g = f.keyHeight, y = f.keyWidth, m = f.autoHeight, b = f.autoWidth, _ = f.unitWidth,
                                        w = f.unitHeight, C = ['tc', 'bc'].indexOf(d) >= 0,
                                        S = ['cl', 'cr'].indexOf(d) >= 0, P = !u, A = {};
                                    if (!C) {
                                        var j = (null === (s = c.getBody()) || void 0 === s ? void 0 : s.offsetWidth) || 0,
                                            M = n.w < j ? n.w : j;
                                        A[y] = b ? 'auto' : l.convertPxToUnit({el: E, valuePx: M, unit: _})
                                    }
                                    S || (A[g] = m ? 'auto' : l.convertPxToUnit({
                                        el: E,
                                        valuePx: n.h,
                                        unit: w
                                    })), !T && p.getDragMode(O) && (A.top = "".concat(n.t, "px"), A.left = "".concat(n.l, "px"));
                                    var D = !1, L = function (t) {
                                        D = !0;
                                        var e = a(a({}, t || A), {__p: P});
                                        o.addStyle(e, {avoidStore: P}), p.Styles.__emitCmpStyleUpdate(e, {components: O})
                                    }, I = a(a({}, k), {
                                        rect: n,
                                        partial: P,
                                        event: v,
                                        style: A,
                                        updateStyle: L,
                                        convertPxToUnit: function (t) {
                                            return l.convertPxToUnit(a({el: E}, t))
                                        },
                                        delta: h.delta,
                                        pointer: h.currentPos
                                    });
                                    t.trigger(r.I.resizeUpdate, I), !D && L()
                                }
                            }
                        }, P), n.options), M = this.canvasResizer;
                    return M || (this.canvasResizer = new u.Resizer(j), M = this.canvasResizer), M.setOptions(j, !0), M.blur(), M.focus(E), M
                }, stop: function () {
                    var t;
                    null === (t = this.canvasResizer) || void 0 === t || t.blur()
                }, convertPxToUnit: function (t) {
                    var e, n = t.el, r = t.valuePx, i = t.unit, a = t.dpi, s = void 0 === a ? 96 : a,
                        l = t.roundDecimals, c = void 0 === l ? 3 : l, u = n.ownerDocument.defaultView,
                        p = (null == u ? void 0 : u.innerWidth) || 1, d = window.innerHeight || 1, f = r, h = i;
                    switch (i) {
                        case o.pt:
                            f = r * (72 / s);
                            break;
                        case o.pc:
                            f = r * (6 / s);
                            break;
                        case o.in:
                            f = r / s;
                            break;
                        case o.cm:
                            f = r / (s / 2.54);
                            break;
                        case o.mm:
                            f = r / (s / 25.4);
                            break;
                        case o.vw:
                            f = r / p * 100;
                            break;
                        case o.vh:
                            f = r / d * 100;
                            break;
                        case o.vmin:
                            f = r / Math.min(p, d) * 100;
                            break;
                        case o.vmax:
                            f = r / Math.max(p, d) * 100;
                            break;
                        case o.perc:
                            f = r / ((null === (e = n.parentElement) || void 0 === e ? void 0 : e.offsetWidth) || 1) * 100;
                            break;
                        case o.svw:
                        case o.lvw:
                        case o.dvw:
                            f = r / p * 100;
                            break;
                        case o.svh:
                        case o.lvh:
                        case o.dvh:
                            f = r / d * 100;
                            break;
                        default:
                            h = 'px'
                    }
                    return "".concat(+f.toFixed(c)).concat(h)
                }
            }
        }, 9317: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => S});
            var o, r = n(5706), i = n(179), a = n(9156), s = void 0 && (void 0).__extends || (o = function (t, e) {
                return o = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, o(t, e)
            }, function (t, e) {
                if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");

                function n() {
                    this.constructor = t
                }

                o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
            });
            const l = function (t) {
                function e() {
                    return null !== t && t.apply(this, arguments) || this
                }

                return s(e, t), e.prototype.defaults = function () {
                    return {command: '', attributes: {}}
                }, e
            }(a.Kx);
            var c = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), u = function (t) {
                function e() {
                    return null !== t && t.apply(this, arguments) || this
                }

                return c(e, t), e
            }(a.pM);
            const p = u;
            u.prototype.model = l;
            var d = n(2225), f = n(8242), h = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), v = void 0 && (void 0).__assign || function () {
                return v = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, v.apply(this, arguments)
            };
            const g = function (t) {
                function e(e) {
                    var n = t.call(this, e) || this;
                    return n.em = e.config.em, n
                }

                return h(e, t), e.prototype.events = function () {
                    return this.model.get('events') || {mousedown: 'handleClick'}
                }, e.prototype.attributes = function () {
                    return this.model.get('attributes')
                }, e.prototype.handleClick = function (t) {
                    t.preventDefault(), t.stopPropagation();
                    var e = this.em, n = e.Canvas.getFrameEl().getBoundingClientRect(), o = n.left, r = n.top,
                        i = v(v({}, t), {clientX: t.clientX - o, clientY: t.clientY - r});
                    e.trigger('toolbar:run:before', {event: i}), this.execCommand(i)
                }, e.prototype.execCommand = function (t) {
                    var e = this.em, n = {event: t}, o = this.model.get('command'), i = e.Editor;
                    (0, r.isFunction)(o) && o(i, null, n), (0, r.isString)(o) && i.runCommand(o, n)
                }, e.prototype.render = function () {
                    var t = this, e = t.em, n = t.$el, o = t.model, r = o.get('id'), i = o.get('label'),
                        a = e.getConfig().stylePrefix;
                    return n.addClass("".concat(a, "toolbar-item")), r && n.addClass("".concat(a, "toolbar-item__").concat(r)), i && n.append(i), this
                }, e
            }(a.Ss);
            var y = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), m = function (t) {
                function e(e) {
                    var n = t.call(this, e) || this, o = e.em;
                    return n.em = o, n.config = {em: o}, n.listenTo(n.collection, 'reset', n.render), n
                }

                return y(e, t), e.prototype.onRender = function () {
                    var t = this.em.config.stylePrefix;
                    this.el.className = "".concat(t, "toolbar-items")
                }, e
            }(f.A);
            const b = m;
            m.prototype.itemView = g;
            var _, w = n(6294), x = n(1166), C = void 0 && (void 0).__assign || function () {
                return C = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, C.apply(this, arguments)
            };
            const S = {
                activeResizer: !1, init: function () {
                    this.onSelect = (0, r.debounce)(this.onSelect, 0), (0, r.bindAll)(this, 'onHover', 'onOut', 'onClick', 'onCanvasScroll', 'onFrameScroll', 'onFrameResize', 'onFrameUpdated', 'onContainerChange')
                }, enable: function () {
                    this.frameOff = this.canvasOff = this.adjScroll = null, this.startSelectComponent(), _ = !0
                }, startSelectComponent: function () {
                    this.toggleSelectComponent(1), this.em.getSelected() && this.onSelect()
                }, stopSelectComponent: function () {
                    this.toggleSelectComponent()
                }, toggleSelectComponent: function (t) {
                    var e = this, n = this.em, o = this.canvas.getCanvasView().el, r = n.getConfig().listenToEl,
                        i = n.getContainer().parentNode, a = t ? 'on' : 'off', s = {on: w.on, off: w.AU},
                        l = d.I.update;
                    !r.length && i && r.push(i);
                    s[a](window, 'resize', this.onFrameUpdated), s[a](r, 'scroll', this.onContainerChange), n[a]("component:toggled ".concat(l, " undo redo"), this.onSelect, this), n[a]('change:componentHovered', this.onHovered, this), n[a]("".concat(d.I.resize, " styleable:change ").concat(d.I.input), this.updateGlobalPos, this), n[a]("".concat(l, ":toolbar"), this._upToolbar, this), n[a]('frame:updated', this.onFrameUpdated, this), n[a]('canvas:updateTools', this.onFrameUpdated, this), n[a](n.Canvas.events.refresh, this.updateAttached, this), n.Canvas.getFrames().forEach((function (t) {
                        var n = t.view, r = null == n ? void 0 : n.getWindow();
                        r && function (t, n, o) {
                            s[a](o, 'scroll', e.onCanvasScroll, !0), s[a](n, 'mouseover', e.onHover), s[a](n, 'mouseleave', e.onOut), s[a](n, 'click', e.onClick), s[a](t, 'scroll', e.onFrameScroll, !0), s[a](t, 'resize', e.onFrameResize)
                        }(r, null == n ? void 0 : n.getBody(), o)
                    }))
                }, onHover: function (t) {
                    t.stopPropagation();
                    var e = this.em, n = t.target, o = (0, x.getComponentView)(n), r = null == o ? void 0 : o.frameView,
                        i = null == o ? void 0 : o.model;
                    if (!i) for (var a = n.parentNode; !i && a && !(0, w.ZQ)(a);) i = (0, x.getComponentModel)(a), a = a.parentNode;
                    this.currentDoc = n.ownerDocument, e.setHovered(i, {useValid: !0}), r && e.setCurrentFrame(r)
                }, onFrameUpdated: function () {
                    this.updateLocalPos(), this.updateGlobalPos()
                }, onHovered: function (t, e) {
                    var n, o = this, r = {};
                    e ? null === (n = e.views) || void 0 === n || n.forEach((function (t) {
                        var n = t.el, i = o.getElementPos(n);
                        r = {
                            el: n,
                            pos: i,
                            component: e,
                            view: t
                        }, n.ownerDocument === o.currentDoc && (o.elHovered = r), o.updateToolsLocal(r)
                    })) : (this.currentDoc = null, this.elHovered = 0, this.updateToolsLocal(), this.canvas.getFrames().forEach((function (t) {
                        var e = t.view, n = e && e.getToolsEl();
                        n && o.toggleToolsEl(0, 0, {el: n})
                    })))
                }, onSelect: function () {
                    var t = this.em, e = t.getSelected(), n = t.getCurrentFrame(),
                        o = e && e.getView(null == n ? void 0 : n.model), r = null == o ? void 0 : o.el, i = {};
                    r && (0, w.zN)(r) && (i = {el: r, pos: this.getElementPos(r), component: e, view: o});
                    this.elSelected = i, this.updateToolsGlobal(), this.updateLocalPos(i), this.initResize(e)
                }, updateGlobalPos: function () {
                    var t = this.getElSelected();
                    t.el && (t.pos = this.getElementPos(t.el), this.updateToolsGlobal())
                }, updateLocalPos: function (t) {
                    var e = this.getElHovered();
                    e.el && (e.pos = this.getElementPos(e.el), this.updateToolsLocal(t))
                }, getElHovered: function () {
                    return this.elHovered || {}
                }, getElSelected: function () {
                    return this.elSelected || {}
                }, onOut: function () {
                    this.em.setHovered()
                }, toggleToolsEl: function (t, e, n) {
                    void 0 === n && (n = {});
                    var o = n.el || this.canvas.getToolsEl(e);
                    return o && (o.style.display = t ? '' : 'none'), o || {}
                }, showElementOffset: function (t, e, n) {
                    void 0 === n && (n = {}), _ && this.editor.runCommand('show-offset', {
                        el: t,
                        elPos: e,
                        view: n.view,
                        force: 1,
                        top: 0,
                        left: 0
                    })
                }, hideElementOffset: function (t) {
                    this.editor.stopCommand('show-offset', {view: t})
                }, showFixedElementOffset: function (t, e) {
                    this.editor.runCommand('show-offset', {el: t, elPos: e, state: 'Fixed'})
                }, hideFixedElementOffset: function () {
                    this.editor && this.editor.stopCommand('show-offset', {state: 'Fixed'})
                }, hideHighlighter: function (t) {
                    this.canvas.getHighlighter(t).style.opacity = 0
                }, onClick: function (t) {
                    t.stopPropagation(), t.preventDefault();
                    var e = this.em;
                    if (e.get('_cmpDrag')) return e.set('_cmpDrag');
                    var n = t.target, o = (0, x.getComponentModel)(n);
                    if (!o) for (var r = n.parentNode; !o && r && !(0, w.ZQ)(r);) o = (0, x.getComponentModel)(r), r = r.parentNode;
                    if (o) {
                        if (e.isEditing() && (!o.get('textable') && o.isChildOf('text') || e.getEditing() !== o)) return;
                        this.select(o, t)
                    }
                }, select: function (t, e) {
                    if (t) {
                        var n = this.em;
                        n.setSelected(t, {event: e, useValid: !0}), this.initResize(n.getSelected())
                    }
                }, updateBadge: function (t, e, n) {
                    void 0 === n && (n = {});
                    var o = this.canvas, r = (0, x.getComponentModel)(t), i = this.getBadge(n), a = i.style;
                    if (r && r.get('badgable')) {
                        if (!n.posOnly) {
                            var s = this.canvas.getConfig(), l = r.getIcon(), c = s.pStylePrefix || '',
                                u = "".concat(c, "badge"), p = s.customBadgeLabel,
                                d = "".concat(l ? "<div class=\"".concat(u, "__icon\">").concat(l, "</div>") : '', "\n        <div class=\"").concat(u, "__name\">").concat(r.getName(), "</div>");
                            i.innerHTML = p ? p(r) : d
                        }
                        var f = 'px';
                        a.display = 'block';
                        var h = o.getTargetToElementFixed(t, i, {pos: e}).top, v = n.leftOff < 0 ? -n.leftOff : 0;
                        a.top = h + f, a.left = v + f
                    } else a.display = 'none'
                }, showHighlighter: function (t) {
                    this.canvas.getHighlighter(t).style.opacity = ''
                }, initResize: function (t) {
                    var e, n = this, o = this.em, a = this.canvas, s = o.Editor,
                        l = !(0, r.isElement)(t) && (0, w.GW)(t) ? t : o.getSelected(),
                        c = null === (e = null == l ? void 0 : l.get) || void 0 === e ? void 0 : e.call(l, 'resizable'),
                        u = i.F.Resize, p = a.hasCustomSpot(u);
                    a.removeSpots({type: u});
                    var f = {component: l, hasCustomResize: p, resizable: c};
                    l && o.trigger(d.I.resizeInit, f);
                    var h = f.resizable;
                    if (l && h) {
                        a.addSpot({type: u, component: l});
                        var v = (0, r.isElement)(t) ? t : l.getEl(), g = (0, x.isObject)(h) ? h : {};
                        if (p || !v || this.activeResizer) return;
                        this.resizer = s.runCommand('resize', C(C({}, g), {
                            el: v,
                            component: l,
                            force: !0,
                            afterStart: function () {
                                _ = !1, n.activeResizer = !0
                            },
                            afterEnd: function () {
                                _ = !0, n.activeResizer = !1
                            }
                        }))
                    } else {
                        if (p) return;
                        s.stopCommand('resize'), this.resizer = null
                    }
                }, updateToolbar: function (t) {
                    var e = this.canvas, n = this.config.em, o = t === n ? n.getSelected() : t, r = e.getToolbarEl(),
                        a = r.style, s = o.get('toolbar'), l = n.config.showToolbar, c = !e.hasCustomSpot(i.F.Select);
                    if (o && l && s && s.length && c) {
                        if (a.display = '', !this.toolbar) {
                            r.innerHTML = '', this.toolbar = new p(s);
                            var u = new b({collection: this.toolbar, em: n});
                            r.appendChild(u.render().el)
                        }
                        this.toolbar.reset(s), a.top = '-100px', a.left = '0'
                    } else a.display = 'none'
                }, updateToolbarPos: function (t) {
                    var e = 'px', n = this.canvas.getToolbarEl().style;
                    n.top = "".concat(t.top).concat(e), n.left = "".concat(t.left).concat(e), n.opacity = ''
                }, getCanvasPosition: function () {
                    return this.canvas.getCanvasView().getPosition()
                }, getBadge: function (t) {
                    return void 0 === t && (t = {}), this.canvas.getBadgeEl(t.view)
                }, onCanvasScroll: function (t) {
                    this.onFrameScroll(t), this.onContainerChange()
                }, onFrameScroll: function () {
                    this.updateTools(), this.canvas.refreshSpots()
                }, onFrameResize: function () {
                    this.canvas.refresh({all: !0})
                }, updateTools: function () {
                    this.updateLocalPos(), this.updateGlobalPos()
                }, isCompSelected: function (t) {
                    return t && 'selected' === t.get('status')
                }, updateToolsLocal: function (t) {
                    var e = this.em.getConfig(), n = t || this.getElHovered(), o = n.el, r = n.pos, a = n.view,
                        s = n.component;
                    if (o) {
                        var l = s.get('hoverable'), c = this.lastHovered !== o, u = c ? {} : {posOnly: 1},
                            p = this.canvas.hasCustomSpot(i.F.Hover);
                        c && l && (this.lastHovered = o, p ? this.hideHighlighter(a) : this.showHighlighter(a), this.showElementOffset(o, r, {view: a})), this.isCompSelected(s) && (this.hideHighlighter(a), !e.showOffsetsSelected && this.hideElementOffset(a));
                        var d = 'px', f = this.toggleToolsEl(1, a), h = f.style, v = this.canvas.canvasRectOffset(o, r),
                            g = v.top, y = v.left;
                        !p && this.updateBadge(o, r, C(C({}, u), {
                            view: a,
                            topOff: g,
                            leftOff: y
                        })), h.top = g + d, h.left = y + d, h.width = r.width + d, h.height = r.height + d, this._trgToolUp('local', {
                            component: s,
                            el: f,
                            top: g,
                            left: y,
                            width: r.width,
                            height: r.height
                        })
                    } else this.lastHovered = 0
                }, _upToolbar: (0, r.debounce)((function () {
                    this.updateToolsGlobal({force: 1})
                }), 0), _trgToolUp: function (t, e) {
                    void 0 === e && (e = {}), this.em.trigger('canvas:tools:update', C({type: t}, e))
                }, updateToolsGlobal: function (t) {
                    void 0 === t && (t = {});
                    var e = this.getElSelected(), n = e.el, o = e.pos, r = e.component;
                    if (!n) return this.toggleToolsEl(), void (this.lastSelected = 0);
                    var i = this.canvas;
                    (this.lastSelected !== n || t.force) && (this.lastSelected = n, this.updateToolbar(r));
                    var a = 'px', s = this.toggleToolsEl(1), l = s.style,
                        c = i.getTargetToElementFixed(n, i.getToolbarEl(), {pos: o}), u = c.canvasOffsetTop,
                        p = c.canvasOffsetLeft;
                    l.top = u + a, l.left = p + a, l.width = o.width + a, l.height = o.height + a, this.updateToolbarPos({
                        top: c.top,
                        left: c.left
                    }), this._trgToolUp('global', {
                        component: r,
                        el: s,
                        top: u,
                        left: p,
                        width: o.width,
                        height: o.height
                    })
                }, updateAttached: (0, r.debounce)((function () {
                    this.updateGlobalPos()
                }), 0), onContainerChange: (0, r.debounce)((function () {
                    this.em.refreshCanvas()
                }), 150), getElementPos: function (t) {
                    return this.canvas.getCanvasView().getElementPos(t, {noScroll: !0})
                }, hideBadge: function () {
                    this.getBadge().style.display = 'none'
                }, cleanPrevious: function (t) {
                    t && t.set({status: '', state: ''})
                }, getContentWindow: function () {
                    return this.canvas.getWindow()
                }, run: function (t) {
                    (0, x.hasWin)() && (this.editor = t && t.get('Editor'), this.enable())
                }, stop: function (t, e, n) {
                    if (void 0 === n && (n = {}), (0, x.hasWin)()) {
                        var o = this.em, r = this.editor;
                        this.onHovered(), this.stopSelectComponent(), !n.preserveSelected && o.setSelected(), this.toggleToolsEl(), this.updateAttached.cancel(), r && r.stopCommand('resize')
                    }
                }
            }
        }, 1406: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => a});
            var o = n(7774), r = n(1447), i = n(8433);
            const a = {
                startSelectPosition: function (t, e, n) {
                    void 0 === n && (n = {}), this.isPointed = !1;
                    var o = this.em.Utils, a = t[0].ownerDocument.body;
                    o && (this.sorter = new o.ComponentSorter({
                        em: this.em,
                        treeClass: r.A,
                        containerContext: {
                            container: a,
                            containerSel: '*',
                            itemSel: '*',
                            pfx: this.ppfx,
                            document: e,
                            placeholderElement: this.canvas.getPlacerEl()
                        },
                        positionOptions: {windowMargin: 1, canvasRelative: !0},
                        dragBehavior: {dragDirection: i.A.BothDirections, nested: !0}
                    })), n.onStart && (this.sorter.eventHandlers.legacyOnStartSort = n.onStart), t && t.length > 0 && this.sorter.startSort(t.map((function (t) {
                        return {element: t}
                    })))
                }, getOffsetDim: function () {
                    var t = this.offset(this.canvas.getFrameEl()), e = this.offset(this.canvas.getElement());
                    return {top: t.top - e.top, left: t.left - e.left}
                }, stopSelectPosition: function () {
                    this.posTargetCollection = null, this.posIndex = 'after' == this.posMethod && 0 !== this.cDim.length ? this.posIndex + 1 : this.posIndex, this.sorter && this.sorter.cancelDrag(), this.cDim && (this.posIsLastEl = 0 !== this.cDim.length && 'after' == this.posMethod && this.posIndex == this.cDim.length, this.posTargetEl = 0 === this.cDim.length ? (0, o["default"])(this.outsideElem) : !this.posIsLastEl && this.cDim[this.posIndex] ? (0, o["default"])(this.cDim[this.posIndex][5]).parent() : (0, o["default"])(this.outsideElem), this.posTargetModel = this.posTargetEl.data('model'), this.posTargetCollection = this.posTargetEl.data('model-comp'))
                }, enable: function () {
                    this.startSelectPosition()
                }, nearFloat: function (t, e, n) {
                    var o = t || 0, r = e || 'before', i = n.length, a = 0 !== i && 'after' == r && o == i;
                    return 0 !== i && (!a && !n[o][4] || n[o - 1] && !n[o - 1][4] || a && !n[o - 1][4]) ? 1 : 0
                }, run: function () {
                    this.enable()
                }, stop: function () {
                    this.stopSelectPosition(), this.$wrapper.css('cursor', ''), this.$wrapper.unbind()
                }
            }
        }, 9395: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => s});
            var o = n(5706), r = n(179), i = n(7774), a = void 0 && (void 0).__assign || function () {
                return a = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, a.apply(this, arguments)
            };
            const s = {
                getOffsetMethod: function (t) {
                    return 'get' + (t || '') + 'OffsetViewerEl'
                }, run: function (t, e, n) {
                    var s = this.canvas, l = n || {}, c = l.state || '', u = t.getConfig(),
                        p = this.em.getZoomDecimal(), d = l.el;
                    if (u.showOffsets && d instanceof HTMLElement && (u.showOffsetsSelected || 'Fixed' != c)) {
                        if (!s.hasCustomSpot(r.F.Spacing)) {
                            var f = a({}, l.elPos || s.getElementPos(d));
                            (0, o.isUndefined)(l.top) || (f.top = l.top), (0, o.isUndefined)(l.left) || (f.left = l.left);
                            var h = window.getComputedStyle(d), v = this.ppfx, g = c + 'State',
                                y = s[this.getOffsetMethod(c)](n.view);
                            y.style.opacity = '';
                            var m = this['marginT' + c], b = this['marginB' + c], _ = this['marginL' + c],
                                w = this['marginR' + c], x = this['padT' + c], C = this['padB' + c],
                                S = this['padL' + c], O = this['padR' + c];
                            if (y.childNodes.length && (this[g] = '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[g]) {
                                var T = c.toLowerCase(), P = T + 'margin-v', E = T + 'padding-v',
                                    k = (0, i["default"])("<div class=\"".concat(v, "marginName\">")).get(0),
                                    A = (0, i["default"])("<div class=\"".concat(v, "paddingName\">")).get(0),
                                    j = v + E + '-el', M = "".concat(v + P + '-el', " ").concat(v + P),
                                    D = "".concat(j, " ").concat(v + E);
                                m = (0, i["default"])("<div class=\"".concat(M, "-top\"></div>")).get(0), b = (0, i["default"])("<div class=\"".concat(M, "-bottom\"></div>")).get(0), _ = (0, i["default"])("<div class=\"".concat(M, "-left\"></div>")).get(0), w = (0, i["default"])("<div class=\"".concat(M, "-right\"></div>")).get(0), x = (0, i["default"])("<div class=\"".concat(D, "-top\"></div>")).get(0), C = (0, i["default"])("<div class=\"".concat(D, "-bottom\"></div>")).get(0), S = (0, i["default"])("<div class=\"".concat(D, "-left\"></div>")).get(0), O = (0, i["default"])("<div class=\"".concat(D, "-right\"></div>")).get(0), this['marginT' + c] = m, this['marginB' + c] = b, this['marginL' + c] = _, this['marginR' + c] = w, this['padT' + c] = x, this['padB' + c] = C, this['padL' + c] = S, this['padR' + c] = O, k.appendChild(m), k.appendChild(b), k.appendChild(_), k.appendChild(w), A.appendChild(x), A.appendChild(C), A.appendChild(S), A.appendChild(O), y.appendChild(k), y.appendChild(A), this[g] = '1'
                            }
                            var L = 'px', I = parseFloat(h.marginLeft.replace(L, '')) * p,
                                N = parseFloat(h.marginRight.replace(L, '')) * p,
                                R = parseFloat(h.marginTop.replace(L, '')) * p,
                                V = parseFloat(h.marginBottom.replace(L, '')) * p, F = m.style, H = b.style,
                                U = _.style, z = w.style, B = x.style, W = C.style, $ = S.style, q = O.style,
                                G = parseFloat(f.left), K = parseFloat(h.width) * p + L;
                            F.height = R + L, F.width = K, F.top = f.top - R + L, F.left = G + L, H.height = V + L, H.width = K, H.top = f.top + f.height + L, H.left = G + L;
                            var Y = f.height + R + V + L, X = f.top - R + L;
                            U.height = Y, U.width = I + L, U.top = X, U.left = G - I + L, z.height = Y, z.width = N + L, z.top = X, z.left = G + f.width + L;
                            var J = parseFloat(h.paddingTop) * p;
                            B.height = J + L;
                            var Z = parseFloat(h.paddingBottom) * p;
                            W.height = Z + L;
                            var Q = f.height - Z - J + L, tt = f.top + J + L;
                            $.height = Q, $.width = parseFloat(h.paddingLeft) * p + L, $.top = tt;
                            var et = parseFloat(h.paddingRight) * p;
                            q.height = Q, q.width = et + L, q.top = tt
                        }
                    } else t.stopCommand("".concat(this.id), n)
                }, stop: function (t, e, n) {
                    void 0 === n && (n = {});
                    var o = (n || {}).state || '', r = this.getOffsetMethod(o), i = n.view;
                    this.canvas[r](i).style.opacity = 0
                }
            }
        }, 7285: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => i});
            var o = n(5706), r = n(1166);
            const i = {
                init: function () {
                    (0, o.bindAll)(this, '_onFramesChange')
                }, run: function (t) {
                    this.toggleVis(t, !0)
                }, stop: function (t) {
                    this.toggleVis(t, !1)
                }, toggleVis: function (t, e) {
                    if (void 0 === e && (e = !0), !t.Commands.isActive('preview')) {
                        var n = t.Canvas, o = e ? 'on' : 'off';
                        n.getModel()[o]('change:frames', this._onFramesChange), this.handleFrames(n.getFrames(), e)
                    }
                }, handleFrames: function (t, e) {
                    var n = this;
                    t.forEach((function (t) {
                        var o;
                        (null === (o = t.view) || void 0 === o ? void 0 : o.loaded) && n._upFrame(t, e), t.__ol || (t.on('loaded', (function () {
                            return n._upFrame(t)
                        })), t.__ol = !0)
                    }))
                }, _onFramesChange: function (t, e) {
                    this.handleFrames(e)
                }, _upFrame: function (t, e) {
                    var n, o = this, i = o.ppfx, a = o.em, s = o.id,
                        l = ((0, r.isDef)(e) ? e : a.Commands.isActive(s)) ? 'add' : 'remove',
                        c = "".concat(i, "dashed");
                    null === (n = t.view) || void 0 === n || n.getBody().classList[l](c)
                }
            }
        }, 9156: (t, e, n) => {
            "use strict";
            n.d(e, {Kx: () => u, Ss: () => d, e2: () => c, lK: () => f, pM: () => p, x2: () => r});
            var o, r, i = n(4193), a = n.n(i), s = void 0 && (void 0).__extends || (o = function (t, e) {
                return o = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, o(t, e)
            }, function (t, e) {
                if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");

                function n() {
                    this.constructor = t
                }

                o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
            }), l = void 0 && (void 0).__assign || function () {
                return l = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, l.apply(this, arguments)
            }, c = 'add remove reset change', u = function (t) {
                function e() {
                    return null !== t && t.apply(this, arguments) || this
                }

                return s(e, t), e
            }(a().Model), p = function (t) {
                function e() {
                    return null !== t && t.apply(this, arguments) || this
                }

                return s(e, t), e
            }(a().Collection), d = function (t) {
                function e() {
                    return null !== t && t.apply(this, arguments) || this
                }

                return s(e, t), e
            }(a().View);
            !function (t) {
                t["Screen"] = "screen", t["World"] = "world"
            }(r || (r = {}));
            var f = {x: 0, y: 0};
            l(l({}, f), {width: 0, height: 0})
        }, 2225: (t, e, n) => {
            "use strict";
            var o, r;
            n.d(e, {I: () => r, t: () => o}), function (t) {
                t["remove"] = "component:remove", t["add"] = "component:add", t["move"] = "component:move"
            }(o || (o = {})), function (t) {
                t["add"] = "component:add", t["remove"] = "component:remove", t["removeBefore"] = "component:remove:before", t["removed"] = "component:removed", t["create"] = "component:create", t["update"] = "component:update", t["updateInside"] = "component:update-inside", t["styleUpdate"] = "component:styleUpdate", t["styleUpdateProperty"] = "component:styleUpdate:", t["select"] = "component:select", t["selectBefore"] = "component:select:before", t["mount"] = "component:mount", t["scriptMount"] = "component:script:mount", t["scriptMountBefore"] = "component:script:mount:before", t["scriptUnmount"] = "component:script:unmount", t["render"] = "component:render", t["input"] = "component:input", t["resize"] = "component:resize", t["resizeStart"] = "component:resize:start", t["resizeMove"] = "component:resize:move", t["resizeEnd"] = "component:resize:end", t["resizeUpdate"] = "component:resize:update", t["resizeInit"] = "component:resize:init", t["symbolMainAdd"] = "symbol:main:add", t["symbolMainUpdate"] = "symbol:main:update", t["symbolMainUpdateDeep"] = "symbol:main:update-deep", t["symbolMainRemove"] = "symbol:main:remove", t["symbolMain"] = "symbol:main", t["symbolInstanceAdd"] = "symbol:instance:add", t["symbolInstanceRemove"] = "symbol:instance:remove", t["symbolInstance"] = "symbol:instance", t["symbol"] = "symbol"
            }(r || (r = {}))
        }, 8242: (t, e, n) => {
            "use strict";
            n.d(e, {A: () => l});
            var o, r = n(5706), i = n(9156), a = void 0 && (void 0).__extends || (o = function (t, e) {
                return o = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, o(t, e)
            }, function (t, e) {
                if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");

                function n() {
                    this.constructor = t
                }

                o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
            }), s = function (t) {
                function e(e, n, o) {
                    void 0 === e && (e = {}), void 0 === o && (o = !1);
                    var r = t.call(this, e) || this;
                    return r.itemsView = '', r.itemType = 'type', r.reuseView = !1, r.config = n || e.config || {}, o && r.listenTo(r.collection, 'add', r.addTo), r.items = [], r
                }

                return a(e, t), e.prototype.addTo = function (t) {
                    this.add(t)
                }, e.prototype.itemViewNotFound = function (t) {
                    var e = this.config, n = this.ns, o = e.em,
                        r = "".concat(n ? "[".concat(n, "]: ") : '', "'").concat(t, "' type not found");
                    o && o.logWarning(r)
                }, e.prototype.add = function (t, e) {
                    var n, o = this, i = o.config, a = o.reuseView, s = o.items, l = this.itemsView || {},
                        c = e || null, u = this.itemView, p = t.get(this.itemType);
                    l[p] ? u = l[p] : !p || l[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), n = t.view && a ? t.view : new u({
                        model: t,
                        config: i
                    }, i), s && s.push(n);
                    var d = n.render().el;
                    c ? c.appendChild(d) : this.$el.append(d)
                }, e.prototype.render = function () {
                    var t = document.createDocumentFragment();
                    return this.clearItems(), this.$el.empty(), this.collection.length && this.collection.each((function (e) {
                        this.add(e, t)
                    }), this), this.$el.append(t), this.onRender(), this
                }, e.prototype.onRender = function () {
                }, e.prototype.onRemoveBefore = function (t, e) {
                }, e.prototype.onRemove = function (t, e) {
                }, e.prototype.remove = function (e) {
                    void 0 === e && (e = {});
                    var n = this.items;
                    return this.onRemoveBefore(n, e), this.clearItems(), t.prototype.remove.call(this), this.onRemove(n, e), this
                }, e.prototype.clearItems = function () {
                    this.items
                }, e
            }(i.Ss);
            const l = s;
            s.prototype.itemView = ''
        }, 9966: (t, e, n) => {
            "use strict";
            n.d(e, {A: () => s});
            var o = n(5706), r = n(6294), i = void 0 && (void 0).__assign || function () {
                return i = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, i.apply(this, arguments)
            }, a = ['x', 'y'];
            const s = function () {
                function t(t) {
                    return void 0 === t && (t = {}), this.opts = {
                        snapGuides: {x: 5, y: 5},
                        snapOffset: 5,
                        scale: 1
                    }, (0, o.bindAll)(this, 'drag', 'stop', 'keyHandle', 'handleScroll'), this.setOptions(t), 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 t.prototype.setOptions = function (t) {
                    void 0 === t && (t = {}), this.opts = i(i({}, this.opts), t)
                }, t.prototype.toggleDrag = function (t) {
                    var e = this.getDocumentEl(), n = this.getContainerEl(), o = this.getWindowEl(),
                        i = t ? 'on' : 'off', a = {on: r.on, off: r.AU};
                    a[i](n, 'mousemove dragover', this.drag), a[i](e, 'mouseup dragend touchend', this.stop), a[i](e, 'keydown', this.keyHandle), a[i](o, 'scroll', this.handleScroll)
                }, t.prototype.handleScroll = function () {
                    var t = this.lastScroll, e = this.delta, n = this.getScrollInfo(), o = {x: n.x - t.x, y: n.y - t.y};
                    this.move(e.x + o.x, e.y + o.y), this.lastScrollDiff = o
                }, t.prototype.start = function (t) {
                    var e = this.opts, n = e.onStart;
                    this.toggleDrag(!0), this.startPointer = this.getPointerPos(t), this.guidesStatic = (0, o.result)(e, 'guidesStatic') || [], this.guidesTarget = (0, o.result)(e, 'guidesTarget') || [], (0, o.isFunction)(n) && n(t, this), this.startPosition = this.getStartPosition(), this.lastScrollDiff = {
                        x: 0,
                        y: 0
                    }, this.globScrollDiff = {x: 0, y: 0}, this.drag(t)
                }, t.prototype.drag = function (t) {
                    var e = this, n = this, r = n.opts, s = n.lastScrollDiff, l = n.globScrollDiff, c = r.onDrag,
                        u = this.startPointer, p = this.getPointerPos(t), d = {x: l.x + s.x, y: l.y + s.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 = function (n) {
                        a.forEach((function (t) {
                            return n[t] = n[t] * (0, o.result)(r, 'scale')
                        })), e.delta = n, e.move(n.x, n.y), (0, o.isFunction)(c) && c(t, e)
                    }, v = i({}, f);
                    if (this.currentPointer = p, this.lastScroll = this.getScrollInfo(), h(f), this.guidesTarget.length) {
                        var g = this.snapGuides(v), y = g.newDelta, m = g.trgX, b = g.trgY;
                        (m || b) && h(y)
                    }
                    0 === t.which && this.stop(t)
                }, t.prototype.snapGuides = function (t) {
                    var e = this, n = i({}, t), r = this.trgX, s = this.trgY;
                    return this.guidesTarget.forEach((function (n) {
                        n.x && e.trgX || n.y && e.trgY || (n.active = !1, e.guidesStatic.forEach((function (i) {
                            if (!(n.y && i.x || n.x && i.y)) {
                                var a = n.y && i.y, l = a ? 'y' : 'x', c = n[l], u = i[l], p = t[l], d = a ? s : r;
                                if (e.isPointIn(c, u, {axis: l}) && (0, o.isUndefined)(d)) {
                                    var f = p - (c - u);
                                    e.setGuideLock(n, f)
                                }
                            }
                        })))
                    })), r = this.trgX, s = this.trgY, a.forEach((function (r) {
                        var i = r.toUpperCase(), a = e["trg".concat(i)];
                        a && !e.isPointIn(t[r], a.lock, {axis: r}) && (e.setGuideLock(a, null), a = null), a && !(0, o.isUndefined)(a.lock) && (n[r] = a.lock)
                    })), {newDelta: n, trgX: this.trgX, trgY: this.trgY}
                }, t.prototype.isPointIn = function (t, e, n) {
                    var o, r = void 0 === n ? {} : n, i = r.offset, a = r.axis, s = this.opts, l = s.snapGuides,
                        c = void 0 === l ? {} : l, u = s.snapOffset, p = void 0 === u ? 0 : u,
                        d = 'x' === a ? c.x : 'y' === a ? c.y : void 0,
                        f = 0 === d ? 0 : null !== (o = null != i ? i : d) && void 0 !== o ? o : p;
                    return 0 !== f && (t >= e && t <= e + f || t <= e && t >= e - f)
                }, t.prototype.setGuideLock = function (t, e) {
                    var n = (0, o.isUndefined)(t.x) ? 'Y' : 'X', r = "trg".concat(n);
                    return null !== e ? (t.active = !0, t.lock = e, this[r] = t) : (delete t.active, delete t.lock, delete this[r]), t
                }, t.prototype.stop = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.delta, r = !!e.cancel, i = r ? 0 : n.x, a = r ? 0 : n.y;
                    this.toggleDrag(), this.move(i, a, !0);
                    var s = this.opts.onEnd;
                    (0, o.isFunction)(s) && s(t, this, {cancelled: r})
                }, t.prototype.keyHandle = function (t) {
                    (0, r.v$)(t) && this.stop(t, {cancel: !0})
                }, t.prototype.move = function (t, e, n) {
                    var r = this.el, i = this.opts, a = this.startPosition;
                    if (a) {
                        var s = i.setPosition, l = a.x + t, c = a.y + e;
                        this.position = {
                            x: l,
                            y: c,
                            end: n
                        }, (0, o.isFunction)(s) && s(this.position), r && (r.style.left = "".concat(l, "px"), r.style.top = "".concat(c, "px"))
                    }
                }, t.prototype.getContainerEl = function () {
                    var t = this.opts.container;
                    return t ? [t] : this.getDocumentEl()
                }, t.prototype.getWindowEl = function () {
                    return this.getContainerEl().map((function (t) {
                        var e = t.ownerDocument || t;
                        return e.defaultView || e.parentWindow
                    }))
                }, t.prototype.getDocumentEl = function (t) {
                    var e = this.opts.doc;
                    if (t = t || this.el, !this.docs.length) {
                        var n = [document];
                        t && n.push(t.ownerDocument), e && n.push(e), this.docs = n
                    }
                    return this.docs
                }, t.prototype.getPointerPos = function (t) {
                    var e = this.opts.getPointerPosition, n = (0, r.G2)(t);
                    return e ? e(t) : {x: n.clientX, y: n.clientY}
                }, t.prototype.getStartPosition = function () {
                    var t = this.el, e = this.opts.getPosition, n = {x: 0, y: 0};
                    return (0, o.isFunction)(e) ? n = e() : t && (n = {
                        x: parseFloat(t.style.left),
                        y: parseFloat(t.style.top)
                    }), n
                }, t.prototype.getScrollInfo = function () {
                    var t = this.opts.doc, e = t && t.body;
                    return {y: e ? e.scrollTop : 0, x: e ? e.scrollLeft : 0}
                }, t.prototype.detectAxisLock = function (t, e) {
                    var n = t, o = e, r = Math.abs(n), i = Math.abs(o);
                    return o >= r || o <= -r ? 'x' : n > i || n < -i ? 'y' : void 0
                }, t
            }()
        }, 7774: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {default: () => gt});
            var o = 'undefined' != typeof document ? document : null, r = 'undefined' != typeof window ? window : null,
                i = Array.prototype, a = i.filter, s = i.indexOf, l = i.map, c = i.push, u = i.reverse, p = i.slice,
                d = i.splice, f = /^#[\w-]*$/, h = /^\.[\w-]*$/, v = /<.+>/, g = /^\w+$/;

            function y(t, e) {
                return void 0 === e && (e = o), h.test(t) ? e.getElementsByClassName(t.slice(1)) : g.test(t) ? e.getElementsByTagName(t) : e.querySelectorAll(t)
            }

            function m(t, e) {
                if (void 0 === e && (e = o), t) {
                    if (t.__cash) return t;
                    var n = t;
                    if (E(t)) {
                        if (e.__cash && (e = e[0]), !(n = f.test(t) ? e.getElementById(t.slice(1)) : v.test(t) ? ft(t) : y(t, e))) return
                    } else if (P(t)) return this.ready(t);
                    (n.nodeType || n === r) && (n = [n]), this.length = n.length;
                    for (var i = 0, a = this.length; i < a; i++) this[i] = n[i]
                }
            }

            function b(t, e) {
                return new m(t, e)
            }

            var _ = b.fn = b.prototype = m.prototype = {constructor: b, __cash: !0, length: 0, splice: d};
            _.get = function (t) {
                return void 0 === t ? p.call(this) : this[t < 0 ? t + this.length : t]
            }, _.eq = function (t) {
                return b(this.get(t))
            }, _.first = function () {
                return this.eq(0)
            }, _.last = function () {
                return this.eq(-1)
            }, _.map = function (t) {
                return b(l.call(this, (function (e, n) {
                    return t.call(e, n, e)
                })))
            }, _.slice = function () {
                return b(p.apply(this, arguments))
            };
            var w = /(?:^\w|[A-Z]|\b\w)/g, x = /[\s-_]+/g;

            function C(t) {
                return t.replace(w, (function (t, e) {
                    return t[e ? 'toUpperCase' : 'toLowerCase']()
                })).replace(x, '')
            }

            function S(t, e) {
                for (var n = 0, o = t.length; n < o && !1 !== e.call(t[n], t[n], n, t); n++) ;
            }

            b.camelCase = C, b.each = S, _.each = function (t) {
                return S(this, (function (e, n) {
                    return t.call(e, n, e)
                })), this
            }, _.removeProp = function (t) {
                return this.each((function (e, n) {
                    delete n[t]
                }))
            }, b.extend = _.extend = function (t) {
                void 0 === t && (t = this);
                for (var e = arguments, n = e.length, o = n < 2 ? 0 : 1; o < n; o++) for (var r in e[o]) t[r] = e[o][r];
                return t
            };
            var O = 1;

            function T(t, e) {
                var n = t && (t.matches || t.webkitMatchesSelector || t.mozMatchesSelector || t.msMatchesSelector || t.oMatchesSelector);
                return !!n && n.call(t, e)
            }

            function P(t) {
                return 'function' == typeof t
            }

            function E(t) {
                return 'string' == typeof t
            }

            function k(t) {
                return !isNaN(parseFloat(t)) && isFinite(t)
            }

            b.guid = O, b.matches = T, b.isFunction = P, b.isString = E, b.isNumeric = k;
            var A = Array.isArray;

            function j(t) {
                return E(t) ? function (e, n) {
                    return T(n, t)
                } : t.__cash ? function (e, n) {
                    return t.is(n)
                } : function (t, e, n) {
                    return e === n
                }
            }

            b.isArray = A, _.prop = function (t, e) {
                if (t) {
                    if (E(t)) return arguments.length < 2 ? this[0] && this[0][t] : this.each((function (n, o) {
                        o[t] = e
                    }));
                    for (var n in t) this.prop(n, t[n]);
                    return this
                }
            }, _.filter = function (t) {
                if (!t) return b();
                var e = P(t) ? t : j(t);
                return b(a.call(this, (function (n, o) {
                    return e.call(n, o, n, t)
                })))
            };
            var M = /\S+/g;

            function D(t) {
                return E(t) && t.match(M) || []
            }

            function L(t) {
                return t.filter((function (t, e, n) {
                    return n.indexOf(t) === e
                }))
            }

            function I(t, e, n) {
                if (1 === t.nodeType) {
                    var o = r.getComputedStyle(t, null);
                    return e ? n ? o.getPropertyValue(e) : o[e] : o
                }
            }

            function N(t, e) {
                return parseInt(I(t, e), 10) || 0
            }

            _.hasClass = function (t) {
                var e = D(t), n = !1;
                return e.length && this.each((function (t, o) {
                    return !(n = o.classList.contains(e[0]))
                })), n
            }, _.removeAttr = function (t) {
                var e = D(t);
                return e.length ? this.each((function (t, n) {
                    S(e, (function (t) {
                        n.removeAttribute(t)
                    }))
                })) : this
            }, _.attr = function (t, e) {
                if (t) {
                    if (E(t)) {
                        if (arguments.length < 2) {
                            if (!this[0]) return;
                            var n = this[0].getAttribute(t);
                            return null === n ? void 0 : n
                        }
                        return null === e ? this.removeAttr(t) : this.each((function (n, o) {
                            o.setAttribute(t, e)
                        }))
                    }
                    for (var o in t) this.attr(o, t[o]);
                    return this
                }
            }, _.toggleClass = function (t, e) {
                var n = D(t), o = void 0 !== e;
                return n.length ? this.each((function (t, r) {
                    S(n, (function (t) {
                        o ? e ? r.classList.add(t) : r.classList.remove(t) : r.classList.toggle(t)
                    }))
                })) : this
            }, _.addClass = function (t) {
                return this.toggleClass(t, !0)
            }, _.removeClass = function (t) {
                return arguments.length ? this.toggleClass(t, !1) : this.attr('class', '')
            }, b.unique = L, _.add = function (t, e) {
                return b(L(this.get().concat(b(t, e).get())))
            };
            var R = /^--/;

            function V(t) {
                return R.test(t)
            }

            var F = {}, H = o && o.createElement('div'), U = H ? H.style : {}, z = ['webkit', 'moz', 'ms', 'o'];

            function B(t, e) {
                if (void 0 === e && (e = V(t)), e) return t;
                if (!F[t]) {
                    var n = C(t), o = '' + n.charAt(0).toUpperCase() + n.slice(1);
                    S((n + ' ' + z.join(o + ' ') + o).split(' '), (function (e) {
                        if (e in U) return F[t] = e, !1
                    }))
                }
                return F[t]
            }

            b.prefixedProp = B;
            var W = {
                animationIterationCount: !0,
                columnCount: !0,
                flexGrow: !0,
                flexShrink: !0,
                fontWeight: !0,
                lineHeight: !0,
                opacity: !0,
                order: !0,
                orphans: !0,
                widows: !0,
                zIndex: !0
            };

            function $(t, e, n) {
                return void 0 === n && (n = V(t)), n || W[t] || !k(e) ? e : e + 'px'
            }

            _.css = function (t, e) {
                if (E(t)) {
                    var n = V(t);
                    return t = B(t, n), arguments.length < 2 ? this[0] && I(this[0], t, n) : t ? (e = $(t, e, n), this.each((function (o, r) {
                        1 === r.nodeType && (n ? r.style.setProperty(t, e) : r.style[t] = e)
                    }))) : this
                }
                for (var o in t) this.css(o, t[o]);
                return this
            };
            var q = '__cashData', G = /^data-(.*)/;

            function K(t) {
                return t[q] = t[q] || {}
            }

            function Y(t, e) {
                var n = K(t);
                if (e) {
                    if (!(e in n)) {
                        var o = t.dataset ? t.dataset[e] || t.dataset[C(e)] : b(t).attr('data-' + e);
                        if (void 0 !== o) {
                            try {
                                o = JSON.parse(o)
                            } catch (t) {
                            }
                            n[e] = o
                        }
                    }
                    return n[e]
                }
                return n
            }

            function X(t, e) {
                return N(t, 'border' + (e ? 'Left' : 'Top') + 'Width') + N(t, 'padding' + (e ? 'Left' : 'Top')) + N(t, 'padding' + (e ? 'Right' : 'Bottom')) + N(t, 'border' + (e ? 'Right' : 'Bottom') + 'Width')
            }

            function J(t, e) {
                for (var n = 0, o = e.length; n < o; n++) if (t.indexOf(e[n]) < 0) return !1;
                return !0
            }

            function Z(t, e, n) {
                S(t[n], (function (t) {
                    t[0];
                    var o = t[1];
                    e.removeEventListener(n, o)
                })), delete t[n]
            }

            b.hasData = function (t) {
                return q in t
            }, _.data = function (t, e) {
                var n = this;
                if (!t) {
                    if (!this[0]) return;
                    return S(this[0].attributes, (function (t) {
                        var e = t.name.match(G);
                        e && n.data(e[1])
                    })), Y(this[0])
                }
                if (E(t)) return void 0 === e ? this[0] && Y(this[0], t) : this.each((function (n, o) {
                    return function (t, e, n) {
                        K(t)[e] = n
                    }(o, t, e)
                }));
                for (var o in t) this.data(o, t[o]);
                return this
            }, _.removeData = function (t) {
                return this.each((function (e, n) {
                    return function (t, e) {
                        void 0 === e ? delete t[q] : delete K(t)[e]
                    }(n, t)
                }))
            }, S(['Width', 'Height'], (function (t) {
                _['inner' + t] = function () {
                    if (this[0]) return this[0] === r ? r['inner' + t] : this[0]['client' + t]
                }
            })), S(['width', 'height'], (function (t, e) {
                _[t] = function (n) {
                    return this[0] ? arguments.length ? (n = parseInt(n, 10), this.each((function (o, r) {
                        if (1 === r.nodeType) {
                            var i = I(r, 'boxSizing');
                            r.style[t] = $(t, n + ('border-box' === i ? X(r, !e) : 0))
                        }
                    }))) : this[0] === r ? this[0][C('outer-' + t)] : this[0].getBoundingClientRect()[t] - X(this[0], !e) : void 0 === n ? void 0 : this
                }
            })), S(['Width', 'Height'], (function (t, e) {
                _['outer' + t] = function (n) {
                    if (this[0]) return this[0] === r ? r['outer' + t] : this[0]['offset' + t] + (n ? N(this[0], 'margin' + (e ? 'Top' : 'Left')) + N(this[0], 'margin' + (e ? 'Bottom' : 'Right')) : 0)
                }
            }));
            var Q = '__cashEvents', tt = '.';

            function et(t) {
                return t[Q] = t[Q] || {}
            }

            function nt(t) {
                var e = t.split(tt);
                return [e[0], e.slice(1).sort()]
            }

            function ot(t, e, n, o) {
                var r = et(t);
                if (e) {
                    var i = r[e];
                    if (!i) return;
                    o && (o.guid = o.guid || O++), r[e] = i.filter((function (r) {
                        var i = r[0], a = r[1];
                        if (o && a.guid !== o.guid || !J(i, n)) return !0;
                        t.removeEventListener(e, a)
                    }))
                } else if (n && n.length) for (e in r) ot(t, e, n, o); else for (e in r) Z(r, t, e)
            }

            _.off = function (t, e) {
                var n = this;
                return void 0 === t ? this.each((function (t, e) {
                    return ot(e)
                })) : S(D(t), (function (t) {
                    var o = nt(t), r = o[0], i = o[1];
                    n.each((function (t, n) {
                        return ot(n, r, i, e)
                    }))
                })), this
            }, _.on = function (t, e, n, o) {
                var r = this;
                if (!E(t)) {
                    for (var i in t) this.on(i, e, t[i]);
                    return this
                }
                return P(e) && (n = e, e = !1), S(D(t), (function (t) {
                    var i = nt(t), a = i[0], s = i[1];
                    r.each((function (t, r) {
                        var i = function t(i) {
                            if (!i.namespace || J(s, i.namespace.split(tt))) {
                                var l = r;
                                if (e) {
                                    for (var c = i.target; !T(c, e);) {
                                        if (c === r) return;
                                        if (!(c = c.parentNode)) return
                                    }
                                    l = c
                                }
                                i.namespace = i.namespace || '';
                                var u = n.call(l, i, i.data);
                                o && ot(r, a, s, t), !1 === u && (i.preventDefault(), i.stopPropagation())
                            }
                        };
                        i.guid = n.guid = n.guid || O++, function (t, e, n, o) {
                            o.guid = o.guid || O++;
                            var r = et(t);
                            r[e] = r[e] || [], r[e].push([n, o]), t.addEventListener(e, o)
                        }(r, a, s, i)
                    }))
                })), this
            }, _.one = function (t, e, n) {
                return this.on(t, e, n, !0)
            }, _.ready = function (t) {
                var e = function () {
                    return t(b)
                };
                return 'loading' !== o.readyState ? setTimeout(e) : o.addEventListener('DOMContentLoaded', e), this
            }, _.trigger = function (t, e) {
                var n = t;
                if (E(t)) {
                    var r = nt(t), i = r[0], a = r[1];
                    (n = o.createEvent('HTMLEvents')).initEvent(i, !0, !0), n.namespace = a.join(tt)
                }
                return n.data = e, this.each((function (t, e) {
                    e.dispatchEvent(n)
                }))
            };
            var rt = /select-one/i, it = /select-multiple/i;

            function at(t) {
                var e = t.type;
                return rt.test(e) ? function (t) {
                    return t.selectedIndex < 0 ? null : t.options[t.selectedIndex].value
                }(t) : it.test(e) ? function (t) {
                    var e = [];
                    return S(t.options, (function (t) {
                        !t.selected || t.disabled || t.parentNode.disabled || e.push(t.value)
                    })), e
                }(t) : t.value
            }

            var st = /%20/g;
            var lt = /file|reset|submit|button|image/i, ct = /radio|checkbox/i;
            _.serialize = function () {
                var t = '';
                return this.each((function (e, n) {
                    S(n.elements || [n], (function (e) {
                        if (!e.disabled && e.name && 'FIELDSET' !== e.tagName && !lt.test(e.type) && (!ct.test(e.type) || e.checked)) {
                            var n = at(e);
                            if (void 0 !== n) S(A(n) ? n : [n], (function (n) {
                                t += function (t, e) {
                                    return '&' + encodeURIComponent(t) + '=' + encodeURIComponent(e).replace(st, '+')
                                }(e.name, n)
                            }))
                        }
                    }))
                })), t.substr(1)
            }, _.val = function (t) {
                return void 0 === t ? this[0] && at(this[0]) : this.each((function (e, n) {
                    var o = it.test(n.type), r = null === t ? o ? [] : '' : t;
                    o && A(r) ? S(n.options, (function (t) {
                        t.selected = r.indexOf(t.value) >= 0
                    })) : n.value = r
                }))
            }, _.clone = function () {
                return this.map((function (t, e) {
                    return e.cloneNode(!0)
                }))
            }, _.detach = function () {
                return this.each((function (t, e) {
                    e.parentNode && e.parentNode.removeChild(e)
                }))
            };
            var ut, pt = /^\s*<(\w+)[^>]*>/, dt = /^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;

            function ft(t) {
                if (function () {
                    if (!ut) {
                        var t = o.createElement('table'), e = o.createElement('tr');
                        ut = {
                            '*': o.createElement('div'),
                            tr: o.createElement('tbody'),
                            td: e,
                            th: e,
                            thead: t,
                            tbody: t,
                            tfoot: t
                        }
                    }
                }(), !E(t)) return [];
                if (dt.test(t)) return [o.createElement(RegExp.$1)];
                var e = pt.test(t) && RegExp.$1, n = ut[e] || ut['*'];
                return n.innerHTML = t, b(n.childNodes).detach().get()
            }

            function ht(t, e, n) {
                if (void 0 !== e) {
                    var o = E(e);
                    !o && e.length ? S(e, (function (e) {
                        return ht(t, e, n)
                    })) : S(t, o ? function (t) {
                        t.insertAdjacentHTML(n ? 'afterbegin' : 'beforeend', e)
                    } : function (t, o) {
                        return function (t, e, n) {
                            n ? t.insertBefore(e, t.childNodes[0]) : t.appendChild(e)
                        }(t, o ? e.cloneNode(!0) : e, n)
                    })
                }
            }

            b.parseHTML = ft, _.empty = function () {
                var t = this[0];
                if (t) for (; t.firstChild;) t.removeChild(t.firstChild);
                return this
            }, _.append = function () {
                var t = this;
                return S(arguments, (function (e) {
                    ht(t, e)
                })), this
            }, _.appendTo = function (t) {
                return ht(b(t), this), this
            }, _.html = function (t) {
                if (void 0 === t) return this[0] && this[0].innerHTML;
                var e = t.nodeType ? t[0].outerHTML : t;
                return this.each((function (t, n) {
                    n.innerHTML = e
                }))
            }, _.insertAfter = function (t) {
                var e = this;
                return b(t).each((function (t, n) {
                    var o = n.parentNode;
                    e.each((function (e, r) {
                        o.insertBefore(t ? r.cloneNode(!0) : r, n.nextSibling)
                    }))
                })), this
            }, _.after = function () {
                var t = this;
                return S(u.apply(arguments), (function (e) {
                    u.apply(b(e).slice()).insertAfter(t)
                })), this
            }, _.insertBefore = function (t) {
                var e = this;
                return b(t).each((function (t, n) {
                    var o = n.parentNode;
                    e.each((function (e, r) {
                        o.insertBefore(t ? r.cloneNode(!0) : r, n)
                    }))
                })), this
            }, _.before = function () {
                var t = this;
                return S(arguments, (function (e) {
                    b(e).insertBefore(t)
                })), this
            }, _.prepend = function () {
                var t = this;
                return S(arguments, (function (e) {
                    ht(t, e, !0)
                })), this
            }, _.prependTo = function (t) {
                return ht(b(t), u.apply(this.slice()), !0), this
            }, _.remove = function () {
                return this.detach().off()
            }, _.replaceWith = function (t) {
                var e = this;
                return this.each((function (n, o) {
                    var r = o.parentNode;
                    if (r) {
                        var i = n ? b(t).clone() : b(t);
                        if (!i[0]) return e.remove(), !1;
                        r.replaceChild(i[0], o), b(i[0]).after(i.slice(1))
                    }
                }))
            }, _.replaceAll = function (t) {
                return b(t).replaceWith(this), this
            }, _.text = function (t) {
                return void 0 === t ? this[0] ? this[0].textContent : '' : this.each((function (e, n) {
                    n.textContent = t
                }))
            };
            var vt = o && o.documentElement;
            _.offset = function () {
                var t = this[0];
                if (t) {
                    var e = t.getBoundingClientRect();
                    return {top: e.top + r.pageYOffset - vt.clientTop, left: e.left + r.pageXOffset - vt.clientLeft}
                }
            }, _.offsetParent = function () {
                return b(this[0] && this[0].offsetParent)
            }, _.position = function () {
                var t = this[0];
                if (t) return {left: t.offsetLeft, top: t.offsetTop}
            }, _.children = function (t) {
                var e = [];
                return this.each((function (t, n) {
                    c.apply(e, n.children)
                })), e = b(L(e)), t ? e.filter((function (e, n) {
                    return T(n, t)
                })) : e
            }, _.contents = function () {
                var t = [];
                return this.each((function (e, n) {
                    c.apply(t, 'IFRAME' === n.tagName ? [n.contentDocument] : n.childNodes)
                })), b(t.length && L(t))
            }, _.find = function (t) {
                for (var e = [], n = 0, o = this.length; n < o; n++) {
                    var r = y(t, this[n]);
                    r.length && c.apply(e, r)
                }
                return b(e.length && L(e))
            }, _.has = function (t) {
                var e = E(t) ? function (e, n) {
                    return !!y(t, n).length
                } : function (e, n) {
                    return n.contains(t)
                };
                return this.filter(e)
            }, _.is = function (t) {
                if (!t || !this[0]) return !1;
                var e = j(t), n = !1;
                return this.each((function (o, r) {
                    return !(n = e(o, r, t))
                })), n
            }, _.next = function () {
                return b(this[0] && this[0].nextElementSibling)
            }, _.not = function (t) {
                if (!t || !this[0]) return this;
                var e = j(t);
                return this.filter((function (n, o) {
                    return !e(n, o, t)
                }))
            }, _.parent = function () {
                var t = [];
                return this.each((function (e, n) {
                    n && n.parentNode && t.push(n.parentNode)
                })), b(L(t))
            }, _.index = function (t) {
                var e = t ? b(t)[0] : this[0], n = t ? this : b(e).parent().children();
                return s.call(n, e)
            }, _.closest = function (t) {
                return t && this[0] ? this.is(t) ? this.filter(t) : this.parent().closest(t) : b()
            }, _.parents = function (t) {
                var e, n = [];
                return this.each((function (r, i) {
                    for (e = i; e && e.parentNode && e !== o.body.parentNode;) e = e.parentNode, (!t || t && T(e, t)) && n.push(e)
                })), b(L(n))
            }, _.prev = function () {
                return b(this[0] && this[0].previousElementSibling)
            }, _.siblings = function () {
                var t = this[0];
                return this.parent().children().filter((function (e, n) {
                    return n !== t
                }))
            };
            const gt = b
        }, 6294: (t, e, n) => {
            "use strict";
            n.d(e, {
                AU: () => L,
                BC: () => g,
                C8: () => C,
                Ch: () => T,
                Ci: () => k,
                D8: () => s,
                G2: () => P,
                GW: () => x,
                GZ: () => m,
                I6: () => p,
                LJ: () => j,
                Sc: () => v,
                X6: () => d,
                Xy: () => S,
                YZ: () => c,
                ZQ: () => l,
                _I: () => I,
                a_: () => y,
                af: () => _,
                bG: () => h,
                cx: () => u,
                ir: () => w,
                kk: () => M,
                on: () => D,
                rp: () => A,
                v$: () => E,
                yL: () => b,
                zN: () => f
            });
            var o = n(5706), r = void 0 && (void 0).__spreadArray || function (t, e, n) {
                    if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                    return t.concat(o || Array.prototype.slice.call(e))
                }, i = 'tag', a = 'attributes', s = 'transitionend oTransitionEnd transitionend webkitTransitionEnd',
                l = function (t) {
                    return (null == t ? void 0 : t.nodeType) === Node.DOCUMENT_NODE
                }, c = function (t) {
                    var e = t && t.parentNode;
                    e && e.removeChild(t)
                };

            function u() {
                for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                return (Array.isArray(t[0]) ? t[0] : r([], t, !0)).filter(Boolean).join(' ')
            }

            var p = function (t, e) {
                return t.querySelectorAll(e)
            }, d = function (t, e) {
                return void 0 === e && (e = {}), t && t.setAttribute && (0, o.each)(e, (function (e, n) {
                    return t.setAttribute(n, e)
                }))
            }, f = function (t) {
                var e;
                return t && !!(t.offsetWidth || t.offsetHeight || (null === (e = t.getClientRects) || void 0 === e ? void 0 : e.call(t).length))
            }, h = function (t, e) {
                var n;
                null === (n = t.parentNode) || void 0 === n || n.replaceChild(e, t)
            }, v = function (t, e, n) {
                var r = t.childNodes, i = r.length, a = (0, o.isUndefined)(n) ? i : n;
                (0, o.isString)(e) && (t.insertAdjacentHTML('beforeEnd', e), e = t.lastChild, t.removeChild(e)), a >= i ? t.appendChild(e) : t.insertBefore(e, r[a])
            }, g = function (t, e) {
                return v(t, e)
            }, y = function (t, e, n) {
                void 0 === e && (e = {});
                var r = document.createElement(t);
                return e && (0, o.each)(e, (function (t, e) {
                    return r.setAttribute(e, t)
                })), n && ((0, o.isString)(n) ? r.innerHTML = n : r.appendChild(n)), r
            }, m = function (t) {
                return document.createTextNode(t)
            }, b = function (t, e) {
                var n, o = t.type;
                try {
                    n = new window[e](o, t)
                } catch (t) {
                    (n = document.createEvent(e)).initEvent(o, !0, !0)
                }
                return n._parentEvent = t, 0 === o.indexOf('key') && (n.keyCodeVal = t.keyCode, ['keyCode', 'which'].forEach((function (t) {
                    Object.defineProperty(n, t, {
                        get: function () {
                            return this.keyCodeVal
                        }
                    })
                }))), n
            }, _ = function (t, e) {
                void 0 === e && (e = []), (Array.isArray(e) ? e : [e]).forEach((function (e) {
                    var n = e[i] || 'div', r = e[a] || {}, s = document.createElement(n);
                    (0, o.each)(r, (function (t, e) {
                        s.setAttribute(e, t)
                    })), t.appendChild(s)
                }))
            }, w = function (t) {
                return (null == t ? void 0 : t.nodeType) === Node.TEXT_NODE
            }, x = function (t) {
                return t && !w(t) && !function (t) {
                    return (null == t ? void 0 : t.nodeType) === Node.COMMENT_NODE
                }(t)
            }, C = function (t) {
                var e, n = {top: 0, left: 0, width: 0, height: 0};
                if (!t) return n;
                if (w(t)) {
                    var o = document.createRange();
                    o.selectNode(t), e = o.getBoundingClientRect(), o.detach()
                }
                return e || (t.getBoundingClientRect ? t.getBoundingClientRect() : n)
            }, S = function (t) {
                var e = (null == t ? void 0 : t.ownerDocument) || document, n = e.documentElement,
                    o = e.defaultView || window;
                return {
                    x: (o.pageXOffset || n.scrollLeft || 0) - (n.clientLeft || 0),
                    y: (o.pageYOffset || n.scrollTop || 0) - (n.clientTop || 0)
                }
            }, O = function (t) {
                return t.which || t.keyCode
            }, T = function (t) {
                return String.fromCharCode(O(t))
            }, P = function (t) {
                return t.touches && t.touches[0] ? t.touches[0] : t
            }, E = function (t) {
                return 27 === O(t)
            }, k = function (t) {
                return 13 === O(t)
            }, A = function (t) {
                return function (t) {
                    return t.ctrlKey
                }(t) || t.metaKey
            }, j = function (t) {
                if (!t) return '';
                var e = t.name, n = t.publicId, o = t.systemId, r = n ? " PUBLIC \"".concat(n, "\"") : '',
                    i = !n && o ? " SYSTEM \"".concat(o, "\"") : '';
                return "<!DOCTYPE ".concat(e).concat(r).concat(i, ">")
            }, M = function (t) {
                void 0 === t && (t = {});
                var e = [];
                return (0, o.each)(t, (function (t, n) {
                    return e.push("".concat(n, "=\"").concat(t, "\""))
                })), e.join(' ')
            }, D = function (t, e, n, r) {
                var i = e.split(/\s+/), a = (0, o.isArray)(t) ? t : [t];
                i.forEach((function (t) {
                    a.forEach((function (e) {
                        return null == e ? void 0 : e.addEventListener(t, n, r)
                    }))
                }))
            }, L = function (t, e, n, r) {
                var i = e.split(/\s+/), a = (0, o.isArray)(t) ? t : [t];
                i.forEach((function (t) {
                    a.forEach((function (e) {
                        return null == e ? void 0 : e.removeEventListener(t, n, r)
                    }))
                }))
            }, I = function (t) {
                return t.replace(/-([a-zA-Z0-9])/g, (function (t, e) {
                    return e.toUpperCase()
                }))
            }
        }, 1166: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {
                appendStyles: () => C,
                buildBase64UrlFromSvg: () => q,
                camelCase: () => P,
                capitalize: () => V,
                createId: () => $,
                deepMerge: () => L,
                escape: () => M,
                escapeNodeContent: () => D,
                find: () => j,
                get: () => p,
                getComponentModel: () => B,
                getComponentView: () => z,
                getElement: () => A,
                getGlobal: () => m,
                getModel: () => I,
                getUiClass: () => x,
                getUnitFromValue: () => O,
                getViewEl: () => H,
                hasDnd: () => k,
                hasWin: () => y,
                isBultInMethod: () => f,
                isComponent: () => U,
                isDef: () => g,
                isEmptyObj: () => R,
                isObject: () => N,
                isRule: () => F,
                matches: () => w,
                normalizeFloat: () => E,
                normalizeKey: () => h,
                serialize: () => d,
                setViewEl: () => W,
                shallowDiff: () => S,
                stringToPath: () => u,
                toLowerCase: () => b,
                upFirst: () => T,
                wait: () => v
            });
            var o = n(5706), r = n(6294), i = void 0 && (void 0).__assign || function () {
                    return i = Object.assign || function (t) {
                        for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                        return t
                    }, i.apply(this, arguments)
                }, a = void 0 && (void 0).__spreadArray || function (t, e, n) {
                    if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                    return t.concat(o || Array.prototype.slice.call(e))
                }, s = {}, l = /\\(\\)?/g,
                c = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,
                u = function (t) {
                    var e = [];
                    return 46 === t.charCodeAt(0) && e.push(''), t.replace(c, (function (t, n, o, r) {
                        return e.push(o ? r.replace(l, '$1') : n || t), ''
                    })), e
                };
            var p = function (t, e, n) {
                    for (var r, i = function (t, e) {
                        return (0, o.isArray)(t) ? t : e.hasOwnProperty(t) ? [t] : u(t)
                    }(e, t), a = i.length, s = 0; null != t && s < a;) t = t["".concat(i[s++])];
                    return null !== (r = s && s == a ? t : void 0) && void 0 !== r ? r : n
                }, d = function (t) {
                    return JSON.parse(JSON.stringify(t))
                }, f = function (t) {
                    return (0, o.isFunction)(s[t])
                }, h = function (t) {
                    return f(t) ? "_".concat(t) : t
                }, v = function (t) {
                    return void 0 === t && (t = 0), new Promise((function (e) {
                        return setTimeout(e, t)
                    }))
                }, g = function (t) {
                    return void 0 !== t
                }, y = function () {
                    return 'undefined' != typeof window
                }, m = function () {
                    return 'undefined' != typeof globalThis ? globalThis : 'undefined' != typeof window ? window : n.g
                }, b = function (t) {
                    return (t || '').toLowerCase()
                }, _ = y() ? window.Element.prototype : {},
                w = _.matches || _.webkitMatchesSelector || _.mozMatchesSelector || _.msMatchesSelector,
                x = function (t, e) {
                    var n = t.getConfig(), o = n.stylePrefix;
                    return [n.customUI && "".concat(o, "cui"), e].filter((function (t) {
                        return t
                    })).join(' ')
                }, C = function (t, e) {
                    void 0 === e && (e = {});
                    var n = (0, o.isArray)(t) ? a([], t, !0) : [t];
                    if (n.length) {
                        var r = n.shift();
                        if (r && (!e.unique || !document.querySelector("link[href=\"".concat(r, "\"]")))) {
                            var i = document.head, s = document.createElement('link');
                            s.href = r, s.rel = 'stylesheet', e.prepand ? i.insertBefore(s, i.firstChild) : i.appendChild(s)
                        }
                        C(n)
                    }
                }, S = function (t, e) {
                    var n = {}, r = (0, o.keys)(e);
                    for (var i in t) if (t.hasOwnProperty(i)) {
                        var a = t[i], s = e[i];
                        r.indexOf(i) >= 0 ? a !== s && (n[i] = s) : n[i] = null
                    }
                    for (var i in e) e.hasOwnProperty(i) && (0, o.isUndefined)(t[i]) && (n[i] = e[i]);
                    return n
                }, O = function (t) {
                    return t.replace(parseFloat(t), '')
                }, T = function (t) {
                    return t[0].toUpperCase() + t.toLowerCase().slice(1)
                }, P = function (t) {
                    return t.replace(/-./g, (function (t) {
                        return t[1].toUpperCase()
                    }))
                }, E = function (t, e, n) {
                    void 0 === e && (e = 1), void 0 === n && (n = 0);
                    var o = 0;
                    if (isNaN(t)) return n;
                    if (t = parseFloat(t), Math.floor(t) !== t) {
                        var r = e.toString().split('.')[1];
                        o = r ? r.length : 0
                    }
                    return o ? parseFloat(t.toFixed(o)) : t
                }, k = function (t) {
                    return 'draggable' in document.createElement('i') && (!t || t.config.nativeDnD)
                }, A = function (t) {
                    return (0, o.isElement)(t) || (0, r.ir)(t) ? t : t && t.getEl ? t.getEl() : void 0
                }, j = function (t, e) {
                    var n = null;
                    return t.some((function (o, r) {
                        return e(o, r, t) ? (n = o, 1) : 0
                    })), n
                }, M = function (t) {
                    return void 0 === t && (t = ''), "".concat(t).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;').replace(/`/g, '&#96;')
                }, D = function (t) {
                    return void 0 === t && (t = ''), "".concat(t).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
                }, L = function () {
                    for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                    for (var n = i({}, t[0]), o = 1; o < t.length; o++) {
                        var r = i({}, t[o]);
                        for (var a in r) {
                            var s = n[a], l = r[a];
                            N(s) && N(l) ? n[a] = L(s, l) : n[a] = l
                        }
                    }
                    return n
                }, I = function (t, e) {
                    var n;
                    return !e && t && t.__cashData ? n = t.__cashData.model : e && (0, o.isElement)(t) && (n = e(t).data('model')), n
                }, N = function (t) {
                    return t && !Array.isArray(t) && 'object' == typeof t
                }, R = function (t) {
                    return Object.keys(t).length <= 0
                }, V = function (t) {
                    return void 0 === t && (t = ''), t && t.charAt(0).toUpperCase() + t.substring(1)
                }, F = function (t) {
                    return t && t.toCSS
                }, H = function (t) {
                    return null == t ? void 0 : t.__gjsv
                }, U = function (t) {
                    return !!(null == t ? void 0 : t.toHTML)
                }, z = function (t) {
                    return H(t)
                }, B = function (t) {
                    var e;
                    return null === (e = z(t)) || void 0 === e ? void 0 : e.model
                }, W = function (t, e) {
                    t.__gjsv = e
                }, $ = function (t) {
                    void 0 === t && (t = 16);
                    for (var e = '', n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', o = n.length, r = 0; r < t; r++) e += n.charAt(Math.floor(Math.random() * o));
                    return e
                }, q = function (t) {
                    if (t && '<svg' === t.substr(0, 4)) {
                        var e = '';
                        return y() ? e = window.btoa(t) : 'undefined' != typeof Buffer && (e = Buffer.from(t, 'utf8').toString('base64')), e ? "data:image/svg+xml;base64,".concat(e) : t
                    }
                    return t
                }
        }, 6756: (t, e, n) => {
            "use strict";
            n.d(e, {h: () => a});
            var o, r = n(3178), i = void 0 && (void 0).__extends || (o = function (t, e) {
                return o = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, o(t, e)
            }, function (t, e) {
                if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");

                function n() {
                    this.constructor = t
                }

                o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
            }), a = function (t) {
                function e() {
                    var e = null !== t && t.apply(this, arguments) || this;
                    return e.displayCache = new Map, e
                }

                return i(e, t), e.prototype.getChildren = function () {
                    return this.getDisplayedChildren()
                }, e.prototype.getDisplayedChildren = function () {
                    var t = this;
                    return this.model.components().filter((function (e) {
                        return t.isChildDisplayed(e)
                    })).map((function (e) {
                        return new t.constructor(e)
                    }))
                }, e.prototype.isChildDisplayed = function (t) {
                    if (this.displayCache.has(t)) return this.displayCache.get(t);
                    var e = function (t) {
                        return !!t && ('object' == typeof t && t.nodeType === Node.ELEMENT_NODE && 'none' !== window.getComputedStyle(t).display && t.offsetWidth > 0 && t.offsetHeight > 0)
                    }(t.getEl());
                    return this.displayCache.set(t, e), e
                }, e.prototype.getParent = function () {
                    var t = this.model.parent();
                    return t ? new this.constructor(t) : null
                }, e.prototype.addChildAt = function (t, e, n) {
                    var o, r, i, a, s, l, c, u;
                    if (void 0 === n && (n = {action: 'add-component'}), (null === (r = null === (o = this.model) || void 0 === o ? void 0 : o.isInstanceOf) || void 0 === r ? void 0 : r.call(o, 'text')) && (null === (a = null === (i = null == t ? void 0 : t.model) || void 0 === i ? void 0 : i.get) || void 0 === a ? void 0 : a.call(i, 'textable'))) return null === (u = null === (c = null === (l = null === (s = this.model) || void 0 === s ? void 0 : s.getView) || void 0 === l ? void 0 : l.call(s)) || void 0 === c ? void 0 : c.insertComponent) || void 0 === u ? void 0 : u.call(c, null == t ? void 0 : t.model, {action: n.action});
                    var p = this.model.components().add(t.model, {at: this.getRealIndex(e), action: n.action});
                    return new this.constructor(p)
                }, e.prototype.removeChildAt = function (t, e) {
                    void 0 === e && (e = {temporary: !1});
                    var n = this.model.components().at(this.getRealIndex(t));
                    n && this.model.components().remove(n, e)
                }, e.prototype.indexOfChild = function (t) {
                    return this.getDisplayIndex(t)
                }, e.prototype.getDisplayIndex = function (t) {
                    var e = this.getDisplayedChildren();
                    return e ? e.findIndex((function (e) {
                        return e.model === t.model
                    })) : -1
                }, e.prototype.getRealIndex = function (t) {
                    if (-1 === t) return -1;
                    for (var e = 0, n = this.model.components(), o = 0; o < n.length; o++) {
                        var r = n.at(o);
                        if (this.isChildDisplayed(r) && e++, e === t + 1) return o
                    }
                    return -1
                }, e.prototype.canMove = function (t, e) {
                    return this.model.em.Components.canMove(this.model, t.model, this.getRealIndex(e)).result
                }, e.prototype.equals = function (t) {
                    return !!(null == t ? void 0 : t._model) && this._model.getId() === t._model.getId()
                }, e.prototype.restNodeState = function () {
                    this.clearState();
                    var t = this.model;
                    this.setContentEditable(!1), t.em.getEditing() === t && this.disableEditing()
                }, e.prototype.setContentEditable = function (t) {
                    this.element && this.isTextNode() && (this.element.contentEditable = t ? 'true' : 'false')
                }, e.prototype.disableEditing = function () {
                    var t, e;
                    null === (e = null === (t = this.view) || void 0 === t ? void 0 : t.disableEditing) || void 0 === e || e.call(t)
                }, e.prototype.clearState = function () {
                    var t, e;
                    null === (e = (t = this.model).set) || void 0 === e || e.call(t, 'status', '')
                }, e.prototype.setSelectedParentState = function () {
                    var t, e;
                    null === (e = (t = this.model).set) || void 0 === e || e.call(t, 'status', 'selected-parent')
                }, e.prototype.isTextNode = function () {
                    var t, e;
                    return null === (e = (t = this.model).isInstanceOf) || void 0 === e ? void 0 : e.call(t, 'text')
                }, e.prototype.isTextable = function () {
                    var t, e;
                    return null === (e = (t = this.model).get) || void 0 === e ? void 0 : e.call(t, 'textable')
                }, e
            }(r.$)
        }, 1447: (t, e, n) => {
            "use strict";
            n.d(e, {A: () => a});
            var o, r = n(6756), i = void 0 && (void 0).__extends || (o = function (t, e) {
                return o = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, o(t, e)
            }, function (t, e) {
                if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");

                function n() {
                    this.constructor = t
                }

                o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
            });
            const a = function (t) {
                function e() {
                    var e = null !== t && t.apply(this, arguments) || this;
                    return e._dropAreaConfig = {ratio: .8, minUndroppableDimension: 1, maxUndroppableDimension: 15}, e
                }

                return i(e, t), Object.defineProperty(e.prototype, "view", {
                    get: function () {
                        var t, e;
                        return null === (e = (t = this.model).getView) || void 0 === e ? void 0 : e.call(t)
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(e.prototype, "element", {
                    get: function () {
                        var t, e;
                        return null === (e = (t = this.model).getEl) || void 0 === e ? void 0 : e.call(t)
                    }, enumerable: !1, configurable: !0
                }), e
            }(r.h)
        }, 3178: (t, e, n) => {
            "use strict";
            n.d(e, {$: () => o});
            var o = function () {
                function t(t, e) {
                    void 0 === e && (e = {}), this._dropAreaConfig = {
                        ratio: 1,
                        minUndroppableDimension: 0,
                        maxUndroppableDimension: 0
                    }, this._model = t, this._dragSource = e
                }

                return Object.defineProperty(t.prototype, "model", {
                    get: function () {
                        return this._model
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(t.prototype, "dragSource", {
                    get: function () {
                        return this._dragSource
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(t.prototype, "dropArea", {
                    get: function () {
                        var t, e;
                        return this.getParent() ? null === (e = this.nodeDimensions) || void 0 === e ? void 0 : e.getDropArea(this._dropAreaConfig) : null === (t = this.nodeDimensions) || void 0 === t ? void 0 : t.clone()
                    }, enumerable: !1, configurable: !0
                }), t.prototype.isWithinDropBounds = function (t, e) {
                    return !!this.dropArea && this.dropArea.isWithinBounds(t, e)
                }, t.prototype.equals = function (t) {
                    return !!(null == t ? void 0 : t._model) && this._model === t._model
                }, t.prototype.adjustDimensions = function (t) {
                    var e, n;
                    0 === t.topDifference && 0 === t.leftDifference || (null === (e = this.nodeDimensions) || void 0 === e || e.adjustDimensions(t), null === (n = this.childrenDimensions) || void 0 === n || n.forEach((function (e) {
                        return e.adjustDimensions(t)
                    })))
                }, t
            }()
        }, 8433: (t, e, n) => {
            "use strict";
            var o;
            n.d(e, {A: () => o}), function (t) {
                t["Vertical"] = "Vertical", t["Horizontal"] = "Horizontal", t["BothDirections"] = "BothDirections"
            }(o || (o = {}))
        }, 585: (t, e, n) => {
            var o = {
                "./CanvasClear": 9484,
                "./CanvasClear.ts": 9484,
                "./CanvasMove": 9516,
                "./CanvasMove.ts": 9516,
                "./CommandAbstract": 9946,
                "./CommandAbstract.ts": 9946,
                "./ComponentDelete": 7801,
                "./ComponentDelete.ts": 7801,
                "./ComponentDrag": 4864,
                "./ComponentDrag.ts": 4864,
                "./ComponentEnter": 6134,
                "./ComponentEnter.ts": 6134,
                "./ComponentExit": 914,
                "./ComponentExit.ts": 914,
                "./ComponentNext": 5547,
                "./ComponentNext.ts": 5547,
                "./ComponentPrev": 8655,
                "./ComponentPrev.ts": 8655,
                "./ComponentStyleClear": 7640,
                "./ComponentStyleClear.ts": 7640,
                "./CopyComponent": 5837,
                "./CopyComponent.ts": 5837,
                "./ExportTemplate": 6477,
                "./ExportTemplate.ts": 6477,
                "./Fullscreen": 1772,
                "./Fullscreen.ts": 1772,
                "./MoveComponent": 741,
                "./MoveComponent.ts": 741,
                "./OpenAssets": 2924,
                "./OpenAssets.ts": 2924,
                "./OpenBlocks": 3963,
                "./OpenBlocks.ts": 3963,
                "./OpenLayers": 1479,
                "./OpenLayers.ts": 1479,
                "./OpenStyleManager": 3473,
                "./OpenStyleManager.ts": 3473,
                "./OpenTraitManager": 5054,
                "./OpenTraitManager.ts": 5054,
                "./PasteComponent": 6979,
                "./PasteComponent.ts": 6979,
                "./Preview": 4457,
                "./Preview.ts": 4457,
                "./Resize": 5493,
                "./Resize.ts": 5493,
                "./SelectComponent": 9317,
                "./SelectComponent.ts": 9317,
                "./SelectPosition": 1406,
                "./SelectPosition.ts": 1406,
                "./ShowOffset": 9395,
                "./ShowOffset.ts": 9395,
                "./SwitchVisibility": 7285,
                "./SwitchVisibility.ts": 7285
            };

            function r(t) {
                var e = i(t);
                return n(e)
            }

            function i(t) {
                if (!n.o(o, t)) {
                    var e = new Error("Cannot find module '" + t + "'");
                    throw e.code = 'MODULE_NOT_FOUND', e
                }
                return o[t]
            }

            r.keys = function () {
                return Object.keys(o)
            }, r.resolve = i, t.exports = r, r.id = 585
        }, 5706: (t, e, n) => {
            "use strict";
            n.r(e), n.d(e, {
                VERSION: () => r,
                after: () => Ie,
                all: () => en,
                allKeys: () => gt,
                any: () => nn,
                assign: () => It,
                before: () => Ne,
                bind: () => Ce,
                bindAll: () => Te,
                chain: () => be,
                chunk: () => Fn,
                clone: () => Ft,
                collect: () => Ye,
                compact: () => En,
                compose: () => Le,
                constant: () => Z,
                contains: () => on,
                countBy: () => gn,
                create: () => Vt,
                debounce: () => je,
                default: () => Wn,
                defaults: () => Nt,
                defer: () => ke,
                delay: () => Ee,
                detect: () => qe,
                difference: () => An,
                drop: () => Tn,
                each: () => Ke,
                escape: () => se,
                every: () => en,
                extend: () => Lt,
                extendOwn: () => It,
                filter: () => Qe,
                find: () => qe,
                findIndex: () => He,
                findKey: () => Ve,
                findLastIndex: () => Ue,
                findWhere: () => Ge,
                first: () => On,
                flatten: () => kn,
                foldl: () => Je,
                foldr: () => Ze,
                forEach: () => Ke,
                functions: () => Mt,
                get: () => Wt,
                groupBy: () => hn,
                has: () => $t,
                head: () => On,
                identity: () => qt,
                include: () => on,
                includes: () => on,
                indexBy: () => vn,
                indexOf: () => We,
                initial: () => Sn,
                inject: () => Je,
                intersection: () => Ln,
                invert: () => jt,
                invoke: () => rn,
                isArguments: () => Y,
                isArray: () => q,
                isArrayBuffer: () => R,
                isBoolean: () => E,
                isDataView: () => $,
                isDate: () => D,
                isElement: () => k,
                isEmpty: () => lt,
                isEqual: () => vt,
                isError: () => I,
                isFinite: () => X,
                isFunction: () => H,
                isMap: () => Ot,
                isMatch: () => ct,
                isNaN: () => J,
                isNull: () => T,
                isNumber: () => M,
                isObject: () => O,
                isRegExp: () => L,
                isSet: () => Pt,
                isString: () => j,
                isSymbol: () => N,
                isTypedArray: () => rt,
                isUndefined: () => P,
                isWeakMap: () => Tt,
                isWeakSet: () => Et,
                iteratee: () => Jt,
                keys: () => st,
                last: () => Pn,
                lastIndexOf: () => $e,
                map: () => Ye,
                mapObject: () => Qt,
                matcher: () => Gt,
                matches: () => Gt,
                max: () => ln,
                memoize: () => Pe,
                methods: () => Mt,
                min: () => cn,
                mixin: () => Un,
                negate: () => De,
                noop: () => te,
                now: () => re,
                object: () => Rn,
                omit: () => Cn,
                once: () => Re,
                pairs: () => At,
                partial: () => xe,
                partition: () => yn,
                pick: () => xn,
                pluck: () => an,
                property: () => Kt,
                propertyOf: () => ee,
                random: () => oe,
                range: () => Vn,
                reduce: () => Je,
                reduceRight: () => Ze,
                reject: () => tn,
                rest: () => Tn,
                restArguments: () => S,
                result: () => ge,
                sample: () => un,
                select: () => Qe,
                shuffle: () => pn,
                size: () => _n,
                some: () => nn,
                sortBy: () => dn,
                sortedIndex: () => ze,
                tail: () => Tn,
                take: () => On,
                tap: () => Ht,
                template: () => ve,
                templateSettings: () => ce,
                throttle: () => Ae,
                times: () => ne,
                toArray: () => bn,
                toPath: () => Ut,
                transpose: () => In,
                unescape: () => le,
                union: () => Dn,
                uniq: () => Mn,
                unique: () => Mn,
                uniqueId: () => me,
                unzip: () => In,
                values: () => kt,
                where: () => sn,
                without: () => jn,
                wrap: () => Me,
                zip: () => Nn
            });
            var o = {};
            n.r(o), n.d(o, {
                VERSION: () => r,
                after: () => Ie,
                all: () => en,
                allKeys: () => gt,
                any: () => nn,
                assign: () => It,
                before: () => Ne,
                bind: () => Ce,
                bindAll: () => Te,
                chain: () => be,
                chunk: () => Fn,
                clone: () => Ft,
                collect: () => Ye,
                compact: () => En,
                compose: () => Le,
                constant: () => Z,
                contains: () => on,
                countBy: () => gn,
                create: () => Vt,
                debounce: () => je,
                default: () => zn,
                defaults: () => Nt,
                defer: () => ke,
                delay: () => Ee,
                detect: () => qe,
                difference: () => An,
                drop: () => Tn,
                each: () => Ke,
                escape: () => se,
                every: () => en,
                extend: () => Lt,
                extendOwn: () => It,
                filter: () => Qe,
                find: () => qe,
                findIndex: () => He,
                findKey: () => Ve,
                findLastIndex: () => Ue,
                findWhere: () => Ge,
                first: () => On,
                flatten: () => kn,
                foldl: () => Je,
                foldr: () => Ze,
                forEach: () => Ke,
                functions: () => Mt,
                get: () => Wt,
                groupBy: () => hn,
                has: () => $t,
                head: () => On,
                identity: () => qt,
                include: () => on,
                includes: () => on,
                indexBy: () => vn,
                indexOf: () => We,
                initial: () => Sn,
                inject: () => Je,
                intersection: () => Ln,
                invert: () => jt,
                invoke: () => rn,
                isArguments: () => Y,
                isArray: () => q,
                isArrayBuffer: () => R,
                isBoolean: () => E,
                isDataView: () => $,
                isDate: () => D,
                isElement: () => k,
                isEmpty: () => lt,
                isEqual: () => vt,
                isError: () => I,
                isFinite: () => X,
                isFunction: () => H,
                isMap: () => Ot,
                isMatch: () => ct,
                isNaN: () => J,
                isNull: () => T,
                isNumber: () => M,
                isObject: () => O,
                isRegExp: () => L,
                isSet: () => Pt,
                isString: () => j,
                isSymbol: () => N,
                isTypedArray: () => rt,
                isUndefined: () => P,
                isWeakMap: () => Tt,
                isWeakSet: () => Et,
                iteratee: () => Jt,
                keys: () => st,
                last: () => Pn,
                lastIndexOf: () => $e,
                map: () => Ye,
                mapObject: () => Qt,
                matcher: () => Gt,
                matches: () => Gt,
                max: () => ln,
                memoize: () => Pe,
                methods: () => Mt,
                min: () => cn,
                mixin: () => Un,
                negate: () => De,
                noop: () => te,
                now: () => re,
                object: () => Rn,
                omit: () => Cn,
                once: () => Re,
                pairs: () => At,
                partial: () => xe,
                partition: () => yn,
                pick: () => xn,
                pluck: () => an,
                property: () => Kt,
                propertyOf: () => ee,
                random: () => oe,
                range: () => Vn,
                reduce: () => Je,
                reduceRight: () => Ze,
                reject: () => tn,
                rest: () => Tn,
                restArguments: () => S,
                result: () => ge,
                sample: () => un,
                select: () => Qe,
                shuffle: () => pn,
                size: () => _n,
                some: () => nn,
                sortBy: () => dn,
                sortedIndex: () => ze,
                tail: () => Tn,
                take: () => On,
                tap: () => Ht,
                template: () => ve,
                templateSettings: () => ce,
                throttle: () => Ae,
                times: () => ne,
                toArray: () => bn,
                toPath: () => Ut,
                transpose: () => In,
                unescape: () => le,
                union: () => Dn,
                uniq: () => Mn,
                unique: () => Mn,
                uniqueId: () => me,
                unzip: () => In,
                values: () => kt,
                where: () => sn,
                without: () => jn,
                wrap: () => Me,
                zip: () => Nn
            });
            var r = '1.13.1',
                i = 'object' == typeof self && self.self === self && self || 'object' == typeof global && global.global === global && global || Function('return this')() || {},
                a = Array.prototype, s = Object.prototype, l = 'undefined' != typeof Symbol ? Symbol.prototype : null,
                c = a.push, u = a.slice, p = s.toString, d = s.hasOwnProperty, f = 'undefined' != typeof ArrayBuffer,
                h = 'undefined' != typeof DataView, v = Array.isArray, g = 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(t, e) {
                return e = null == e ? t.length - 1 : +e, function () {
                    for (var n = Math.max(arguments.length - e, 0), o = Array(n), r = 0; r < n; r++) o[r] = arguments[r + e];
                    switch (e) {
                        case 0:
                            return t.call(this, o);
                        case 1:
                            return t.call(this, arguments[0], o);
                        case 2:
                            return t.call(this, arguments[0], arguments[1], o)
                    }
                    var i = Array(e + 1);
                    for (r = 0; r < e; r++) i[r] = arguments[r];
                    return i[e] = o, t.apply(this, i)
                }
            }

            function O(t) {
                var e = typeof t;
                return 'function' === e || 'object' === e && !!t
            }

            function T(t) {
                return null === t
            }

            function P(t) {
                return void 0 === t
            }

            function E(t) {
                return !0 === t || !1 === t || '[object Boolean]' === p.call(t)
            }

            function k(t) {
                return !(!t || 1 !== t.nodeType)
            }

            function A(t) {
                var e = '[object ' + t + ']';
                return function (t) {
                    return p.call(t) === e
                }
            }

            const j = A('String'), M = A('Number'), D = A('Date'), L = A('RegExp'), I = A('Error'), N = A('Symbol'),
                R = A('ArrayBuffer');
            var V = A('Function'), F = i.document && i.document.childNodes;
            1 && 'object' != typeof Int8Array && 'function' != typeof F && (V = function (t) {
                return 'function' == typeof t || !1
            });
            const H = V, U = A('Object');
            var z = h && U(new DataView(new ArrayBuffer(8))), B = 'undefined' != typeof Map && U(new Map),
                W = A('DataView');
            const $ = z ? function (t) {
                return null != t && H(t.getInt8) && R(t.buffer)
            } : W, q = v || A('Array');

            function G(t, e) {
                return null != t && d.call(t, e)
            }

            var K = A('Arguments');
            !function () {
                K(arguments) || (K = function (t) {
                    return G(t, 'callee')
                })
            }();
            const Y = K;

            function X(t) {
                return !N(t) && _(t) && !isNaN(parseFloat(t))
            }

            function J(t) {
                return M(t) && b(t)
            }

            function Z(t) {
                return function () {
                    return t
                }
            }

            function Q(t) {
                return function (e) {
                    var n = t(e);
                    return 'number' == typeof n && n >= 0 && n <= C
                }
            }

            function tt(t) {
                return function (e) {
                    return null == e ? void 0 : e[t]
                }
            }

            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 (t) {
                return m ? m(t) && !$(t) : nt(t) && ot.test(p.call(t))
            } : Z(!1), it = tt('length');

            function at(t, e) {
                e = function (t) {
                    for (var e = {}, n = t.length, o = 0; o < n; ++o) e[t[o]] = !0;
                    return {
                        contains: function (t) {
                            return e[t]
                        }, push: function (n) {
                            return e[n] = !0, t.push(n)
                        }
                    }
                }(e);
                var n = x.length, o = t.constructor, r = H(o) && o.prototype || s, i = 'constructor';
                for (G(t, i) && !e.contains(i) && e.push(i); n--;) (i = x[n]) in t && t[i] !== r[i] && !e.contains(i) && e.push(i)
            }

            function st(t) {
                if (!O(t)) return [];
                if (g) return g(t);
                var e = [];
                for (var n in t) G(t, n) && e.push(n);
                return w && at(t, e), e
            }

            function lt(t) {
                if (null == t) return !0;
                var e = it(t);
                return 'number' == typeof e && (q(t) || j(t) || Y(t)) ? 0 === e : 0 === it(st(t))
            }

            function ct(t, e) {
                var n = st(e), o = n.length;
                if (null == t) return !o;
                for (var r = Object(t), i = 0; i < o; i++) {
                    var a = n[i];
                    if (e[a] !== r[a] || !(a in r)) return !1
                }
                return !0
            }

            function ut(t) {
                return t instanceof ut ? t : this instanceof ut ? void (this._wrapped = t) : new ut(t)
            }

            function pt(t) {
                return new Uint8Array(t.buffer || t, t.byteOffset || 0, et(t))
            }

            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(t, e, n, o) {
                if (t === e) return 0 !== t || 1 / t == 1 / e;
                if (null == t || null == e) return !1;
                if (t != t) return e != e;
                var r = typeof t;
                return ('function' === r || 'object' === r || 'object' == typeof e) && ht(t, e, n, o)
            }

            function ht(t, e, n, o) {
                t instanceof ut && (t = t._wrapped), e instanceof ut && (e = e._wrapped);
                var r = p.call(t);
                if (r !== p.call(e)) return !1;
                if (z && '[object Object]' == r && $(t)) {
                    if (!$(e)) return !1;
                    r = dt
                }
                switch (r) {
                    case'[object RegExp]':
                    case'[object String]':
                        return '' + t == '' + e;
                    case'[object Number]':
                        return +t != +t ? +e != +e : 0 == +t ? 1 / +t == 1 / e : +t == +e;
                    case'[object Date]':
                    case'[object Boolean]':
                        return +t == +e;
                    case'[object Symbol]':
                        return l.valueOf.call(t) === l.valueOf.call(e);
                    case'[object ArrayBuffer]':
                    case dt:
                        return ht(pt(t), pt(e), n, o)
                }
                var i = '[object Array]' === r;
                if (!i && rt(t)) {
                    if (et(t) !== et(e)) return !1;
                    if (t.buffer === e.buffer && t.byteOffset === e.byteOffset) return !0;
                    i = !0
                }
                if (!i) {
                    if ('object' != typeof t || 'object' != typeof e) return !1;
                    var a = t.constructor, s = e.constructor;
                    if (a !== s && !(H(a) && a instanceof a && H(s) && s instanceof s) && 'constructor' in t && 'constructor' in e) return !1
                }
                o = o || [];
                for (var c = (n = n || []).length; c--;) if (n[c] === t) return o[c] === e;
                if (n.push(t), o.push(e), i) {
                    if ((c = t.length) !== e.length) return !1;
                    for (; c--;) if (!ft(t[c], e[c], n, o)) return !1
                } else {
                    var u, d = st(t);
                    if (c = d.length, st(e).length !== c) return !1;
                    for (; c--;) if (!G(e, u = d[c]) || !ft(t[u], e[u], n, o)) return !1
                }
                return n.pop(), o.pop(), !0
            }

            function vt(t, e) {
                return ft(t, e)
            }

            function gt(t) {
                if (!O(t)) return [];
                var e = [];
                for (var n in t) e.push(n);
                return w && at(t, e), e
            }

            function yt(t) {
                var e = it(t);
                return function (n) {
                    if (null == n) return !1;
                    var o = gt(n);
                    if (it(o)) return !1;
                    for (var r = 0; r < e; r++) if (!H(n[t[r]])) return !1;
                    return t !== Ct || !H(n[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 = B ? yt(xt) : A('Map'), Tt = B ? yt(Ct) : A('WeakMap'), Pt = B ? yt(St) : A('Set'),
                Et = A('WeakSet');

            function kt(t) {
                for (var e = st(t), n = e.length, o = Array(n), r = 0; r < n; r++) o[r] = t[e[r]];
                return o
            }

            function At(t) {
                for (var e = st(t), n = e.length, o = Array(n), r = 0; r < n; r++) o[r] = [e[r], t[e[r]]];
                return o
            }

            function jt(t) {
                for (var e = {}, n = st(t), o = 0, r = n.length; o < r; o++) e[t[n[o]]] = n[o];
                return e
            }

            function Mt(t) {
                var e = [];
                for (var n in t) H(t[n]) && e.push(n);
                return e.sort()
            }

            function Dt(t, e) {
                return function (n) {
                    var o = arguments.length;
                    if (e && (n = Object(n)), o < 2 || null == n) return n;
                    for (var r = 1; r < o; r++) for (var i = arguments[r], a = t(i), s = a.length, l = 0; l < s; l++) {
                        var c = a[l];
                        e && void 0 !== n[c] || (n[c] = i[c])
                    }
                    return n
                }
            }

            const Lt = Dt(gt), It = Dt(st), Nt = Dt(gt, !0);

            function Rt(t) {
                if (!O(t)) return {};
                if (y) return y(t);
                var e = function () {
                };
                e.prototype = t;
                var n = new e;
                return e.prototype = null, n
            }

            function Vt(t, e) {
                var n = Rt(t);
                return e && It(n, e), n
            }

            function Ft(t) {
                return O(t) ? q(t) ? t.slice() : Lt({}, t) : t
            }

            function Ht(t, e) {
                return e(t), t
            }

            function Ut(t) {
                return q(t) ? t : [t]
            }

            function zt(t) {
                return ut.toPath(t)
            }

            function Bt(t, e) {
                for (var n = e.length, o = 0; o < n; o++) {
                    if (null == t) return;
                    t = t[e[o]]
                }
                return n ? t : void 0
            }

            function Wt(t, e, n) {
                var o = Bt(t, zt(e));
                return P(o) ? n : o
            }

            function $t(t, e) {
                for (var n = (e = zt(e)).length, o = 0; o < n; o++) {
                    var r = e[o];
                    if (!G(t, r)) return !1;
                    t = t[r]
                }
                return !!n
            }

            function qt(t) {
                return t
            }

            function Gt(t) {
                return t = It({}, t), function (e) {
                    return ct(e, t)
                }
            }

            function Kt(t) {
                return t = zt(t), function (e) {
                    return Bt(e, t)
                }
            }

            function Yt(t, e, n) {
                if (void 0 === e) return t;
                switch (null == n ? 3 : n) {
                    case 1:
                        return function (n) {
                            return t.call(e, n)
                        };
                    case 3:
                        return function (n, o, r) {
                            return t.call(e, n, o, r)
                        };
                    case 4:
                        return function (n, o, r, i) {
                            return t.call(e, n, o, r, i)
                        }
                }
                return function () {
                    return t.apply(e, arguments)
                }
            }

            function Xt(t, e, n) {
                return null == t ? qt : H(t) ? Yt(t, e, n) : O(t) && !q(t) ? Gt(t) : Kt(t)
            }

            function Jt(t, e) {
                return Xt(t, e, 1 / 0)
            }

            function Zt(t, e, n) {
                return ut.iteratee !== Jt ? ut.iteratee(t, e) : Xt(t, e, n)
            }

            function Qt(t, e, n) {
                e = Zt(e, n);
                for (var o = st(t), r = o.length, i = {}, a = 0; a < r; a++) {
                    var s = o[a];
                    i[s] = e(t[s], s, t)
                }
                return i
            }

            function te() {
            }

            function ee(t) {
                return null == t ? te : function (e) {
                    return Wt(t, e)
                }
            }

            function ne(t, e, n) {
                var o = Array(Math.max(0, t));
                e = Yt(e, n, 1);
                for (var r = 0; r < t; r++) o[r] = e(r);
                return o
            }

            function oe(t, e) {
                return null == e && (e = t, t = 0), t + Math.floor(Math.random() * (e - t + 1))
            }

            ut.toPath = Ut, ut.iteratee = Jt;
            const re = Date.now || function () {
                return (new Date).getTime()
            };

            function ie(t) {
                var e = function (e) {
                    return t[e]
                }, n = '(?:' + st(t).join('|') + ')', o = RegExp(n), r = RegExp(n, 'g');
                return function (t) {
                    return t = null == t ? '' : '' + t, o.test(t) ? t.replace(r, e) : t
                }
            }

            const ae = {'&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#x27;', '`': '&#x60;'},
                se = ie(ae), le = ie(jt(ae)), 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(t) {
                return '\\' + pe[t]
            }

            var he = /^\s*(\w|\$)+\s*$/;

            function ve(t, e, n) {
                !e && n && (e = n), e = Nt({}, e, ut.templateSettings);
                var o = RegExp([(e.escape || ue).source, (e.interpolate || ue).source, (e.evaluate || ue).source].join('|') + '|$', 'g'),
                    r = 0, i = "__p+='";
                t.replace(o, (function (e, n, o, a, s) {
                    return i += t.slice(r, s).replace(de, fe), r = s + e.length, n ? i += "'+\n((__t=(" + n + "))==null?'':_.escape(__t))+\n'" : o ? i += "'+\n((__t=(" + o + "))==null?'':__t)+\n'" : a && (i += "';\n" + a + "\n__p+='"), e
                })), i += "';\n";
                var a, s = e.variable;
                if (s) {
                    if (!he.test(s)) throw new Error('variable is not a bare identifier: ' + s)
                } else i = 'with(obj||{}){\n' + i + '}\n', s = 'obj';
                i = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + i + 'return __p;\n';
                try {
                    a = new Function(s, '_', i)
                } catch (t) {
                    throw t.source = i, t
                }
                var l = function (t) {
                    return a.call(this, t, ut)
                };
                return l.source = 'function(' + s + '){\n' + i + '}', l
            }

            function ge(t, e, n) {
                var o = (e = zt(e)).length;
                if (!o) return H(n) ? n.call(t) : n;
                for (var r = 0; r < o; r++) {
                    var i = null == t ? void 0 : t[e[r]];
                    void 0 === i && (i = n, r = o), t = H(i) ? i.call(t) : i
                }
                return t
            }

            var ye = 0;

            function me(t) {
                var e = ++ye + '';
                return t ? t + e : e
            }

            function be(t) {
                var e = ut(t);
                return e._chain = !0, e
            }

            function _e(t, e, n, o, r) {
                if (!(o instanceof e)) return t.apply(n, r);
                var i = Rt(t.prototype), a = t.apply(i, r);
                return O(a) ? a : i
            }

            var we = S((function (t, e) {
                var n = we.placeholder, o = function () {
                    for (var r = 0, i = e.length, a = Array(i), s = 0; s < i; s++) a[s] = e[s] === n ? arguments[r++] : e[s];
                    for (; r < arguments.length;) a.push(arguments[r++]);
                    return _e(t, o, this, this, a)
                };
                return o
            }));
            we.placeholder = ut;
            const xe = we, Ce = S((function (t, e, n) {
                if (!H(t)) throw new TypeError('Bind must be called on a function');
                var o = S((function (r) {
                    return _e(t, o, e, this, n.concat(r))
                }));
                return o
            })), Se = Q(it);

            function Oe(t, e, n, o) {
                if (o = o || [], e || 0 === e) {
                    if (e <= 0) return o.concat(t)
                } else e = 1 / 0;
                for (var r = o.length, i = 0, a = it(t); i < a; i++) {
                    var s = t[i];
                    if (Se(s) && (q(s) || Y(s))) if (e > 1) Oe(s, e - 1, n, o), r = o.length; else for (var l = 0, c = s.length; l < c;) o[r++] = s[l++]; else n || (o[r++] = s)
                }
                return o
            }

            const Te = S((function (t, e) {
                var n = (e = Oe(e, !1, !1)).length;
                if (n < 1) throw new Error('bindAll must be passed function names');
                for (; n--;) {
                    var o = e[n];
                    t[o] = Ce(t[o], t)
                }
                return t
            }));

            function Pe(t, e) {
                var n = function (o) {
                    var r = n.cache, i = '' + (e ? e.apply(this, arguments) : o);
                    return G(r, i) || (r[i] = t.apply(this, arguments)), r[i]
                };
                return n.cache = {}, n
            }

            const Ee = S((function (t, e, n) {
                return setTimeout((function () {
                    return t.apply(null, n)
                }), e)
            })), ke = xe(Ee, ut, 1);

            function Ae(t, e, n) {
                var o, r, i, a, s = 0;
                n || (n = {});
                var l = function () {
                    s = !1 === n.leading ? 0 : re(), o = null, a = t.apply(r, i), o || (r = i = null)
                }, c = function () {
                    var c = re();
                    s || !1 !== n.leading || (s = c);
                    var u = e - (c - s);
                    return r = this, i = arguments, u <= 0 || u > e ? (o && (clearTimeout(o), o = null), s = c, a = t.apply(r, i), o || (r = i = null)) : o || !1 === n.trailing || (o = setTimeout(l, u)), a
                };
                return c.cancel = function () {
                    clearTimeout(o), s = 0, o = r = i = null
                }, c
            }

            function je(t, e, n) {
                var o, r, i, a, s, l = function () {
                    var c = re() - r;
                    e > c ? o = setTimeout(l, e - c) : (o = null, n || (a = t.apply(s, i)), o || (i = s = null))
                }, c = S((function (c) {
                    return s = this, i = c, r = re(), o || (o = setTimeout(l, e), n && (a = t.apply(s, i))), a
                }));
                return c.cancel = function () {
                    clearTimeout(o), o = i = s = null
                }, c
            }

            function Me(t, e) {
                return xe(e, t)
            }

            function De(t) {
                return function () {
                    return !t.apply(this, arguments)
                }
            }

            function Le() {
                var t = arguments, e = t.length - 1;
                return function () {
                    for (var n = e, o = t[e].apply(this, arguments); n--;) o = t[n].call(this, o);
                    return o
                }
            }

            function Ie(t, e) {
                return function () {
                    if (--t < 1) return e.apply(this, arguments)
                }
            }

            function Ne(t, e) {
                var n;
                return function () {
                    return --t > 0 && (n = e.apply(this, arguments)), t <= 1 && (e = null), n
                }
            }

            const Re = xe(Ne, 2);

            function Ve(t, e, n) {
                e = Zt(e, n);
                for (var o, r = st(t), i = 0, a = r.length; i < a; i++) if (e(t[o = r[i]], o, t)) return o
            }

            function Fe(t) {
                return function (e, n, o) {
                    n = Zt(n, o);
                    for (var r = it(e), i = t > 0 ? 0 : r - 1; i >= 0 && i < r; i += t) if (n(e[i], i, e)) return i;
                    return -1
                }
            }

            const He = Fe(1), Ue = Fe(-1);

            function ze(t, e, n, o) {
                for (var r = (n = Zt(n, o, 1))(e), i = 0, a = it(t); i < a;) {
                    var s = Math.floor((i + a) / 2);
                    n(t[s]) < r ? i = s + 1 : a = s
                }
                return i
            }

            function Be(t, e, n) {
                return function (o, r, i) {
                    var a = 0, s = it(o);
                    if ('number' == typeof i) t > 0 ? a = i >= 0 ? i : Math.max(i + s, a) : s = i >= 0 ? Math.min(i + 1, s) : i + s + 1; else if (n && i && s) return o[i = n(o, r)] === r ? i : -1;
                    if (r != r) return (i = e(u.call(o, a, s), J)) >= 0 ? i + a : -1;
                    for (i = t > 0 ? a : s - 1; i >= 0 && i < s; i += t) if (o[i] === r) return i;
                    return -1
                }
            }

            const We = Be(1, He, ze), $e = Be(-1, Ue);

            function qe(t, e, n) {
                var o = (Se(t) ? He : Ve)(t, e, n);
                if (void 0 !== o && -1 !== o) return t[o]
            }

            function Ge(t, e) {
                return qe(t, Gt(e))
            }

            function Ke(t, e, n) {
                var o, r;
                if (e = Yt(e, n), Se(t)) for (o = 0, r = t.length; o < r; o++) e(t[o], o, t); else {
                    var i = st(t);
                    for (o = 0, r = i.length; o < r; o++) e(t[i[o]], i[o], t)
                }
                return t
            }

            function Ye(t, e, n) {
                e = Zt(e, n);
                for (var o = !Se(t) && st(t), r = (o || t).length, i = Array(r), a = 0; a < r; a++) {
                    var s = o ? o[a] : a;
                    i[a] = e(t[s], s, t)
                }
                return i
            }

            function Xe(t) {
                return function (e, n, o, r) {
                    var i = arguments.length >= 3;
                    return function (e, n, o, r) {
                        var i = !Se(e) && st(e), a = (i || e).length, s = t > 0 ? 0 : a - 1;
                        for (r || (o = e[i ? i[s] : s], s += t); s >= 0 && s < a; s += t) {
                            var l = i ? i[s] : s;
                            o = n(o, e[l], l, e)
                        }
                        return o
                    }(e, Yt(n, r, 4), o, i)
                }
            }

            const Je = Xe(1), Ze = Xe(-1);

            function Qe(t, e, n) {
                var o = [];
                return e = Zt(e, n), Ke(t, (function (t, n, r) {
                    e(t, n, r) && o.push(t)
                })), o
            }

            function tn(t, e, n) {
                return Qe(t, De(Zt(e)), n)
            }

            function en(t, e, n) {
                e = Zt(e, n);
                for (var o = !Se(t) && st(t), r = (o || t).length, i = 0; i < r; i++) {
                    var a = o ? o[i] : i;
                    if (!e(t[a], a, t)) return !1
                }
                return !0
            }

            function nn(t, e, n) {
                e = Zt(e, n);
                for (var o = !Se(t) && st(t), r = (o || t).length, i = 0; i < r; i++) {
                    var a = o ? o[i] : i;
                    if (e(t[a], a, t)) return !0
                }
                return !1
            }

            function on(t, e, n, o) {
                return Se(t) || (t = kt(t)), ('number' != typeof n || o) && (n = 0), We(t, e, n) >= 0
            }

            const rn = S((function (t, e, n) {
                var o, r;
                return H(e) ? r = e : (e = zt(e), o = e.slice(0, -1), e = e[e.length - 1]), Ye(t, (function (t) {
                    var i = r;
                    if (!i) {
                        if (o && o.length && (t = Bt(t, o)), null == t) return;
                        i = t[e]
                    }
                    return null == i ? i : i.apply(t, n)
                }))
            }));

            function an(t, e) {
                return Ye(t, Kt(e))
            }

            function sn(t, e) {
                return Qe(t, Gt(e))
            }

            function ln(t, e, n) {
                var o, r, i = -1 / 0, a = -1 / 0;
                if (null == e || 'number' == typeof e && 'object' != typeof t[0] && null != t) for (var s = 0, l = (t = Se(t) ? t : kt(t)).length; s < l; s++) null != (o = t[s]) && o > i && (i = o); else e = Zt(e, n), Ke(t, (function (t, n, o) {
                    ((r = e(t, n, o)) > a || r === -1 / 0 && i === -1 / 0) && (i = t, a = r)
                }));
                return i
            }

            function cn(t, e, n) {
                var o, r, i = 1 / 0, a = 1 / 0;
                if (null == e || 'number' == typeof e && 'object' != typeof t[0] && null != t) for (var s = 0, l = (t = Se(t) ? t : kt(t)).length; s < l; s++) null != (o = t[s]) && o < i && (i = o); else e = Zt(e, n), Ke(t, (function (t, n, o) {
                    ((r = e(t, n, o)) < a || r === 1 / 0 && i === 1 / 0) && (i = t, a = r)
                }));
                return i
            }

            function un(t, e, n) {
                if (null == e || n) return Se(t) || (t = kt(t)), t[oe(t.length - 1)];
                var o = Se(t) ? Ft(t) : kt(t), r = it(o);
                e = Math.max(Math.min(e, r), 0);
                for (var i = r - 1, a = 0; a < e; a++) {
                    var s = oe(a, i), l = o[a];
                    o[a] = o[s], o[s] = l
                }
                return o.slice(0, e)
            }

            function pn(t) {
                return un(t, 1 / 0)
            }

            function dn(t, e, n) {
                var o = 0;
                return e = Zt(e, n), an(Ye(t, (function (t, n, r) {
                    return {value: t, index: o++, criteria: e(t, n, r)}
                })).sort((function (t, e) {
                    var n = t.criteria, o = e.criteria;
                    if (n !== o) {
                        if (n > o || void 0 === n) return 1;
                        if (n < o || void 0 === o) return -1
                    }
                    return t.index - e.index
                })), 'value')
            }

            function fn(t, e) {
                return function (n, o, r) {
                    var i = e ? [[], []] : {};
                    return o = Zt(o, r), Ke(n, (function (e, r) {
                        var a = o(e, r, n);
                        t(i, e, a)
                    })), i
                }
            }

            const hn = fn((function (t, e, n) {
                G(t, n) ? t[n].push(e) : t[n] = [e]
            })), vn = fn((function (t, e, n) {
                t[n] = e
            })), gn = fn((function (t, e, n) {
                G(t, n) ? t[n]++ : t[n] = 1
            })), yn = fn((function (t, e, n) {
                t[n ? 0 : 1].push(e)
            }), !0);
            var mn = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;

            function bn(t) {
                return t ? q(t) ? u.call(t) : j(t) ? t.match(mn) : Se(t) ? Ye(t, qt) : kt(t) : []
            }

            function _n(t) {
                return null == t ? 0 : Se(t) ? t.length : st(t).length
            }

            function wn(t, e, n) {
                return e in n
            }

            const xn = S((function (t, e) {
                var n = {}, o = e[0];
                if (null == t) return n;
                H(o) ? (e.length > 1 && (o = Yt(o, e[1])), e = gt(t)) : (o = wn, e = Oe(e, !1, !1), t = Object(t));
                for (var r = 0, i = e.length; r < i; r++) {
                    var a = e[r], s = t[a];
                    o(s, a, t) && (n[a] = s)
                }
                return n
            })), Cn = S((function (t, e) {
                var n, o = e[0];
                return H(o) ? (o = De(o), e.length > 1 && (n = e[1])) : (e = Ye(Oe(e, !1, !1), String), o = function (t, n) {
                    return !on(e, n)
                }), xn(t, o, n)
            }));

            function Sn(t, e, n) {
                return u.call(t, 0, Math.max(0, t.length - (null == e || n ? 1 : e)))
            }

            function On(t, e, n) {
                return null == t || t.length < 1 ? null == e || n ? void 0 : [] : null == e || n ? t[0] : Sn(t, t.length - e)
            }

            function Tn(t, e, n) {
                return u.call(t, null == e || n ? 1 : e)
            }

            function Pn(t, e, n) {
                return null == t || t.length < 1 ? null == e || n ? void 0 : [] : null == e || n ? t[t.length - 1] : Tn(t, Math.max(0, t.length - e))
            }

            function En(t) {
                return Qe(t, Boolean)
            }

            function kn(t, e) {
                return Oe(t, e, !1)
            }

            const An = S((function (t, e) {
                return e = Oe(e, !0, !0), Qe(t, (function (t) {
                    return !on(e, t)
                }))
            })), jn = S((function (t, e) {
                return An(t, e)
            }));

            function Mn(t, e, n, o) {
                E(e) || (o = n, n = e, e = !1), null != n && (n = Zt(n, o));
                for (var r = [], i = [], a = 0, s = it(t); a < s; a++) {
                    var l = t[a], c = n ? n(l, a, t) : l;
                    e && !n ? (a && i === c || r.push(l), i = c) : n ? on(i, c) || (i.push(c), r.push(l)) : on(r, l) || r.push(l)
                }
                return r
            }

            const Dn = S((function (t) {
                return Mn(Oe(t, !0, !0))
            }));

            function Ln(t) {
                for (var e = [], n = arguments.length, o = 0, r = it(t); o < r; o++) {
                    var i = t[o];
                    if (!on(e, i)) {
                        var a;
                        for (a = 1; a < n && on(arguments[a], i); a++) ;
                        a === n && e.push(i)
                    }
                }
                return e
            }

            function In(t) {
                for (var e = t && ln(t, it).length || 0, n = Array(e), o = 0; o < e; o++) n[o] = an(t, o);
                return n
            }

            const Nn = S(In);

            function Rn(t, e) {
                for (var n = {}, o = 0, r = it(t); o < r; o++) e ? n[t[o]] = e[o] : n[t[o][0]] = t[o][1];
                return n
            }

            function Vn(t, e, n) {
                null == e && (e = t || 0, t = 0), n || (n = e < t ? -1 : 1);
                for (var o = Math.max(Math.ceil((e - t) / n), 0), r = Array(o), i = 0; i < o; i++, t += n) r[i] = t;
                return r
            }

            function Fn(t, e) {
                if (null == e || e < 1) return [];
                for (var n = [], o = 0, r = t.length; o < r;) n.push(u.call(t, o, o += e));
                return n
            }

            function Hn(t, e) {
                return t._chain ? ut(e).chain() : e
            }

            function Un(t) {
                return Ke(Mt(t), (function (e) {
                    var n = ut[e] = t[e];
                    ut.prototype[e] = function () {
                        var t = [this._wrapped];
                        return c.apply(t, arguments), Hn(this, n.apply(ut, t))
                    }
                })), ut
            }

            Ke(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], (function (t) {
                var e = a[t];
                ut.prototype[t] = function () {
                    var n = this._wrapped;
                    return null != n && (e.apply(n, arguments), 'shift' !== t && 'splice' !== t || 0 !== n.length || delete n[0]), Hn(this, n)
                }
            })), Ke(['concat', 'join', 'slice'], (function (t) {
                var e = a[t];
                ut.prototype[t] = function () {
                    var t = this._wrapped;
                    return null != t && (t = e.apply(t, arguments)), Hn(this, t)
                }
            }));
            const zn = ut;
            var Bn = Un(o);
            Bn._ = Bn;
            const Wn = Bn
        }
    }, e = {};

    function n(o) {
        var r = e[o];
        if (void 0 !== r) return r.exports;
        var i = e[o] = {exports: {}};
        return t[o].call(i.exports, i, i.exports, n), i.exports
    }

    n.n = t => {
        var e = t && t.__esModule ? () => t['default'] : () => t;
        return n.d(e, {a: e}), e
    }, n.d = (t, e) => {
        for (var o in e) n.o(e, o) && !n.o(t, o) && Object.defineProperty(t, o, {enumerable: !0, get: e[o]})
    }, n.g = function () {
        if ('object' == typeof globalThis) return globalThis;
        try {
            return this || new Function('return this')()
        } catch (t) {
            if ('object' == typeof window) return window
        }
    }(), n.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e), n.r = t => {
        'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {value: 'Module'}), Object.defineProperty(t, '__esModule', {value: !0})
    };
    var o = {};
    return (() => {
        "use strict";
        n.d(o, {default: () => am});
        var t = n(5706), e = n(1166);

        function r(t) {
            for (var n = [], o = 1; o < arguments.length; o++) n[o - 1] = arguments[o];
            var r = t.raw;
            return r.reduce((function (t, o, i) {
                var a = n[i - 1], s = r[i - 1];
                return Array.isArray(a) ? a = a.join('') : s && '$' === s.slice(-1) ? t = t.slice(0, -1) : a = (0, e.escape)(a), t + a + o
            }))
        }

        const i = function () {
            return {
                stylePrefix: 'gjs-',
                components: '',
                style: '',
                fromElement: !1,
                projectData: void 0,
                noticeOnUnload: !0,
                showOffsets: !1,
                showOffsetsSelected: !1,
                forceClass: !0,
                height: '900px',
                width: '100%',
                log: ['warning', 'error'],
                baseCss: '',
                protectedCss: '* { box-sizing: border-box; } body {margin: 0;}',
                canvasCss: '',
                defaultCommand: 'select-comp',
                showToolbar: !0,
                showDevices: !0,
                devicePreviewMode: !1,
                mediaCondition: 'max-width',
                tagVarStart: '{[ ',
                tagVarEnd: ' ]}',
                keepEmptyTextNodes: !1,
                jsInHtml: !0,
                nativeDnD: !0,
                multipleSelection: !0,
                optsHtml: {},
                optsCss: {},
                avoidInlineStyle: !0,
                avoidDefaults: !0,
                clearStyles: !1,
                listenToEl: [],
                cssIcons: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css',
                icons: {
                    close: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',
                    move: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"/></svg>',
                    plus: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /></svg>',
                    caret: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7,10L12,15L17,10H7Z" /></svg>',
                    delete: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /></svg>',
                    copy: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" /></svg>',
                    arrowUp: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z" /></svg>',
                    chevron: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z" /></svg>',
                    eye: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" /></svg>',
                    eyeOff: '<svg viewBox="0 0 24 24"><path fill="currentColor" d="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z" /></svg>'
                },
                i18n: {},
                undoManager: {},
                assetManager: {},
                canvas: {},
                layerManager: {},
                storageManager: {},
                richTextEditor: {},
                domComponents: {},
                modal: {},
                codeManager: {},
                panels: {},
                commands: {},
                cssComposer: {},
                selectorManager: {},
                deviceManager: {},
                styleManager: {},
                blockManager: {},
                traitManager: {},
                textViewCode: 'Code',
                keepUnusedStyles: !1,
                customUI: !1,
                telemetry: !0
            }
        };
        var a = n(4193), s = n.n(a), l = n(7774);
        var c, u = n(9156), p = void 0 && (void 0).__extends || (c = function (t, e) {
            return c = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                t.__proto__ = e
            } || function (t, e) {
                for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
            }, c(t, e)
        }, function (t, e) {
            if ("function" != typeof e && null !== e) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");

            function n() {
                this.constructor = t
            }

            c(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n)
        }), d = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return p(e, t), e
        }(u.Kx);
        const f = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return p(n, e), n.prototype.getByComponent = function (t) {
                var e = this;
                return this.filter((function (n) {
                    return e.getComponent(n) === t
                }))[0]
            }, n.prototype.addComponent = function (e, n) {
                var o = this, r = ((0, t.isArray)(e) ? e : [e]).filter((function (t) {
                    return !o.hasComponent(t)
                })).map((function (t) {
                    return new d({component: t})
                }))[0];
                return this.push(r, n)
            }, n.prototype.getComponent = function (t) {
                return t.get('component')
            }, n.prototype.hasComponent = function (t) {
                var e = this.getByComponent(t);
                return e && this.contains(e)
            }, n.prototype.lastComponent = function () {
                var t = this.last();
                return t ? this.getComponent(t) : void 0
            }, n.prototype.allComponents = function () {
                var t = this;
                return this.map((function (e) {
                    return t.getComponent(e)
                })).filter((function (t) {
                    return t
                }))
            }, n.prototype.removeComponent = function (e, n) {
                var o = this, r = ((0, t.isArray)(e) ? e : [e]).map((function (t) {
                    return o.getByComponent(t)
                }));
                return this.remove(r, n)
            }, n
        }(u.pM);
        var h = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), v = void 0 && (void 0).__assign || function () {
            return v = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, v.apply(this, arguments)
        }, g = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, y = function () {
            function n(n, o, r) {
                this.debounced = [], this.collections = [], this.cls = [], this.events = {}, this._em = n, this._name = o;
                var i = this.name.charAt(0).toLowerCase() + this.name.slice(1),
                    a = (0, t.isUndefined)(n.config[i]) ? n.config[this.name] : n.config[i],
                    s = !0 === a ? {} : a || {};
                s.pStylePrefix = n.config.pStylePrefix || '', (0, t.isUndefined)(a) || a || (s._disable = 1), s.em = n, this._config = (0, e.deepMerge)(r || {}, s)
            }

            return Object.defineProperty(n.prototype, "em", {
                get: function () {
                    return this._em
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "config", {
                get: function () {
                    return this._config
                }, enumerable: !1, configurable: !0
            }), n.prototype.render = function (t) {
            }, n.prototype.postLoad = function (t) {
            }, n.prototype.onInit = function () {
            }, Object.defineProperty(n.prototype, "name", {
                get: function () {
                    return this._name
                }, enumerable: !1, configurable: !0
            }), n.prototype.getConfig = function (t) {
                return t ? this.config[t] : this.config
            }, n.prototype.__logWarn = function (t, e) {
                void 0 === e && (e = {}), this.em.logWarning("[".concat(this.name, "]: ").concat(t), e)
            }, n.prototype.destroy = function () {
                this.__destroy()
            }, n.prototype.__destroy = function () {
                var t, e, n;
                null === (t = this.view) || void 0 === t || t.remove(), null === (e = this.state) || void 0 === e || e.stopListening(), null === (n = this.state) || void 0 === n || n.clear(), this.debounced.forEach((function (t) {
                    return t.cancel()
                })), this.collections.forEach((function (t) {
                    t.stopListening(), t.reset()
                }))
            }, n.prototype.__appendTo = function () {
                var e = this.getConfig().appendTo;
                if (e) {
                    var n = (0, t.isElement)(e) ? e : document.querySelector(e);
                    if (!n) return this.__logWarn('"appendTo" element not found');
                    n.appendChild(this.render())
                }
            }, n
        }();
        const m = y;
        var b = function (n) {
            function o(t, e, o, r, i, a) {
                void 0 === a && (a = {});
                var s = n.call(this, t, e, i) || this;
                return s.cls = [], s.private = !1, s.all = o, r && (s.events = r), !a.skipListen && s.__initListen(), s
            }

            return h(o, n), o.prototype.postLoad = function (t) {
            }, o.prototype.render = function (t) {
            }, o.prototype.getProjectData = function (t) {
                var e = {}, n = this.storageKey;
                return n && (e[n] = t || this.getAll()), e
            }, o.prototype.loadProjectData = function (t, n) {
                void 0 === t && (t = {}), void 0 === n && (n = {});
                var o = n.all, r = n.onResult, i = n.reset, a = this.storageKey, s = {action: 'load'},
                    l = o || this.all, c = t[a];
                if ('string' == typeof c) try {
                    c = JSON.parse(c)
                } catch (t) {
                    this.__logWarn('Data parsing failed', {input: c})
                }
                return i && c && l.reset(void 0, s), r ? c && r(c, s) : c && (0, e.isDef)(c.length) && l.reset(c, s), c
            }, o.prototype.clear = function (t) {
                void 0 === t && (t = {});
                var e = this.all;
                return e && e.reset(void 0, t), this
            }, o.prototype.getAll = function () {
                return g([], this.all.models, !0)
            }, o.prototype.getAllMap = function () {
                return this.getAll().reduce((function (t, e) {
                    return t[e.get(e.idAttribute)] = e, t
                }), {})
            }, o.prototype.__initListen = function (t) {
                void 0 === t && (t = {});
                var e = this, n = e.all, o = e.em, r = e.events;
                n && o && n.on('add', (function (t, e, n) {
                    return o.trigger(r.add, t, n)
                })).on('remove', (function (t, e, n) {
                    return o.trigger(r.remove, t, n)
                })).on('change', (function (t, e) {
                    return o.trigger(r.update, t, t.changedAttributes(), e)
                })).on('all', this.__catchAllEvent, this), this.cls = [n].concat(t.collections || []), (t.propagate || []).forEach((function (t) {
                    var e = t.entity, r = t.event;
                    e.on('all', (function (t, e, i, a) {
                        var s = v({event: t}, a || i);
                        [o, n].map((function (t) {
                            return t.trigger(r, e, s)
                        }))
                    }))
                }))
            }, o.prototype.__remove = function (e, n) {
                var o = this;
                void 0 === n && (n = {});
                var r = this.em, i = (0, t.isString)(e) ? this.get(e) : e, a = function () {
                    return i && o.all.remove(i, n), i
                };
                return !n.silent && (null == r || r.trigger(this.events.removeBefore, i, a, n)), !n.abort && a()
            }, o.prototype.__catchAllEvent = function (t, e, n, o) {
                var r = this.em, i = this.events, a = o || n;
                r && i.all && r.trigger(i.all, {event: t, model: e, options: a}), this.__onAllEvent()
            }, o.prototype.__appendTo = function (e) {
                var n = this.config.appendTo;
                if (n) {
                    var o = (0, t.isElement)(n) ? n : document.querySelector(n);
                    if (!o) return this.__logWarn('"appendTo" element not found');
                    o.appendChild(this.render(e))
                }
            }, o.prototype.__onAllEvent = function () {
            }, o.prototype._createId = function (t) {
                void 0 === t && (t = 16);
                var n, o = this.getAll().length + t, r = this.getAllMap();
                do {
                    n = (0, e.createId)(o)
                } while (r[n]);
                return n
            }, o.prototype.__listenAdd = function (t, e) {
                var n = this;
                t.on('add', (function (t, o, r) {
                    return n.em.trigger(e, t, r)
                }))
            }, o.prototype.__listenRemove = function (t, e) {
                var n = this;
                t.on('remove', (function (t, o, r) {
                    return n.em.trigger(e, t, r)
                }))
            }, o.prototype.__listenUpdate = function (t, e) {
                var n = this;
                t.on('change', (function (t, o) {
                    return n.em.trigger(e, t, t.changedAttributes(), o)
                }))
            }, o.prototype.__destroy = function () {
                var t;
                this.cls.forEach((function (t) {
                    t.stopListening(), t.reset()
                })), null === (t = this.view) || void 0 === t || t.remove(), this.view = void 0
            }, o
        }(y);
        const _ = function () {
            return {
                stylePrefix: 'cv-',
                scripts: [],
                styles: [],
                customBadgeLabel: void 0,
                autoscrollLimit: 50,
                extHl: !1,
                frameContent: '<!DOCTYPE html>',
                frameStyle: window.GrapesJsCSS + "\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]'],
                allowExternalDrop: !0
            }
        };
        var w, x = n(7058);
        !function (t) {
            t["add"] = "device:add", t["addBefore"] = "device:add:before", t["remove"] = "device:remove", t["removeBefore"] = "device:remove:before", t["select"] = "device:select", t["selectBefore"] = "device:select:before", t["update"] = "device:update", t["all"] = "device"
        }(w || (w = {}));
        const C = w;
        var S;
        !function (t) {
            t["add"] = "page:add", t["addBefore"] = "page:add:before", t["remove"] = "page:remove", t["removeBefore"] = "page:remove:before", t["select"] = "page:select", t["selectBefore"] = "page:select:before", t["update"] = "page:update", t["all"] = "page"
        }(S || (S = {}));
        const O = S;
        var T = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), P = function (e) {
            function n(t, n, o) {
                return e.call(this, n, {module: t, modelConstructor: o}) || this
            }

            return T(n, e), n.prototype.add = function (n, o) {
                var r, i = this, a = (0, t.isArray)(n) ? n : (0, t.isUndefined)(n) ? void 0 : [n];
                return a = null !== (r = null == a ? void 0 : a.map((function (t) {
                    return t instanceof i.newModel ? t : new i.newModel(i.module, t)
                }))) && void 0 !== r ? r : [void 0], e.prototype.add.call(this, (0, t.isArray)(n) ? a : a[0], o)
            }, n.prototype.preinitialize = function (t, e) {
                this.newModel = e.modelConstructor, this.module = e.module
            }, n
        }(u.pM);
        const E = P;
        var k;
        !function (t) {
            t["dragEnter"] = "canvas:dragenter", t["dragOver"] = "canvas:dragover", t["dragEnd"] = "canvas:dragend", t["dragData"] = "canvas:dragdata", t["drop"] = "canvas:drop", t["spot"] = "canvas:spot", t["spotAdd"] = "canvas:spot:add", t["spotUpdate"] = "canvas:spot:update", t["spotRemove"] = "canvas:spot:remove", t["coords"] = "canvas:coords", t["zoom"] = "canvas:zoom", t["pointer"] = "canvas:pointer", t["refresh"] = "canvas:refresh", t["frameLoad"] = "canvas:frame:load", t["frameLoadHead"] = "canvas:frame:load:head", t["frameLoadBody"] = "canvas:frame:load:body", t["frameUnload"] = "canvas:frame:unload"
        }(k || (k = {}));
        const A = k;
        var j = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), M = void 0 && (void 0).__assign || function () {
            return M = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, M.apply(this, arguments)
        }, D = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, L = '__aw', I = '__ah', N = function (e, n) {
            var o, r = e.get(n),
                i = null === (o = e.view) || void 0 === o ? void 0 : o.el['width' === n ? 'offsetWidth' : 'offsetHeight'];
            return (0, t.isNumber)(r) ? r : (0, t.isString)(r) && r.endsWith('px') ? parseFloat(r) : i || 0
        }, R = function (n) {
            function o(o, r) {
                var i = n.call(this, o, r) || this, a = i.em, s = i.attributes, l = s.styles, c = s.component,
                    u = a.Components, p = u.getConfig(), d = a.Css.getAll(), f = {},
                    h = {em: a, config: p, frame: i, idMap: f};
                if (!(0, e.isComponent)(c)) {
                    var v = (0, e.isObject)(c) ? c : {components: c};
                    !v.type && (v.type = 'wrapper');
                    var g = u.getType('wrapper').model;
                    i.set('component', new g(v, h))
                }
                if (l) {
                    if (!(0, e.isObject)(l)) {
                        var y = l;
                        (0, t.keys)(f).length && (y = (0, t.isString)(y) ? a.Parser.parseCss(y) : y, a.Css.checkId(y, {idMap: f})), d.add(y), i.set('styles', d)
                    }
                } else i.set('styles', d);
                return !r.width && i.set(L, 1), !r.height && i.set(I, 1), !i.id && i.set('id', (0, e.createId)()), i
            }

            return j(o, n), o.prototype.defaults = function () {
                return {
                    x: 0,
                    y: 0,
                    changesCount: 0,
                    attributes: {},
                    width: null,
                    height: null,
                    head: [],
                    component: '',
                    styles: '',
                    refFrame: null,
                    _undo: !0,
                    _undoexc: ['changesCount']
                }
            }, Object.defineProperty(o.prototype, "width", {
                get: function () {
                    return N(this, 'width')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "height", {
                get: function () {
                    return N(this, 'height')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "head", {
                get: function () {
                    return this.get('head')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "refFrame", {
                get: function () {
                    return this.get('refFrame')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "root", {
                get: function () {
                    var t = this.refFrame;
                    return (null == t ? void 0 : t.getComponent()) || this.getComponent()
                }, enumerable: !1, configurable: !0
            }), o.prototype.initRefs = function () {
                var e = this.refFrame;
                if ((0, t.isString)(e)) {
                    var n = this.module.framesById[e];
                    n && this.set({refFrame: n}, {silent: !0})
                }
            }, o.prototype.getBoxRect = function () {
                var t = this.attributes;
                return {x: t.x, y: t.y, width: this.width, height: this.height}
            }, o.prototype.onRemove = function () {
                !this.refFrame && this.getComponent().remove({root: 1})
            }, o.prototype.changesUp = function (t) {
                void 0 === t && (t = {}), t.temporary || t.noCount || t.avoidStore || this.set('changesCount', this.get('changesCount') + 1)
            }, o.prototype.getComponent = function () {
                return this.get('component')
            }, o.prototype.getStyles = function () {
                return this.get('styles')
            }, o.prototype.disable = function () {
                this.trigger('disable')
            }, o.prototype.remove = function () {
                var t;
                null === (t = this.view) || void 0 === t || t.remove(), this.view = void 0;
                var e = this.collection;
                return e && e.remove(this)
            }, o.prototype.getHead = function () {
                return D([], this.head, !0)
            }, o.prototype.setHead = function (t) {
                return this.set('head', D([], t, !0))
            }, o.prototype.addHeadItem = function (t) {
                this.head.push(t)
            }, o.prototype.getHeadByAttr = function (t, e, n) {
                return this.head.filter((function (o) {
                    return o.attributes && o.attributes[t] == e && (!n || n === o.tag)
                }))[0]
            }, o.prototype.removeHeadByAttr = function (t, e, n) {
                var o = this.getHeadByAttr(t, e, n), r = this.head.indexOf(o);
                r >= 0 && this.head.splice(r, 1)
            }, o.prototype.addLink = function (t) {
                var e = 'link';
                !this.getHeadByAttr('href', t, e) && this.addHeadItem({
                    tag: e,
                    attributes: {href: t, rel: 'stylesheet'}
                })
            }, o.prototype.removeLink = function (t) {
                this.removeHeadByAttr('href', t, 'link')
            }, o.prototype.addScript = function (t) {
                var e = 'script';
                !this.getHeadByAttr('src', t, e) && this.addHeadItem({tag: e, attributes: {src: t}})
            }, o.prototype.removeScript = function (t) {
                this.removeHeadByAttr('src', t, 'script')
            }, o.prototype.getPage = function () {
                var t;
                return null === (t = this.collection) || void 0 === t ? void 0 : t.page
            }, o.prototype._emitUpdated = function (t) {
                void 0 === t && (t = {}), this.em.trigger('frame:updated', M({frame: this}, t))
            }, o.prototype._emitUnload = function () {
                this._emitWithEditor(A.frameUnload, {frame: this})
            }, o.prototype._emitWithEditor = function (t, e) {
                [this.em, this].forEach((function (n) {
                    return null == n ? void 0 : n.trigger(t, e)
                }))
            }, o.prototype.hasAutoHeight = function () {
                return !('auto' !== this.attributes.height && !this.config.infiniteCanvas)
            }, o.prototype.toJSON = function (e) {
                void 0 === e && (e = {});
                var n = x.A.prototype.toJSON.call(this, e), o = (0, t.result)(this, 'defaults');
                return e.fromUndo && delete n.component, delete n.styles, delete n.changesCount, n[L] && delete n.width, n[I] && delete n.height, n.refFrame && (n.refFrame = n.refFrame.id, delete n.component), (0, t.forEach)(n, (function (t, e) {
                    0 === e.indexOf('_') && delete n[e]
                })), (0, t.forEach)(o, (function (t, e) {
                    n[e] === t && delete n[e]
                })), (0, t.forEach)(['attributes', 'head'], (function (e) {
                    (0, t.isEmpty)(n[e]) && delete n[e]
                })), n
            }, o
        }(x.A);
        const V = R;
        var F = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const H = function (e) {
            function n(n, o) {
                void 0 === o && (o = []);
                var r = e.call(this, n, o, V) || this;
                return r.loadedItems = 0, r.itemsToLoad = 0, (0, t.bindAll)(r, 'itemLoaded'), r.on('add', r.onAdd), r.on('reset', r.onReset), r.on('remove', r.onRemove), r.forEach((function (t) {
                    return r.onAdd(t)
                })), r
            }

            return F(n, e), n.prototype.onAdd = function (t) {
                this.module.framesById[t.id] = t
            }, n.prototype.onReset = function (t, e) {
                var n = this;
                ((null == e ? void 0 : e.previousModels) || []).map((function (t) {
                    return n.onRemove(t)
                }))
            }, n.prototype.onRemove = function (t) {
                t.onRemove(), delete this.module.framesById[t.id]
            }, n.prototype.initRefs = function () {
                this.forEach((function (t) {
                    return t.initRefs()
                }))
            }, n.prototype.itemLoaded = function () {
                this.loadedItems++, this.loadedItems >= this.itemsToLoad && (this.trigger('loaded:all'), this.listenToLoadItems(!1))
            }, n.prototype.listenToLoad = function () {
                this.loadedItems = 0, this.itemsToLoad = this.length, this.listenToLoadItems(!0)
            }, n.prototype.listenToLoadItems = function (t) {
                var e = this;
                this.forEach((function (n) {
                    return n[t ? 'on' : 'off']('loaded', e.itemLoaded)
                }))
            }, n
        }(E);
        var U = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), z = function (t) {
            function e(e) {
                var n = this, o = e.em, r = e.config, i = r.scripts, a = r.styles;
                return (n = t.call(this, e, {
                    scripts: i,
                    styles: a
                }) || this).set('frames', new H(e)), n.on('change:zoom', n.onZoomChange), n.on('change:x change:y', n.onCoordsChange), n.on('change:pointer change:pointerScreen', n.onPointerChange), n.listenTo(o, "change:device ".concat(C.update), n.updateDevice), n.listenTo(o, O.select, n._pageUpdated), n
            }

            return U(e, t), e.prototype.defaults = function () {
                return {
                    frame: '',
                    frames: [],
                    rulers: !1,
                    zoom: 100,
                    x: 0,
                    y: 0,
                    scripts: [],
                    styles: [],
                    pointer: u.lK,
                    pointerScreen: u.lK
                }
            }, Object.defineProperty(e.prototype, "frames", {
                get: function () {
                    return this.get('frames')
                }, enumerable: !1, configurable: !0
            }), e.prototype.init = function () {
                var t = this.em.Pages._initPage();
                this.set('frames', t.getFrames()), this.updateDevice({frame: t.getMainFrame()})
            }, e.prototype._pageUpdated = function (t, e) {
                var n = this.em;
                n.setSelected(), n.get('readyCanvas') && n.stopDefault(), null == e || e.getFrames().map((function (t) {
                    t.disable(), t._emitUnload()
                })), this.set('frames', t.getFrames()), this.updateDevice({frame: t.getMainFrame()})
            }, e.prototype.updateDevice = function (t) {
                void 0 === t && (t = {});
                var e = this.em, n = e.getDeviceModel(), o = t.frame || e.getCurrentFrameModel();
                if (o && n) {
                    var r = n.attributes, i = r.width, a = r.height, s = r.minHeight;
                    o.set({width: i, height: a, minHeight: s}, {noUndo: 1})
                }
            }, e.prototype.onZoomChange = function (t, e, n) {
                var o = this.em, r = this.module;
                this.get('zoom') < 1 && this.set('zoom', 1), o.trigger(r.events.zoom, {options: n})
            }, e.prototype.onCoordsChange = function () {
                var t = this.em, e = this.module;
                t.trigger(e.events.coords)
            }, e.prototype.onPointerChange = function () {
                var t = this.em, e = this.module;
                t.trigger(e.events.pointer)
            }, e.prototype.getPointerCoords = function (t) {
                void 0 === t && (t = u.x2.World);
                var e = this.attributes, n = e.pointer, o = e.pointerScreen;
                return t === u.x2.World ? n : o
            }, e
        }(x.A);
        const B = z;
        var W = n(179), $ = n(2225), q = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), G = function (e) {
            function n(n, o) {
                void 0 === o && (o = []);
                var r = e.call(this, n, o, W.A) || this;
                r.on('add', r.onAdd), r.on('change', r.onChange), r.on('remove', r.onRemove);
                var i = r.em;
                r.refreshDbn = (0, t.debounce)((function () {
                    return r.refresh()
                }), 0);
                var a = "".concat($.I.resize, " styleable:change ").concat($.I.input, " ").concat($.I.update, " frame:updated undo redo");
                return r.listenTo(i, a, (function () {
                    return r.refreshDbn()
                })), r
            }

            return q(n, e), Object.defineProperty(n.prototype, "em", {
                get: function () {
                    return this.module.em
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "events", {
                get: function () {
                    return this.module.events
                }, enumerable: !1, configurable: !0
            }), n.prototype.refresh = function () {
                var t = this.em, e = this.events;
                t.trigger(e.spot)
            }, n.prototype.onAdd = function (t) {
                this.__trgEvent(this.events.spotAdd, {spot: t})
            }, n.prototype.onChange = function (t) {
                this.__trgEvent(this.events.spotUpdate, {spot: t})
            }, n.prototype.onRemove = function (t) {
                this.__trgEvent(this.events.spotRemove, {spot: t})
            }, n.prototype.__trgEvent = function (t, e) {
                this.module.em.trigger(t, e), this.refreshDbn()
            }, n
        }(E);
        const K = G;
        var Y = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), X = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Y(e, t), Object.defineProperty(e.prototype, "pfx", {
                get: function () {
                    return this.ppfx + this.config.stylePrefix || ''
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "ppfx", {
                get: function () {
                    return this.em.config.stylePrefix || ''
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "module", {
                get: function () {
                    var t, e;
                    return null !== (e = null === (t = this.model) || void 0 === t ? void 0 : t.module) && void 0 !== e ? e : this.collection.module
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "em", {
                get: function () {
                    return this.module.em
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "config", {
                get: function () {
                    return this.module.config
                }, enumerable: !1, configurable: !0
            }), e.prototype.preinitialize = function (t) {
                this.className = ''
            }, e
        }(u.Ss);
        const J = X;
        var Z = n(6294), Q = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const tt = function (t) {
            function e(e, n) {
                void 0 === e && (e = {}), void 0 === n && (n = !1);
                var o = t.call(this, e) || this;
                return o.itemsView = '', o.itemType = 'type', o.reuseView = !1, o.viewCollection = [], n && o.listenTo(o.collection, 'add', o.addTo), o
            }

            return Q(e, t), e.prototype.addTo = function (t) {
                this.add(t)
            }, e.prototype.itemViewNotFound = function (t) {
            }, e.prototype.add = function (t, e) {
                var n, o = this.reuseView, r = this.viewCollection, i = e || null, a = t.get(this.itemType);
                n = t.view && o ? t.view : this.renderView(t, a), r.push(n);
                var s = n.render().el;
                i ? i.appendChild(s) : this.$el.append(s)
            }, e.prototype.render = function () {
                var t = this, e = document.createDocumentFragment();
                return this.clearItems(), this.$el.empty(), this.collection.length && this.collection.each((function (n) {
                    return t.add(n, e)
                })), this.$el.append(e), this.onRender(), this
            }, e.prototype.onRender = function () {
            }, e.prototype.onRemoveBefore = function (t, e) {
            }, e.prototype.onRemove = function (t, e) {
            }, e.prototype.remove = function (t) {
                void 0 === t && (t = {});
                var e = this.viewCollection;
                return this.onRemoveBefore(e, t), this.clearItems(), u.Ss.prototype.remove.apply(this, t), this.onRemove(e, t), this
            }, e.prototype.clearItems = function () {
                this.viewCollection
            }, e
        }(J);
        var et;
        !function (t) {
            t["mount"] = "css:mount", t["mountBefore"] = "css:mount:before"
        }(et || (et = {}));
        var nt = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ot = function (t) {
            function e(e) {
                void 0 === e && (e = {});
                var n = t.call(this, e) || this;
                n.config = e.config || {};
                var o = n.model;
                return n.listenTo(o, 'change', n.render), n.listenTo(o, 'destroy remove', n.remove), n.listenTo(o.get('selectors'), 'change', n.render), o.setView(n), n
            }

            return nt(e, t), Object.defineProperty(e.prototype, "frameView", {
                get: function () {
                    return this.config.frameView
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "em", {
                get: function () {
                    return this.model.em
                }, enumerable: !1, configurable: !0
            }), e.prototype.remove = function () {
                return t.prototype.remove.call(this), this.model.removeView(this), this
            }, e.prototype.updateStyles = function () {
                this.render()
            }, e.prototype.tagName = function () {
                return 'style'
            }, e.prototype.render = function () {
                var t = this, e = t.model, n = t.el, o = t.em, r = e.get('important'), i = e.toCSS({important: r}),
                    a = {rule: e, ruleView: this, css: i};
                return null == o || o.trigger(et.mountBefore, a), n.innerHTML = a.css, null == o || o.trigger(et.mount, a), this
            }, e
        }(u.Ss);
        const rt = ot;
        var it = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const at = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return it(e, t), e.prototype._createElement = function () {
                return document.createTextNode('')
            }, e.prototype.render = function () {
                var t = this.model, e = t.get('important');
                return this.el.textContent = t.getDeclaration({important: e}), this
            }, e
        }(rt);
        var st = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), lt = function (t, e) {
            return "".concat(t).concat(e ? "-".concat(parseFloat(e)) : '')
        }, ct = function (e) {
            function n(n) {
                var o = e.call(this, n) || this;
                (0, t.bindAll)(o, 'sortRules');
                var r = n.config || {};
                o.atRules = {}, o.config = r, o.em = r.em, o.pfx = r.stylePrefix || '', o.className = o.pfx + 'rules';
                var i = o.collection;
                return o.listenTo(i, 'add', o.addTo), o.listenTo(i, 'reset', o.render), o
            }

            return st(n, e), n.prototype.addTo = function (t) {
                this.addToCollection(t)
            }, n.prototype.addToCollection = function (t, e) {
                if (this.renderStarted) {
                    var n, o, r = e || null, i = {model: t, config: this.config};
                    if ('keyframes' === t.get('atRuleType')) {
                        var a = t.getAtRule(), s = this.atRules[a];
                        if (!s) {
                            var l = document.createElement('style');
                            s = document.createTextNode(''), l.appendChild(document.createTextNode("".concat(a, "{"))), l.appendChild(s), l.appendChild(document.createTextNode('}')), this.atRules[a] = s, n = l
                        }
                        o = new at(i), s.appendData(o.render().el.textContent)
                    } else n = (o = new rt(i)).render().el;
                    var c = this.className, u = t.get('mediaText'), p = lt(c), d = p;
                    if (u && (d = lt(c, this.getMediaWidth(u))), n) {
                        var f = r || this.el, h = void 0;
                        try {
                            h = f.querySelector("#".concat(d))
                        } catch (t) {
                        }
                        h || (h = f.querySelector("#".concat(p))), null == h || h.appendChild(n)
                    }
                    return n
                }
            }, n.prototype.getMediaWidth = function (t) {
                return t && t.replace("(".concat(this.em.getConfig().mediaCondition, ": "), '').replace(')', '')
            }, n.prototype.sortRules = function (t, e) {
                var n = -1 !== (this.em.getConfig().mediaCondition || '').indexOf('min-width');
                return n ? (n ? t : e) - (n ? e : t) : 0
            }, n.prototype.render = function () {
                var t = this;
                this.renderStarted = !0, this.atRules = {};
                var e = this, n = e.em, o = e.$el, r = e.collection, i = this.className,
                    a = document.createDocumentFragment();
                o.empty();
                var s = n.Devices.getAll().pluck('priority').sort(this.sortRules);
                return s.every((function (t) {
                    return t
                })) && s.unshift(0), s.forEach((function (t) {
                    return a.appendChild((0, Z.a_)('div', {id: lt(i, t)}))
                })), r.each((function (e) {
                    return t.addToCollection(e, a)
                })), o.append(a), o.attr('class', i), this
            }, n
        }(u.Ss);
        const ut = ct;
        var pt = 'text/html', dt = pt;
        var ft;
        !function (t) {
            t["html"] = "parse:html", t["htmlRoot"] = "parse:html:root", t["htmlBefore"] = "parse:html:before", t["css"] = "parse:css", t["cssBefore"] = "parse:css:before", t["all"] = "parse"
        }(ft || (ft = {}));
        var ht = void 0 && (void 0).__assign || function () {
            return ht = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, ht.apply(this, arguments)
        }, vt = 'data-gjs-';
        const gt = function (n, o) {
            return void 0 === o && (o = {}), {
                compTypes: [], modelAttrStart: vt, getPropAttribute: function (t, e) {
                    var n = t.replace(this.modelAttrStart, ''), o = (null == e ? void 0 : e.length) || 0,
                        r = null == e ? void 0 : e.substring(0, 1), i = null == e ? void 0 : e.substring(o - 1),
                        a = 'true' === e || 'false' !== e && e;
                    try {
                        a = '{' == r && '}' == i || '[' == r && ']' == i ? JSON.parse(a) : a
                    } catch (t) {
                    }
                    return {name: n, value: a}
                }, splitPropsFromAttr: function (e) {
                    var n = this;
                    void 0 === e && (e = {});
                    var o = {}, r = {};
                    return (0, t.each)(e, (function (t, e) {
                        if (0 === e.indexOf(n.modelAttrStart)) {
                            var i = n.getPropAttribute(e, t);
                            o[i.name] = i.value
                        } else r[e] = t
                    })), {props: o, attrs: r}
                }, parseStyle: function (e) {
                    for (var n = {}; e.indexOf('/*') >= 0;) {
                        var o = e.indexOf('/*'), r = e.indexOf('*/'), i = r > -1 ? r + 2 : void 0;
                        e = e.replace(e.slice(o, i), '')
                    }
                    for (var a = e.split(';'), s = 0, l = a.length; s < l; s++) {
                        var c = a[s].trim();
                        if (c) {
                            var u = c.split(':'), p = u[0].trim(), d = u.slice(1).join(':').trim();
                            n[p] ? ((0, t.isArray)(n[p]) || (n[p] = [n[p]]), n[p].push(d)) : n[p] = d
                        }
                    }
                    return n
                }, parseClass: function (t) {
                    for (var e = [], n = t.split(' '), o = 0, r = n.length; o < r; o++) {
                        var i = n[o].trim();
                        i && e.push(i)
                    }
                    return e
                }, parseNodeAttr: function (e, r) {
                    for (var i, a, s = r || {}, l = e.attributes || [], c = l.length, u = !!(null === (i = null == o ? void 0 : o.optionsHtml) || void 0 === i ? void 0 : i.convertDataGjsAttributesHyphens), p = u && !!s.type && (0, t.result)(null === (a = null == n ? void 0 : n.Components.getType(s.type)) || void 0 === a ? void 0 : a.model.prototype, 'defaults') || {}, d = 0; d < c; d++) {
                        var f = l[d].nodeName, h = l[d].nodeValue;
                        if ('style' == f) s.style = this.parseStyle(h); else if ('class' == f) s.classes = this.parseClass(h); else {
                            if ('contenteditable' == f) continue;
                            if (0 === f.indexOf(this.modelAttrStart)) {
                                var v = this.getPropAttribute(f, h), g = v.name;
                                if (u && !(g in p)) {
                                    var y = (0, Z._I)(g);
                                    g = y in p ? y : g
                                }
                                s[g] = v.value
                            } else '' === h && !0 === e[f] && (h = !0), s.attributes || (s.attributes = {}), s.attributes[f] = h
                        }
                    }
                    return s
                }, detectNode: function (t, e) {
                    var n;
                    void 0 === e && (e = {});
                    var o = this.compTypes, r = {};
                    if (o) {
                        var i = null === (n = t.getAttribute) || void 0 === n ? void 0 : n.call(t, "".concat(this.modelAttrStart, "type"));
                        if (i) r = {type: i}; else for (var a = 0; a < o.length; a++) {
                            var s = o[a], l = s.model.isComponent(t, e);
                            if (l) {
                                'object' != typeof l && (l = {type: s.id}), r = l;
                                break
                            }
                        }
                    }
                    return r
                }, parseNode: function (t, e) {
                    var n;
                    void 0 === e && (e = {});
                    var r = (null === (n = t.content) || void 0 === n ? void 0 : n.childNodes) || t.childNodes,
                        i = r.length, a = this.detectNode(t, e);
                    if (!a.tagName) {
                        var s = t.tagName || '', l = t.namespaceURI || '';
                        a.tagName = s && 'http://www.w3.org/1999/xhtml' === l ? s.toLowerCase() : s
                    }
                    if (a = this.parseNodeAttr(t, a), i || '/>' !== "".concat(t.outerHTML).slice(-2) || (a.void = !0), i && !a.components && !e.skipChildren) {
                        var c = r[0];
                        1 === i && 3 === c.nodeType ? (!a.type && (a.type = 'text'), a.components = {
                            type: 'textnode',
                            content: c.nodeValue
                        }) : a.components = this.parseNodes(t, ht(ht({}, e), {inSvg: e.inSvg || 'svg' === a.type}))
                    }
                    var u = a.components;
                    if (!a.type && (null == u ? void 0 : u.length)) {
                        for (var p = o.textTypes, d = void 0 === p ? [] : p, f = o.textTags, h = void 0 === f ? [] : f, v = !0, g = !1, y = 0; y < u.length; y++) {
                            var m = u[y], b = m.type;
                            if (!d.includes(b) && !h.includes(m.tagName)) {
                                v = !1;
                                break
                            }
                            'textnode' === b && (g = !0)
                        }
                        v && g && (a.type = 'text')
                    }
                    return a
                }, parseNodes: function (e, n) {
                    var o;
                    void 0 === n && (n = {});
                    for (var r = [], i = (null === (o = e.content) || void 0 === o ? void 0 : o.childNodes) || e.childNodes, a = i.length, s = 0; s < a; s++) {
                        var l = i[s], c = r[r.length - 1], u = this.parseNode(l, n);
                        if ('textnode' === u.type) {
                            if ('textnode' === (null == c ? void 0 : c.type)) {
                                c.content += u.content;
                                continue
                            }
                            if (!n.keepEmptyTextNodes) {
                                var p = l.nodeValue || '', d = 0 === s || s === a - 1, f = p.includes('\n');
                                if (' ' != p && !p.trim() && (d || f)) continue
                            }
                        }
                        !u.tagName && (0, t.isUndefined)(u.content) || r.push(u)
                    }
                    return r
                }, parse: function (e, r, i) {
                    var a, s, l;
                    void 0 === i && (i = {});
                    var c = (null == n ? void 0 : n.get('Config')) || {}, u = null == n ? void 0 : n.Parser,
                        p = {html: []}, d = ht(ht({}, o), i),
                        f = ht(ht(ht({}, o.optionsHtml), {htmlType: (null === (a = o.optionsHtml) || void 0 === a ? void 0 : a.htmlType) || o.htmlType}), i),
                        h = ht(ht({}, f), {asDocument: this.__checkAsDocument(e, f)}), v = h.preParser,
                        g = h.asDocument,
                        y = {input: (0, t.isFunction)(v) ? v(e, {editor: null == n ? void 0 : n.getEditor()}) : e};
                    null == u || u.__emitEvent(ft.htmlBefore, y);
                    var m = y.input, b = (0, t.isFunction)(d.parserHtml) ? d.parserHtml(m, h) : function (e, n) {
                        void 0 === n && (n = {});
                        var o, r = new DOMParser, i = n.htmlType || dt, a = i === pt,
                            s = a ? e : "<div>".concat(e, "</div>"), l = r.parseFromString(s, i);
                        if (a) {
                            if (n.asDocument) return l;
                            var c = l.head, u = l.body, p = c.querySelectorAll('script');
                            (0, t.each)(p, (function (t) {
                                return u.appendChild(t)
                            }));
                            var d = [];
                            (0, t.each)(c.children, (function (t) {
                                return d.push(t)
                            })), (0, t.each)(d, (function (t, e) {
                                return u.insertBefore(t, u.children[e])
                            })), o = u
                        } else o = l.firstChild;
                        return o
                    }(m, h), _ = b, w = b;
                    g && (_ = w.documentElement, p.doctype = (0, Z.LJ)(w.doctype));
                    var x = _.querySelectorAll('script'), C = x.length;
                    if (!((0, t.isUndefined)(c.allowScripts) ? h.allowScripts : c.allowScripts)) for (; C--;) null === (s = x[C].parentNode) || void 0 === s || s.removeChild(x[C]);
                    if (h.allowUnsafeAttr && h.allowUnsafeAttrValue || this.__sanitizeNode(_, h), r) {
                        for (var S = _.querySelectorAll('style'), O = S.length, T = ''; O--;) T = S[O].innerHTML + T, null === (l = S[O].parentNode) || void 0 === l || l.removeChild(S[O]);
                        T && (p.css = r.parse(T))
                    }
                    null == u || u.__emitEvent(ft.htmlRoot, {input: m, root: _});
                    var P = [];
                    if (g) p.head = this.parseNode(w.head, d), p.root = this.parseNodeAttr(_), P = this.parseNode(w.body, d); else {
                        var E = this.parseNodes(_, d);
                        P = 1 !== E.length || d.returnArray ? E : E[0]
                    }
                    return p.html = P, null == u || u.__emitEvent(ft.html, {input: m, output: p, options: h}), p
                }, __sanitizeNode: function (e, n) {
                    var o = this, r = e.attributes || [], i = e.childNodes || [], a = [];
                    (0, t.each)(r, (function (t) {
                        var e = t.nodeName || '', o = t.nodeValue || '';
                        !n.allowUnsafeAttr && e.startsWith('on') && a.push(e), !n.allowUnsafeAttrValue && o.startsWith('javascript:') && a.push(e)
                    })), a.map((function (t) {
                        return e.removeAttribute(t)
                    })), (0, t.each)(i, (function (t) {
                        return o.__sanitizeNode(t, n)
                    }))
                }, __checkAsDocument: function (n, o) {
                    return (0, e.isDef)(o.asDocument) ? o.asDocument : (0, t.isFunction)(o.detectDocument) ? !!o.detectDocument(n) : o.detectDocument ? n.toLowerCase().trim().startsWith('<!doctype') : void 0
                }
            }
        };
        var yt;
        !function (t) {
            t["add"] = "data:add", t["addBefore"] = "data:add:before", t["remove"] = "data:remove", t["removeBefore"] = "data:remove:before", t["update"] = "data:update", t["path"] = "data:path", t["pathSource"] = "data:pathSource:", t["all"] = "data"
        }(yt || (yt = {}));
        var mt, bt = 'data-collection', _t = 'data-collection-item', wt = 'dataResolver', xt = function () {
            function t(t, e, n) {
                this.operator = t, this.statements = e, this.opts = n
            }

            return t.prototype.evaluate = function () {
                var t = this, e = this.statements.map((function (e) {
                    return new Nt({condition: e}, t.opts).evaluate()
                }));
                return this.operator.evaluate(e)
            }, t
        }(), Ct = function () {
            function t(t, e) {
                this.operationString = t, this.em = e.em
            }

            return t.prototype.getOperations = function () {
                return t = this.operationsEnum, Object.keys(t).filter((function (t) {
                    return isNaN(Number(t))
                })).map((function (e) {
                    return t[e]
                }));
                var t
            }, t
        }(), St = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        !function (t) {
            t["equals"] = "equals", t["isTruthy"] = "isTruthy", t["isFalsy"] = "isFalsy", t["isDefined"] = "isDefined", t["isNull"] = "isNull", t["isUndefined"] = "isUndefined", t["isArray"] = "isArray", t["isObject"] = "isObject", t["isString"] = "isString", t["isNumber"] = "isNumber", t["isBoolean"] = "isBoolean", t["isDefaultValue"] = "isDefaultValue"
        }(mt || (mt = {}));
        var Ot, Tt = function (t) {
            function e() {
                var e = null !== t && t.apply(this, arguments) || this;
                return e.operationsEnum = mt, e
            }

            return St(e, t), e.prototype.evaluate = function (t, e) {
                var n;
                switch (this.operationString) {
                    case'equals':
                        return t === e;
                    case'isTruthy':
                        return !!t;
                    case'isFalsy':
                        return !t;
                    case'isDefined':
                        return null != t;
                    case'isNull':
                        return null === t;
                    case'isUndefined':
                        return void 0 === t;
                    case'isArray':
                        return Array.isArray(t);
                    case'isObject':
                        return 'object' == typeof t && null !== t;
                    case'isString':
                        return 'string' == typeof t;
                    case'isNumber':
                        return 'number' == typeof t;
                    case'isBoolean':
                        return 'boolean' == typeof t;
                    case'isDefaultValue':
                        return t instanceof me && t.get('defaultValue') === e;
                    default:
                        return null === (n = this.em) || void 0 === n || n.logWarning("Unsupported generic operation: ".concat(this.operationString)), !1
                }
            }, e
        }(Ct), Pt = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        !function (t) {
            t["and"] = "and", t["or"] = "or", t["xor"] = "xor"
        }(Ot || (Ot = {}));
        var Et, kt = function (t) {
            function e() {
                var e = null !== t && t.apply(this, arguments) || this;
                return e.operationsEnum = Ot, e
            }

            return Pt(e, t), e.prototype.evaluate = function (t) {
                if (!(null == t ? void 0 : t.length)) return !1;
                switch (this.operationString) {
                    case Ot.and:
                        return t.every(Boolean);
                    case Ot.or:
                        return t.some(Boolean);
                    case Ot.xor:
                        return 1 === t.filter(Boolean).length;
                    default:
                        return this.em.logWarning("Unsupported boolean operation: ".concat(this.operationString)), !1
                }
            }, e
        }(Ct), At = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        !function (t) {
            t["greaterThan"] = ">", t["lessThan"] = "<", t["greaterThanOrEqual"] = ">=", t["lessThanOrEqual"] = "<=", t["equals"] = "=", t["notEquals"] = "!="
        }(Et || (Et = {}));
        var jt, Mt = function (t) {
            function e() {
                var e = null !== t && t.apply(this, arguments) || this;
                return e.operationsEnum = Et, e
            }

            return At(e, t), e.prototype.evaluate = function (t, e) {
                if ('number' != typeof t) return !1;
                switch (this.operationString) {
                    case Et.greaterThan:
                        return t > e;
                    case Et.lessThan:
                        return t < e;
                    case Et.greaterThanOrEqual:
                        return t >= e;
                    case Et.lessThanOrEqual:
                        return t <= e;
                    case Et.equals:
                        return t === e;
                    case Et.notEquals:
                        return t !== e;
                    default:
                        return this.em.logWarning("Unsupported number operation: ".concat(this.operationString)), !1
                }
            }, e
        }(Ct), Dt = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        !function (t) {
            t["contains"] = "contains", t["startsWith"] = "startsWith", t["endsWith"] = "endsWith", t["matchesRegex"] = "matchesRegex", t["equalsIgnoreCase"] = "equalsIgnoreCase", t["trimEquals"] = "trimEquals"
        }(jt || (jt = {}));
        var Lt = function (t) {
                function e() {
                    var e = null !== t && t.apply(this, arguments) || this;
                    return e.operationsEnum = jt, e
                }

                return Dt(e, t), e.prototype.evaluate = function (t, e) {
                    if ('string' != typeof t) return !1;
                    switch (this.operationString) {
                        case jt.contains:
                            return t.includes(e);
                        case jt.startsWith:
                            return t.startsWith(e);
                        case jt.endsWith:
                            return t.endsWith(e);
                        case jt.matchesRegex:
                            return e || this.em.logWarning('Regex pattern must be provided.'), new RegExp(null != e ? e : '').test(t);
                        case jt.equalsIgnoreCase:
                            return t.toLowerCase() === e.toLowerCase();
                        case jt.trimEquals:
                            return t.trim() === e.trim();
                        default:
                            return this.em.logWarning("Unsupported string operation: ".concat(this.operationString)), !1
                    }
                }, e
            }(Ct), It = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), Nt = function (e) {
                function n(t, n) {
                    var o, r = e.call(this, t) || this;
                    return r.collectionsStateMap = {}, r.em = n.em, r.collectionsStateMap = null !== (o = n.collectionsStateMap) && void 0 !== o ? o : {}, r
                }

                return It(n, e), n.prototype.evaluate = function () {
                    var e = this.get('condition');
                    if (!e || (0, t.isBoolean)(e)) return !!e;
                    var n = this.getOperator();
                    return !!n && n.evaluate(this.getResolvedLeftValue(), this.getResolvedRightValue())
                }, n.prototype.getDependentDataVariables = function () {
                    var t = this.get('condition');
                    return t ? this.extractDataVariables(t) : []
                }, n.prototype.getOperations = function () {
                    var t = this.getOperator();
                    return !t || t instanceof xt ? [] : t.getOperations()
                }, n.prototype.updateCollectionStateMap = function (t) {
                    this.collectionsStateMap = t
                }, n.prototype.getOperator = function () {
                    var e = {em: this.em, collectionsStateMap: this.collectionsStateMap}, n = this.get('condition');
                    if (n && !(0, t.isBoolean)(n)) {
                        var o;
                        if (this.isLogicGroup(n)) {
                            var r = n.logicalOperator, i = n.statements, a = new kt(r, e);
                            o = new xt(a, i, e)
                        }
                        if (this.isExpression(n)) {
                            var s = n.left, l = (a = n.operator, ue(s, e));
                            o = this.resolveOperator(l, a)
                        }
                        return o
                    }
                }, n.prototype.resolveOperator = function (t, e) {
                    var n = this.em;
                    return this.isOperatorInEnum(e, mt) ? new Tt(e, {em: n}) : 'number' == typeof t ? new Mt(e, {em: n}) : 'string' == typeof t ? new Lt(e, {em: n}) : void 0
                }, n.prototype.extractDataVariables = function (t) {
                    var e = this, n = [];
                    return this.isExpression(t) ? (ce(t.left) && n.push(t.left), ce(t.right) && n.push(t.right)) : this.isLogicGroup(t) && t.statements.forEach((function (t) {
                        return n.push.apply(n, e.extractDataVariables(t))
                    })), n
                }, n.prototype.isLogicGroup = function (t) {
                    return t && void 0 !== t.logicalOperator && Array.isArray(t.statements)
                }, n.prototype.isExpression = function (t) {
                    return t && void 0 !== t.left && 'string' == typeof t.operator
                }, n.prototype.isOperatorInEnum = function (t, e) {
                    return Object.values(e).includes(t)
                }, n.prototype.resolveExpressionSide = function (t) {
                    var e = this.get('condition'), n = this.em, o = this.collectionsStateMap;
                    return e && 'boolean' != typeof e ? e && 'object' == typeof e && t in e ? ue(e[t], {
                        em: n,
                        collectionsStateMap: o
                    }) : void 0 : e
                }, n.prototype.getResolvedLeftValue = function () {
                    return this.resolveExpressionSide('left')
                }, n.prototype.getResolvedRightValue = function () {
                    return this.resolveExpressionSide('right')
                }, n.prototype.toJSON = function (t) {
                    var e = this.get('condition');
                    return 'object' == typeof e ? JSON.parse(JSON.stringify(e)) : e
                }, n
            }(u.Kx), Rt = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), Vt = 'data-condition', Ft = 'data-condition-evaluation-changed', Ht = 'data-condition-output-changed',
            Ut = function (t) {
                function e(e, n) {
                    var o, r = t.call(this, e, n) || this;
                    r.collectionsStateMap = {}, r.resolverListeners = [], r._previousEvaluationResult = null, r.em = n.em, r.collectionsStateMap = null !== (o = n.collectionsStateMap) && void 0 !== o ? o : {};
                    var i = e.condition, a = new Nt({condition: void 0 === i ? {} : i}, {em: r.em});
                    return r._conditionEvaluator = a, r.listenToDataVariables(), r.listenToPropsChange(), r
                }

                return Rt(e, t), e.prototype.defaults = function () {
                    return {
                        type: Vt,
                        condition: {left: '', operator: jt.equalsIgnoreCase, right: ''},
                        ifTrue: {},
                        ifFalse: {}
                    }
                }, e.prototype.getCondition = function () {
                    return this._conditionEvaluator.get('condition')
                }, e.prototype.getIfTrue = function () {
                    return this.get('ifTrue')
                }, e.prototype.getIfFalse = function () {
                    return this.get('ifFalse')
                }, e.prototype.getOperations = function () {
                    return this._conditionEvaluator.getOperations()
                }, e.prototype.setCondition = function (t) {
                    this.set('condition', t), this._conditionEvaluator.set('condition', t), this.trigger(Ht, this.getDataValue())
                }, e.prototype.setIfTrue = function (t) {
                    this.set('ifTrue', t)
                }, e.prototype.setIfFalse = function (t) {
                    this.set('ifFalse', t)
                }, e.prototype.isTrue = function () {
                    return this._conditionEvaluator.evaluate()
                }, e.prototype.getDataValue = function (t) {
                    void 0 === t && (t = !1);
                    var e = {em: this.em, collectionsStateMap: this.collectionsStateMap}, n = this.getIfTrue(),
                        o = this.getIfFalse(), r = this.isTrue();
                    return t ? r ? n : o : ue(r ? n : o, e)
                }, e.prototype.resolvesFromCollection = function () {
                    return !1
                }, e.prototype.updateCollectionsStateMap = function (t) {
                    this.collectionsStateMap = t, this._conditionEvaluator.updateCollectionStateMap(t), this.listenToDataVariables(), this.emitConditionEvaluationChange()
                }, e.prototype.listenToPropsChange = function () {
                    var t = this;
                    this.on('change:condition', this.handleConditionChange.bind(this)), this.on('change:condition change:ifTrue change:ifFalse', (function () {
                        t.listenToDataVariables()
                    }))
                }, e.prototype.handleConditionChange = function () {
                    this.setCondition(this.get('condition'))
                }, e.prototype.listenToDataVariables = function () {
                    this.cleanupListeners(), this.setupConditionDataVariableListeners(), this.setupOutputDataVariableListeners()
                }, e.prototype.setupConditionDataVariableListeners = function () {
                    var t = this;
                    this._conditionEvaluator.getDependentDataVariables().forEach((function (e) {
                        t.addListener(e, (function () {
                            t.emitConditionEvaluationChange()
                        }))
                    }))
                }, e.prototype.setupOutputDataVariableListeners = function () {
                    var t = this.isTrue();
                    this.setupOutputVariableListener(this.getIfTrue(), t), this.setupOutputVariableListener(this.getIfFalse(), !t)
                }, e.prototype.setupOutputVariableListener = function (t, e) {
                    var n = this;
                    ce(t) && this.addListener(t, (function () {
                        e && n.trigger(Ht, t)
                    }))
                }, e.prototype.addListener = function (t, e) {
                    var n = new _e({
                        em: this.em,
                        resolver: new me(t, {em: this.em, collectionsStateMap: this.collectionsStateMap}),
                        onUpdate: e
                    });
                    this.resolverListeners.push(n)
                }, e.prototype.emitConditionEvaluationChange = function () {
                    var t = this.isTrue();
                    this._previousEvaluationResult !== t && (this._previousEvaluationResult = t, this.trigger(Ft, t), this.emitOutputValueChange())
                }, e.prototype.emitOutputValueChange = function () {
                    var t = this.getDataValue();
                    this.trigger(Ht, t)
                }, e.prototype.cleanupListeners = function () {
                    this.resolverListeners.forEach((function (t) {
                        return t.destroy()
                    })), this.resolverListeners = []
                }, e.prototype.toJSON = function () {
                    var t = this.getIfTrue(), e = this.getIfFalse();
                    return {type: Vt, condition: this._conditionEvaluator.toJSON(), ifTrue: t, ifFalse: e}
                }, e
            }(u.Kx), zt = 'data-condition-true-content', Bt = 'data-condition-false-content',
            Wt = void 0 && (void 0).__assign || function () {
                return Wt = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, Wt.apply(this, arguments)
            }, $t = void 0 && (void 0).__spreadArray || function (t, e, n) {
                if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                return t.concat(o || Array.prototype.slice.call(e))
            }, qt = function (e) {
                return (0, t.isArray)(e.get(On))
            }, Gt = function (t) {
                return !!t.get(Tn)
            }, Kt = function (t) {
                return !(!qt(t) && !Gt(t))
            }, Yt = function (t) {
                var e = t.parent();
                return Kt(t) && (!e || !Kt(e))
            }, Xt = function (t) {
                t.__symbReady || (t.on('change', t.__upSymbProps), t.__symbReady = !0)
            }, Jt = function (e) {
                var n = e.get(Tn);
                if (n && (0, t.isString)(n)) {
                    var o = e.__getAllById()[n];
                    o ? (n = o, e.set(Tn, o)) : n = 0
                }
                return n || void 0
            }, Zt = function (e) {
                var n = null == e ? void 0 : e.get(On);
                return n && (0, t.isArray)(n) && (n.forEach((function (o, r) {
                    o && (0, t.isString)(o) && (n[r] = e.__getAllById()[o])
                })), n = n.filter((function (e) {
                    return e && !(0, t.isString)(e)
                }))), n || void 0
            }, Qt = function (e, n) {
                void 0 === n && (n = '');
                var o = null == e ? void 0 : e.get(Pn), r = n.split(':')[0], i = n !== r ? [n, r] : [n];
                return !0 === o || (0, t.isArray)(o) && i.some((function (t) {
                    return o.indexOf(t) >= 0
                }))
            }, te = function (t, e) {
                void 0 === e && (e = {});
                var n = [], o = e.changed;
                if (e.fromInstance || e.noPropagate || e.fromUndo || o && Qt(t, o)) return n;
                var r = Zt(t) || [], i = Jt(t);
                return n = (i ? $t([i], Zt(i) || [], !0) : r).filter((function (e) {
                    return e !== t
                })).filter((function (t) {
                    return !(o && Qt(t, o))
                }))
            }, ee = function (t, e) {
                for (var n = t, o = t.parent(e); o && Kt(o);) n = o, o = o.parent(e);
                return n
            }, ne = function (t, e) {
                void 0 === e && (e = {});
                var n = Jt(t), o = n && Zt(n);
                !e.skipRefs && o && n.set(On, o.filter((function (e) {
                    return e !== t
                }))), t.set(Tn, 0), t.components().forEach((function (t) {
                    return ne(t, e)
                }))
            }, oe = function (t, e, n, o) {
                void 0 === o && (o = {});
                var r = Jt(t), i = Zt(t);
                (r || i) && t.em.log(e, {model: t, toUp: n, context: 'symbols', opts: o})
            }, re = function (t, n) {
                ['status', 'open', On, Tn, Pn, 'attributes'].forEach((function (e) {
                    return delete t[e]
                })), delete n.id, (0, e.isEmptyObj)(n) || (t.attributes = n)
            }, ie = function (e, n) {
                (0, t.keys)(e).forEach((function (t) {
                    ae(e, t, n) || delete e[t]
                }))
            }, ae = function (t, e, n) {
                var o = function () {
                    var n;
                    if ('attributes' === e) {
                        var o = t['attributes'];
                        return Object.values(o).some((function (t) {
                            return !!(null == t ? void 0 : t.collectionId)
                        }))
                    }
                    return !!(null === (n = t[e]) || void 0 === n ? void 0 : n.collectionId)
                }();
                return !Qt(n, e) || o
            }, se = function (t, e, n, o) {
                var r = o || n || {}, i = {fromInstance: r.fromInstance, fromUndo: r.fromUndo}, a = e.opt.temporary;
                if (o) if (o.add) {
                    var s = [], l = !!Zt(t);
                    if ((m = te(t, Wt(Wt({}, i), {changed: 'components:add'}))).length) {
                        var c = Jt(e);
                        s = Zt(c || e) || [], (s = $t([], s, !0)).push(c || e)
                    }
                    !a && oe(t, 'add', m, {
                        opts: o, addedInstances: s.map((function (t) {
                            return t.cid
                        })), added: e.cid
                    }), m.forEach((function (n) {
                        var r = ee(n), i = s.filter((function (t) {
                            var e = ee(t, {prev: 1});
                            return r && e && e === r
                        }))[0] || e.clone({symbol: !0, symbolInv: l});
                        n.append(i, Wt({fromInstance: t}, o))
                    }))
                } else {
                    var u = Jt(e);
                    if (u && !o.temporary && u.set(On, Zt(u).filter((function (t) {
                        return t !== e
                    }))), !Yt(e) && !o.skipRefsUp) {
                        var p = 'components:remove', d = o.index, f = e.parent(), h = Wt({fromInstance: e}, o), v = Yt(e),
                            g = function (t) {
                                var e = t.parent();
                                e && !Qt(e, p) && t.remove(h)
                            };
                        m = Qt(f, p) ? [] : te(e, i);
                        v && (m = f && te(f, Wt(Wt({}, i), {changed: p})), g = function (t) {
                            var e = t.components().at(d);
                            e && e.remove(Wt({fromInstance: f}, h))
                        }), !a && oe(t, 'remove', m, {opts: o, removed: e.cid, isSymbNested: v}), m.forEach(g)
                    }
                } else {
                    var y = e, m = te(t, Wt(Wt({}, i), {changed: 'components:reset'})), b = y.models, _ = new Set;
                    oe(t, 'reset', m, {components: b}), m.forEach((function (e) {
                        var o = e.components(), r = b.map((function (e, n) {
                            return t.get(wt) ? e.clone({symbol: Kt(e)}) : !Kt(e) || _.has(e) ? (_.add(e), e.clone({symbol: !0})) : o.at(n)
                        }));
                        o.reset(r, Wt({fromInstance: t}, n))
                    }))
                }
                t.__changesUp(r)
            };

        function le(t) {
            return 'object' == typeof t && [ge, Vt].includes(null == t ? void 0 : t.type)
        }

        function ce(t) {
            return (null == t ? void 0 : t.type) === ge
        }

        function ue(t, e) {
            return le(t) ? (ce(t) && me.resolveDataResolver(t, e), de(t, e)) : t
        }

        function pe(t, e) {
            var n, o, r = t.type;
            switch (r) {
                case ge:
                    o = new me(t, e);
                    break;
                case Vt:
                    o = new Ut(t, e);
                    break;
                default:
                    return void (null === (n = e.em) || void 0 === n || n.logWarning("Unsupported dynamic type: ".concat(r)))
            }
            return o
        }

        function de(t, e) {
            var n = pe(t, e);
            return null == n ? void 0 : n.getDataValue()
        }

        function fe(t) {
            var e = function (t) {
                var e = t.collectionsStateMap;
                if (!e) return !1;
                var n = Object.keys(e);
                if (!n.length) return !1;
                var o = Jt(t);
                if (!o || o === t) return !1;
                var r = o.collectionsStateMap;
                return Object.keys(r).every((function (t) {
                    return n.includes(t)
                }))
            }(t), n = e ? function (t) {
                var e = Jt(t);
                return e ? e.getId() : ''
            }(t) : null;
            return {shouldSync: e, itemId: n}
        }

        var he = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ve = void 0 && (void 0).__assign || function () {
            return ve = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, ve.apply(this, arguments)
        }, ge = 'data-variable', ye = function (t) {
            function e(e, n) {
                var o = t.call(this, e, n) || this;
                return o.em = n.em, o.collectionsStateMap = n.collectionsStateMap, o
            }

            return he(e, t), e.prototype.defaults = function () {
                return {
                    type: ge,
                    defaultValue: '',
                    path: '',
                    collectionId: void 0,
                    variableType: void 0,
                    asPlainText: void 0
                }
            }, Object.defineProperty(e.prototype, "path", {
                get: function () {
                    var t;
                    return null !== (t = this.get('path')) && void 0 !== t ? t : ''
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "defaultValue", {
                get: function () {
                    var t;
                    return null !== (t = this.get('defaultValue')) && void 0 !== t ? t : ''
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "collectionId", {
                get: function () {
                    return this.get('collectionId')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "variableType", {
                get: function () {
                    return this.get('variableType')
                }, enumerable: !1, configurable: !0
            }), e.prototype.resolvesFromCollection = function () {
                return !!this.collectionId
            }, e.prototype.updateCollectionsStateMap = function (t) {
                this.collectionsStateMap = t, this.trigger('change')
            }, e.prototype.getResolverPath = function () {
                var t;
                if (this.resolvesFromCollection()) {
                    var e = this.resolveCollectionVariable();
                    return !!ce(e) && (null !== (t = e.path) && void 0 !== t ? t : '')
                }
                return this.path
            }, e.prototype.toJSON = function (e) {
                var n = this.defaults(), o = t.prototype.toJSON.call(this, e),
                    r = Object.fromEntries(Object.entries(o).filter((function (t) {
                        var e = t[0];
                        return t[1] !== n[e]
                    })));
                return ve(ve({}, r), {type: ge})
            }, e.prototype.getDataValue = function () {
                var t = {em: this.em, collectionsStateMap: this.collectionsStateMap};
                return e.resolveDataResolver({
                    path: this.path,
                    defaultValue: this.defaultValue,
                    collectionId: this.collectionId,
                    variableType: this.variableType
                }, t)
            }, e.resolveDataSourceVariable = function (t, e) {
                var n, o;
                return e.em.DataSources.getValue(null !== (n = t.path) && void 0 !== n ? n : '', null !== (o = t.defaultValue) && void 0 !== o ? o : '')
            }, e.resolveDataResolver = function (t, n) {
                var o, r, i, a;
                if (t.collectionId) {
                    var s = e.resolveCollectionVariable(t, n);
                    return ce(s) ? e.resolveDataSourceVariable({
                        path: null !== (o = s.path) && void 0 !== o ? o : '',
                        defaultValue: null !== (r = t.defaultValue) && void 0 !== r ? r : ''
                    }, {em: n.em}) : s
                }
                return e.resolveDataSourceVariable({
                    path: null !== (i = t.path) && void 0 !== i ? i : '',
                    defaultValue: null !== (a = t.defaultValue) && void 0 !== a ? a : ''
                }, {em: n.em})
            }, e.prototype.resolveCollectionVariable = function () {
                var t = this.em, n = this.collectionsStateMap;
                return e.resolveCollectionVariable(this.attributes, {em: t, collectionsStateMap: n})
            }, e.resolveCollectionVariable = function (t, n) {
                var o = t.collectionId, r = void 0 === o ? '' : o, i = t.variableType, a = t.path, s = t.defaultValue,
                    l = void 0 === s ? '' : s, c = n.em, u = n.collectionsStateMap;
                if (!u) return l;
                var p = u[r];
                return p ? i ? 'currentItem' === i ? e.resolveCurrentItem(p, a, r, c) : p[i] : (c.logError("Missing collection variable type for collection: ".concat(r)), l) : l
            }, e.resolveCurrentItem = function (t, e, n, o) {
                var r = t.currentItem;
                if (!r) return o.logError("Current item is missing for collection: ".concat(n)), '';
                if (r.type === ge) {
                    var i = r.path ? "".concat(r.path, ".").concat(e) : e;
                    return {type: ge, path: i}
                }
                return e && !r[e] ? (o.logError("Path not found in current item: ".concat(e, " for collection: ").concat(n)), '') : e ? r[e] : r
            }, e
        }(u.Kx);
        const me = ye;
        var be = function () {
            function t(t) {
                var e = this;
                this.listeners = [], this.model = new u.Kx, this.onChange = function () {
                    var t = e.resolver.getDataValue();
                    e.onUpdate(t)
                }, this.em = t.em, this.resolver = t.resolver, this.onUpdate = t.onUpdate, this.listenToResolver()
            }

            return t.prototype.createListener = function (t, e, n) {
                return void 0 === n && (n = this.onChange), {obj: t, event: e, callback: n}
            }, t.prototype.listenToResolver = function () {
                var t = this.resolver, e = this.model;
                this.removeListeners();
                var n = [];
                switch (t.attributes.type) {
                    case ge:
                        n = this.listenToDataVariable(t);
                        break;
                    case Vt:
                        n = this.listenToConditionalVariable(t)
                }
                n.forEach((function (t) {
                    return e.listenTo(t.obj, t.event, t.callback)
                })), this.listeners = n
            }, t.prototype.listenToConditionalVariable = function (t) {
                return [{obj: t, event: Ht, callback: this.onChange}]
            }, t.prototype.listenToDataVariable = function (t) {
                var n = this, o = this.em, r = [], i = function () {
                    n.listenToResolver(), n.onChange()
                };
                r.push(this.createListener(t, 'change', i));
                var a = t.getResolverPath();
                if (!a) return r;
                var s = (0, e.stringToPath)(a || '').join('.'), l = o.DataSources.fromPath(a), c = l[0], u = l[1];
                return c && r.push(this.createListener(c.records, 'add remove reset', i)), u && r.push(this.createListener(u, 'change')), r.push(this.createListener(o.DataSources.all, 'add remove reset', i), this.createListener(o, "".concat(yt.path, ":").concat(s))), r
            }, t.prototype.removeListeners = function () {
                var t = this;
                this.listeners.forEach((function (e) {
                    return t.model.stopListening(e.obj, e.event, e.callback)
                })), this.listeners = []
            }, t.prototype.destroy = function () {
                this.removeListeners()
            }, t
        }();
        const _e = be;
        var we = void 0 && (void 0).__assign || function () {
            return we = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, we.apply(this, arguments)
        }, xe = function () {
            function t(t, e, n) {
                this.model = t, this.updateFn = e, this.resolverListeners = {}, this.em = n.em
            }

            return t.prototype.bindModel = function (t) {
                this.model = t
            }, t.prototype.setDynamicValues = function (t, e) {
                return void 0 === e && (e = {}), e.skipWatcherUpdates || e.fromDataSource || this.removeListeners(), this.addDynamicValues(t, e)
            }, t.prototype.addDynamicValues = function (t, e) {
                if (void 0 === e && (e = {}), !t) return {};
                var n = this.evaluateValues(t);
                return e.skipWatcherUpdates || e.fromDataSource || this.updateListeners(t), n
            }, t.prototype.onCollectionsStateMapUpdate = function () {
                var t = this, e = this.getValuesResolvingFromCollections();
                if (e.length) {
                    e.forEach((function (e) {
                        return t.resolverListeners[e].resolver.updateCollectionsStateMap(t.collectionsStateMap)
                    }));
                    var n = this.addDynamicValues(this.getSerializableValues(Object.fromEntries(e.map((function (t) {
                        return [t, null]
                    })))));
                    Object.entries(n).forEach((function (e) {
                        var n = e[0], o = e[1];
                        return t.updateFn(t.model, n, o)
                    }))
                }
            }, Object.defineProperty(t.prototype, "collectionsStateMap", {
                get: function () {
                    var t = this.model;
                    return t instanceof jn ? t.collectionsStateMap : {}
                }, enumerable: !1, configurable: !0
            }), t.prototype.updateListeners = function (t) {
                var e = this, n = this.em, o = this.collectionsStateMap;
                this.removeListeners(Object.keys(t));
                for (var r = Object.keys(t), i = function (i) {
                    var s = r[i], l = t[s];
                    if (!le(l)) return "continue";
                    var c = pe(l, {em: n, collectionsStateMap: o});
                    a.resolverListeners[s] = new _e({
                        em: n, resolver: c, onUpdate: function (t) {
                            return e.updateFn(e.model, s, t)
                        }
                    })
                }, a = this, s = 0; s < r.length; s++) i(s)
            }, t.prototype.evaluateValues = function (t) {
                for (var e = this.em, n = this.collectionsStateMap, o = we({}, t), r = Object.keys(t), i = 0; i < r.length; i++) {
                    var a = r[i], s = t[a];
                    le(s) && (o[a] = de(s, {em: e, collectionsStateMap: n}))
                }
                return o
            }, t.prototype.removeListeners = function (t) {
                var e = this, n = t || Object.keys(this.resolverListeners);
                return n.forEach((function (t) {
                    var n, o;
                    e.resolverListeners[t] && (null === (o = (n = e.resolverListeners[t]).destroy) || void 0 === o || o.call(n), delete e.resolverListeners[t])
                })), n
            }, t.prototype.getSerializableValues = function (t) {
                if (!t) return {};
                for (var e = we({}, t), n = Object.keys(e), o = 0; o < n.length; o++) {
                    var r = n[o], i = this.resolverListeners[r];
                    i && (e[r] = i.resolver.toJSON())
                }
                return e
            }, t.prototype.getAllSerializableValues = function () {
                for (var t = {}, e = Object.keys(this.resolverListeners), n = 0; n < e.length; n++) {
                    var o = e[n];
                    t[o] = this.resolverListeners[o].resolver.toJSON()
                }
                return t
            }, t.prototype.getValuesResolvingFromCollections = function () {
                var t = this;
                return Object.keys(this.resolverListeners).filter((function (e) {
                    return t.resolverListeners[e].resolver.resolvesFromCollection()
                }))
            }, t.prototype.destroy = function () {
                this.removeListeners()
            }, t
        }(), Ce = void 0 && (void 0).__assign || function () {
            return Ce = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Ce.apply(this, arguments)
        }, Se = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Oe = {fromDataSource: !0, avoidStore: !0}, Te = function () {
            function t(t, e) {
                this.model = t, this.propertyWatcher = new xe(t, this.onPropertyUpdate, e), this.attributeWatcher = new xe(t, this.onAttributeUpdate, e), this.styleWatcher = new xe(t, this.onStyleUpdate, e)
            }

            return t.prototype.onPropertyUpdate = function (t, e, n) {
                null == t || t.set(e, n, Oe)
            }, t.prototype.onAttributeUpdate = function (t, e, n) {
                var o;
                null == t || t.addAttributes(((o = {})[e] = n, o), Oe)
            }, t.prototype.onStyleUpdate = function (t, e, n) {
                var o;
                null == t || t.addStyle(((o = {})[e] = n, o), Ce(Ce({}, Oe), {partial: !0, avoidStore: !0}))
            }, t.prototype.bindModel = function (t) {
                this.model = t, this.propertyWatcher.bindModel(t), this.attributeWatcher.bindModel(t), this.styleWatcher.bindModel(t), this.updateSymbolOverride()
            }, t.prototype.addProps = function (t, e) {
                var n = this;
                void 0 === e && (e = {});
                var o = ['components', 'dataResolver'], r = Object.fromEntries(Object.entries(t).map((function (t) {
                    var r, i = t[0], a = t[1];
                    return o.includes(i) ? [i, a] : [i, n.propertyWatcher.addDynamicValues((r = {}, r[i] = a, r), e)[i]]
                })));
                if (t.attributes) {
                    var i = this.attributeWatcher.setDynamicValues(t.attributes, e);
                    r['attributes'] = i
                }
                return e.skipWatcherUpdates || e.fromDataSource || this.updateSymbolOverride(), r
            }, t.prototype.setStyles = function (t, e) {
                return void 0 === e && (e = {}), this.styleWatcher.setDynamicValues(t, e)
            }, t.prototype.disableStyles = function () {
                this.styleWatcher.removeListeners(), this.styleWatcher.destroy()
            }, t.prototype.removeAttributes = function (t) {
                this.attributeWatcher.removeListeners(t), this.updateSymbolOverride()
            }, t.prototype.updateSymbolOverride = function () {
                var t, e = this.model,
                    n = !!Object.keys(null !== (t = null == e ? void 0 : e.collectionsStateMap) && void 0 !== t ? t : {}).length;
                if (this.model && n) {
                    var o = this.propertyWatcher.getValuesResolvingFromCollections(),
                        r = this.attributeWatcher.getValuesResolvingFromCollections(),
                        i = Se(['locked', 'layerable'], o, !0);
                    Object.keys(r).length && i.push('attributes'), te(e).forEach((function (t) {
                        t.setSymbolOverride(i, {fromDataSource: !0})
                    })), e.setSymbolOverride(i, {fromDataSource: !0})
                }
            }, t.prototype.onCollectionsStateMapUpdate = function () {
                this.propertyWatcher.onCollectionsStateMapUpdate(), this.attributeWatcher.onCollectionsStateMapUpdate(), this.styleWatcher.onCollectionsStateMapUpdate()
            }, t.prototype.getDynamicPropsDefs = function () {
                return this.propertyWatcher.getAllSerializableValues()
            }, t.prototype.getDynamicAttributesDefs = function () {
                return this.attributeWatcher.getAllSerializableValues()
            }, t.prototype.getDynamicStylesDefs = function () {
                return this.styleWatcher.getAllSerializableValues()
            }, t.prototype.getPropsDefsOrValues = function (t) {
                return this.propertyWatcher.getSerializableValues(t)
            }, t.prototype.getAttributesDefsOrValues = function (t) {
                return this.attributeWatcher.getSerializableValues(t)
            }, t.prototype.getStylesDefsOrValues = function (t) {
                return this.styleWatcher.getSerializableValues(t)
            }, t.prototype.destroy = function () {
                this.propertyWatcher.destroy(), this.attributeWatcher.destroy(), this.styleWatcher.destroy()
            }, t
        }(), Pe = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ee = void 0 && (void 0).__assign || function () {
            return Ee = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Ee.apply(this, arguments)
        }, ke = gt(), Ae = function (e) {
            return (0, t.isArray)(e) ? e[e.length - 1] : e
        }, je = function (n) {
            function o(t, e) {
                void 0 === e && (e = {});
                var o = this, r = e.em, i = new Te(void 0, {em: r});
                return (o = n.call(this, t, Ee(Ee({}, e), {dataResolverWatchers: i})) || this).views = [], o.collectionsStateMap = {}, i.bindModel(o), i.setStyles(o.get('style')), o.dataResolverWatchers = i, o.em = e.em, o
            }

            return Pe(o, n), o.prototype.parseStyle = function (t) {
                return ke.parseStyle(t)
            }, o.prototype.extendStyle = function (t) {
                return Ee(Ee({}, this.getStyle('', {skipResolve: !0})), t)
            }, o.prototype.getStyle = function (e, n) {
                void 0 === n && (n = {});
                var o = Ee({}, this.get('style') || {});
                if (delete o.__p, !n.skipResolve) return e && (0, t.isString)(e) ? Ee({}, o)[e] : Ee({}, o);
                var r = Ee(Ee({}, o), this.dataResolverWatchers.getDynamicStylesDefs());
                return e && (0, t.isString)(e) ? r[e] : r
            }, o.prototype.setStyle = function (n, o) {
                var r = this;
                void 0 === n && (n = {}), void 0 === o && (o = {}), (0, t.isString)(n) && (n = this.parseStyle(n));
                var i = this.getStyle('', {skipResolve: !0});
                o.partial || o.avoidStore ? (o.avoidStore = !0, n.__p = !0) : delete n.__p;
                var a = Ee({}, n), s = Ee({}, a);
                (0, t.keys)(s).forEach((function (t) {
                    '' !== s[t] || delete s[t]
                })), s = this.dataResolverWatchers.setStyles(s, o), this.set('style', s, o);
                var l = Object.keys((0, e.shallowDiff)(i, a)).reduce((function (t, e) {
                    var n;
                    return Ee(Ee({}, t), ((n = {})[e] = s[e], n))
                }), {});
                return delete l.__p, (0, t.keys)(l).forEach((function (t) {
                    var e = r.em;
                    o.noEvent || (r.trigger("change:style:".concat(t)), e && (e.trigger('styleable:change', r, t, o), e.trigger("styleable:change:".concat(t), r, t, o)))
                })), s
            }, o.prototype.getView = function (t) {
                var e = this.views, n = this.em, o = t || (null == n ? void 0 : n.getCurrentFrameModel());
                return o ? e.find((function (t) {
                    return t.frameView === o.view
                })) : e[0]
            }, o.prototype.setView = function (t) {
                var e = this.views;
                !e.includes(t) && e.push(t)
            }, o.prototype.removeView = function (t) {
                var e = this.views;
                e.splice(e.indexOf(t), 1)
            }, o.prototype.updateView = function () {
                this.views.forEach((function (t) {
                    return t.updateStyles()
                }))
            }, o.prototype.addStyle = function (t, e, n) {
                var o;
                void 0 === e && (e = ''), void 0 === n && (n = {}), 'string' == typeof t ? ((o = {})[t] = e, t = o) : n = e || {}, n.addStyle = t, t = this.extendStyle(t), this.setStyle(t, n)
            }, o.prototype.removeStyle = function (t) {
                var e = this.getStyle();
                delete e[t], this.setStyle(e)
            }, o.prototype.styleToString = function (e) {
                void 0 === e && (e = {});
                var n = [], o = e.style || this.getStyle(e), r = e.important, i = function (e) {
                    var i = (0, t.isArray)(r) ? r.indexOf(e) >= 0 : r;
                    if ('__' === e.substring(0, 2)) return "continue";
                    var a = o[e];
                    ((0, t.isArray)(a) ? a : [a]).forEach((function (t) {
                        var o = "".concat(t).concat(i ? ' !important' : '');
                        o && n.push("".concat(e, ":").concat(o, ";"))
                    }))
                };
                for (var a in o) i(a);
                return n.join('')
            }, o.prototype.getSelectors = function () {
                return this.get('selectors') || this.get('classes')
            }, o.prototype.getSelectorsString = function (t) {
                return this.selectorsToString ? this.selectorsToString(t) : this.getSelectors().getFullString()
            }, o
        }(u.Kx);
        const Me = je;
        var De = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Le = void 0 && (void 0).__assign || function () {
            return Le = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Le.apply(this, arguments)
        }, Ie = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        }, Ne = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Re = function (e, n) {
            return void 0 === n && (n = []), e ? (((0, t.isArray)(e) || (0, t.isFunction)(e.map) ? e : [e]).map((function (t) {
                n.push(t.getId()), Re(t.components().models, n)
            })), n) : []
        }, Ve = function (e, n, o) {
            void 0 === n && (n = {}), void 0 === o && (o = {}), o.visitedCmps = o.visitedCmps || {};
            var r = o.visitedCmps;
            return ((0, t.isArray)(e) ? e : [e]).map((function (e) {
                var i = e.attributes, a = void 0 === i ? {} : i, s = e.components, l = e.tagName, c = e.style, u = a.id,
                    p = (a.draggable, Ie(a, ["id", "draggable"])), d = e;
                if (u) if (r[u]) r[u].push(d), u = jn.getNewId(n), d.attributes.id = u; else if (r[u] = [], n[u]) {
                    var f = d = n[u];
                    l && f.set({tagName: l}, Le(Le({}, o), {silent: !0})), (0, t.keys)(p).length && f.addAttributes(p, Le({}, o)), (0, t.keys)(c).length && f.addStyle(c, o)
                }
                var h = (0, t.isFunction)(d.components) ? d : null;
                if (s) {
                    var v = Ve(s, n, o);
                    h ? h.components().reset(v, o) : d.components = v
                } else h && h.components().reset([], o);
                return d
            }))
        }, Fe = function (e) {
            function n(t, n) {
                var o = e.call(this, t, n) || this;
                o.opt = n, o.listenTo(o, 'add', o.onAdd), o.listenTo(o, 'remove', o.removeChildren), o.listenTo(o, 'reset', o.resetChildren);
                var r = n.em, i = n.config;
                return o.config = i, o.em = r, o.domc = n.domc || (null == r ? void 0 : r.Components), o
            }

            return De(n, e), Object.defineProperty(n.prototype, "events", {
                get: function () {
                    var t;
                    return null === (t = this.domc) || void 0 === t ? void 0 : t.events
                }, enumerable: !1, configurable: !0
            }), n.prototype.resetChildren = function (t, e) {
                var n = this;
                void 0 === e && (e = {});
                var o = this, r = e.previousModels || [], i = r.filter((function (e) {
                    return !t.get(e.cid)
                })), a = Re(t), s = Re(r).filter((function (t) {
                    return a.indexOf(t) >= 0
                }));
                e.keepIds = (e.keepIds || []).concat(s), i.forEach((function (t) {
                    return n.removeChildren(t, o, e)
                })), t.each((function (t) {
                    return n.onAdd(t)
                }))
            }, n.prototype.resetFromString = function (t, e) {
                var n, o;
                void 0 === t && (t = ''), void 0 === e && (e = {}), e.keepIds = Re(this);
                var r = this, i = r.domc, a = r.em, s = r.parent, l = null == a ? void 0 : a.Css,
                    c = (null == i ? void 0 : i.allById()) || {}, u = this.parseString(t, e), p = Ve(u, c, e),
                    d = e.visitedCmps, f = void 0 === d ? {} : d;
                Object.keys(f).forEach((function (t) {
                    var e = f[t];
                    if (e.length) {
                        var n = (null == l ? void 0 : l.getRules("#".concat(t))) || [];
                        n.length && e.forEach((function (t) {
                            n.forEach((function (e) {
                                var n = e.clone();
                                n.set('selectors', ["#".concat(t.attributes.id)]), l.getAll().add(n)
                            }))
                        }))
                    }
                })), this.reset(p, e), null == a || a.trigger('component:content', s, e, t), null === (o = (n = s).__checkInnerChilds) || void 0 === o || o.call(n)
            }, n.prototype.removeChildren = function (t, e, n) {
                var o = this;
                if (void 0 === n && (n = {}), t) {
                    var r = this.domc, i = this.em, a = n.temporary || n.fromUndo;
                    if (t.prevColl = this, !a) {
                        var s = t.getId(), l = i.Selectors.getAll(), c = i.Css.getAll(),
                            u = (n.keepIds || []).indexOf(s) < 0;
                        delete (r ? r.allById() : {})[s];
                        var p = u ? c.remove(c.filter((function (t) {
                            return t.getSelectors().getFullString() === "#".concat(s)
                        })), n) : [];
                        l.remove(p.map((function (t) {
                            return t.getSelectors().at(0)
                        }))), t.opt.temporary || (i.Commands.run('core:component-style-clear', {target: t}), t.views.forEach((function (e) {
                            e.scriptContainer && t.emitWithEditor($.I.scriptUnmount, {component: t, view: e, el: e.el})
                        })), t.removed(), t.trigger('removed'), i.trigger($.I.remove, t), r && Gt(t) && Yt(t) && r.symbols.__trgEvent(r.events.symbolInstanceRemove, {component: t}, !0));
                        var d = t.components();
                        d.forEach((function (t) {
                            se(t, t, d, Le(Le({}, n), {skipRefsUp: !0})), o.removeChildren(t, e, n)
                        }))
                    }
                    var f = t.components();
                    if (i.stopListening(f), i.stopListening(t), i.stopListening(t.get('classes')), t.__postRemove(), !t.opt.temporary) {
                        var h = function (t) {
                            t.emitWithEditor($.I.removed, t, {removeOptions: n}), t.components().forEach((function (t) {
                                return h(t)
                            }))
                        };
                        h(t)
                    }
                }
            }, n.prototype.model = function (t, e) {
                var n, o = e.collection.opt, r = o.em, i = r.Components.componentTypes;
                e.em = r, e.config = o.config, e.componentTypes = i, e.domc = o.domc;
                for (var a = 0; a < i.length; a++) {
                    if (i[a].id == t.type) {
                        n = i[a].model;
                        break
                    }
                }
                return n || (n = i[i.length - 1].model, r && t.type && r.logWarning("Component type '".concat(t.type, "' not found"), {
                    attrs: t,
                    options: e
                })), new n(t, e)
            }, n.prototype.parseString = function (t, e) {
                void 0 === e && (e = {});
                var n = this, o = n.em, r = n.domc, i = n.parent, a = null == i ? void 0 : i.is('wrapper'),
                    s = e.asDocument && a, l = o.Css, c = o.Parser.parseHtml(t, Le({asDocument: s}, e.parserOptions)),
                    u = c.html;
                if (a && c.doctype) {
                    var p = i, d = c.html || {}, f = d.components, h = void 0 === f ? [] : f, v = Ie(d, ["components"]),
                        g = c.head || {}, y = g.components, m = Ie(g, ["components"]);
                    u = h, p.set(v, e), p.head.set(m, e), p.head.components(y, e), p.docEl.set(c.root, e), p.set({doctype: c.doctype})
                }
                if (jn.checkId(u, c.css, r.componentsById, e), c.css && l && !e.temporary) {
                    e.at;
                    var b = Ie(e, ["at"]);
                    l.addCollection(c.css, Le(Le({}, b), {extend: 1}))
                }
                return u
            }, n.prototype.add = function (n, o) {
                var r = this;
                if (void 0 === o && (o = {}), null != n) {
                    o.keepIds = Ne(Ne([], o.keepIds || [], !0), Re(o.previousModels), !0), (0, t.isString)(n) ? n = this.parseString(n, o) : (0, t.isArray)(n) && (n = Ne([], n, !0)).forEach((function (e, i) {
                        if ((0, t.isString)(e)) {
                            var a = r.parseString(e, o);
                            n[i] = (0, t.isArray)(a) && !a.length ? null : a
                        }
                    }));
                    var i = ((0, t.isArray)(n) ? n : [n]).filter(Boolean).map((function (t) {
                        return r.processDef(t)
                    }));
                    return n = (0, t.isArray)(n) ? (0, t.flatten)(i, 1) : i[0], e.prototype.add.call(this, n, o)
                }
            }, n.prototype.processDef = function (e) {
                if (e.cid && e.ccid) return e;
                var n = this.em, o = this.config, r = (void 0 === o ? {} : o).processor, i = e;
                if (r) {
                    var a = r(i = Le({}, i));
                    a && ((0, t.each)(i, (function (t, e) {
                        return delete i[e]
                    })), (0, t.extend)(i, a))
                }
                if (i.$$typeof && 'object' == typeof i.props) {
                    (i = Le({}, i)).props = Le({}, i.props);
                    var s = n.Components, l = n.Parser.parserHtml;
                    (0, t.each)(i, (function (e, n) {
                        (0, t.includes)(['props', 'type'], n) || delete i[n]
                    }));
                    var c = i.props, u = c.children;
                    delete c.children, delete i.props;
                    var p = l.splitPropsFromAttr(c);
                    i.attributes = p.attrs, u && (i.components = u), i.type ? s.getType(i.type) || (i.tagName = i.type, delete i.type) : i.type = 'textnode', (0, t.extend)(i, p.props)
                }
                return i
            }, n.prototype.onAdd = function (e, n, o) {
                void 0 === o && (o = {});
                var r = this.domc, i = this.em, a = e.getStyle(), s = i && i.getConfig().avoidInlineStyle;
                if (r && r.Component.ensureInList(e), !(0, t.isEmpty)(a) && !s && i && i.getConfig().forceClass && !o.temporary) {
                    var l = e.cid;
                    i.Css.setClassRule(l, a), e.setStyle({}), e.addClass(l)
                }
                if (e.__postAdd({recursive: !0}), i && !o.temporary) {
                    var c = function (t) {
                        i.trigger($.I.add, t, o), t.components().forEach((function (t) {
                            return c(t)
                        }))
                    };
                    c(e), r && Gt(e) && Yt(e) && r.symbols.__trgEvent(r.events.symbolInstanceAdd, {component: e}, !0)
                }
            }, n
        }(u.pM);
        const He = Fe;
        var Ue = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ze = 1, Be = 2, We = function (e) {
            function n(t, o) {
                void 0 === o && (o = {});
                var r = e.call(this, t, o) || this, i = o.config, a = void 0 === i ? {} : i, s = r.get('name'),
                    l = r.get('label');
                s ? l || r.set('label', s) : r.set('name', l);
                var c = r.get('name'), u = a.escapeName, p = u ? u(c) : n.escapeName(c);
                return r.set('name', p), r.em = o.em, r
            }

            return Ue(n, e), n.prototype.defaults = function () {
                return {name: '', label: '', type: ze, active: !0, private: !1, protected: !1, _undo: !0}
            }, n.prototype.isId = function () {
                return this.get('type') === Be
            }, n.prototype.isClass = function () {
                return this.get('type') === ze
            }, n.prototype.getFullName = function (t) {
                void 0 === t && (t = {});
                var e = t.escape, n = this.get('name'), o = '';
                switch (this.get('type')) {
                    case ze:
                        o = '.';
                        break;
                    case Be:
                        o = '#'
                }
                return o + (e ? e(n) : n)
            }, n.prototype.toString = function () {
                return this.getFullName()
            }, n.prototype.getName = function () {
                return this.get('name') || ''
            }, n.prototype.getLabel = function () {
                return this.get('label') || ''
            }, n.prototype.setLabel = function (t) {
                return this.set('label', t)
            }, n.prototype.getActive = function () {
                return !!this.get('active')
            }, n.prototype.setActive = function (t) {
                return this.set('active', t)
            }, n.prototype.toJSON = function (e) {
                void 0 === e && (e = {});
                var n = this.em, o = u.Kx.prototype.toJSON.call(this, [e]), r = (0, t.result)(this, 'defaults');
                if (null == n ? void 0 : n.getConfig().avoidDefaults) {
                    (0, t.forEach)(r, (function (t, e) {
                        o[e] === t && delete o[e]
                    })), o.label === o.name && delete o.label;
                    var i = (0, t.keys)(o).length;
                    1 === i && o.name && (o = o.name), 2 === i && o.name && o.type && (o = this.getFullName())
                }
                return o
            }, n.escapeName = function (t) {
                return "".concat(t).trim().replace(/\s+/g, '-')
            }, n.TYPE_CLASS = ze, n.TYPE_ID = Be, n
        }(u.Kx);
        const $e = We;
        We.prototype.idAttribute = 'name';
        var qe = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ge = function (t, e) {
            return t.reduce((function (n, o, r) {
                return n.concat(Ge(t.slice(r + 1), "".concat(e).concat(o)))
            }), [e])
        }, Ke = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return qe(n, e), n.prototype.modelId = function (t) {
                return "".concat(t.name, "_").concat(t.type || $e.TYPE_CLASS)
            }, n.prototype.getStyleable = function () {
                return (0, t.filter)(this.models, (function (t) {
                    return t.getActive() && !t.get('private')
                }))
            }, n.prototype.getValid = function (e) {
                var n = (void 0 === e ? {} : e).noDisabled;
                return (0, t.filter)(this.models, (function (t) {
                    return !t.get('private')
                })).filter((function (t) {
                    return n ? t.get('active') : 1
                }))
            }, n.prototype.getFullString = function (t, e) {
                void 0 === e && (e = {});
                var n = [];
                return (t || this).forEach((function (t) {
                    return n.push(t.getFullName(e))
                })), e.sort && n.sort(), n.join('').trim()
            }, n.prototype.getFullName = function (t) {
                void 0 === t && (t = {});
                var e = t.combination, n = t.array, o = [], r = this.map((function (e) {
                    return e.getFullName(t)
                })).sort();
                return e ? r.forEach((function (t, e) {
                    o = o.concat(Ge(r.slice(e + 1), t))
                })) : o = r, n ? o : e ? o.join(',') : o.join('')
            }, n
        }(u.pM);
        const Ye = Ke;
        Ke.prototype.model = $e;
        var Xe = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Je = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        };
        const Ze = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Xe(e, t), e.prototype.defaults = function () {
                return {id: '', label: '', open: !0, attributes: {}}
            }, e.prototype.getId = function () {
                return this.get('id')
            }, e.prototype.getLabel = function () {
                return this.get('label')
            }, e
        }(u.Kx);

        function Qe(t) {
            var e = new Set, n = new Map, o = {items: []};
            t.forEach((function (t) {
                var r = t.category;
                if (r) {
                    e.add(r);
                    var i = n.get(r);
                    i ? i.push(t) : n.set(r, [t])
                } else o.items.push(t)
            }));
            var r = Array.from(e).map((function (t) {
                return {category: t, items: n.get(t) || []}
            }));
            return Je(Je([], r, !0), [o], !1)
        }

        var tn = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), en = 'category', nn = function (n) {
            function o() {
                return null !== n && n.apply(this, arguments) || this
            }

            return tn(o, n), o.prototype.initCategory = function (n) {
                var o = n.get(en), r = o instanceof Ze;
                if (o && !r) {
                    (0, t.isString)(o) ? o = {id: o, label: o} : (0, e.isObject)(o) && !o.id && (o.id = o.label);
                    var i = this.getCategories().add(o);
                    return n.set(en, i, {silent: !0}), i
                }
                if (r) {
                    i = o;
                    return this.getCategories().add(i), i
                }
            }, o
        }(u.pM), on = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), rn = function (n) {
            function o(t, e) {
                void 0 === e && (e = {});
                var o = n.call(this, t, e) || this, r = e.events, i = e.em, a = null == r ? void 0 : r.update;
                return i && a && o.on('change', (function (t, e) {
                    return i.trigger(a, {category: t, changes: t.changedAttributes(), options: e})
                })), o
            }

            return on(o, n), o.prototype.add = function (o, r) {
                return ((0, t.isArray)(o) ? o : [o]).forEach((function (t) {
                    return t && (t.id = (0, e.normalizeKey)("".concat(t.id)))
                })), n.prototype.add.call(this, o, r)
            }, o.prototype.get = function (o) {
                return n.prototype.get.call(this, (0, t.isString)(o) ? (0, e.normalizeKey)(o) : o)
            }, o
        }(u.pM);
        const an = rn;
        var sn;
        rn.prototype.model = Ze, function (t) {
            t["select"] = "trait:select", t["value"] = "trait:value", t["categoryUpdate"] = "trait:category:update", t["custom"] = "trait:custom", t["all"] = "trait"
        }(sn || (sn = {}));
        const ln = sn;
        var cn = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), un = void 0 && (void 0).__assign || function () {
            return un = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, un.apply(this, arguments)
        }, pn = function (n) {
            function o(t, e) {
                var o = n.call(this, t) || this, r = o.attributes, i = r.target, a = r.name;
                return !o.get('id') && o.set('id', a), i && o.setTarget(i), o.em = e, o
            }

            return cn(o, n), o.prototype.defaults = function () {
                return {
                    type: 'text',
                    label: '',
                    name: '',
                    unit: '',
                    step: 1,
                    value: '',
                    default: '',
                    placeholder: '',
                    category: '',
                    changeProp: !1,
                    options: []
                }
            }, Object.defineProperty(o.prototype, "parent", {
                get: function () {
                    return this.collection
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "category", {
                get: function () {
                    var t = this.get('category');
                    return t instanceof Ze ? t : void 0
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "component", {
                get: function () {
                    return this.target
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "changeProp", {
                get: function () {
                    return !!this.get('changeProp')
                }, enumerable: !1, configurable: !0
            }), o.prototype.setTarget = function (e) {
                if (e) {
                    var n = this.attributes, o = n.name, r = n.changeProp, i = n.value, a = n.getValue;
                    this.target = e, this.unset('target');
                    var s = r ? "change:".concat(o) : "change:attributes:".concat(o);
                    this.listenTo(e, s, this.targetUpdated);
                    var l = i || (a ? void 0 : this.getValue());
                    !(0, t.isUndefined)(l) && this.set({value: l}, {silent: !0})
                }
            }, o.prototype.getId = function () {
                return this.get('id')
            }, o.prototype.getType = function () {
                return this.get('type')
            }, o.prototype.getName = function () {
                return this.get('name')
            }, o.prototype.getLabel = function (t) {
                var e;
                void 0 === t && (t = {});
                var n = t.locale, o = void 0 === n || n, r = this.getId(), i = this.get('label') || this.getName();
                return o && (null === (e = this.em) || void 0 === e ? void 0 : e.t("traitManager.traits.labels.".concat(r))) || i
            }, o.prototype.getValue = function (t) {
                return this.getTargetValue(t)
            }, o.prototype.setValue = function (t, e) {
                var n = this;
                void 0 === e && (e = {});
                var o = this.component, r = this.em, i = e.partial, a = {}, s = this.attributes.setValue;
                s ? s({
                    value: t,
                    component: o,
                    editor: null == r ? void 0 : r.getEditor(),
                    trait: this,
                    partial: !!i,
                    options: e,
                    emitUpdate: function () {
                        return n.targetUpdated()
                    }
                }) : (i && (a.avoidStore = !0), this.setTargetValue(t, a))
            }, o.prototype.getDefault = function () {
                return this.get('default')
            }, o.prototype.getOptions = function () {
                return this.get('options') || []
            }, o.prototype.getOption = function (t) {
                var n = this, o = (0, e.isDef)(t) ? t : this.getValue();
                return this.getOptions().filter((function (t) {
                    return n.getOptionId(t) === o
                }))[0]
            }, o.prototype.getOptionId = function (t) {
                return t.id || t.value
            }, o.prototype.getOptionLabel = function (e, n) {
                var o;
                void 0 === n && (n = {});
                var r = n.locale, i = void 0 === r || r, a = (0, t.isString)(e) ? this.getOption(e) : e,
                    s = this.getOptionId(a), l = a.label || a.name || s, c = this.getName();
                return i && (null === (o = this.em) || void 0 === o ? void 0 : o.t("traitManager.traits.options.".concat(c, ".").concat(s))) || l
            }, o.prototype.getCategoryLabel = function (t) {
                void 0 === t && (t = {});
                var e = this.em, n = this.category, o = t.locale, r = void 0 === o || o,
                    i = null == n ? void 0 : n.getId(), a = null == n ? void 0 : n.getLabel();
                return r && (null == e ? void 0 : e.t("traitManager.categories.".concat(i))) || a || ''
            }, o.prototype.runCommand = function () {
                var e = this.em, n = this.attributes.command;
                if (n && e) return (0, t.isString)(n) ? e.Commands.run(n) : n(e.Editor, this)
            }, o.prototype.props = function () {
                return this.attributes
            }, o.prototype.targetUpdated = function () {
                var t = this.component, e = this.em, n = this.getTargetValue({useType: !0});
                this.set({value: n}, {fromTarget: 1});
                var o = {trait: this, component: t, value: n};
                t.trigger(ln.value, o), null == e || e.trigger(ln.value, o), null == e || e.trigger('trait:update', o)
            }, o.prototype.getTargetValue = function (e) {
                var n;
                void 0 === e && (e = {});
                var o, r = this.component, i = this.em, a = this.getName(), s = this.get('getValue'), l = e.skipResolve;
                if ((s ? o = s({
                    editor: null == i ? void 0 : i.getEditor(),
                    trait: this,
                    component: r
                }) : this.changeProp ? (o = r.get(a), l && (o = r.dataResolverWatchers.getPropsDefsOrValues((n = {}, n[a] = o, n))[a])) : o = r.getAttributes({skipResolve: l})[a], e.useType) && 'checkbox' === this.getType()) {
                    var c = this.attributes, u = c.valueTrue, p = c.valueFalse;
                    (0, t.isUndefined)(u) || u !== o ? (0, t.isUndefined)(p) || p !== o || (o = !1) : o = !0
                }
                return (0, t.isUndefined)(o) ? '' : o
            }, o.prototype.setTargetValue = function (e, n) {
                var o;
                void 0 === n && (n = {});
                var r = this.component, i = this.attributes, a = this.getName();
                if (!(0, t.isUndefined)(e)) {
                    var s = e;
                    if ('false' === e ? s = !1 : 'true' === e && (s = !0), 'checkbox' === this.getType()) {
                        var l = i.valueTrue, c = i.valueFalse;
                        s && !(0, t.isUndefined)(l) && (s = l), s || (0, t.isUndefined)(c) || (s = c)
                    }
                    var u = ((o = {})[a] = s, o);
                    u.__p = n.avoidStore ? null : void 0, this.changeProp ? r.set(u, n) : r.addAttributes(u, n)
                }
            }, o.prototype.setValueFromInput = function (t, e, n) {
                void 0 === e && (e = !0), void 0 === n && (n = {});
                var o = {value: t};
                this.set(o, un(un({}, n), {avoidStore: 1})), e && (this.set('value', '', n), this.set(o, n))
            }, o.prototype.getInitValue = function () {
                var t, e = this.component, n = this.getName();
                if (e) {
                    var o = e.get('attributes');
                    t = this.changeProp ? e.get(n) : o[n]
                }
                return t || this.get('value') || this.get('default')
            }, o
        }(u.Kx);
        const dn = pn;
        var fn = function () {
            function e(t) {
                void 0 === t && (t = {}), this.config = t
            }

            return e.prototype.build = function (e, n) {
                return (0, t.isString)(e) ? this.buildFromString(e, n) : new dn(e, n)
            }, e.prototype.buildFromString = function (t, e) {
                var n = {name: t, type: 'text'};
                if ('target' === t) n.type = 'select', n.default = !1, n.options = this.config.optionsTarget;
                return new dn(n, e)
            }, e
        }();
        const hn = fn;
        var vn = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), gn = function (e) {
            function n(t, n) {
                var o = e.call(this, t) || this;
                o.categories = new an;
                var r = n.em;
                o.em = r, o.categories = new an([], {
                    em: r,
                    events: {update: ln.categoryUpdate}
                }), o.on('add', o.handleAdd), o.on('reset', o.handleReset);
                var i = o.module, a = null == i ? void 0 : i.getConfig();
                return o.tf = new hn(a), o
            }

            return vn(n, e), Object.defineProperty(n.prototype, "module", {
                get: function () {
                    return this.em.Traits
                }, enumerable: !1, configurable: !0
            }), n.prototype.getCategories = function () {
                return this.categories
            }, n.prototype.handleReset = function (t, e) {
                var n = (void 0 === e ? {} : e).previousModels;
                (void 0 === n ? [] : n).forEach((function (t) {
                    return t.trigger('remove')
                }))
            }, n.prototype.handleAdd = function (t) {
                t.em = this.em;
                var e = this.target;
                e && (t.target = e), this.initCategory(t)
            }, n.prototype.setTarget = function (t) {
                this.target = t, this.models.forEach((function (e) {
                    return e.setTarget(t)
                }))
            }, n.prototype.add = function (n, o) {
                if (null != n) {
                    var r = this.target, i = this.em;
                    if ((0, t.isArray)(n)) {
                        for (var a = [], s = 0, l = n.length; s < l; s++) {
                            var c = n[s];
                            a[s] = c instanceof dn ? c : this.tf.build(c, i), a[s].setTarget(r)
                        }
                        return e.prototype.add.call(this, a, o)
                    }
                    var u = n instanceof dn ? n : this.tf.build(n, i);
                    return u.setTarget(r), e.prototype.add.call(this, u, o)
                }
            }, n
        }(nn);
        const yn = gn;
        var mn = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), bn = void 0 && (void 0).__assign || function () {
                return bn = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, bn.apply(this, arguments)
            }, _n = void 0 && (void 0).__rest || function (t, e) {
                var n = {};
                for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
                if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                    var r = 0;
                    for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
                }
                return n
            }, wn = void 0 && (void 0).__spreadArray || function (t, e, n) {
                if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                return t.concat(o || Array.prototype.slice.call(e))
            }, xn = function (t) {
                return t.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
            }, Cn = function (t) {
                return !!(null == t ? void 0 : t.getConfig().avoidInlineStyle)
            }, Sn = 'component:drag', On = '__symbols', Tn = '__symbol', Pn = '__symbol_ovrd', En = $.I.update,
            kn = $.I.updateInside, An = function (n) {
                function o(e, r) {
                    void 0 === e && (e = {});
                    var i = this, a = r.em;
                    i = n.call(this, e, r) || this, (0, t.bindAll)(i, '__upSymbProps', '__upSymbCls', '__upSymbComps', 'syncOnComponentChange');
                    var s = i.parent(), l = null == s ? void 0 : s.attributes, c = i.get('propagate');
                    if (c && i.set('propagate', (0, t.isArray)(c) ? c : [c]), l && l.propagate && !c) {
                        var u = {}, p = l.propagate;
                        p.forEach((function (t) {
                            return u[t] = s.get(t)
                        })), u.propagate = p, i.set(bn(bn({}, u), e))
                    }
                    r && r.config && r.config.voidElements.indexOf(i.get('tagName')) >= 0 && i.set('void', !0), r.em = a, i.opt = r, i.em = a, i.config = r.config || {};
                    var d = i.dataResolverWatchers.getDynamicAttributesDefs();
                    if (i.setAttributes(bn(bn(bn({}, (0, t.result)(i, 'defaults').attributes || {}), i.get('attributes') || {}), d)), i.ccid = o.createId(i, r), i.preInit(), i.initClasses(), i.initComponents(), i.initTraits(), i.initToolbar(), i.initScriptProps(), i.listenTo(i, 'change:script', i.scriptUpdated), i.listenTo(i, 'change:tagName', i.tagUpdated), i.listenTo(i, 'change:attributes', i.attrUpdated), i.listenTo(i, 'change:attributes:id', i._idUpdated), i.on('change:toolbar', i.__emitUpdateTlb), i.on('change', i.__onChange), i.on(kn, i.__propToParent), i.set('status', ''), i.views = [], ['classes', 'traits', 'components'].forEach((function (t) {
                        var e = "add remove reset ".concat('components' !== t ? 'change' : '');
                        i.listenTo(i.get(t), e.trim(), (function () {
                            for (var e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
                            return i.emitUpdate.apply(i, wn([t], e, !1))
                        }))
                    })), !r.temporary) {
                        var f = a && a.Css, h = i.attributes, v = h.styles, g = h.type;
                        v && f && f.addCollection(v, {avoidUpdateStyle: !0}, {group: "cmp:".concat(g)}), i._moveInlineStyleToRule(), i.__postAdd(), i.init(), Kt(i) && Xt(i), null == a || a.trigger($.I.create, i, r)
                    }
                    return Cn(a) && i.dataResolverWatchers.disableStyles(), i
                }

                return mn(o, n), Object.defineProperty(o.prototype, "defaults", {
                    get: function () {
                        var t;
                        return (t = {
                            tagName: 'div',
                            type: '',
                            name: '',
                            removable: !0,
                            draggable: !0,
                            droppable: !0,
                            badgable: !0,
                            stylable: !0,
                            'stylable-require': '',
                            'style-signature': '',
                            unstylable: '',
                            highlightable: !0,
                            copyable: !0,
                            resizable: !1,
                            editable: !1,
                            layerable: !0,
                            selectable: !0,
                            hoverable: !0,
                            void: !1,
                            state: '',
                            status: '',
                            content: '',
                            icon: '',
                            style: '',
                            styles: '',
                            classes: '',
                            script: '',
                            'script-props': '',
                            'script-export': '',
                            attributes: {},
                            traits: ['id', 'title'],
                            propagate: '',
                            dmode: '',
                            toolbar: null,
                            delegate: null
                        })[Tn] = 0, t[On] = 0, t[Pn] = 0, t._undo = !0, t._undoexc = ['status', 'open'], t
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "tagName", {
                    get: function () {
                        return this.get('tagName')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "classes", {
                    get: function () {
                        return this.get('classes')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "traits", {
                    get: function () {
                        return this.get('traits')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "content", {
                    get: function () {
                        var t;
                        return null !== (t = this.get('content')) && void 0 !== t ? t : ''
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "toolbar", {
                    get: function () {
                        return this.get('toolbar') || []
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "resizable", {
                    get: function () {
                        return this.get('resizable')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "delegate", {
                    get: function () {
                        return this.get('delegate')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "locked", {
                    get: function () {
                        return this.get('locked')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "frame", {
                    get: function () {
                        return this.opt.frame
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "page", {
                    get: function () {
                        var t;
                        return null === (t = this.frame) || void 0 === t ? void 0 : t.getPage()
                    }, enumerable: !1, configurable: !0
                }), o.prototype.getType = function () {
                    return this.get('type') || 'default'
                }, o.prototype.preInit = function () {
                }, o.prototype.init = function () {
                }, o.prototype.updated = function (t, e, n) {
                }, o.prototype.removed = function () {
                }, o.prototype.set = function (t, e, o) {
                    var r, i, a = {skipWatcherUpdates: !1, fromDataSource: !1};
                    'object' == typeof t ? (i = t, a = e || a) : 'string' == typeof t ? ((r = {})[t] = e, i = r, a = o || a) : (i = {}, a = o || a), this.dataResolverWatchers = this.dataResolverWatchers || a.dataResolverWatchers;
                    var s = this.dataResolverWatchers.addProps(i, a);
                    return n.prototype.set.call(this, s, a)
                }, o.prototype.onCollectionsStateMapUpdate = function (t) {
                    this.collectionsStateMap = t, this.dataResolverWatchers.onCollectionsStateMapUpdate(), this.components().forEach((function (e) {
                        return e.onCollectionsStateMapUpdate(t)
                    }))
                }, o.prototype.syncComponentsCollectionState = function () {
                    this.stopListening(this.components(), 'add remove reset', this.syncOnComponentChange), this.listenTo(this.components(), 'add remove reset', this.syncOnComponentChange), this.components().forEach((function (t) {
                        return t.syncComponentsCollectionState()
                    }))
                }, o.prototype.stopSyncComponentCollectionState = function () {
                    this.stopListening(this.components(), 'add remove reset', this.syncOnComponentChange), this.collectionsStateMap = {}, this.components().forEach((function (t) {
                        return t.stopSyncComponentCollectionState()
                    }))
                }, o.prototype.syncOnComponentChange = function (t, e, n) {
                    var o = this;
                    if (this.collectionsStateMap && Object.keys(this.collectionsStateMap).length) {
                        var r = n || e || {};
                        if (n) if (r.add) {
                            var i = t;
                            i.syncComponentsCollectionState(), i.onCollectionsStateMapUpdate(this.collectionsStateMap)
                        } else {
                            t.stopSyncComponentCollectionState()
                        } else (r.previousModels || []).forEach((function (t) {
                            return t.stopSyncComponentCollectionState()
                        })), this.components().forEach((function (t) {
                            t.syncComponentsCollectionState(), t.onCollectionsStateMapUpdate(o.collectionsStateMap)
                        }))
                    }
                }, o.prototype.__postAdd = function (t) {
                    void 0 === t && (t = {});
                    var e = this.em, n = null == e ? void 0 : e.UndoManager, o = this.components();
                    n && !this.__hasUm && (n.add(o), n.add(this.getSelectors()), this.__hasUm = !0), t.recursive && o.map((function (e) {
                        return e.__postAdd(t)
                    }))
                }, o.prototype.__postRemove = function () {
                    var t = this.em, e = null == t ? void 0 : t.UndoManager;
                    e && (e.remove(this.components()), e.remove(this.getSelectors()), delete this.__hasUm)
                }, o.prototype.__onChange = function (n, o) {
                    var r = this, i = this.changedAttributes() || {};
                    (0, t.keys)(i).forEach((function (t) {
                        return r.emitUpdate(t)
                    })), ['status', 'open', 'toolbar', 'traits'].forEach((function (t) {
                        return delete i[t]
                    })), (0, e.isEmptyObj)(i) || (this.__changesUp(o), this.__propSelfToParent({
                        component: this,
                        changed: i,
                        options: o
                    }))
                }, o.prototype.__onStyleChange = function (e) {
                    var n = this;
                    if (this.em) {
                        var o = (0, t.keys)(e), r = {style: e};
                        this.emitWithEditor($.I.styleUpdate, this, r), o.forEach((function (t) {
                            return n.emitWithEditor("".concat($.I.styleUpdateProperty).concat(t), n, r)
                        }));
                        var i = this.collectionsStateMap, a = Object.keys(i);
                        if (a.length) if (a.every((function (t) {
                            return i[t].currentIndex === i[t].startIndex
                        }))) te(this).forEach((function (t) {
                            var n = t.collectionsStateMap;
                            Object.keys(n).every((function (t) {
                                return a.includes(t)
                            })) && t.addStyle(e)
                        }))
                    }
                }, o.prototype.__changesUp = function (t) {
                    var e = this.em;
                    [this.frame, e].forEach((function (e) {
                        return e && e.changesUp(t)
                    }))
                }, o.prototype.__propSelfToParent = function (t) {
                    this.trigger(En, t), this.__propToParent(t)
                }, o.prototype.__propToParent = function (t) {
                    var e = this.parent();
                    e && e.trigger(kn, t)
                }, o.prototype.__emitUpdateTlb = function () {
                    this.emitUpdate('toolbar')
                }, o.prototype.__getAllById = function () {
                    var t = this.em;
                    return t ? t.Components.allById() : {}
                }, o.prototype.__upSymbProps = function (t, n) {
                    void 0 === n && (n = {}), function (t, n) {
                        void 0 === n && (n = {});
                        var o = t.dataResolverWatchers.getPropsDefsOrValues(Wt({}, t.changedAttributes())),
                            r = t.dataResolverWatchers.getAttributesDefsOrValues(Wt({}, o.attributes));
                        if (re(o, r), !(0, e.isEmptyObj)(o)) {
                            var i = te(t, n);
                            ie(o, t), oe(t, 'props', i, {opts: n, changed: o}), i.forEach((function (e) {
                                var r = Wt({}, o);
                                ie(r, e), e.set(r, Wt({fromInstance: t}, n))
                            }))
                        }
                    }(this, n)
                }, o.prototype.__upSymbCls = function (t, e, n) {
                    void 0 === n && (n = {}), function (t, e) {
                        void 0 === e && (e = {});
                        var n = te(t, e);
                        oe(t, 'classes', n, {opts: e}), n.forEach((function (e) {
                            e.set('classes', t.get('classes'), {fromInstance: t})
                        })), t.__changesUp(e)
                    }(this, n)
                }, o.prototype.__upSymbComps = function (t, e, n) {
                    se(this, t, e, n)
                }, o.prototype.__onDestroy = function () {
                }, o.prototype.is = function (t) {
                    return !(this.get('type') != t)
                }, o.prototype.props = function () {
                    return this.attributes
                }, o.prototype.index = function () {
                    var t = this.collection;
                    return t ? t.indexOf(this) : 0
                }, o.prototype.setDragMode = function (t) {
                    return this.set('dmode', t)
                }, o.prototype.getDragMode = function () {
                    return this.get('dmode') || ''
                }, o.prototype.setSymbolOverride = function (e, n) {
                    var o, r;
                    void 0 === n && (n = {}), this.set(((o = {})[Pn] = null !== (r = (0, t.isString)(e) ? [e] : e) && void 0 !== r ? r : 0, o), n)
                }, o.prototype.getSymbolOverride = function () {
                    return this.get(Pn)
                }, o.prototype.find = function (t) {
                    var e, n = [], o = null === (e = this.view) || void 0 === e ? void 0 : e.$el.find(t);
                    return null == o || o.each((function (t) {
                        var e = o.eq(t).data('model');
                        e && n.push(e)
                    })), n
                }, o.prototype.findType = function (t) {
                    var e = [], n = function (o) {
                        return o.forEach((function (o) {
                            o.is(t) && e.push(o), n(o.components())
                        }))
                    };
                    return n(this.components()), e
                }, o.prototype.findFirstType = function (t) {
                    return this.findType(t).at(0)
                }, o.prototype.closest = function (t) {
                    var e, n = null === (e = this.view) || void 0 === e ? void 0 : e.$el.closest(t);
                    return (null == n ? void 0 : n.length) ? n.data('model') : void 0
                }, o.prototype.closestType = function (t) {
                    for (var e = this.parent(); e && !e.is(t);) e = e.parent();
                    return e
                }, o.prototype.contains = function (t) {
                    var e = !1;
                    if (!t) return e;
                    var n = function (o) {
                        !e && o.forEach((function (o) {
                            o === t && (e = !0), !e && n(o.components())
                        }))
                    };
                    return n(this.components()), e
                }, o.prototype.tagUpdated = function () {
                    this.trigger('rerender')
                }, o.prototype.replaceWith = function (e, n) {
                    void 0 === n && (n = {});
                    var o = this.collection, r = o.indexOf(this);
                    o.remove(this);
                    var i = o.add(e, bn(bn({}, n), {at: r}));
                    return (0, t.isArray)(i) ? i : [i]
                }, o.prototype.attrUpdated = function (n, o, r) {
                    var i = this;
                    void 0 === r && (r = {});
                    var a = this.get('attributes'), s = a.class;
                    s && this.setClass(s), delete a.class;
                    var l = a.style;
                    l && this.setStyle(l, r), delete a.style;
                    var c = bn({}, this.previous('attributes')), u = (0, e.shallowDiff)(c, this.get('attributes'));
                    (0, t.keys)(u).forEach((function (t) {
                        var e, n = "attributes:".concat(t);
                        i.trigger("change:".concat(n), i, u[t], r), null === (e = i.em) || void 0 === e || e.trigger("".concat(En, ":").concat(n), i, u[t], r)
                    }))
                }, o.prototype.setAttributes = function (t, e) {
                    return void 0 === e && (e = {
                        skipWatcherUpdates: !1,
                        fromDataSource: !1
                    }), this.set('attributes', bn({}, t), e), this
                }, o.prototype.addAttributes = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.dataResolverWatchers.getDynamicAttributesDefs();
                    return this.setAttributes(bn(bn(bn({}, this.getAttributes({noClass: !0, noStyle: !0})), n), t), e)
                }, o.prototype.removeAttributes = function (t, e) {
                    void 0 === t && (t = []), void 0 === e && (e = {});
                    var n = Array.isArray(t) ? t : [t];
                    this.dataResolverWatchers.removeAttributes(n);
                    var o = this.getAttributes();
                    return n.map((function (t) {
                        return delete o[t]
                    })), this.setAttributes(o, e)
                }, o.prototype.getStyle = function (e, o) {
                    void 0 === e && (e = {}), void 0 === o && (o = {});
                    var r = this.em, i = (0, t.isString)(e), a = i ? e : '', s = i || '' === e ? o : e,
                        l = !!(null == s ? void 0 : s.skipResolve);
                    if (Cn(r) && !s.inline) {
                        var c = r.get('state'), u = r.Css.getIdRule(this.getId(), bn({state: c}, s));
                        return this.rule = u, u ? u.getStyle(a, {skipResolve: l}) : {}
                    }
                    return n.prototype.getStyle.call(this, a, {skipResolve: l})
                }, o.prototype.setStyle = function (o, r) {
                    var i = this;
                    void 0 === o && (o = {}), void 0 === r && (r = {});
                    var a = this.opt, s = this.em;
                    if (!Cn(s) || a.temporary || r.inline) o = n.prototype.setStyle.apply(this, arguments); else {
                        var l = this.get('style') || {};
                        o = (0, t.isString)(o) ? this.parseStyle(o) : o, o = bn(bn({}, o), l);
                        var c = s.get('state'), u = s.Css, p = this.getStyle(bn(bn({}, r), {skipResolve: !0}));
                        this.rule = u.setIdRule(this.getId(), o, bn({state: c}, r));
                        var d = (0, e.shallowDiff)(p, o);
                        this.set('style', '', {silent: !0}), (0, t.keys)(d).forEach((function (t) {
                            return i.trigger("change:style:".concat(t))
                        }))
                    }
                    return a.temporary || this.__onStyleChange(r.addStyle || o), o
                }, o.prototype.getAttributes = function (n) {
                    void 0 === n && (n = {});
                    var o = this.em, r = [], i = n.skipResolve ? this.dataResolverWatchers.getDynamicAttributesDefs() : {},
                        a = bn(bn({}, this.get('attributes')), i), s = null == o ? void 0 : o.Selectors, l = this.getId();
                    if (n.noClass ? delete a.class : (this.classes.forEach((function (e) {
                        return r.push((0, t.isString)(e) ? e : e.getName())
                    })), r.length && (a.class = r.join(' '))), !n.noStyle) {
                        var c = this.getStyle({inline: !0});
                        (0, e.isObject)(c) && !(0, e.isEmptyObj)(c) && (a.style = this.styleToString({inline: !0}))
                    }
                    if (!(0, t.has)(a, 'id')) {
                        var u = !1;
                        !Cn(o) && (0, t.isEmpty)(this.getStyle()) || (u = !!(null == s ? void 0 : s.get(l, s.Selector.TYPE_ID))), (Kt(this) || this.get('script-export') || this.get('script')) && (u = !0), u && (a.id = l)
                    }
                    return a
                }, o.prototype.addClass = function (t) {
                    var e = this.em.Selectors.addClass(t);
                    return this.classes.add(e)
                }, o.prototype.setClass = function (t) {
                    return this.classes.reset(), this.addClass(t)
                }, o.prototype.removeClass = function (e) {
                    var n = [];
                    e = (0, t.isArray)(e) ? e : [e];
                    var o = this.classes, r = $e.TYPE_CLASS;
                    return e.forEach((function (t) {
                        t.split(' ').forEach((function (t) {
                            var e = o.where({name: t, type: r})[0];
                            e && n.push(o.remove(e))
                        }))
                    })), n
                }, o.prototype.getClasses = function () {
                    var t = this.getAttributes().class;
                    return t ? t.split(' ') : []
                }, o.prototype.initClasses = function (e, n, o) {
                    void 0 === o && (o = {});
                    var r = this.get('attributes') || {}, i = r.class, a = _n(r, ["class"]),
                        s = [this, 'change:classes', this.initClasses], l = this.get('classes') || i || [],
                        c = (0, t.isString)(l) ? l.split(' ') : l;
                    this.stopListening.apply(this, s);
                    var u = this.normalizeClasses(c), p = new Ye([]);
                    return this.set('classes', p, o), p.add(u), p.on('add remove reset', this.__upSymbCls), i && u.length && this.set('attributes', a), this.listenTo.apply(this, s), this
                }, o.prototype.initComponents = function () {
                    var e = [this, 'change:components', this.initComponents];
                    this.stopListening.apply(this, e);
                    var n = new He([], this.opt);
                    n.parent = this;
                    var o = this.get('components'), r = !this.opt.avoidChildren;
                    return this.set('components', n), r && o && n.add((0, t.isFunction)(o) ? o(this) : o, this.opt), n.on('add remove reset', this.__upSymbComps), this.listenTo.apply(this, e), this
                }, o.prototype.initTraits = function (e) {
                    var n = this, o = this.em, r = 'change:traits';
                    this.off(r, this.initTraits), this.__loadTraits();
                    var i = bn({}, this.get('attributes')), a = this.traits;
                    a.each((function (e) {
                        var o = e.getName(), r = e.getInitValue();
                        e.changeProp ? (0, t.isUndefined)(n.get(o)) && n.set(o, r) : o && r && (i[o] = r)
                    }));
                    var s = this.dataResolverWatchers.getDynamicAttributesDefs();
                    return a.length && this.setAttributes(bn(bn({}, i), s)), this.on(r, this.initTraits), e && o && o.trigger('component:toggled'), this
                }, o.prototype.initScriptProps = function () {
                    if (!this.opt.temporary) {
                        var t = 'script-props', e = ["change:".concat(t), this.initScriptProps];
                        this.off.apply(this, e);
                        var n = this.previous(t) || [], o = this.get(t) || [], r = n.map((function (t) {
                            return "change:".concat(t)
                        })).join(' '), i = o.map((function (t) {
                            return "change:".concat(t)
                        })).join(' ');
                        r && this.off(r, this.__scriptPropsChange), i && this.on(i, this.__scriptPropsChange), this.on.apply(this, e)
                    }
                }, o.prototype.__scriptPropsChange = function (t, e, n) {
                    void 0 === n && (n = {}), n.avoidStore || this.trigger('rerender')
                }, o.prototype.append = function (e, n) {
                    void 0 === n && (n = {});
                    var o = ((0, t.isArray)(e) ? wn([], e, !0) : [e]).map((function (e) {
                        return (0, t.isString)(e) || e.collection && e.collection.remove(e, {temporary: !0}), e
                    }));
                    return this.components().add(o, bn({action: $.t.add}, n))
                }, o.prototype.components = function (e, n) {
                    void 0 === n && (n = {});
                    var o = this.get('components');
                    return (0, t.isUndefined)(e) ? o : (o.reset(void 0, n), e ? this.append(e, n) : [])
                }, o.prototype.getChildAt = function (t) {
                    return this.components().at(t || 0) || void 0
                }, o.prototype.getLastChild = function () {
                    var t = this.components();
                    return t.at(t.length - 1) || null
                }, o.prototype.empty = function (t) {
                    return void 0 === t && (t = {}), this.components().reset(void 0, t), this
                }, o.prototype.parent = function (t) {
                    void 0 === t && (t = {});
                    var e = this.collection || t.prev && this.prevColl;
                    return e ? e.parent : void 0
                }, o.prototype.parents = function () {
                    var t = this.parent();
                    return t ? [t].concat(t.parents()) : []
                }, o.prototype.scriptUpdated = function () {
                    this.set('scriptUpdated', 1)
                }, o.prototype.initToolbar = function () {
                    var t = this.em, e = this, n = t && t.getConfig().stylePrefix || '';
                    if (!e.get('toolbar') && t) {
                        var o = [];
                        e.collection && o.push({
                            label: t.getIcon('arrowUp'), command: function (t) {
                                return t.runCommand('core:component-exit', {force: 1})
                            }
                        }), e.get('draggable') && o.push({
                            attributes: {
                                class: "".concat(n, "no-touch-actions"),
                                draggable: !0
                            }, label: t.getIcon('move'), command: 'tlb-move'
                        }), e.get('copyable') && o.push({
                            label: t.getIcon('copy'),
                            command: 'tlb-clone'
                        }), e.get('removable') && o.push({
                            label: t.getIcon('delete'),
                            command: 'tlb-delete'
                        }), e.set('toolbar', o)
                    }
                }, o.prototype.__loadTraits = function (e, n) {
                    void 0 === n && (n = {});
                    var o = e || this.traits;
                    if (!(o instanceof yn)) {
                        o = (0, t.isFunction)(o) ? o(this) : o;
                        var r = new yn([], this.opt);
                        r.setTarget(this), o.length && r.add(o), this.set({traits: r}, n)
                    }
                    return this
                }, o.prototype.getTraits = function () {
                    return this.__loadTraits(), wn([], this.traits.models, !0)
                }, o.prototype.setTraits = function (e) {
                    var n = (0, t.isArray)(e) ? e : [e];
                    return this.set({traits: n}), this.getTraits()
                }, o.prototype.getTrait = function (t) {
                    return this.getTraits().filter((function (e) {
                        return e.get('id') === t || e.get('name') === t
                    }))[0] || null
                }, o.prototype.updateTrait = function (t, e) {
                    var n, o = this.getTrait(t);
                    return o && o.set(e), null === (n = this.em) || void 0 === n || n.trigger('component:toggled'), this
                }, o.prototype.getTraitIndex = function (t) {
                    var e = this.getTrait(t);
                    return e ? this.traits.indexOf(e) : -1
                }, o.prototype.removeTrait = function (e) {
                    var n, o = this, r = ((0, t.isArray)(e) ? e : [e]).map((function (t) {
                        return o.getTrait(t)
                    })), i = this.traits, a = r.length ? i.remove(r) : [];
                    return null === (n = this.em) || void 0 === n || n.trigger('component:toggled'), (0, t.isArray)(a) ? a : [a]
                }, o.prototype.addTrait = function (e, n) {
                    var o;
                    void 0 === n && (n = {}), this.__loadTraits();
                    var r = this.traits.add(e, n);
                    return null === (o = this.em) || void 0 === o || o.trigger('component:toggled'), (0, t.isArray)(r) ? r : [r]
                }, o.prototype.normalizeClasses = function (t) {
                    var e = [], n = this.em, o = null == n ? void 0 : n.Selectors;
                    return o ? t.models ? wn([], t.models, !0) : (t.forEach((function (t) {
                        return e.push(o.add(t))
                    })), e) : []
                }, o.prototype.clone = function (t) {
                    var e;
                    void 0 === t && (t = {});
                    var n = this.em, o = bn(bn({}, this.attributes), this.dataResolverWatchers.getDynamicPropsDefs()),
                        r = bn({}, this.opt), i = this.getId(), a = null == n ? void 0 : n.Css;
                    o.attributes = bn({}, o.attributes ? this.dataResolverWatchers.getAttributesDefsOrValues(o.attributes) : void 0), o.components = [], o.classes = [], o.traits = [], Yt(this) && (t.symbol = !0), this.get('components').each((function (e, n) {
                        o.components[n] = e.clone(bn(bn({}, t), {_inner: 1}))
                    })), this.get('traits').each((function (t, e) {
                        o.traits[e] = t.clone()
                    })), this.get('classes').each((function (t, e) {
                        o.classes[e] = t.get('name')
                    })), o.status = '', r.collection = null, r.forCloning = !0;
                    var s = new this.constructor(o, r), l = "#".concat(s.getId());
                    (a ? a.getRules("#".concat(i)) : []).forEach((function (t) {
                        var e = t.clone();
                        e.set('selectors', [l]), a.getAll().add(e)
                    })), s.set(On, 0);
                    var c = Jt(this), u = Zt(this);
                    if (t.symbol || !c && !u) if (c) {
                        var p = null !== (e = Zt(c)) && void 0 !== e ? e : [];
                        c.set(On, wn(wn([], p, !0), [s], !1)), Xt(s)
                    } else t.symbol && (qt(this) ? (this.set(On, wn(wn([], u, !0), [s], !1)), s.set(Tn, this), Xt(s)) : t.symbolInv ? (this.set(On, [s]), s.set(Tn, this), [this, s].map((function (t) {
                        return Xt(t)
                    }))) : (s.set(On, [this]), [this, s].map((function (t) {
                        return Xt(t)
                    })), this.set(Tn, s))); else s.set(Tn, 0), s.set(On, 0);
                    var d = 'component:clone';
                    return n && n.trigger(d, s), this.trigger(d, s), s
                }, o.prototype.getName = function (t) {
                    void 0 === t && (t = {});
                    var n = this.em, o = this.attributes, r = o.type, i = o.tagName, a = o.name, s = r || i, l = r ? '' : i,
                        c = 'domComponents.names.', u = a && (null == n ? void 0 : n.t("".concat(c).concat(a))),
                        p = l && (null == n ? void 0 : n.t("".concat(c).concat(l))),
                        d = n && (n.t("".concat(c).concat(r)) || n.t("".concat(c).concat(i))), f = this.get('custom-name');
                    return (t.noCustom ? '' : f) || u || a || p || (0, e.capitalize)(l) || d || (0, e.capitalize)(s)
                }, o.prototype.setName = function (t, e) {
                    void 0 === e && (e = {}), this.set('custom-name', t, e)
                }, o.prototype.getIcon = function () {
                    var t = this.get('icon');
                    return t ? t + ' ' : ''
                }, o.prototype.toHTML = function (t) {
                    void 0 === t && (t = {});
                    var e = t.tag || this.get('tagName');
                    delete t.tag;
                    var n = this.__attrToString(t), o = n ? " ".concat(n) : '', r = this.getInnerHTML(t),
                        i = !r && this.get('void'), a = "<".concat(e).concat(o).concat(i ? '/' : '', ">").concat(r);
                    return !i && (a += "</".concat(e, ">")), a
                }, o.prototype.getInnerHTML = function (t) {
                    return this.__innerHTML(t)
                }, o.prototype.__innerHTML = function (t) {
                    void 0 === t && (t = {});
                    var e = this.components();
                    return e.length ? e.map((function (e) {
                        return e.toHTML(t)
                    })).join('') : this.content
                }, o.prototype.__attrToString = function (n) {
                    void 0 === n && (n = {});
                    var o = [], r = n.attributes, i = this.getAttrToHTML(n);
                    if (r && ((0, t.isFunction)(r) ? i = r(this, i) || {} : (0, e.isObject)(r) && (i = r)), n.withProps) {
                        var a = this.toJSON();
                        (0, t.forEach)(a, (function (n, o) {
                            '_' !== o[0] && ['classes', 'attributes', 'components'].indexOf(o) < 0 && (i["data-gjs-".concat(o)] = (0, t.isArray)(n) || (0, e.isObject)(n) ? JSON.stringify(n) : (0, t.isBoolean)(n) ? "".concat(n) : n)
                        }))
                    }
                    for (var s in i) {
                        var l = i[s];
                        if (!(0, t.isUndefined)(l) && null !== l) if ((0, t.isBoolean)(l)) l && o.push(s); else {
                            var c = '';
                            if (n.altQuoteAttr && (0, t.isString)(l) && l.indexOf('"') >= 0) c = "'".concat(l.replace(/'/g, '&apos;'), "'"); else {
                                var u = (0, t.isString)(l) ? l.replace(/"/g, '&quot;') : l;
                                c = "\"".concat(u, "\"")
                            }
                            o.push("".concat(s, "=").concat(c))
                        }
                    }
                    return o.join(' ')
                }, o.prototype.getAttrToHTML = function (t) {
                    var e = this.getAttributes();
                    return Cn(this.em) && !0 !== (null == t ? void 0 : t.keepInlineStyle) && delete e.style, e
                }, o.prototype.toJSON = function (e) {
                    void 0 === e && (e = {});
                    var n = a.Model.prototype.toJSON.call(this, e);
                    if ((n = bn(bn({}, n), this.dataResolverWatchers.getDynamicPropsDefs())).attributes = this.dataResolverWatchers.getAttributesDefsOrValues(this.getAttributes()), delete n.dataResolverWatchers, delete n.attributes.class, delete n.toolbar, delete n.traits, delete n.status, delete n.open, delete n._undoexc, delete n.delegate, this.collectionsStateMap && Object.getOwnPropertyNames(this.collectionsStateMap).length > 0 && (delete n[Tn], delete n[Pn], delete n[On], delete n.attributes.id), !e.fromUndo) {
                        var o = n[Tn], r = n[On];
                        r && (0, t.isArray)(r) && (n[On] = r.filter((function (t) {
                            return t
                        })).map((function (t) {
                            return t.getId ? t.getId() : t
                        }))), o && !(0, t.isString)(o) && (n[Tn] = o.getId())
                    }
                    return this.em.getConfig().avoidDefaults && this.getChangedProps(n), n
                }, o.prototype.getChangedProps = function (e) {
                    var n = e || a.Model.prototype.toJSON.apply(this), o = (0, t.result)(this, 'defaults');
                    return (0, t.forEach)(o, (function (t, e) {
                        -1 === ['type'].indexOf(e) && n[e] === t && delete n[e]
                    })), (0, t.isEmpty)(n.type) && delete n.type, (0, t.forEach)(['attributes', 'style'], (function (e) {
                        (0, t.isEmpty)(o[e]) && (0, t.isEmpty)(n[e]) && delete n[e]
                    })), (0, t.forEach)(['classes', 'components'], (function (e) {
                        (!n[e] || (0, t.isEmpty)(o[e]) && !n[e].length) && delete n[e]
                    })), n
                }, o.prototype.getId = function () {
                    var t = this.get('attributes') || {}, e = fe(this), n = e.shouldSync, o = e.itemId;
                    return n && (t.id = o), t.id || this.ccid || this.cid
                }, o.prototype.setId = function (t, e) {
                    return this.addAttributes({id: t}, e), this
                }, o.prototype.getEl = function (t) {
                    var e = this.getView(t);
                    return e && e.el
                }, o.prototype.getView = function (t) {
                    var e = this, n = e.view, o = e.views, r = e.em,
                        i = t || (null == r ? void 0 : r.getCurrentFrameModel());
                    return i && (n = o.filter((function (t) {
                        return t.frameView === i.view
                    }))[0]), n
                }, o.prototype.getCurrentView = function () {
                    var t = this.em.getCurrentFrame(), e = null == t ? void 0 : t.model;
                    return this.getView(e)
                }, o.prototype.__getScriptProps = function () {
                    var t = this.props();
                    return (this.get('script-props') || []).reduce((function (e, n) {
                        return e[n] = t[n], e
                    }), {})
                },o.prototype.getScriptString = function (e) {
                    var n = this, o = e || this.get('script') || '';
                    if (!o) return o;
                    if (this.get('script-props')) o = o.toString().trim(); else {
                        if ((0, t.isFunction)(o)) {
                            var r = o.toString().trim();
                            o = (r = r.slice(r.indexOf('{') + 1, r.lastIndexOf('}'))).trim()
                        }
                        var i = this.em.getConfig(), a = xn(i.tagVarStart || '{[ '), s = xn(i.tagVarEnd || ' ]}'),
                            l = new RegExp("".concat(a, "([\\w\\d-]*)").concat(s), 'g');
                        o = o.replace(l, (function (e, o) {
                            n.scriptUpdated();
                            var r = n.attributes[o] || '';
                            return (0, t.isArray)(r) || 'object' == typeof r ? JSON.stringify(r) : r
                        }))
                    }
                    return o
                },o.prototype.emitUpdate = function (t) {
                    for (var e, n = [], o = 1; o < arguments.length; o++) n[o - 1] = arguments[o];
                    var r = this.em, i = En + (t ? ":".concat(t) : ''), a = t && this.get(t);
                    t && this.updated.apply(this, wn([t, a, t && this.previous(t)], n, !1)), this.trigger.apply(this, wn([i], n, !1)), r && r.trigger.apply(r, wn([i, this], n, !1)), ['components', 'classes'].indexOf(t) >= 0 && this.__propSelfToParent({
                        component: this,
                        changed: (e = {}, e[t] = a, e),
                        options: n[2] || n[1] || {}
                    })
                },o.prototype.emitWithEditor = function (t, e, n) {
                    [this.em, this].forEach((function (o) {
                        return null == o ? void 0 : o.trigger(t, e, n)
                    }))
                },o.prototype.onAll = function (e) {
                    return (0, t.isFunction)(e) && (e(this), this.components().forEach((function (t) {
                        return t.onAll(e)
                    }))), this
                },o.prototype.forEachChild = function (e) {
                    (0, t.isFunction)(e) && this.components().forEach((function (t) {
                        e(t), t.forEachChild(e)
                    }))
                },o.prototype.remove = function (t) {
                    var e = this;
                    void 0 === t && (t = {});
                    var n = this.em, o = this.collection, r = function () {
                        o && o.remove(e, bn({action: $.t.remove}, t)), o || (e.components('', t), e.components().removeChildren(e, void 0, t))
                    }, i = bn({}, t);
                    return [this, n].map((function (t) {
                        return t.trigger($.I.removeBefore, e, r, i)
                    })), !i.abort && r(), this
                },o.prototype.destroy = function (t) {
                    return this.stopListening(this.components(), 'add remove reset', this.syncOnComponentChange), this.dataResolverWatchers.destroy(), this.__onDestroy(), n.prototype.destroy.call(this, t)
                },o.prototype.move = function (t, e) {
                    if (void 0 === e && (e = {}), t) {
                        var n = e.at, o = this.index(), r = t === this.parent();
                        if (!r || !(o === n || o === n - 1)) {
                            r && n && n > o && (e.at = n - 1);
                            var i = $.t.move;
                            this.remove({action: i, temporary: 1}), t.append(this, bn({action: i}, e)), this.emitUpdate()
                        }
                    }
                    return this
                },o.prototype.isInstanceOf = function (t) {
                    var e, n,
                        o = null === (n = null === (e = this.em) || void 0 === e ? void 0 : e.Components.getType(t)) || void 0 === n ? void 0 : n.model;
                    if (!o) return !1;
                    var r = this.constructor.typeExtends;
                    return this instanceof o || r.has(t)
                },o.prototype.isChildOf = function (e) {
                    for (var n = (0, t.isString)(e), o = this.parent(); o;) {
                        if (n) {
                            if (o.isInstanceOf(e)) return !0
                        } else if (o === e) return !0;
                        o = o.parent()
                    }
                    return !1
                },o.prototype.resetId = function (t) {
                    void 0 === t && (t = {});
                    var e = this.em, n = this.getId();
                    if (!n) return this;
                    var r = o.createId(this);
                    this.setId(r);
                    var i = null == e ? void 0 : e.Css.getIdRule(n), a = null == i ? void 0 : i.get('selectors').at(0);
                    return null == a || a.set('name', r), this
                },o.prototype._getStyleRule = function (t) {
                    var e = (void 0 === t ? {} : t).id, n = this.em, o = e || this.getId();
                    return null == n ? void 0 : n.Css.getIdRule(o)
                },o.prototype._getStyleSelector = function (t) {
                    var e = this._getStyleRule(t);
                    return null == e ? void 0 : e.get('selectors').at(0)
                },o.prototype._moveInlineStyleToRule = function () {
                    var n = this.get('style'),
                        o = (0, t.isString)(n) && n.length > 0 || (0, e.isObject)(n) && Object.keys(n).length > 0;
                    Cn(this.em) && o && (this.addStyle(n), this.set('style', ''))
                },o.prototype._idUpdated = function (t, e, n) {
                    if (void 0 === n && (n = {}), !n.idUpdate) {
                        var r = this.ccid, i = (this.get('attributes') || {}).id,
                            a = (this.previous('attributes') || {}).id || r, s = o.getList(this);
                        if (s[i] || !i && a) return this.setId(a, {idUpdate: !0});
                        delete s[a], s[i] = this, this.ccid = i;
                        var l = this._getStyleSelector({id: a});
                        l && l.set({name: i, label: i})
                    }
                },o.getDefaults = function () {
                    return (0, t.result)(this.prototype, 'defaults')
                },o.isComponent = function (t, n) {
                    return {tagName: (0, e.toLowerCase)(t.tagName)}
                },o.ensureInList = function (t) {
                    var e = o.getList(t), n = t.getId(), r = e[n];
                    if (r) {
                        if (r !== t) {
                            var i = o.getIncrementId(n, e);
                            t.setId(i), e[i] = t
                        }
                    } else e[n] = t;
                    t.components().forEach((function (t) {
                        return o.ensureInList(t)
                    }))
                },o.createId = function (t, e) {
                    void 0 === e && (e = {});
                    var n, r = o.getList(t), i = e.idMap, a = void 0 === i ? {} : i, s = t.get('attributes').id;
                    return s ? (n = o.getIncrementId(s, r, e), t.setId(n), s !== n && (a[s] = n)) : n = o.getNewId(r), r[n] = t, n
                },o.getNewId = function (t) {
                    for (var e = Object.keys(t).length.toString().length + 2, n = (Math.random() + 1.1).toString(36).slice(-e), r = "i".concat(n); t[r];) r = o.getNewId(t);
                    return r
                },o.getIncrementId = function (t, e, n) {
                    void 0 === n && (n = {});
                    var o = n.keepIds, r = 1, i = t;
                    if ((void 0 === o ? [] : o).indexOf(t) < 0) for (; e[i];) r++, i = "".concat(t, "-").concat(r);
                    return i
                },o.getList = function (t) {
                    var e, n = t.em, o = null == n ? void 0 : n.Components;
                    return null !== (e = null == o ? void 0 : o.componentsById) && void 0 !== e ? e : {}
                },o.checkId = function (e, n, r, i) {
                    void 0 === n && (n = []), void 0 === r && (r = {}), void 0 === i && (i = {});
                    var a = (0, t.isArray)(e) ? e : [e], s = i.keepIds, l = void 0 === s ? [] : s, c = i.idMap,
                        u = void 0 === c ? {} : c;
                    a.forEach((function (e) {
                        e.attributes;
                        var a = e.attributes, s = void 0 === a ? {} : a, c = e.components, p = s.id;
                        if (p && r[p] && l.indexOf(p) < 0) {
                            var d = o.getIncrementId(p, r);
                            u[p] = d, s.id = d, (0, t.isArray)(n) && n.forEach((function (t) {
                                var e = t.selectors;
                                e.forEach((function (t, n) {
                                    t === "#".concat(p) && (e[n] = "#".concat(d))
                                }))
                            }))
                        }
                        c && o.checkId(c, n, r, i)
                    }))
                },o.typeExtends = new Set,o
            }(Me);
        const jn = An;
        var Mn = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Dn = void 0 && (void 0).__assign || function () {
            return Dn = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Dn.apply(this, arguments)
        }, Ln = 'head', In = ['title', 'style', 'base', 'link', 'meta', 'script', 'noscript'], Nn = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Mn(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Dn(Dn({}, t.prototype.defaults), {
                        type: Ln,
                        tagName: Ln,
                        draggable: !1,
                        highlightable: !1,
                        droppable: function (t) {
                            var n = t.tagName;
                            return !n || In.includes((0, e.toLowerCase)(n))
                        }
                    })
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === Ln
            }, n
        }(jn);
        const Rn = Nn;
        var Vn = function () {
            function e(e, n) {
                var o;
                void 0 === e && (e = 50), this.dragging = !1, this.lastMaxHeight = 0, this.zoom = 1, this.rectIsInScrollIframe = !1, this.autoscrollLimit = e, this.lastMaxHeight = null !== (o = null == n ? void 0 : n.lastMaxHeight) && void 0 !== o ? o : 0, this.onScroll = null == n ? void 0 : n.onScroll, this.rectIsInScrollIframe = !!(null == n ? void 0 : n.rectIsInScrollIframe), (0, t.bindAll)(this, 'start', 'autoscroll', 'updateClientY', 'stop')
            }

            return e.prototype.start = function (t, e, n) {
                var o = this;
                this.eventEl = t, this.scrollEl = e, this.lastMaxHeight = (null == n ? void 0 : n.lastMaxHeight) || Number.POSITIVE_INFINITY, this.zoom = (null == n ? void 0 : n.zoom) || 1, this.ignoredElement = null == n ? void 0 : n.ignoredElement, setTimeout((function () {
                    o.toggleAutoscrollFx(!0), requestAnimationFrame(o.autoscroll)
                }), 0)
            }, e.prototype.autoscroll = function () {
                var t, e, n = this, o = this.scrollEl;
                if (this.dragging && o) if (void 0 !== this.lastClientY) {
                    var r = null !== (t = this.lastClientY) && void 0 !== t ? t : 0, i = this.autoscrollLimit,
                        a = this.getEventElHeight() - i, s = 0;
                    r < i && (s += r - i), r > a && (s += r - a);
                    var l = this.getElScrollTop(o);
                    s = Math.min(s, this.lastMaxHeight - l), 0 !== (s = Math.max(s, -l)) && (o.scrollBy({
                        top: s,
                        behavior: 'auto'
                    }), null === (e = this.onScroll) || void 0 === e || e.call(this)), requestAnimationFrame(this.autoscroll)
                } else setTimeout((function () {
                    requestAnimationFrame(n.autoscroll)
                }), 50)
            }, e.prototype.getEventElHeight = function () {
                var t = this.eventEl;
                return t ? t.getBoundingClientRect().height : 0
            }, e.prototype.updateClientY = function (t) {
                var e = t.target;
                if (!this.ignoredElement || !this.ignoredElement.contains(e)) {
                    var n = this.scrollEl;
                    t.preventDefault();
                    var o = this.rectIsInScrollIframe ? 0 : this.getElScrollTop(n);
                    this.lastClientY = (0, Z.G2)(t).clientY * this.zoom - o
                }
            }, e.prototype.getElScrollTop = function (t) {
                return (t instanceof HTMLElement ? t.scrollTop : null == t ? void 0 : t.scrollY) || 0
            }, e.prototype.toggleAutoscrollFx = function (t) {
                this.dragging = t;
                var e = this.eventEl;
                if (e) {
                    var n = t ? 'on' : 'off', o = {on: Z.on, off: Z.AU};
                    o[n](e, 'mousemove dragover', this.updateClientY), o[n](e, 'mouseup', this.stop)
                }
            }, e.prototype.stop = function () {
                this.toggleAutoscrollFx(!1), this.lastClientY = void 0, this.ignoredElement = void 0
            }, e
        }();
        const Fn = Vn;
        var Hn = n(8433), Un = n(1447), zn = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Bn = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return zn(n, e), n.prototype.canMove = function (e, n) {
                var o = this, r = this.getRealIndex(n), i = e._dragSource, a = i.model, s = i.content, l = i.dragDef,
                    c = !a || !this.isSourceSameSymbol(a), u = ((0, t.isFunction)(s) ? l : s) || e.model;
                return Array.isArray(u) ? c && u.every((function (t, e) {
                    return o.canMoveSingleContent(t, r + e)
                })) : c && this.canMoveSingleContent(u, r)
            }, n.prototype.canMoveSingleContent = function (t, e) {
                return this.model.em.Components.canMove(this.model, t, e).result
            }, n.prototype.addChildAt = function (e, n) {
                var o = e._dragSource.content, r = this.isTextNode() && e.isTextable(),
                    i = (0, t.isFunction)(o) ? o() : o;
                return Array.isArray(i) ? this.addMultipleChildren(i, n, r) : this.addSingleChild(i, n, r)
            }, n.prototype.addSingleChild = function (t, e, n) {
                var o, r, i, a, s;
                return s = n ? null === (a = null === (i = null === (r = null === (o = this.model) || void 0 === o ? void 0 : o.getView) || void 0 === r ? void 0 : r.call(o)) || void 0 === i ? void 0 : i.insertComponent) || void 0 === a ? void 0 : a.call(i, t, {action: 'add-component'}) : this.model.components().add(t, {
                    at: this.getRealIndex(e),
                    action: 'add-component'
                }), new this.constructor(s)
            }, n.prototype.addMultipleChildren = function (t, e, n) {
                var o, r = this;
                return t.forEach((function (t, i) {
                    o = r.addSingleChild(t, e + i, n)
                })), o
            }, n.prototype.isSourceSameSymbol = function (t) {
                if (Kt(this.model)) {
                    var e = ee(this.model);
                    if ((qt(e) ? e : Jt(e)) === t) return !0
                }
                return !1
            }, Object.defineProperty(n.prototype, "content", {
                set: function (t) {
                    this._dragSource.content = t
                }, enumerable: !1, configurable: !0
            }), n
        }(Un.A);
        const Wn = Bn;
        var $n = void 0 && (void 0).__assign || function () {
            return $n = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, $n.apply(this, arguments)
        }, qn = function () {
            function e(e, n) {
                var o = this;
                this.em = e, this.canvas = e.Canvas;
                var r = n || this.canvas.getFrames().map((function (t) {
                    return t.getComponent().getEl()
                })), i = Array.isArray(r) ? r : [r];
                this.el = i[0], this.counter = 0, (0, t.bindAll)(this, 'handleDragEnter', 'handleDragOver', 'handleDrop', 'handleDragLeave', 'handleDragEnd'), i.forEach((function (t) {
                    return o.toggleEffects(t, !0)
                }))
            }

            return e.prototype.toggleEffects = function (t, e) {
                var n = {on: Z.on, off: Z.AU}, o = e ? 'on' : 'off';
                n[o](t, 'dragenter', this.handleDragEnter), n[o](t, 'dragover', this.handleDragOver), n[o](t, 'drop', this.handleDrop), n[o](t, 'dragleave', this.handleDragLeave)
            }, e.prototype.__customTglEff = function (t) {
                var e, n = t ? Z.on : Z.AU, o = this.el.ownerDocument,
                    r = null === (e = o.defaultView) || void 0 === e ? void 0 : e.frameElement;
                this.getSorterOptions = t ? function (t) {
                    return {
                        legacyOnStartSort: function () {
                            (0, Z.on)(r, 'pointermove', t.onMove)
                        }, legacyOnEnd: function () {
                            (0, Z.AU)(r, 'pointermove', t.onMove)
                        }, customTarget: function (t) {
                            var e = t.event;
                            return o.elementFromPoint(e.clientX, e.clientY)
                        }
                    }
                } : void 0, n(r, 'pointerenter', this.handleDragEnter), n(r, 'pointermove', this.handleDragOver), n(document, 'pointerup', this.handleDrop), n(r, 'pointerout', this.handleDragLeave)
            }, e.prototype.startCustom = function () {
                this.__customTglEff(!0)
            }, e.prototype.endCustom = function (t) {
                this.over ? this.endDrop(t) : this.__customTglEff(!1)
            }, e.prototype.endDrop = function (t, e) {
                var n = this.em, o = this.dragStop;
                this.counter = 0, o && o(t || !this.over), this.__customTglEff(!1), n.trigger('canvas:dragend', e)
            }, e.prototype.handleDragLeave = function (t) {
                this.updateCounter(-1, t)
            }, e.prototype.updateCounter = function (t, e) {
                this.counter += t, 0 === this.counter && this.endDrop(!0, e)
            }, e.prototype.handleDragEnter = function (t) {
                var e, n, o = this, r = this.em, i = this.canvas, a = t.dataTransfer, s = r.get('dragSource');
                if (((null == s ? void 0 : s.content) || i.getConfig().allowExternalDrop) && (this.updateCounter(1, t), !this.over)) {
                    this.over = !0;
                    var l, c = r.Utils, u = (null == s ? void 0 : s.content) || '<br>';
                    if (r.stopDefault(), r.inAbsoluteMode()) {
                        var p = r.Components.getWrapper(), d = p.append({})[0],
                            f = r.Commands.run('core:component-drag', {
                                event: t,
                                guidesInfo: 1,
                                center: 1,
                                target: d,
                                onEnd: function (t, e, n) {
                                    var r;
                                    if (!n.cancelled && u) {
                                        r = p.append(u)[0];
                                        var s = i.getOffset(), l = d.getStyle(), c = l.top, f = l.left, h = l.position,
                                            v = (0, Z.Xy)(t.target),
                                            g = parseInt("".concat(parseFloat(f) + v.x - s.left), 10),
                                            y = parseInt("".concat(parseFloat(c) + v.y - s.top), 10);
                                        r.addStyle({left: g + 'px', top: y + 'px', position: h})
                                    }
                                    o.handleDragEnd(r, a), d.remove()
                                }
                            });
                        l = function (e) {
                            return f.stop(t, {cancel: e})
                        }, this.setAbsoluteDragContent = function (t) {
                            return u = t
                        }
                    } else {
                        var h = new c.ComponentSorter({
                            em: r,
                            treeClass: Wn,
                            containerContext: {
                                container: this.el,
                                containerSel: '*',
                                itemSel: '*',
                                pfx: 'gjs-',
                                placeholderElement: i.getPlacerEl(),
                                document: this.el.ownerDocument
                            },
                            dragBehavior: {dragDirection: Hn.A.BothDirections, nested: !0},
                            positionOptions: {windowMargin: 1, canvasRelative: !0},
                            eventHandlers: {legacyOnEndMove: this.handleDragEnd}
                        }), v = null === (e = this.getSorterOptions) || void 0 === e ? void 0 : e.call(this, h);
                        v && (h.eventHandlers.legacyOnStartSort = v.legacyOnStart, h.eventHandlers.legacyOnEnd = v.legacyOnEnd, h.containerContext.customTarget = v.customTarget);
                        var g = r.Components.getShallowWrapper(),
                            y = null == g ? void 0 : g.append(u, {temporary: !0})[0],
                            m = [{element: null == y ? void 0 : y.getEl(), dragSource: $n({model: y}, s)}];
                        h.startSort(m), this.sorter = h, this.draggedNode = null === (n = h.sourceNodes) || void 0 === n ? void 0 : n[0], l = function (t) {
                            t ? h.cancelDrag() : h.endDrag()
                        }
                    }
                    this.dragStop = l, r.trigger('canvas:dragenter', a, u)
                }
            }, e.prototype.handleDragEnd = function (t, e) {
                var n = this.em;
                this.over = !1, t && (n.set('dragResult', t), n.trigger('canvas:drop', e, t)), n.runDefault({preserveSelected: 1})
            }, e.prototype.handleDragOver = function (t) {
                t.preventDefault(), this.em.trigger('canvas:dragover', t)
            }, e.prototype.handleDrop = function (t) {
                var e;
                t.preventDefault();
                var n = t.dataTransfer, o = this.getContentByData(n).content;
                this.draggedNode && (this.draggedNode.content = o), null === (e = this.setAbsoluteDragContent) || void 0 === e || e.call(this, o), this.endDrop(!o, t)
            }, e.prototype.getContentByData = function (e) {
                var n = this.em, o = e && e.types, r = e && e.files || [], i = n.get('dragSource'),
                    a = e && e.getData('text');
                if (r.length) {
                    a = [];
                    for (var s = 0; s < r.length; s++) {
                        var l = r[s], c = l.type.split('/')[0];
                        'image' == c && a.push({type: c, file: l, attributes: {alt: l.name}})
                    }
                } else if (null == i ? void 0 : i.content) a = i.content; else if ((0, t.indexOf)(o, 'text/html') >= 0) a = e && e.getData('text/html').replace(/<\/?meta[^>]*>/g, ''); else if ((0, t.indexOf)(o, 'text/uri-list') >= 0) a = {
                    type: 'link',
                    attributes: {href: a},
                    content: a
                }; else if ((0, t.indexOf)(o, 'text/json') >= 0) {
                    var u = e && e.getData('text/json');
                    u && (a = JSON.parse(u))
                } else 1 === o.length && 'text/plain' === o[0] && (a = "<div>".concat(a, "</div>"));
                var p = {content: a};
                return n.trigger('canvas:dragdata', e, p), p
            }, e
        }();
        const Gn = qn;
        var Kn = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Yn = void 0 && (void 0).__assign || function () {
            return Yn = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Yn.apply(this, arguments)
        }, Xn = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Jn = function (n) {
            function o(o, r) {
                var i = n.call(this, {model: o}) || this;
                i.dragging = !1, i.loaded = !1, i.lastMaxHeight = 0, i.tools = {}, (0, t.bindAll)(i, 'startAutoscroll', 'stopAutoscroll', '_emitUpdate');
                var a = i.el;
                i.module._config = Yn(Yn({}, i.config || {}), {frameView: i}), i.frameWrapView = r, i.showGlobalTools = (0, t.debounce)(i.showGlobalTools.bind(i), 50);
                var s = i.getCanvasModel();
                return i.listenTo(o, 'change:head', i.updateHead), i.listenTo(s, 'change:styles', i.renderStyles), o.view = i, (0, e.setViewEl)(a, i), i.autoScroller = new Fn(i.config.autoscrollLimit, {
                    rectIsInScrollIframe: !0,
                    onScroll: function () {
                        i.getGlobalToolsEl().style.opacity = '0', i.showGlobalTools(), i.em.Canvas.spots.refreshDbn()
                    }
                }), i
            }

            return Kn(o, n), Object.defineProperty(o.prototype, "tagName", {
                get: function () {
                    return 'iframe'
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "attributes", {
                get: function () {
                    return {allowfullscreen: 'allowfullscreen'}
                }, enumerable: !1, configurable: !0
            }), o.prototype.getBoxRect = function () {
                var t = this.el, e = this.module, n = e.getCanvasView(), o = e.getCoords(),
                    r = t.getBoundingClientRect(), i = n.getCanvasOffset(), a = n.getViewportDelta(),
                    s = e.getZoomMultiplier();
                return {
                    x: (r.x - i.left - a.x - o.x) * s,
                    y: (r.y - i.top - a.y - o.y) * s,
                    width: r.width * s,
                    height: r.height * s
                }
            }, o.prototype.updateHead = function () {
                var t = this.model, e = this.getHead(), n = [], o = [], r = t.head, i = t.previous('head'),
                    a = function (t) {
                        return void 0 === t && (t = {}), Object.keys(t).sort().map((function (e) {
                            return "[".concat(e, "=\"").concat(t[e], "\"]")
                        })).join('')
                    }, s = function (t, e, n) {
                        t.forEach((function (t) {
                            var o = t.tag, r = t.attributes;
                            !e.some((function (t) {
                                return t.tag === o && a(t.attributes) === a(r)
                            })) && n.push(t)
                        }))
                    };
                s(r, i, o), s(i, r, n), n.forEach((function (t) {
                    var n, o = e.querySelector("".concat(t.tag).concat(a(t.attributes)));
                    null === (n = null == o ? void 0 : o.parentNode) || void 0 === n || n.removeChild(o)
                })), (0, Z.af)(e, o)
            }, o.prototype.getEl = function () {
                return this.el
            }, o.prototype.getCanvasModel = function () {
                var t;
                return null === (t = null == this ? void 0 : this.em.Canvas) || void 0 === t ? void 0 : t.getModel()
            }, o.prototype.getWindow = function () {
                return this.getEl().contentWindow
            }, o.prototype.getDoc = function () {
                return this.getEl().contentDocument
            }, o.prototype.getHead = function () {
                return this.getDoc().querySelector('head')
            }, o.prototype.getBody = function () {
                return this.getDoc().querySelector('body')
            }, o.prototype.getWrapper = function () {
                return this.getBody().querySelector('[data-gjs-type=wrapper]')
            }, o.prototype.getJsContainer = function () {
                return this.jsContainer || (this.jsContainer = (0, Z.a_)('div', {class: "".concat(this.ppfx, "js-cont")})), this.jsContainer
            }, o.prototype.getToolsEl = function () {
                var t;
                return null === (t = this.frameWrapView) || void 0 === t ? void 0 : t.elTools
            }, o.prototype.getGlobalToolsEl = function () {
                return this.em.Canvas.getGlobalToolsEl()
            }, o.prototype.getHighlighter = function () {
                return this._getTool('[data-hl]')
            }, o.prototype.getBadgeEl = function () {
                return this._getTool('[data-badge]')
            }, o.prototype.getOffsetViewerEl = function () {
                return this._getTool('[data-offset]')
            }, o.prototype.getRect = function () {
                return this.rect || (this.rect = this.el.getBoundingClientRect()), this.rect
            }, o.prototype.getOffsetRect = function () {
                var t = this.el, e = this.getBody(), n = e.scrollTop, o = e.scrollLeft, r = t.offsetHeight,
                    i = t.offsetWidth;
                return {
                    top: t.offsetTop,
                    left: t.offsetLeft,
                    height: r,
                    width: i,
                    scrollTop: n,
                    scrollLeft: o,
                    scrollBottom: n + r,
                    scrollRight: o + i
                }
            }, o.prototype._getTool = function (t) {
                var e = this.tools, n = this.getToolsEl();
                return e[t] || (e[t] = n.querySelector(t)), e[t]
            }, o.prototype.remove = function () {
                for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
                return this._toggleEffects(!1), this.tools = {}, null === (t = this.wrapper) || void 0 === t || t.remove(), J.prototype.remove.apply(this, e), this
            }, o.prototype.startAutoscroll = function () {
                this.autoScroller.start(this.el, this.getWindow(), {
                    lastMaxHeight: this.getWrapper().offsetHeight - this.el.offsetHeight,
                    zoom: this.em.getZoomDecimal(),
                    ignoredElement: this.em.Canvas.getSpotsEl()
                })
            }, o.prototype.stopAutoscroll = function () {
                this.autoScroller.stop()
            }, o.prototype.showGlobalTools = function () {
                this.getGlobalToolsEl().style.opacity = ''
            }, o.prototype.render = function () {
                var t = this, e = t.$el, n = t.ppfx, o = t.em;
                return e.attr({class: "".concat(n, "frame")}), this.renderScripts(), o.trigger('frame:render', this), this
            }, o.prototype.renderScripts = function () {
                var e = this, n = this, o = n.el, r = n.model, i = n.em, a = 'frame:load',
                    s = {el: o, model: r, view: this}, l = this.getCanvasModel(), c = function (n) {
                        var r;
                        if (n.length > 0) {
                            var l = n.shift(),
                                u = (0, Z.a_)('script', Yn({type: 'text/javascript'}, (0, t.isString)(l) ? {src: l} : l));
                            null === (r = o.contentDocument) || void 0 === r || r.head.appendChild(u), u.hasAttribute('nomodule') && 'noModule' in HTMLScriptElement.prototype ? c(n) : u.onerror = u.onload = c.bind(null, n)
                        } else null == i || i.trigger(A.frameLoadHead, s), e.renderBody(), null == i || i.trigger(A.frameLoadBody, s), null == i || i.trigger(a, s)
                    };
                o.onload = function () {
                    var t = e.config.frameContent;
                    if (t) {
                        var n = e.getDoc();
                        n.open(), n.write(t), n.close()
                    }
                    s.window = e.getWindow(), null == i || i.trigger("".concat(a, ":before"), s), null == i || i.trigger(A.frameLoad, s), e.renderHead(), c(Xn([], l.get('scripts'), !0))
                }
            }, o.prototype.renderStyles = function (e) {
                void 0 === e && (e = {});
                var n = this.getHead(), o = this.getCanvasModel(), r = function (e) {
                        return void 0 === e && (e = []), e.map((function (e) {
                            return {tag: 'link', attributes: Yn({rel: 'stylesheet'}, (0, t.isString)(e) ? {href: e} : e)}
                        }))
                    }, i = r(e.prev || o.previous('styles')), a = r(null == o ? void 0 : o.get('styles')), s = [], l = [],
                    c = function (t, e, n) {
                        t.forEach((function (t) {
                            var o = t.attributes.href;
                            !e.some((function (t) {
                                return t.attributes.href === o
                            })) && n.push(t)
                        }))
                    };
                c(a, i, l), c(i, a, s), s.forEach((function (t) {
                    var e, o = n.querySelector("link[href=\"".concat(t.attributes.href, "\"]"));
                    null === (e = null == o ? void 0 : o.parentNode) || void 0 === e || e.removeChild(o)
                })), (0, Z.af)(n, l)
            }, o.prototype.renderHead = function () {
                var t, e = this.model, n = this.em, o = e.root,
                    r = null === (t = null == n ? void 0 : n.Components) || void 0 === t ? void 0 : t.getType(Ln).view;
                r && (this.headView = new r({
                    el: this.getHead(),
                    model: o.head,
                    config: Yn(Yn({}, o.config), {frameView: this})
                }).render())
            }, o.prototype.renderBody = function () {
                var e, n = this, o = this, r = o.config, i = o.em, a = o.model, s = o.ppfx, l = this.getBody(),
                    c = this.getWindow(), u = a.hasAutoHeight(), p = i.config;
                c._isEditor = !0, this.renderStyles({prev: []});
                (0, Z.BC)(l, "<style>\n      ".concat(p.baseCss || r.frameStyle || '', "\n\n      ").concat(u ? 'body { overflow: hidden }' : '', "\n\n      [data-gjs-type=\"wrapper\"] {\n        ").concat(u ? '' : 'min-height: 100vh;', "\n        padding-top: 0.001em;\n      }\n\n      .").concat(s, "dashed *[data-gjs-highlightable] {\n        outline: 1px dashed rgba(170,170,170,0.7);\n        outline-offset: -2px;\n      }\n\n      .").concat(s, "selected {\n        outline: 2px solid #3b97e3 !important;\n        outline-offset: -2px;\n      }\n\n      .").concat(s, "selected-parent {\n        outline: 2px solid ").concat('#ffca6f', " !important\n      }\n\n      .").concat(s, "no-select {\n        user-select: none;\n        -webkit-user-select:none;\n        -moz-user-select: none;\n      }\n\n      .").concat(s, "freezed {\n        opacity: 0.5;\n        pointer-events: none;\n      }\n\n      .").concat(s, "no-pointer {\n        pointer-events: none;\n      }\n\n      .").concat(s, "pointer-init {\n        pointer-events: initial;\n      }\n\n      .").concat(s, "plh-image {\n        background: #f5f5f5;\n        border: none;\n        height: 100px;\n        width: 100px;\n        display: block;\n        outline: 3px solid #ffca6f;\n        cursor: pointer;\n        outline-offset: -2px\n      }\n\n      .").concat(s, "grabbing {\n        cursor: grabbing;\n        cursor: -webkit-grabbing;\n      }\n\n      .").concat(s, "is__grabbing {\n        overflow-x: hidden;\n      }\n\n      .").concat(s, "is__grabbing,\n      .").concat(s, "is__grabbing * {\n        cursor: grabbing !important;\n      }\n\n      ").concat(p.canvasCss || '', "\n      ").concat(p.protectedCss || '', "\n    </style>"));
                var d = a.root,
                    f = ((null === (e = null == i ? void 0 : i.Components) || void 0 === e ? void 0 : e.getType('wrapper')) || {}).view;
                f && ((0, t.isFunction)(r.customRenderer) ? r.customRenderer({
                    editor: i.Editor,
                    frame: a,
                    window: c,
                    frameView: this,
                    onMount: function (t) {
                        n.wrapper = t, n._onRootMount(t)
                    }
                }) : (this.wrapper = new f({
                    model: d,
                    config: Yn(Yn({}, d.config), {em: i, frameView: this})
                }).render(), this._onRootMount(this.wrapper)))
            }, o.prototype._onRootMount = function (t) {
                var n, o = this, r = this, i = r.config, a = r.em, s = r.model, l = this.getDoc(), c = l.body;
                (0, Z.BC)(c, t.el), (0, Z.BC)(c, new ut({
                    collection: s.getStyles(),
                    config: Yn(Yn({}, a.Css.getConfig()), {frameView: this})
                }).render().el), (0, Z.BC)(c, this.getJsContainer()), (0, Z.on)(c, 'click', (function (t) {
                    var e;
                    return t && 'A' == (null === (e = t.target) || void 0 === e ? void 0 : e.tagName) && t.preventDefault()
                })), (0, Z.on)(c, 'submit', (function (t) {
                    return t && t.preventDefault()
                })), [{event: 'keydown keyup keypress', class: 'KeyboardEvent'}, {
                    event: 'mousedown mousemove mouseup',
                    class: 'MouseEvent'
                }, {event: 'pointerdown pointermove pointerup', class: 'PointerEvent'}, {
                    event: 'wheel',
                    class: 'WheelEvent',
                    opts: {passive: !i.infiniteCanvas}
                }].forEach((function (t) {
                    return t.event.split(' ').forEach((function (e) {
                        l.addEventListener(e, (function (e) {
                            return o.el.dispatchEvent((0, Z.yL)(e, t.class))
                        }), t.opts)
                    }))
                })), this._toggleEffects(!0), (0, e.hasDnd)(a) && (this.droppable = new Gn(a, null === (n = this.wrapper) || void 0 === n ? void 0 : n.el)), this.loaded = !0, s.trigger('loaded')
            }, o.prototype._toggleEffects = function (t) {
                var e = t ? Z.on : Z.AU, n = this.getWindow();
                n && e(n, "".concat(Z.D8, " resize"), this._emitUpdate)
            }, o.prototype._emitUpdate = function () {
                this.model._emitUpdated()
            }, o
        }(J);
        const Zn = Jn;
        var Qn = n(9966), to = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), eo = void 0 && (void 0).__assign || function () {
            return eo = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, eo.apply(this, arguments)
        }, no = function (e) {
            function n(n, o) {
                var r = e.call(this, {model: n}) || this;
                (0, t.bindAll)(r, 'onScroll', 'frameLoaded', 'updateOffset', 'remove', 'startDrag');
                eo(eo({}, n.config), {frameWrapView: r});
                return r.cv = o, r.frame = new Zn(n, r), r.classAnim = "".concat(r.ppfx, "frame-wrapper--anim"), r.updateOffset = (0, t.debounce)(r.updateOffset.bind(r), 0), r.updateSize = (0, t.debounce)(r.updateSize.bind(r), 0), r.listenTo(n, 'loaded', r.frameLoaded), r.listenTo(n, 'change:x change:y', r.updatePos), r.listenTo(n, 'change:width change:height', r.updateSize), r.listenTo(n, 'destroy remove', r.remove), r.updatePos(), r.setupDragger(), r
            }

            return to(n, e), n.prototype.events = function () {
                return {'click [data-action-remove]': 'remove', 'mousedown [data-action-move]': 'startDrag'}
            }, n.prototype.setupDragger = function () {
                var t, e, n, o = this, r = this.module, i = this.model, a = function (t) {
                    r.toggleFramesEvents(t)
                };
                this.dragger = new Qn.A({
                    onStart: function () {
                        var r = i.attributes, s = r.x, l = r.y;
                        n = o.em.getZoomMultiplier(), t = s, e = l, a(!1)
                    }, onEnd: function () {
                        return a(!0)
                    }, setPosition: function (o) {
                        i.set({x: t + o.x * n, y: e + o.y * n})
                    }
                })
            }, n.prototype.startDrag = function (t) {
                var e;
                t && (null === (e = this.dragger) || void 0 === e || e.start(t))
            }, n.prototype.__clear = function (t) {
                var e = this.frame;
                e && e.remove(t), (0, Z.YZ)(this.elTools)
            }, n.prototype.remove = function (t) {
                var e, n = this;
                return null === (e = this.sizeObserver) || void 0 === e || e.disconnect(), this.__clear(t), J.prototype.remove.apply(this, t), ['frame', 'dragger', 'cv', 'elTools'].forEach((function (t) {
                    return n[t] = 0
                })), this
            }, n.prototype.updateOffset = function () {
                var t, e = this, n = e.em, o = e.$el, r = e.frame;
                n && !n.destroyed && (n.runDefault({preserveSelected: 1}), o.removeClass(this.classAnim), null === (t = null == r ? void 0 : r.model) || void 0 === t || t._emitUpdated())
            }, n.prototype.updatePos = function (t) {
                var e = this.model, n = this.el, o = e.attributes, r = o.x, i = o.y, a = n.style;
                this.frame.rect = void 0, a.left = isNaN(r) ? r : "".concat(r, "px"), a.top = isNaN(i) ? i : "".concat(i, "px"), t && this.updateOffset()
            }, n.prototype.updateSize = function () {
                this.updateDim()
            }, n.prototype.updateDim = function () {
                var e = this, n = e.em, o = e.el, r = e.$el, i = e.model, a = e.classAnim, s = e.frame;
                if (s) {
                    s.rect = void 0, r.addClass(a);
                    var l = this.__handleSize(), c = l.noChanges, u = l.width, p = l.height;
                    ((0, t.isNull)(u) || (0, t.isNull)(p)) && i.set(eo(eo({}, u ? {} : {width: o.offsetWidth}), p ? {} : {height: o.offsetHeight}), {silent: 1}), n.stopDefault({preserveSelected: 1}), c ? this.updateOffset() : setTimeout(this.updateOffset, 350)
                }
            }, n.prototype.onScroll = function () {
                var t = this.frame;
                this.em.trigger('frame:scroll', {frame: t, body: t.getBody(), target: t.getWindow()})
            }, n.prototype.frameLoaded = function () {
                var t = this.frame;
                this.config;
                t.getWindow().onscroll = this.onScroll, this.updateDim()
            }, n.prototype.__handleSize = function () {
                var e, n = 'px', o = this.model, r = this.el.style, i = o.attributes, a = i.width, s = i.height,
                    l = r.width || '', c = r.height || '', u = a || '', p = s || '', d = l == u && c == p,
                    f = (0, t.isNumber)(u) ? "".concat(u).concat(n) : u,
                    h = (0, t.isNumber)(p) ? "".concat(p).concat(n) : p;
                if (r.width = f, null === (e = this.sizeObserver) || void 0 === e || e.disconnect(), o.hasAutoHeight()) {
                    var v = this.frame.el.contentDocument;
                    if (v) {
                        var g = new ResizeObserver((function () {
                            requestAnimationFrame((function () {
                                var t = parseFloat(o.get('minHeight')) || 0, e = Math.max(v.body.scrollHeight, t);
                                r.height = "".concat(e, "px")
                            }))
                        }));
                        g.observe(v.body), this.sizeObserver = g
                    }
                } else r.height = h, delete this.sizeObserver;
                return {noChanges: d, width: a, height: s, newW: u, newH: p}
            }, n.prototype.render = function () {
                var t = this, e = t.frame, n = t.$el, o = t.ppfx, r = t.cv, i = t.model, a = t.el,
                    s = i.attributes.onRender;
                this.__clear(), this.__handleSize(), e.render(), n.empty().attr({class: "".concat(o, "frame-wrapper")}).append("\n      <div class=\"".concat(o, "frame-wrapper__top gjs-two-color\" data-frame-top>\n        <div class=\"").concat(o, "frame-wrapper__name\" data-action-move>\n          ").concat(i.get('name') || '', "\n        </div>\n        <div class=\"").concat(o, "frame-wrapper__top-r\">\n          <div class=\"").concat(o, "frame-wrapper__icon\" data-action-remove style=\"display: none\">\n            <svg viewBox=\"0 0 24 24\"><path d=\"M19 4h-3.5l-1-1h-5l-1 1H5v2h14M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12z\"></path></svg>\n          </div>\n        </div>\n      </div>\n      <div class=\"").concat(o, "frame-wrapper__right\" data-frame-right></div>\n      <div class=\"").concat(o, "frame-wrapper__left\" data-frame-left></div>\n      <div class=\"").concat(o, "frame-wrapper__bottom\" data-frame-bottom></div>\n      ")).append(e.el);
                var l = (0, Z.a_)('div', {
                    class: "".concat(o, "tools"),
                    style: 'pointer-events:none; display: none'
                }, "\n      <div class=\"".concat(o, "highlighter\" data-hl></div>\n      <div class=\"").concat(o, "badge\" data-badge></div>\n      <div class=\"").concat(o, "placeholder\">\n        <div class=\"").concat(o, "placeholder-int\"></div>\n      </div>\n      <div class=\"").concat(o, "ghost\"></div>\n      <div class=\"").concat(o, "toolbar\" style=\"pointer-events:all\"></div>\n      <div class=\"").concat(o, "resizer\"></div>\n      <div class=\"").concat(o, "offset-v\" data-offset>\n        <div class=\"gjs-marginName\" data-offset-m>\n          <div class=\"gjs-margin-v-el gjs-margin-v-top\" data-offset-m-t></div>\n          <div class=\"gjs-margin-v-el gjs-margin-v-bottom\" data-offset-m-b></div>\n          <div class=\"gjs-margin-v-el gjs-margin-v-left\" data-offset-m-l></div>\n          <div class=\"gjs-margin-v-el gjs-margin-v-right\" data-offset-m-r></div>\n        </div>\n        <div class=\"gjs-paddingName\" data-offset-m>\n          <div class=\"gjs-padding-v-el gjs-padding-v-top\" data-offset-p-t></div>\n          <div class=\"gjs-padding-v-el gjs-padding-v-bottom\" data-offset-p-b></div>\n          <div class=\"gjs-padding-v-el gjs-padding-v-left\" data-offset-p-l></div>\n          <div class=\"gjs-padding-v-el gjs-padding-v-right\" data-offset-p-r></div>\n        </div>\n      </div>\n      <div class=\"").concat(o, "offset-fixed-v\"></div>\n    "));
                this.elTools = l;
                var c = null == r ? void 0 : r.toolsWrapper;
                return c && c.appendChild(l), s && s({
                    el: a,
                    elTop: a.querySelector('[data-frame-top]'),
                    elRight: a.querySelector('[data-frame-right]'),
                    elBottom: a.querySelector('[data-frame-bottom]'),
                    elLeft: a.querySelector('[data-frame-left]'),
                    frame: i,
                    frameWrapperView: this,
                    remove: this.remove,
                    startDrag: this.startDrag
                }), this
            }, n
        }(J);
        const oo = no;
        var ro = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), io = function (t) {
            function e(e, n) {
                void 0 === e && (e = {});
                var o = t.call(this, e, !0) || this;
                return o.listenTo(o.collection, 'reset', o.render), o.canvasView = n.canvasView, o._module = n.module, o
            }

            return ro(e, t), e.prototype.onRemoveBefore = function (t, e) {
                void 0 === e && (e = {}), t.forEach((function (t) {
                    return t.remove(e)
                }))
            }, e.prototype.onRender = function () {
                var t = this.$el, e = this.ppfx;
                t.attr({class: "".concat(e, "frames")})
            }, e.prototype.clearItems = function () {
                (this.viewCollection || []).forEach((function (t) {
                    return t.remove()
                })), this.viewCollection = []
            }, e.prototype.renderView = function (t, e) {
                return new oo(t, this.canvasView)
            }, e
        }(tt);
        const ao = io;
        var so = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), lo = void 0 && (void 0).__assign || function () {
            return lo = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, lo.apply(this, arguments)
        }, co = function (n) {
            function o(e) {
                var o = n.call(this, {model: e}) || this;
                o.ready = !1, (0, t.bindAll)(o, 'clearOff', 'onKeyPress', 'onWheel', 'onPointer');
                var r = o, i = r.em, a = r.pfx, s = r.ppfx, l = o.module.events;
                return o.className = "".concat(a, "canvas ").concat(s, "no-touch-actions").concat(i.config.customUI ? '' : " ".concat(a, "canvas-bg")), o.clsUnscale = "".concat(a, "unscale"), o._initFrames(), o.listenTo(i, l.refresh, o.clearOff), o.listenTo(i, 'component:selected', o.checkSelected), o.listenTo(i, "".concat(l.coords, " ").concat(l.zoom), o.updateFrames), o.listenTo(e, 'change:frames', o._onFramesUpdate), o.toggleListeners(!0), o
            }

            return so(o, n), o.prototype.template = function () {
                var t = this.pfx;
                return "\n      <div class=\"".concat(t, "canvas__frames\" data-frames>\n        <div class=\"").concat(t, "canvas__spots\" data-spots></div>\n      </div>\n      <div id=\"").concat(t, "tools\" class=\"").concat(t, "canvas__tools\" data-tools></div>\n      <style data-canvas-style></style>\n    ")
            }, o.prototype._onFramesUpdate = function () {
                this._initFrames(), this._renderFrames()
            }, o.prototype._initFrames = function () {
                var t = this, e = t.frames, n = t.model, o = t.config, r = t.em, i = n.frames;
                r.set('readyCanvas', 0), i.once('loaded:all', (function () {
                    return r.set('readyCanvas', 1)
                })), null == e || e.remove(), this.frames = new ao({collection: i}, lo(lo({}, o), {canvasView: this}))
            }, o.prototype.checkSelected = function (t, e) {
                var n;
                void 0 === e && (e = {});
                var o = e.scroll, r = this.em.getCurrentFrame();
                o && (null === (n = t.views) || void 0 === n || n.forEach((function (t) {
                    t.frameView === r && t.scrollIntoView(o)
                })))
            }, o.prototype.remove = function () {
                for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
                return clearTimeout(this.timerZoom), null === (t = this.frames) || void 0 === t || t.remove(), this.frames = void 0, J.prototype.remove.apply(this, e), this.toggleListeners(!1), this
            }, o.prototype.preventDefault = function (t) {
                var e;
                t && (t.preventDefault(), null === (e = t._parentEvent) || void 0 === e || e.preventDefault())
            }, o.prototype.toggleListeners = function (t) {
                var e = this.el, n = this.config, o = t ? Z.on : Z.AU;
                o(document, 'keypress', this.onKeyPress), o(window, 'scroll resize', this.clearOff), o(e, 'wheel', this.onWheel, {passive: !n.infiniteCanvas}), o(e, 'pointermove', this.onPointer)
            }, o.prototype.screenToWorld = function (t, e) {
                var n = this.module, o = n.getCoords(), r = n.getZoomMultiplier(), i = this.getViewportDelta();
                return {x: (t - o.x - i.x) * r, y: (e - o.y - i.y) * r}
            }, o.prototype.onPointer = function (t) {
                if (this.config.infiniteCanvas) {
                    var e = this.getCanvasOffset(), n = (0, Z.Xy)(),
                        o = {x: t.clientX - e.left + n.x, y: t.clientY - e.top + n.y};
                    if (t._parentEvent) {
                        var r = t.target.getBoundingClientRect(), i = this.module.getZoomDecimal();
                        o.x = r.left - e.left + n.x + t.clientX * i, o.y = r.top - e.top + n.y + t.clientY * i
                    }
                    this.model.set({pointerScreen: o, pointer: this.screenToWorld(o.x, o.y)})
                }
            }, o.prototype.onKeyPress = function (t) {
                var e = this.em;
                ' ' !== (0, Z.Ch)(t) || 1 === e.getZoomDecimal() || e.Canvas.isInputFocused() || (this.preventDefault(t), e.Editor.runCommand('core:canvas-move'))
            }, o.prototype.onWheel = function (t) {
                var e = this.module;
                if (this.config.infiniteCanvas) {
                    this.preventDefault(t);
                    var n = t.deltaX, o = t.deltaY, r = e.getZoomDecimal(), i = (0, Z.rp)(t), a = e.getCoords();
                    if (i) {
                        var s = r - o * r * .01;
                        e.setZoom(100 * s);
                        var l = this.model.getPointerCoords(u.x2.Screen), c = this.getCanvasOffset(),
                            p = l.x - c.width / 2, d = l.y - c.height / 2, f = s / r, h = p - (p - a.x) * f,
                            v = d - (d - a.y) * f;
                        e.setCoords(h, v)
                    } else this.onPointer(t), e.setCoords(a.x - n, a.y - o)
                }
            }, o.prototype.updateFrames = function (t) {
                var e = this.em, n = this.toolsWrapper, o = {preserveSelected: 1};
                this.updateFramesArea(), this.clearOff(), n.style.display = 'none', e.trigger('canvas:update', t), clearTimeout(this.timerZoom), this.timerZoom = setTimeout((function () {
                    e.stopDefault(o), e.runDefault(o), n.style.display = ''
                }), 300)
            }, o.prototype.updateFramesArea = function () {
                var t = this, e = t.framesArea, n = t.model, o = t.module, r = t.cvStyle, i = t.clsUnscale,
                    a = o.getZoomMultiplier();
                if (e) {
                    var s = n.attributes, l = s.x, c = s.y, u = o.getZoomDecimal();
                    e.style.transform = "scale(".concat(u, ") translate(").concat(l * a, "px, ").concat(c * a, "px)")
                }
                r && (r.innerHTML = "\n        .".concat(i, " { scale: ").concat(a, " }\n      "))
            }, o.prototype.fitViewport = function (n) {
                var o, r, i;
                void 0 === n && (n = {});
                var a = this, s = a.em, l = a.module, c = a.model;
                this.clearOff();
                var u = this.getCanvasOffset(), p = n.el,
                    d = p && (null === (o = (0, e.getComponentView)(p)) || void 0 === o ? void 0 : o.frameView),
                    f = d ? d.model : n.frame || s.getCurrentFrameModel() || c.frames.at(0), h = f.attributes, v = h.x,
                    g = h.y, y = {x: null != v ? v : 0, y: null != g ? g : 0, width: f.width, height: f.height};
                if (p) {
                    var m = this.getElBoxRect(p);
                    y.x = y.x + m.x, y.y = y.y + m.y, y.width = m.width, y.height = m.height
                }
                var b = n.ignoreHeight, _ = null !== (r = n.gap) && void 0 !== r ? r : 0, w = (0, t.isNumber)(_),
                    x = w ? _ : _.x, C = w ? _ : _.y, S = y.width + 2 * x, O = y.height + 2 * C, T = u.width,
                    P = u.height, E = T / S, k = P / O, A = 100 * (b ? E : Math.min(E, k)),
                    j = null !== (i = (0, t.isFunction)(n.zoom) ? n.zoom(A) : n.zoom) && void 0 !== i ? i : A;
                l.setZoom(j, {from: 'fitViewport'});
                var M = -y.x + (f.width >= T ? T / 2 - S / 2 : -x), D = -y.y + P / 2 - O / 2, L = l.getZoomDecimal(),
                    I = {x: (M + x) * L, y: (D + C) * L};
                if (b) {
                    var N = l.getZoomMultiplier(), R = (P * N - P) / 2;
                    I.y = (-y.y + C) * L - R / N
                }
                l.setCoords(I.x, I.y)
            }, o.prototype.isElInViewport = function (t) {
                var n = (0, e.getElement)(t), o = (0, Z.C8)(n), r = this.getFrameOffset(n), i = o.top, a = o.left;
                return i >= 0 && a >= 0 && i <= r.height && a <= r.width
            }, o.prototype.offset = function (t, e) {
                void 0 === e && (e = {});
                var n = e.noScroll, o = (0, Z.C8)(t), r = n ? {x: 0, y: 0} : (0, Z.Xy)(t);
                return {top: o.top + r.y, left: o.left + r.x, width: o.width, height: o.height}
            }, o.prototype.getRectToScreen = function (t) {
                var e, n, o, r, i = this.getCanvasScroll(), a = this.module.getZoomDecimal(),
                    s = this.module.getCoords(), l = this.getViewportDelta();
                return {
                    x: (null !== (e = t.x) && void 0 !== e ? e : 0) * a - i.scrollLeft + s.x + l.x || 0,
                    y: (null !== (n = t.y) && void 0 !== n ? n : 0) * a - i.scrollTop + s.y + l.y || 0,
                    width: (null !== (o = t.width) && void 0 !== o ? o : 0) * a,
                    height: (null !== (r = t.height) && void 0 !== r ? r : 0) * a
                }
            }, o.prototype.getElBoxRect = function (t, n) {
                var o, r, i;
                void 0 === n && (n = {});
                var a = this.module, s = (0, Z.C8)(t), l = s.width, c = s.height, u = s.left, p = s.top,
                    d = null === (o = (0, e.getComponentView)(t)) || void 0 === o ? void 0 : o.frameView,
                    f = null == d ? void 0 : d.getBoxRect(), h = a.getZoomMultiplier(),
                    v = null !== (r = null == f ? void 0 : f.x) && void 0 !== r ? r : 0,
                    g = null !== (i = null == f ? void 0 : f.y) && void 0 !== i ? i : 0, y = this.el, m = (0, Z.Xy)(),
                    b = {x: u + v + (y.scrollLeft + m.x) * h, y: p + g + (y.scrollTop + m.y) * h, width: l, height: c};
                return n.local && (b.x = u, b.y = p), n.toScreen ? this.getRectToScreen(b) : b
            }, o.prototype.getViewportRect = function (t) {
                void 0 === t && (t = {});
                var e = this.getCanvasOffset(), n = e.top, o = e.left, r = e.width, i = e.height, a = this.module;
                if (t.toWorld) {
                    var s = a.getZoomMultiplier(), l = a.getCoords(), c = this.getViewportDelta();
                    return {x: (-l.x - c.x || 0) * s, y: (-l.y - c.y || 0) * s, width: r * s, height: i * s}
                }
                return {x: o, y: n, width: r, height: i}
            }, o.prototype.getViewportDelta = function (t) {
                void 0 === t && (t = {});
                var e = this.module.getZoomMultiplier(), n = this.getCanvasOffset(), o = n.width, r = n.height;
                return {x: (o * e - o) / 2 / e, y: (r * e - r) / 2 / e}
            }, o.prototype.clearOff = function () {
                this.frmOff = void 0, this.cvsOff = void 0
            }, o.prototype.getFrameOffset = function (t) {
                var e;
                if (!this.frmOff || t) {
                    var n = null === (e = this.frame) || void 0 === e ? void 0 : e.el,
                        o = null == t ? void 0 : t.ownerDocument.defaultView, r = o ? o.frameElement : n;
                    this.frmOff = this.offset(r || n)
                }
                return this.frmOff
            }, o.prototype.getCanvasOffset = function () {
                return this.cvsOff || (this.cvsOff = this.offset(this.el)), this.cvsOff
            }, o.prototype.getElementPos = function (t, e) {
                void 0 === e && (e = {});
                var n = this.module.getZoomDecimal(), o = this.getFrameOffset(t), r = this.el,
                    i = this.getCanvasOffset(), a = this.offset(t, e), s = e.avoidFrameOffset ? 0 : o.top,
                    l = e.avoidFrameOffset ? 0 : o.left, c = e.avoidFrameZoom ? a.top : a.top * n,
                    u = e.avoidFrameZoom ? a.left : a.left * n;
                return {
                    top: e.avoidFrameOffset ? c : c + s - i.top + r.scrollTop,
                    left: e.avoidFrameOffset ? u : u + l - i.left + r.scrollLeft,
                    height: e.avoidFrameZoom ? a.height : a.height * n,
                    width: e.avoidFrameZoom ? a.width : a.width * n,
                    zoom: n,
                    rect: a
                }
            }, o.prototype.getElementOffsets = function (t) {
                if (!t || (0, Z.ir)(t)) return {};
                var e = {}, n = window.getComputedStyle(t), o = this.module.getZoomDecimal();
                return ['marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'].forEach((function (t) {
                    e[t] = parseFloat(n[t]) * o
                })), e
            }, o.prototype.getPosition = function (t) {
                var e;
                void 0 === t && (t = {});
                var n = null === (e = this.frame) || void 0 === e ? void 0 : e.el.contentDocument;
                if (!n) return {top: 0, left: 0, width: 0, height: 0};
                var o = n.body, r = this.module.getZoomDecimal(), i = this.getFrameOffset(), a = this.getCanvasOffset(),
                    s = t.noScroll;
                return {
                    top: i.top + (s ? 0 : o.scrollTop) * r - a.top,
                    left: i.left + (s ? 0 : o.scrollLeft) * r - a.left,
                    width: a.width,
                    height: a.height
                }
            }, o.prototype.getCanvasScroll = function () {
                return this.config.scrollableCanvas ? {
                    scrollTop: this.el.scrollTop,
                    scrollLeft: this.el.scrollLeft
                } : {scrollTop: 0, scrollLeft: 0}
            }, o.prototype.updateScript = function (t) {
                var e = t.model, n = e.getId(), o = {component: e, view: t, el: t.el};
                if (!t.scriptContainer) {
                    t.scriptContainer = (0, Z.a_)('div', {'data-id': n});
                    var r = this.getJsContainer();
                    null == r || r.appendChild(t.scriptContainer)
                }
                t.el.id = n, t.scriptContainer.innerHTML = '';
                var i = document.createElement('script'), a = e.getScriptString(),
                    s = e.get('script-props') ? a : "function(){\n".concat(a, "\n;}"),
                    l = JSON.stringify(e.__getScriptProps());
                i.innerHTML = "\n      setTimeout(function() {\n        var item = document.getElementById('".concat(n, "');\n        if (!item) return;\n        var script = (").concat(s, ").bind(item);\n        script(").concat(l, ", { el: item });\n      }, 1);"), setTimeout((function () {
                    e.emitWithEditor($.I.scriptMountBefore, o);
                    var n = t.scriptContainer;
                    null == n || n.appendChild(i), e.emitWithEditor($.I.scriptMount, o)
                }), 0)
            }, o.prototype.getJsContainer = function (t) {
                var e = this.getFrameView(t);
                return null == e ? void 0 : e.getJsContainer()
            }, o.prototype.getFrameView = function (t) {
                return (null == t ? void 0 : t.frameView) || this.em.getCurrentFrame()
            }, o.prototype._renderFrames = function () {
                if (this.ready) {
                    var t = this, e = t.model, n = t.frames, o = t.em, r = t.framesArea, i = e.frames;
                    i.listenToLoad(), n.render();
                    var a = i.at(0), s = null == a ? void 0 : a.view;
                    o.setCurrentFrame(s), null == r || r.appendChild(n.el), this.frame = s, this.updateFramesArea()
                }
            }, o.prototype.renderFrames = function () {
                this._renderFrames()
            }, o.prototype.render = function () {
                var t = this, n = t.el, o = t.$el, r = t.ppfx, i = t.config, a = t.em;
                o.html(this.template());
                var s = o.find('[data-frames]');
                this.framesArea = s.get(0);
                var l = o.find('[data-tools]');
                return this.toolsWrapper = l.get(0), l.append("\n      <div class=\"".concat(r, "tools ").concat(r, "tools-gl\" style=\"pointer-events:none\">\n        <div class=\"").concat(r, "placeholder\">\n          <div class=\"").concat(r, "placeholder-int\"></div>\n        </div>\n      </div>\n      <div id=\"").concat(r, "tools\" style=\"pointer-events:none\">\n        ").concat(i.extHl ? "<div class=\"".concat(r, "highlighter-sel\"></div>") : '', "\n        <div class=\"").concat(r, "badge\"></div>\n        <div class=\"").concat(r, "ghost\"></div>\n        <div class=\"").concat(r, "toolbar\" style=\"pointer-events:all\"></div>\n        <div class=\"").concat(r, "resizer\"></div>\n        <div class=\"").concat(r, "offset-v\"></div>\n        <div class=\"").concat(r, "offset-fixed-v\"></div>\n      </div>\n    ")), this.toolsEl = n.querySelector("#".concat(r, "tools")), this.hlEl = n.querySelector(".".concat(r, "highlighter")), this.badgeEl = n.querySelector(".".concat(r, "badge")), this.placerEl = n.querySelector(".".concat(r, "placeholder")), this.ghostEl = n.querySelector(".".concat(r, "ghost")), this.toolbarEl = n.querySelector(".".concat(r, "toolbar")), this.resizerEl = n.querySelector(".".concat(r, "resizer")), this.offsetEl = n.querySelector(".".concat(r, "offset-v")), this.fixedOffsetEl = n.querySelector(".".concat(r, "offset-fixed-v")), this.toolsGlobEl = n.querySelector(".".concat(r, "tools-gl")), this.spotsEl = n.querySelector('[data-spots]'), this.cvStyle = n.querySelector('[data-canvas-style]'), n.className = (0, e.getUiClass)(a, this.className), !0 === i.scrollableCanvas && (n.style.overflow = 'auto'), this.ready = !0, this._renderFrames(), this
            }, o
        }(J);
        const uo = co;
        var po = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), fo = void 0 && (void 0).__assign || function () {
            return fo = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, fo.apply(this, arguments)
        }, ho = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, vo = function (n) {
            function o(t) {
                var e = n.call(this, t, 'Canvas', _()) || this;
                return e.events = k, e.framesById = {}, e.canvas = new B(e), e.spots = new K(e), e.model = e.canvas, e.startAutoscroll = e.startAutoscroll.bind(e), e.stopAutoscroll = e.stopAutoscroll.bind(e), e.autoScroller = new Fn, e
            }

            return po(o, n), o.prototype.getCanvasView = function () {
                return this.canvasView
            }, o.prototype.postLoad = function () {
                this.model.init()
            }, o.prototype.getModel = function () {
                return this.canvas
            }, o.prototype.getElement = function () {
                return this.getCanvasView().el
            }, o.prototype.getFrame = function (t) {
                return this.getFrames()[t || 0]
            }, o.prototype.getFrameEl = function () {
                var t = (this.canvasView || {}).frame;
                return null == t ? void 0 : t.el
            }, o.prototype.getFramesEl = function () {
                var t;
                return null === (t = this.canvasView) || void 0 === t ? void 0 : t.framesArea
            }, o.prototype.getWindow = function () {
                var t = (this.canvasView || {}).frame;
                return null == t ? void 0 : t.getWindow()
            }, o.prototype.getDocument = function () {
                var t = this.getFrameEl();
                return null == t ? void 0 : t.contentDocument
            }, o.prototype.getBody = function () {
                var t = this.getDocument();
                return null == t ? void 0 : t.body
            }, o.prototype._getLocalEl = function (t, e, n) {
                var o = t, r = null == e ? void 0 : e.frameView;
                return o = r ? r[n]() : o
            }, o.prototype.getGlobalToolsEl = function () {
                var t;
                return null === (t = this.canvasView) || void 0 === t ? void 0 : t.toolsGlobEl
            }, o.prototype.getToolsEl = function (t) {
                return this._getLocalEl(this.getCanvasView().toolsEl, t, 'getToolsEl')
            }, o.prototype.getHighlighter = function (t) {
                return this._getLocalEl(this.getCanvasView().hlEl, t, 'getHighlighter')
            }, o.prototype.getBadgeEl = function (t) {
                return this._getLocalEl(this.getCanvasView().badgeEl, t, 'getBadgeEl')
            }, o.prototype.getPlacerEl = function () {
                return this.getCanvasView().placerEl
            }, o.prototype.getGhostEl = function () {
                return this.getCanvasView().ghostEl
            }, o.prototype.getToolbarEl = function () {
                return this.getCanvasView().toolbarEl
            }, o.prototype.getResizerEl = function () {
                return this.getCanvasView().resizerEl
            }, o.prototype.getOffsetViewerEl = function (t) {
                return this._getLocalEl(this.getCanvasView().offsetEl, t, 'getOffsetViewerEl')
            }, o.prototype.getFixedOffsetViewerEl = function () {
                return this.getCanvasView().fixedOffsetEl
            }, o.prototype.getSpotsEl = function () {
                var t;
                return null === (t = this.canvasView) || void 0 === t ? void 0 : t.spotsEl
            }, o.prototype.render = function () {
                var t;
                return null === (t = this.canvasView) || void 0 === t || t.remove(), this.canvasView = new uo(this.canvas), this.canvasView.render().el
            }, o.prototype.getOffset = function () {
                var t = this.offset(this.getFrameEl()), e = this.offset(this.getElement());
                return {top: t.top - e.top, left: t.left - e.left}
            }, o.prototype.offset = function (t) {
                return this.getCanvasView().offset(t)
            }, o.prototype.setCustomBadgeLabel = function (t) {
                this.config.customBadgeLabel = t
            }, o.prototype.getElementPos = function (t, e) {
                return this.getCanvasView().getElementPos(t, e)
            }, o.prototype.getElementOffsets = function (t) {
                return this.getCanvasView().getElementOffsets(t)
            }, o.prototype.getRect = function () {
                var t, e = null !== (t = this.getCanvasView().getPosition()) && void 0 !== t ? t : {}, n = e.top,
                    o = void 0 === n ? 0 : n, r = e.left, i = void 0 === r ? 0 : r;
                return fo(fo({}, this.getCanvasView().getCanvasOffset()), {topScroll: o, leftScroll: i})
            }, o.prototype.getTargetToElementDim = function (t, e, n) {
                void 0 === n && (n = {});
                var o = n || {}, r = this.getCanvasView().getPosition();
                if (r) {
                    var i = o.elPos || this.getCanvasView().getElementPos(e), a = n.toRight || 0,
                        s = o.targetHeight || t.offsetHeight, l = o.targetWidth || t.offsetWidth, c = o.event || null,
                        u = i.top - s, p = i.left;
                    p += a ? i.width : 0;
                    var d = (p = a ? p - l : p) < r.left ? r.left : p, f = u < r.top ? r.top : u, h = {
                        top: f = f > i.top + i.height ? i.top + i.height : f,
                        left: d,
                        elementTop: i.top,
                        elementLeft: i.left,
                        elementWidth: i.width,
                        elementHeight: i.height,
                        targetWidth: t.offsetWidth,
                        targetHeight: t.offsetHeight,
                        canvasTop: r.top,
                        canvasLeft: r.left,
                        canvasWidth: r.width,
                        canvasHeight: r.height
                    };
                    return c && this.em && this.em.trigger(c, h), h
                }
            }, o.prototype.canvasRectOffset = function (t, e, n) {
                var o = this;
                void 0 === n && (n = {});
                var r = function (t, e, r) {
                    void 0 === e && (e = 1);
                    var i = o.em.getZoomDecimal(), a = e ? 'top' : 'left', s = t.ownerDocument,
                        l = n.offset ? function (t) {
                            var e = t.defaultView;
                            return null == e ? void 0 : e.frameElement
                        }(s) : {}, c = l.offsetTop, u = void 0 === c ? 0 : c, p = l.offsetLeft,
                        d = void 0 === p ? 0 : p, f = s.body || {}, h = f.scrollTop, v = void 0 === h ? 0 : h,
                        g = f.scrollLeft, y = e ? v : void 0 === g ? 0 : g, m = e ? u : d;
                    return r[a] - (y - m) * i
                };
                return {top: r(t, 1, e), left: r(t, 0, e)}
            }, o.prototype.getTargetToElementFixed = function (e, n, o) {
                void 0 === o && (o = {});
                var r = o.pos || this.getElementPos(e, {noScroll: !0}), i = o.canvasOff || this.canvasRectOffset(e, r),
                    a = n.offsetHeight || 0, s = n.offsetWidth || 0, l = this.getCanvasView(), c = l.getCanvasScroll(),
                    u = c.scrollTop, p = c.scrollLeft, d = l.getPosition(), f = o.event, h = r.width - s, v = -a,
                    g = (0, t.isUndefined)(o.left) ? h : o.left, y = Math.max(-r.left + p, 0);
                g = Math.max(g, y);
                var m = r.width - s;
                g = Math.min(g, m);
                var b = d.width + p - s - r.left;
                g = Math.min(g, b);
                var _ = v;
                if (i.top < a + u) {
                    var w = r.height + a;
                    if (w < d.height) _ += w; else {
                        var x = -i.top + u;
                        _ = x < r.height ? x : r.height
                    }
                }
                var C = {
                    top: _,
                    left: g,
                    canvasOffsetTop: i.top,
                    canvasOffsetLeft: i.left,
                    elRect: r,
                    canvasOffset: i,
                    canvasRect: d,
                    targetWidth: s,
                    targetHeight: a
                };
                return f && this.em.trigger(f, C), C
            }, o.prototype.getMouseRelativePos = function (t, e) {
                void 0 === e && (e = {});
                var n = e.subWinOffset, o = t.target, r = o.nodeType === Node.DOCUMENT_NODE ? o : o.ownerDocument,
                    i = r.defaultView || r.parentWindow, a = i.frameElement, s = n ? i.pageYOffset : 0,
                    l = n ? i.pageXOffset : 0, c = this.getZoomMultiplier(), u = 0, p = 0;
                if (a) {
                    var d = a.getBoundingClientRect();
                    u = d.top || 0, p = d.left || 0
                }
                return {y: (t.clientY + u - s) * c, x: (t.clientX + p - l) * c}
            }, o.prototype.getMouseRelativeCanvas = function (t, e) {
                var n, o = this.getZoomDecimal(), r = this.getCanvasView(),
                    i = null !== (n = r.getPosition(e)) && void 0 !== n ? n : {top: 0, left: 0},
                    a = r.getCanvasScroll(), s = {top: i.top + a.scrollTop, left: i.left + a.scrollLeft}, l = s.top,
                    c = s.left;
                return {y: t.clientY * o + l, x: t.clientX * o + c}
            }, o.prototype.startDrag = function (t) {
                this.em.set('dragSource', t)
            }, o.prototype.endDrag = function () {
                this.em.set({dragResult: null, dragSource: void 0})
            }, o.prototype.hasFocus = function () {
                return this.getDocument().hasFocus()
            }, o.prototype.isInputFocused = function () {
                var t = this.getDocument(), e = this.getFrameEl(), n = ho(['body'], this.config.notTextable, !0),
                    o = e && document.activeElement === e ? t && t.activeElement : document.activeElement;
                return o && !n.some((function (t) {
                    return o.matches(t)
                }))
            }, o.prototype.scrollTo = function (t, n) {
                void 0 === n && (n = {});
                var o = (0, e.getElement)(t), r = o && (0, e.getViewEl)(o);
                r && r.scrollIntoView(n)
            }, o.prototype.startAutoscroll = function (t) {
                var e = t && t.view || this.em.getCurrentFrame();
                if (e && e.startAutoscroll(), this.config.scrollableCanvas) {
                    var n = this.getCanvasView().el;
                    this.autoScroller.start(n, n, {zoom: this.em.getZoomDecimal(), ignoredElement: this.getSpotsEl()})
                }
            }, o.prototype.stopAutoscroll = function (t) {
                var e = t && t.view || this.em.getCurrentFrame();
                e && e.stopAutoscroll(), this.config.scrollableCanvas && this.autoScroller.stop()
            }, o.prototype.setZoom = function (t, e) {
                return void 0 === e && (e = {}), this.canvas.set('zoom', 'string' == typeof t ? parseFloat(t) : t, e), this
            }, o.prototype.getZoom = function () {
                return parseFloat(this.canvas.get('zoom'))
            }, o.prototype.setCoords = function (t, e, n) {
                var o;
                void 0 === n && (n = {});
                var r = t || 0 === t, i = e || 0 === e, a = {x: this.canvas.get('x'), y: this.canvas.get('y')};
                if (r && (a.x = parseFloat("".concat(t))), i && (a.y = parseFloat("".concat(e))), n.toWorld) {
                    var s = null === (o = this.canvasView) || void 0 === o ? void 0 : o.getViewportDelta();
                    s && (r && (a.x = a.x - s.x), i && (a.y = a.y - s.y))
                }
                return this.canvas.set(a), this
            }, o.prototype.getCoords = function () {
                var t = this.canvas.attributes;
                return {x: t.x, y: t.y}
            }, o.prototype.getPointer = function (t) {
                var e = this.canvas.attributes, n = e.pointer, o = e.pointerScreen;
                return t ? o : n
            }, o.prototype.getZoomDecimal = function () {
                return this.getZoom() / 100
            }, o.prototype.getZoomMultiplier = function () {
                var t = this.getZoomDecimal();
                return t ? 1 / t : 1
            }, o.prototype.fitViewport = function (t) {
                var e;
                null === (e = this.canvasView) || void 0 === e || e.fitViewport(t)
            }, o.prototype.toggleFramesEvents = function (t) {
                this.getFramesEl().style.pointerEvents = t ? '' : 'none'
            }, o.prototype.getFrames = function () {
                return this.canvas.frames.map((function (t) {
                    return t
                }))
            }, o.prototype.addFrame = function (t, e) {
                return void 0 === t && (t = {}), void 0 === e && (e = {}), this.canvas.frames.add(new V(this, fo({}, t)), e)
            }, o.prototype.getLastDragResult = function () {
                return this.em.get('dragResult')
            }, o.prototype.addSpot = function (t, e) {
                var n;
                void 0 === e && (e = {});
                var o = t, r = this.getSpots(o);
                if (r.length) {
                    var i = r[0];
                    return i.set(o), i
                }
                var a = o.componentView || (null === (n = o.component) || void 0 === n ? void 0 : n.view),
                    s = new W.A(this, fo(fo({}, o), {
                        id: o.id || "cs_".concat(o.type, "_").concat(null == a ? void 0 : a.cid),
                        type: o.type || ''
                    }));
                return this.spots.add(s, e), s
            }, o.prototype.getSpots = function (t) {
                return void 0 === t && (t = {}), this.spots.where(t.id ? {id: t.id} : t)
            }, o.prototype.removeSpots = function (e) {
                void 0 === e && (e = {});
                var n = (0, t.isArray)(e) ? e : this.getSpots(e);
                return this.spots.remove(n)
            }, o.prototype.hasCustomSpot = function (t) {
                var e = this.config.customSpots;
                return !!(!0 === e || e && t && e[t])
            }, o.prototype.getWorldRectToScreen = function (t) {
                var e;
                return null === (e = this.canvasView) || void 0 === e ? void 0 : e.getRectToScreen(t)
            }, o.prototype.refresh = function (t) {
                void 0 === t && (t = {});
                var e = this, n = e.em, o = e.events, r = e.canvasView;
                null == r || r.clearOff(), (t.spots || t.all) && (this.refreshSpots(), n.trigger('canvas:updateTools')), n.set('canvasOffset', this.getOffset()), n.trigger(o.refresh, t)
            }, o.prototype.refreshSpots = function () {
                this.spots.refresh()
            }, o.prototype.destroy = function () {
                var t, e = this;
                this.canvas.stopListening(), null === (t = this.canvasView) || void 0 === t || t.remove(), ['model', 'droppable'].forEach((function (t) {
                    return e[t] = {}
                }))
            }, o
        }(m);
        const go = vo;
        const yo = function () {
            return {
                stylePrefix: 'comp-',
                components: [],
                draggableComponents: !0,
                disableTextInnerChilds: !1,
                processor: void 0,
                useFrameDoc: !1,
                voidElements: ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr']
            }
        };
        var mo = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), bo = void 0 && (void 0).__assign || function () {
            return bo = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, bo.apply(this, arguments)
        }, _o = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return mo(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return bo(bo({}, t.prototype.defaults), {
                        tagName: '',
                        droppable: !1,
                        layerable: !1,
                        selectable: !1,
                        editable: !0
                    })
                }, enumerable: !1, configurable: !0
            }), n.prototype.toHTML = function () {
                var t = this.content, e = this.parent();
                return (null == e ? void 0 : e.is('script')) ? t : this.__escapeContent(t)
            }, n.prototype.__escapeContent = function (t) {
                return (0, e.escapeNodeContent)(t)
            }, n.isComponent = function (t) {
                var e;
                if (3 === t.nodeType) return {
                    type: 'textnode',
                    content: null !== (e = t.textContent) && void 0 !== e ? e : ''
                }
            }, n
        }(jn);
        const wo = _o;
        var xo = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Co = void 0 && (void 0).__assign || function () {
            return Co = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Co.apply(this, arguments)
        }, So = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return xo(e, t), Object.defineProperty(e.prototype, "defaults", {
                get: function () {
                    return Co({}, t.prototype.defaults)
                }, enumerable: !1, configurable: !0
            }), e.prototype.toHTML = function () {
                return "\x3c!--".concat(this.content, "--\x3e")
            }, e.isComponent = function (t) {
                var e;
                if (8 == t.nodeType) return {
                    type: 'comment',
                    content: null !== (e = t.textContent) && void 0 !== e ? e : ''
                }
            }, e
        }(wo);
        const Oo = So;
        var To = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Po = void 0 && (void 0).__assign || function () {
            return Po = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Po.apply(this, arguments)
        }, Eo = 'iframe';
        const ko = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return To(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Po(Po({}, t.prototype.defaults), {
                        type: Eo,
                        tagName: Eo,
                        droppable: !1,
                        resizable: !0,
                        traits: ['id', 'title', 'src'],
                        attributes: {frameborder: '0'}
                    })
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === Eo
            }, n
        }(jn);
        var Ao = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), jo = void 0 && (void 0).__assign || function () {
                return jo = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, jo.apply(this, arguments)
            },
            Mo = '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)"',
            Do = function (n) {
                function o(o, r) {
                    void 0 === o && (o = {});
                    var i = n.call(this, o, r) || this, a = i.get('attributes').src;
                    return a && (0, e.buildBase64UrlFromSvg)((0, t.result)(i, 'defaults').src) !== a && i.set('src', a, {silent: !0}), i
                }

                return Ao(o, n), Object.defineProperty(o.prototype, "defaults", {
                    get: function () {
                        return jo(jo({}, n.prototype.defaults), {
                            type: 'image',
                            tagName: 'img',
                            void: !0,
                            droppable: 0,
                            editable: 1,
                            highlightable: 0,
                            resizable: {ratioDefault: 1},
                            traits: ['alt'],
                            src: "<svg ".concat(Mo, ">\n        <path d=\"M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2z\"></path>\n      </svg>"),
                            fallback: "<svg ".concat(Mo, ">\n        <path d=\"M2.28 3L1 4.27l2 2V19c0 1.1.9 2 2 2h12.73l2 2L21 21.72 2.28 3m2.55 0L21 19.17V5a2 2 0 0 0-2-2H4.83M8.5 13.5l2.5 3 1-1.25L14.73 18H5l3.5-4.5z\"></path>\n      </svg>"),
                            file: ''
                        })
                    }, enumerable: !1, configurable: !0
                }), o.prototype.initToolbar = function () {
                    n.prototype.initToolbar.call(this);
                    var t = this.em;
                    if (t) {
                        var e = 'image-editor';
                        if (t.Commands.has(e)) {
                            for (var o = !1, r = this.get('toolbar'), i = 0; i < r.length; i++) if ('image-editor' === r[i].command) {
                                o = !0;
                                break
                            }
                            o || (r.push({attributes: {class: 'fa fa-pencil'}, command: e}), this.set('toolbar', r))
                        }
                    }
                }, o.prototype.getAttrToHTML = function () {
                    var t = n.prototype.getAttrToHTML.call(this), e = this.getSrcResult();
                    return e && (t.src = e), t
                }, o.prototype.getSrcResult = function (t) {
                    void 0 === t && (t = {});
                    var n = this.get(t.fallback ? 'fallback' : 'src') || '', o = n;
                    return n && '<svg' === n.substr(0, 4) && (o = (0, e.buildBase64UrlFromSvg)(n)), o
                }, o.prototype.isDefaultSrc = function () {
                    var n = this.get('src'), o = (0, t.result)(this, 'defaults').src;
                    return n === o || n === (0, e.buildBase64UrlFromSvg)(o)
                }, o.prototype.toJSON = function (t) {
                    var e = n.prototype.toJSON.call(this, t), o = e.attributes;
                    return o && e.src === o.src && delete e.src, e
                }, o.prototype.parseUri = function (t) {
                    var n = {};
                    if ((0, e.hasWin)()) (n = document.createElement('a')).href = t; else if ('undefined' != typeof URL) try {
                        n = new URL(t)
                    } catch (t) {
                    }
                    return {
                        hostname: n.hostname || '',
                        pathname: n.pathname || '',
                        protocol: n.protocol || '',
                        search: n.search || '',
                        hash: n.hash || '',
                        port: n.port || '',
                        query: function (t) {
                            void 0 === t && (t = '');
                            for (var e = {}, n = t.substring(1).split('&'), o = 0; o < n.length; o++) {
                                var r = n[o].split('='), i = decodeURIComponent(r[0]);
                                i && (e[i] = decodeURIComponent(r[1] || ''))
                            }
                            return e
                        }(n.search)
                    }
                }, o.isComponent = function (t) {
                    return 'img' === (0, e.toLowerCase)(t.tagName)
                }, o
            }(jn);
        const Lo = Do;
        var Io = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), No = void 0 && (void 0).__assign || function () {
            return No = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, No.apply(this, arguments)
        };
        const Ro = function (e) {
            function n(t, n) {
                void 0 === t && (t = {});
                var o = e.call(this, t, n) || this;
                return o.__checkInnerChilds(), o
            }

            return Io(n, e), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return No(No({}, e.prototype.defaults), {type: 'text', droppable: !1, editable: !0})
                }, enumerable: !1, configurable: !0
            }), n.prototype.__checkInnerChilds = function () {
                var e = this.em.Components.config.disableTextInnerChilds;
                if (e) {
                    var n = function (t) {
                        t.isInstanceOf('textnode') || t.set({locked: !0, layerable: !1})
                    };
                    (0, t.isFunction)(e) ? this.forEachChild((function (t) {
                        e(t) && n(t)
                    })) : this.forEachChild(n)
                }
            }, n
        }(jn);
        var Vo = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Fo = void 0 && (void 0).__assign || function () {
            return Fo = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Fo.apply(this, arguments)
        }, Ho = 'label';
        const Uo = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Vo(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Fo(Fo({}, t.prototype.defaults), {type: Ho, tagName: Ho, traits: ['id', 'title', 'for']})
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === Ho
            }, n
        }(Ro);
        var zo = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Bo = void 0 && (void 0).__assign || function () {
            return Bo = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Bo.apply(this, arguments)
        }, Wo = 'link', $o = function (n) {
            function o() {
                return null !== n && n.apply(this, arguments) || this
            }

            return zo(o, n), Object.defineProperty(o.prototype, "defaults", {
                get: function () {
                    return Bo(Bo({}, n.prototype.defaults), {
                        type: Wo,
                        tagName: 'a',
                        traits: ['title', 'href', 'target']
                    })
                }, enumerable: !1, configurable: !0
            }), o.isComponent = function (n, o) {
                var r;
                if (void 0 === o && (o = {}), 'a' === (0, e.toLowerCase)(n.tagName)) {
                    var i = o.textTags || [];
                    r = {type: Wo, editable: !1};
                    var a = n.childNodes;
                    a.length || delete r.editable, (0, t.forEach)(a, (function (t) {
                        var n = t.tagName;
                        (3 == t.nodeType && '' !== t.textContent.trim() || n && i.indexOf((0, e.toLowerCase)(n)) >= 0) && delete r.editable
                    }))
                }
                return r
            }, o
        }(Ro);
        const qo = $o;
        var Go = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ko = void 0 && (void 0).__assign || function () {
            return Ko = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Ko.apply(this, arguments)
        }, Yo = function (t) {
            function n(e, n) {
                void 0 === e && (e = {});
                var o = t.call(this, e, n) || this;
                return o.get('src') ? o.parseFromSrc() : o.updateSrc(), o.listenTo(o, 'change:address change:zoom change:mapType', o.updateSrc), o
            }

            return Go(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    var e = t.prototype.defaults;
                    return Ko(Ko({}, e), {
                        type: 'map',
                        src: '',
                        void: !1,
                        mapUrl: 'https://maps.google.com/maps',
                        tagName: 'iframe',
                        mapType: 'q',
                        address: '',
                        zoom: '1',
                        attributes: {frameborder: 0},
                        toolbar: e.toolbar,
                        traits: [
                            {
                                label: 'Address',
                                name: 'address',
                                placeholder: 'eg. London, UK',
                                changeProp: !0
                            },
                            {
                                type: 'select',
                                label: 'Map type',
                                name: 'mapType',
                                changeProp: !0,
                                options: [
                                    {id: 'q', label: 'Roadmap'},
                                    {id: 'w', label: 'Satellite'}
                                ]
                            },
                            {
                                label: 'Zoom',
                                name: 'zoom',
                                type: 'range',
                                min: 1,
                                max: 100,
                                changeProp: !0
                            }
                        ]
                    })
                }, enumerable: !1, configurable: !0
            }), n.prototype.updateSrc = function () {
                this.set('src', this.getMapUrl())
            }, n.prototype.getMapUrl = function () {
                var t = this.get('address'),
                    e = this.get('zoom'),
                    n = this.get('mapType');
                t = t ? '&q=' + encodeURIComponent(t) : '',
                    e = e ? '&z=' + Math.round(Math.max(2, Math.min(e / 5, 20))) : '',
                    n = n ? '&t=' + n : '';
                var o = this.get('mapUrl') + '?' + t + e + n;
                return o += '&output=embed'
            }, n.prototype.parseFromSrc = function () {
                var t = this.parseUri(this.get('src')).query;
                t.q && this.set('address', t.q), t.z && this.set('zoom', t.z), t.t && this.set('mapType', t.t)
            }, n.isComponent = function (t) {
                if ('iframe' == (0, e.toLowerCase)(t.tagName) && /maps\.google\.com/.test(t.src)) return {
                    type: 'map',
                    src: t.src
                }
            }, n
        }(Lo);
        const Xo = Yo;
        var Jo = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Zo = void 0 && (void 0).__assign || function () {
            return Zo = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Zo.apply(this, arguments)
        }, Qo = 'script';
        const tr = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Jo(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Zo(Zo({}, t.prototype.defaults), {
                        type: Qo,
                        tagName: Qo,
                        droppable: !1,
                        draggable: !1,
                        layerable: !1,
                        highlightable: !1
                    })
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === Qo
            }, n
        }(jn);
        var er = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), nr = void 0 && (void 0).__assign || function () {
            return nr = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, nr.apply(this, arguments)
        }, or = 'svg';
        const rr = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return er(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return nr(nr({}, t.prototype.defaults), {
                        type: or,
                        tagName: or,
                        highlightable: !1,
                        resizable: {ratioDefault: !0}
                    })
                }, enumerable: !1, configurable: !0
            }), n.prototype.getName = function () {
                var t = this.get('tagName'), e = this.get('custom-name');
                return t = t.charAt(0).toUpperCase() + t.slice(1), e || t
            }, n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === or
            }, n
        }(jn);
        var ir = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ar = void 0 && (void 0).__assign || function () {
            return ar = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, ar.apply(this, arguments)
        };
        const sr = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return ir(e, t), Object.defineProperty(e.prototype, "defaults", {
                get: function () {
                    return ar(ar({}, t.prototype.defaults), {selectable: !1, hoverable: !1, layerable: !1})
                }, enumerable: !1, configurable: !0
            }), e.isComponent = function (t, e) {
                return void 0 === e && (e = {}), !!e.inSvg
            }, e
        }(rr);
        var lr = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), cr = void 0 && (void 0).__assign || function () {
            return cr = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, cr.apply(this, arguments)
        }, ur = 'table';
        const pr = function (t) {
            function n(e, n) {
                void 0 === e && (e = {});
                var o = t.call(this, e, n) || this, r = o.get('components');
                return !r.length && r.add({type: 'tbody'}), o
            }

            return lr(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return cr(cr({}, t.prototype.defaults), {
                        type: ur,
                        tagName: ur,
                        droppable: ['tbody', 'thead', 'tfoot']
                    })
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === ur
            }, n
        }(jn);
        var dr = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), fr = void 0 && (void 0).__assign || function () {
            return fr = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, fr.apply(this, arguments)
        }, hr = 'tbody';
        const vr = function (t) {
            function n(e, n) {
                void 0 === e && (e = {});
                var o = t.call(this, e, n) || this, r = o.get('components'), i = o.get('columns'), a = o.get('rows');
                if (!r.length) {
                    for (var s = []; a--;) {
                        for (var l = [], c = i; c--;) l.push({type: 'cell', classes: ['cell']});
                        s.push({type: 'row', classes: ['row'], components: l})
                    }
                    r.add(s)
                }
                return o
            }

            return dr(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return fr(fr({}, t.prototype.defaults), {
                        type: hr,
                        tagName: hr,
                        draggable: ['table'],
                        droppable: ['tr'],
                        columns: 1,
                        rows: 1
                    })
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === hr
            }, n
        }(jn);
        var gr = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), yr = void 0 && (void 0).__assign || function () {
            return yr = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, yr.apply(this, arguments)
        };
        const mr = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return gr(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return yr(yr({}, t.prototype.defaults), {type: 'cell', tagName: 'td', draggable: ['tr']})
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return ['td', 'th'].indexOf((0, e.toLowerCase)(t.tagName)) >= 0
            }, n
        }(jn);
        var br = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), _r = void 0 && (void 0).__assign || function () {
            return _r = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, _r.apply(this, arguments)
        }, wr = 'tfoot';
        const xr = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return br(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return _r(_r({}, t.prototype.defaults), {type: wr, tagName: wr})
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === wr
            }, n
        }(vr);
        var Cr = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Sr = void 0 && (void 0).__assign || function () {
            return Sr = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Sr.apply(this, arguments)
        }, Or = 'thead';
        const Tr = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Cr(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Sr(Sr({}, t.prototype.defaults), {type: Or, tagName: Or})
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === Or
            }, n
        }(vr);
        var Pr = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Er = void 0 && (void 0).__assign || function () {
            return Er = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Er.apply(this, arguments)
        }, kr = 'tr';
        const Ar = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Pr(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Er(Er({}, t.prototype.defaults), {
                        tagName: kr,
                        draggable: ['thead', 'tbody', 'tfoot'],
                        droppable: ['th', 'td']
                    })
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === kr
            }, n
        }(jn);
        var jr = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Mr = void 0 && (void 0).__assign || function () {
            return Mr = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Mr.apply(this, arguments)
        }, Dr = 'video', Lr = 'yt', Ir = 'vi', Nr = 'ytnc', Rr = 'so', Vr = function (t) {
            return t && '0' !== t
        }, Fr = function (t) {
            function n(e, n) {
                void 0 === e && (e = {});
                var o = t.call(this, e, n) || this;
                return o.get('src') && o.parseFromSrc(), o.updatePropsFromAttr(), o.updateTraits(), o.on('change:provider', o.updateTraits), o.on('change:videoId change:provider', o.updateSrc), o
            }

            return jr(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Mr(Mr({}, t.prototype.defaults), {
                        type: Dr,
                        tagName: Dr,
                        videoId: '',
                        void: !1,
                        provider: Rr,
                        ytUrl: 'https://www.youtube.com/embed/',
                        ytncUrl: 'https://www.youtube-nocookie.com/embed/',
                        viUrl: 'https://player.vimeo.com/video/',
                        loop: !1,
                        poster: '',
                        muted: !1,
                        autoplay: !1,
                        controls: !0,
                        color: '',
                        list: '',
                        src: '',
                        rel: 1,
                        modestbranding: 0,
                        sources: [],
                        attributes: {allowfullscreen: 'allowfullscreen'}
                    })
                }, enumerable: !1, configurable: !0
            }), n.prototype.updatePropsFromAttr = function () {
                if (this.get('provider') === Rr) {
                    var t = this.get('attributes'), n = t.controls, o = t.autoplay, r = t.loop, i = t.muted, a = {};
                    (0, e.isDef)(n) && (a.controls = !!n), (0, e.isDef)(o) && (a.autoplay = !!o), (0, e.isDef)(r) && (a.loop = !!r), (0, e.isDef)(i) && (a.muted = !!i), (0, e.isEmptyObj)(a) || this.set(a)
                }
            }, n.prototype.updateTraits = function () {
                var t, e = this.em, n = 'iframe';
                switch (this.get('provider')) {
                    case Lr:
                    case Nr:
                        t = this.getYoutubeTraits();
                        break;
                    case Ir:
                        t = this.getVimeoTraits();
                        break;
                    default:
                        n = 'video', t = this.getSourceTraits()
                }
                this.set({tagName: n}, {silent: !0}), this.set({traits: t}), e.get('ready') && e.trigger('component:toggled')
            }, n.prototype.parseFromSrc = function () {
                var t = this.get('provider'), e = this.parseUri(this.get('src')), n = e.query;
                switch (t) {
                    case Lr:
                    case Nr:
                    case Ir:
                        this.set('videoId', e.pathname.split('/').pop()), n.list && this.set('list', n.list), Vr(n.autoplay) && this.set('autoplay', !0), Vr(n.loop) && this.set('loop', !0), 0 === parseInt(n.controls) && this.set('controls', !1), Vr(n.color) && this.set('color', n.color), '0' === n.rel && this.set('rel', 0), '1' === n.modestbranding && this.set('modestbranding', 1), '1' === n.muted && this.set('muted', !0)
                }
            }, n.prototype.updateSrc = function () {
                var t = '';
                switch (this.get('provider')) {
                    case Lr:
                        t = this.getYoutubeSrc();
                        break;
                    case Nr:
                        t = this.getYoutubeNoCookieSrc();
                        break;
                    case Ir:
                        t = this.getVimeoSrc()
                }
                this.set({src: t})
            }, n.prototype.getAttrToHTML = function () {
                var e = t.prototype.getAttrToHTML.call(this);
                switch (this.get('provider')) {
                    case Lr:
                    case Nr:
                    case Ir:
                        break;
                    default:
                        e.loop = !!this.get('loop'), e.autoplay = !!this.get('autoplay'), e.controls = !!this.get('controls'), e.muted = !!this.get('muted')
                }
                return e
            }, n.prototype.getProviderTrait = function () {
                return {
                    type: 'select',
                    label: 'Provider',
                    name: 'provider',
                    changeProp: !0,
                    options: [{value: 'so', name: 'HTML5 Source'}, {value: Lr, name: 'Youtube'}, {
                        value: Nr,
                        name: 'Youtube (no cookie)'
                    }, {value: Ir, name: 'Vimeo'}]
                }
            }, n.prototype.getSourceTraits = function () {
                return [this.getProviderTrait(), {
                    label: 'Source',
                    name: 'src',
                    placeholder: 'eg. ./media/video.mp4',
                    changeProp: !0
                }, {
                    label: 'Poster',
                    name: 'poster',
                    placeholder: 'eg. ./media/image.jpg'
                }, this.getAutoplayTrait(), this.getLoopTrait(), this.getControlsTrait(), this.getMutedTrait()]
            }, n.prototype.getYoutubeTraits = function () {
                return [this.getProviderTrait(), {
                    label: 'Video ID',
                    name: 'videoId',
                    placeholder: 'eg. jNQXAC9IVRw',
                    changeProp: !0
                }, this.getAutoplayTrait(), this.getLoopTrait(), this.getControlsTrait(), {
                    type: 'checkbox',
                    label: 'Related',
                    name: 'rel',
                    changeProp: !0
                }, {type: 'checkbox', label: 'Modest', name: 'modestbranding', changeProp: !0}, this.getMutedTrait()]
            }, n.prototype.getVimeoTraits = function () {
                return [this.getProviderTrait(), {
                    label: 'Video ID',
                    name: 'videoId',
                    placeholder: 'eg. 123456789',
                    changeProp: !0
                }, {
                    label: 'Color',
                    name: 'color',
                    placeholder: 'eg. FF0000',
                    changeProp: !0
                }, this.getAutoplayTrait(), this.getLoopTrait(), this.getMutedTrait()]
            }, n.prototype.getAutoplayTrait = function () {
                return {type: 'checkbox', label: 'Autoplay', name: 'autoplay', changeProp: !0}
            }, n.prototype.getLoopTrait = function () {
                return {type: 'checkbox', label: 'Loop', name: 'loop', changeProp: !0}
            }, n.prototype.getControlsTrait = function () {
                return {type: 'checkbox', label: 'Controls', name: 'controls', changeProp: !0}
            }, n.prototype.getMutedTrait = function () {
                return {type: 'checkbox', label: 'Muted', name: 'muted', changeProp: !0}
            }, n.prototype.getYoutubeSrc = function () {
                var t = this.get('videoId'), e = this.get('ytUrl'), n = this.get('list');
                return e += t + (t.indexOf('?') < 0 ? '?' : ''), e += n ? "&list=".concat(n) : '', e += this.get('autoplay') ? '&autoplay=1' : '', e += this.get('muted') ? '&mute=1' : '', e += this.get('controls') ? '' : '&controls=0&showinfo=0', e += this.get('loop') ? "&loop=1&playlist=".concat(t) : '', e += this.get('rel') ? '' : '&rel=0', e += this.get('modestbranding') ? '&modestbranding=1' : ''
            }, n.prototype.getYoutubeNoCookieSrc = function () {
                var t = this.getYoutubeSrc();
                return t = t.replace(this.get('ytUrl'), this.get('ytncUrl'))
            }, n.prototype.getVimeoSrc = function () {
                var t = this.get('viUrl');
                return t += this.get('videoId') + '?', t += this.get('autoplay') ? '&autoplay=1' : '', t += this.get('muted') ? '&muted=1' : '', t += this.get('loop') ? '&loop=1' : '', t += this.get('controls') ? '' : '&title=0&portrait=0&badge=0', t += this.get('color') ? '&color=' + this.get('color') : ''
            }, n.isComponent = function (t) {
                var n = t.tagName, o = t.src, r = /youtube\.com\/embed/.test(o),
                    i = /youtube-nocookie\.com\/embed/.test(o), a = /player\.vimeo\.com\/video/.test(o),
                    s = r || i || a;
                if ((0, e.toLowerCase)(n) == Dr || 'iframe' == (0, e.toLowerCase)(n) && s) {
                    var l = {type: 'video'};
                    return o && (l.src = o), s && (r ? l.provider = Lr : i ? l.provider = Nr : a && (l.provider = Ir)), l
                }
            }, n
        }(Lo);
        const Hr = Fr;
        var Ur = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), zr = void 0 && (void 0).__assign || function () {
            return zr = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, zr.apply(this, arguments)
        }, Br = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return Ur(n, e), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return zr(zr({}, e.prototype.defaults), {
                        tagName: 'body',
                        removable: !1,
                        copyable: !1,
                        draggable: !1,
                        components: [],
                        traits: [],
                        doctype: '',
                        head: null,
                        docEl: null,
                        stylable: ['background', 'background-color', 'background-image', 'background-repeat', 'background-attachment', 'background-position', 'background-size']
                    })
                }, enumerable: !1, configurable: !0
            }), n.prototype.preInit = function () {
                var t, e, n = this.opt, o = this.attributes,
                    r = null === (t = this.em) || void 0 === t ? void 0 : t.Components,
                    i = null === (e = null == r ? void 0 : r.getType(Ln)) || void 0 === e ? void 0 : e.model,
                    a = null == r ? void 0 : r.getType('default').model;
                if (i) {
                    var s = o.head, l = o.docEl;
                    this.set({
                        head: s && s instanceof jn ? s : new i(zr({}, s), n),
                        docEl: l && l instanceof jn ? l : new a(zr({tagName: 'html'}, l), n)
                    }, {silent: !0})
                }
            }, Object.defineProperty(n.prototype, "head", {
                get: function () {
                    return this.get('head')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "docEl", {
                get: function () {
                    return this.get('docEl')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "doctype", {
                get: function () {
                    return this.attributes.doctype || ''
                }, enumerable: !1, configurable: !0
            }), n.prototype.clone = function (t) {
                var n = e.prototype.clone.call(this, t);
                return n.set('head', this.get('head').clone(t)), n.set('docEl', this.get('docEl').clone(t)), n
            }, n.prototype.toHTML = function (n) {
                void 0 === n && (n = {});
                var o = this.doctype, r = (0, t.isUndefined)(n.asDocument) ? !!o : n.asDocument, i = this.head,
                    a = this.docEl, s = e.prototype.toHTML.call(this, n),
                    l = r && (null == i ? void 0 : i.toHTML(n)) || '',
                    c = r && (0, Z.kk)(null == a ? void 0 : a.getAttrToHTML()) || '', u = c ? " ".concat(c) : '';
                return r ? "".concat(o, "<html").concat(u, ">").concat(l).concat(s, "</html>") : s
            }, n.prototype.__postAdd = function () {
                var t, n = null === (t = this.em) || void 0 === t ? void 0 : t.UndoManager;
                return !this.__hasUm && (null == n || n.add(this)), e.prototype.__postAdd.call(this)
            }, n.prototype.__postRemove = function () {
                var t, n = null === (t = this.em) || void 0 === t ? void 0 : t.UndoManager;
                return null == n || n.remove(this), e.prototype.__postRemove.call(this)
            }, n.isComponent = function () {
                return !1
            }, n
        }(jn);
        const Wr = Br;
        var $r = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), qr = function (e) {
            function n() {
                var t = null !== e && e.apply(this, arguments) || this;
                return t.compView = Jr, t
            }

            return $r(n, e), n.prototype.initialize = function (t) {
                this.opts = t || {}, this.config = t.config || {}, this.em = this.config.em;
                var e = this.collection;
                this.listenTo(e, 'add', this.addTo), this.listenTo(e, 'reset', this.resetChildren), this.listenTo(e, 'remove', this.removeChildren)
            }, n.prototype.removeChildren = function (t, e, n) {
                var o = this;
                void 0 === n && (n = {}), t.views.forEach((function (t) {
                    if (t) {
                        var e = t.childrenView, n = t.scriptContainer;
                        e && e.stopListening(), (0, Z.YZ)(n), t.remove.apply(t)
                    }
                })), t.components().forEach((function (t) {
                    return o.removeChildren(t, e, n)
                }))
            }, n.prototype.addTo = function (t) {
                this.addToCollection(t, null, this.collection.indexOf(t))
            }, n.prototype.addToCollection = function (e, n, o) {
                for (var r = this, i = r.config, a = r.opts, s = r.em, l = i.frameView, c = (null == l ? void 0 : l.model) && e.getView(l.model), u = a.componentTypes || (null == s ? void 0 : s.Components.getTypes()), p = e.get('type') || 'default', d = this.compView, f = 0; f < u.length; f++) if (u[f].id == p) {
                    d = u[f].view;
                    break
                }
                var h, v = c || new d({model: e, config: i, componentTypes: u});
                try {
                    h = v.render().el
                } catch (t) {
                    h = document.createTextNode(''), s.logError(t)
                }
                if (n) n.appendChild(h); else {
                    var g = this.parentEl, y = g.childNodes;
                    if ((0, t.isUndefined)(o)) g.appendChild(h); else {
                        var m = y.length == o;
                        m && o--, m || !y.length ? g.appendChild(h) : g.insertBefore(h, y[o])
                    }
                }
                return e.opt.temporary || null == s || s.trigger($.I.mount, e), h
            }, n.prototype.resetChildren = function (t, e) {
                var n = this;
                void 0 === e && (e = {});
                var o = e.previousModels;
                e.skipDomReset || (this.parentEl.innerHTML = ''), null == o || o.forEach((function (t) {
                    return n.removeChildren(t, n.collection)
                })), t.each((function (t) {
                    return n.addToCollection(t)
                }))
            }, n.prototype.render = function (t) {
                var e = this, n = this.el, o = document.createDocumentFragment();
                return this.parentEl = t || this.el, this.collection.each((function (t) {
                    return e.addToCollection(t, o)
                })), n.innerHTML = '', n.appendChild(o), this
            }, n
        }(u.Ss);
        const Gr = qr;
        var Kr = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Yr = void 0 && (void 0).__assign || function () {
            return Yr = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Yr.apply(this, arguments)
        }, Xr = function (n) {
            function o() {
                var t = null !== n && n.apply(this, arguments) || this;
                return t.rendered = !1, t
            }

            return Kr(o, n), o.prototype.className = function () {
                return this.getClasses()
            }, o.prototype.tagName = function () {
                return this.model.get('tagName')
            }, o.prototype.preinitialize = function (t) {
                void 0 === t && (t = {}), this.opts = t
            }, o.prototype.initialize = function (t) {
                void 0 === t && (t = {});
                var n = this.model, o = t.config || {}, r = o.em, i = n.opt || {}, a = this.$el, s = this.el;
                this.opts = t, this.modelOpt = i, this.config = o, this.em = r, this.pfx = o.stylePrefix || '', this.ppfx = o.pStylePrefix || '', this.attr = n.get('attributes'), this.classe = this.attr.class || [], this.listenTo(n, 'change:style', this.updateStyle), this.listenTo(n, 'change:attributes', this.renderAttributes), this.listenTo(n, 'change:highlightable', this.updateHighlight), this.listenTo(n, 'change:status change:locked', this.updateStatus), this.listenTo(n, 'change:script rerender', this.reset), this.listenTo(n, 'change:content', this.updateContent), this.listenTo(n, 'change', this.handleChange), this.listenTo(n, 'active', this.onActive), this.listenTo(n, 'disable', this.onDisable), a.data('model', n), (0, e.setViewEl)(s, this), n.view = this, this.frameView && n.views.push(this), this.initClasses(), this.initComponents({avoidRender: !0}), this.events = Yr(Yr({}, this.constructor.getEvents()), {dragstart: 'handleDragStart'}), this.delegateEvents(), !i.temporary && this.init(this._clbObj())
            }, Object.defineProperty(o.prototype, "__cmpStyleOpts", {
                get: function () {
                    return {state: '', mediaText: ''}
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "frameView", {
                get: function () {
                    return this.opts.config.frameView
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "createDoc", {
                get: function () {
                    var t, e, n = (null === (t = this.frameView) || void 0 === t ? void 0 : t.getDoc()) || document;
                    return (null === (e = this.opts.config) || void 0 === e ? void 0 : e.useFrameDoc) ? n : document
                }, enumerable: !1, configurable: !0
            }), o.prototype.__isDraggable = function () {
                var t = this.model, e = this.config, n = t.attributes.draggable;
                return e.draggableComponents && n
            }, o.prototype._clbObj = function () {
                var t = this, e = t.em, n = t.model, o = t.el;
                return {editor: null == e ? void 0 : e.getEditor(), model: n, el: o}
            }, o.prototype.init = function (t) {
            }, o.prototype.removed = function (t) {
            }, o.prototype.onRender = function (t) {
            }, o.prototype.onActive = function (t) {
            }, o.prototype.onDisable = function (t) {
            }, o.prototype.remove = function () {
                var t;
                n.prototype.remove.call(this);
                var e = this.model, o = this.$el, r = e.views, i = this.frameView || {};
                return e.components().forEach((function (t) {
                    var e = t.getView(i.model);
                    null == e || e.remove()
                })), null === (t = this.childrenView) || void 0 === t || t.remove(), r.splice(r.indexOf(this), 1), this.removed(this._clbObj()), o.data({
                    model: '',
                    collection: '',
                    view: ''
                }), this
            }, o.prototype.handleDragStart = function (t) {
                if (!this.__isDraggable()) return !1;
                t.stopPropagation(), t.preventDefault();
                var e = this.em.getSelectedAll(), n = e.includes(this.model) ? e : [this.model];
                this.em.Commands.run('tlb-move', {target: n, event: t})
            }, o.prototype.initClasses = function () {
                var t = this.model, e = t.classes, n = 'change:classes';
                e instanceof Ye && (this.stopListening(t, n, this.initClasses), this.listenTo(t, n, this.initClasses), this.listenTo(e, 'add remove change reset', this.updateClasses), e.length && this.importClasses())
            }, o.prototype.initComponents = function (t) {
                void 0 === t && (t = {});
                var e = this, n = e.model, o = e.$el, r = e.childrenView, i = n.get('components'),
                    a = [n, 'change:components', this.initComponents];
                i instanceof He && (o.data('collection', i), r && r.remove(), this.stopListening.apply(this, a), !t.avoidRender && this.renderChildren(), this.listenTo.apply(this, a))
            }, o.prototype.handleChange = function () {
                var e = this.model, n = (0, t.keys)(e.changed);
                if (1 !== n.length || 'status' !== n[0]) for (var o in e.emitUpdate(), e.changed) e.emitUpdate(o)
            }, o.prototype.importClasses = function () {
                var t = this.em, e = this.model, n = t.Selectors;
                n && e.classes.forEach((function (t) {
                    return n.add(t.getName())
                }))
            }, o.prototype.updateStatus = function (e) {
                void 0 === e && (e = {});
                var n = this, o = n.em, r = n.el, i = n.ppfx, a = n.model, s = null == o ? void 0 : o.Canvas,
                    l = null == s ? void 0 : s.config.extHl, c = a.get('status'), u = "".concat(i, "selected"),
                    p = "".concat(u, "-parent"), d = "".concat(i, "freezed"), f = "".concat(i, "hovered"),
                    h = "".concat(i, "no-pointer"), v = "".concat(i, "pointer-init"), g = [u, p, d, f, h, v],
                    y = l && !e.noExtHl ? '' : u;
                this.$el.removeClass(g.join(' '));
                var m = [r.getAttribute('class') || ''], b = !(null == s ? void 0 : s.hasCustomSpot(W.F.Select)),
                    _ = !(null == s ? void 0 : s.hasCustomSpot(W.F.Target));
                switch (c) {
                    case'selected':
                        b && m.push(y);
                        break;
                    case'selected-parent':
                        _ && m.push(p);
                        break;
                    case'freezed':
                        m.push(d);
                        break;
                    case'freezed-selected':
                        m.push(d), b && m.push(y);
                        break;
                    case'hovered':
                        !e.avoidHover && m.push(f)
                }
                (0, t.isBoolean)(a.locked) && m.push(a.locked ? h : v);
                var w = m.filter(Boolean).join(' ');
                w && r.setAttribute('class', w)
            }, o.prototype.updateHighlight = function () {
                var t = this.model, e = t.get('textable'), n = t.get('highlightable') && (e || !t.isChildOf('text'));
                this.setAttribute('data-gjs-highlightable', !!n || '')
            }, o.prototype.updateStyle = function (e, n, o) {
                void 0 === o && (o = {});
                var r = this.model, i = this.em;
                if (Cn(i) && !o.inline) {
                    var a = this.__cmpStyleOpts, s = r.getStyle(Yr({inline: !0}, a));
                    !(0, t.isEmpty)(s) && r.setStyle(s, a)
                } else this.setAttribute('style', r.styleToString(o))
            }, o.prototype.updateStyles = function () {
                this.updateStyle()
            }, o.prototype.updateClasses = function () {
                var t = this.model.classes.pluck('name').join(' ');
                this.setAttribute('class', t), this.updateStatus(), this.onAttrUpdate()
            }, o.prototype.setAttribute = function (t, e) {
                var n = this.$el;
                e ? n.attr(t, e) : n.removeAttr(t)
            }, o.prototype.getClasses = function () {
                return this.model.getClasses().join(' ')
            }, o.prototype.updateAttributes = function () {
                var e = this, n = e.model, o = e.$el, r = (e.el, n.attributes), i = r.textable, a = r.type, s = Yr(Yr({
                    id: n.getId(),
                    'data-gjs-type': a || 'default'
                }, this.__isDraggable() && {draggable: !0}), i && {contenteditable: 'false'});
                this.__clearAttributes(), this.updateStyle(), this.updateHighlight();
                var l = Yr(Yr({}, s), n.getAttributes());
                (0, t.keys)(l).forEach((function (t) {
                    return !1 === l[t] && delete l[t]
                })), o.attr(l)
            }, o.prototype.__clearAttributes = function () {
                var e = this.el, n = this.$el, o = [];
                (0, t.each)(e.attributes, (function (t) {
                    return o.push(t.nodeName)
                })), o.forEach((function (t) {
                    return n.removeAttr(t)
                }))
            }, o.prototype.updateContent = function () {
                var t = this.model.content, e = this.model.components().length;
                this.getChildrenContainer().innerHTML = e ? '' : t
            }, o.prototype.prevDef = function (t) {
                t.preventDefault()
            }, o.prototype.updateScript = function () {
                var t = this.model, e = this.em;
                t.get('script') && (null == e || e.Canvas.getCanvasView().updateScript(this))
            }, o.prototype.getChildrenContainer = function () {
                var t = this.el;
                return 'function' == typeof this.getChildrenSelector ? t = this.el.querySelector(this.getChildrenSelector()) : this.getTemplate, t
            }, o.prototype.getOffsetRect = function () {
                var t = {top: 0, left: 0, bottom: 0, right: 0}, e = this.el, n = 0, o = 0, r = function (i) {
                    var a = i.offsetParent;
                    a ? (n += a.offsetTop, o += a.offsetLeft, r(a)) : (t.top = e.offsetTop + n, t.left = e.offsetLeft + o, t.bottom = t.top + e.offsetHeight, t.right = t.left + e.offsetWidth)
                };
                return r(e), t
            }, o.prototype.isInViewport = function () {
                var t = this, e = t.el, n = t.em, o = t.frameView,
                    r = n.Canvas.getCanvasView().getElBoxRect(e, {local: !0}), i = o.el, a = i.clientHeight,
                    s = i.clientWidth, l = r.y, c = r.x, u = l + r.height, p = c + r.width;
                return (l >= 0 && l < a || u > 0 && u < a) && (p >= 0 && p < s || c > 0 && c <= s)
            }, o.prototype.scrollIntoView = function (t) {
                var e;
                if (void 0 === t && (t = {}), !this.isInViewport() || t.force) {
                    var n = this.el;
                    if ('smooth' !== t.behavior) {
                        var o = this.getOffsetRect();
                        null === (e = n.ownerDocument.defaultView) || void 0 === e || e.scrollTo(0, o.top)
                    } else n.scrollIntoView(Yr({behavior: 'smooth', block: 'nearest'}, t))
                }
            }, o.prototype.reset = function () {
                var t = this, e = t.el, n = t.model;
                t.scriptContainer && n.emitWithEditor($.I.scriptUnmount, {
                    component: n,
                    view: t,
                    el: e
                }), this.el = '', this._ensureElement(), this._setData(), (0, Z.bG)(e, this.el), this.render()
            }, o.prototype._setData = function () {
                var t = this.model, n = this.el, o = t.components();
                this.$el.data({model: t, collection: o, view: this}), (0, e.setViewEl)(n, this)
            }, o.prototype._createElement = function (t) {
                return this.createDoc.createElement(t)
            }, o.prototype.renderChildren = function () {
                this.updateContent();
                var t = this.getChildrenContainer(), e = this.childrenView || new Gr({
                    collection: this.model.get('components'),
                    config: this.config,
                    componentTypes: this.opts.componentTypes
                });
                e.render(t), this.childrenView = e;
                for (var n = Array.prototype.slice.call(e.el.childNodes), o = 0, r = n.length; o < r; o++) t.appendChild(n.shift())
            }, o.prototype.renderAttributes = function () {
                this.updateAttributes(), this.updateClasses()
            }, o.prototype.onAttrUpdate = function () {
            }, o.prototype.render = function () {
                return this.renderAttributes(), this.modelOpt.temporary || (this.renderChildren(), this.updateScript(), (0, e.setViewEl)(this.el, this), this.postRender()), this
            }, o.prototype.postRender = function () {
                if (!this.modelOpt.temporary) {
                    var t = this.model, e = this.el;
                    this.onRender(this._clbObj()), t.emitWithEditor($.I.render, {
                        component: t,
                        view: this,
                        el: e
                    }), this.rendered = !0
                }
            }, o.getEvents = function () {
                return (0, t.result)(this.prototype, 'events')
            }, o
        }(u.Ss);
        const Jr = Xr;
        var Zr = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Qr = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Zr(e, t), e.prototype._setAttributes = function () {
            }, e.prototype.renderAttributes = function () {
            }, e.prototype.updateStatus = function () {
            }, e.prototype.updateClasses = function () {
            }, e.prototype.setAttribute = function () {
            }, e.prototype.updateAttributes = function () {
            }, e.prototype.initClasses = function () {
            }, e.prototype.initComponents = function () {
            }, e.prototype.delegateEvents = function () {
                return this
            }, e.prototype._createElement = function () {
                return document.createTextNode('')
            }, e.prototype.render = function () {
                var t = this.model, e = this.el;
                return t.opt.temporary || (e.textContent = t.content), this
            }, e
        }(Jr);
        var ti = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const ei = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return ti(e, t), e.prototype._createElement = function () {
                return document.createComment(this.model.content)
            }, e
        }(Qr);
        var ni = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const oi = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return ni(e, t), e.prototype.tagName = function () {
                return 'div'
            }, e.prototype.initialize = function (e) {
                t.prototype.initialize.call(this, e), this.listenTo(this.model, 'change:attributes:src', this.updateSrc)
            }, e.prototype.updateSrc = function () {
                var t = (0, Z.I6)(this.el, 'iframe')[0];
                t && (0, Z.X6)(t, {src: this.__getSrc()})
            }, e.prototype.render = function () {
                t.prototype.render.call(this);
                var e = (0, Z.a_)('iframe', {
                    class: "".concat(this.ppfx, "no-pointer"),
                    style: 'width: 100%; height: 100%; border: none',
                    src: this.__getSrc()
                });
                return this.el.appendChild(e), this
            }, e.prototype.__getSrc = function () {
                return this.model.getAttributes().src || ''
            }, e
        }(Jr);
        var ri = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ii = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return ri(n, e), n.prototype.tagName = function () {
                return 'img'
            }, n.prototype.events = function () {
                return {
                    dblclick: 'onActive',
                    click: 'initResize',
                    error: 'onError',
                    load: 'onLoad',
                    dragstart: 'noDrag'
                }
            }, n.prototype.initialize = function (t) {
                e.prototype.initialize.call(this, t), this.listenTo(this.model, 'change:src', this.updateSrc), this.classEmpty = "".concat(this.ppfx, "plh-image"), this.fetchFile()
            }, n.prototype.fetchFile = function () {
                if (!this.modelOpt.temporary) {
                    var e = this.model, n = this.em, o = e.get('file');
                    if (o && n) {
                        var r = n.Assets.FileUploader();
                        null == r || r.uploadFile({dataTransfer: {files: [o]}}, (function (n) {
                            var o = n && n.data && n.data[0], r = o && ((0, t.isString)(o) ? o : o.src);
                            r && e.set({src: r})
                        })), e.set('file', '')
                    }
                }
            }, n.prototype.updateSrc = function () {
                var t = this.model;
                t.addAttributes({src: t.getSrcResult()}), this.updateClasses()
            }, n.prototype.updateClasses = function () {
                e.prototype.updateClasses.call(this);
                var t = this, n = t.el, o = t.classEmpty, r = t.model,
                    i = r.getSrcResult() && !r.isDefaultSrc() ? 'remove' : 'add';
                n.classList[i](o)
            }, n.prototype.onActive = function (t) {
                null == t || t.stopPropagation();
                var e = this.em, n = this.model, o = null == e ? void 0 : e.Assets;
                o && n.get('editable') && o.open({
                    select: function (t, e) {
                        n.set({src: t.getSrc()}), e && o.close()
                    }, target: n, types: ['image'], accept: 'image/*'
                })
            }, n.prototype.onError = function () {
                var t = this.model, e = this.el, n = t.getSrcResult({fallback: !0});
                n && (e.srcset && (e.srcset = ''), e.src = n)
            }, n.prototype.onLoad = function () {
                this.em.Canvas.refresh({all: !0})
            }, n.prototype.noDrag = function (t) {
                return t.preventDefault(), !1
            }, n.prototype.render = function () {
                if (this.renderAttributes(), this.modelOpt.temporary) return this;
                this.updateSrc();
                var t = this.$el, e = this.model, n = t.attr('class') || '';
                return !e.get('src') && t.attr('class', "".concat(n, " ").concat(this.classEmpty).trim()), this.postRender(), this
            }, n
        }(Jr);
        const ai = ii;
        var si = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), li = void 0 && (void 0).__assign || function () {
            return li = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, li.apply(this, arguments)
        }, ci = void 0 && (void 0).__awaiter || function (t, e, n, o) {
            return new (n || (n = Promise))((function (r, i) {
                function a(t) {
                    try {
                        l(o.next(t))
                    } catch (t) {
                        i(t)
                    }
                }

                function s(t) {
                    try {
                        l(o["throw"](t))
                    } catch (t) {
                        i(t)
                    }
                }

                function l(t) {
                    var e;
                    t.done ? r(t.value) : (e = t.value, e instanceof n ? e : new n((function (t) {
                        t(e)
                    }))).then(a, s)
                }

                l((o = o.apply(t, e || [])).next())
            }))
        }, ui = void 0 && (void 0).__generator || function (t, e) {
            var n, o, r, i, a = {
                label: 0, sent: function () {
                    if (1 & r[0]) throw r[1];
                    return r[1]
                }, trys: [], ops: []
            };
            return i = {
                next: s(0),
                throw: s(1),
                return: s(2)
            }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
                return this
            }), i;

            function s(s) {
                return function (l) {
                    return function (s) {
                        if (n) throw new TypeError("Generator is already executing.");
                        for (; i && (i = 0, s[0] && (a = 0)), a;) try {
                            if (n = 1, o && (r = 2 & s[0] ? o["return"] : s[0] ? o["throw"] || ((r = o["return"]) && r.call(o), 0) : o.next) && !(r = r.call(o, s[1])).done) return r;
                            switch (o = 0, r && (s = [2 & s[0], r.value]), s[0]) {
                                case 0:
                                case 1:
                                    r = s;
                                    break;
                                case 4:
                                    return a.label++, {value: s[1], done: !1};
                                case 5:
                                    a.label++, o = s[1], s = [0];
                                    continue;
                                case 7:
                                    s = a.ops.pop(), a.trys.pop();
                                    continue;
                                default:
                                    if (!(r = a.trys, (r = r.length > 0 && r[r.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
                                        a = 0;
                                        continue
                                    }
                                    if (3 === s[0] && (!r || s[1] > r[0] && s[1] < r[3])) {
                                        a.label = s[1];
                                        break
                                    }
                                    if (6 === s[0] && a.label < r[1]) {
                                        a.label = r[1], r = s;
                                        break
                                    }
                                    if (r && a.label < r[2]) {
                                        a.label = r[2], a.ops.push(s);
                                        break
                                    }
                                    r[2] && a.ops.pop(), a.trys.pop();
                                    continue
                            }
                            s = e.call(t, a)
                        } catch (t) {
                            s = [6, t], o = 0
                        } finally {
                            n = r = 0
                        }
                        if (5 & s[0]) throw s[1];
                        return {value: s[0] ? s[1] : void 0, done: !0}
                    }([s, l])
                }
            }
        }, pi = function (n) {
            function o() {
                return null !== n && n.apply(this, arguments) || this
            }

            return si(o, n), o.prototype.events = function () {
                return {dblclick: 'onActive', input: 'onInput'}
            }, o.prototype.initialize = function (e) {
                n.prototype.initialize.call(this, e), (0, t.bindAll)(this, 'disableEditing', 'onDisable');
                var o = this.model, r = this.em;
                this.listenTo(o, 'focus', this.onActive), this.listenTo(o, 'change:content', this.updateContentText), this.listenTo(o, 'sync:content', this.syncContent), this.rte = null == r ? void 0 : r.RichTextEditor
            }, o.prototype.updateContentText = function (t, e, n) {
                void 0 === n && (n = {}), !n.fromDisable && this.disableEditing()
            }, o.prototype.canActivate = function () {
                var t, e = this, n = e.model, o = e.rteEnabled, r = e.em,
                    i = (null == r ? void 0 : r.getEditing()) === n, a = !0, s = !1;
                if ((o || !n.get('editable') || i || (s = n.isChildOf('text'))) && (a = !1, s && !n.get('textable'))) {
                    for (var l = n.parent(); l && !l.isInstanceOf('text');) l = l.parent();
                    l && l.get('editable') ? t = l : a = !0
                }
                return {result: a, delegate: t}
            }, o.prototype.onActive = function (t) {
                return ci(this, void 0, void 0, (function () {
                    var e, n, o, r, i, a, s, l, c, u, p, d;
                    return ui(this, (function (f) {
                        switch (f.label) {
                            case 0:
                                return n = (e = this).rte, o = e.em, r = this.canActivate(), i = r.result, a = r.delegate, i ? (null === (d = null == t ? void 0 : t.stopPropagation) || void 0 === d || d.call(t), s = this, [4, this.getContent()]) : (a && (null === (p = null == t ? void 0 : t.stopPropagation) || void 0 === p || p.call(t), o.setSelected(a), a.trigger('active', t)), [2]);
                            case 1:
                                if (s.lastContent = f.sent(), !n) return [3, 5];
                                f.label = 2;
                            case 2:
                                return f.trys.push([2, 4, , 5]), l = this, c = this, [4, n.enable(l, this.activeRte, {
                                    event: t,
                                    view: l
                                })];
                            case 3:
                                return c.activeRte = f.sent(), [3, 5];
                            case 4:
                                return u = f.sent(), o.logError(u), [3, 5];
                            case 5:
                                return this.toggleEvents(!0), [2]
                        }
                    }))
                }))
            }, o.prototype.onDisable = function (t) {
                this.disableEditing(t)
            }, o.prototype.disableEditing = function () {
                return ci(this, arguments, void 0, (function (t) {
                    var e, n, o, r, i, a, s, l, c;
                    return void 0 === t && (t = {}), ui(this, (function (u) {
                        switch (u.label) {
                            case 0:
                                return n = (e = this).model, o = e.rte, r = e.activeRte, i = e.em, a = n && n.get('editable'), o ? (s = {}, [4, this.getContent()]) : [3, 7];
                            case 1:
                                l = u.sent(), u.label = 2;
                            case 2:
                                return u.trys.push([2, 4, , 5]), [4, o.disable(this, r, t)];
                            case 3:
                                return s = u.sent(), [3, 5];
                            case 4:
                                return c = u.sent(), i.logError(c), [3, 5];
                            case 5:
                                return !a || l === this.lastContent && !s.forceSync ? [3, 7] : [4, this.syncContent(li(li({}, t), {content: l}))];
                            case 6:
                                u.sent(), this.lastContent = '', u.label = 7;
                            case 7:
                                return this.toggleEvents(), [2]
                        }
                    }))
                }))
            }, o.prototype.getContent = function () {
                return ci(this, void 0, void 0, (function () {
                    var t, e, n, o;
                    return ui(this, (function (r) {
                        switch (r.label) {
                            case 0:
                                return e = (t = this).rte, n = t.activeRte, o = '', e ? [4, e.getContent(this, n)] : [3, 2];
                            case 1:
                                o = r.sent(), r.label = 2;
                            case 2:
                                return [2, o]
                        }
                    }))
                }))
            }, o.prototype.syncContent = function () {
                return ci(this, arguments, void 0, (function (t) {
                    var e, n, o, r, i, a, s, l;
                    return void 0 === t && (t = {}), ui(this, (function (c) {
                        switch (c.label) {
                            case 0:
                                return n = (e = this).model, o = e.rte, e.rteEnabled || t.force ? null === (l = t.content) || void 0 === l ? [3, 1] : (i = l, [3, 3]) : [2];
                            case 1:
                                return [4, this.getContent()];
                            case 2:
                                i = c.sent(), c.label = 3;
                            case 3:
                                return r = i, a = n.components(), s = li({fromDisable: 1}, t), n.set('content', '', s), (null == o ? void 0 : o.customRte) && !o.customRte.parseContent ? (a.length && a.reset(void 0, li(li({}, t), {keepIds: Re(a)})), n.set('content', r, s)) : a.resetFromString(r, t), [2]
                        }
                    }))
                }))
            }, o.prototype.insertComponent = function (t, n) {
                var o;
                void 0 === n && (n = {});
                var r = this.model, i = this.el.ownerDocument.getSelection();
                if (null == i ? void 0 : i.rangeCount) {
                    var a = i.getRangeAt(0), s = a.startContainer, l = a.startOffset, c = (0, e.getComponentModel)(s),
                        u = [];
                    if (c && (null === (o = c.is) || void 0 === o ? void 0 : o.call(c, 'textnode'))) {
                        var p = c.collection;
                        p.forEach((function (e) {
                            if (e === c) {
                                var o = 'textnode', r = n.useDomContent ? s.textContent || '' : e.content;
                                u.push({type: o, content: r.slice(0, l)}), u.push(t), u.push({
                                    type: o,
                                    content: r.slice(l)
                                })
                            } else u.push(e)
                        }));
                        var d = u.filter(Boolean), f = d.indexOf(t);
                        return p.reset(d, n), p.at(f)
                    }
                }
                return r.append(t, n)
            }, o.prototype.onInput = function () {
                var t = this.model;
                [$.I.update, $.I.input].forEach((function (e) {
                    return t.emitWithEditor(e, t)
                }))
            }, o.prototype.disablePropagation = function (t) {
                t.stopPropagation()
            }, o.prototype.toggleEvents = function (t) {
                var e = this, n = e.em, o = e.model, r = e.$el, i = {on: Z.on, off: Z.AU}, a = t ? 'on' : 'off';
                n.setEditing(!!t && this), this.rteEnabled = !!t;
                var s = [this.el.ownerDocument, document];
                if (i.off(s, 'mousedown', this.onDisable), i[a](s, 'mousedown', this.onDisable), n[a]('toolbar:run:before', this.onDisable), o && (o[a]('removed', this.onDisable), o.trigger("rte:".concat(t ? 'enable' : 'disable'))), null == r || r.off('mousedown', this.disablePropagation), r && r[a]('mousedown', this.disablePropagation), this.config.draggableComponents) for (var l = this.el; l;) l.draggable = !t, (l = l.parentNode) && 'BODY' == l.tagName && (l = 0)
            }, o
        }(Jr);
        const di = pi;
        var fi = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const hi = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return fi(e, t), e.prototype.render = function () {
                return t.prototype.render.call(this), this.el.addEventListener('click', this.prevDef, !0), this
            }, e
        }(di);
        var vi = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const gi = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return vi(e, t), e
        }(hi);
        var yi = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const mi = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return yi(e, t), e.prototype.tagName = function () {
                return 'div'
            }, e.prototype.events = function () {
                return {}
            }, e.prototype.initialize = function (e) {
                t.prototype.initialize.call(this, e), this.classEmpty = this.ppfx + 'plh-map'
            }, e.prototype.updateSrc = function () {
                this.getIframe().src = this.model.get('src')
            }, e.prototype.getIframe = function () {
                if (!this.iframe) {
                    var t = document.createElement('iframe');
                    t.src = this.model.get('src'), t.frameBorder = '0', t.style.height = '100%', t.style.width = '100%', t.className = this.ppfx + 'no-pointer', this.iframe = t
                }
                return this.iframe
            }, e.prototype.render = function () {
                return t.prototype.render.call(this), this.updateClasses(), this.el.appendChild(this.getIframe()), this
            }, e
        }(ai);
        var bi = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const _i = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return bi(e, t), e.prototype.tagName = function () {
                return 'script'
            }, e.prototype.events = function () {
                return {}
            }, e
        }(Jr);
        var wi = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), xi = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return wi(e, t), e.prototype._createElement = function (t) {
                return document.createElementNS('http://www.w3.org/2000/svg', t)
            }, e
        }(Jr);
        const Ci = xi;
        var Si = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Oi = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Si(e, t), e
        }(Jr);
        var Ti = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Pi = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ti(e, t), e
        }(Jr);
        var Ei = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const ki = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ei(e, t), e
        }(Jr);
        var Ai = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const ji = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ai(e, t), e
        }(Jr);
        var Mi = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Di = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Mi(e, t), e
        }(Jr);
        var Li = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Ii = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Li(e, t), e.prototype.events = function () {
                return {}
            }, e
        }(Jr);
        var Ni = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ri = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ni(e, t), e.prototype.tagName = function () {
                return 'div'
            }, e.prototype.events = function () {
                return {}
            }, e.prototype.initialize = function () {
                Jr.prototype.initialize.apply(this, arguments);
                var t = this.model,
                    e = ['loop', 'autoplay', 'controls', 'color', 'rel', 'modestbranding', 'poster', 'muted'].map((function (t) {
                        return "change:".concat(t)
                    })).join(' ');
                this.listenTo(t, 'change:provider', this.updateProvider), this.listenTo(t, 'change:src', this.updateSrc), this.listenTo(t, e, this.updateVideo)
            }, e.prototype.updateProvider = function () {
                var t = this.model.get('provider');
                this.el.innerHTML = '', this.el.appendChild(this.renderByProvider(t))
            }, e.prototype.updateSrc = function () {
                var t = this.model, e = this.videoEl;
                if (e) {
                    var n = t.get('provider'), o = t.get('src');
                    switch (n) {
                        case'yt':
                            o = t.getYoutubeSrc();
                            break;
                        case'ytnc':
                            o = t.getYoutubeNoCookieSrc();
                            break;
                        case'vi':
                            o = t.getVimeoSrc()
                    }
                    e.src = o
                }
            }, e.prototype.updateVideo = function () {
                var t = this.model, e = this.videoEl;
                switch (t.get('provider')) {
                    case'yt':
                    case'ytnc':
                    case'vi':
                        t.trigger('change:videoId');
                        break;
                    default:
                        if (e) {
                            var n = e;
                            n.loop = t.get('loop'), n.autoplay = t.get('autoplay'), n.controls = t.get('controls'), n.poster = t.get('poster'), n.muted = t.get('muted')
                        }
                }
            }, e.prototype.renderByProvider = function (t) {
                var e;
                switch (t) {
                    case'yt':
                        e = this.renderYoutube();
                        break;
                    case'ytnc':
                        e = this.renderYoutubeNoCookie();
                        break;
                    case'vi':
                        e = this.renderVimeo();
                        break;
                    default:
                        e = this.renderSource()
                }
                return this.videoEl = e, e
            }, e.prototype.renderSource = function () {
                var t = document.createElement('video');
                return t.src = this.model.get('src'), this.initVideoEl(t), t
            }, e.prototype.renderYoutube = function () {
                var t = document.createElement('iframe');
                return t.src = this.model.getYoutubeSrc(), t.frameBorder = '0', t.setAttribute('allowfullscreen', 'true'), this.initVideoEl(t), t
            }, e.prototype.renderYoutubeNoCookie = function () {
                var t = document.createElement('iframe');
                return t.src = this.model.getYoutubeNoCookieSrc(), t.frameBorder = '0', t.setAttribute('allowfullscreen', 'true'), this.initVideoEl(t), t
            }, e.prototype.renderVimeo = function () {
                var t = document.createElement('iframe');
                return t.src = this.model.getVimeoSrc(), t.frameBorder = '0', t.setAttribute('allowfullscreen', 'true'), this.initVideoEl(t), t
            }, e.prototype.initVideoEl = function (t) {
                t.className = this.ppfx + 'no-pointer', t.style.height = '100%', t.style.width = '100%'
            }, e.prototype.render = function () {
                Jr.prototype.render.apply(this), this.updateClasses();
                var t = this.model.get('provider');
                return this.el.appendChild(this.renderByProvider(t)), this.updateVideo(), this
            }, e
        }(ai);
        const Vi = Ri;
        var Fi = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Hi = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Fi(e, t), e.prototype.tagName = function () {
                return 'div'
            }, e
        }(Jr);
        var Ui = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), zi = void 0 && (void 0).__assign || function () {
            return zi = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, zi.apply(this, arguments)
        }, Bi = function (e) {
            function n() {
                for (var n = [], o = 0; o < arguments.length; o++) n[o] = arguments[o];
                var r = e.apply(this, n) || this;
                r.refreshDbn = (0, t.debounce)((function () {
                    return r.refresh()
                }), 0);
                var i = r.events;
                return r.on(i.update, r.onUpdate), r.on(i.updateInside, r.onUpdateDeep), r
            }

            return Ui(n, e), n.prototype.removeChildren = function (t, n, o) {
                var r;
                void 0 === o && (o = {}), e.prototype.removeChildren.call(this, t, n, o), null === (r = Zt(t)) || void 0 === r || r.forEach((function (t) {
                    return ne(t, {skipRefs: !0})
                })), this.__trgEvent(this.events.symbolMainRemove, {component: t})
            }, n.prototype.onAdd = function () {
                for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
                e.prototype.onAdd.apply(this, t);
                var o = t[0];
                this.__trgEvent(this.events.symbolMainAdd, {component: o})
            }, n.prototype.onUpdate = function (t) {
                this.__trgEvent(this.events.symbolMainUpdate, t)
            }, n.prototype.onUpdateDeep = function (t) {
                this.__trgEvent(this.events.symbolMainUpdateDeep, t)
            }, n.prototype.refresh = function () {
                var t = this.em, e = this.events;
                t.trigger(e.symbol)
            }, n.prototype.__trgEvent = function (t, e, n) {
                void 0 === n && (n = !1);
                var o = this.em, r = this.events, i = n ? r.symbolInstance : r.symbolMain;
                o.trigger(t, e), o.trigger(i, zi(zi({}, e), {event: t})), this.refreshDbn()
            }, n
        }(He);
        const Wi = Bi;
        var $i = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), qi = void 0 && (void 0).__assign || function () {
            return qi = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, qi.apply(this, arguments)
        }, Gi = function (t) {
            function e(e, n) {
                var o = t.call(this, e, n) || this;
                return o.dataResolver = o.initializeDataResolver(e, n), o.listenToPropsChange(), o
            }

            return $i(e, t), e.prototype.initializeDataResolver = function (t, e) {
                var n, o = null !== (n = t.dataResolver) && void 0 !== n ? n : {type: t.type};
                return this.createResolverInstance(o, qi(qi({}, e), {collectionsStateMap: this.collectionsStateMap}))
            }, e.prototype.getDataResolver = function () {
                return this.get('dataResolver')
            }, e.prototype.setDataResolver = function (t) {
                return this.set('dataResolver', t)
            }, e.prototype.onCollectionsStateMapUpdate = function (e) {
                this.dataResolver.updateCollectionsStateMap(e), t.prototype.onCollectionsStateMapUpdate.call(this, e)
            }, e.prototype.listenToPropsChange = function () {
                var t = this;
                this.listenTo(this.dataResolver, 'change', function () {
                    t.__changesUp({m: t})
                }.bind(this)), this.on('change:dataResolver', (function () {
                    t.dataResolver.set(t.get('dataResolver'))
                }))
            }, e.prototype.removePropsListeners = function () {
                this.stopListening(this.dataResolver), this.off('change:dataResolver'), this.off("change:".concat(this.collectionsStateMap))
            }, e.prototype.destroy = function (e) {
                return this.removePropsListeners(), t.prototype.destroy.call(this, e)
            }, e.prototype.toJSON = function (e) {
                var n = t.prototype.toJSON.call(this, e), o = this.dataResolver.toJSON();
                return delete o.type, qi(qi({}, n), {dataResolver: o})
            }, e
        }(jn), Ki = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Yi = void 0 && (void 0).__assign || function () {
            return Yi = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Yi.apply(this, arguments)
        };
        const Xi = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ki(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Yi(Yi({}, t.prototype.defaults), {type: ge, dataResolver: {}, droppable: !1})
                }, enumerable: !1, configurable: !0
            }), n.prototype.getPath = function () {
                return this.dataResolver.get('path')
            }, n.prototype.getCollectionId = function () {
                return this.dataResolver.get('collectionId')
            }, n.prototype.getVariableType = function () {
                return this.dataResolver.get('variableType')
            }, n.prototype.getDefaultValue = function () {
                return this.dataResolver.get('defaultValue')
            }, n.prototype.getDataValue = function () {
                return this.dataResolver.getDataValue()
            }, n.prototype.resolvesFromCollection = function () {
                return this.dataResolver.resolvesFromCollection()
            }, n.prototype.getInnerHTML = function () {
                return this.getDataValue()
            }, n.prototype.setPath = function (t) {
                this.dataResolver.set('path', t)
            }, n.prototype.setDefaultValue = function (t) {
                this.dataResolver.set('defaultValue', t)
            }, n.prototype.resetDataSourcePath = function (t) {
                this.set('dataResolver', {path: t, collectionId: void 0, variableType: void 0})
            }, n.prototype.createResolverInstance = function (t, e) {
                return new me(t, e)
            }, n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === ge
            }, n
        }(Gi);
        var Ji = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Zi = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ji(e, t), e.prototype.initialize = function (e) {
                var n = this;
                void 0 === e && (e = {}), t.prototype.initialize.call(this, e), this.dataResolverListener = new _e({
                    em: this.em,
                    resolver: this.model.dataResolver,
                    onUpdate: function () {
                        return n.postRender()
                    }
                })
            }, e.prototype.remove = function () {
                return this.dataResolverListener.destroy(), t.prototype.remove.call(this)
            }, e.prototype.postRender = function () {
                var e = this.model;
                !!e.getDataResolver().asPlainText ? this.el.textContent = e.getDataValue() : this.el.innerHTML = e.getDataValue(), t.prototype.postRender.call(this)
            }, e
        }(Jr);
        var Qi = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const ta = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Qi(e, t), e.prototype.initialize = function (e) {
                void 0 === e && (e = {}), t.prototype.initialize.call(this, e), this.postRender = this.postRender.bind(this), this.listenTo(this.model.components(), 'reset', this.postRender), this.dataResolverListener = new _e({
                    em: this.em,
                    resolver: this.model.dataResolver,
                    onUpdate: this.postRender
                })
            }, e.prototype.renderDataResolver = function () {
                var t = this.model.getIfTrueContent(), e = this.model.getIfFalseContent(),
                    n = null == t ? void 0 : t.getEl(), o = null == e ? void 0 : e.getEl(), r = this.model.isTrue();
                n && (n.style.display = r ? '' : 'none'), o && (o.style.display = r ? 'none' : '')
            }, e.prototype.postRender = function () {
                this.renderDataResolver(), t.prototype.postRender.call(this)
            }, e.prototype.remove = function () {
                return this.stopListening(this.model.components(), 'reset', this.postRender), this.dataResolverListener.destroy(), t.prototype.remove.call(this)
            }, e
        }(Jr);
        var ea = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), na = void 0 && (void 0).__assign || function () {
            return na = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, na.apply(this, arguments)
        }, oa = function (e) {
            function n(t, n) {
                var o;
                void 0 === n && (n = {});
                var r = e.call(this, t, n) || this;
                return r.mutable = null === (o = t.mutable) || void 0 === o || o, r.on('change', r.handleChange), r
            }

            return ea(n, e), Object.defineProperty(n.prototype, "cl", {
                get: function () {
                    return this.collection
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "dataSource", {
                get: function () {
                    return this.cl.dataSource
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "em", {
                get: function () {
                    return this.dataSource.em
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "index", {
                get: function () {
                    return this.cl.indexOf(this)
                }, enumerable: !1, configurable: !0
            }), n.prototype.handleChange = function (e, n) {
                var o = this, r = this.changedAttributes();
                (0, t.keys)(r).forEach((function (t) {
                    return o.triggerChange(t, n)
                }))
            }, n.prototype.getPath = function (t, e) {
                void 0 === e && (e = {});
                var n = this, o = n.dataSource, r = n.id, i = n.index, a = o.id, s = t ? ".".concat(t) : '';
                return "".concat(a, ".").concat(e.useIndex ? i : r).concat(s)
            }, n.prototype.getPaths = function (t) {
                return [this.getPath(t), this.getPath(t, {useIndex: !0})]
            }, n.prototype.triggerChange = function (t, e) {
                void 0 === e && (e = {});
                var n = this.dataSource, o = this.em, r = this.getPaths(t),
                    i = {dataSource: n, dataRecord: this, path: r[0], options: e};
                o.trigger(yt.path, i), o.trigger("".concat(yt.pathSource, ":").concat(n.id), i), r.forEach((function (t) {
                    return o.trigger("".concat(yt.path, ":").concat(t), na(na({}, i), {path: t}))
                }))
            }, n.prototype.set = function (t, n, o) {
                var r, i, a = this;
                if (!this.isNew() && !1 === this.attributes.mutable) throw new Error('Cannot modify immutable record');
                var s = null === (i = null === (r = this.dataSource) || void 0 === r ? void 0 : r.transformers) || void 0 === i ? void 0 : i.onRecordSetValue,
                    l = function (t, n, o) {
                        void 0 === o && (o = {});
                        var r = (null == o ? void 0 : o.avoidTransformers) || !s ? n : s({id: a.id, key: t, value: n});
                        e.prototype.set.call(a, t, r, o), e.prototype.set.call(a, {__p: !!o.partial || void 0}, o)
                    };
                if ('object' == typeof t && null !== t) for (var c = t, u = 0, p = Object.entries(c); u < p.length; u++) {
                    var d = p[u];
                    l(d[0], d[1], n)
                } else l(t, n, o);
                return this
            }, n
        }(u.Kx);
        const ra = oa;
        var ia = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), aa = function (t) {
            function e(e, n) {
                var o = t.call(this, e, n) || this;
                return o.dataSource = n.dataSource, o
            }

            return ia(e, t), e
        }(u.pM);
        const sa = aa;
        aa.prototype.model = ra;
        var la = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ca = void 0 && (void 0).__assign || function () {
            return ca = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, ca.apply(this, arguments)
        }, ua = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        };
        const pa = function (t) {
            function e(e, n) {
                var o = t.call(this, ca(ca({}, e), {records: []}), n) || this, r = e.records, i = e.transformers;
                return o.transformers = i || {}, r instanceof sa || o.set({records: new sa(r, {dataSource: o})}), o.listenTo(o.records, 'add', o.onAdd), o.listenTo(o.records, u.e2, o.handleChanges), o
            }

            return la(e, t), e.prototype.defaults = function () {
                return {records: [], transformers: {}}
            }, Object.defineProperty(e.prototype, "records", {
                get: function () {
                    return this.attributes.records
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "em", {
                get: function () {
                    return this.collection.em
                }, enumerable: !1, configurable: !0
            }), e.prototype.onAdd = function (t) {
                t.triggerChange()
            }, e.prototype.addRecord = function (t, e) {
                return this.records.add(t, e)
            }, e.prototype.getRecord = function (t) {
                return this.records.get(t)
            }, e.prototype.getRecords = function () {
                var t = this;
                return ua([], this.records.models, !0).map((function (e) {
                    return t.getRecord(e.id)
                }))
            }, e.prototype.removeRecord = function (t, e) {
                var n = this.getRecord(t);
                if (!1 === (null == n ? void 0 : n.mutable) && !(null == e ? void 0 : e.dangerously)) throw new Error('Cannot remove immutable record');
                return this.records.remove(t, e)
            }, e.prototype.setRecords = function (t) {
                var e = this;
                this.records.reset([], {silent: !0}), t.forEach((function (t) {
                    e.records.add(t)
                }))
            }, e.prototype.handleChanges = function (t, e, n) {
                this.em.changesUp(n || e)
            }, e
        }(u.Kx);
        var da = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), fa = void 0 && (void 0).__assign || function () {
            return fa = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, fa.apply(this, arguments)
        }, ha = {avoidStore: !0, partial: !0}, va = function (n) {
            function o(t, e) {
                var o = this;
                if (e.forCloning) return n.call(this, t, e) || this;
                var r = fa(fa({}, t), {droppable: !1}), i = o = n.call(this, r, e) || this;
                return o.rebuildChildrenFromCollection = o.rebuildChildrenFromCollection.bind(o), o.listenToPropsChange(), o.rebuildChildrenFromCollection(), i
            }

            return da(o, n), Object.defineProperty(o.prototype, "defaults", {
                get: function () {
                    return fa(fa({}, n.prototype.defaults), {
                        droppable: !1,
                        dataResolver: {},
                        type: bt,
                        components: [{type: _t}]
                    })
                }, enumerable: !1, configurable: !0
            }), o.prototype.getDataResolver = function () {
                return this.get('dataResolver')
            }, o.prototype.getItemsCount = function () {
                var e, n, o = function (e) {
                        return (0, t.isArray)(e) ? e.length : Object.keys(e).length
                    }(this.getDataSourceItems()),
                    r = Math.max(0, null !== (e = this.getConfigStartIndex()) && void 0 !== e ? e : 0),
                    i = null !== (n = this.getConfigEndIndex()) && void 0 !== n ? n : Number.MAX_VALUE,
                    a = Math.min(o - 1, i) - r + 1;
                return Math.max(0, a)
            }, o.prototype.getConfigStartIndex = function () {
                return this.dataResolver.startIndex
            }, o.prototype.getConfigEndIndex = function () {
                return this.dataResolver.endIndex
            }, o.prototype.getDataSource = function () {
                var t;
                return null === (t = this.dataResolver) || void 0 === t ? void 0 : t.dataSource
            }, o.prototype.getCollectionId = function () {
                var t;
                return null === (t = this.dataResolver) || void 0 === t ? void 0 : t.collectionId
            }, o.prototype.getCollectionItemComponents = function () {
                return this.firstChild.components()
            }, o.prototype.setDataResolver = function (t) {
                return this.set('dataResolver', t)
            }, o.prototype.setCollectionId = function (t) {
                this.updateCollectionConfig({collectionId: t})
            }, o.prototype.setStartIndex = function (t) {
                t < 0 ? this.em.logError('Start index should be greater than or equal to 0') : this.updateCollectionConfig({startIndex: t})
            }, o.prototype.setEndIndex = function (t) {
                this.updateCollectionConfig({endIndex: t})
            }, o.prototype.setDataSource = function (t) {
                this.set(wt, fa(fa({}, this.dataResolver), {dataSource: t}))
            }, o.prototype.setCollectionItemComponents = function (t) {
                this.firstChild.components(t)
            }, Object.defineProperty(o.prototype, "firstChild", {
                get: function () {
                    return this.components().at(0)
                }, enumerable: !1, configurable: !0
            }), o.prototype.updateCollectionConfig = function (t) {
                this.set(wt, fa(fa({}, this.dataResolver), t))
            }, o.prototype.getDataSourceItems = function () {
                var n = function (t, n) {
                    switch (!0) {
                        case(0, e.isObject)(t) && t instanceof pa:
                            return ba(t.get('id'), n);
                        case ce(t):
                            var o = t.path;
                            return o ? 1 === o.split('.').length ? ba(o, n) : n.DataSources.getValue(o, []) : [];
                        default:
                            return []
                    }
                }(this.dataResolver.dataSource, this.em);
                if ((0, t.isArray)(n)) return n;
                var o = fa({}, n);
                return delete o['__p'], o
            }, Object.defineProperty(o.prototype, "dataResolver", {
                get: function () {
                    return this.get(wt) || {}
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(o.prototype, "collectionDataSource", {
                get: function () {
                    return this.dataResolver.dataSource
                }, enumerable: !1, configurable: !0
            }), o.prototype.listenToDataSource = function () {
                var t, e = this.em, n = null === (t = this.collectionDataSource) || void 0 === t ? void 0 : t.path;
                n && (this.dataSourceWatcher = new _e({
                    em: e,
                    resolver: new me({type: ge, path: n}, {em: e, collectionsStateMap: this.collectionsStateMap}),
                    onUpdate: this.rebuildChildrenFromCollection
                }))
            }, o.prototype.rebuildChildrenFromCollection = function () {
                this.components().reset(this.getCollectionItems(), Oe)
            }, o.prototype.getCollectionItems = function () {
                var e, n = this.ensureFirstChild(), o = n.getStyle()['display'], r = !o || 'none' === o ? '' : o;
                n.addStyle({display: 'none'}, ha);
                var i = [n], a = function (t, e) {
                    for (var n = [{
                        property: null == t ? void 0 : t.collectionId,
                        propertyPath: 'dataResolver.collectionId'
                    }, {
                        property: null == t ? void 0 : t.dataSource,
                        propertyPath: 'dataResolver.dataSource'
                    }], o = 0, r = n; o < r.length; o++) {
                        if (!ma(t, r[o].propertyPath, e)) return []
                    }
                    var i = null == t ? void 0 : t.startIndex;
                    void 0 !== i && (i < 0 || !Number.isInteger(i)) && e.logError("Invalid startIndex: ".concat(i, ". It must be a non-negative integer."));
                    return !0
                }(this.dataResolver, this.em);
                if (!a) return i;
                var s = this.collectionId, l = this.getDataSourceItems(), c = this.resolveCollectionConfig(l),
                    u = c.startIndex, p = c.endIndex;
                if (this.hasDuplicateCollectionId()) return this.em.logError("The collection ID \"".concat(s, "\" already exists in the parent collection state. Overriding it is not allowed.")), i;
                for (var d = u; d <= p; d++) {
                    var f = d === u, h = (0, t.isArray)(l) ? d : Object.keys(l)[d],
                        v = this.getCollectionsStateMapForItem(l, h);
                    if (f) null === (e = Zt(n)) || void 0 === e || e.forEach((function (t) {
                        return ne(t)
                    })), ya(n, v), n.addStyle({display: r}, ha); else {
                        var g = n.clone({symbol: !0, symbolInv: !0});
                        g.set({locked: !0, layerable: !1}, ha), ya(g, v), i.push(g)
                    }
                }
                return i
            }, o.prototype.getCollectionsStateMapForItem = function (t, e) {
                var n, o = this.resolveCollectionConfig(t), r = o.startIndex, i = o.endIndex, a = o.totalItems,
                    s = this.collectionId, l = t[e], c = this.collectionsStateMap,
                    u = 'string' == typeof e ? Object.keys(t).indexOf(e) : e, p = {
                        collectionId: s,
                        currentIndex: u,
                        currentItem: l,
                        currentKey: e,
                        startIndex: r,
                        endIndex: i,
                        totalItems: a,
                        remainingItems: a - (1 + (u - r))
                    };
                return fa(fa({}, c), ((n = {})[s] = p, n))
            }, o.prototype.hasDuplicateCollectionId = function () {
                var t = this.collectionId;
                return !!this.collectionsStateMap[t]
            }, o.prototype.resolveCollectionConfig = function (t) {
                var e, n, o = Array.isArray(t), r = o ? t.length : Object.keys(t).length,
                    i = null !== (e = this.getConfigStartIndex()) && void 0 !== e ? e : 0,
                    a = null !== (n = this.getConfigEndIndex()) && void 0 !== n ? n : Number.MAX_VALUE,
                    s = Math.min(r - 1, a), l = 0;
                return r > 0 && (l = Math.max(0, s - i + 1)), {startIndex: i, endIndex: s, totalItems: l, isArray: o}
            }, o.prototype.ensureFirstChild = function () {
                var t = this.em.Components.getType(_t).model;
                return this.firstChild || new t({type: _t}, this.opt)
            }, o.prototype.listenToPropsChange = function () {
                var t = this;
                this.on("change:".concat(wt), (function () {
                    t.rebuildChildrenFromCollection(), t.listenToDataSource()
                })), this.listenToDataSource()
            }, o.prototype.removePropsListeners = function () {
                var t;
                this.off("change:".concat(wt)), null === (t = this.dataSourceWatcher) || void 0 === t || t.destroy()
            }, o.prototype.onCollectionsStateMapUpdate = function (t) {
                var e = this;
                this.collectionsStateMap = t, this.dataResolverWatchers.onCollectionsStateMapUpdate();
                var n = this.getDataSourceItems(), o = this.resolveCollectionConfig(n).startIndex;
                this.components().forEach((function (t, r) {
                    var i = e.getCollectionsStateMapForItem(n, o + r);
                    t.onCollectionsStateMapUpdate(i)
                }))
            }, o.prototype.stopSyncComponentCollectionState = function () {
                this.stopListening(this.components(), 'add remove reset', this.syncOnComponentChange), this.onCollectionsStateMapUpdate({})
            }, o.prototype.syncOnComponentChange = function (t, e, o) {
                var r = this.collectionsStateMap;
                this.collectionsStateMap = {}, n.prototype.syncOnComponentChange.call(this, t, e, o), this.collectionsStateMap = r, this.onCollectionsStateMapUpdate(r)
            }, Object.defineProperty(o.prototype, "collectionId", {
                get: function () {
                    return this.getDataResolver().collectionId
                }, enumerable: !1, configurable: !0
            }), o.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === bt
            }, o.prototype.toJSON = function (t) {
                var e, o = n.prototype.toJSON.call(this, t);
                delete o.droppable, delete o[Tn], null === (e = o.attributes) || void 0 === e || delete e.id;
                var r = this.firstChild;
                return fa(fa({}, o), {components: [r]})
            }, o.prototype.destroy = function (t) {
                return this.removePropsListeners(), n.prototype.destroy.call(this, t)
            }, o
        }(jn);
        const ga = va;

        function ya(t, e) {
            t.setSymbolOverride(['locked', 'layerable']), t.syncComponentsCollectionState(), t.onCollectionsStateMapUpdate(e)
        }

        function ma(t, e, n) {
            return !!t || (n.logError("The \"".concat(e, "\" property is required in the collection definition.")), !1)
        }

        function ba(t, e) {
            var n = e.DataSources.getValue(t, []);
            return Object.keys(n).map((function (e) {
                return {type: ge, path: t + '.' + e}
            }))
        }

        var _a = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const wa = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return _a(e, t), e
        }(Jr);
        var xa = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ca = void 0 && (void 0).__assign || function () {
            return Ca = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Ca.apply(this, arguments)
        }, Sa = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return xa(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Ca(Ca({}, t.prototype.defaults), {
                        droppable: !1,
                        type: Vt,
                        dataResolver: {condition: {left: '', operator: jt.equalsIgnoreCase, right: ''}},
                        components: [{type: zt}, {type: Bt}]
                    })
                }, enumerable: !1, configurable: !0
            }), n.prototype.isTrue = function () {
                return this.dataResolver.isTrue()
            }, n.prototype.getCondition = function () {
                return this.dataResolver.getCondition()
            }, n.prototype.getIfTrueContent = function () {
                return this.components().at(0)
            }, n.prototype.getIfFalseContent = function () {
                return this.components().at(1)
            }, n.prototype.getOutputContent = function () {
                return this.isTrue() ? this.getIfTrueContent() : this.getIfFalseContent()
            }, n.prototype.setCondition = function (t) {
                this.dataResolver.setCondition(t)
            }, n.prototype.setIfTrueComponents = function (t) {
                this.setComponentsAtIndex(0, t)
            }, n.prototype.setIfFalseComponents = function (t) {
                this.setComponentsAtIndex(1, t)
            }, n.prototype.getInnerHTML = function (t) {
                var e, n;
                return null !== (n = null === (e = this.getOutputContent()) || void 0 === e ? void 0 : e.getInnerHTML(t)) && void 0 !== n ? n : ''
            }, n.prototype.createResolverInstance = function (t, e) {
                return new Ut(t, e)
            }, n.prototype.setComponentsAtIndex = function (t, e) {
                var n = this.components().at(t);
                null == n || n.components(e)
            }, n.isComponent = function (t) {
                return (0, e.toLowerCase)(t.tagName) === Vt
            }, n
        }(Gi);
        const Oa = Sa;
        var Ta = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Pa = void 0 && (void 0).__assign || function () {
            return Pa = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Pa.apply(this, arguments)
        }, Ea = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ta(n, t), Object.defineProperty(n.prototype, "defaults", {
                get: function () {
                    return Pa(Pa({}, t.prototype.defaults), {removable: !1, draggable: !1})
                }, enumerable: !1, configurable: !0
            }), n.isComponent = function (t) {
                return function (t) {
                    return !!t && [_t, zt, Bt].includes(t)
                }((0, e.toLowerCase)(t.tagName))
            }, n
        }(jn);
        const ka = Ea;
        var Aa, ja = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ma = void 0 && (void 0).__assign || function () {
            return Ma = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Ma.apply(this, arguments)
        }, Da = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        }, La = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        };
        !function (t) {
            t[t["InvalidSource"] = 0] = "InvalidSource", t[t["SourceReject"] = 1] = "SourceReject", t[t["TargetReject"] = 2] = "TargetReject"
        }(Aa || (Aa = {}));
        var Ia = function (n) {
            function o(t) {
                var e = n.call(this, t, 'DomComponents', new He(void 0, {em: t}), $.I, yo()) || this;
                e.componentTypes = [{id: _t, model: ka, view: Jr}, {id: zt, model: ka, view: Jr}, {
                    id: Bt,
                    model: ka,
                    view: Jr
                }, {id: bt, model: ga, view: wa}, {id: Vt, model: Oa, view: ta}, {
                    id: ge,
                    model: Xi,
                    view: Zi
                }, {id: 'cell', model: mr, view: Pi}, {id: 'row', model: Ar, view: Di}, {
                    id: 'table',
                    model: pr,
                    view: Ii
                }, {id: 'thead', model: Tr, view: ji}, {id: 'tbody', model: vr, view: Oi}, {
                    id: 'tfoot',
                    model: xr,
                    view: ki
                }, {id: 'map', model: Xo, view: mi}, {id: 'link', model: qo, view: hi}, {
                    id: 'label',
                    model: Uo,
                    view: gi
                }, {id: 'video', model: Hr, view: Vi}, {id: 'image', model: Lo, view: ai}, {
                    id: 'script',
                    model: tr,
                    view: _i
                }, {id: 'svg-in', model: sr, view: Ci}, {id: 'svg', model: rr, view: Ci}, {
                    id: 'iframe',
                    model: ko,
                    view: oi
                }, {id: 'comment', model: Oo, view: ei}, {id: 'textnode', model: wo, view: Qr}, {
                    id: Ln,
                    model: Rn,
                    view: Jr
                }, {id: 'wrapper', model: Wr, view: Hi}, {id: 'text', model: Ro, view: di}, {
                    id: 'default',
                    model: jn,
                    view: Jr
                }], e.componentsById = {}, e.Component = jn, e.Components = He, e.ComponentView = Jr, e.ComponentsView = Gr, e.storageKey = 'components', e.keySymbols = 'symbols', e.events = $.I;
                var o = e.config;
                e.symbols = new Wi([], {
                    em: t,
                    config: o,
                    domc: e
                }), t && (e.config.components = t.config.components || e.config.components);
                var r = e.config.pStylePrefix;
                if (r && (e.config.stylePrefix = r + e.config.stylePrefix), t) {
                    t.get('Parser').compTypes = e.componentTypes, t.on('change:componentHovered', e.componentHovered, e);
                    var i = t.get('selected');
                    t.listenTo(i, 'add', (function (t, n, o) {
                        return e.selectAdd(i.getComponent(t), o)
                    })), t.listenTo(i, 'remove', (function (t, n, o) {
                        return e.selectRemove(i.getComponent(t), o)
                    }))
                }
                return e
            }

            return ja(o, n), o.prototype.postLoad = function () {
                var t = this.em, e = this.symbols;
                t.UndoManager.add(e)
            }, o.prototype.load = function (e) {
                var n = this, o = this.loadProjectData(e, {
                    onResult: function (e) {
                        var o = n.getWrapper();
                        if (o || (n.em.Pages.add({}, {select: !0}), o = n.getWrapper()), (0, t.isArray)(e)) e.length && o.components(e); else {
                            var r = e.components, i = void 0 === r ? [] : r, a = Da(e, ["components"]);
                            o.set(a), o.components(i)
                        }
                    }
                });
                return this.symbols.reset(e[this.keySymbols] || []), o
            }, o.prototype.store = function () {
                var t;
                return (t = {})[this.keySymbols] = this.symbols, t
            }, o.prototype.getComponent = function () {
                var t = this.em.Pages.getSelected(), e = null == t ? void 0 : t.getMainFrame();
                return null == e ? void 0 : e.getComponent()
            }, o.prototype.getWrapper = function () {
                return this.getComponent()
            }, o.prototype.getComponents = function () {
                var t = this.getWrapper();
                return null == t ? void 0 : t.components()
            }, o.prototype.addComponent = function (t, e) {
                return void 0 === e && (e = {}), this.getComponents().add(t, e)
            }, o.prototype.render = function () {
                var t;
                return null === (t = this.componentView) || void 0 === t ? void 0 : t.render().el
            }, o.prototype.clear = function (t) {
                void 0 === t && (t = {});
                var e = this.getComponents();
                return null == e || e.filter(Boolean).forEach((function (e) {
                    return e.remove(t)
                })), this
            }, o.prototype.setComponents = function (t, e) {
                void 0 === e && (e = {}), this.clear(e).addComponent(t, e)
            }, o.prototype.addType = function (e, n) {
                var o = this.em, r = n.model, i = void 0 === r ? {} : r, a = n.view, s = void 0 === a ? {} : a,
                    l = n.isComponent, c = n.extend, u = n.extendView, p = n.extendFn, d = void 0 === p ? [] : p,
                    f = n.extendFnView, h = void 0 === f ? [] : f, v = n.block, g = this.getType(e),
                    y = this.getType(c), m = this.getType(u), b = y || (g || this.getType('default')), _ = b.model,
                    w = m ? m.view : b.view, x = function (t, e, n) {
                        return t.reduce((function (t, o) {
                            var r = e[o], i = n.prototype[o];
                            return r && i && (t[o] = function () {
                                for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                                i.bind(this).apply(void 0, t), r.bind(this).apply(void 0, t)
                            }), t
                        }), {})
                    };
                if ('object' == typeof i) {
                    var C = {defaults: i.defaults};
                    delete i.defaults;
                    var S = new Set(_.typeExtends);
                    S.add(_.getDefaults().type), n.model = _.extend(Ma(Ma({}, i), x(d, i, _)), {
                        typeExtends: S,
                        isComponent: !g || y || l ? l || function () {
                            return 0
                        } : _.isComponent
                    }), Object.defineProperty(n.model.prototype, 'defaults', {
                        get: function () {
                            return Ma(Ma({}, (0, t.result)(_.prototype, 'defaults') || {}), (0, t.result)(C, 'defaults') || {})
                        }
                    })
                }
                if ('object' == typeof s && (n.view = w.extend(Ma(Ma({}, s), x(h, s, w)))), g ? (g.model = n.model, g.view = n.view) : (n.id = e, this.componentTypes.unshift(n)), v) {
                    var O = {id: e, label: e, content: {type: e}}, T = !0 === v ? O : Ma(Ma({}, O), v);
                    o.Blocks.add(T.id || e, T)
                }
                var P = "component:type:".concat(g ? 'update' : 'add');
                return null == o || o.trigger(P, g || n), this
            }, o.prototype.getType = function (t) {
                for (var e = this.componentTypes, n = 0; n < e.length; n++) {
                    if (e[n].id == t) return e[n]
                }
            }, o.prototype.removeType = function (t) {
                var e = this.componentTypes, n = this.getType(t);
                if (n) {
                    var o = e.indexOf(n);
                    return e.splice(o, 1), n
                }
            }, o.prototype.getTypes = function () {
                return this.componentTypes
            }, o.prototype.selectAdd = function (t, e) {
                var n = this;
                void 0 === e && (e = {}), t && (t.set({status: 'selected'}), ['component:selected', 'component:toggled'].forEach((function (o) {
                    return n.em.trigger(o, t, e)
                })))
            }, o.prototype.selectRemove = function (t, e) {
                var n = this;
                if (void 0 === e && (e = {}), t) {
                    this.em;
                    t.set({
                        status: '',
                        state: ''
                    }), ['component:deselected', 'component:toggled'].forEach((function (o) {
                        return n.em.trigger(o, t, e)
                    }))
                }
            }, o.prototype.componentHovered = function () {
                var e = this.em, n = e.get('componentHovered'), o = e.previous('componentHovered'), r = 'hovered';
                o && o.get('status') == r && o.set({
                    status: '',
                    state: ''
                }), n && (0, t.isEmpty)(n.get('status')) && n.set('status', r)
            }, o.prototype.getShallowWrapper = function () {
                var e = this.shallow, n = this.em;
                if (!e && n) {
                    var o = n.shallow;
                    if (!o) return;
                    var r = o.Components;
                    if (r.componentTypes = this.componentTypes, e = r.getWrapper()) {
                        var i = [En, kn].join(' ');
                        e.on(i, (0, t.debounce)((function () {
                            return null == e ? void 0 : e.components('')
                        }), 100))
                    }
                    this.shallow = e
                }
                return e
            }, o.prototype.isComponent = function (t) {
                return (0, e.isComponent)(t)
            }, o.prototype.addSymbol = function (e) {
                if (!(0, t.isSymbol)(e) || Yt(e)) {
                    var n = e.clone({symbol: !0});
                    return qt(n) && this.symbols.add(n), this.em.trigger('component:toggled'), n
                }
            }, o.prototype.getSymbols = function () {
                return La([], this.symbols.models, !0)
            }, o.prototype.detachSymbol = function (t) {
                Gt(t) && ne(t)
            }, o.prototype.getSymbolInfo = function (t, e) {
                void 0 === e && (e = {});
                var n = qt(t), o = Jt(t), r = !!o, i = Zt(n ? t : o) || [], a = o || (n ? t : void 0),
                    s = te(t, {changed: e.withChanges}), l = n || r;
                return {
                    isSymbol: l,
                    isMain: n,
                    isInstance: r,
                    isRoot: l && Yt(t),
                    main: a,
                    instances: i,
                    relatives: s || []
                }
            }, o.prototype.canMove = function (n, o, r) {
                var i = {result: !1, reason: Aa.InvalidSource, target: n, source: null};
                if (!o || !n) return i;
                if (Kt(n) && o instanceof jn && Kt(o)) {
                    var a = ee(n), s = qt(a) ? a : Jt(a), l = ee(o);
                    if (s === (qt(l) ? l : Jt(l)) && a !== l) return Ma(Ma({}, i), {reason: Aa.TargetReject})
                }
                var c = (0, e.isComponent)(o) ? o : null;
                if (!c) {
                    var u = this.getShallowWrapper();
                    c = (null == u ? void 0 : u.append(o, {temporary: !0})[0]) || null
                }
                if (i.source = c, !c) return i;
                var p = c.get('draggable');
                if ((0, t.isFunction)(p)) p = !!p(c, n, r); else {
                    var d = n.getEl();
                    p = (0, t.isArray)(p) ? p.join(',') : p, p = (0, t.isString)(p) ? null == d ? void 0 : d.matches(p) : p
                }
                if (!p) return Ma(Ma({}, i), {reason: Aa.SourceReject});
                var f = n.get('droppable');
                if ((0, t.isFunction)(f)) f = !!f(c, n, r); else if (!1 === f && n.isInstanceOf('text') && c.get('textable')) f = !0; else {
                    d = c.getEl();
                    f = (0, t.isArray)(f) ? f.join(',') : f, f = (0, t.isString)(f) ? null == d ? void 0 : d.matches(f) : f
                }
                var h = [n].concat(n.parents()).indexOf(c) > -1;
                return Ma(Ma({}, i), !f || h ? {reason: Aa.TargetReject} : {result: !0})
            }, o.prototype.allById = function () {
                return this.componentsById
            }, o.prototype.getById = function (t) {
                return this.componentsById[t] || null
            }, o.prototype.destroy = function () {
                var t, e = this.allById();
                Object.keys(e).forEach((function (t) {
                    return e[t] && e[t].remove()
                })), null === (t = this.componentView) || void 0 === t || t.remove(), [this.em, this.componentsById, this.componentView].forEach((function (t) {
                    return {}
                }))
            }, o
        }(b);
        const Na = Ia;
        const Ra = function () {
            return {stylePrefix: 'css-', rules: []}
        };
        var Va = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Fa = Number.MAX_VALUE, Ha = function (n) {
            function o() {
                var e = n.call(this) || this;
                return (0, t.bindAll)(e, 'sortRules'), e.compCls = [], e.ids = [], e
            }

            return Va(o, n), o.prototype.buildFromModel = function (t, e) {
                var n = this;
                void 0 === e && (e = {});
                var o = '', r = this.em, i = r && r.getConfig().avoidInlineStyle, a = t.styleToString(), s = t.classes;
                return this.ids.push("#".concat(t.getId())), s.forEach((function (t) {
                    return n.compCls.push(t.getFullName())
                })), !i && a && (o = "#".concat(t.getId(), "{").concat(a, "}")), t.components().forEach((function (t) {
                    return o += n.buildFromModel(t, e)
                })), o
            }, o.prototype.build = function (n, o) {
                var r = this;
                void 0 === o && (o = {});
                var i = o.json, a = o.em, s = o.cssc || (null == a ? void 0 : a.Css);
                this.em = a, this.compCls = [], this.ids = [], this.model = n;
                var l = [], c = n ? this.buildFromModel(n, o) : '',
                    u = (0, t.isUndefined)(o.clearStyles) && a ? a.getConfig().clearStyles : o.clearStyles;
                if (s) {
                    var p = o.rules || s.getAll(), d = {}, f = [];
                    o.onlyMatched && n && (0, e.hasWin)() && (p = this.matchedRules(n, p)), p.forEach((function (t) {
                        var e = t.getAtRule();
                        if (e) {
                            var n = d[e];
                            n ? n.push(t) : d[e] = [t]
                        } else {
                            var a = r.buildFromRule(t, f, o);
                            i ? l.push(a) : c += a
                        }
                    })), this.sortMediaObject(d).forEach((function (t) {
                        var e = '', n = t.key;
                        t.value.forEach((function (t) {
                            var a = r.buildFromRule(t, f, o);
                            t.get('singleAtRule') ? c += "".concat(n, "{").concat(a, "}") : e += a, i && l.push(a)
                        })), e && (c += "".concat(n, "{").concat(e, "}"))
                    })), a && u && p.remove && p.remove(f)
                }
                return i ? l.filter((function (t) {
                    return t
                })) : c
            }, o.prototype.buildFromRule = function (t, e, n) {
                var o, r = this;
                void 0 === n && (n = {});
                var i, a = '', s = this.model, l = t.selectorsToString({skipAdd: 1}), c = t.get('selectorsAdd'),
                    u = t.get('singleAtRule');
                if (null === (o = t.get('selectors')) || void 0 === o || o.forEach((function (t) {
                    var e = t.getFullName();
                    (r.compCls.indexOf(e) >= 0 || r.ids.indexOf(e) >= 0 || n.keepUnusedStyles) && (i = 1)
                })), l && i || c || u || !s) {
                    var p = t.getDeclaration();
                    p && (n.json ? a = t : a += p)
                } else e.push(t);
                return a
            }, o.prototype.matchedRules = function (t, e) {
                var n = this, o = t.getEl(), r = [];
                return e.forEach((function (t) {
                    try {
                        t.selectorsToString().split(',').some((function (t) {
                            return null == o ? void 0 : o.matches(n.__cleanSelector(t))
                        })) && r.push(t)
                    } catch (t) {
                    }
                })), t.components().forEach((function (t) {
                    r = r.concat(n.matchedRules(t, e))
                })), r = r.filter((function (t, e) {
                    return r.indexOf(t) === e
                }))
            }, o.prototype.getQueryLength = function (t) {
                var e = /(-?\d*\.?\d+)\w{0,}/.exec(t);
                return e ? parseFloat(e[1]) : Fa
            }, o.prototype.sortMediaObject = function (e) {
                var n = this;
                void 0 === e && (e = {});
                var o = [];
                return (0, t.each)(e, (function (t, e) {
                    return o.push({key: e, value: t})
                })), o.sort((function (t, e) {
                    var o = [t.key, e.key].every((function (t) {
                        return -1 !== t.indexOf('min-width')
                    })), r = o ? t.key : e.key, i = o ? e.key : t.key;
                    return n.getQueryLength(r) - n.getQueryLength(i)
                }))
            }, o.prototype.sortRules = function (t, e) {
                var n = function (t) {
                    return t.get('mediaText') || ''
                }, o = [n(t), n(e)].every((function (t) {
                    return -1 !== t.indexOf('min-width')
                })), r = n(o ? t : e), i = n(o ? e : t);
                return this.getQueryLength(r) - this.getQueryLength(i)
            }, o.prototype.__cleanSelector = function (t) {
                return t.split(' ').map((function (t) {
                    return t.split(':')[0]
                })).join(' ')
            }, o
        }(u.Kx);
        const Ua = Ha;
        var za = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ba = void 0 && (void 0).__assign || function () {
            return Ba = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Ba.apply(this, arguments)
        }, Wa = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, $a = ((0, e.hasWin)() ? window : {}).CSS, qa = function (n) {
            function o(t, e) {
                void 0 === e && (e = {});
                var o = n.call(this, t, {em: e.em}) || this;
                return o.views = [], o.config = t || {}, o.opt = e, o.em = e.em, o.ensureSelectors(null, null, {}), o.on('change', o.__onChange), o.setStyle(o.get('style')), o
            }

            return za(o, n), o.prototype.defaults = function () {
                return {
                    selectors: [],
                    selectorsAdd: '',
                    style: {},
                    mediaText: '',
                    state: '',
                    stylable: !0,
                    atRuleType: '',
                    singleAtRule: !1,
                    important: !1,
                    group: '',
                    shallow: !1,
                    _undo: !0
                }
            }, o.prototype.__onChange = function (t, n) {
                var o = this.em, r = this.changedAttributes();
                r && !(0, e.isEmptyObj)(r) && (null == o || o.changesUp(n))
            }, o.prototype.clone = function () {
                var t = Ba({}, this.opt), e = Ba({}, this.attributes);
                return e.selectors = this.get('selectors').map((function (t) {
                    return t.clone()
                })), new this.constructor(e, t)
            }, o.prototype.ensureSelectors = function (e, n, o) {
                var r = this.em, i = null == r ? void 0 : r.Selectors,
                    a = [this, 'change:selectors', this.ensureSelectors], s = this.getSelectors();
                if (this.stopListening.apply(this, a), s.models && (s = Wa([], s.models, !0)), s = (0, t.isString)(s) ? [s] : s, Array.isArray(s)) {
                    var l = s.filter((function (t) {
                        return t
                    })).map((function (t) {
                        return i ? i.add(t) : t
                    }));
                    s = new Ye(l)
                }
                this.set('selectors', s, o), this.listenTo.apply(this, a)
            }, o.prototype.getAtRule = function () {
                var t = this.get('atRuleType'), e = this.get('mediaText'), n = t ? "@".concat(t) : e ? '@media' : '';
                return n + (e && n ? " ".concat(e) : '')
            }, o.prototype.selectorsToString = function (t) {
                void 0 === t && (t = {});
                var e = [], n = this.get('state'), o = this.get('selectorsAdd'), r = {
                    escape: function (t) {
                        return $a && $a.escape ? $a.escape(t) : t
                    }
                }, i = this.getSelectors().getFullString(0, r), a = n && !t.skipState ? ":".concat(n) : '';
                return i && e.push("".concat(i).concat(a)), o && !t.skipAdd && e.push(o), e.join(', ')
            }, o.prototype.getDeclaration = function (t) {
                void 0 === t && (t = {});
                var e = '', n = this.attributes.important, o = this.selectorsToString(t),
                    r = this.styleToString(Ba({important: n}, t)), i = this.get('singleAtRule');
                return (o || i) && (r || t.allowEmpty) && (e = i ? r : "".concat(o, "{").concat(r, "}")), e
            }, o.prototype.getDevice = function () {
                var t = this.em, e = this.attributes, n = e.atRuleType, o = e.mediaText,
                    r = (null == t ? void 0 : t.Devices.getDevices()) || [], i = r.filter((function (t) {
                        return '' === t.getWidthMedia()
                    }))[0];
                return 'media' === n && o ? r.filter((function (t) {
                    return t.getWidthMedia() === ((e = /(-?\d*\.?\d+)\w{0,}/.exec(o)) ? e[0] : '');
                    var e
                }))[0] || null : i || null
            }, o.prototype.getState = function () {
                var t = this.em, e = this.get('state');
                return ((null == t ? void 0 : t.Selectors.getStates()) || []).filter((function (t) {
                    return t.getName() === e
                }))[0] || null
            }, o.prototype.getComponent = function () {
                var t, e = this.getSelectors(), n = 1 == e.length && e.at(0), o = n && n.isId() && n.get('name');
                return o && (null === (t = this.em) || void 0 === t ? void 0 : t.Components.getById(o)) || null
            }, o.prototype.toCSS = function (t) {
                void 0 === t && (t = {});
                var e = '', n = this.getAtRule(), o = this.getDeclaration(t);
                return (o || t.allowEmpty) && (e = o), n && e && (e = "".concat(n, "{").concat(e, "}")), e
            }, o.prototype.toJSON = function () {
                for (var e, n = [], o = 0; o < arguments.length; o++) n[o] = arguments[o];
                var r = u.Kx.prototype.toJSON.apply(this, n);
                if (null === (e = this.em) || void 0 === e ? void 0 : e.getConfig().avoidDefaults) {
                    var i = this.defaults();
                    (0, t.forEach)(i, (function (t, e) {
                        r[e] === t && delete r[e]
                    })), delete r.style.__p, (0, t.isEmpty)(r.selectors) && delete r.selectors, (0, t.isEmpty)(r.style) && delete r.style
                }
                return Ba(Ba({}, r), {style: this.dataResolverWatchers.getStylesDefsOrValues(r.style)})
            }, o.prototype.compare = function (e, n, o, r) {
                var i;
                void 0 === r && (r = {});
                var a = n || '', s = o || '', l = r.selectorsAdd || '', c = r.atRuleType || '';
                s && !c && (c = 'media');
                var u = ((0, t.isArray)(e) || e.models ? e.models || e : [e]).map((function (t) {
                    return t.getFullName()
                })), p = null === (i = this.get('selectors')) || void 0 === i ? void 0 : i.map((function (t) {
                    return t.getFullName()
                })), d = u.slice().sort(), f = p.slice().sort();
                return !(u.length !== p.length || !d.every((function (t, e) {
                    return t === f[e]
                }))) && (this.get('state') === a && this.get('mediaText') === s && this.get('selectorsAdd') === l && this.get('atRuleType') === c)
            }, o
        }(Me);
        const Ga = qa;
        var Ka = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ya = function (t) {
            function e(e, n) {
                var o = t.call(this, e) || this;
                return o.editor = null == n ? void 0 : n.em, setTimeout((function () {
                    o.on('remove', o.onRemove), o.on('add', o.onAdd)
                })), o
            }

            return Ka(e, t), e.prototype.toJSON = function (t) {
                return u.pM.prototype.toJSON.call(this, t).filter((function (t) {
                    return t.style && !t.shallow
                }))
            }, e.prototype.onAdd = function (t, e, n) {
                t.ensureSelectors(t, e, n)
            }, e.prototype.onRemove = function (t) {
                var e = this.editor;
                e.stopListening(t), e.UndoManager.remove(t)
            }, e.prototype.add = function (t, e) {
                return void 0 === e && (e = {}), 'string' == typeof t && (t = this.editor.get('Parser').parseCss(t)), e.em = this.editor, u.pM.prototype.add.apply(this, [t, e])
            }, e
        }(u.pM);
        const Xa = Ya;
        Ya.prototype.model = Ga;
        var Ja = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Za = void 0 && (void 0).__assign || function () {
            return Za = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Za.apply(this, arguments)
        }, Qa = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, ts = function (n) {
            function o(t) {
                var e = n.call(this, t, 'CssComposer', null, et, Ra()) || this;
                e.classes = {
                    CssRule: Ga,
                    CssRules: Xa,
                    CssRuleView: rt,
                    CssRulesView: ut
                }, e.events = et, e.Selectors = Ye, e.storageKey = 'styles';
                var o = e.config, r = o.pStylePrefix;
                return r && (o.stylePrefix = r + o.stylePrefix), o.rules = e.em.config.style || o.rules || '', e.rules = new Xa([], o), e
            }

            return Ja(o, n), o.prototype.onLoad = function () {
                this.rules.add(this.config.rules, {silent: !0})
            }, o.prototype.postLoad = function () {
                this.em.UndoManager.add(this.getAll())
            }, o.prototype.store = function () {
                return this.getProjectData()
            }, o.prototype.load = function (t) {
                return this.loadProjectData(t, {all: this.rules})
            }, o.prototype.add = function (t, e, n, o, r) {
                void 0 === o && (o = {}), void 0 === r && (r = {});
                var i = e || '', a = n || '', s = Za({}, o), l = this.get(t, i, a, s);
                return l && l.config && !l.config.singleAtRule || (s.state = i, s.mediaText = a, s.selectors = [], a && !s.atRuleType && (s.atRuleType = 'media'), (l = new Ga(s, this.config)).get('selectors').add(t, r), this.rules.add(l, r)), l
            }, o.prototype.get = function (e, n, o, r) {
                var i = e;
                if ((0, t.isString)(e)) {
                    var a = this.em.Selectors, s = e.split(',')[0].trim(),
                        l = this.em.Parser.parserCss.checkNode({selectors: s})[0];
                    i = a.get(l.selectors)
                }
                return this.rules.find((function (t) {
                    return t.compare(i, n, o, r)
                })) || null
            }, o.prototype.getAll = function () {
                return this.rules
            }, o.prototype.addCollection = function (n, o, r) {
                void 0 === o && (o = {}), void 0 === r && (r = {});
                var i = this.em, a = [];
                (0, t.isString)(n) && (n = i.Parser.parseCss(n));
                for (var s = n instanceof Array ? n : [n], l = 0, c = s.length; l < c; l++) {
                    var u = s[l] || {};
                    if (u.selectors) {
                        var p = null == i ? void 0 : i.Selectors;
                        p || console.warn('Selector Manager not found');
                        for (var d = u.selectors, f = d instanceof Array ? d : [d], h = [], v = 0, g = f.length; v < g; v++) {
                            var y = p.add(f[v]);
                            h.push(y)
                        }
                        var m = this.get(h, u.state, u.mediaText, u), b = this.add(h, u.state, u.mediaText, u, o),
                            _ = !m || !o.avoidUpdateStyle, w = u.style || {};
                        if ((0, e.isObject)(r) && b.set(r, o), _) {
                            var x = o.extend ? Za(Za({}, b.getStyle('', {skipResolve: !0})), w) : w;
                            b.setStyle(x, o)
                        }
                        a.push(b)
                    }
                }
                return a
            }, o.prototype.addRules = function (t) {
                return this.addCollection(t)
            }, o.prototype.setRule = function (t, e, n) {
                void 0 === e && (e = {}), void 0 === n && (n = {});
                var o = n.atRuleType, r = n.atRuleParams,
                    i = this.em.Parser.parserCss.checkNode({selectors: t, style: e})[0], a = i.state,
                    s = i.selectorsAdd, l = this.em.Selectors.add(i.selectors),
                    c = this.add(l, a, r, {selectorsAdd: s, atRule: o});
                return n.addStyles ? c.addStyle(e, n) : c.setStyle(e, n), c
            }, o.prototype.getRule = function (t, e) {
                void 0 === e && (e = {});
                var n = this.em, o = n.Selectors, r = n.Parser.parserCss.checkNode({selectors: t})[0],
                    i = o.get(r.selectors), a = r.state, s = r.selectorsAdd, l = e.atRuleType, c = e.atRuleParams;
                return i ? this.get(i, a, c, {selectorsAdd: s, atRuleType: l}) : void 0
            }, o.prototype.getRules = function (e) {
                var n = this.getAll();
                if (!e) return Qa([], n.models, !0);
                var o = {sort: !0}, r = (0, t.isString)(e) ? e.split(',').map((function (t) {
                    return t.trim()
                })) : e;
                return n.filter((function (t) {
                    return r.indexOf(t.getSelectors().getFullString(null, o)) >= 0
                }))
            }, o.prototype.setIdRule = function (e, n, o) {
                void 0 === n && (n = {}), void 0 === o && (o = {});
                var r = o.addOpts, i = void 0 === r ? {} : r, a = o.mediaText, s = o.state || '',
                    l = (0, t.isUndefined)(a) ? this.em.getCurrentMedia() : a,
                    c = this.em.Selectors.add({name: e, type: $e.TYPE_ID}, i), u = this.add(c, s, l, {}, i);
                return u.setStyle(n, Za(Za({}, o), i)), u
            }, o.prototype.getIdRule = function (e, n) {
                void 0 === n && (n = {});
                var o = n.mediaText, r = n.state || '', i = (0, t.isUndefined)(o) ? this.em.getCurrentMedia() : o,
                    a = this.em.Selectors.get(e, $e.TYPE_ID);
                return a && this.get(a, r, i)
            }, o.prototype.setClassRule = function (t, e, n) {
                void 0 === e && (e = {}), void 0 === n && (n = {});
                var o = n.state || '', r = n.mediaText || this.em.getCurrentMedia(),
                    i = this.em.Selectors.add({name: t, type: $e.TYPE_CLASS}), a = this.add(i, o, r);
                return a.setStyle(e, n), a
            }, o.prototype.getClassRule = function (t, e) {
                void 0 === e && (e = {});
                var n = e.state || '', o = e.mediaText || this.em.getCurrentMedia(),
                    r = this.em.Selectors.get(t, $e.TYPE_CLASS);
                return r && this.get(r, n, o)
            }, o.prototype.remove = function (e, n) {
                var o = (0, t.isString)(e) ? this.getRules(e) : e, r = this.getAll().remove(o, n);
                return (0, t.isArray)(r) ? r : [r]
            }, o.prototype.clear = function (t) {
                return void 0 === t && (t = {}), this.getAll().reset([], t), this
            }, o.prototype.getComponentRules = function (e, n) {
                void 0 === n && (n = {});
                var o = n.state, r = n.mediaText;
                n.current && (o = this.em.get('state') || '', r = this.em.getCurrentMedia());
                var i = e.getId();
                return this.getAll().filter((function (e) {
                    return !(!(0, t.isUndefined)(o) && e.get('state') !== o) && (!(!(0, t.isUndefined)(r) && e.get('mediaText') !== r) && e.getSelectorsString() === "#".concat(i))
                }))
            }, o.prototype.render = function () {
                var t;
                return null === (t = this.rulesView) || void 0 === t || t.remove(), this.rulesView = new ut({
                    collection: this.rules,
                    config: this.config
                }), this.rulesView.render().el
            }, o.prototype.checkId = function (e, n) {
                void 0 === n && (n = {});
                var o = n.idMap, r = void 0 === o ? {} : o, i = [];
                return Object.keys(r).length ? ((Array.isArray(e) ? e : [e]).forEach((function (e) {
                    var n = e.selectors;
                    if (n && 1 == n.length) {
                        var o = n[0];
                        if ((0, t.isString)(o)) {
                            if ('#' === o[0]) {
                                var a = o.substring(1), s = r[a];
                                a && s && (n[0] = "#".concat(s), i.push(e))
                            }
                        } else if (o.name && o.type === $e.TYPE_ID) {
                            (s = r[o.name]) && (o.name = s, i.push(e))
                        }
                    }
                })), i) : i
            }, o.prototype.destroy = function () {
                var t;
                this.rules.reset(), this.rules.stopListening(), null === (t = this.rulesView) || void 0 === t || t.remove()
            }, o
        }(b);
        const es = ts;
        const ns = function () {
            return {appendTo: '', blocks: [], appendOnClick: !1, custom: !1}
        };
        var os = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const rs = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return os(n, e), n.prototype.defaults = function () {
                return {
                    label: '',
                    content: '',
                    media: '',
                    category: '',
                    activate: !1,
                    select: void 0,
                    resetId: !1,
                    disable: !1,
                    onClick: void 0,
                    attributes: {},
                    dragDef: {}
                }
            }, Object.defineProperty(n.prototype, "category", {
                get: function () {
                    var t = this.get('category');
                    return t instanceof Ze ? t : void 0
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "parent", {
                get: function () {
                    return this.collection
                }, enumerable: !1, configurable: !0
            }), n.prototype.getId = function () {
                return this.id
            }, n.prototype.getLabel = function () {
                return this.get('label')
            }, n.prototype.getMedia = function () {
                return this.get('media')
            }, n.prototype.getContent = function () {
                return this.get('content')
            }, n.prototype.getDragDef = function () {
                return this.get('dragDef')
            }, n.prototype.getCategoryLabel = function () {
                var e = this.get('category');
                return (0, t.isFunction)(null == e ? void 0 : e.get) ? e.get('label') : (null == e ? void 0 : e.label) ? null == e ? void 0 : e.label : e
            }, n
        }(u.Kx);
        var is = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), as = function (t) {
            function e(e, n) {
                var o = t.call(this, e) || this;
                return o.em = n.em, o.on('add', o.handleAdd), o
            }

            return is(e, t), e.prototype.getCategories = function () {
                return this.em.Blocks.getCategories()
            }, e.prototype.handleAdd = function (t) {
                this.initCategory(t)
            }, e
        }(nn);
        const ss = as;
        var ls;
        as.prototype.model = rs, function (t) {
            t["add"] = "block:add", t["remove"] = "block:remove", t["removeBefore"] = "block:remove:before", t["update"] = "block:update", t["dragStart"] = "block:drag:start", t["drag"] = "block:drag", t["dragEnd"] = "block:drag:stop", t["categoryUpdate"] = "block:category:update", t["custom"] = "block:custom", t["all"] = "block"
        }(ls || (ls = {}));
        var cs = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), us = void 0 && (void 0).__assign || function () {
            return us = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, us.apply(this, arguments)
        }, ps = function (n) {
            function o(t, e) {
                void 0 === e && (e = {});
                var o = n.call(this, t) || this, r = o.model;
                return o.em = e.em, o.config = e, o.endDrag = o.endDrag.bind(o), o.ppfx = e.pStylePrefix || '', o.listenTo(r, 'destroy remove', o.remove), o.listenTo(r, 'change', o.render), o
            }

            return cs(o, n), o.prototype.events = function () {
                return {
                    click: 'handleClick',
                    mousedown: 'startDrag',
                    dragstart: 'handleDragStart',
                    drag: 'handleDrag',
                    dragend: 'handleDragEnd'
                }
            }, o.prototype.__getModule = function () {
                return this.em.Blocks
            }, o.prototype.handleClick = function (e) {
                var n, o, r = this, i = r.config, a = r.model, s = r.em, l = a.get('onClick') || i.appendOnClick;
                if (s.trigger('block:click', a, e), l) {
                    if ((0, t.isFunction)(l)) return l(a, null == s ? void 0 : s.getEditor(), {event: e});
                    var c = null === (n = i.getSorter) || void 0 === n ? void 0 : n.call(i);
                    if (c) {
                        var u, p, d = a.get('content'),
                            f = null === (o = this.getTempDropModel(d).view) || void 0 === o ? void 0 : o.el,
                            h = f ? [{element: f, dragSource: {content: d}}] : [], v = s.getSelected(), g = 0;
                        if (v) if (c.validTarget(v.getEl(), h, g)) u = v; else {
                            var y = v.parent();
                            y && c.validTarget(y.getEl(), h, g) && (u = y, p = y.components().indexOf(v) + 1)
                        }
                        if (!u) {
                            var m = s.getWrapper();
                            c.validTarget(m.getEl(), h, g) && (u = m)
                        }
                        var b = u && u.append(d, {at: p})[0];
                        b && s.setSelected(b, {scroll: !0})
                    }
                }
            }, o.prototype.startDrag = function (t) {
                var e, n = this, o = n.config, r = n.em, i = n.model, a = i.get('disable');
                if (0 === t.button && o.getSorter && !this.el.draggable && !a) {
                    r.refreshCanvas();
                    var s = o.getSorter();
                    s.__currentBlock = i;
                    var l = this.model.get('content'),
                        c = null === (e = this.getTempDropModel(l).view) || void 0 === e ? void 0 : e.el,
                        u = c ? [{element: c, dragSource: {content: l}}] : [];
                    s.startSort(u), (0, Z.on)(document, 'mouseup', this.endDrag)
                }
            }, o.prototype.handleDragStart = function (t) {
                this.__getModule().__startDrag(this.model, t)
            }, o.prototype.handleDrag = function (t) {
                this.__getModule().__drag(t)
            }, o.prototype.handleDragEnd = function () {
                this.__getModule().__endDrag()
            }, o.prototype.endDrag = function () {
                var t, e;
                (0, Z.AU)(document, 'mouseup', this.endDrag);
                var n = null === (e = (t = this.config).getSorter) || void 0 === e ? void 0 : e.call(t);
                n && n.endDrag()
            }, o.prototype.getTempDropModel = function (t) {
                var e, n = this.em.Components.getComponents(),
                    o = {avoidChildren: 1, avoidStore: 1, avoidUpdateStyle: 1},
                    r = n.add(t, us(us({}, o), {temporary: !0})), i = n.remove(r, us(us({}, o), {temporary: !0}));
                return null === (e = (i = i instanceof Array ? i[0] : i).view) || void 0 === e || e.$el.data('model', i), i
            }, o.prototype.render = function () {
                var t, n = this, o = n.em, r = n.el, i = n.$el, a = n.ppfx, s = n.model, l = s.get('disable'),
                    c = s.get('attributes') || {}, u = c.class || '', p = "".concat(a, "block"),
                    d = o && o.t("blockManager.labels.".concat(s.id)) || s.get('label'), f = s.get('render'),
                    h = s.get('media'), v = l ? "".concat(p, "--disable") : "".concat(a, "four-color-h");
                i.attr(c), r.className = "".concat(u, " ").concat(p, " ").concat(a, "one-bg ").concat(v).trim(), r.innerHTML = "\n      ".concat(h ? "<div class=\"".concat(p, "__media\">").concat(h, "</div>") : '', "\n      <div class=\"").concat(p, "-label\">").concat(d, "</div>\n    "), r.title = c.title || (null === (t = r.textContent) || void 0 === t ? void 0 : t.trim()), r.setAttribute('draggable', "".concat(!(!(0, e.hasDnd)(o) || l)));
                var g = f && f({el: r, model: s, className: p, prefix: a});
                return g && (r.innerHTML = g), this
            }, o
        }(u.Ss);
        const ds = ps;
        var fs = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), hs = void 0 && (void 0).__makeTemplateObject || function (t, e) {
            return Object.defineProperty ? Object.defineProperty(t, "raw", {value: e}) : t.raw = e, t
        }, vs = function (t) {
            function e(e, n, o) {
                var r = t.call(this, e) || this;
                r.config = n;
                var i = n.pStylePrefix || '';
                return r.em = n.em, r.catName = o, r.pfx = i, r.caretR = 'fa fa-caret-right', r.caretD = 'fa fa-caret-down', r.iconClass = "".concat(i, "caret-icon"), r.activeClass = "".concat(i, "open"), r.className = "".concat(i).concat(o, "-category"), r.listenTo(r.model, 'change:open', r.updateVisibility), r.model.view = r, r
            }

            return fs(e, t), e.prototype.events = function () {
                return {'click [data-title]': 'toggle'}
            }, e.prototype.template = function (t) {
                var e = t.pfx, n = t.label, o = t.catName;
                return r(ys || (ys = hs(["\n      <div class=\"", "title\" data-title>\n        <i class=\"", "caret-icon\"></i>\n        ", "\n      </div>\n      <div class=\"", "", "s-c\"></div>\n    "], ["\n      <div class=\"", "title\" data-title>\n        <i class=\"", "caret-icon\"></i>\n        ", "\n      </div>\n      <div class=\"", "", "s-c\"></div>\n    "])), e, e, n, e, o)
            }, e.prototype.attributes = function () {
                return this.model.get('attributes') || {}
            }, e.prototype.updateVisibility = function () {
                this.model.get('open') ? this.open() : this.close()
            }, e.prototype.open = function () {
                this.$el.addClass(this.activeClass), this.getIconEl().className = "".concat(this.iconClass, " ").concat(this.caretD), this.getTypeEl().style.display = ''
            }, e.prototype.close = function () {
                this.$el.removeClass(this.activeClass), this.getIconEl().className = "".concat(this.iconClass, " ").concat(this.caretR), this.getTypeEl().style.display = 'none'
            }, e.prototype.toggle = function () {
                var t = this.model;
                t.set('open', !t.get('open'))
            }, e.prototype.getIconEl = function () {
                return this.iconEl || (this.iconEl = this.el.querySelector(".".concat(this.iconClass))), this.iconEl
            }, e.prototype.getTypeEl = function () {
                return this.typeEl || (this.typeEl = this.el.querySelector(".".concat(this.pfx).concat(this.catName, "s-c"))), this.typeEl
            }, e.prototype.append = function (t) {
                this.getTypeEl().appendChild(t)
            }, e.prototype.render = function () {
                var t = this, e = t.em, n = t.el, o = t.$el, r = t.model, i = t.pfx, a = t.catName,
                    s = e.t("".concat(a, "Manager.categories.").concat(r.id)) || r.get('label');
                return n.innerHTML = this.template({
                    pfx: i,
                    label: s,
                    catName: a
                }), o.addClass(this.className), o.css({order: r.get('order')}), this.updateVisibility(), this
            }, e
        }(u.Ss);
        const gs = vs;
        var ys, ms = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), bs = void 0 && (void 0).__assign || function () {
            return bs = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, bs.apply(this, arguments)
        }, _s = function (e) {
            function n(n, o) {
                var r = e.call(this, n) || this;
                r.renderedCategories = new Map, (0, t.bindAll)(r, 'getSorter', 'onDrag', 'onDrop', 'onMove'), r.config = o || {}, r.categories = n.categories || '';
                var i = r.config.pStylePrefix || '';
                r.ppfx = i, r.noCatClass = "".concat(i, "blocks-no-cat"), r.blockContClass = "".concat(i, "blocks-c"), r.catsClass = "".concat(i, "block-categories");
                var a = r.collection;
                return r.listenTo(a, 'add', r.addTo), r.listenTo(a, 'reset', r.render), r.em = r.config.em, r.em && (r.config.getSorter = r.getSorter), r
            }

            return ms(n, e), n.prototype.__getModule = function () {
                return this.em.Blocks
            }, n.prototype.updateConfig = function (t) {
                void 0 === t && (t = {}), this.config = bs(bs({}, this.config), t)
            }, n.prototype.getSorter = function () {
                var t = this.em;
                if (t) {
                    if (!this.sorter) {
                        var e = t.Utils, n = t.Canvas;
                        this.sorter = new e.ComponentSorter({
                            em: t,
                            treeClass: Wn,
                            containerContext: {
                                container: n.getBody(),
                                containerSel: '*',
                                itemSel: '*',
                                pfx: this.ppfx,
                                placeholderElement: n.getPlacerEl(),
                                document: n.getBody().ownerDocument
                            },
                            dragBehavior: {dragDirection: Hn.A.BothDirections, nested: !0},
                            positionOptions: {windowMargin: 1, canvasRelative: !0},
                            eventHandlers: {
                                legacyOnStartSort: this.onDrag,
                                legacyOnEndMove: this.onDrop,
                                legacyOnMoveClb: this.onMove
                            }
                        })
                    }
                    return this.sorter
                }
            }, n.prototype.onDrag = function (t) {
                this.em.stopDefault(), this.__getModule().__startDrag(this.sorter.__currentBlock, t)
            }, n.prototype.onMove = function (t) {
                this.__getModule().__drag(t)
            }, n.prototype.onDrop = function (t) {
                this.em.runDefault(), this.__getModule().__endDrag({component: t}), delete this.sorter.__currentBlock
            }, n.prototype.addTo = function (t) {
                this.add(t)
            }, n.prototype.add = function (t, e) {
                var n = this.config, o = this.renderedCategories, r = t.get('attributes'),
                    i = new ds({model: t, attributes: r}, n).render().el, a = t.parent.initCategory(t);
                if (a && this.categories && !n.ignoreCategories) {
                    var s = a.getId(), l = this.getCategoriesEl(), c = o.get(s);
                    return !c && l && (c = new gs({model: a}, n, 'block').render(), o.set(s, c), l.appendChild(c.el)), void (null == c || c.append(i))
                }
                e ? e.appendChild(i) : this.append(i)
            }, n.prototype.getCategoriesEl = function () {
                return this.catsEl || (this.catsEl = this.el.querySelector(".".concat(this.catsClass))), this.catsEl
            }, n.prototype.getBlocksEl = function () {
                return this.blocksEl || (this.blocksEl = this.el.querySelector(".".concat(this.noCatClass, " .").concat(this.blockContClass))), this.blocksEl
            }, n.prototype.append = function (t) {
                var e = this.getBlocksEl();
                e && e.appendChild(t)
            }, n.prototype.render = function () {
                var t = this, e = this.ppfx, n = document.createDocumentFragment();
                delete this.catsEl, delete this.blocksEl, this.renderedCategories = new Map, this.el.innerHTML = "\n      <div class=\"".concat(this.catsClass, "\"></div>\n      <div class=\"").concat(this.noCatClass, "\">\n        <div class=\"").concat(this.blockContClass, "\"></div>\n      </div>\n    "), this.collection.each((function (e) {
                    return t.add(e, n)
                })), this.append(n);
                var o = "".concat(this.blockContClass, "s ").concat(e, "one-bg ").concat(e, "two-color");
                return this.$el.addClass(o), this.rendered = !0, this
            }, n
        }(u.Ss);
        const ws = _s;
        var xs = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Cs = void 0 && (void 0).__assign || function () {
            return Cs = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Cs.apply(this, arguments)
        }, Ss = function (e) {
            function n(n) {
                var o = e.call(this, n, 'BlockManager', new ss([], {em: n}), ls, ns()) || this;
                return o.events = ls, o.Block = rs, o.Blocks = ss, o.Category = Ze, o.Categories = an, o.storageKey = '', o.blocks = o.all, o.blocksVisible = new ss(o.blocks.models, {em: n}), o.categories = new an([], {
                    em: n,
                    events: {update: ls.categoryUpdate}
                }), o.__onAllEvent = (0, t.debounce)((function () {
                    return o.__trgCustom()
                }), 0), o
            }

            return xs(n, e), n.prototype.onInit = function () {
                var t = this, e = t.config, n = t.blocks, o = t.blocksVisible;
                n.on('add', (function (t) {
                    return o.add(t)
                })), n.on('remove', (function (t) {
                    return o.remove(t)
                })), n.on('reset', (function (t) {
                    return o.reset(t.models)
                })), n.add(e.blocks || [])
            }, n.prototype.__trgCustom = function () {
                this.em.trigger(this.events.custom, this.__customData())
            }, n.prototype.__customData = function () {
                var t = this, e = this.__getBehaviour();
                return {
                    bm: this, blocks: this.getAll().models, container: e.container, dragStart: function (e, n) {
                        return t.startDrag(e, n)
                    }, drag: function (e) {
                        return t.__drag(e)
                    }, dragStop: function (e) {
                        return t.endDrag(e)
                    }
                }
            }, n.prototype.__startDrag = function (t, e) {
                var n = this, o = n.em, r = n.events, i = n.blocks, a = t.getContent ? t.getContent() : t;
                this._dragBlock = t, o.set({
                    dragResult: null,
                    dragSource: {content: a, dragDef: t.getDragDef()}
                }), [o, i].map((function (n) {
                    return n.trigger(r.dragStart, t, e)
                }))
            }, n.prototype.__drag = function (t) {
                var e = this, n = e.em, o = e.events, r = e.blocks, i = this._dragBlock;
                [n, r].map((function (e) {
                    return e.trigger(o.drag, i, t)
                }))
            }, n.prototype.__endDrag = function (e) {
                void 0 === e && (e = {});
                var n = this, o = n.em, r = n.events, i = n.blocks, a = this._dragBlock,
                    s = e.component || o.get('dragResult');
                if (delete this._dragBlock, s && a) {
                    var l = 'activeOnRender', c = s.get && s.get(l), u = a.get('activate') || c, p = a.get('select'),
                        d = (0, t.isArray)(s) ? s[0] : s;
                    p || u && !1 !== p ? o.setSelected(d, {activate: u}) : u && d.trigger('active'), u && c && d.unset(l), a.get('resetId') && d.onAll((function (t) {
                        return t.resetId()
                    }))
                }
                o.set({dragResult: null, dragSource: void 0}), a && [o, i].map((function (t) {
                    return t.trigger(r.dragEnd, s, a)
                }))
            }, n.prototype.__getFrameViews = function () {
                return this.em.Canvas.getFrames().map((function (t) {
                    return t.view
                })).filter(Boolean)
            }, n.prototype.__behaviour = function (t) {
                return void 0 === t && (t = {}), this._bhv = Cs(Cs({}, this._bhv || {}), t)
            }, n.prototype.__getBehaviour = function () {
                return this._bhv || {}
            }, n.prototype.startDrag = function (t, e) {
                this.__startDrag(t, e), this.__getFrameViews().forEach((function (t) {
                    var e;
                    return null === (e = t.droppable) || void 0 === e ? void 0 : e.startCustom()
                }))
            }, n.prototype.endDrag = function (t) {
                this.__getFrameViews().forEach((function (e) {
                    var n;
                    return null === (n = e.droppable) || void 0 === n ? void 0 : n.endCustom(t)
                })), this.__endDrag()
            }, n.prototype.postRender = function () {
                var t = this, e = t.categories, n = t.config, o = t.em, r = this.blocksVisible;
                this.blocksView = new ws({
                    collection: r,
                    categories: e
                }, Cs(Cs({}, n), {em: o})), this.__appendTo(r.models), this.__trgCustom()
            }, n.prototype.add = function (t, e, n) {
                void 0 === n && (n = {});
                var o = e || {};
                return o.id = t, this.blocks.add(o, n)
            }, n.prototype.get = function (t) {
                return this.blocks.get(t)
            }, n.prototype.getAll = function () {
                return this.blocks
            }, n.prototype.getAllVisible = function () {
                return this.blocksVisible
            }, n.prototype.remove = function (t, e) {
                return void 0 === e && (e = {}), this.__remove(t, e)
            }, n.prototype.getCategories = function () {
                return this.categories
            }, n.prototype.getContainer = function () {
                var t;
                return null === (t = this.blocksView) || void 0 === t ? void 0 : t.el
            }, n.prototype.getDragBlock = function () {
                return this._dragBlock
            }, n.prototype.getBlocksByCategory = function (t) {
                return Qe(t || this.getAll().models)
            }, n.prototype.render = function (t, e) {
                void 0 === e && (e = {});
                var n = this, o = n.categories, r = n.config, i = n.em, a = t || this.getAll().models;
                if (e.external) {
                    var s = new ss(a, {em: i});
                    return new ws({collection: s, categories: o}, Cs(Cs({em: i}, r), e)).render().el
                }
                return this.blocksView && (this.blocksView.updateConfig(e), this.blocksView.collection.reset(a), this.blocksView.rendered || (this.blocksView.render(), this.blocksView.rendered = !0)), this.getContainer()
            }, n.prototype.destroy = function () {
                var t, e = [this.blocks, this.blocksVisible, this.categories];
                e.map((function (t) {
                    return t.stopListening()
                })), e.map((function (t) {
                    return t.reset()
                })), null === (t = this.blocksView) || void 0 === t || t.remove()
            }, n
        }(b);
        const Os = Ss;
        const Ts = function () {
            return {
                stylePrefix: 'clm-',
                appendTo: '',
                selectors: [],
                states: [{name: 'hover'}, {name: 'active'}, {name: 'nth-of-type(2n)'}],
                iconAdd: '<svg viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></svg>',
                iconSync: '<svg viewBox="0 0 24 24"><path d="M12 18c-3.31 0-6-2.69-6-6 0-1 .25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4m0-11V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8z"></path></svg>',
                iconTagOn: '<svg viewBox="0 0 24 24"><path d="M19 19H5V5h10V3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8h-2m-11.09-.92L6.5 11.5 11 16 21 6l-1.41-1.42L11 13.17l-3.09-3.09z"></path></svg>',
                iconTagOff: '<svg viewBox="0 0 24 24"><path d="M19 3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2m0 2v14H5V5h14z"></path></svg>',
                iconTagRemove: '<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',
                componentFirst: !1,
                custom: !1
            }
        };
        var Ps = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Es = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ps(e, t), e.prototype.defaults = function () {
                return {name: '', label: ''}
            }, e.prototype.getName = function () {
                return this.get('name')
            }, e.prototype.getLabel = function () {
                return this.get('label') || this.getName()
            }, e
        }(u.Kx);
        const ks = Es;
        Es.prototype.idAttribute = 'name';
        var As = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), js = void 0 && (void 0).__makeTemplateObject || function (t, e) {
            return Object.defineProperty ? Object.defineProperty(t, "raw", {value: e}) : t.raw = e, t
        }, Ms = 'contentEditable', Ds = function (t) {
            function e(e) {
                void 0 === e && (e = {});
                var n = t.call(this, e) || this, o = e.config || {};
                return n.config = o, n.module = e.module, n.coll = e.coll || null, n.pfx = o.stylePrefix || '', n.ppfx = o.pStylePrefix || '', n.em = o.em, n.listenTo(n.model, 'change:active', n.updateStatus), n
            }

            return As(e, t), e.prototype.template = function () {
                var t = this, e = t.pfx, n = t.model, o = t.config, i = n.get('label') || '';
                return r(Is || (Is = js(["\n      <span id=\"", "checkbox\" class=\"", "tag-status\" data-tag-status></span>\n      <span id=\"", "tag-label\" data-tag-name>", "</span>\n      <span id=\"", "close\" class=\"", "tag-close\" data-tag-remove> $", " </span>\n    "], ["\n      <span id=\"", "checkbox\" class=\"", "tag-status\" data-tag-status></span>\n      <span id=\"", "tag-label\" data-tag-name>", "</span>\n      <span id=\"", "close\" class=\"", "tag-close\" data-tag-remove> $", " </span>\n    "])), e, e, e, i, e, e, o.iconTagRemove)
            }, e.prototype.events = function () {
                return {
                    'click [data-tag-remove]': 'removeTag',
                    'click [data-tag-status]': 'changeStatus',
                    'dblclick [data-tag-name]': 'startEditTag',
                    'focusout [data-tag-name]': 'endEditTag'
                }
            }, e.prototype.getInputEl = function () {
                return this.inputEl || (this.inputEl = this.el.querySelector('[data-tag-name]')), this.inputEl
            }, e.prototype.startEditTag = function () {
                var t = this.em, e = this.getInputEl();
                e[Ms] = 'true', e.focus(), null == t || t.setEditing(!0)
            }, e.prototype.endEditTag = function () {
                var t = this.model, e = this.em, n = this.getInputEl(), o = n.textContent || '',
                    r = null == e ? void 0 : e.Selectors;
                n[Ms] = 'false', null == e || e.setEditing(!1), r && r.rename(t, o) !== t && (n.innerText = t.getLabel())
            }, e.prototype.changeStatus = function () {
                var t = this.model;
                t.set('active', !t.getActive())
            }, e.prototype.removeTag = function () {
                this.module.removeSelected(this.model)
            }, e.prototype.updateStatus = function () {
                var t = this, e = t.model, n = t.$el, o = t.config, r = o.iconTagOn, i = o.iconTagOff,
                    a = n.find('[data-tag-status]');
                e.get('active') ? (a.html(r), n.removeClass('opac50')) : (a.html(i), n.addClass('opac50'))
            }, e.prototype.render = function () {
                var t = this, e = t.pfx, n = t.ppfx, o = t.$el, r = t.model, i = "".concat(e, "tag"),
                    a = ["".concat(i, " ").concat(n, "three-bg")];
                return r.get('protected') && a.push("".concat(i, "-protected")), o.html(this.template()), o.attr('class', a.join(' ')), this.updateStatus(), this
            }, e
        }(u.Ss);
        const Ls = Ds;
        var Is, Ns = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Rs = void 0 && (void 0).__makeTemplateObject || function (t, e) {
            return Object.defineProperty ? Object.defineProperty(t, "raw", {value: e}) : t.raw = e, t
        }, Vs = function (e) {
            function n(n) {
                void 0 === n && (n = {});
                var o = e.call(this, n) || this;
                o.config = n.config || {}, o.pfx = o.config.stylePrefix || '', o.ppfx = o.config.pStylePrefix || '', o.className = o.pfx + 'tags', o.stateInputId = o.pfx + 'states', o.stateInputC = o.pfx + 'input-c', o.states = o.config.states || [];
                var r = o.config.em, i = o.collection;
                o.target = r;
                var a = r.Selectors;
                o.module = a, o.em = r, o.componentChanged = (0, t.debounce)(o.componentChanged.bind(o), 0), o.checkSync = (0, t.debounce)(o.checkSync.bind(o), 0);
                var s = $.I.update, l = "".concat(s, ":classes"), c = "component:toggled ".concat(l),
                    u = "".concat(l, " ").concat(s, ":attributes:id change:state");
                return o.listenTo(r, c, o.componentChanged), o.listenTo(r, 'styleManager:update', o.componentChanged), o.listenTo(r, u, o.__handleStateChange), o.listenTo(r, 'styleable:change change:device', o.checkSync), o.listenTo(i, 'add', o.addNew), o.listenTo(i, 'reset', o.renderClasses), o.listenTo(i, 'remove', o.tagRemoved), o.listenTo(a.getAll(), a.events.state, (0, t.debounce)((function () {
                    return o.renderStates()
                }), 0)), o.delegateEvents(), o
            }

            return Ns(n, e), n.prototype.template = function (t) {
                var e = t.labelInfo, n = t.labelHead, o = t.iconSync, i = t.iconAdd, a = t.pfx, s = t.ppfx;
                return r(Hs || (Hs = Rs([" <div id=\"", "up\" class=\"", "header\">\n        <div id=\"", "label\" class=\"", "header-label\">", "</div>\n        <div id=\"", "status-c\" class=\"", "header-status\">\n          <span id=\"", "input-c\" data-states-c>\n            <div class=\"", "field ", "select\">\n              <span id=\"", "input-holder\">\n                <select id=\"", "states\" data-states></select>\n              </span>\n              <div class=\"", "sel-arrow\">\n                <div class=\"", "d-s-arrow\"></div>\n              </div>\n            </div>\n          </span>\n        </div>\n      </div>\n      <div id=\"", "tags-field\" class=\"", "field\">\n        <div id=\"", "tags-c\" data-selectors></div>\n        <input id=\"", "new\" data-input />\n        <span id=\"", "add-tag\" class=\"", "tags-btn ", "tags-btn__add\" data-add> $", " </span>\n        <span class=\"", "tags-btn ", "tags-btn__sync\" style=\"display: none\" data-sync-style> $", " </span>\n      </div>\n      <div class=\"", "sels-info\">\n        <div class=\"", "label-sel\">", ":</div>\n        <div class=\"", "sels\" data-selected></div>\n      </div>"], [" <div id=\"", "up\" class=\"", "header\">\n        <div id=\"", "label\" class=\"", "header-label\">", "</div>\n        <div id=\"", "status-c\" class=\"", "header-status\">\n          <span id=\"", "input-c\" data-states-c>\n            <div class=\"", "field ", "select\">\n              <span id=\"", "input-holder\">\n                <select id=\"", "states\" data-states></select>\n              </span>\n              <div class=\"", "sel-arrow\">\n                <div class=\"", "d-s-arrow\"></div>\n              </div>\n            </div>\n          </span>\n        </div>\n      </div>\n      <div id=\"", "tags-field\" class=\"", "field\">\n        <div id=\"", "tags-c\" data-selectors></div>\n        <input id=\"", "new\" data-input />\n        <span id=\"", "add-tag\" class=\"", "tags-btn ", "tags-btn__add\" data-add> $", " </span>\n        <span class=\"", "tags-btn ", "tags-btn__sync\" style=\"display: none\" data-sync-style> $", " </span>\n      </div>\n      <div class=\"", "sels-info\">\n        <div class=\"", "label-sel\">", ":</div>\n        <div class=\"", "sels\" data-selected></div>\n      </div>"])), a, a, a, a, n, a, a, a, s, s, s, a, s, s, a, s, a, a, a, a, a, i, a, a, o, a, a, e, a)
            }, n.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'
                }
            }, n.prototype.syncStyle = function () {
                var t, e = this.em, n = this.getTarget(), o = e.Css,
                    r = this.getCommonSelectors({opts: {noDisabled: 1}}), i = e.get('state'), a = e.getCurrentMedia(),
                    s = [], l = o.get(r, i, a) || o.add(r, i, a);
                this.getTargets().forEach((function (e) {
                    var n = o.getIdRule(e.getId(), {state: i, mediaText: a});
                    t = n.getStyle(), n.setStyle({}), s.push(n)
                })), t && l.addStyle(t), e.trigger('component:toggled'), e.trigger('component:sync-style', {
                    component: n,
                    selectors: r,
                    mediaText: a,
                    rule: l,
                    ruleComponents: s,
                    state: i
                })
            }, n.prototype.tagRemoved = function (t) {
                this.updateStateVis()
            }, n.prototype.addNew = function (t) {
                this.addToClasses(t)
            }, n.prototype.startNewTag = function () {
                var t, e;
                null === (t = this.$addBtn) || void 0 === t || t.css({display: 'none'}), null === (e = this.$input) || void 0 === e || e.show().focus()
            }, n.prototype.endNewTag = function () {
                var t, e;
                null === (t = this.$addBtn) || void 0 === t || t.css({display: ''}), null === (e = this.$input) || void 0 === e || e.hide().val('')
            }, n.prototype.onInputKeyUp = function (t) {
                var e;
                13 === t.keyCode ? (t.preventDefault(), this.addNewTag(null === (e = this.$input) || void 0 === e ? void 0 : e.val())) : 27 === t.keyCode && this.endNewTag()
            }, n.prototype.checkStates = function () {
                var t = this.em.getState(), e = this.getStates();
                e && e.val(t)
            }, n.prototype.componentChanged = function (t) {
                var e = (void 0 === t ? {} : t).targets;
                this.updateSelection(e)
            }, n.prototype.updateSelection = function (e) {
                var n = e || this.getTargets(), o = [];
                return (n = (0, t.isArray)(n) ? n : [n]) && n.length && (o = this.getCommonSelectors({targets: n}), this.checkSync({validSelectors: o})), this.collection.reset(o), this.updateStateVis(n), this.module.__trgCustom(), o
            }, n.prototype.getCommonSelectors = function (t) {
                var e = void 0 === t ? {} : t, n = e.targets, o = e.opts, r = void 0 === o ? {} : o,
                    i = n || this.getTargets();
                return this.module.__getCommonSelectors(i, r)
            }, n.prototype._commonSelectors = function () {
                for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
                return (t = this.module).__common.apply(t, e)
            }, n.prototype.checkSync = function () {
                var e, n = this, o = n.$btnSyncEl, r = n.config, i = n.collection, a = this.getTarget();
                if (a && r.componentFirst && i.length) {
                    var s = a.getStyle();
                    e = !(0, t.isEmpty)(s)
                }
                o && o[e ? 'show' : 'hide']()
            }, n.prototype.getTarget = function () {
                return this.target.getSelected()
            }, n.prototype.getTargets = function () {
                return this.target.getSelectedAll()
            }, n.prototype.updateStateVis = function (t) {
                var e = this.em, n = e && e.getConfig().avoidInlineStyle, o = this.collection.length || n ? '' : 'none';
                this.getStatesC().css('display', o), this.updateSelector(t)
            }, n.prototype.__handleStateChange = function () {
                this.updateSelector(this.getTargets())
            }, n.prototype.updateSelector = function (e) {
                var n = this, o = this.el.querySelector('[data-selected]'), r = [], i = e || this.getTargets();
                (i = (0, t.isArray)(i) ? i : [i]).forEach((function (t) {
                    return r.push(n.__getName(t))
                })), o && (o.innerHTML = r.join(', ')), this.checkStates()
            }, n.prototype.__getName = function (e) {
                var n, o = this, i = o.pfx, a = o.config, s = o.em, l = a.selectedName, c = a.componentFirst;
                if ((0, t.isString)(e)) n = r(Us || (Us = Rs(["<span class=\"", "sel-gen\">", "</span>"], ["<span class=\"", "sel-gen\">", "</span>"])), i, e); else {
                    var u = null == e ? void 0 : e.getSelectors();
                    if (!u) return '';
                    var p = u.getStyleable(), d = s.get('state'),
                        f = e.getId ? r(zs || (zs = Rs(["<span class=\"", "sel-cmp\">", "</span>\n            <span class=\"", "sel-id\">#", "</span>"], ["<span class=\"", "sel-cmp\">", "</span>\n            <span class=\"", "sel-id\">#", "</span>"])), i, e.getName(), i, e.getId()) : '';
                    n = (n = this.collection.getFullString(p)) ? r(Bs || (Bs = Rs(["<span class=\"", "sel-rule\">", "</span>"], ["<span class=\"", "sel-rule\">", "</span>"])), i, n) : e.get('selectorsAdd') || f, n = c && f ? f : n, n += d ? r(Ws || (Ws = Rs(["<span class=\"", "sel-state\">:", "</span>"], ["<span class=\"", "sel-state\">:", "</span>"])), i, d) : '', n = l ? l({
                        result: n,
                        state: d,
                        target: e
                    }) : n
                }
                return n && "<span class=\"".concat(i, "sel\">").concat(n, "</span>")
            }, n.prototype.stateChanged = function (t) {
                var e = this.em, n = t.target.value;
                e.set('state', n)
            }, n.prototype.addNewTag = function (t) {
                var e = t.trim();
                e && (this.module.addSelected({label: e}), this.endNewTag())
            }, n.prototype.addToClasses = function (t, e) {
                var n = e, o = this.getClasses(),
                    r = new Ls({model: t, config: this.config, coll: this.collection, module: this.module}).render().el;
                return n ? n.appendChild(r) : o.append(r), r
            }, n.prototype.renderClasses = function () {
                var t = this, e = document.createDocumentFragment(), n = this.getClasses();
                n.empty(), this.collection.each((function (n) {
                    return t.addToClasses(n, e)
                })), n.append(e)
            }, n.prototype.getClasses = function () {
                return this.$el.find('[data-selectors]')
            }, n.prototype.getStates = function () {
                if (!this.$states) {
                    var t = this.$el.find('[data-states]');
                    this.$states = t[0] && t
                }
                return this.$states
            }, n.prototype.getStatesC = function () {
                return this.$statesC || (this.$statesC = this.$el.find('#' + this.stateInputC)), this.$statesC
            }, n.prototype.renderStates = function () {
                var t = this.module, e = this.em, n = e.t('selectorManager.emptyState'),
                    o = t.getStates().map((function (t) {
                        var n = e.t("selectorManager.states.".concat(t.id)) || t.getLabel() || t.id;
                        return "<option value=\"".concat(t.id, "\">").concat(n, "</option>")
                    })).join(''), r = this.getStates();
                r && r.html("<option value=\"\">".concat(n, "</option>").concat(o)), this.checkStates()
            }, n.prototype.render = function () {
                var t = this, e = t.em, n = t.pfx, o = t.ppfx, r = t.config, i = t.$el, a = t.el, s = r.render, l = {
                    iconSync: r.iconSync,
                    iconAdd: r.iconAdd,
                    labelHead: e.t('selectorManager.label'),
                    labelInfo: e.t('selectorManager.selected'),
                    ppfx: o,
                    pfx: n,
                    el: a
                };
                i.html(this.template(l));
                var c = s && s(l);
                return c && c !== a && i.empty().append(c), this.$input = i.find('[data-input]'), this.$addBtn = i.find('[data-add]'), this.$classes = i.find('#' + n + 'tags-c'), this.$btnSyncEl = i.find('[data-sync-style]'), this.$input.hide(), this.renderStates(), this.renderClasses(), i.attr('class', "".concat(this.className, " ").concat(o, "one-bg ").concat(o, "two-color")), this
            }, n
        }(u.Ss);
        const Fs = Vs;
        var Hs, Us, zs, Bs, Ws, $s = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), qs = void 0 && (void 0).__assign || function () {
                return qs = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, qs.apply(this, arguments)
            }, Gs = void 0 && (void 0).__spreadArray || function (t, e, n) {
                if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                return t.concat(o || Array.prototype.slice.call(e))
            }, Ks = function (e) {
                return (0, t.isString)(e) && '#' == e[0]
            }, Ys = function (e) {
                return (0, t.isString)(e) && '.' == e[0]
            }, Xs = 'selector', Js = "".concat(Xs, ":"), Zs = "".concat(Js, "add"), Qs = "".concat(Js, "update"),
            tl = "".concat(Js, "remove"), el = "".concat(tl, ":before"), nl = "".concat(Js, "custom"),
            ol = "".concat(Js, "state"),
            rl = {all: Xs, update: Qs, add: Zs, remove: tl, removeBefore: el, state: ol, custom: nl},
            il = function (n) {
                function o(e) {
                    var o = n.call(this, e, 'SelectorManager', new Ye([]), rl, Ts(), {skipListen: !0}) || this;
                    o.Selector = $e, o.Selectors = Ye, o.storageKey = '', (0, t.bindAll)(o, '__updateSelectedByComponents');
                    var r = o.config, i = r.pStylePrefix;
                    i && (r.stylePrefix = i + r.stylePrefix), o.all = new Ye(r.selectors), o.selected = new Ye([], {
                        em: e,
                        config: r
                    }), o.states = new u.pM(r.states.map((function (t) {
                        return new ks(t)
                    })), {model: ks}), o.model = new u.Kx({
                        cFirst: r.componentFirst,
                        _undo: !0
                    }), o.__update = (0, t.debounce)((function () {
                        return o.__trgCustom()
                    }), 0), o.__initListen({
                        collections: [o.states, o.selected],
                        propagate: [{entity: o.states, event: o.events.state}]
                    }), e.on('change:state', (function (t, n) {
                        return e.trigger(ol, n)
                    })), o.model.on('change:cFirst', (function (t, n) {
                        return e.trigger('selector:type', n)
                    }));
                    var a = "".concat($.I.update, ":classes");
                    e.on("component:toggled ".concat(a), o.__updateSelectedByComponents);
                    var s = "component:toggled ".concat(a, " change:device styleManager:update selector:state selector:type style:target");
                    return o.model.listenTo(e, s, (function () {
                        return o.__update()
                    })), o
                }

                return $s(o, n), o.prototype.__trgCustom = function (t) {
                    this.em.trigger(this.events.custom, this.__customData(t))
                }, o.prototype.getAll = function (t) {
                    return void 0 === t && (t = {}), this.all ? t.array ? Gs([], this.all.models, !0) : this.all : []
                }, o.prototype.__customData = function (t) {
                    return void 0 === t && (t = {}), this.__ctn = this.__ctn || t.container, {
                        states: this.getStates(),
                        selected: this.getSelected(),
                        container: this.__ctn
                    }
                }, o.prototype.postRender = function () {
                    this.__appendTo(), this.__trgCustom()
                }, o.prototype.select = function (t, n) {
                    void 0 === n && (n = {});
                    var o = Array.isArray(t) ? t : [t], r = this.em.Styles.select(o, n);
                    this.selected.reset(this.__getCommonSelectors(r));
                    var i = this.selectorTags, a = r.filter((function (t) {
                        return t
                    })).map((function (t) {
                        return (0, e.isComponent)(t) || (0, e.isRule)(t) && !t.get('selectorsAdd') ? t : t.getSelectorsString()
                    }));
                    return i && i.componentChanged({targets: a}), this
                }, o.prototype.addSelector = function (e, n, o) {
                    void 0 === n && (n = {}), void 0 === o && (o = {});
                    var r = qs({}, n);
                    (0, t.isObject)(e) ? r = e : r.name = e, Ks(r.name) ? (r.name = r.name.substr(1), r.type = $e.TYPE_ID) : Ys(r.name) && (r.name = r.name.substr(1)), r.label && !r.name && (r.name = this.escapeName(r.label));
                    var i = r.name, a = this.getConfig(), s = this.all, l = this.em,
                        c = i ? this.get(i, r.type) : s.where(r)[0];
                    if (!c) {
                        var u = r instanceof $e ? r : new $e(r, qs(qs({}, o), {config: a, em: l}));
                        return s.add(u, o)
                    }
                    return c
                }, o.prototype.getSelector = function (t, e) {
                    return void 0 === e && (e = $e.TYPE_CLASS), Ks(t) ? (t = t.substr(1), e = $e.TYPE_ID) : Ys(t) && (t = t.substr(1)), this.all.where({
                        name: t,
                        type: e
                    })[0]
                }, o.prototype.add = function (e, n) {
                    var o = this;
                    void 0 === n && (n = {});
                    var r = (0, t.isString)(e) ? {} : n;
                    return (0, t.isArray)(e) ? e.map((function (t) {
                        return o.addSelector(t, n, r)
                    })) : this.addSelector(e, n, r)
                }, o.prototype.addClass = function (e) {
                    var n = this, o = [];
                    return (0, t.isString)(e) && (e = e.trim().split(' ')), e.forEach((function (t) {
                        return o.push(n.addSelector(t))
                    })), o
                }, o.prototype.get = function (e, n) {
                    var o = this;
                    if ((0, t.isArray)(e)) {
                        var r = [];
                        return e.map((function (t) {
                            return o.getSelector(t)
                        })).filter(Boolean).forEach((function (t) {
                            return r.indexOf(t) < 0 && r.push(t)
                        })), r
                    }
                    return this.getSelector(e, n)
                }, o.prototype.remove = function (t, e) {
                    return this.__remove(t, e)
                }, o.prototype.rename = function (t, e, n) {
                    var o = this.escapeName(e);
                    return this.get(o) || t.set({name: o, label: e}, n)
                }, o.prototype.setState = function (t) {
                    return this.em.setState(t), this
                }, o.prototype.getState = function () {
                    return this.em.getState()
                }, o.prototype.getStates = function () {
                    return Gs([], this.states.models, !0)
                }, o.prototype.setStates = function (t, e) {
                    return this.states.reset(t.map((function (t) {
                        return new ks(t)
                    })), e)
                }, o.prototype.getSelected = function () {
                    return this.__getCommon()
                }, o.prototype.getSelectedAll = function () {
                    return Gs([], this.selected.models, !0)
                }, o.prototype.addSelected = function (t) {
                    var e = this.add(t);
                    this.em.getSelectedAll().forEach((function (t) {
                        t.getSelectors().add(e)
                    }))
                }, o.prototype.removeSelected = function (t) {
                    this.em.getSelectedAll().forEach((function (e) {
                        !t.get('protected') && e && e.getSelectors().remove(t)
                    }))
                }, o.prototype.duplicateSelected = function (t, e) {
                    var n = this;
                    void 0 === e && (e = {});
                    var o = this.em, r = this.getSelected();
                    if (!(r.indexOf(t) < 0)) {
                        var i = this.getState(), a = o.getCurrentMedia(), s = o.Css.get(r, i, a),
                            l = null == s ? void 0 : s.getStyle();
                        if (o.getSelectedAll().forEach((function (o) {
                            var r = o.getSelectors();
                            if (r.includes(t)) {
                                var i = e.suffix || ' copy', a = t.getLabel(),
                                    s = n.addSelector("".concat(a).concat(i)), l = r.indexOf(t);
                                r.remove(t), r.add(s, {at: l})
                            }
                        })), l) o.Css.add(this.getSelected(), i, a).setStyle(l)
                    }
                }, o.prototype.getSelectedTargets = function () {
                    return this.em.Styles.getSelectedAll()
                }, o.prototype.setComponentFirst = function (t) {
                    this.getConfig().componentFirst = t, this.model.set({cFirst: t})
                }, o.prototype.getComponentFirst = function () {
                    return this.getConfig().componentFirst
                }, o.prototype.escapeName = function (t) {
                    var e = this.getConfig().escapeName;
                    return e ? e(t) : $e.escapeName(t)
                }, o.prototype.render = function (t) {
                    var e = this.selectorTags, n = this.getConfig(), o = null == e ? void 0 : e.el;
                    return this.selected.reset(t), this.selectorTags = new Fs({
                        el: o,
                        collection: this.selected,
                        module: this,
                        config: n
                    }), this.selectorTags.render().el
                }, o.prototype.destroy = function () {
                    var t = this.selectorTags;
                    this.model.stopListening(), this.__update.cancel(), this.__destroy(), null == t || t.remove(), this.selectorTags = void 0
                }, o.prototype.__getCommon = function () {
                    return this.__getCommonSelectors(this.em.getSelectedAll())
                }, o.prototype.__getCommonSelectors = function (t, e) {
                    void 0 === e && (e = {});
                    var n = t.map((function (t) {
                        return t.getSelectors && t.getSelectors().getValid(e)
                    })).filter(Boolean);
                    return this.__common.apply(this, n)
                }, o.prototype.__common = function () {
                    for (var t = this, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
                    return e.length ? 1 === e.length ? e[0] : 2 === e.length ? e[0].filter((function (t) {
                        return e[1].indexOf(t) >= 0
                    })) : e.slice(1).reduce((function (e, n) {
                        return t.__common(e, n)
                    }), e[0]) : []
                }, o.prototype.__updateSelectedByComponents = function () {
                    this.selected.reset(this.__getCommon())
                }, o
            }(b);
        const al = il;
        const sl = function () {
            return {
                textTags: ['br', 'b', 'i', 'u', 'a', 'ul', 'ol'],
                textTypes: ['text', 'textnode', 'comment'],
                parserCss: void 0,
                parserHtml: void 0,
                optionsHtml: {
                    htmlType: 'text/html',
                    allowScripts: !1,
                    allowUnsafeAttr: !1,
                    allowUnsafeAttrValue: !1,
                    keepEmptyTextNodes: !1,
                    convertDataGjsAttributesHyphens: !1
                }
            }
        };
        var ll, cl = 5, ul = 6, pl = 7, dl = 11, fl = 12, hl = 13, vl = 14, gl = 15,
            yl = ((ll = {})[4] = 'media', ll[cl] = 'font-face', ll[ul] = 'page', ll[pl] = 'keyframes', ll[dl] = 'counter-style', ll[fl] = 'supports', ll[hl] = 'document', ll[vl] = 'font-feature-values', ll[gl] = 'viewport', ll),
            ml = (0, t.keys)(yl), bl = [cl, ul, dl, gl], _l = ml.filter((function (t) {
                return bl.indexOf(Number(t)) < 0
            })).map((function (t) {
                return yl[t]
            })).concat(['container', 'layer']), wl = bl.map((function (t) {
                return yl[t]
            })), xl = function (t) {
                void 0 === t && (t = '');
                for (var e = [], n = [], o = t.split(','), r = 0, i = o.length; r < i; r++) {
                    var a = o[r].trim();
                    if (/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(a) || /^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(a)) {
                        var s = a.split('.').filter(Boolean);
                        n.push(s)
                    } else e.push(a)
                }
                return {result: n, add: e}
            }, Cl = function (t) {
                for (var e = t.style, n = {}, o = 0, r = e.length; o < r; o++) {
                    var i = e[o], a = e.getPropertyValue(i), s = e.getPropertyPriority(i);
                    n[i] = "".concat(a).concat(s ? " !".concat(s) : '')
                }
                return n
            }, Sl = function (t) {
                return (t.conditionText || t.media && t.media.mediaText || t.name || t.selectorText || '').trim()
            }, Ol = function (t, e, n) {
                void 0 === e && (e = {}), void 0 === n && (n = {});
                var o = {}, r = t.length, i = t[r - 1], a = i ? i.split(/:(.+)/) : [], s = a[1], l = n.atRule,
                    c = n.selectorsAdd, u = n.mediaText;
                return wl.indexOf(l) >= 0 && (o.singleAtRule = !0), l && (o.atRuleType = l), c && (o.selectorsAdd = c), u && (o.mediaText = u), s && (t[r - 1] = a[0], o.state = s, a.splice(a.length - 1, 1)), o.selectors = t, o.style = e, o
            }, Tl = function (t) {
                var e = t.cssText, n = void 0 === e ? '' : e;
                return _l.find((function (t) {
                    return 0 === n.indexOf("@".concat(t))
                }))
            }, Pl = function (t) {
                for (var e = [], n = t.cssRules || [], o = 0, r = n.length; o < r; o++) {
                    var i = n[o], a = i.type, s = !1, l = '', c = '', u = i.selectorText || i.keyText || '',
                        p = bl.indexOf(a) >= 0;
                    if (p) s = !0, l = yl[a], c = Sl(i); else if (ml.indexOf("".concat(a)) >= 0 || !a && Tl(i)) {
                        var d = Pl(i), f = yl[a] || Tl(i);
                        c = Sl(i);
                        for (var h = 0, v = d.length; h < v; h++) {
                            var g = d[h];
                            c && (g.mediaText = c), g.atRuleType = f
                        }
                        e = e.concat(d)
                    }
                    if (u || p) {
                        for (var y = Cl(i), m = xl(u), b = m.add, _ = m.result, w = void 0, x = 0, C = _.length; x < C; x++) {
                            var S = Ol(_[x], y, {atRule: yl[a]});
                            e.push(S), w = S
                        }
                        if (b.length) {
                            var O = b.join(', ');
                            if (w) w.selectorsAdd = O; else {
                                S = {selectors: [], selectorsAdd: O, style: y};
                                s && (S.singleAtRule = s), l && (S.atRuleType = l), c && (S.mediaText = c), e.push(S)
                            }
                        }
                    }
                }
                return e
            };
        const El = function (e, n) {
            return void 0 === n && (n = {}), {
                parse: function (t, o) {
                    var r = this;
                    void 0 === o && (o = {});
                    var i, a = [], s = n.parserCss, l = null == e ? void 0 : e.Editor, c = [],
                        u = null == e ? void 0 : e.Parser, p = {input: t};
                    null == u || u.__emitEvent(ft.cssBefore, p);
                    var d = p.input;
                    try {
                        c = s ? s(d, l) : function (t) {
                            var e = document.createElement('style');
                            e.innerHTML = t, document.head.appendChild(e);
                            var n = e.sheet;
                            return document.head.removeChild(e), n ? Pl(n) : []
                        }(d)
                    } catch (t) {
                        if (i = t, o.throwOnError) throw t
                    }
                    return c.forEach((function (t) {
                        return a = a.concat(r.checkNode(t))
                    })), null == u || u.__emitEvent(ft.css, {input: d, output: a, nodes: c, error: i}), a
                }, checkNode: function (e) {
                    var n = e.selectors, o = e.style, r = [e];
                    if ((0, t.isString)(n)) {
                        var i = [], a = e, s = xl(n), l = s.result, c = s.add.join(', '),
                            u = {atRule: a.atRule, mediaText: a.params};
                        if (l.length ? l.forEach((function (t) {
                            i.push(Ol(t, o, u))
                        })) : i.push(Ol([], o, u)), c) i[i.length - 1].selectorsAdd = c;
                        r = i
                    }
                    return r
                }
            }
        };
        var kl = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Al = void 0 && (void 0).__assign || function () {
            return Al = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Al.apply(this, arguments)
        }, jl = function (t) {
            function e(e) {
                var n = t.call(this, e, 'Parser', sl()) || this;
                n.events = ft;
                var o = n.config;
                return n.parserCss = El(e, o), n.parserHtml = gt(e, o), n
            }

            return kl(e, t), e.prototype.parseHtml = function (t, e) {
                void 0 === e && (e = {});
                var n = this.em, o = this.parserHtml;
                return o.compTypes = n.Components.getTypes() || [], o.parse(t, this.parserCss, e)
            }, e.prototype.parseCss = function (t) {
                return this.parserCss.parse(t)
            }, e.prototype.__emitEvent = function (t, e) {
                var n = this.em, o = this.events;
                n.trigger(t, e), n.trigger(o.all, Al({event: t}, e))
            }, e.prototype.destroy = function () {
            }, e
        }(m);
        const Ml = jl;
        const Dl = function () {
            return {
                id: 'gjs-',
                type: 'local',
                autosave: !0,
                autoload: !0,
                stepsBeforeSave: 1,
                recovery: !1,
                onStore: function (t) {
                    return t
                },
                onLoad: function (t) {
                    return t
                },
                options: {
                    local: {key: 'gjsProject', checkLocal: !0},
                    remote: {
                        headers: {},
                        urlStore: '',
                        urlLoad: '',
                        contentTypeJson: !0,
                        fetchOptions: '',
                        credentials: 'include',
                        onStore: function (t) {
                            return t
                        },
                        onLoad: function (t) {
                            return t
                        }
                    }
                }
            }
        };
        var Ll = void 0 && (void 0).__awaiter || function (t, e, n, o) {
            return new (n || (n = Promise))((function (r, i) {
                function a(t) {
                    try {
                        l(o.next(t))
                    } catch (t) {
                        i(t)
                    }
                }

                function s(t) {
                    try {
                        l(o["throw"](t))
                    } catch (t) {
                        i(t)
                    }
                }

                function l(t) {
                    var e;
                    t.done ? r(t.value) : (e = t.value, e instanceof n ? e : new n((function (t) {
                        t(e)
                    }))).then(a, s)
                }

                l((o = o.apply(t, e || [])).next())
            }))
        }, Il = void 0 && (void 0).__generator || function (t, e) {
            var n, o, r, i, a = {
                label: 0, sent: function () {
                    if (1 & r[0]) throw r[1];
                    return r[1]
                }, trys: [], ops: []
            };
            return i = {
                next: s(0),
                throw: s(1),
                return: s(2)
            }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
                return this
            }), i;

            function s(s) {
                return function (l) {
                    return function (s) {
                        if (n) throw new TypeError("Generator is already executing.");
                        for (; i && (i = 0, s[0] && (a = 0)), a;) try {
                            if (n = 1, o && (r = 2 & s[0] ? o["return"] : s[0] ? o["throw"] || ((r = o["return"]) && r.call(o), 0) : o.next) && !(r = r.call(o, s[1])).done) return r;
                            switch (o = 0, r && (s = [2 & s[0], r.value]), s[0]) {
                                case 0:
                                case 1:
                                    r = s;
                                    break;
                                case 4:
                                    return a.label++, {value: s[1], done: !1};
                                case 5:
                                    a.label++, o = s[1], s = [0];
                                    continue;
                                case 7:
                                    s = a.ops.pop(), a.trys.pop();
                                    continue;
                                default:
                                    if (!(r = a.trys, (r = r.length > 0 && r[r.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
                                        a = 0;
                                        continue
                                    }
                                    if (3 === s[0] && (!r || s[1] > r[0] && s[1] < r[3])) {
                                        a.label = s[1];
                                        break
                                    }
                                    if (6 === s[0] && a.label < r[1]) {
                                        a.label = r[1], r = s;
                                        break
                                    }
                                    if (r && a.label < r[2]) {
                                        a.label = r[2], a.ops.push(s);
                                        break
                                    }
                                    r[2] && a.ops.pop(), a.trys.pop();
                                    continue
                            }
                            s = e.call(t, a)
                        } catch (t) {
                            s = [6, t], o = 0
                        } finally {
                            n = r = 0
                        }
                        if (5 & s[0]) throw s[1];
                        return {value: s[0] ? s[1] : void 0, done: !0}
                    }([s, l])
                }
            }
        };
        const Nl = function () {
            function t() {
            }

            return t.prototype.store = function (t) {
                return Ll(this, arguments, void 0, (function (t, e) {
                    return void 0 === e && (e = {}), Il(this, (function (n) {
                        return this.hasLocal(e, !0) && localStorage.setItem(e.key, JSON.stringify(t)), [2, t]
                    }))
                }))
            }, t.prototype.load = function () {
                return Ll(this, arguments, void 0, (function (t) {
                    var e;
                    return void 0 === t && (t = {}), Il(this, (function (n) {
                        return e = {}, this.hasLocal(t, !0) && (e = JSON.parse(localStorage.getItem(t.key) || '{}')), [2, e]
                    }))
                }))
            }, t.prototype.hasLocal = function (t, n) {
                if (void 0 === t && (t = {}), t.checkLocal && (!(0, e.hasWin)() || !localStorage)) {
                    if (n) throw new Error('localStorage not available');
                    return !1
                }
                return !0
            }, t
        }();

        function Rl(t) {
            return Rl = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
                return typeof t
            } : function (t) {
                return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
            }, Rl(t)
        }

        const Vl = function (t) {
            var e = this.constructor;
            return this.then((function (n) {
                return e.resolve(t()).then((function () {
                    return n
                }))
            }), (function (n) {
                return e.resolve(t()).then((function () {
                    return e.reject(n)
                }))
            }))
        };
        const Fl = function (t) {
            return new this((function (e, n) {
                if (!t || void 0 === t.length) return n(new TypeError(Rl(t) + ' ' + t + ' is not iterable(cannot read property Symbol(Symbol.iterator))'));
                var o = Array.prototype.slice.call(t);
                if (0 === o.length) return e([]);
                var r = o.length;

                function i(t, n) {
                    if (n && ('object' === Rl(n) || 'function' == typeof n)) {
                        var a = n.then;
                        if ('function' == typeof a) return void a.call(n, (function (e) {
                            i(t, e)
                        }), (function (n) {
                            o[t] = {status: 'rejected', reason: n}, 0 == --r && e(o)
                        }))
                    }
                    o[t] = {status: 'fulfilled', value: n}, 0 == --r && e(o)
                }

                for (var a = 0; a < o.length; a++) i(a, o[a])
            }))
        };

        function Hl(t, e) {
            this.name = 'AggregateError', this.errors = t, this.message = e || ''
        }

        Hl.prototype = Error.prototype;
        const Ul = function (t) {
            var e = this;
            return new e((function (n, o) {
                if (!t || void 0 === t.length) return o(new TypeError('Promise.any accepts an array'));
                var r = Array.prototype.slice.call(t);
                if (0 === r.length) return o();
                for (var i = [], a = 0; a < r.length; a++) try {
                    e.resolve(r[a]).then(n).catch((function (t) {
                        i.push(t), i.length === r.length && o(new Hl(i, 'All promises were rejected'))
                    }))
                } catch (t) {
                    o(t)
                }
            }))
        };
        var zl = setTimeout;

        function Bl(t) {
            return Boolean(t && void 0 !== t.length)
        }

        function Wl() {
        }

        function $l(t) {
            if (!(this instanceof $l)) throw new TypeError('Promises must be constructed via new');
            if ('function' != typeof t) throw new TypeError('not a function');
            this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], Jl(t, this)
        }

        function ql(t, e) {
            for (; 3 === t._state;) t = t._value;
            0 !== t._state ? (t._handled = !0, $l._immediateFn((function () {
                var n = 1 === t._state ? e.onFulfilled : e.onRejected;
                if (null !== n) {
                    var o;
                    try {
                        o = n(t._value)
                    } catch (t) {
                        return void Kl(e.promise, t)
                    }
                    Gl(e.promise, o)
                } else (1 === t._state ? Gl : Kl)(e.promise, t._value)
            }))) : t._deferreds.push(e)
        }

        function Gl(t, e) {
            try {
                if (e === t) throw new TypeError('A promise cannot be resolved with itself.');
                if (e && ('object' === Rl(e) || 'function' == typeof e)) {
                    var n = e.then;
                    if (e instanceof $l) return t._state = 3, t._value = e, void Yl(t);
                    if ('function' == typeof n) return void Jl((o = n, r = e, function () {
                        o.apply(r, arguments)
                    }), t)
                }
                t._state = 1, t._value = e, Yl(t)
            } catch (e) {
                Kl(t, e)
            }
            var o, r
        }

        function Kl(t, e) {
            t._state = 2, t._value = e, Yl(t)
        }

        function Yl(t) {
            2 === t._state && 0 === t._deferreds.length && $l._immediateFn((function () {
                t._handled || $l._unhandledRejectionFn(t._value)
            }));
            for (var e = 0, n = t._deferreds.length; e < n; e++) ql(t, t._deferreds[e]);
            t._deferreds = null
        }

        function Xl(t, e, n) {
            this.onFulfilled = 'function' == typeof t ? t : null, this.onRejected = 'function' == typeof e ? e : null, this.promise = n
        }

        function Jl(t, e) {
            var n = !1;
            try {
                t((function (t) {
                    n || (n = !0, Gl(e, t))
                }), (function (t) {
                    n || (n = !0, Kl(e, t))
                }))
            } catch (t) {
                if (n) return;
                n = !0, Kl(e, t)
            }
        }

        $l.prototype['catch'] = function (t) {
            return this.then(null, t)
        }, $l.prototype.then = function (t, e) {
            var n = new this.constructor(Wl);
            return ql(this, new Xl(t, e, n)), n
        }, $l.prototype['finally'] = Vl, $l.all = function (t) {
            return new $l((function (e, n) {
                if (!Bl(t)) return n(new TypeError('Promise.all accepts an array'));
                var o = Array.prototype.slice.call(t);
                if (0 === o.length) return e([]);
                var r = o.length;

                function i(t, a) {
                    try {
                        if (a && ('object' === Rl(a) || 'function' == typeof a)) {
                            var s = a.then;
                            if ('function' == typeof s) return void s.call(a, (function (e) {
                                i(t, e)
                            }), n)
                        }
                        o[t] = a, 0 == --r && e(o)
                    } catch (t) {
                        n(t)
                    }
                }

                for (var a = 0; a < o.length; a++) i(a, o[a])
            }))
        }, $l.any = Ul, $l.allSettled = Fl, $l.resolve = function (t) {
            return t && 'object' === Rl(t) && t.constructor === $l ? t : new $l((function (e) {
                e(t)
            }))
        }, $l.reject = function (t) {
            return new $l((function (e, n) {
                n(t)
            }))
        }, $l.race = function (t) {
            return new $l((function (e, n) {
                if (!Bl(t)) return n(new TypeError('Promise.race accepts an array'));
                for (var o = 0, r = t.length; o < r; o++) $l.resolve(t[o]).then(e, n)
            }))
        }, $l._immediateFn = 'function' == typeof setImmediate && function (t) {
            setImmediate(t)
        } || function (t) {
            zl(t, 0)
        }, $l._unhandledRejectionFn = function (t) {
            'undefined' != typeof console && console && console.warn('Possible Unhandled Promise Rejection:', t)
        };
        const Zl = $l;
        (0, e.hasWin)() && (window.Promise = window.Promise || Zl);
        const Ql = 'function' == typeof fetch ? fetch.bind() : function (t, e) {
            return new Zl((function (n, o) {
                var r = new XMLHttpRequest;
                for (var i in r.open(e.method || 'get', t), r.withCredentials = 'include' == e.credentials, e.headers || {}) r.setRequestHeader(i, e.headers[i]);
                r.onload = function (t) {
                    return n({
                        status: r.status, statusText: r.statusText, text: function () {
                            return Zl.resolve(r.responseText)
                        }
                    })
                }, r.onerror = o, r.upload && e.onProgress && (r.upload.onprogress = e.onProgress), e.body ? r.send(e.body) : r.send()
            }))
        };
        var tc = void 0 && (void 0).__assign || function () {
            return tc = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, tc.apply(this, arguments)
        }, ec = void 0 && (void 0).__awaiter || function (t, e, n, o) {
            return new (n || (n = Promise))((function (r, i) {
                function a(t) {
                    try {
                        l(o.next(t))
                    } catch (t) {
                        i(t)
                    }
                }

                function s(t) {
                    try {
                        l(o["throw"](t))
                    } catch (t) {
                        i(t)
                    }
                }

                function l(t) {
                    var e;
                    t.done ? r(t.value) : (e = t.value, e instanceof n ? e : new n((function (t) {
                        t(e)
                    }))).then(a, s)
                }

                l((o = o.apply(t, e || [])).next())
            }))
        }, nc = void 0 && (void 0).__generator || function (t, e) {
            var n, o, r, i, a = {
                label: 0, sent: function () {
                    if (1 & r[0]) throw r[1];
                    return r[1]
                }, trys: [], ops: []
            };
            return i = {
                next: s(0),
                throw: s(1),
                return: s(2)
            }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
                return this
            }), i;

            function s(s) {
                return function (l) {
                    return function (s) {
                        if (n) throw new TypeError("Generator is already executing.");
                        for (; i && (i = 0, s[0] && (a = 0)), a;) try {
                            if (n = 1, o && (r = 2 & s[0] ? o["return"] : s[0] ? o["throw"] || ((r = o["return"]) && r.call(o), 0) : o.next) && !(r = r.call(o, s[1])).done) return r;
                            switch (o = 0, r && (s = [2 & s[0], r.value]), s[0]) {
                                case 0:
                                case 1:
                                    r = s;
                                    break;
                                case 4:
                                    return a.label++, {value: s[1], done: !1};
                                case 5:
                                    a.label++, o = s[1], s = [0];
                                    continue;
                                case 7:
                                    s = a.ops.pop(), a.trys.pop();
                                    continue;
                                default:
                                    if (!(r = a.trys, (r = r.length > 0 && r[r.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
                                        a = 0;
                                        continue
                                    }
                                    if (3 === s[0] && (!r || s[1] > r[0] && s[1] < r[3])) {
                                        a.label = s[1];
                                        break
                                    }
                                    if (6 === s[0] && a.label < r[1]) {
                                        a.label = r[1], r = s;
                                        break
                                    }
                                    if (r && a.label < r[2]) {
                                        a.label = r[2], a.ops.push(s);
                                        break
                                    }
                                    r[2] && a.ops.pop(), a.trys.pop();
                                    continue
                            }
                            s = e.call(t, a)
                        } catch (t) {
                            s = [6, t], o = 0
                        } finally {
                            n = r = 0
                        }
                        if (5 & s[0]) throw s[1];
                        return {value: s[0] ? s[1] : void 0, done: !0}
                    }([s, l])
                }
            }
        }, oc = function () {
            function e() {
            }

            return e.prototype.store = function (t) {
                return ec(this, arguments, void 0, (function (t, e) {
                    return void 0 === e && (e = {}), nc(this, (function (n) {
                        switch (n.label) {
                            case 0:
                                return [4, this.request(e.urlStore, this.__props(e, t), e)];
                            case 1:
                                return [2, n.sent()]
                        }
                    }))
                }))
            }, e.prototype.load = function () {
                return ec(this, arguments, void 0, (function (t) {
                    return void 0 === t && (t = {}), nc(this, (function (e) {
                        switch (e.label) {
                            case 0:
                                return [4, this.request(t.urlLoad, this.__props(t), t)];
                            case 1:
                                return [2, e.sent()]
                        }
                    }))
                }))
            }, e.prototype.request = function (e, n, o) {
                return void 0 === n && (n = {}), void 0 === o && (o = {}), Ql(e, n).then((function (t) {
                    var e = t.text();
                    return 1 == (t.status / 200 | 0) ? e : e.then(Promise.reject)
                })).then((function (e) {
                    var n = e && (0, t.isString)(e);
                    return o.contentTypeJson && n ? JSON.parse(e) : e
                }))
            }, e.prototype.__props = function (e, n) {
                void 0 === e && (e = {});
                var o, r = e.contentTypeJson, i = e.headers || {}, a = e.fetchOptions || {}, s = 'X-Requested-With',
                    l = 'Content-Type';
                if ((0, t.isUndefined)(i[s]) && (i[s] = 'XMLHttpRequest'), (0, t.isUndefined)(i[l]) && r && (i[l] = 'application/json; charset=utf-8'), n) if (r) o = JSON.stringify(n); else for (var c in o = new FormData, n) o.append(c, n[c]);
                var u = {method: o ? 'POST' : 'GET', credentials: e.credentials, headers: i, body: o};
                return tc(tc({}, u), (0, t.isFunction)(a) ? a(u) : a)
            }, e
        }();
        const rc = oc;
        var ic;
        !function (t) {
            t["start"] = "storage:start", t["startStore"] = "storage:start:store", t["startLoad"] = "storage:start:load", t["load"] = "storage:load", t["store"] = "storage:store", t["after"] = "storage:after", t["afterStore"] = "storage:after:store", t["afterLoad"] = "storage:after:load", t["end"] = "storage:end", t["endStore"] = "storage:end:store", t["endLoad"] = "storage:end:load", t["error"] = "storage:error", t["errorStore"] = "storage:error:store", t["errorLoad"] = "storage:error:load"
        }(ic || (ic = {}));
        const ac = ic;
        var sc = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), lc = void 0 && (void 0).__assign || function () {
            return lc = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, lc.apply(this, arguments)
        }, cc = void 0 && (void 0).__awaiter || function (t, e, n, o) {
            return new (n || (n = Promise))((function (r, i) {
                function a(t) {
                    try {
                        l(o.next(t))
                    } catch (t) {
                        i(t)
                    }
                }

                function s(t) {
                    try {
                        l(o["throw"](t))
                    } catch (t) {
                        i(t)
                    }
                }

                function l(t) {
                    var e;
                    t.done ? r(t.value) : (e = t.value, e instanceof n ? e : new n((function (t) {
                        t(e)
                    }))).then(a, s)
                }

                l((o = o.apply(t, e || [])).next())
            }))
        }, uc = void 0 && (void 0).__generator || function (t, e) {
            var n, o, r, i, a = {
                label: 0, sent: function () {
                    if (1 & r[0]) throw r[1];
                    return r[1]
                }, trys: [], ops: []
            };
            return i = {
                next: s(0),
                throw: s(1),
                return: s(2)
            }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
                return this
            }), i;

            function s(s) {
                return function (l) {
                    return function (s) {
                        if (n) throw new TypeError("Generator is already executing.");
                        for (; i && (i = 0, s[0] && (a = 0)), a;) try {
                            if (n = 1, o && (r = 2 & s[0] ? o["return"] : s[0] ? o["throw"] || ((r = o["return"]) && r.call(o), 0) : o.next) && !(r = r.call(o, s[1])).done) return r;
                            switch (o = 0, r && (s = [2 & s[0], r.value]), s[0]) {
                                case 0:
                                case 1:
                                    r = s;
                                    break;
                                case 4:
                                    return a.label++, {value: s[1], done: !1};
                                case 5:
                                    a.label++, o = s[1], s = [0];
                                    continue;
                                case 7:
                                    s = a.ops.pop(), a.trys.pop();
                                    continue;
                                default:
                                    if (!(r = a.trys, (r = r.length > 0 && r[r.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
                                        a = 0;
                                        continue
                                    }
                                    if (3 === s[0] && (!r || s[1] > r[0] && s[1] < r[3])) {
                                        a.label = s[1];
                                        break
                                    }
                                    if (6 === s[0] && a.label < r[1]) {
                                        a.label = r[1], r = s;
                                        break
                                    }
                                    if (r && a.label < r[2]) {
                                        a.label = r[2], a.ops.push(s);
                                        break
                                    }
                                    r[2] && a.ops.pop(), a.trys.pop();
                                    continue
                            }
                            s = e.call(t, a)
                        } catch (t) {
                            s = [6, t], o = 0
                        } finally {
                            n = r = 0
                        }
                        if (5 & s[0]) throw s[1];
                        return {value: s[0] ? s[1] : void 0, done: !0}
                    }([s, l])
                }
            }
        }, pc = 'local', dc = 'remote', fc = function (e) {
            function n(t) {
                var n = e.call(this, t, 'StorageManager', Dl()) || this;
                n.storages = {}, n.events = ac;
                var o = n.config;
                return o._disable && (o.type = void 0), n.storages = {}, n.add(pc, new Nl), n.add(dc, new rc), n.setCurrent(o.type), n
            }

            return sc(n, e), n.prototype.isAutosave = function () {
                return !!this.config.autosave
            }, n.prototype.setAutosave = function (t) {
                return this.config.autosave = !!t, this
            }, n.prototype.getStepsBeforeSave = function () {
                return this.config.stepsBeforeSave
            }, n.prototype.setStepsBeforeSave = function (t) {
                return this.config.stepsBeforeSave = t, this
            }, n.prototype.add = function (t, e) {
                return this.storages[t] = e, this
            }, n.prototype.get = function (t) {
                return this.storages[t]
            }, n.prototype.getStorages = function () {
                return this.storages
            }, n.prototype.getCurrent = function () {
                return this.config.currentStorage
            }, n.prototype.setCurrent = function (t) {
                return this.getConfig().currentStorage = t, this
            }, n.prototype.getCurrentStorage = function () {
                return this.get(this.getCurrent())
            }, n.prototype.getStorageOptions = function (t) {
                return this.getCurrentOptions(t)
            }, n.prototype.store = function (t) {
                return cc(this, arguments, void 0, (function (t, e) {
                    var n, o, r, i, a;
                    return void 0 === e && (e = {}), uc(this, (function (s) {
                        switch (s.label) {
                            case 0:
                                n = this.getCurrentStorage(), o = lc(lc({}, this.getCurrentOptions()), e), r = this.getRecoveryStorage(), i = this.getCurrentOptions(pc), s.label = 1;
                            case 1:
                                return s.trys.push([1, 5, , 9]), [4, this.__exec(n, o, t)];
                            case 2:
                                return s.sent(), r ? [4, this.__exec(r, i, {})] : [3, 4];
                            case 3:
                                s.sent(), s.label = 4;
                            case 4:
                                return [3, 9];
                            case 5:
                                return a = s.sent(), r ? [4, this.__exec(r, i, t)] : [3, 7];
                            case 6:
                                return s.sent(), [3, 8];
                            case 7:
                                throw a;
                            case 8:
                                return [3, 9];
                            case 9:
                                return [2, t]
                        }
                    }))
                }))
            }, n.prototype.load = function () {
                return cc(this, arguments, void 0, (function (e) {
                    var n, o, r, i, a;
                    return void 0 === e && (e = {}), uc(this, (function (s) {
                        switch (s.label) {
                            case 0:
                                return n = this.getCurrentStorage(), o = lc(lc({}, this.getCurrentOptions()), e), (r = this.getRecoveryStorage()) ? [4, this.__exec(r, this.getCurrentOptions(pc))] : [3, 5];
                            case 1:
                                if (a = s.sent(), (0, t.isEmpty)(a)) return [3, 5];
                                s.label = 2;
                            case 2:
                                return s.trys.push([2, 4, , 5]), [4, this.__askRecovery()];
                            case 3:
                                return s.sent(), i = a, [3, 5];
                            case 4:
                                return s.sent(), [3, 5];
                            case 5:
                                return i ? [3, 7] : [4, this.__exec(n, o)];
                            case 6:
                                i = s.sent(), s.label = 7;
                            case 7:
                                return [2, i || {}]
                        }
                    }))
                }))
            }, n.prototype.__askRecovery = function () {
                var e = this.em, n = this.getRecovery();
                return new Promise((function (o, r) {
                    (0, t.isFunction)(n) ? n(o, r, null == e ? void 0 : e.getEditor()) : confirm(null == e ? void 0 : e.t('storageManager.recover')) ? o(null) : r()
                }))
            }, n.prototype.getRecovery = function () {
                return this.config.recovery
            }, n.prototype.getRecoveryStorage = function () {
                return this.getRecovery() && this.getCurrent() === dc && this.get(pc)
            }, n.prototype.__exec = function (t, e, n) {
                return cc(this, void 0, void 0, (function () {
                    var o, r, i, a, s, l, c, u, p, d, f, h, v, g;
                    return uc(this, (function (y) {
                        switch (y.label) {
                            case 0:
                                if (o = n ? 'store' : 'load', r = this.getConfig(), i = r.onStore, a = r.onLoad, !t) return [2, n || {}];
                                this.onStart(o, n), y.label = 1;
                            case 1:
                                return y.trys.push([1, 14, , 15]), l = null === (g = this.em) || void 0 === g ? void 0 : g.getEditor(), c = void 0, n ? (p = i) ? [4, i(n, l)] : [3, 3] : [3, 7];
                            case 2:
                                p = y.sent(), y.label = 3;
                            case 3:
                                return u = p || n, (d = e.onStore) ? [4, e.onStore(u, l)] : [3, 5];
                            case 4:
                                d = y.sent(), y.label = 5;
                            case 5:
                                return u = d || u, [4, t.store(u, e)];
                            case 6:
                                return c = y.sent(), s = n, [3, 13];
                            case 7:
                                return [4, t.load(e)];
                            case 8:
                                return c = y.sent(), s = this.__clearKeys(c), (f = e.onLoad) ? [4, e.onLoad(s, l)] : [3, 10];
                            case 9:
                                f = y.sent(), y.label = 10;
                            case 10:
                                return s = f || s, (h = a) ? [4, a(s, l)] : [3, 12];
                            case 11:
                                h = y.sent(), y.label = 12;
                            case 12:
                                s = h || s, y.label = 13;
                            case 13:
                                return this.onAfter(o, s, c), this.onEnd(o, s, c), [3, 15];
                            case 14:
                                throw v = y.sent(), this.onError(o, v), v;
                            case 15:
                                return [2, s]
                        }
                    }))
                }))
            }, n.prototype.__clearKeys = function (t) {
                void 0 === t && (t = {});
                var e = this.getConfig(), n = new RegExp("^".concat(e.id)), o = {};
                for (var r in t) {
                    o[r.replace(n, '')] = t[r]
                }
                return o
            }, n.prototype.getCurrentOptions = function (t) {
                var e = this.getConfig(), n = t || this.getCurrent();
                return e.options[n] || {}
            }, n.prototype.onStart = function (t, e) {
                var n = this.em;
                if (n) {
                    var o = 'load' === t ? ac.startLoad : ac.startStore;
                    n.trigger(ac.start, t, e), n.trigger(o, e)
                }
            }, n.prototype.onAfter = function (t, e, n) {
                var o = this.em;
                if (o) {
                    var r = 'load' === t ? ac.afterLoad : ac.afterStore;
                    o.trigger(ac.after), o.trigger(r, e, n);
                    var i = 'load' === t ? ac.load : ac.store;
                    o.trigger(i, e, n)
                }
            }, n.prototype.onEnd = function (t, e, n) {
                var o = this.em;
                if (o) {
                    var r = 'load' === t ? ac.endLoad : ac.endStore;
                    o.trigger(ac.end, t, e, n), o.trigger(r, e, n)
                }
            }, n.prototype.onError = function (t, e) {
                var n = this.em;
                if (n) {
                    var o = 'load' === t ? ac.errorLoad : ac.errorStore;
                    n.trigger(ac.error, e, t), n.trigger(o, e), this.onEnd(t, e)
                }
            }, n.prototype.canAutoload = function () {
                return !!this.getCurrentStorage() && !!this.config.autoload
            }, n.prototype.destroy = function () {
                this.storages = {}
            }, n
        }(m);
        const hc = fc;
        const vc = function () {
            return {stylePrefix: 'trt-', appendTo: '', optionsTarget: [{value: !1}, {value: '_blank'}], custom: !1}
        };
        var gc = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), yc = void 0 && (void 0).__assign || function () {
            return yc = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, yc.apply(this, arguments)
        }, mc = function (n) {
            function o(t) {
                void 0 === t && (t = {});
                var e = n.call(this, t) || this;
                e.events = {}, e.appendInput = !0;
                var o = t.config, r = void 0 === o ? {} : o, i = e, a = i.model, s = i.eventCapture, l = a.target,
                    c = a.attributes.type;
                return e.config = r, e.em = r.em, e.pfx = r.stylePrefix || '', e.ppfx = r.pStylePrefix || '', e.target = l, e.className = e.pfx + 'trait', e.clsField = "".concat(e.ppfx, "field ").concat(e.ppfx, "field-").concat(c), [['change:value', e.onValueChange], ['remove', e.removeView]].forEach((function (t) {
                    var n = t[0], o = t[1];
                    a.off(n, o), e.listenTo(a, n, o)
                })), a.view = e, e.listenTo(a, 'change:label', e.render), e.listenTo(a, 'change:placeholder', e.rerender), e.events = {}, s.forEach((function (t) {
                    return e.events[t] = 'onChange'
                })), e.delegateEvents(), e.init(), e
            }

            return gc(o, n), o.prototype.attributes = function () {
                return this.model.get('attributes') || {}
            }, o.prototype.templateLabel = function (t) {
                var e = this.ppfx, n = this.getLabel();
                return "<div class=\"".concat(e, "label\" title=\"").concat(n, "\">").concat(n, "</div>")
            }, o.prototype.templateInput = function (t) {
                var e = this.clsField;
                return "<div class=\"".concat(e, "\" data-input></div>")
            }, o.prototype.getClbOpts = function () {
                return {component: this.target, trait: this.model, elInput: this.getInputElem()}
            }, o.prototype.removeView = function () {
                this.remove(), this.removed()
            }, o.prototype.init = function () {
            }, o.prototype.removed = function () {
            }, o.prototype.onRender = function (t) {
            }, o.prototype.onUpdate = function (t) {
            }, o.prototype.onEvent = function (t) {
            }, o.prototype.onChange = function (e) {
                var n = this.getInputElem();
                n && !(0, t.isUndefined)(n.value) && this.model.set('value', n.value), this.onEvent(yc(yc({}, this.getClbOpts()), {event: e}))
            }, o.prototype.getValueForTarget = function () {
                return this.model.get('value')
            }, o.prototype.setInputValue = function (t) {
                var e = this.getInputElem();
                e && (e.value = t)
            }, o.prototype.onValueChange = function (t, e, n) {
                void 0 === n && (n = {});
                var o = this.model, r = this.getValueForTarget();
                n.fromTarget ? (this.setInputValue(r), this.postUpdate()) : o.setValue(r, n)
            }, o.prototype.renderLabel = function () {
                var t = this.$el, e = this.target, n = this.getLabel(), o = this.templateLabel(e);
                this.createLabel && (o = this.createLabel({
                    label: n,
                    component: e,
                    trait: this
                }) || ''), t.find('[data-label]').append(o)
            }, o.prototype.getLabel = function () {
                var t = this.em, n = this.model.attributes, o = n.label, r = n.name;
                return t.t("traitManager.traits.labels.".concat(r)) || (0, e.capitalize)(o || r).replace(/-/g, ' ')
            }, o.prototype.getComponent = function () {
                return this.target
            }, o.prototype.getInputEl = function () {
                if (!this.$input) {
                    var e = this.em, n = this.model, o = n, r = n.attributes.name,
                        i = o.get('placeholder') || o.get('default') || '', a = o.get('type') || 'text',
                        s = o.get('min'), c = o.get('max'), u = this.getModelValue(),
                        p = (0, l["default"])("<input type=\"".concat(a, "\">")),
                        d = e.t("traitManager.traits.attributes.".concat(r)) || {};
                    p.attr(yc({placeholder: i}, d)), (0, t.isUndefined)(u) || (o.set({value: u}, {silent: !0}), p.prop('value', u)), s && p.prop('min', s), c && p.prop('max', c), this.$input = p
                }
                return this.$input.get(0)
            }, o.prototype.getInputElem = function () {
                var t = this.input, e = this.$input;
                return t || e && e.get && e.get(0) || this.getElInput()
            }, o.prototype.getModelValue = function () {
                return this.model.getValue()
            }, o.prototype.getElInput = function () {
                return this.elInput
            }, o.prototype.renderField = function () {
                var e = this, n = e.$el, o = e.appendInput, r = e.model, i = n.find('[data-input]'),
                    a = i[i.length - 1], s = r.el;
                s || (s = this.createInput ? this.createInput(this.getClbOpts()) : this.getInputEl()), (0, t.isString)(s) ? (a.innerHTML = s, this.elInput = a.firstChild) : (o ? a.appendChild(s) : a.insertBefore(s, a.firstChild), this.elInput = s), r.el = this.elInput
            }, o.prototype.hasLabel = function () {
                var t = this.model.attributes.label;
                return !this.noLabel && !1 !== t
            }, o.prototype.rerender = function () {
                delete this.model.el, this.render()
            }, o.prototype.postUpdate = function () {
                this.onUpdate(this.getClbOpts())
            }, o.prototype.render = function () {
                var e = this, n = e.$el, o = e.pfx, r = e.ppfx, i = e.model.attributes, a = i.type, s = i.id,
                    l = this.hasLabel && this.hasLabel(), c = "".concat(o, "trait");
                delete this.$input;
                var u = "<div class=\"".concat(c, " ").concat(c, "--").concat(a, "\">\n      ").concat(l ? "<div class=\"".concat(r, "label-wrp\" data-label></div>") : '', "\n      <div class=\"").concat(r, "field-wrp ").concat(r, "field-wrp--").concat(a, "\" data-input>\n        ").concat(this.templateInput ? (0, t.isFunction)(this.templateInput) ? this.templateInput(this.getClbOpts()) : this.templateInput : '', "\n      </div>\n    </div>");
                return n.empty().append(u), l && this.renderLabel(), this.renderField(), this.el.className = "".concat(c, "__wrp ").concat(c, "__wrp-").concat(s), this.postUpdate(), this.onRender(this.getClbOpts()), this
            }, o
        }(u.Ss);
        const bc = mc;
        mc.prototype.eventCapture = ['change'];
        var _c = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), wc = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return _c(e, t), e.prototype.templateInput = function () {
                return ''
            }, e.prototype.onChange = function () {
                this.handleClick()
            }, e.prototype.handleClick = function () {
                this.model.runCommand()
            }, e.prototype.renderLabel = function () {
                this.model.get('label') && bc.prototype.renderLabel.apply(this)
            }, e.prototype.getInputEl = function () {
                var t = this.model, e = this.ppfx, n = t.props(), o = n.labelButton, r = n.text, i = n.full, a = o || r,
                    s = "".concat(e, "btn");
                return "<button type=\"button\" class=\"".concat(s, "-prim").concat(i ? " ".concat(s, "--full") : '', "\">").concat(a, "</button>")
            }, e
        }(bc);
        const xc = wc;
        wc.prototype.eventCapture = ['click button'];
        var Cc = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Sc = function (e) {
            function n() {
                var t = null !== e && e.apply(this, arguments) || this;
                return t.appendInput = !1, t
            }

            return Cc(n, e), n.prototype.templateInput = function () {
                var t = this.ppfx, e = this.clsField;
                return "<label class=\"".concat(e, "\" data-input>\n    <i class=\"").concat(t, "chk-icon\"></i>\n  </label>")
            }, n.prototype.onChange = function () {
                this.model.set('value', this.getInputElem().checked)
            }, n.prototype.setInputValue = function (t) {
                var e = this.getInputElem();
                e && (e.checked = !!t)
            }, n.prototype.getInputEl = function () {
                for (var e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
                var o = !this.$input, r = bc.prototype.getInputEl.apply(this, e);
                if (o) {
                    var i = void 0, a = void 0, s = this.model, l = this.target, c = s.attributes.valueFalse,
                        u = s.getName();
                    s.changeProp ? a = i = l.get(u) : i = !(!(a = l.get('attributes')[u]) && '' !== a), (0, t.isUndefined)(c) || a !== c || (i = !1), r.checked = i
                }
                return r
            }, n
        }(bc);
        var Oc = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Tc = function (t) {
            function e(e) {
                void 0 === e && (e = {});
                var n = t.call(this, e) || this, o = e.ppfx || '';
                return n.opts = e, n.ppfx = o, n.em = e.target || {}, !e.onChange && n.listenTo(n.model, 'change:value', n.handleModelChange), n
            }

            return Oc(e, t), e.prototype.template = function () {
                return "<span class=\"".concat(this.holderClass(), "\"></span>")
            }, e.prototype.inputClass = function () {
                return "".concat(this.ppfx, "field")
            }, e.prototype.holderClass = function () {
                return "".concat(this.ppfx, "input-holder")
            }, e.prototype.elementUpdated = function () {
                this.model.trigger('el:change')
            }, e.prototype.setValue = function (t, e) {
                var n = this.model, o = t || n.get('defaults'), r = this.getInputEl();
                r && (r.value = o)
            }, e.prototype.handleModelChange = function (t, e, n) {
                this.setValue(e, n)
            }, e.prototype.handleChange = function (t) {
                t.stopPropagation();
                var e = this.getInputEl().value;
                this.__onInputChange(e), this.elementUpdated()
            }, e.prototype.__onInputChange = function (t) {
                this.model.set({value: t}, {fromInput: 1})
            }, e.prototype.getInputEl = function () {
                if (!this.inputEl) {
                    var t = this.model, e = this.opts.type || 'text',
                        n = t.get('placeholder') || t.get('defaults') || t.get('default') || '';
                    this.inputEl = (0, l["default"])("<input type=\"".concat(e, "\" placeholder=\"").concat(n, "\">"))
                }
                return this.inputEl.get(0)
            }, e.prototype.render = function () {
                this.inputEl = null;
                var t = this.$el;
                return t.addClass(this.inputClass()), t.html(this.template()), t.find(".".concat(this.holderClass())).append(this.getInputEl()), this
            }, e
        }(u.Ss);
        const Pc = Tc;
        Tc.prototype.events = {change: 'handleChange'};
        var Ec = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), kc = void 0 && (void 0).__assign || function () {
            return kc = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, kc.apply(this, arguments)
        };
        l["default"] && function (t, n) {
            if ((0, e.hasWin)()) {
                var o = {
                        beforeShow: P,
                        move: P,
                        change: P,
                        show: P,
                        hide: P,
                        color: !1,
                        flat: !1,
                        showInput: !1,
                        allowEmpty: !1,
                        showButtons: !0,
                        clickoutFiresChange: !0,
                        showInitial: !1,
                        showPalette: !1,
                        showPaletteOnly: !1,
                        hideAfterPaletteSelect: !1,
                        togglePaletteOnly: !1,
                        showSelectionPalette: !0,
                        localStorageKey: !1,
                        appendTo: 'body',
                        maxSelectionSize: 7,
                        cancelText: 'cancel',
                        chooseText: 'choose',
                        togglePaletteMoreText: 'more',
                        togglePaletteLessText: 'less',
                        clearText: 'Clear Color Selection',
                        noColorSelectedText: 'No Color Selected',
                        preferredFormat: !1,
                        className: '',
                        containerClassName: '',
                        replacerClassName: '',
                        showAlpha: !1,
                        theme: 'sp-light',
                        palette: [['#ffffff', '#000000', '#ff0000', '#ff8000', '#ffff00', '#008000', '#0000ff', '#4b0082', '#9400d3']],
                        selectionPalette: [],
                        disabled: !1,
                        offset: null
                    }, r = [], i = !!/msie/i.exec(window.navigator.userAgent), a = function () {
                        function t(t, e) {
                            return !!~('' + t).indexOf(e)
                        }

                        var e = document.createElement('div').style;
                        return e.cssText = 'background-color:rgba(0,0,0,.5)', t(e.backgroundColor, 'rgba') || t(e.backgroundColor, 'hsla')
                    }(),
                    s = ["<div class='sp-replacer'>", "<div class='sp-preview'><div class='sp-preview-inner'></div></div>", "<div class='sp-dd'>&#9660;</div>", '</div>'].join(''),
                    l = function () {
                        var t = '';
                        if (i) for (var e = 1; e <= 6; e++) t += "<div class='sp-" + e + "'></div>";
                        return ["<div class='sp-container sp-hidden'>", "<div class='sp-palette-container'>", "<div class='sp-palette sp-thumb sp-cf'></div>", "<div class='sp-palette-button-container sp-cf'>", "<button type='button' class='sp-palette-toggle'></button>", '</div>', '</div>', "<div class='sp-picker-container'>", "<div class='sp-top sp-cf'>", "<div class='sp-fill'></div>", "<div class='sp-top-inner'>", "<div class='sp-color'>", "<div class='sp-sat'>", "<div class='sp-val'>", "<div class='sp-dragger'></div>", '</div>', '</div>', '</div>', "<div class='sp-clear sp-clear-display'>", '</div>', "<div class='sp-hue'>", "<div class='sp-slider'></div>", t, '</div>', '</div>', "<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>", '</div>', "<div class='sp-input-container sp-cf'>", "<input class='sp-input' type='text' spellcheck='false'  />", '</div>', "<div class='sp-initial sp-thumb sp-cf'></div>", "<div class='sp-button-container sp-cf'>", "<a class='sp-cancel' href='#'></a>", "<button type='button' class='sp-choose'></button>", '</div>', '</div>', '</div>'].join('')
                    }(), c = 'spectrum.id';
                t.fn.spectrum = function (e, n) {
                    if ('string' == typeof e) {
                        var o = this, i = Array.prototype.slice.call(arguments, 1);
                        return this.each((function () {
                            var n = r[t(this).data(c)];
                            if (n) {
                                var a = n[e];
                                if (!a) throw new Error("Spectrum: no such method: '" + e + "'");
                                'get' == e ? o = n.get() : 'container' == e ? o = n.container : 'option' == e ? o = n.option.apply(n, i) : 'destroy' == e ? (n.destroy(), t(this).removeData(c)) : a.apply(n, i)
                            }
                        })), o
                    }
                    return this.spectrum('destroy').each((function () {
                        var n = T(this, t.extend({}, e, t(this).data()));
                        t(this).data(c, n.id)
                    }))
                }, t.fn.spectrum.load = !0, t.fn.spectrum.loadOpts = {}, t.fn.spectrum.draggable = A, t.fn.spectrum.defaults = o, t.fn.spectrum.inputTypeColorSupport = function e() {
                    if (void 0 === e._cachedResult) {
                        var n = t("<input type='color'/>")[0];
                        e._cachedResult = 'color' === n.type && '' !== n.value
                    }
                    return e._cachedResult
                }, t.spectrum = {}, t.spectrum.localization = {}, t.spectrum.palettes = {}, t.fn.spectrum.processNativeColorInputs = function () {
                    var e = t('input[type=color]');
                    e.length && !j() && e.spectrum({preferredFormat: 'hex6'})
                };
                var u = /^[\s,#]+/, p = /\s+$/, d = 0, f = Math, h = f.round, v = f.min, g = f.max, y = f.random,
                    m = function (t, e) {
                        if (e = e || {}, (t = t || '') instanceof m) return t;
                        if (!(this instanceof m)) return new m(t, e);
                        var n = function (t) {
                            var e = {r: 0, g: 0, b: 0}, n = 1, o = !1, r = !1;
                            'string' == typeof t && (t = function (t) {
                                t = t.replace(u, '').replace(p, '').toLowerCase();
                                var e, n = !1;
                                if (x[t]) t = x[t], n = !0; else if ('transparent' == t) return {
                                    r: 0,
                                    g: 0,
                                    b: 0,
                                    a: 0,
                                    format: 'name'
                                };
                                if (e = S.rgb.exec(t)) return {r: e[1], g: e[2], b: e[3]};
                                if (e = S.rgba.exec(t)) return {r: e[1], g: e[2], b: e[3], a: e[4]};
                                if (e = S.hsl.exec(t)) return {h: e[1], s: e[2], l: e[3]};
                                if (e = S.hsla.exec(t)) return {h: e[1], s: e[2], l: e[3], a: e[4]};
                                if (e = S.hsv.exec(t)) return {h: e[1], s: e[2], v: e[3]};
                                if (e = S.hsva.exec(t)) return {h: e[1], s: e[2], v: e[3], a: e[4]};
                                if (e = S.hex8.exec(t)) return {
                                    a: et(e[1]),
                                    r: Z(e[2]),
                                    g: Z(e[3]),
                                    b: Z(e[4]),
                                    format: n ? 'name' : 'hex8'
                                };
                                if (e = S.hex6.exec(t)) return {
                                    r: Z(e[1]),
                                    g: Z(e[2]),
                                    b: Z(e[3]),
                                    format: n ? 'name' : 'hex'
                                };
                                if (e = S.hex3.exec(t)) return {
                                    r: Z(e[1] + '' + e[1]),
                                    g: Z(e[2] + '' + e[2]),
                                    b: Z(e[3] + '' + e[3]),
                                    format: n ? 'name' : 'hex'
                                };
                                return !1
                            }(t));
                            'object' == typeof t && (t.hasOwnProperty('r') && t.hasOwnProperty('g') && t.hasOwnProperty('b') ? (i = t.r, a = t.g, s = t.b, e = {
                                r: 255 * X(i, 255),
                                g: 255 * X(a, 255),
                                b: 255 * X(s, 255)
                            }, o = !0, r = '%' === String(t.r).substr(-1) ? 'prgb' : 'rgb') : t.hasOwnProperty('h') && t.hasOwnProperty('s') && t.hasOwnProperty('v') ? (t.s = tt(t.s), t.v = tt(t.v), e = function (t, e, n) {
                                t = 6 * X(t, 360), e = X(e, 100), n = X(n, 100);
                                var o = f.floor(t), r = t - o, i = n * (1 - e), a = n * (1 - r * e),
                                    s = n * (1 - (1 - r) * e), l = o % 6, c = [n, a, i, i, s, n][l],
                                    u = [s, n, n, a, i, i][l], p = [i, i, s, n, n, a][l];
                                return {r: 255 * c, g: 255 * u, b: 255 * p}
                            }(t.h, t.s, t.v), o = !0, r = 'hsv') : t.hasOwnProperty('h') && t.hasOwnProperty('s') && t.hasOwnProperty('l') && (t.s = tt(t.s), t.l = tt(t.l), e = function (t, e, n) {
                                var o, r, i;

                                function a(t, e, n) {
                                    return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + 6 * (e - t) * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t
                                }

                                if (t = X(t, 360), e = X(e, 100), n = X(n, 100), 0 === e) o = r = i = n; else {
                                    var s = n < .5 ? n * (1 + e) : n + e - n * e, l = 2 * n - s;
                                    o = a(l, s, t + 1 / 3), r = a(l, s, t), i = a(l, s, t - 1 / 3)
                                }
                                return {r: 255 * o, g: 255 * r, b: 255 * i}
                            }(t.h, t.s, t.l), o = !0, r = 'hsl'), t.hasOwnProperty('a') && (n = t.a));
                            var i, a, s;
                            return n = Y(n), {
                                ok: o,
                                format: t.format || r,
                                r: v(255, g(e.r, 0)),
                                g: v(255, g(e.g, 0)),
                                b: v(255, g(e.b, 0)),
                                a: n
                            }
                        }(t);
                        this._originalInput = t, this._r = n.r, this._g = n.g, this._b = n.b, this._a = n.a, this._roundA = h(100 * this._a) / 100, this._format = e.format || n.format, this._gradientType = e.gradientType, this._r < 1 && (this._r = h(this._r)), this._g < 1 && (this._g = h(this._g)), this._b < 1 && (this._b = h(this._b)), this._ok = n.ok, this._tc_id = d++
                    };
                m.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 t = this.toRgb();
                        return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3
                    }, setAlpha: function (t) {
                        return this._a = Y(t), this._roundA = h(100 * this._a) / 100, this
                    }, toHsv: function () {
                        var t = D(this._r, this._g, this._b);
                        return {h: 360 * t.h, s: t.s, v: t.v, a: this._a}
                    }, toHsvString: function () {
                        var t = D(this._r, this._g, this._b), e = h(360 * t.h), n = h(100 * t.s), o = h(100 * t.v);
                        return 1 == this._a ? 'hsv(' + e + ', ' + n + '%, ' + o + '%)' : 'hsva(' + e + ', ' + n + '%, ' + o + '%, ' + this._roundA + ')'
                    }, toHsl: function () {
                        var t = M(this._r, this._g, this._b);
                        return {h: 360 * t.h, s: t.s, l: t.l, a: this._a}
                    }, toHslString: function () {
                        var t = M(this._r, this._g, this._b), e = h(360 * t.h), n = h(100 * t.s), o = h(100 * t.l);
                        return 1 == this._a ? 'hsl(' + e + ', ' + n + '%, ' + o + '%)' : 'hsla(' + e + ', ' + n + '%, ' + o + '%, ' + this._roundA + ')'
                    }, toHex: function (t) {
                        return L(this._r, this._g, this._b, t)
                    }, toHexString: function (t) {
                        return '#' + this.toHex(t)
                    }, toHex8: function () {
                        return I(this._r, this._g, this._b, this._a)
                    }, toHex8String: function () {
                        return '#' + this.toHex8()
                    }, toRgb: function () {
                        return {r: h(this._r), g: h(this._g), b: h(this._b), a: this._a}
                    }, toRgbString: function () {
                        return 1 == this._a ? 'rgb(' + h(this._r) + ', ' + h(this._g) + ', ' + h(this._b) + ')' : 'rgba(' + h(this._r) + ', ' + h(this._g) + ', ' + h(this._b) + ', ' + this._roundA + ')'
                    }, toPercentageRgb: function () {
                        return {
                            r: h(100 * X(this._r, 255)) + '%',
                            g: h(100 * X(this._g, 255)) + '%',
                            b: h(100 * X(this._b, 255)) + '%',
                            a: this._a
                        }
                    }, toPercentageRgbString: function () {
                        return 1 == this._a ? 'rgb(' + h(100 * X(this._r, 255)) + '%, ' + h(100 * X(this._g, 255)) + '%, ' + h(100 * X(this._b, 255)) + '%)' : 'rgba(' + h(100 * X(this._r, 255)) + '%, ' + h(100 * X(this._g, 255)) + '%, ' + h(100 * X(this._b, 255)) + '%, ' + this._roundA + ')'
                    }, toName: function () {
                        return 0 === this._a ? 'transparent' : !(this._a < 1) && (C[L(this._r, this._g, this._b, !0)] || !1)
                    }, toFilter: function (t) {
                        var e = '#' + I(this._r, this._g, this._b, this._a), n = e,
                            o = this._gradientType ? 'GradientType = 1, ' : '';
                        t && (n = m(t).toHex8String());
                        return 'progid:DXImageTransform.Microsoft.gradient(' + o + 'startColorstr=' + e + ',endColorstr=' + n + ')'
                    }, toString: function (t) {
                        var e = !!t;
                        t = t || this._format;
                        var n = !1, o = this._a < 1 && this._a >= 0;
                        return e || !o || 'hex' !== t && 'hex6' !== t && 'hex3' !== t && 'name' !== t ? ('rgb' === t && (n = this.toRgbString()), 'prgb' === t && (n = this.toPercentageRgbString()), 'hex' !== t && 'hex6' !== t || (n = this.toHexString()), 'hex3' === t && (n = this.toHexString(!0)), 'hex8' === t && (n = this.toHex8String()), 'name' === t && (n = this.toName()), 'hsl' === t && (n = this.toHslString()), 'hsv' === t && (n = this.toHsvString()), n || this.toHexString()) : 'name' === t && 0 === this._a ? this.toName() : this.toRgbString()
                    }, _applyModification: function (t, e) {
                        var n = t.apply(null, [this].concat([].slice.call(e)));
                        return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this
                    }, lighten: function () {
                        return this._applyModification(F, arguments)
                    }, brighten: function () {
                        return this._applyModification(H, arguments)
                    }, darken: function () {
                        return this._applyModification(U, arguments)
                    }, desaturate: function () {
                        return this._applyModification(N, arguments)
                    }, saturate: function () {
                        return this._applyModification(R, arguments)
                    }, greyscale: function () {
                        return this._applyModification(V, arguments)
                    }, spin: function () {
                        return this._applyModification(z, arguments)
                    }, _applyCombination: function (t, e) {
                        return t.apply(null, [this].concat([].slice.call(e)))
                    }, analogous: function () {
                        return this._applyCombination(G, arguments)
                    }, complement: function () {
                        return this._applyCombination(B, arguments)
                    }, monochromatic: function () {
                        return this._applyCombination(K, arguments)
                    }, splitcomplement: function () {
                        return this._applyCombination(q, arguments)
                    }, triad: function () {
                        return this._applyCombination(W, arguments)
                    }, tetrad: function () {
                        return this._applyCombination($, arguments)
                    }
                }, m.fromRatio = function (t, e) {
                    if ('object' == typeof t) {
                        var n = {};
                        for (var o in t) t.hasOwnProperty(o) && (n[o] = 'a' === o ? t[o] : tt(t[o]));
                        t = n
                    }
                    return m(t, e)
                }, m.equals = function (t, e) {
                    return !(!t || !e) && m(t).toRgbString() == m(e).toRgbString()
                }, m.random = function () {
                    return m.fromRatio({r: y(), g: y(), b: y()})
                }, m.mix = function (t, e, n) {
                    n = 0 === n ? 0 : n || 50;
                    var o, r = m(t).toRgb(), i = m(e).toRgb(), a = n / 100, s = 2 * a - 1, l = i.a - r.a,
                        c = 1 - (o = ((o = s * l == -1 ? s : (s + l) / (1 + s * l)) + 1) / 2), u = {
                            r: i.r * o + r.r * c,
                            g: i.g * o + r.g * c,
                            b: i.b * o + r.b * c,
                            a: i.a * a + r.a * (1 - a)
                        };
                    return m(u)
                }, m.readability = function (t, e) {
                    var n = m(t), o = m(e), r = n.toRgb(), i = o.toRgb(), a = n.getBrightness(), s = o.getBrightness(),
                        l = Math.max(r.r, i.r) - Math.min(r.r, i.r) + Math.max(r.g, i.g) - Math.min(r.g, i.g) + Math.max(r.b, i.b) - Math.min(r.b, i.b);
                    return {brightness: Math.abs(a - s), color: l}
                }, m.isReadable = function (t, e) {
                    var n = m.readability(t, e);
                    return n.brightness > 125 && n.color > 500
                }, m.mostReadable = function (t, e) {
                    for (var n = null, o = 0, r = !1, i = 0; i < e.length; i++) {
                        var a = m.readability(t, e[i]), s = a.brightness > 125 && a.color > 500,
                            l = 3 * (a.brightness / 125) + a.color / 500;
                        (s && !r || s && r && l > o || !s && !r && l > o) && (r = s, o = l, n = m(e[i]))
                    }
                    return n
                };
                var b, _, w, x = m.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'
                    }, C = m.hexNames = function (t) {
                        var e = {};
                        for (var n in t) t.hasOwnProperty(n) && (e[t[n]] = n);
                        return e
                    }(x),
                    S = (_ = '[\\s|\\(]+(' + (b = '(?:' + '[-\\+]?\\d*\\.\\d+%?' + ')|(?:' + '[-\\+]?\\d+%?' + ')') + ')[,|\\s]+(' + b + ')[,|\\s]+(' + b + ')\\s*\\)?', w = '[\\s|\\(]+(' + b + ')[,|\\s]+(' + b + ')[,|\\s]+(' + b + ')[,|\\s]+(' + b + ')\\s*\\)?', {
                        rgb: new RegExp('rgb' + _),
                        rgba: new RegExp('rgba' + w),
                        hsl: new RegExp('hsl' + _),
                        hsla: new RegExp('hsla' + w),
                        hsv: new RegExp('hsv' + _),
                        hsva: new RegExp('hsva' + w),
                        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 = m, t((function () {
                    t.fn.spectrum.load && t.fn.spectrum.processNativeColorInputs()
                }))
            }

            function O(e, n, o, r) {
                for (var i = [], s = 0; s < e.length; s++) {
                    var l = e[s];
                    if (l) {
                        var c = m(l), u = c.toHsl().l < .5 ? 'sp-thumb-el sp-thumb-dark' : 'sp-thumb-el sp-thumb-light';
                        u += m.equals(n, l) ? ' sp-thumb-active' : '';
                        var p = c.toString(r.preferredFormat || 'rgb'),
                            d = a ? 'background-color:' + c.toRgbString() : 'filter:' + c.toFilter();
                        i.push('<span title="' + p + '" data-color="' + c.toRgbString() + '" class="' + u + '"><span class="sp-thumb-inner" style="' + d + ';"></span></span>')
                    } else {
                        i.push(t('<div />').append(t('<span data-color="" style="background-color:transparent;" class="' + 'sp-clear-display' + '"></span>').attr('title', r.noColorSelectedText)).html())
                    }
                }
                return "<div class='sp-cf " + o + "'>" + i.join('') + '</div>'
            }

            function T(e, c) {
                var u, p, d, f, h = function (e, n) {
                        var r = t.extend({}, o, e);
                        return r.callbacks = {
                            move: k(r.move, n),
                            change: k(r.change, n),
                            show: k(r.show, n),
                            hide: k(r.hide, n),
                            beforeShow: k(r.beforeShow, n)
                        }, r
                    }(c, e), v = h.flat, g = h.showSelectionPalette, y = h.localStorageKey, b = h.theme, _ = h.callbacks,
                    w = (u = $t, p = 10, function () {
                        var t = this, e = arguments, n = function () {
                            f = null, u.apply(t, e)
                        };
                        d && clearTimeout(f), !d && f || (f = setTimeout(n, p))
                    }), x = !1, C = !1, S = !0, T = 0, P = 0, M = 0, D = 0, L = 0, I = 0, N = 0, R = 0, V = 0, F = 0,
                    H = 1, U = [], z = [], B = {}, W = h.selectionPalette.slice(0), $ = h.maxSelectionSize,
                    q = 'sp-dragging', G = null, K = e.ownerDocument, Y = (K.body, t(e)), X = !1,
                    J = t(l, K).addClass(b), Z = J.find('.sp-picker-container'), Q = J.find('.sp-color'),
                    tt = J.find('.sp-dragger'), et = J.find('.sp-hue'), nt = J.find('.sp-slider'),
                    ot = J.find('.sp-alpha-inner'), rt = J.find('.sp-alpha'), it = J.find('.sp-alpha-handle'),
                    at = J.find('.sp-input'), st = J.find('.sp-palette'), lt = J.find('.sp-initial'),
                    ct = J.find('.sp-cancel'), ut = J.find('.sp-clear'), pt = J.find('.sp-choose'),
                    dt = J.find('.sp-palette-toggle'), ft = Y.is('input'), ht = ft && 'color' === Y.attr('type') && j(),
                    vt = ft && !v,
                    gt = vt ? t(s).addClass(b).addClass(h.className).addClass(h.replacerClassName) : t([]),
                    yt = vt ? gt : Y, mt = gt.find('.sp-preview-inner'), bt = h.color || ft && Y.val(), _t = !1,
                    wt = h.preferredFormat, xt = !h.showButtons || h.clickoutFiresChange, Ct = !bt,
                    St = h.allowEmpty && !ht;

                function Ot() {
                    if (h.showPaletteOnly && (h.showPalette = !0), dt.text(h.showPaletteOnly ? h.togglePaletteMoreText : h.togglePaletteLessText), h.palette) {
                        U = h.palette.slice(0), z = t.isArray(U[0]) ? U : [U], B = {};
                        for (var e = 0; e < z.length; e++) for (var n = 0; n < z[e].length; n++) {
                            var o = m(z[e][n]).toRgbString();
                            B[o] = !0
                        }
                    }
                    J.toggleClass('sp-flat', v), J.toggleClass('sp-input-disabled', !h.showInput), J.toggleClass('sp-alpha-enabled', h.showAlpha), J.toggleClass('sp-clear-enabled', St), J.toggleClass('sp-buttons-disabled', !h.showButtons), J.toggleClass('sp-palette-buttons-disabled', !h.togglePaletteOnly), J.toggleClass('sp-palette-disabled', !h.showPalette), J.toggleClass('sp-palette-only', h.showPaletteOnly), J.toggleClass('sp-initial-disabled', !h.showInitial), J.addClass(h.className).addClass(h.containerClassName), $t()
                }

                function Tt() {
                    if (y && window.localStorage) {
                        try {
                            var e = window.localStorage[y].split(',#');
                            e.length > 1 && (delete window.localStorage[y], t.each(e, (function (t, e) {
                                Pt(e)
                            })))
                        } catch (t) {
                        }
                        try {
                            W = window.localStorage[y].split(';')
                        } catch (t) {
                        }
                    }
                }

                function Pt(e) {
                    if (g) {
                        var n = m(e).toRgbString();
                        if (!B[n] && -1 === t.inArray(n, W)) for (W.push(n); W.length > $;) W.shift();
                        if (y && window.localStorage) try {
                            window.localStorage[y] = W.join(';')
                        } catch (t) {
                        }
                    }
                }

                function Et() {
                    var e = Ht(), n = t.map(z, (function (t, n) {
                        return O(t, e, 'sp-palette-row sp-palette-row-' + n, h)
                    }));
                    Tt(), W && n.push(O(function () {
                        var t = [];
                        if (h.showPalette) for (var e = 0; e < W.length; e++) {
                            var n = m(W[e]).toRgbString();
                            B[n] || t.push(W[e])
                        }
                        return t.reverse().slice(0, h.maxSelectionSize)
                    }(), e, 'sp-palette-row sp-palette-row-selection', h)), st.html(n.join(''))
                }

                function kt() {
                    if (h.showInitial) {
                        var t = _t, e = Ht();
                        lt.html(O([t, e], e, 'sp-palette-row-initial', h))
                    }
                }

                function At() {
                    (P <= 0 || T <= 0 || D <= 0) && $t(), C = !0, J.addClass(q), G = null, Y.trigger('dragstart.spectrum', [Ht()])
                }

                function jt() {
                    C = !1, J.removeClass(q), Y.trigger('dragstop.spectrum', [Ht()])
                }

                function Mt() {
                    var t = at.val();
                    if (null !== t && '' !== t || !St) {
                        var e = m(t);
                        e.isValid() ? (Ft(e), Wt(!0)) : at.addClass('sp-validation-error')
                    } else Ft(null), Wt(!0)
                }

                function Dt() {
                    x ? Rt() : Lt()
                }

                function Lt() {
                    var e = t.Event('beforeShow.spectrum');
                    if (x) $t(); else if (Y.trigger('beforeShow.spectrum', [Ht()]), !1 !== _.beforeShow(Ht()) && !e.isDefaultPrevented()) {
                        !function () {
                            for (var t = 0; t < r.length; t++) r[t] && r[t].hide()
                        }(), x = !0;
                        var n = t(K);
                        n.bind('keydown.spectrum', It), n.bind('click.spectrum', Nt), t(window).bind('resize.spectrum', w), gt.addClass('sp-active'), J.removeClass('sp-hidden'), $t(), zt(), _t = Ht(), kt(), _.show(_t), Y.trigger('show.spectrum', [_t])
                    }
                }

                function It(t) {
                    27 === t.keyCode && Rt()
                }

                function Nt(t) {
                    2 != t.button && (C || (xt ? Wt(!0) : Vt(), Rt()))
                }

                function Rt() {
                    x && !v && (x = !1, t(K).unbind('keydown.spectrum', It), t(K).unbind('click.spectrum', Nt), t(window).unbind('resize.spectrum', w), gt.removeClass('sp-active'), J.addClass('sp-hidden'), _.hide(Ht()), Y.trigger('hide.spectrum', [Ht()]))
                }

                function Vt() {
                    Ft(_t, !0)
                }

                function Ft(t, e) {
                    var n, o;
                    m.equals(t, Ht()) ? zt() : (!t && St ? Ct = !0 : (Ct = !1, S = !t, o = (n = m(t)).toHsv(), R = o.h % 360 / 360, V = o.s, F = o.v, H = o.a), zt(), n && n.isValid() && !e && (wt = h.preferredFormat || n.getFormat()))
                }

                function Ht(t) {
                    return t = t || {}, St && Ct ? null : m.fromRatio({
                        h: R,
                        s: V,
                        v: F,
                        a: Math.round(100 * H) / 100
                    }, {format: t.format || wt})
                }

                function Ut() {
                    zt(), _.move(Ht()), Y.trigger('move.spectrum', [Ht()])
                }

                function zt() {
                    at.removeClass('sp-validation-error'), Bt();
                    var t = m.fromRatio({h: R, s: 1, v: 1});
                    Q.css('background-color', t.toHexString());
                    var e = wt;
                    H < 1 && (0 !== H || 'name' !== e) && ('hex' !== e && 'hex3' !== e && 'hex6' !== e && 'name' !== e || (e = 'rgb'));
                    var n = Ht({format: e}), o = '';
                    if (mt.removeClass('sp-clear-display'), mt.css('background-color', 'transparent'), !n && St) mt.addClass('sp-clear-display'); else {
                        var r = n.toHexString(), s = n.toRgbString();
                        if (a || 1 === n.alpha ? mt.css('background-color', s) : (mt.css('background-color', 'transparent'), mt.css('filter', n.toFilter())), h.showAlpha) {
                            var l = n.toRgb();
                            l.a = 0;
                            var c = m(l).toRgbString(), u = 'linear-gradient(left, ' + c + ', ' + r + ')';
                            i ? ot.css('filter', m(c).toFilter({gradientType: 1}, r)) : (ot.css('background', '-webkit-' + u), ot.css('background', '-moz-' + u), ot.css('background', '-ms-' + u), ot.css('background', 'linear-gradient(to right, ' + c + ', ' + r + ')'))
                        }
                        o = n.toString(e)
                    }
                    h.showInput && at.val(o), h.showPalette && Et(), kt()
                }

                function Bt() {
                    var t = V, e = F;
                    if (St && Ct) it.hide(), nt.hide(), tt.hide(); else {
                        it.show(), nt.show(), tt.show();
                        var n = t * T, o = P - e * P;
                        n = Math.max(-M, Math.min(T - M, n - M)), o = Math.max(-M, Math.min(P - M, o - M)), tt.css({
                            top: o + 'px',
                            left: n + 'px'
                        });
                        var r = H * L;
                        it.css({left: r - I / 2 + 'px'});
                        var i = R * D;
                        nt.css({top: i - N + 'px'})
                    }
                }

                function Wt(t) {
                    var e = Ht(), n = '', o = !!S || !m.equals(e, _t);
                    e && (n = e.toString(wt), !x && Pt(e)), ft && Y.val(n), t && o && (_.change(e), Y.trigger('change', [e]))
                }

                function $t() {
                    x && (T = Q.width(), P = Q.height(), M = tt.height(), et.width(), D = et.height(), N = nt.height(), L = rt.width(), I = it.width(), v || (J.css('position', 'absolute'), h.offset ? J.offset(h.offset) : J.offset(function (t, e) {
                        var n = e[0], o = t[0], r = o.parentElement, i = n.getBoundingClientRect(), a = o.offsetWidth,
                            s = o.offsetHeight, l = {top: 0, left: 0, width: n.offsetWidth, height: n.offsetHeight};
                        for (; n && (l.top += n.offsetTop - n.scrollTop, l.left += n.offsetLeft - n.scrollLeft, n !== r && r.contains(n.offsetParent));) n = n.offsetParent;
                        i.right + a > window.innerWidth - window.scrollX && i.right - a > 0 && (l.left -= a - l.width);
                        i.bottom + s < window.innerHeight - window.scrollY ? l.top += l.height : l.top -= s;
                        return l
                    }(J, yt))), Bt(), h.showPalette && Et(), Y.trigger('reflow.spectrum'))
                }

                function qt() {
                    Rt(), X = !0, Y.attr('disabled', !0), yt.addClass('sp-disabled')
                }

                !function () {
                    if (i && J.find('*:not(input)').attr('unselectable', 'on'), Ot(), vt && Y.after(gt).hide(), St || ut.hide(), v) Y.after(J).hide(); else {
                        var e = 'parent' === h.appendTo ? Y.parent() : t(h.appendTo);
                        1 !== e.length && (e = t('body')), e.append(J)
                    }

                    function n(e) {
                        return e.data && e.data.ignore ? (Ft(t(e.target).closest('.sp-thumb-el').data('color')), Ut()) : (Ft(t(e.target).closest('.sp-thumb-el').data('color')), Ut(), h.hideAfterPaletteSelect && (Wt(!0), Rt())), !1
                    }

                    Tt(), yt.bind('click.spectrum touchstart.spectrum', (function (e) {
                        X || Dt(), e.stopPropagation(), t(e.target).is('input') || e.preventDefault()
                    })), (Y.is(':disabled') || !0 === h.disabled) && qt(), J.click(E), at.change(Mt), at.bind('paste', (function () {
                        setTimeout(Mt, 1)
                    })), at.keydown((function (t) {
                        13 == t.keyCode && Mt()
                    })), ct.text(h.cancelText), ct.bind('click.spectrum', (function (t) {
                        t.stopPropagation(), t.preventDefault(), Vt(), Rt()
                    })), ut.attr('title', h.clearText), ut.bind('click.spectrum', (function (t) {
                        t.stopPropagation(), t.preventDefault(), Ct = !0, Ut(), v && Wt(!0)
                    })), pt.text(h.chooseText), pt.bind('click.spectrum', (function (t) {
                        t.stopPropagation(), t.preventDefault(), i && at.is(':focus') && at.trigger('change'), at.hasClass('sp-validation-error') || (Wt(!0), Rt())
                    })), dt.text(h.showPaletteOnly ? h.togglePaletteMoreText : h.togglePaletteLessText), dt.bind('click.spectrum', (function (t) {
                        t.stopPropagation(), t.preventDefault(), h.showPaletteOnly = !h.showPaletteOnly, h.showPaletteOnly || v || J.css('left', '-=' + (Z.outerWidth(!0) + 5)), Ot()
                    })), A(rt, (function (t, e, n) {
                        H = t / L, Ct = !1, n.shiftKey && (H = Math.round(10 * H) / 10), Ut()
                    }), At, jt), A(et, (function (t, e) {
                        R = parseFloat(e / D), Ct = !1, h.showAlpha || (H = 1), Ut()
                    }), At, jt), A(Q, (function (t, e, n) {
                        if (n.shiftKey) {
                            if (!G) {
                                var o = V * T, r = P - F * P, i = Math.abs(t - o) > Math.abs(e - r);
                                G = i ? 'x' : 'y'
                            }
                        } else G = null;
                        var a = !G || 'y' === G;
                        (!G || 'x' === G) && (V = parseFloat(t / T)), a && (F = parseFloat((P - e) / P)), Ct = !1, h.showAlpha || (H = 1), Ut()
                    }), At, jt), bt ? (Ft(bt), zt(), wt = h.preferredFormat || m(bt).getFormat(), Pt(bt)) : zt(), v && Lt();
                    var o = i ? 'mousedown.spectrum' : 'click.spectrum touchstart.spectrum';
                    st.delegate('.sp-thumb-el', o, n), lt.delegate('.sp-thumb-el:nth-child(1)', o, {ignore: !0}, n)
                }();
                var Gt = {
                    show: Lt, hide: Rt, toggle: Dt, reflow: $t, option: function (e, o) {
                        return e === n ? t.extend({}, h) : o === n ? h[e] : (h[e] = o, 'preferredFormat' === e && (wt = h.preferredFormat), void Ot())
                    }, enable: function () {
                        X = !1, Y.attr('disabled', !1), yt.removeClass('sp-disabled')
                    }, disable: qt, offset: function (t) {
                        h.offset = t, $t()
                    }, set: function (t) {
                        Ft(t), Wt()
                    }, get: Ht, destroy: function () {
                        Y.show(), yt.unbind('click.spectrum touchstart.spectrum'), J.remove(), gt.remove(), r[Gt.id] = null
                    }, container: J
                };
                return Gt.id = r.push(Gt) - 1, Gt
            }

            function P() {
            }

            function E(t) {
                t.stopPropagation()
            }

            function k(t, e) {
                var n = Array.prototype.slice, o = n.call(arguments, 2);
                return function () {
                    return t.apply(e, o.concat(n.call(arguments)))
                }
            }

            function A(e, n, o, r) {
                n = n || function () {
                }, o = o || function () {
                }, r = r || function () {
                };
                var a = document, s = !1, l = {}, c = 0, u = 0, p = 'ontouchstart' in window, d = {};

                function f(t) {
                    t.stopPropagation && t.stopPropagation(), t.preventDefault && t.preventDefault(), t.returnValue = !1
                }

                function h(t) {
                    if (s) {
                        if (i && a.documentMode < 9 && !t.button) return v();
                        var o = t && t.touches && t.touches[0], r = o && o.pageX || t.pageX,
                            d = o && o.pageY || t.pageY, h = Math.max(0, Math.min(r - l.left, u)),
                            g = Math.max(0, Math.min(d - l.top, c));
                        p && f(t), n.apply(e, [h, g, t])
                    }
                }

                function v() {
                    s && (t(a).unbind(d), t(a.body).removeClass('sp-dragging'), setTimeout((function () {
                        r.apply(e, arguments)
                    }), 0)), s = !1
                }

                d['selectstart'] = f, d['dragstart'] = f, d['touchmove mousemove'] = h, d['touchend mouseup'] = v, t(e).bind('touchstart mousedown', (function (n) {
                    (n.which ? 3 == n.which : 2 == n.button) || s || !1 !== o.apply(e, arguments) && (s = !0, c = t(e).height(), u = t(e).width(), l = t(e).offset(), t(a).bind(d), t(a.body).addClass('sp-dragging'), h(n), f(n))
                }))
            }

            function j() {
                return t.fn.spectrum.inputTypeColorSupport()
            }

            function M(t, e, n) {
                t = X(t, 255), e = X(e, 255), n = X(n, 255);
                var o, r, i = g(t, e, n), a = v(t, e, n), s = (i + a) / 2;
                if (i == a) o = r = 0; else {
                    var l = i - a;
                    switch (r = s > .5 ? l / (2 - i - a) : l / (i + a), i) {
                        case t:
                            o = (e - n) / l + (e < n ? 6 : 0);
                            break;
                        case e:
                            o = (n - t) / l + 2;
                            break;
                        case n:
                            o = (t - e) / l + 4
                    }
                    o /= 6
                }
                return {h: o, s: r, l: s}
            }

            function D(t, e, n) {
                t = X(t, 255), e = X(e, 255), n = X(n, 255);
                var o, r, i = g(t, e, n), a = v(t, e, n), s = i, l = i - a;
                if (r = 0 === i ? 0 : l / i, i == a) o = 0; else {
                    switch (i) {
                        case t:
                            o = (e - n) / l + (e < n ? 6 : 0);
                            break;
                        case e:
                            o = (n - t) / l + 2;
                            break;
                        case n:
                            o = (t - e) / l + 4
                    }
                    o /= 6
                }
                return {h: o, s: r, v: s}
            }

            function L(t, e, n, o) {
                var r = [Q(h(t).toString(16)), Q(h(e).toString(16)), Q(h(n).toString(16))];
                return o && r[0].charAt(0) == r[0].charAt(1) && r[1].charAt(0) == r[1].charAt(1) && r[2].charAt(0) == r[2].charAt(1) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) : r.join('')
            }

            function I(t, e, n, o) {
                var r;
                return [Q((r = o, Math.round(255 * parseFloat(r)).toString(16))), Q(h(t).toString(16)), Q(h(e).toString(16)), Q(h(n).toString(16))].join('')
            }

            function N(t, e) {
                e = 0 === e ? 0 : e || 10;
                var n = m(t).toHsl();
                return n.s -= e / 100, n.s = J(n.s), m(n)
            }

            function R(t, e) {
                e = 0 === e ? 0 : e || 10;
                var n = m(t).toHsl();
                return n.s += e / 100, n.s = J(n.s), m(n)
            }

            function V(t) {
                return m(t).desaturate(100)
            }

            function F(t, e) {
                e = 0 === e ? 0 : e || 10;
                var n = m(t).toHsl();
                return n.l += e / 100, n.l = J(n.l), m(n)
            }

            function H(t, e) {
                e = 0 === e ? 0 : e || 10;
                var n = m(t).toRgb();
                return n.r = g(0, v(255, n.r - h(255 * (-e / 100)))), n.g = g(0, v(255, n.g - h(255 * (-e / 100)))), n.b = g(0, v(255, n.b - h(255 * (-e / 100)))), m(n)
            }

            function U(t, e) {
                e = 0 === e ? 0 : e || 10;
                var n = m(t).toHsl();
                return n.l -= e / 100, n.l = J(n.l), m(n)
            }

            function z(t, e) {
                var n = m(t).toHsl(), o = (h(n.h) + e) % 360;
                return n.h = o < 0 ? 360 + o : o, m(n)
            }

            function B(t) {
                var e = m(t).toHsl();
                return e.h = (e.h + 180) % 360, m(e)
            }

            function W(t) {
                var e = m(t).toHsl(), n = e.h;
                return [m(t), m({h: (n + 120) % 360, s: e.s, l: e.l}), m({h: (n + 240) % 360, s: e.s, l: e.l})]
            }

            function $(t) {
                var e = m(t).toHsl(), n = e.h;
                return [m(t), m({h: (n + 90) % 360, s: e.s, l: e.l}), m({
                    h: (n + 180) % 360,
                    s: e.s,
                    l: e.l
                }), m({h: (n + 270) % 360, s: e.s, l: e.l})]
            }

            function q(t) {
                var e = m(t).toHsl(), n = e.h;
                return [m(t), m({h: (n + 72) % 360, s: e.s, l: e.l}), m({h: (n + 216) % 360, s: e.s, l: e.l})]
            }

            function G(t, e, n) {
                e = e || 6, n = n || 30;
                var o = m(t).toHsl(), r = 360 / n, i = [m(t)];
                for (o.h = (o.h - (r * e >> 1) + 720) % 360; --e;) o.h = (o.h + r) % 360, i.push(m(o));
                return i
            }

            function K(t, e) {
                e = e || 6;
                for (var n = m(t).toHsv(), o = n.h, r = n.s, i = n.v, a = [], s = 1 / e; e--;) a.push(m({
                    h: o,
                    s: r,
                    v: i
                })), i = (i + s) % 1;
                return a
            }

            function Y(t) {
                return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t
            }

            function X(t, e) {
                (function (t) {
                    return 'string' == typeof t && -1 != t.indexOf('.') && 1 === parseFloat(t)
                })(t) && (t = '100%');
                var n = function (t) {
                    return 'string' == typeof t && -1 != t.indexOf('%')
                }(t);
                return t = v(e, g(0, parseFloat(t))), n && (t = parseInt(t * e, 10) / 100), f.abs(t - e) < 1e-6 ? 1 : t % e / parseFloat(e)
            }

            function J(t) {
                return v(1, g(0, t))
            }

            function Z(t) {
                return parseInt(t, 16)
            }

            function Q(t) {
                return 1 == t.length ? '0' + t : '' + t
            }

            function tt(t) {
                return t <= 1 && (t = 100 * t + '%'), t
            }

            function et(t) {
                return Z(t) / 255
            }
        }(l["default"]);
        var Ac = function (t) {
            var e = 'name' === t.getFormat() && t.toName(), n = 1 == t.getAlpha() ? t.toHexString() : t.toRgbString();
            return e || n.replace(/ /g, '')
        }, jc = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return Ec(n, e), n.prototype.template = function () {
                var t = this.ppfx;
                return "\n      <div class=\"".concat(this.holderClass(), "\"></div>\n      <div class=\"").concat(t, "field-colorp\">\n        <div class=\"").concat(t, "field-colorp-c\" data-colorp-c>\n          <div class=\"").concat(t, "checker-bg\"></div>\n        </div>\n      </div>\n    ")
            }, n.prototype.inputClass = function () {
                var t = this.ppfx;
                return "".concat(t, "field ").concat(t, "field-color")
            }, n.prototype.holderClass = function () {
                return "".concat(this.ppfx, "input-holder")
            }, n.prototype.remove = function () {
                return e.prototype.remove.call(this), this.colorEl.spectrum('destroy'), this
            }, n.prototype.handleChange = function (e) {
                e.stopPropagation();
                var n = e.target.value;
                (0, t.isUndefined)(n) || this.__onInputChange(n)
            }, n.prototype.__onInputChange = function (t) {
                var e = this.model, n = this.opts.onChange, o = t, r = this.getColorEl();
                if (r) {
                    r.spectrum('set', o);
                    var i = r.spectrum('get'), a = o && Ac(i);
                    a && (o = a)
                }
                n ? n(o) : e.set({value: o}, {fromInput: 1})
            }, n.prototype.setValue = function (e, n) {
                void 0 === n && (n = {});
                var o = this.model, r = (0, t.isUndefined)(n.def) ? o.get('defaults') : n.def,
                    i = (0, t.isUndefined)(e) ? (0, t.isUndefined)(r) ? '' : r : e, a = this.getInputEl(),
                    s = this.getColorEl(), l = 'none' != i ? i : '';
                a.value = i, s.get(0).style.backgroundColor = l, (n.fromTarget || n.fromInput && !n.avoidStore) && (s.spectrum('set', l), this.noneColor = 'none' == i, this.movedColor = l)
            }, n.prototype.getColorEl = function () {
                var t = this;
                if (!this.colorEl) {
                    var e = this, n = e.em, o = e.model, r = e.opts, i = this.ppfx, a = r.onChange,
                        s = (0, l["default"])("<div class=\"".concat(this.ppfx, "field-color-picker\"></div>")),
                        c = s.get(0).style, u = n && n.getConfig && n.getConfig().colorPicker || {};
                    this.movedColor = '';
                    var p, d = !1;
                    this.$el.find('[data-colorp-c]').append(s);
                    var f = function (t, e) {
                        void 0 === e && (e = !0), a ? a(t, !e) : (e && o.setValueFromInput(0, !1), o.setValueFromInput(t, e))
                    };
                    s.spectrum(kc(kc(kc({
                        color: o.getValue() || !1,
                        containerClassName: "".concat(i, "one-bg ").concat(i, "two-color ").concat(i, "editor-sp"),
                        maxSelectionSize: 8,
                        showPalette: !0,
                        showAlpha: !0,
                        chooseText: 'Ok',
                        cancelText: '⨯',
                        palette: []
                    }, u), o.get('colorPicker') || {}), {
                        move: function (e) {
                            var n = Ac(e);
                            t.movedColor = n, c.backgroundColor = n, f(n, !1)
                        }, change: function (e) {
                            d = !0;
                            var n = Ac(e);
                            c.backgroundColor = n, f(n), t.noneColor = !1
                        }, show: function (e) {
                            d = !1, t.movedColor = '', p = a ? o.getValue({noDefault: !0}) : Ac(e)
                        }, hide: function () {
                            d || !p && !a || (t.noneColor && (p = ''), c.backgroundColor = p, s.spectrum('set', p), f(p, !1))
                        }
                    })), n && n.on && this.listenTo(n, 'component:selected', (function () {
                        t.movedColor && f(t.movedColor), d = !0, t.movedColor = '', s.spectrum('hide')
                    })), this.colorEl = s
                }
                return this.colorEl
            }, n.prototype.render = function () {
                return Pc.prototype.render.call(this), this.getColorEl(), this
            }, n
        }(Pc);
        const Mc = jc;
        var Dc = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Lc = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Dc(e, t), e.prototype.templateInput = function () {
                return ''
            }, e.prototype.getInputEl = function () {
                if (!this.input) {
                    var t = this.model, e = this.getModelValue(), n = new Mc({
                        model: t,
                        target: this.config.em,
                        contClass: this.ppfx + 'field-color',
                        ppfx: this.ppfx
                    }).render();
                    n.setValue(e, {fromTarget: 1}), this.input = n.el
                }
                return this.input
            }, e
        }(bc);
        var Ic = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Nc = function (e) {
            function n(n) {
                void 0 === n && (n = {});
                var o = e.call(this, n) || this;
                return (0, t.bindAll)(o, 'moveIncrement', 'upIncrement'), o.doc = document, o.listenTo(o.model, 'change:unit', o.handleModelChange), o
            }

            return Ic(n, e), n.prototype.template = function () {
                var t = this.ppfx;
                return "\n      <span class=\"".concat(t, "input-holder\"></span>\n      <span class=\"").concat(t, "field-units\"></span>\n      <div class=\"").concat(t, "field-arrows\" data-arrows>\n        <div class=\"").concat(t, "field-arrow-u\" data-arrow-up></div>\n        <div class=\"").concat(t, "field-arrow-d\" data-arrow-down></div>\n      </div>\n    ")
            }, n.prototype.inputClass = function () {
                var t = this.ppfx;
                return this.opts.contClass || "".concat(t, "field ").concat(t, "field-integer")
            }, n.prototype.setValue = function (t, e) {
                var n = e || {}, o = this.validateInputValue(t, {deepCheck: 1}), r = {value: o.value, unit: ''};
                (o.unit || o.force) && (r.unit = o.unit), this.model.set(r, n), n.silent && this.handleModelChange()
            }, n.prototype.handleChange = function (t) {
                t.stopPropagation(), this.setValue(this.getInputEl().value), this.elementUpdated()
            }, n.prototype.handleUnitChange = function (t) {
                t.stopPropagation();
                var e = this.getUnitEl().value;
                this.model.set('unit', e), this.elementUpdated()
            }, n.prototype.handleKeyDown = function (t) {
                'ArrowUp' === t.key && (t.preventDefault(), this.upArrowClick()), 'ArrowDown' === t.key && (t.preventDefault(), this.downArrowClick())
            }, n.prototype.elementUpdated = function () {
                this.model.trigger('el:change')
            }, n.prototype.handleModelChange = function () {
                var t = this.model;
                this.getInputEl().value = t.get('value');
                var e = this.getUnitEl();
                e && (e.value = t.get('unit') || '')
            }, n.prototype.getUnitEl = function () {
                if (!this.unitEl) {
                    var t = this.model, e = t.get('units') || [];
                    if (e.length) {
                        var n = ['<option value="" disabled hidden>-</option>'];
                        e.forEach((function (e) {
                            var o = e == t.get('unit') ? 'selected' : '';
                            n.push("<option ".concat(o, ">").concat(e, "</option>"))
                        }));
                        var o = document.createElement('div');
                        o.innerHTML = "<select class=\"".concat(this.ppfx, "input-unit\">").concat(n.join(''), "</select>"), this.unitEl = o.firstChild
                    }
                }
                return this.unitEl
            }, n.prototype.upArrowClick = function () {
                var t = this.model.get('step'), e = parseFloat(this.getInputEl().value);
                this.setValue(this.normalizeValue(e + t)), this.elementUpdated()
            }, n.prototype.downArrowClick = function () {
                var t = this.model.get('step'), e = parseFloat(this.getInputEl().value);
                this.setValue(this.normalizeValue(e - t)), this.elementUpdated()
            }, n.prototype.downIncrement = function (t) {
                t.preventDefault(), this.moved = !1;
                var e = this.model.get('value') || 0;
                e = this.normalizeValue(e), this.current = {
                    y: t.pageY,
                    val: e
                }, (0, Z.on)(this.doc, 'mousemove', this.moveIncrement), (0, Z.on)(this.doc, 'mouseup', this.upIncrement)
            }, n.prototype.moveIncrement = function (t) {
                this.moved = !0;
                var e = this.model, n = e.get('step'), o = this.current,
                    r = this.normalizeValue(o.val + (o.y - t.pageY) * n), i = this.validateInputValue(r), a = i.value,
                    s = i.unit;
                return this.prValue = a, e.set({value: a, unit: s}, {avoidStore: 1}), !1
            }, n.prototype.upIncrement = function () {
                var t = this.model, e = t.get('step');
                if ((0, Z.AU)(this.doc, 'mouseup', this.upIncrement), (0, Z.AU)(this.doc, 'mousemove', this.moveIncrement), this.prValue && this.moved) {
                    var n = this.prValue - e;
                    t.set('value', n, {avoidStore: 1}).set('value', n + e), this.elementUpdated()
                }
            }, n.prototype.normalizeValue = function (t, e) {
                void 0 === e && (e = 0);
                var n = this.model.get('step'), o = 0;
                if (isNaN(t)) return e;
                if (t = parseFloat(t), Math.floor(t) !== t) {
                    var r = n.toString().split('.')[1];
                    o = r ? r.length : 0
                }
                return o ? parseFloat(t.toFixed(o)) : t
            }, n.prototype.validateInputValue = function (e, n) {
                void 0 === n && (n = {});
                var o = 0, r = n || {}, i = this.model, a = '', s = (0, t.isUndefined)(e) ? a : e,
                    l = n.units || i.get('units') || [], c = i.get('unit') || l.length && l[0] || '',
                    u = (0, t.isUndefined)(n.max) ? i.get('max') : n.max,
                    p = (0, t.isUndefined)(n.min) ? i.get('min') : n.min, d = !!i.get('limitlessMax'),
                    f = !!i.get('limitlessMin');
                if (r.deepCheck) {
                    var h = i.get('fixedValues') || [];
                    if ('' === s && (c = ''), s) {
                        var v = new RegExp('^' + h.join('|'), 'g');
                        if (h.length && v.test(s)) s = s.match(v)[0], c = '', o = 1; else {
                            var g = s + '';
                            s += '', s = parseFloat(s.replace(',', '.')), s = isNaN(s) ? a : s;
                            var y = g.replace(s, '');
                            (0, t.indexOf)(l, y) >= 0 && (c = y)
                        }
                    }
                }
                return isNaN(s) || '' === s || (d || (0, t.isUndefined)(u) || '' === u || (s = s > u ? u : s), f || (0, t.isUndefined)(p) || '' === p || (s = s < p ? p : s)), {
                    force: o,
                    value: s,
                    unit: c
                }
            }, n.prototype.render = function () {
                Pc.prototype.render.call(this), this.unitEl = null;
                var t = this.getUnitEl();
                return t && this.$el.find(".".concat(this.ppfx, "field-units")).get(0).appendChild(t), this
            }, n
        }(Pc);
        const Rc = Nc;
        Nc.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 Vc = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Fc = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return Vc(n, e), n.prototype.getValueForTarget = function () {
                var e = this.model, n = e.attributes, o = n.value, r = n.unit;
                return (0, t.isUndefined)(o) || '' === o ? e.get('default') : o + r
            }, n.prototype.getInputEl = function () {
                if (!this.input) {
                    var t = this.ppfx, e = this.model, n = this.getModelValue(),
                        o = new Rc({contClass: "".concat(t, "field-int"), type: 'number', model: e, ppfx: t});
                    o.render(), this.$input = o.inputEl, this.$unit = o.unitEl, e.set('value', n, {fromTarget: !0}), this.$input.val(n), this.input = o.el
                }
                return this.input
            }, n
        }(bc);
        const Hc = Fc;
        var Uc = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const zc = function (e) {
            function n(t) {
                void 0 === t && (t = {});
                var n = e.call(this, t) || this;
                return n.listenTo(n.model, 'change:options', n.rerender), n
            }

            return Uc(n, e), n.prototype.templateInput = function () {
                var t = this.ppfx, e = this.clsField;
                return "<div class=\"".concat(e, "\">\n      <div data-input></div>\n      <div class=\"").concat(t, "sel-arrow\">\n        <div class=\"").concat(t, "d-s-arrow\"></div>\n      </div>\n    </div>")
            }, n.prototype.getInputEl = function () {
                if (!this.$input) {
                    var e = this.model, n = this.em, o = e.get('name'), r = e.get('options') || [], i = [],
                        a = '<select>';
                    r.forEach((function (e) {
                        var r, s, l, c = '';
                        (0, t.isString)(e) ? (r = e, s = e) : (r = e.name || e.label || e.value, s = "".concat((0, t.isUndefined)(e.value) ? e.id : e.value).replace(/"/g, '&quot;'), c += (l = e.style ? e.style.replace(/"/g, '&quot;') : '') ? " style=\"".concat(l, "\"") : '');
                        var u = n.t("traitManager.traits.options.".concat(o, ".").concat(s)) || r;
                        a += "<option value=\"".concat(s, "\"").concat(c, ">").concat(u, "</option>"), i.push(s)
                    })), a += '</select>', this.$input = (0, l["default"])(a);
                    var s = e.getTargetValue(), c = i.indexOf(s) >= 0 ? s : e.get('default');
                    !(0, t.isUndefined)(c) && this.$input.val(c)
                }
                return this.$input.get(0)
            }, n
        }(bc);
        var Bc = n(8242), Wc = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), $c = 'data-categories', qc = 'data-no-categories', Gc = function (t) {
            function e(e, n) {
                var o = t.call(this, e) || this;
                o.reuseView = !0, o.renderedCategories = new Map, o.itemsView = n;
                var r = e.config || {};
                o.config = r;
                var i = e.editor;
                o.em = i;
                var a = r.pStylePrefix || '';
                return o.ppfx = a, o.pfx = a + r.stylePrefix || '', o.className = "".concat(o.pfx, "traits"), o.traitContClass = "".concat(a, "traits-c"), o.classNoCat = "".concat(a, "traits-empty-c"), o.catsClass = "".concat(a, "trait-categories"), o.collection = new yn([], {em: i}), o.listenTo(i, 'component:toggled', o.updatedCollection), o.updatedCollection(), o
            }

            return Wc(e, t), e.prototype.updatedCollection = function () {
                var t = this.ppfx, e = this.em, n = e.getSelected();
                this.el.className = "".concat(this.traitContClass, "s ").concat(t, "one-bg ").concat(t, "two-color"), this.collection = (null == n ? void 0 : n.traits) || new yn([], {em: e}), this.render()
            }, e.prototype.add = function (t, e) {
                var n = this.config, o = this.renderedCategories, r = this.itemView, i = t.get(this.itemType);
                this.itemsView && this.itemsView[i] && (r = this.itemsView[i]);
                var a = new r({config: n, model: t, attributes: t.get('attributes')}).render().el,
                    s = t.parent.initCategory(t);
                if (s) {
                    var l = s.getId(), c = this.getCategoriesEl(), u = o.get(l);
                    return !u && c && (u = new gs({model: s}, n, 'trait').render(), o.set(l, u), c.appendChild(u.el)), void (null == u || u.append(a))
                }
                e ? e.appendChild(a) : this.append(a)
            }, e.prototype.getCategoriesEl = function () {
                return this.catsEl || (this.catsEl = this.el.querySelector("[".concat($c, "]"))), this.catsEl
            }, e.prototype.getTraitsEl = function () {
                return this.traitsEl || (this.traitsEl = this.el.querySelector("[".concat(qc, "]"))), this.traitsEl
            }, e.prototype.append = function (t) {
                var e = this.getTraitsEl();
                null == e || e.appendChild(t)
            }, e.prototype.render = function () {
                var t = this, e = this, n = e.el, o = e.ppfx, r = e.catsClass, i = e.traitContClass, a = e.classNoCat,
                    s = document.createDocumentFragment();
                delete this.catsEl, delete this.traitsEl, this.renderedCategories = new Map, n.innerHTML = "\n      <div class=\"".concat(r, "\" ").concat($c, "></div>\n      <div class=\"").concat(a, " ").concat(i, "\" ").concat(qc, "></div>\n    "), this.collection.forEach((function (e) {
                    return t.add(e, s)
                })), this.append(s);
                var l = "".concat(i, "s ").concat(o, "one-bg ").concat(o, "two-color");
                return this.$el.addClass(l), this.rendered = !0, this
            }, e
        }(Bc.A);
        const Kc = Gc;
        Gc.prototype.itemView = bc;
        var Yc = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Xc = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Jc = function (e) {
            function n(n) {
                var o = e.call(this, n, 'TraitManager', vc()) || this;
                o.TraitsView = Kc, o.events = sn, o.state = new u.Kx({traits: []}), o.types = {
                    text: bc,
                    number: Hc,
                    select: zc,
                    checkbox: Sc,
                    color: Lc,
                    button: xc
                };
                var r = o, i = r.state, a = r.config, s = r.events, l = a.pStylePrefix;
                l && (a.stylePrefix = "".concat(l).concat(a.stylePrefix)), (0, t.bindAll)(o, '__onSelect');
                var c = (0, t.debounce)((function () {
                    return o.__upSel()
                }), 0), p = (0, t.debounce)((function () {
                    return o.__onUp()
                }), 0);
                return i.listenTo(n, 'component:toggled', c), i.listenTo(n, s.value, p), i.on('change:traits', o.__onSelect), o.debounced = [c, p], o
            }

            return Yc(n, e), n.prototype.select = function (t) {
                var e = (null == t ? void 0 : t.getTraits()) || [];
                this.state.set({component: t, traits: e}), this.__trgCustom()
            }, n.prototype.getCategories = function () {
                var t, e = this.getComponent(),
                    n = (null === (t = null == e ? void 0 : e.traits.categories) || void 0 === t ? void 0 : t.models) || [];
                return Xc([], n, !0)
            }, n.prototype.getTraits = function () {
                return this.getCurrent()
            }, n.prototype.getTraitsByCategory = function (t) {
                return Qe(t || this.getTraits())
            }, n.prototype.getComponent = function () {
                return this.state.attributes.component
            }, n.prototype.addType = function (t, e) {
                var n = this.getType('text');
                this.types[t] = n.extend(e)
            }, n.prototype.getType = function (t) {
                return this.getTypes()[t]
            }, n.prototype.getTypes = function () {
                return this.types
            }, n.prototype.getTraitsViewer = function () {
                return this.view
            }, n.prototype.getCurrent = function () {
                return this.state.get('traits') || []
            }, n.prototype.render = function () {
                var t = this.view, e = this.em;
                return t = new Kc({
                    el: null == t ? void 0 : t.el,
                    collection: [],
                    editor: e,
                    config: this.getConfig()
                }, this.getTypes()), this.view = t, t.el
            }, n.prototype.postRender = function () {
                this.__appendTo()
            }, n.prototype.__onSelect = function () {
                var t = this, e = t.em, n = t.events, o = t.state.attributes, r = o.component, i = o.traits;
                e.trigger(n.select, {component: r, traits: i})
            }, n.prototype.__trgCustom = function (t) {
                void 0 === t && (t = {});
                var e = this, n = e.em, o = e.events, r = e.__ctn;
                this.__ctn = r || t.container, n.trigger(o.custom, this.__customData())
            }, n.prototype.__customData = function () {
                return {container: this.__ctn}
            }, n.prototype.__upSel = function () {
                this.select(this.em.getSelected())
            }, n.prototype.__onUp = function () {
                this.select(this.getComponent())
            }, n
        }(m);
        const Zc = Jc;
        const Qc = function () {
            return {
                stylePrefix: '',
                appendTo: '',
                sortable: !0,
                hidable: !0,
                hideTextnode: !0,
                root: '',
                showWrapper: !0,
                showHover: !0,
                scrollCanvas: {behavior: 'smooth', block: 'nearest'},
                scrollLayers: {behavior: 'auto', block: 'nearest'},
                highlightHover: !0,
                custom: !1,
                onInit: function () {
                },
                onRender: function () {
                },
                extend: {}
            }
        };
        var tu = n(6756), eu = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), nu = function (t) {
            function e() {
                var e = null !== t && t.apply(this, arguments) || this;
                return e._dropAreaConfig = {ratio: .4, minUndroppableDimension: 3, maxUndroppableDimension: 20}, e
            }

            return eu(e, t), Object.defineProperty(e.prototype, "view", {
                get: function () {
                    return this.model.viewLayer
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "element", {
                get: function () {
                    var t;
                    return null === (t = this.model.viewLayer) || void 0 === t ? void 0 : t.el
                }, enumerable: !1, configurable: !0
            }), e
        }(tu.h);
        const ou = nu;
        var ru = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), iu = function (e) {
            function n(t) {
                void 0 === t && (t = {});
                var n = e.call(this, t) || this;
                n.items = [], n.opt = t;
                var o = t.config || {};
                n.config = o, n.module = t.module, n.parentView = t.parentView;
                var r = o.stylePrefix || '', i = (o.pStylePrefix, n.collection);
                n.listenTo(i, 'add', n.addTo), n.listenTo(i, 'reset resetNavigator', n.render), n.listenTo(i, 'remove', n.removeChildren), n.className = "".concat(r, "layers");
                var a = o.em;
                if (o.sortable && !n.opt.sorter) {
                    var s = a.Utils, l = o.sortContainer || n.el, c = n.createPlaceholder(r);
                    n.opt.sorter = new s.ComponentSorter({
                        em: a,
                        treeClass: ou,
                        containerContext: {
                            container: l,
                            containerSel: ".".concat(n.className),
                            itemSel: ".".concat(r, "layer"),
                            pfx: o.pStylePrefix,
                            document,
                            placeholderElement: c
                        },
                        dragBehavior: {dragDirection: Hn.A.Vertical, nested: !0}
                    })
                }
                return n.$el.data('collection', i), t.parent && n.$el.data('model', t.parent), n
            }

            return ru(n, e), n.prototype.createPlaceholder = function (t) {
                var e = document.createElement('div'), n = document.createElement('div');
                return this.el.parentNode, e.className = t + 'placeholder', e.style.display = 'none', e.style.pointerEvents = 'none', n.className = t + 'placeholder-int', e.appendChild(n), e
            }, n.prototype.removeChildren = function (t) {
                var e = t.viewLayer;
                e && (e.remove(), delete t.viewLayer)
            }, n.prototype.addTo = function (t) {
                this.addToCollection(t, null, this.collection.indexOf(t))
            }, n.prototype.addToCollection = function (e, n, o) {
                var r = this, i = r.parentView, a = r.opt, s = r.config, l = r.el, c = a.ItemView, u = a.opened,
                    p = a.module, d = a.level, f = a.sorter, h = e.viewLayer || new c({
                        ItemView: c,
                        level: d,
                        model: e,
                        parentView: i,
                        config: s,
                        sorter: f,
                        opened: u,
                        module: p
                    }), v = h.render().el;
                if (n) n.appendChild(v); else {
                    var g = l, y = g.childNodes;
                    if ((0, t.isUndefined)(o)) g.appendChild(v); else {
                        var m = y.length == o;
                        m && o--, m || !y.length ? g.appendChild(v) : g.insertBefore(v, y[o])
                    }
                }
                return this.items.push(h), v
            }, n.prototype.remove = function () {
                for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                return u.Ss.prototype.remove.apply(this, t), this.items.map((function (t) {
                    return t.remove()
                })), this
            }, n.prototype.render = function () {
                var t = this, e = this.el, n = this.module, o = document.createDocumentFragment();
                return e.innerHTML = '', this.collection.map((function (t) {
                    return n.__getLayerFromComponent(t)
                })).forEach((function (e) {
                    return t.addToCollection(e, o)
                })), e.appendChild(o), e.className = this.className, this
            }, n
        }(u.Ss);
        const au = iu;
        var su = n(9946);
        const lu = function () {
            return {stylePrefix: 'com-', defaults: {}, strict: !0, defaultOptions: {}}
        };
        var cu = n(1738), uu = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), pu = void 0 && (void 0).__assign || function () {
                return pu = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, pu.apply(this, arguments)
            }, du = void 0 && (void 0).__spreadArray || function (t, e, n) {
                if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                return t.concat(o || Array.prototype.slice.call(e))
            },
            fu = [['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']],
            hu = {preserveSelected: 1}, vu = function (t) {
                return function (e) {
                    return t.trigger("".concat(Sn, ":start"), e)
                }
            }, gu = function (t) {
                return function (e) {
                    return t.trigger(Sn, e)
                }
            }, yu = function (t, e, n) {
                return void 0 === n && (n = {}), function (o, r, i) {
                    setTimeout((function () {
                        e.forEach((function (t) {
                            return t.set('status', t.get('selectable') ? 'selected' : '')
                        })), t.setSelected(e), e[0].emitUpdate()
                    })), t.trigger("".concat(Sn, ":end"), i), setTimeout((function () {
                        return t.runDefault(hu)
                    })), (n.altMode || i.cancelled) && t.set('_cmpDrag', 1)
                }
            }, mu = function (e) {
                function o(o) {
                    var r = e.call(this, o, 'Commands', lu()) || this;
                    r.CommandAbstract = su["default"], r.defaultCommands = {}, r.commands = {}, r.active = {}, r.events = cu.A;
                    var i = r.config, a = i.pStylePrefix, s = r.defaultCommands;
                    for (var l in a && (i.stylePrefix = a + i.stylePrefix), Object.keys(i.defaults).forEach((function (t) {
                        var e = i.defaults[t];
                        e.id && r.add(e.id, e)
                    })), s['tlb-delete'] = {
                        run: function (t) {
                            return t.runCommand('core:component-delete')
                        }
                    }, s['tlb-clone'] = {
                        run: function (t) {
                            t.runCommand('core:copy'), t.runCommand('core:paste', {action: 'clone-component'})
                        }
                    }, s['tlb-move'] = {
                        run: function (e, n, o) {
                            var r, i;
                            void 0 === o && (o = {});
                            var a = e.getModel(), s = o.event, l = o.target,
                                c = (Array.isArray(l) ? l : l ? [l] : du([], e.getSelectedAll(), !0)).map((function (t) {
                                    var e, n;
                                    return (null === (n = null === (e = t.delegate) || void 0 === e ? void 0 : e.move) || void 0 === n ? void 0 : n.call(e, t)) || t
                                })).filter(Boolean), u = c[c.length - 1], p = 'dragstart' === (null == s ? void 0 : s.type);
                            if (!(null == u ? void 0 : u.get('draggable'))) return a.logWarning('The element is not draggable');
                            var d = o.mode || u.get('dmode') || a.get('dmode'), f = function () {
                                return a.stopDefault(hu)
                            }, h = (0, t.includes)(['absolute', 'translate'], d);
                            c.forEach((function (t) {
                                return t.trigger('disable', {fromMove: !0})
                            })), p ? setTimeout(f, 0) : f();
                            var v = vu(a), g = gu(a), y = yu(a, c, {altMode: h});
                            if (h) e.runCommand('core:component-drag', {
                                guidesInfo: 1,
                                mode: d,
                                target: u,
                                onStart: v,
                                onDrag: g,
                                onEnd: y,
                                event: s
                            }); else {
                                p && (null === (r = null == s ? void 0 : s.dataTransfer) || void 0 === r || r.setDragImage(null === (i = u.view) || void 0 === i ? void 0 : i.el, 0, 0));
                                var m = e.Commands.get('move-comp');
                                m.onStart = v, m.onDrag = g, m.onEndMoveFromModel = y, m.initSorterFromModels(c)
                            }
                            c.filter((function (t) {
                                return t.get('selectable')
                            })).forEach((function (t) {
                                return t.set('status', 'freezed-selected')
                            }))
                        }
                    }, s['core:undo'] = function (t) {
                        return t.UndoManager.undo()
                    }, s['core:redo'] = function (t) {
                        return t.UndoManager.redo()
                    }, fu.forEach((function (t) {
                        var e = t[2], r = n(585)("./".concat(t[1])).default, i = "core:".concat(t[0]);
                        s[i] = r, e && (s[e] = r, ['run', 'stop'].forEach((function (t) {
                            o.on("".concat(t, ":").concat(e), (function () {
                                for (var e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
                                return o.trigger.apply(o, du(["".concat(t, ":").concat(i)], e, !1))
                            }))
                        })))
                    })), i.model = o.Canvas, s) r.add(l, s[l]);
                    return r
                }

                return uu(o, e), o.prototype.add = function (e, n) {
                    var o = (0, t.isFunction)(n) ? {run: n} : n;
                    return o.stop || (o.noStop = !0), delete o.initialize, o.id = e, this.commands[e] = su["default"].extend(o), this
                }, o.prototype.get = function (e) {
                    var n = this.commands[e];
                    return (0, t.isFunction)(n) ? (n = new n(this.config), this.commands[e] = n) : n || this.em.logWarning("'".concat(e, "' command not found")), n
                }, o.prototype.extend = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.get(t);
                    if (n) {
                        var o = pu(pu({}, n.constructor.prototype), e);
                        this.add(t, o);
                        var r = fu.filter((function (e) {
                            return "core:".concat(e[0]) === t && e[2]
                        }))[0];
                        r && this.add(r[2], o)
                    }
                    return this
                }, o.prototype.has = function (t) {
                    return !!this.commands[t]
                }, o.prototype.getAll = function () {
                    return this.commands
                }, o.prototype.run = function (t, e) {
                    return void 0 === e && (e = {}), this.runCommand(this.get(t), e)
                }, o.prototype.stop = function (t, e) {
                    return void 0 === e && (e = {}), this.stopCommand(this.get(t), e)
                }, o.prototype.isActive = function (t) {
                    return this.getActive().hasOwnProperty(t)
                }, o.prototype.getActive = function () {
                    return this.active
                }, o.prototype.runCommand = function (e, n) {
                    var o, r, i;
                    if (void 0 === n && (n = {}), null == e ? void 0 : e.run) {
                        var a = this.em, s = this.config, l = e.id, c = a.Editor;
                        if (!this.isActive(l) || n.force || !s.strict) {
                            var u = null === (r = null === (o = s.defaultOptions) || void 0 === o ? void 0 : o[l]) || void 0 === r ? void 0 : r.run;
                            (0, t.isFunction)(u) && (n = u(n)), i = c && e.callRun(c, n)
                        }
                    }
                    return i
                }, o.prototype.stopCommand = function (e, n) {
                    var o, r, i;
                    if (void 0 === n && (n = {}), null == e ? void 0 : e.run) {
                        var a = this.em, s = this.config, l = e.id, c = a.Editor;
                        if (this.isActive(l) || n.force || !s.strict) {
                            var u = null === (r = null === (o = s.defaultOptions) || void 0 === o ? void 0 : o[l]) || void 0 === r ? void 0 : r.stop;
                            (0, t.isFunction)(u) && (n = u(n)), i = e.callStop(c, n)
                        }
                    }
                    return i
                }, o.prototype.create = function (t) {
                    return t.stop || (t.noStop = !0), new (su["default"].extend(t))(this.config)
                }, o.prototype.__onRun = function (t, e) {
                    var n = this.em, o = this.events;
                    n.on("".concat(o.runCommand).concat(t), e)
                }, o.prototype.__onStop = function (t, e) {
                    var n = this.em, o = this.events;
                    n.on("".concat(o.stopCommand).concat(t), e)
                }, o.prototype.destroy = function () {
                    this.defaultCommands = {}, this.commands = {}, this.active = {}
                }, o
            }(m);
        const bu = mu;
        var _u = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), wu = void 0 && (void 0).__assign || function () {
            return wu = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, wu.apply(this, arguments)
        }, xu = 'contentEditable', Cu = 'data-toggle-move', Su = function (e) {
            function n(n) {
                var o = e.call(this, n) || this;
                (0, t.bindAll)(o, '__render'), o.opt = n, o.module = n.module, o.config = n.config || {}, o.sorter = n.sorter || '', o.parentView = n.parentView;
                var r = o, i = r.model, a = r.pfx, s = r.ppfx, l = i.get('type') || 'default';
                return o.className = "".concat(a, "layer ").concat(a, "layer__t-").concat(l, " no-select ").concat(s, "two-color"), o.inputNameCls = "".concat(s, "layer-name"), o.clsTitleC = "".concat(a, "layer-title-c"), o.clsTitle = "".concat(a, "layer-title"), o.clsCaret = "".concat(a, "layer-caret"), o.clsCount = "".concat(a, "layer-count"), o.clsMove = "".concat(a, "layer-move"), o.clsChildren = "".concat(a, "layer-children"), o.clsNoChild = "".concat(a, "layer-no-chld"), o.clsEdit = "".concat(o.inputNameCls, "--edit"), o.clsNoEdit = "".concat(o.inputNameCls, "--no-edit"), o.initComponent(), o
            }

            return _u(n, e), n.prototype.events = function () {
                var t;
                return (t = {})["mousedown [".concat(Cu, "]")] = 'startSort', t["touchstart [".concat(Cu, "]")] = 'startSort', t['click [data-toggle-visible]'] = 'toggleVisibility', t['click [data-toggle-open]'] = 'toggleOpening', t['click [data-toggle-select]'] = 'handleSelect', t['mouseover [data-toggle-select]'] = 'handleHover', t['mouseout [data-toggle-select]'] = 'handleHoverOut', t['dblclick [data-name]'] = 'handleEdit', t['keydown [data-name]'] = 'handleEditKey', t['focusout [data-name]'] = 'handleEditEnd', t
            }, n.prototype.template = function (t) {
                var e = this, n = e.pfx, o = e.ppfx, r = e.config, i = e.clsNoEdit, a = e.module, s = e.opt, l = e.em,
                    c = r.hidable, u = a.getComponents(t).length, p = u ? '' : this.clsNoChild,
                    d = "".concat(this.clsTitle, " ").concat(p), f = "".concat(this.clsTitleC),
                    h = "".concat(this.inputNameCls, " ").concat(i, " ").concat(o, "no-app"), v = s.level || 0,
                    g = "".concat(10 * v, "px"), y = t.getName(), m = t.getIcon(), b = "".concat(n, "layer"),
                    _ = (null == l ? void 0 : l.getConfig()).icons, w = _.move, x = _.eye, C = _.eyeOff, S = _.chevron;
                return "\n      <div class=\"".concat(n, "layer-item ").concat(o, "one-bg\" data-toggle-select>\n        <div class=\"").concat(n, "layer-item-left\">\n          ").concat(c ? "<i class=\"".concat(n, "layer-vis\" data-toggle-visible>\n                <i class=\"").concat(n, "layer-vis-on\">").concat(x, "</i>\n                <i class=\"").concat(n, "layer-vis-off\">").concat(C, "</i>\n              </i>") : '', "\n          <div class=\"").concat(f, "\">\n            <div class=\"").concat(d, "\" style=\"padding-left: ").concat(g, "\">\n              <div class=\"").concat(n, "layer-title-inn\" title=\"").concat(y, "\">\n                <i class=\"").concat(this.clsCaret, "\" data-toggle-open>").concat(S, "</i>\n                  ").concat(m ? "<span class=\"".concat(b, "__icon\">").concat(m, "</span>") : '', "\n                <span class=\"").concat(h, "\" data-name>").concat(y, "</span>\n              </div>\n            </div>\n          </div>\n        </div>\n        <div class=\"").concat(n, "layer-item-right\">\n          <div class=\"").concat(this.clsCount, "\" data-count>").concat(u || '', "</div>\n          <div class=\"").concat(this.clsMove, "\" ").concat(Cu, ">").concat(w || '', "</div>\n        </div>\n      </div>\n      <div class=\"").concat(this.clsChildren, "\"></div>\n    ")
            }, Object.defineProperty(n.prototype, "em", {
                get: function () {
                    return this.module.em
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "ppfx", {
                get: function () {
                    return this.em.getConfig().stylePrefix
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(n.prototype, "pfx", {
                get: function () {
                    return this.config.stylePrefix
                }, enumerable: !1, configurable: !0
            }), n.prototype.initComponent = function () {
                var t = this, e = this.model, n = this.config.onInit, o = e.components();
                this.listenTo(o, 'remove add reset', this.checkChildren), [['change:status', this.updateStatus], ['change:open', this.updateOpening], ['change:layerable', this.updateLayerable], ['change:style:display', this.updateVisibility], ['change:draggable', this.updateMove], ['rerender:layer', this.render], ['change:name change:custom-name', this.updateName]].forEach((function (n) {
                    return t.listenTo(e, n[0], n[1])
                })), this.$el.data('model', e), this.$el.data('collection', o), e.viewLayer = this, n.bind(this)({
                    component: e,
                    render: this.__render,
                    listenTo: this.listenTo
                })
            }, n.prototype.updateName = function () {
                this.getInputName().innerText = this.model.getName()
            }, n.prototype.getVisibilityEl = function () {
                return this.getItemContainer().find('[data-toggle-visible]')
            }, n.prototype.updateVisibility = function () {
                var t = this, e = t.pfx, n = t.model, o = t.module, r = "".concat(e, "layer-hidden"),
                    i = !o.isVisible(n) ? 'addClass' : 'removeClass';
                this.$el[i](r), this.getVisibilityEl()[i]("".concat(e, "layer-off"))
            }, n.prototype.updateMove = function () {
                var t = this.model, e = this.config, n = this.getItemContainer().find("[".concat(Cu, "]"))[0];
                if (n) {
                    var o = t.get('draggable') && e.sortable;
                    n.style.display = o ? '' : 'none'
                }
            }, n.prototype.toggleVisibility = function (t) {
                null == t || t.stopImmediatePropagation();
                var e = this.module, n = this.model;
                e.setVisible(n, !e.isVisible(n))
            }, n.prototype.handleEdit = function (t) {
                null == t || t.stopPropagation();
                var e = this, n = e.em, o = e.$el, r = e.clsNoEdit, i = e.clsEdit, a = this.getInputName();
                a[xu] = 'true', a.focus(), document.execCommand('selectAll', !1), n.setEditing(!0), o.find(".".concat(this.inputNameCls)).removeClass(r).addClass(i)
            }, n.prototype.handleEditKey = function (t) {
                t.stopPropagation(), ((0, Z.v$)(t) || (0, Z.Ci)(t)) && this.handleEditEnd(t)
            }, n.prototype.handleEditEnd = function (t) {
                null == t || t.stopPropagation();
                var e = this, n = e.em, o = e.$el, r = e.clsNoEdit, i = e.clsEdit, a = e.model, s = this.getInputName(),
                    l = s.textContent;
                s.scrollLeft = 0, s[xu] = 'false', a.setName(l), n.setEditing(!1), o.find(".".concat(this.inputNameCls)).addClass(r).removeClass(i), this.updateName()
            }, n.prototype.getInputName = function () {
                return this.inputName || (this.inputName = this.el.querySelector(".".concat(this.inputNameCls))), this.inputName
            }, n.prototype.updateOpening = function () {
                var t = this, e = t.$el, n = t.model, o = t.pfx, r = 'open', i = "".concat(o, "layer-open"),
                    a = this.getCaret();
                this.module.isOpen(n) ? (e.addClass(r), a.addClass(i)) : (e.removeClass(r), a.removeClass(i))
            }, n.prototype.toggleOpening = function (t) {
                var e = this.model, n = this.module;
                null == t || t.stopImmediatePropagation(), e.get('components').length && n.setOpen(e, !n.isOpen(e))
            }, n.prototype.handleSelect = function (t) {
                null == t || t.stopPropagation();
                var e = this.module, n = this.model;
                e.setLayerData(n, {selected: !0}, {event: t})
            }, n.prototype.handleHover = function (t) {
                null == t || t.stopPropagation();
                var e = this.module, n = this.model;
                e.setLayerData(n, {hovered: !0})
            }, n.prototype.handleHoverOut = function (t) {
                null == t || t.stopPropagation();
                var e = this.module, n = this.model;
                e.setLayerData(n, {hovered: !1})
            }, n.prototype.startSort = function (t) {
                var e, n, o;
                t.stopPropagation();
                var r = this, i = r.em, a = r.sorter, s = r.model;
                if ((!t.button || 0 === t.button) && a) {
                    var l = (null === (n = null === (e = s.delegate) || void 0 === e ? void 0 : e.move) || void 0 === n ? void 0 : n.call(e, s)) || s;
                    a.eventHandlers = wu({
                        legacyOnStartSort: vu(i),
                        legacyOnMoveClb: gu(i),
                        legacyOnEndMove: yu(i, [l])
                    }, a.eventHandlers);
                    var c = (null === (o = l.viewLayer) || void 0 === o ? void 0 : o.el) || t.target;
                    a.startSort([{element: c}])
                }
            }, n.prototype.updateStatus = function () {
                Jr.prototype.updateStatus.apply(this, [{avoidHover: !this.config.highlightHover, noExtHl: !0}])
            }, n.prototype.getItemContainer = function () {
                return this.$el.children('[data-toggle-select]')
            }, n.prototype.checkChildren = function () {
                var t = this, e = t.model, n = t.clsNoChild, o = t.module, r = o.getComponents(e).length,
                    i = this.getItemContainer(), a = i.find(".".concat(this.clsTitle)), s = i.find('[data-count]');
                a[r ? 'removeClass' : 'addClass'](n), s.html("".concat(r || '')), !r && o.setOpen(e, !1)
            }, n.prototype.getCaret = function () {
                return this.caret && this.caret.length || (this.caret = this.getItemContainer().find(".".concat(this.clsCaret))), this.caret
            }, n.prototype.setRoot = function (e) {
                var n,
                    o = (0, t.isString)(e) ? null === (n = this.em.getWrapper()) || void 0 === n ? void 0 : n.find(e)[0] : e;
                o && (this.stopListening(), this.model = o, this.initComponent(), this._rendered && this.render())
            }, n.prototype.updateLayerable = function () {
                (this.parentView || this).render()
            }, n.prototype.__clearItems = function () {
                var t;
                null === (t = this.items) || void 0 === t || t.remove()
            }, n.prototype.remove = function () {
                for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                return u.Ss.prototype.remove.apply(this, t), delete this.model.viewLayer, this.__clearItems(), this
            }, n.prototype.render = function () {
                var t = this, e = t.model, n = t.config, o = t.pfx, r = t.ppfx, i = t.opt, a = t.sorter;
                this.__clearItems();
                var s = i.opened, l = i.module, c = i.ItemView, u = !l.__isLayerable(e), p = this.$el.empty(),
                    d = i.level + 1;
                delete this.inputName, this.items = new au({
                    ItemView: c,
                    collection: e.get('components'),
                    config: n,
                    sorter: a,
                    opened: s,
                    parentView: this,
                    parent: e,
                    level: d,
                    module: l
                });
                var f = this.items.render().$el;
                return n.showWrapper || 1 !== d ? (p.html(this.template(e)), p.find(".".concat(this.clsChildren)).append(f)) : p.append(f), !l.isVisible(e) && (this.className += " ".concat(o, "hide")), u && (this.className += " ".concat(r, "hidden")), p.attr('class', this.className), this.updateStatus(), this.updateOpening(), this.updateVisibility(), this.updateMove(), this.__render(), this._rendered = !0, this
            }, n.prototype.__render = function () {
                var t = this, e = t.model, n = t.config, o = {component: e, el: t.el};
                n.onRender.bind(this)(o), this.em.trigger('layer:render', o)
            }, n
        }(u.Ss);
        const Ou = Su;
        var Tu = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), Pu = void 0 && (void 0).__assign || function () {
                return Pu = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, Pu.apply(this, arguments)
            }, Eu = 'layer', ku = "".concat(Eu, ":"), Au = "".concat(ku, "root"), ju = "".concat(ku, "component"),
            Mu = "".concat(ku, "custom"), Du = {all: Eu, root: Au, component: ju, custom: Mu}, Lu = {mediaText: ''},
            Iu = ['open', 'status', 'locked', 'custom-name', 'components', 'classes'].map((function (t) {
                return "".concat($.I.update, ":").concat(t)
            })).join(' '), Nu = function (n) {
                function o(e) {
                    var o = n.call(this, e, 'LayerManager', Qc()) || this;
                    return o.events = Du, (0, t.bindAll)(o, 'componentChanged', '__onRootChange', '__onComponent'), o.model = new x.A(o, {opened: {}}), o.config.stylePrefix = o.config.pStylePrefix, o
                }

                return Tu(o, n), o.prototype.onLoad = function () {
                    var t = this, e = this, n = e.em, o = e.config, r = e.model;
                    r.listenTo(n, 'component:selected', this.componentChanged), r.on('change:root', this.__onRootChange), r.listenTo(n, Iu, this.__onComponent), this.componentChanged(), r.listenToOnce(n, 'load', (function () {
                        t.setRoot(o.root), t.__appendTo()
                    }))
                }, o.prototype.setRoot = function (n) {
                    var o = this.em.getWrapper(), r = (0, e.isComponent)(n) ? n : o;
                    n && (0, t.isString)(n) && (0, e.hasWin)() && (r = o.find(n)[0] || o);
                    var i = this.__getLayerFromComponent(r);
                    return this.model.set('root', i), i
                }, o.prototype.getRoot = function () {
                    return this.model.get('root')
                }, o.prototype.getComponents = function (t) {
                    var e = this;
                    return t.components().map((function (t) {
                        return e.__getLayerFromComponent(t)
                    })).filter((function (t) {
                        return e.__isLayerable(t)
                    }))
                }, o.prototype.setOpen = function (t, e) {
                    t.set('open', e)
                }, o.prototype.isOpen = function (t) {
                    return !!t.get('open')
                }, o.prototype.setVisible = function (t, e) {
                    var n = '__prev-display', o = t.getStyle(Lu), r = o.display;
                    if (e) {
                        var i = t.get(n);
                        delete o.display, i && (o.display = i, t.unset(n))
                    } else r && t.set(n, r), o.display = 'none';
                    t.setStyle(o, Lu), this.updateLayer(t), this.em.trigger('component:toggled')
                }, o.prototype.isVisible = function (t) {
                    return void 0 === (e = t.getStyle(Lu)) && (e = {}), !(0 === (e.display || '').trim().indexOf('none'));
                    var e
                }, o.prototype.setLocked = function (t, e) {
                    t.set('locked', e)
                }, o.prototype.isLocked = function (t) {
                    return !!t.get('locked')
                }, o.prototype.setName = function (t, e) {
                    t.set('custom-name', e)
                }, o.prototype.getName = function (t) {
                    return t.getName()
                }, o.prototype.getLayerData = function (t) {
                    var e = t.get('status');
                    return {
                        name: t.getName(),
                        open: this.isOpen(t),
                        selected: 'selected' === e,
                        hovered: 'hovered' === e,
                        visible: this.isVisible(t),
                        locked: this.isLocked(t),
                        components: this.getComponents(t)
                    }
                }, o.prototype.setLayerData = function (t, n, o) {
                    var r;
                    void 0 === o && (o = {});
                    var i = this.em, a = this.config, s = n.open, l = n.selected, c = n.hovered, u = n.visible,
                        p = n.locked, d = n.name, f = Pu({fromLayers: !0}, o);
                    if ((0, e.isDef)(s) && this.setOpen(t, s), (0, e.isDef)(l)) if (l) {
                        i.setSelected(t, f);
                        var h = a.scrollCanvas;
                        h && (null === (r = t.views) || void 0 === r || r.forEach((function (t) {
                            return t.scrollIntoView(h)
                        })))
                    } else i.removeSelected(t, f);
                    (0, e.isDef)(c) && a.showHover && (c ? i.setHovered(t, f) : i.setHovered(null, f)), (0, e.isDef)(u) && u !== this.isVisible(t) && this.setVisible(t, u), (0, e.isDef)(p) && this.setLocked(t, p), (0, e.isDef)(d) && this.setName(t, d)
                }, o.prototype.componentChanged = function (t, e) {
                    var n;
                    if (void 0 === e && (e = {}), !e.fromLayers) {
                        var o = this.em, r = this.config.scrollLayers, i = this.model.get('opened'), a = o.getSelected(),
                            s = null == a ? void 0 : a.parent();
                        for (var l in i) i[l].set('open', !1), delete i[l];
                        for (; s;) s.set('open', !0), i[s.cid] = s, s = s.parent();
                        if (a && r) {
                            var c = null === (n = a.viewLayer) || void 0 === n ? void 0 : n.el;
                            null == c || c.scrollIntoView(r)
                        }
                    }
                }, o.prototype.getAll = function () {
                    return this.view
                }, o.prototype.render = function () {
                    var t, e, n = this.config, o = this.model, r = Ou.extend(n.extend);
                    return this.view = new r({
                        el: null === (t = this.view) || void 0 === t ? void 0 : t.el,
                        ItemView: r,
                        level: 0,
                        config: n,
                        opened: o.get('opened'),
                        model: this.getRoot(),
                        module: this
                    }), null === (e = this.view) || void 0 === e ? void 0 : e.render().el
                }, o.prototype.destroy = function () {
                    var t;
                    null === (t = this.view) || void 0 === t || t.remove()
                }, o.prototype.__onRootChange = function () {
                    var t, e = this.getRoot();
                    null === (t = this.view) || void 0 === t || t.setRoot(e), this.em.trigger(Au, e), this.__trgCustom()
                }, o.prototype.__getLayerFromComponent = function (t) {
                    var e, n;
                    return (null === (n = null === (e = t.delegate) || void 0 === e ? void 0 : e.layer) || void 0 === n ? void 0 : n.call(e, t)) || t
                }, o.prototype.__onComponent = function (t) {
                    this.updateLayer(t)
                }, o.prototype.__isLayerable = function (t) {
                    var e = t.tagName;
                    return (!this.config.hideTextnode || !t.isInstanceOf('textnode') && 'br' !== e) && t.get('layerable')
                }, o.prototype.__trgCustom = function (t) {
                    var e = this, n = e.__ctn, o = e.em, r = e.events;
                    this.__ctn = n || (null == t ? void 0 : t.container), o.trigger(r.custom, {
                        container: this.__ctn,
                        root: this.getRoot()
                    })
                }, o.prototype.updateLayer = function (t, e) {
                    this.em.trigger(ju, t, e)
                }, o
            }(m);
        const Ru = Nu;
        const Vu = function () {
            return {
                assets: [],
                noAssets: '',
                stylePrefix: 'am-',
                upload: '',
                uploadName: 'files',
                headers: {},
                params: {},
                credentials: 'include',
                multiUpload: !0,
                multiUploadSuffix: '[]',
                autoAdd: !0,
                customFetch: void 0,
                uploadFile: void 0,
                embedAsBase64: !0,
                handleAdd: void 0,
                beforeUpload: void 0,
                showUrlInput: !0,
                custom: !1,
                dropzone: !1,
                openAssetsOnDrop: !0,
                dropzoneContent: ''
            }
        };
        var Fu = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Hu = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return Fu(n, e), n.getDefaults = function () {
                return (0, t.result)(this.prototype, 'defaults')
            }, n.prototype.defaults = function () {
                return {type: '', src: ''}
            }, n.prototype.getType = function () {
                return this.get('type')
            }, n.prototype.getSrc = function () {
                return this.get('src')
            }, n.prototype.getFilename = function () {
                return this.get('src').split('/').pop().split('?').shift()
            }, n.prototype.getExtension = function () {
                return this.getFilename().split('.').pop()
            }, n
        }(u.Kx);
        const Uu = Hu;
        Hu.prototype.idAttribute = 'src';
        var zu = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Bu = void 0 && (void 0).__assign || function () {
            return Bu = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Bu.apply(this, arguments)
        };
        const Wu = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return zu(e, t), e.prototype.defaults = function () {
                return Bu(Bu({}, Uu.getDefaults()), {type: 'image', unitDim: 'px', height: 0, width: 0})
            }, e
        }(Uu);
        var $u = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), qu = function (e) {
            function n(t) {
                var n = e.call(this, t) || this;
                n.options = t, n.collection = t.collection;
                var o = t.config || {};
                n.config = o, n.pfx = o.stylePrefix || '', n.ppfx = o.pStylePrefix || '', n.em = o.em, n.className = n.pfx + 'asset', n.listenTo(n.model, 'destroy remove', n.remove), n.model.view = n;
                var r = n.init && n.init.bind(n);
                return r && r(t), n
            }

            return $u(n, e), n.prototype.__getBhv = function () {
                var t = this.em, e = null == t ? void 0 : t.Assets;
                return (null == e ? void 0 : e.__getBehaviour()) || {}
            }, n.prototype.template = function (t, e) {
                var n = this.pfx;
                return "\n      <div class=\"".concat(n, "preview-cont\">\n        ").concat(this.getPreview(), "\n      </div>\n      <div class=\"").concat(n, "meta\">\n        ").concat(this.getInfo(), "\n      </div>\n      <div class=\"").concat(n, "close\" data-toggle=\"asset-remove\">\n        &Cross;\n      </div>\n    ")
            }, n.prototype.updateTarget = function (e) {
                e && e.set && (e.set('attributes', (0, t.clone)(e.get('attributes'))), e.set('src', this.model.get('src')))
            }, n.prototype.getPreview = function () {
                return ''
            }, n.prototype.getInfo = function () {
                return ''
            }, n.prototype.render = function () {
                var t = this.el;
                return t.innerHTML = this.template(this, this.model), t.className = this.className, this
            }, n
        }(u.Ss);
        const Gu = qu;
        var Ku = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Yu = void 0 && (void 0).__makeTemplateObject || function (t, e) {
            return Object.defineProperty ? Object.defineProperty(t, "raw", {value: e}) : t.raw = e, t
        }, Xu = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return Ku(n, e), n.prototype.getPreview = function () {
                var t = this, e = t.pfx, n = t.ppfx, o = t.model.get('src');
                return r(Zu || (Zu = Yu(["\n      <div class=\"", "preview\" style=\"background-image: url('", "');\"></div>\n      <div class=\"", "preview-bg ", "checker-bg\"></div>\n    "], ["\n      <div class=\"", "preview\" style=\"background-image: url('", "');\"></div>\n      <div class=\"", "preview-bg ", "checker-bg\"></div>\n    "])), e, o, e, n)
            }, n.prototype.getInfo = function () {
                var t = this.pfx, e = this.model, n = e.get('name'), o = e.get('width'), i = e.get('height'),
                    a = e.get('unitDim'), s = o && i ? "".concat(o, "x").concat(i).concat(a) : '';
                return n = n || e.getFilename(), r(Qu || (Qu = Yu(["\n      <div class=\"", "name\">", "</div>\n      <div class=\"", "dimensions\">", "</div>\n    "], ["\n      <div class=\"", "name\">", "</div>\n      <div class=\"", "dimensions\">", "</div>\n    "])), t, n, t, s)
            }, n.prototype.init = function (t) {
                var e = this.pfx;
                this.className += " ".concat(e, "asset-image")
            }, n.prototype.onClick = function () {
                var e = this.model, n = this.pfx, o = this.__getBhv().select, r = this.config.onClick,
                    i = this.collection;
                i.trigger('deselectAll'), this.$el.addClass(n + 'highlight'), (0, t.isFunction)(o) ? o(e, !1) : (0, t.isFunction)(r) ? r(e) : this.updateTarget(i.target)
            }, n.prototype.onDblClick = function () {
                var e = this.em, n = this.model, o = this.__getBhv().select, r = this.config.onDblClick,
                    i = this.collection, a = i.target, s = i.onSelect;
                (0, t.isFunction)(o) ? o(n, !0) : (0, t.isFunction)(r) ? r(n) : (this.updateTarget(a), null == e || e.Modal.close()), (0, t.isFunction)(s) && s(n)
            }, n.prototype.onRemove = function (t) {
                t.stopImmediatePropagation(), this.model.collection.remove(this.model)
            }, n
        }(Gu);
        const Ju = Xu;
        var Zu, Qu;
        Xu.prototype.events = {
            'click [data-toggle=asset-remove]': 'onRemove',
            click: 'onClick',
            dblclick: 'onDblClick'
        };
        var tp = void 0 && (void 0).__assign || function () {
            return tp = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, tp.apply(this, arguments)
        }, ep = {
            types: [], initialize: function (t, e) {
                var n = this;
                void 0 === e && (e = {});
                var o = e.em;
                this.em = o, this.opts = e, this.model = function (t, e) {
                    var r, i, a;
                    if (void 0 === t && (t = {}), void 0 === e && (e = {}), t && t.type) {
                        var s = n.getBaseType();
                        r = (a = n.getType(t.type)) ? a.model : s.model, i = a ? a.view : s.view
                    } else {
                        var l = n.recognizeType(t);
                        r = (a = l.type).model, i = a.view, t = l.attributes
                    }
                    var c = new r(t, tp(tp({}, e), {em: o}));
                    return c.typeView = i, n.model.prototype = r.prototype, c
                };
                var r = this.init && this.init.bind(this);
                r && r()
            }, recognizeType: function (t) {
                for (var e = this.getTypes(), n = 0; n < e.length; n++) {
                    var o = e[n], r = o.isType(t);
                    if (r = 'boolean' == typeof r && r ? {type: o.id} : r) return {type: o, attributes: r}
                }
                return {type: this.getBaseType(), attributes: t}
            }, getBaseType: function () {
                var t = this.getTypes();
                return t[t.length - 1]
            }, getTypes: function () {
                return this.types
            }, getType: function (t) {
                for (var e = this.getTypes(), n = 0; n < e.length; n++) {
                    var o = e[n];
                    if (o.id === t) return o
                }
            }, addType: function (e, n) {
                var o = this.getType(e), r = this.getBaseType(), i = o ? o.model : r.model, a = o ? o.view : r.view,
                    s = n.model, l = n.view, c = n.isType;
                s = s instanceof u.Kx || (0, t.isFunction)(s) ? s : i.extend(s || {}), l = l instanceof u.Ss || (0, t.isFunction)(l) ? l : a.extend(l || {}), !this.extendViewApi || n.model || n.view || (l = l.extend(n)), o ? (o.model = s, o.view = l, o.isType = c || o.isType) : (n.id = e, n.model = s, n.view = l, n.isType = c || function (t) {
                    if (t && t.type == e) return !0
                }, this.getTypes().unshift(n))
            }
        };
        const np = ep;
        var op = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), rp = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return op(e, t), e
        }(u.pM.extend(np));
        const ip = rp;
        var ap;
        rp.prototype.types = [{
            id: 'image', model: Wu, view: Ju, isType: function (t) {
                return 'string' == typeof t ? {type: 'image', src: t} : t
            }
        }], function (t) {
            t["add"] = "asset:add", t["remove"] = "asset:remove", t["removeBefore"] = "asset:remove:before", t["update"] = "asset:update", t["open"] = "asset:open", t["close"] = "asset:close", t["uploadStart"] = "asset:upload:start", t["uploadEnd"] = "asset:upload:end", t["uploadError"] = "asset:upload:error", t["uploadResponse"] = "asset:upload:response", t["custom"] = "asset:custom", t["all"] = "asset"
        }(ap || (ap = {}));
        const sp = ap;
        var lp = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), cp = function (t) {
            function e(e) {
                void 0 === e && (e = {});
                var n = t.call(this, e) || this;
                n.options = e, n.config = e.config, n.pfx = n.config.stylePrefix || '', n.ppfx = n.config.pStylePrefix || '', n.em = n.config.em;
                var o = n.collection;
                return n.listenTo(o, 'reset', n.renderAssets), n.listenTo(o, 'add', n.addToAsset), n.listenTo(o, 'remove', n.removedAsset), n.listenTo(o, 'deselectAll', n.deselectAll), n
            }

            return lp(e, t), e.prototype.template = function (t) {
                var e = t.pfx, n = t.ppfx, o = t.em, r = '';
                return this.config.showUrlInput && (r = "\n          <form class=\"".concat(e, "add-asset\">\n            <div class=\"").concat(n, "field ").concat(e, "add-field\">\n              <input placeholder=\"").concat(null == o ? void 0 : o.t('assetManager.inputPlh'), "\"/>\n            </div>\n            <button class=\"").concat(n, "btn-prim\">").concat(null == o ? void 0 : o.t('assetManager.addButton'), "</button>\n            <div style=\"clear:both\"></div>\n          </form>\n      ")), "\n    <div class=\"".concat(e, "assets-cont\">\n      <div class=\"").concat(e, "assets-header\">\n        ").concat(r, "\n      </div>\n      <div class=\"").concat(e, "assets\" data-el=\"assets\"></div>\n      <div style=\"clear:both\"></div>\n    </div>\n    ")
            }, e.prototype.handleSubmit = function (t) {
                t.preventDefault();
                var e = this.getAddInput(), n = e && e.value.trim(), o = this.config.handleAdd;
                if (n) {
                    e.value = '';
                    var r = this.getAssetsEl();
                    r && (r.scrollTop = 0), o ? o.bind(this)(n) : this.options.globalCollection.add(n, {at: 0})
                }
            }, e.prototype.getAssetsEl = function () {
                return this.el.querySelector(".".concat(this.pfx, "assets"))
            }, e.prototype.getAddInput = function () {
                return this.inputUrl && this.inputUrl.value || (this.inputUrl = this.el.querySelector(".".concat(this.pfx, "add-asset input"))), this.inputUrl
            }, e.prototype.removedAsset = function (t) {
                this.collection.length || this.toggleNoAssets()
            }, e.prototype.addToAsset = function (t) {
                1 == this.collection.length && this.toggleNoAssets(!0), this.addAsset(t)
            }, e.prototype.addAsset = function (t, e) {
                void 0 === e && (e = null);
                var n = e, o = this.collection, r = this.config,
                    i = new t.typeView({model: t, collection: o, config: r}).render().el;
                if (n) n.appendChild(i); else {
                    var a = this.getAssetsEl();
                    a && a.insertBefore(i, a.firstChild)
                }
                return i
            }, e.prototype.toggleNoAssets = function (t) {
                void 0 === t && (t = !1);
                var e = this.$el.find(".".concat(this.pfx, "assets"));
                if (t) e.empty(); else {
                    var n = this.config.noAssets;
                    n && e.append(n)
                }
            }, e.prototype.deselectAll = function () {
                var t = this.pfx;
                this.$el.find(".".concat(t, "highlight")).removeClass("".concat(t, "highlight"))
            }, e.prototype.renderAssets = function () {
                var t = this, e = document.createDocumentFragment(), n = this.$el.find(".".concat(this.pfx, "assets"));
                n.empty(), this.toggleNoAssets(!!this.collection.length), this.collection.each((function (n) {
                    return t.addAsset(n, e)
                })), n.append(e)
            }, e.prototype.render = function () {
                var t = this.options.fu.render().el;
                return this.$el.empty(), this.$el.append(t).append(this.template(this)), this.el.className = "".concat(this.ppfx, "asset-manager"), this.renderAssets(), this
            }, e
        }(u.Ss);
        const up = cp;
        cp.prototype.events = {submit: 'handleSubmit'};
        var pp = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), dp = void 0 && (void 0).__makeTemplateObject || function (t, e) {
            return Object.defineProperty ? Object.defineProperty(t, "raw", {value: e}) : t.raw = e, t
        }, fp = function (t) {
            function e(n) {
                void 0 === n && (n = {});
                var o = t.call(this, n) || this;
                o.options = n;
                var r = n.config || {};
                o.module = n.module, o.config = r, o.em = o.config.em, o.pfx = r.stylePrefix || '', o.ppfx = r.pStylePrefix || '', o.target = o.options.globalCollection || {}, o.uploadId = o.pfx + 'uploadFile', o.disabled = void 0 !== r.disableUpload ? r.disableUpload : !r.upload && !r.embedAsBase64, o.multiUpload = void 0 === r.multiUpload || r.multiUpload;
                var i = r.uploadFile;
                return i ? o.uploadFile = i.bind(o) : !r.upload && r.embedAsBase64 && (o.uploadFile = e.embedAsBase64), o.delegateEvents(), o
            }

            return pp(e, t), e.prototype.template = function (t) {
                var e = t.pfx, n = t.title, o = t.uploadId, i = t.disabled, a = t.multiUpload;
                return r(vp || (vp = dp(["\n      <form>\n        <div id=\"", "title\">", "</div>\n        <input\n          data-input\n          type=\"file\"\n          id=\"", "\"\n          name=\"file\"\n          accept=\"*/*\"\n          ", "\n          ", "\n        />\n        <div style=\"clear:both;\"></div>\n      </form>\n    "], ["\n      <form>\n        <div id=\"", "title\">", "</div>\n        <input\n          data-input\n          type=\"file\"\n          id=\"", "\"\n          name=\"file\"\n          accept=\"*/*\"\n          ", "\n          ", "\n        />\n        <div style=\"clear:both;\"></div>\n      </form>\n    "])), e, n, o, i ? 'disabled' : '', a ? 'multiple' : '')
            }, e.prototype.events = function () {
                return {'change [data-input]': 'uploadFile'}
            }, e.prototype.onUploadStart = function () {
                var t = this.module;
                null == t || t.__propEv(t.events.uploadStart)
            }, e.prototype.onUploadEnd = function (t) {
                var e = this.$el, n = this.module;
                null == n || n.__propEv(n.events.uploadEnd, t);
                var o = e.find('input');
                o && o.val('')
            }, e.prototype.onUploadError = function (t) {
                var e = this.module;
                console.error(t), this.onUploadEnd(t), null == e || e.__propEv(e.events.uploadError, t)
            }, e.prototype.onUploadResponse = function (t, e) {
                var n, o = this, r = o.module, i = o.config, a = o.target;
                try {
                    n = 'string' == typeof t ? JSON.parse(t) : t
                } catch (e) {
                    n = t
                }
                null == r || r.__propEv(r.events.uploadResponse, n), i.autoAdd && a && a.add(n.data, {at: 0}), this.onUploadEnd(t), null == e || e(n)
            }, e.prototype.uploadFile = function (t, e) {
                var n = this, o = t.dataTransfer ? t.dataTransfer.files : t.target.files, r = this.config,
                    i = r.beforeUpload;
                if (!1 !== (i && i(o))) {
                    var a = new FormData, s = r.params, l = r.customFetch, c = r.fetchOptions;
                    for (var u in s) a.append(u, s[u]);
                    if (this.multiUpload) for (var p = 0; p < o.length; p++) a.append("".concat(r.uploadName).concat(r.multiUploadSuffix), o[p]); else o.length && a.append(r.uploadName, o[0]);
                    var d = r.upload, f = r.headers, h = 'X-Requested-With';
                    if (void 0 === f[h] && (f[h] = 'XMLHttpRequest'), d) {
                        this.onUploadStart();
                        var v = {method: 'post', credentials: r.credentials || 'include', headers: f, body: a},
                            g = (null == c ? void 0 : c(v)) || v;
                        return (l ? l(d, g) : Ql(d, g).then((function (t) {
                            return 1 == (t.status / 200 | 0) ? t.text() : t.text().then((function (t) {
                                return Promise.reject(t)
                            }))
                        }))).then((function (t) {
                            return n.onUploadResponse(t, e)
                        })).catch((function (t) {
                            return n.onUploadError(t)
                        }))
                    }
                }
            }, e.prototype.initDrop = function () {
                var t = this;
                if (!this.uploadForm) {
                    this.uploadForm = this.$el.find('form').get(0);
                    var e = this.uploadForm;
                    'draggable' in e && (this.uploadForm.ondragover = function () {
                        return e.className = t.pfx + 'hover', !1
                    }, this.uploadForm.ondragleave = function () {
                        return e.className = '', !1
                    }, this.uploadForm.ondrop = function (n) {
                        e.className = '', n.preventDefault(), t.uploadFile(n)
                    })
                }
            }, e.prototype.initDropzone = function (t) {
                var e = this, n = 0, o = this.config, r = t.model, i = t.el, a = r.Editor, s = r.Canvas.getBody(),
                    l = this.ppfx, c = "".concat(l, "dropzone-active"), u = "".concat(l, "dropzone"), p = function () {
                        i.className = i.className.replace(c, '').trim(), n = 0
                    }, d = function () {
                        return n || (i.className += " ".concat(c), n = 1), !1
                    }, f = function () {
                        return p(), !1
                    }, h = function (t) {
                        if (p(), t.preventDefault(), t.stopPropagation(), e.uploadFile(t), o.openAssetsOnDrop && a) {
                            var n = a.getSelected();
                            a.runCommand('open-assets', {
                                target: n, onSelect: function () {
                                    a.Modal.close(), a.AssetManager.setTarget(null)
                                }
                            })
                        }
                        return !1
                    };
                t.$el.append("<div class=\"".concat(u, "\">").concat(o.dropzoneContent, "</div>")), p(), 'draggable' in i && [i, s].forEach((function (t) {
                    t.ondragover = d, t.ondragleave = f, t.ondrop = h
                }))
            }, e.prototype.render = function () {
                var t = this, e = t.$el, n = t.pfx, o = t.em;
                return e.html(this.template({
                    title: o && o.t('assetManager.uploadTitle'),
                    uploadId: this.uploadId,
                    disabled: this.disabled,
                    multiUpload: this.multiUpload,
                    pfx: n
                })), this.initDrop(), e.attr('class', n + 'file-uploader'), this
            }, e.embedAsBase64 = function (t, e) {
                var n = this, o = t.dataTransfer ? t.dataTransfer.files : t.target.files, r = {data: []};
                if (FileReader) {
                    for (var i = [], a = /^(.+)\/(.+)$/, s = function (t) {
                        var e = new Promise((function (e, n) {
                            var o = new FileReader;
                            o.addEventListener('load', (function (r) {
                                var i, s = t.name, l = a.exec(t.type);
                                if ('image' === (i = l ? l[1] : t.type)) {
                                    var c = {src: o.result, name: s, type: i, height: 0, width: 0}, u = new Image;
                                    u.addEventListener('error', (function (t) {
                                        n(t)
                                    })), u.addEventListener('load', (function () {
                                        c.height = u.height, c.width = u.width, e(c)
                                    })), u.src = c.src
                                } else e(i ? {src: o.result, name: s, type: i} : o.result)
                            })), o.addEventListener('error', (function (t) {
                                n(t)
                            })), o.addEventListener('abort', (function (t) {
                                n('Aborted')
                            })), o.readAsDataURL(t)
                        }));
                        i.push(e)
                    }, l = 0, c = o; l < c.length; l++) {
                        s(c[l])
                    }
                    return Promise.all(i).then((function (t) {
                        r.data = t, n.onUploadResponse(r, e)
                    }), (function (t) {
                        n.onUploadError(t)
                    }))
                }
                this.onUploadError(new Error('Unsupported platform, FileReader is not defined'))
            }, e
        }(u.Ss);
        const hp = fp;
        var vp, gp = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), yp = void 0 && (void 0).__assign || function () {
            return yp = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, yp.apply(this, arguments)
        }, mp = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, bp = 'open-assets', _p = function (e) {
            function n(n) {
                var o = e.call(this, n, 'AssetManager', new ip([], n), sp, Vu()) || this;
                o.storageKey = 'assets', o.Asset = Uu, o.Assets = ip, o.events = sp;
                var r = o, i = r.all, a = r.config;
                o.assetsVis = new ip([]);
                var s = a.pStylePrefix;
                return s && (a.stylePrefix = "".concat(s).concat(a.stylePrefix)), i.on('add', (function (t) {
                    return o.getAllVisible().add(t)
                })), i.on('remove', (function (t) {
                    return o.getAllVisible().remove(t)
                })), o.__onAllEvent = (0, t.debounce)((function () {
                    return o.__trgCustom()
                }), 0), o
            }

            return gp(n, e), n.prototype.open = function (t) {
                void 0 === t && (t = {}), this.em.Commands.run(bp, yp({
                    types: ['image'], select: function () {
                    }
                }, t))
            }, n.prototype.close = function () {
                this.em.Commands.stop(bp)
            }, n.prototype.isOpen = function () {
                var t = this.em.Commands;
                return !!(null == t ? void 0 : t.isActive(bp))
            }, n.prototype.add = function (t, e) {
                return void 0 === e && (e = {}), void 0 === e.at && (e.at = 0), this.all.add(t, e)
            }, n.prototype.get = function (t) {
                return this.all.where({src: t})[0] || null
            }, n.prototype.getAll = function () {
                return this.all
            }, n.prototype.getAllVisible = function () {
                return this.assetsVis
            }, n.prototype.remove = function (t, e) {
                return this.__remove(t, e)
            }, n.prototype.store = function () {
                return this.getProjectData()
            }, n.prototype.load = function (t) {
                return this.loadProjectData(t)
            }, n.prototype.getContainer = function () {
                var t;
                return this.__getBehaviour().container || (null === (t = this.am) || void 0 === t ? void 0 : t.el)
            }, n.prototype.getAssetsEl = function () {
                var t;
                return null === (t = this.am) || void 0 === t ? void 0 : t.el.querySelector('[data-el=assets]')
            }, n.prototype.render = function (t) {
                if (!this.getConfig().custom) {
                    var e = t || this.getAll().models;
                    if (!this.am) {
                        var n = this.__viewParams();
                        n.fu = this.FileUploader(), this.am = new up(yp({}, n)), this.am.render()
                    }
                    return this.assetsVis.reset(e), this.getContainer()
                }
            }, n.prototype.__viewParams = function () {
                return {
                    collection: this.assetsVis,
                    globalCollection: this.all,
                    config: this.config,
                    module: this,
                    fu: void 0
                }
            }, n.prototype.addType = function (t, e) {
                this.getAll().addType(t, e)
            }, n.prototype.getType = function (t) {
                return this.getAll().getType(t)
            }, n.prototype.getTypes = function () {
                return this.getAll().getTypes()
            }, n.prototype.AssetsView = function () {
                return this.am
            }, n.prototype.FileUploader = function () {
                return this.fu || (this.fu = new hp(this.__viewParams())), this.fu
            }, n.prototype.onLoad = function () {
                var t = this;
                this.getAll().reset(this.config.assets);
                var e = this.em, n = this.events;
                e.Commands.__onRun(bp, (function () {
                    return t.__propEv(n.open)
                })), e.Commands.__onStop(bp, (function () {
                    return t.__propEv(n.close)
                }))
            }, n.prototype.postRender = function (t) {
                var e;
                this.config.dropzone && (null === (e = this.fu) || void 0 === e || e.initDropzone(t))
            }, n.prototype.setTarget = function (t) {
                this.assetsVis.target = t
            }, n.prototype.onSelect = function (t) {
                this.assetsVis.onSelect = t
            }, n.prototype.onClick = function (t) {
                this.config.onClick = t
            }, n.prototype.onDblClick = function (t) {
                this.config.onDblClick = t
            }, n.prototype.__propEv = function (t) {
                for (var e, n, o = [], r = 1; r < arguments.length; r++) o[r - 1] = arguments[r];
                (e = this.em).trigger.apply(e, mp([t], o, !1)), (n = this.getAll()).trigger.apply(n, mp([t], o, !1))
            }, n.prototype.__trgCustom = function () {
                var t = this.__getBehaviour(), e = this.getConfig().custom;
                (t.container || e.open) && this.em.trigger(this.events.custom, this.__customData())
            }, n.prototype.__customData = function () {
                var e = this, n = this.__getBehaviour();
                return {
                    am: this,
                    open: this.isOpen(),
                    assets: this.getAll().models,
                    types: n.types || [],
                    container: n.container,
                    close: function () {
                        return e.close()
                    },
                    remove: function (t, n) {
                        return e.remove(t, n)
                    },
                    select: function (o, r) {
                        var i = e.add(o);
                        (0, t.isFunction)(n.select) && n.select(i, r)
                    },
                    options: n.options || {}
                }
            }, n.prototype.__behaviour = function (t) {
                return void 0 === t && (t = {}), this._bhv = yp(yp({}, this._bhv || {}), t)
            }, n.prototype.__getBehaviour = function (t) {
                return void 0 === t && (t = {}), this._bhv || {}
            }, n.prototype.destroy = function () {
                var t, e;
                this.all.stopListening(), this.all.reset(), this.assetsVis.stopListening(), this.assetsVis.reset(), null === (t = this.fu) || void 0 === t || t.remove(), null === (e = this.am) || void 0 === e || e.remove(), this._bhv = {}
            }, n
        }(b);
        const wp = _p;
        const xp = function () {
            return {
                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 Cp = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Sp = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Cp(e, t), e.prototype.defaults = function () {
                return {name: '', width: null, height: '', widthMedia: null, priority: null}
            }, e.prototype.initialize = function () {
                var t = 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 (e) {
                    return t.checkUnit(e)
                }))
            }, e.prototype.checkUnit = function (t) {
                var e = this.get(t) || '';
                (parseFloat(e) || 0).toString() === e.toString() && this.set(t, "".concat(e, "px"))
            }, e.prototype.getName = function () {
                return this.get('name') || this.get('id')
            }, e.prototype.getWidthMedia = function () {
                return this.get('widthMedia') || ''
            }, e
        }(u.Kx);
        var Op = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Tp = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Op(e, t), e
        }(u.pM);
        const Pp = Tp;
        Tp.prototype.model = Sp;
        var Ep = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), kp = void 0 && (void 0).__makeTemplateObject || function (t, e) {
            return Object.defineProperty ? Object.defineProperty(t, "raw", {value: e}) : t.raw = e, t
        }, Ap = function (t) {
            function e(e) {
                var n = t.call(this, e) || this;
                return n.config = e.config || {}, n.em = n.config.em, n.ppfx = n.config.pStylePrefix || '', n.listenTo(n.em, 'change:device', n.updateSelect), n
            }

            return Ep(e, t), e.prototype.template = function (t) {
                var e = t.ppfx, n = t.label;
                return r(Mp || (Mp = kp(["\n      <div class=\"", "device-label\">", "</div>\n      <div class=\"", "field ", "select\">\n        <span id=\"", "input-holder\">\n          <select class=\"", "devices\"></select>\n        </span>\n        <div class=\"", "sel-arrow\">\n          <div class=\"", "d-s-arrow\"></div>\n        </div>\n      </div>\n      <button style=\"display:none\" class=\"", "add-trasp\" data-add-trasp>+</button>\n    "], ["\n      <div class=\"", "device-label\">", "</div>\n      <div class=\"", "field ", "select\">\n        <span id=\"", "input-holder\">\n          <select class=\"", "devices\"></select>\n        </span>\n        <div class=\"", "sel-arrow\">\n          <div class=\"", "d-s-arrow\"></div>\n        </div>\n      </div>\n      <button style=\"display:none\" class=\"", "add-trasp\" data-add-trasp>+</button>\n    "])), e, n, e, e, e, e, e, e, e)
            }, e.prototype.events = function () {
                return {change: 'updateDevice', 'click [data-add-trasp]': 'startAdd'}
            }, e.prototype.startAdd = function () {
            }, e.prototype.updateDevice = function () {
                var t = this.em;
                if (t) {
                    var e = this.devicesEl;
                    t.set('device', e ? e.val() : '')
                }
            }, e.prototype.updateSelect = function () {
                var t = this.em, e = this.devicesEl;
                if (t && t.getDeviceModel && e) {
                    var n = t.getDeviceModel();
                    e.val(n ? n.get('id') : '')
                }
            }, e.prototype.getOptions = function () {
                var t = this.collection, e = this.em, n = '';
                return t.forEach((function (t) {
                    var o = t.attributes, r = o.name, i = o.id,
                        a = e && e.t && e.t("deviceManager.devices.".concat(i)) || r;
                    n += "<option value=\"".concat(i || r, "\">").concat(a, "</option>")
                })), n
            }, e.prototype.render = function () {
                var t = this, e = t.em, n = t.ppfx, o = t.$el, r = t.el, i = e && e.t && e.t('deviceManager.device');
                return o.html(this.template({
                    ppfx: n,
                    label: i
                })), this.devicesEl = o.find(".".concat(n, "devices")), this.devicesEl.append(this.getOptions()), this.devicesEl.val(e.get('device')), r.className = "".concat(n, "devices-c"), this
            }, e
        }(u.Ss);
        const jp = Ap;
        var Mp, Dp = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Lp = void 0 && (void 0).__assign || function () {
            return Lp = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Lp.apply(this, arguments)
        }, Ip = function (e) {
            function n(t) {
                var n, o = e.call(this, t, 'DeviceManager', new Pp, C, xp()) || this;
                return o.Device = Sp, o.Devices = Pp, o.storageKey = '', o.devices = o.all, null === (n = o.config.devices) || void 0 === n || n.forEach((function (t) {
                    return o.add(t, {silent: !0})
                })), o.select(o.config.default || o.devices.at(0)), t.on('change:device', o._onSelect, o), o
            }

            return Dp(n, e), n.prototype._onSelect = function (t, e, n) {
                var o = this.em, r = this.events, i = t.previous('device'), a = this.get(e), s = r.select;
                o.trigger(s, a, this.get(i)), this.__catchAllEvent(s, a, n)
            }, n.prototype.add = function (e, n) {
                var o;
                void 0 === n && (n = {});
                var r = n;
                if ((0, t.isString)(e)) {
                    var i = n;
                    o = Lp(Lp({}, r = arguments[2] || {}), {id: e, name: r.name || e, width: i})
                } else o = e;
                return o.id || (o.id = o.name || this._createId()), this.devices.add(o, r)
            }, n.prototype.get = function (t) {
                return this.getAll().filter((function (e) {
                    return e.get('name') === t
                }))[0] || this.devices.get(t) || null
            }, n.prototype.remove = function (t, e) {
                return void 0 === e && (e = {}), this.__remove(t, e)
            }, n.prototype.getDevices = function () {
                return this.devices.models
            }, n.prototype.select = function (e, n) {
                void 0 === n && (n = {});
                var o = (0, t.isString)(e) ? this.get(e) : e;
                return o && this.em.set('device', o.get('id'), n), this
            }, n.prototype.getSelected = function () {
                return this.get(this.em.get('device'))
            }, n.prototype.getAll = function () {
                return this.devices
            }, n.prototype.render = function () {
                var t, e = this.em;
                return null === (t = this.view) || void 0 === t || t.remove(), this.view = new jp({
                    collection: this.devices,
                    config: Lp({em: e}, this.config)
                }), this.view.render().el
            }, n.prototype.destroy = function () {
                this.__destroy()
            }, n
        }(b);
        const Np = Ip;
        var Rp = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Vp = function (e) {
            function n(t, n) {
                void 0 === n && (n = {});
                var o = e.call(this, t, n) || this, r = n.em, i = {};
                o.em = r, t.frames || (i.component = t.component, i.styles = t.styles, ['component', 'styles'].map((function (t) {
                    return o.unset(t)
                })));
                var a = t.frames || [i], s = new H(r.Canvas, a);
                return s.page = o, o.set('frames', s), !o.getId() && o.set('id', null == r ? void 0 : r.Pages._createId()), null == r || r.UndoManager.add(s), o
            }

            return Rp(n, e), n.prototype.defaults = function () {
                return {name: '', frames: [], _undo: !0}
            }, n.prototype.onRemove = function () {
                this.getFrames().reset()
            }, n.prototype.getFrames = function () {
                return this.get('frames')
            }, n.prototype.getId = function () {
                return this.id
            }, n.prototype.getName = function () {
                return this.get('name')
            }, n.prototype.setName = function (t) {
                return this.set({name: t})
            }, n.prototype.getAllFrames = function () {
                return this.getFrames().models || []
            }, n.prototype.getMainFrame = function () {
                return this.getFrames().at(0)
            }, n.prototype.getMainComponent = function () {
                var t = this.getMainFrame();
                return null == t ? void 0 : t.getComponent()
            }, n.prototype.toJSON = function (e) {
                void 0 === e && (e = {});
                var n = u.Kx.prototype.toJSON.call(this, e), o = (0, t.result)(this, 'defaults');
                return (0, t.forEach)(n, (function (t, e) {
                    0 === e.indexOf('_') && delete n[e]
                })), (0, t.forEach)(o, (function (t, e) {
                    n[e] === t && delete n[e]
                })), n
            }, n
        }(u.Kx);
        var Fp = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Hp = void 0 && (void 0).__assign || function () {
            return Hp = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Hp.apply(this, arguments)
        }, Up = function (t) {
            function e(e, n) {
                var o = t.call(this, e) || this;
                return o.on('reset', o.onReset), o.on('remove', o.onRemove), o.model = function (t, e) {
                    return void 0 === e && (e = {}), new Vp(t, Hp(Hp({}, e), {em: n}))
                }, o
            }

            return Fp(e, t), e.prototype.onReset = function (t, e) {
                var n, o = this;
                null === (n = null == e ? void 0 : e.previousModels) || void 0 === n || n.map((function (t) {
                    return o.onRemove(t, o, e)
                }))
            }, e.prototype.onRemove = function (t, e, n) {
                void 0 === n && (n = {}), n.fromUndo || n.temporary || null == t || t.onRemove()
            }, e
        }(u.pM);
        const zp = Up;
        var Bp = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Wp = void 0 && (void 0).__assign || function () {
            return Wp = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Wp.apply(this, arguments)
        }, $p = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        }, qp = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Gp = 'change:selected', Kp = 'main', Yp = function (n) {
            function o(e) {
                var o = n.call(this, e, 'PageManager', new zp([], e), O) || this;
                o.events = O, o.storageKey = 'pages', (0, t.bindAll)(o, '_onPageChange');
                var r = new x.A(o, {_undo: !0});
                return o.model = r, o.pages.on('reset', o.__onReset, o), o.pages.on('all', o.__onChange, o), r.on(Gp, o._onPageChange), o
            }

            return Bp(o, n), Object.defineProperty(o.prototype, "pages", {
                get: function () {
                    return this.all
                }, enumerable: !1, configurable: !0
            }), o.prototype.getAll = function () {
                return qp([], this.all.models, !0)
            }, o.prototype.__onChange = function (t, e, n, o) {
                var r = this.em, i = this.events, a = o || n;
                r.trigger(i.all, {event: t, page: e, options: a})
            }, o.prototype.__onReset = function () {
                var t = this.pages.at(0);
                t && this.select(t)
            }, o.prototype.onLoad = function () {
                var t, e = this, n = e.pages, o = e.config, r = e.em, i = {silent: !0},
                    a = (null === (t = o.pages) || void 0 === t ? void 0 : t.map((function (t) {
                        return new Vp(t, {em: r, config: o})
                    }))) || [];
                n.add(a, i);
                var s = n.length ? this._initPage() : this.add({type: Kp}, i);
                s && this.select(s, i)
            }, o.prototype._onPageChange = function (t, e, n) {
                var o = this.em, r = this.events, i = o.Layers, a = e.getMainComponent();
                i && a && i.setRoot(a), o.trigger(r.select, e, t.previous('selected')), this.__onChange(Gp, e, n)
            }, o.prototype.postLoad = function () {
                var t = this, e = t.em, n = t.model, o = t.pages, r = e.UndoManager;
                r.add(n), r.add(o), o.on('add remove reset change', (function (t, n, o) {
                    return e.changesUp(o || n)
                }))
            }, o.prototype.add = function (t, e) {
                var n = this;
                void 0 === e && (e = {});
                var o = this.em, r = this.events;
                t.id = t.id || this._createId();
                var i = function () {
                    var o = n.pages.add(new Vp(t, {em: n.em, config: n.config}), e);
                    return e.select && n.select(o), o
                };
                return !e.silent && o.trigger(r.addBefore, t, i, e), e.abort ? void 0 : i()
            }, o.prototype.remove = function (e, n) {
                var o = this;
                void 0 === n && (n = {});
                var r = this.em, i = this.events, a = (0, t.isString)(e) ? this.get(e) : e, s = function () {
                    return a && o.pages.remove(a, n), a
                };
                return !n.silent && r.trigger(i.removeBefore, a, s, n), !n.abort && s()
            }, o.prototype.move = function (e, n) {
                void 0 === n && (n = {});
                var o = this.pages, r = (0, t.isString)(e) ? this.get(e) : e, i = n.at, a = void 0 === i ? 0 : i,
                    s = $p(n, ["at"]);
                if (r) {
                    var l = o.indexOf(r) === a;
                    if (!(a < 0 || a >= o.length || l)) return this.remove(r, Wp(Wp({}, s), {temporary: !0})), o.add(r, Wp(Wp({}, s), {at: a})), r
                }
            }, o.prototype.get = function (t) {
                return this.pages.filter((function (e) {
                    return e.get(e.idAttribute) === t
                }))[0]
            }, o.prototype.getMain = function () {
                var t = this.pages;
                return t.filter((function (t) {
                    return t.get('type') === Kp
                }))[0] || t.at(0)
            }, o.prototype.getAllWrappers = function () {
                var e = this.getAll();
                return (0, t.unique)((0, t.flatten)(e.map((function (t) {
                    return t.getAllFrames().map((function (t) {
                        return t.getComponent()
                    }))
                }))))
            }, o.prototype.select = function (e, n) {
                void 0 === n && (n = {});
                var o = this, r = o.em, i = o.model, a = o.events, s = (0, t.isString)(e) ? this.get(e) : e;
                return s && (r.trigger(a.selectBefore, s, n), i.set('selected', s, n)), this
            }, o.prototype.getSelected = function () {
                return this.model.get('selected')
            }, o.prototype.destroy = function () {
                var t = this;
                this.pages.off().reset(), this.model.stopListening(), this.model.clear({silent: !0}), ['selected', 'model'].map((function (e) {
                    return t[e] = 0
                }))
            }, o.prototype.store = function () {
                return this.getProjectData()
            }, o.prototype.load = function (t) {
                var e = this, n = this.loadProjectData(t, {
                    all: this.pages, reset: !0, onResult: function (t, n) {
                        t.forEach((function (t) {
                            return e.add(t, n)
                        })), e.__onReset()
                    }
                });
                return this.pages.forEach((function (t) {
                    return t.getFrames().initRefs()
                })), n
            }, o.prototype._initPage = function () {
                return this.get(this.config.selected) || this.getMain()
            }, o.prototype._createId = function () {
                var t, n = this.getAll().length + 16, o = this.getAllMap();
                do {
                    t = (0, e.createId)(n)
                } while (o[t]);
                return t
            }, o
        }(b);
        const Xp = Yp;
        var Jp = {placeholder: 'eg. Text here'};
        const Zp = {
            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',
                categories: {},
                traits: {
                    labels: {},
                    attributes: {id: Jp, alt: Jp, title: Jp, href: {placeholder: 'eg. https://google.com'}},
                    options: {target: {false: 'This window', _blank: 'New window'}}
                }
            },
            storageManager: {recover: 'Do you want to recover unsaved changes?'}
        };
        const Qp = function () {
            return {
                locale: 'en',
                localeFallback: 'en',
                detectLocale: !0,
                debug: !1,
                messages: {en: Zp},
                messagesAdd: void 0
            }
        };
        var td;
        !function (t) {
            t["add"] = "i18n:add", t["update"] = "i18n:update", t["locale"] = "i18n:locale"
        }(td || (td = {}));
        const ed = td;
        var nd = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), od = function (n) {
            function o(t) {
                var e = n.call(this, t, 'I18n', Qp()) || this;
                e.events = ed;
                var o = e.config.messagesAdd;
                return o && e.addMessages(o), e.config.detectLocale && (e.config.locale = e._localLang()), e
            }

            return nd(o, n), o.prototype.setLocale = function (t) {
                var e = this, n = e.em, o = e.config, r = e.events;
                return n.trigger(r.locale, {value: t, valuePrev: o.locale}), o.locale = t, this
            }, o.prototype.getLocale = function () {
                return this.config.locale
            }, o.prototype.getMessages = function (t, e) {
                void 0 === e && (e = {});
                var n = this.config.messages;
                return t && !n[t] && this._debug("'".concat(t, "' i18n lang not found"), e), t ? n[t] : n
            }, o.prototype.setMessages = function (t) {
                var e = this, n = e.em, o = e.config, r = e.events;
                return o.messages = t, n.trigger(r.update, t), this
            }, o.prototype.addMessages = function (t) {
                var n = this, o = n.em, r = n.events, i = n.config.messages;
                return o.trigger(r.add, t), this.setMessages((0, e.deepMerge)(i, t)), this
            }, o.prototype.t = function (e, n) {
                void 0 === n && (n = {});
                var o = this.config, r = n.params || {}, i = n.l || this.getLocale(), a = n.lFlb || o.localeFallback,
                    s = this._getMsg(e, i, n);
                return s || (s = this._getMsg(e, a, n)), !s && this._debug("'".concat(e, "' i18n key not found in '").concat(i, "' lang"), n), s = s && (0, t.isString)(s) ? this._addParams(s, r) : s
            }, o.prototype._localLang = function () {
                var t = (0, e.hasWin)() && window.navigator || {}, n = t.language || t.userLanguage;
                return n ? n.split('-')[0] : 'en'
            }, o.prototype._addParams = function (t, e) {
                var n = new RegExp('{([\\w\\d-]*)}', 'g');
                return t.replace(n, (function (t, n) {
                    return e[n] || ''
                })).trim()
            }, o.prototype._getMsg = function (e, n, o) {
                void 0 === o && (o = {});
                var r = this.getMessages(n, o);
                if (r) {
                    var i = r[e];
                    return !i && e.indexOf('.') > 0 && (i = e.split('.').reduce((function (e, n) {
                        if (!(0, t.isUndefined)(e)) return e[n]
                    }), r)), i
                }
            }, o.prototype._debug = function (t, e) {
                void 0 === e && (e = {});
                var n = this.em, o = this.config;
                (e.debug || o.debug) && n && n.logWarning(t)
            }, o.prototype.destroy = function () {
            }, o
        }(m);
        const rd = od;
        var id = void 0 && (void 0).__assign || function () {
            return id = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, id.apply(this, arguments)
        }, ad = function () {
            function n(e) {
                void 0 === e && (e = {}), this.moved = !1, this.defOpts = {
                    ratioDefault: !1,
                    onUpdateContainer: function () {
                    },
                    step: 1,
                    minDim: 10,
                    maxDim: 1 / 0,
                    unitHeight: 'px',
                    unitWidth: 'px',
                    keyHeight: 'height',
                    keyWidth: 'width',
                    currentUnit: !0,
                    silentFrames: !1,
                    avoidContainerUpdate: !1,
                    keepAutoHeight: !1,
                    keepAutoWidth: !1,
                    autoHeight: !1,
                    autoWidth: !1,
                    tl: !0,
                    tc: !0,
                    tr: !0,
                    cl: !0,
                    cr: !0,
                    bl: !0,
                    bc: !0,
                    br: !0
                }, this.opts = id({}, this.defOpts), this.setOptions(e), (0, t.bindAll)(this, 'handleKeyDown', 'handleMouseDown', 'move', 'stop')
            }

            return n.prototype.getConfig = function () {
                return this.opts
            }, n.prototype.setOptions = function (t, e) {
                void 0 === t && (t = {}), this.opts = id(id({}, e ? this.defOpts : this.opts), t), this.setup()
            }, n.prototype.setup = function () {
                var t = this.opts, e = t.prefix || '', n = t.appendTo || document.body, o = this.container;
                for (o || ((o = document.createElement('div')).className = "".concat(e, "resizer-c"), n.appendChild(o), this.container = o); o.firstChild;) o.removeChild(o.firstChild);
                var r = {};
                for (var i in ['tl', 'tc', 'tr', 'cl', 'cr', 'bl', 'bc', 'br'].forEach((function (e) {
                    return r[e] = t[e] ? function (t, e) {
                        void 0 === e && (e = {});
                        var n = e.prefix || '', o = document.createElement('i');
                        return o.className = n + 'resizer-h ' + n + 'resizer-h-' + t, o.setAttribute('data-' + n + 'handler', t), o
                    }(e, t) : null
                })), r) {
                    var a = r[i];
                    a && o.appendChild(a)
                }
                this.handlers = r, this.mousePosFetcher = t.mousePosFetcher, this.updateTarget = t.updateTarget, this.posFetcher = t.posFetcher, this.onStart = t.onStart, this.onMove = t.onMove, this.onEnd = t.onEnd, this.onUpdateContainer = t.onUpdateContainer
            }, n.prototype.toggleFrames = function (e) {
                if (this.opts.silentFrames) {
                    var n = document.querySelectorAll('iframe');
                    (0, t.each)(n, (function (t) {
                        return t.style.pointerEvents = e ? 'none' : ''
                    }))
                }
            }, n.prototype.isHandler = function (t) {
                var e = this.handlers;
                for (var n in e) if (e[n] === t) return !0;
                return !1
            }, n.prototype.getFocusedEl = function () {
                return this.el
            }, n.prototype.getParentEl = function () {
                var t;
                return null === (t = this.el) || void 0 === t ? void 0 : t.parentElement
            }, n.prototype.getDocumentEl = function () {
                return this.opts.docs || [this.el.ownerDocument, document]
            }, n.prototype.getElementPos = function (t, e) {
                void 0 === e && (e = {});
                var n = this.posFetcher;
                return n ? n(t, e) : function (t, e) {
                    var n = e || window, o = t.getBoundingClientRect();
                    return {left: o.left + n.pageXOffset, top: o.top + n.pageYOffset, width: o.width, height: o.height}
                }(t)
            }, n.prototype.focus = function (t) {
                t && t === this.el || (this.el = t, this.updateContainer({forceShow: !0}), (0, Z.on)(this.getDocumentEl(), 'pointerdown', this.handleMouseDown))
            }, n.prototype.blur = function () {
                this.container.style.display = 'none', this.el && ((0, Z.AU)(this.getDocumentEl(), 'pointerdown', this.handleMouseDown), delete this.el)
            }, n.prototype.start = function (e) {
                var n, o = this.el, r = this.opts, i = void 0 === r ? {} : r;
                if (this.moved = !1, 0 === e.button && o) {
                    e.preventDefault(), e.stopPropagation(), null === (n = this.selectedHandler) || void 0 === n || n.setPointerCapture(e.pointerId);
                    var a = this.getParentEl(), s = i, l = this.mousePosFetcher, c = 'data-' + s.prefix + 'handler',
                        u = this.getElementPos(o, {avoidFrameZoom: !0, avoidFrameOffset: !0}),
                        p = this.getElementPos(a), d = e.target;
                    this.handlerAttr = d.getAttribute(c), this.clickedHandler = d, this.startDim = {
                        t: u.top,
                        l: u.left,
                        w: u.width,
                        h: u.height
                    }, this.rectDim = {
                        t: u.top,
                        l: u.left,
                        w: u.width,
                        h: u.height
                    }, this.startPos = l ? l(e) : {x: e.clientX, y: e.clientY}, this.parentDim = {
                        t: p.top,
                        l: p.left,
                        w: p.width,
                        h: p.height
                    };
                    var f = this.getDocumentEl();
                    this.docs = f, (0, Z.on)(f, 'pointermove', this.move), (0, Z.on)(f, 'keydown', this.handleKeyDown), (0, Z.on)(f, 'pointerup', this.stop), (0, t.isFunction)(this.onStart) && this.onStart(e, {
                        docs: f,
                        config: s,
                        el: o,
                        resizer: this
                    }), this.toggleFrames(!0), !s.updateOnMove && this.move(e)
                }
            }, n.prototype.move = function (t) {
                var e, n;
                this.moved = !0;
                var o = this.el, r = this.opts, i = this.docs || this.getDocumentEl(),
                    a = (null === (e = this.mousePosFetcher) || void 0 === e ? void 0 : e.call(this, t)) || {
                        x: t.clientX,
                        y: t.clientY
                    };
                this.currentPos = a, this.delta = {
                    x: a.x - this.startPos.x,
                    y: a.y - this.startPos.y
                }, this.keys = {
                    shift: t.shiftKey,
                    ctrl: t.ctrlKey,
                    alt: t.altKey
                }, this.rectDim = this.calc(this), this.updateRect(!1, t), null === (n = this.onMove) || void 0 === n || n.call(this, t, {
                    docs: i,
                    config: r,
                    el: o,
                    resizer: this
                })
            }, n.prototype.stop = function (t) {
                var e, n, o = this.el, r = this.opts, i = this.docs || this.getDocumentEl();
                (0, Z.AU)(i, 'pointermove', this.move), (0, Z.AU)(i, 'keydown', this.handleKeyDown), (0, Z.AU)(i, 'pointerup', this.stop), !this.moved && r.updateOnMove || this.updateRect(!0, t), null === (e = this.selectedHandler) || void 0 === e || e.releasePointerCapture(t.pointerId), this.toggleFrames(), null === (n = this.onEnd) || void 0 === n || n.call(this, t, {
                    docs: i,
                    config: r,
                    el: o,
                    resizer: this
                }), this.moved = !1, delete this.docs
            }, n.prototype.updateRect = function (e, n) {
                var o = this.el, r = this.opts, i = this.rectDim, a = this.updateTarget, s = this.getSelectedHandler(),
                    l = r.unitHeight, c = r.unitWidth, u = r.keyWidth, p = r.keyHeight;
                if ((0, t.isFunction)(a)) a(o, i, {
                    store: e,
                    selectedHandler: s,
                    resizer: this,
                    config: r,
                    event: n
                }); else {
                    var d = o.style;
                    d[u] = i.w + c, d[p] = i.h + l
                }
                this.updateContainer()
            }, n.prototype.updateContainer = function (t) {
                var e;
                void 0 === t && (t = {});
                var n = this, o = n.opts, r = n.container, i = n.el, a = r.style;
                !o.avoidContainerUpdate && i && t.forceShow && (a.display = 'block'), null === (e = this.onUpdateContainer) || void 0 === e || e.call(this, {
                    el: r,
                    resizer: this,
                    opts: id(id({}, o), t)
                })
            }, n.prototype.getSelectedHandler = function () {
                var t = this.handlers;
                if (this.selectedHandler) for (var e in t) if (t[e] === this.selectedHandler) return e
            }, n.prototype.handleKeyDown = function (t) {
                27 === t.keyCode && (this.rectDim = this.startDim, this.stop(t))
            }, n.prototype.handleMouseDown = function (t) {
                var e = t.target;
                this.isHandler(e) ? (this.selectedHandler = e, this.start(t)) : e !== this.el && (delete this.selectedHandler, this.blur())
            }, n.prototype.calc = function (t) {
                var n, o = this.opts || {}, r = o.step, i = this.startDim, a = o.minDim, s = o.maxDim, l = t.delta.x,
                    c = t.delta.y, u = this.parentDim.w, p = this.parentDim.h, d = this.opts.unitWidth,
                    f = this.opts.unitHeight, h = this.getParentRect(), v = '%' === d ? i.w / 100 * u : i.w,
                    g = '%' === f ? i.h / 100 * p : i.h, y = {t: i.t - h.top, l: i.l - h.left, w: v, h: g};
                if (t) {
                    var m = t.handlerAttr;
                    ~m.indexOf('r') && (n = '%' === d ? (0, e.normalizeFloat)((v + l * r) / u * 100, .01) : (0, e.normalizeFloat)(v + l * r, r), n = Math.max(a, n), s && (n = Math.min(s, n)), y.w = n), ~m.indexOf('b') && (n = '%' === f ? (0, e.normalizeFloat)((g + c * r) / p * 100, .01) : (0, e.normalizeFloat)(g + c * r, r), n = Math.max(a, n), s && (n = Math.min(s, n)), y.h = n), ~m.indexOf('l') && (n = '%' === d ? (0, e.normalizeFloat)((v - l * r) / u * 100, .01) : (0, e.normalizeFloat)(v - l * r, r), n = Math.max(a, n), s && (n = Math.min(s, n)), y.w = n), ~m.indexOf('t') && (n = '%' === f ? (0, e.normalizeFloat)((g - c * r) / p * 100, .01) : (0, e.normalizeFloat)(g - c * r, r), n = Math.max(a, n), s && (n = Math.min(s, n)), y.h = n);
                    var b = o.ratioDefault ? !t.keys.shift : t.keys.shift;
                    if (m.indexOf('c') < 0 && b) {
                        var _ = i.w / i.h;
                        y.w / y.h > _ ? y.h = Math.round(y.w / _) : y.w = Math.round(y.h * _)
                    }
                    for (var w in ~m.indexOf('l') && (y.l += i.w - y.w), ~m.indexOf('t') && (y.t += i.h - y.h), y) {
                        var x = w;
                        y[x] = parseInt("".concat(y[x]), 10)
                    }
                    return y
                }
            }, n.prototype.getParentRect = function () {
                var t = {left: 0, top: 0, width: 0, height: 0}, e = this.el;
                if (!e) return t;
                var n = e.offsetParent;
                return n && 'BODY' !== n.tagName && (t = this.getElementPos(n)), t
            }, n
        }();
        const sd = ad;
        var ld = void 0 && (void 0).__assign || function () {
            return ld = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, ld.apply(this, arguments)
        };

        function cd(t) {
            var e = t.getBoundingClientRect();
            return {top: e.top + document.body.scrollTop, left: e.left + document.body.scrollLeft}
        }

        function ud(t, n) {
            return e.matches.call(t, n)
        }

        function pd(t) {
            return t ? [t].concat(pd(t.parent())) : []
        }

        var dd = function () {
            function t(t) {
                this.timeout = null, this.threshold = t
            }

            return t.prototype.updateArgs = function (t) {
                this.lastArgs = t
            }, t.prototype.execute = function (t) {
                var e = this;
                this.timeout || (this.timeout = setTimeout((function () {
                    e.lastArgs && t(e.lastArgs), e.timeout = null
                }), this.threshold))
            }, t.prototype.clearTimeout = function () {
                this.timeout && (clearTimeout(this.timeout), this.timeout = null), delete this.lastArgs
            }, t
        }(), fd = void 0 && (void 0).__assign || function () {
            return fd = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, fd.apply(this, arguments)
        }, hd = function () {
            function t(t) {
                this.top = t.top, this.left = t.left, this.height = t.height, this.width = t.width, this.offsets = t.offsets, this.dir = t.dir
            }

            return t.prototype.calculateDimensionDifference = function (t) {
                return {topDifference: t.top - this.top, leftDifference: t.left - this.left}
            }, t.prototype.adjustDimensions = function (t) {
                return this.top += t.topDifference, this.left += t.leftDifference, this
            }, t.prototype.determinePlacement = function (t, e) {
                var n = this.left + this.width / 2, o = this.top + this.height / 2;
                return this.dir ? e < o ? 'before' : 'after' : t < n ? 'before' : 'after'
            }, t.prototype.equals = function (t) {
                return !!t && (this.top === t.top && this.left === t.left && this.height === t.height && this.width === t.width && this.dir === t.dir && JSON.stringify(this.offsets) === JSON.stringify(t.offsets))
            }, t.prototype.clone = function () {
                return new t({
                    top: this.top,
                    left: this.left,
                    height: this.height,
                    width: this.width,
                    offsets: fd({}, this.offsets),
                    dir: this.dir
                })
            }, t.prototype.getDropArea = function (t) {
                var e = this.clone(), n = this.adjustDropDimension(this.width, this.left, t), o = n.newSize,
                    r = n.newPosition;
                e.width = o, e.left = r;
                var i = this.adjustDropDimension(this.height, this.top, t), a = i.newSize, s = i.newPosition;
                return e.height = a, e.top = s, e
            }, t.prototype.adjustDropDimension = function (t, e, n) {
                var o = n.ratio, r = n.minUndroppableDimension, i = n.maxUndroppableDimension, a = t * (1 - o) / 2;
                return a = Math.max(a, r), {newSize: t - 2 * (a = Math.min(a, i)), newPosition: e + a}
            }, t.prototype.isWithinBounds = function (t, e) {
                return t >= this.left && t <= this.left + this.width && e >= this.top && e <= this.top + this.height
            }, t
        }();
        const vd = hd;
        var gd = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), yd = function (e) {
            function n(n) {
                var o = e.call(this) || this;
                return o.sourceNodes = [], o.containerOffset = {
                    top: 0,
                    left: 0
                }, o.moveThreshold = 20, o.treeClass = n.treeClass, o.em = n.em, o.containerContext = n.containerContext, o.positionOptions = n.positionOptions, o.dragDirection = n.dragDirection, o.eventHandlers = n.eventHandlers, (0, t.bindAll)(o, 'endDrag', 'cancelDrag', 'recalculateTargetOnScroll', 'startSort', 'onDragStart', 'onMove'), o.restLastMoveData(), o.rateLimiter = new dd(o.moveThreshold), o
            }

            return gd(n, e), n.prototype.startSort = function (t) {
                this.sourceNodes = t, this.bindDragEventHandlers()
            }, n.prototype.bindDragEventHandlers = function () {
                (0, Z.on)(this.containerContext.container, 'dragstart', this.onDragStart), (0, Z.on)(this.containerContext.container, 'mousemove dragover', this.onMove), (0, Z.on)(this.containerContext.document, 'mouseup dragend touchend', this.endDrag)
            }, n.prototype.recalculateTargetOnScroll = function () {
                var t = this.lastMoveData.mouseEvent;
                t && this.onMove(t)
            }, n.prototype.onMove = function (t) {
                this.rateLimiter.updateArgs(t), this.rateLimiter.execute(this.handleMove.bind(this))
            }, n.prototype.handleMove = function (t) {
                var e, n, o, r, i, a, s;
                this.adjustForScroll();
                var c = this.lastMoveData.targetNode;
                null === (n = (e = this.eventHandlers).onMouseMove) || void 0 === n || n.call(e, t), this.cacheContainerPosition();
                var u = this.getMousePositionRelativeToContainer(t.clientX, t.clientY), p = u.mouseXRelative,
                    d = u.mouseYRelative, f = this.getMouseTargetElement(t), h = this.getFirstElementWithAModel(f),
                    v = h ? null === (o = (0, l["default"])(h)) || void 0 === o ? void 0 : o.data('model') : void 0,
                    g = v ? this.getOrCreateHoveredNode(v) : void 0,
                    y = g ? this.getIndexInParent(g, g.nodeDimensions, p, d) : 0,
                    m = g ? this.getValidParent(g, 0, p, d) : void 0;
                if (!(null == m ? void 0 : m.equals(c)) && (null === (i = (r = this.eventHandlers).onTargetChange) || void 0 === i || i.call(r, c, m)), !m || !g) return this.triggerLegacyOnMoveCallback(t, 0), this.triggerMoveEvent(p, d), void this.restLastMoveData();
                var b = this.getDropPosition(m, p, d), _ = b.index, w = b.placement, x = b.placeholderDimensions;
                (!x.equals(this.lastMoveData.placeholderDimensions) || w !== this.lastMoveData.placement) && (null === (s = (a = this.eventHandlers).onPlaceholderPositionChange) || void 0 === s || s.call(a, x, w)), this.lastMoveData = {
                    targetNode: m,
                    hoveredNode: g,
                    mouseEvent: t,
                    index: _,
                    hoveredIndex: y,
                    placement: w,
                    placeholderDimensions: x
                }, this.triggerMoveEvent(p, d), this.triggerLegacyOnMoveCallback(t, _)
            }, n.prototype.adjustForScroll = function () {
                var t, e, n = this.lastMoveData.targetNode;
                if (null == n ? void 0 : n.element) {
                    var o = this.getDim(null == n ? void 0 : n.element);
                    (i = null === (t = n.nodeDimensions) || void 0 === t ? void 0 : t.calculateDimensionDifference(o)) && n.adjustDimensions(i)
                }
                var r = this.lastMoveData.hoveredNode;
                if (null == r ? void 0 : r.element) {
                    var i;
                    o = this.getDim(null == r ? void 0 : r.element);
                    (i = null === (e = r.nodeDimensions) || void 0 === e ? void 0 : e.calculateDimensionDifference(o)) && r.adjustDimensions(i)
                }
            }, n.prototype.restLastMoveData = function () {
                this.lastMoveData = {targetNode: void 0, index: void 0, placement: void 0, mouseEvent: void 0}
            }, n.prototype.triggerLegacyOnMoveCallback = function (t, e) {
                var n, o, r, i, a = null === (n = this.sourceNodes[0]) || void 0 === n ? void 0 : n.model;
                null === (r = (o = this.eventHandlers).legacyOnMoveClb) || void 0 === r || r.call(o, {
                    event: t,
                    target: a,
                    parent: null === (i = this.lastMoveData.targetNode) || void 0 === i ? void 0 : i.model,
                    index: e
                })
            }, n.prototype.triggerMoveEvent = function (t, e) {
                var n, o = this.lastMoveData, r = o.targetNode, i = o.placement, a = o.index,
                    s = a ? a + ('after' === i ? -1 : 0) : 0;
                this.em.trigger('sorter:drag', {
                    target: (null == r ? void 0 : r.element) || null,
                    targetModel: null === (n = this.lastMoveData.targetNode) || void 0 === n ? void 0 : n.model,
                    sourceModel: this.sourceNodes[0].model,
                    dims: (null == r ? void 0 : r.childrenDimensions) || [],
                    pos: {index: s, indexEl: s, placement: i},
                    x: t,
                    y: e
                })
            }, n.prototype.getDropPosition = function (t, e, n) {
                var o, r = t.nodeDimensions, i = t.childrenDimensions, a = t.getChildren(), s = a && a.length > 0;
                r = r || this.getDim(t.element), t.nodeDimensions = r, i = i || this.getChildrenDim(t), t.childrenDimensions = i;
                var l = r.clone(), c = 0, u = 'inside';
                return s && (c = (o = function (t, e, n) {
                    for (var o, r = {
                        index: 0,
                        placement: 'before'
                    }, i = 0, a = 0, s = 0, l = 0, c = 0, u = 0, p = 0, d = t.length; p < d; p++) {
                        var f = (o = t[p]).top, h = o.left, v = o.height, g = o.width;
                        if (u = f + v, l = h + g / 2, c = f + v / 2, !(a && h > a || s && c >= s || i && h + g < i)) if (r.index = p, o.dir) {
                            if (n < c) {
                                r.placement = 'before';
                                break
                            }
                            r.placement = 'after'
                        } else n < u && (s = u), e < l ? (a = l, r.placement = 'before') : (i = l, r.placement = 'after')
                    }
                    return r
                }(i, e, n)).index, u = o.placement, l = i[c].clone(), c += 'after' == u ? 1 : 0), {
                    index: c,
                    placement: u,
                    placeholderDimensions: l
                }
            }, n.prototype.getOrCreateHoveredNode = function (t) {
                var e = this.lastMoveData.hoveredNode, n = new this.treeClass(t), o = n.equals(e), r = o ? e : n;
                return r.nodeDimensions = o ? e.nodeDimensions : this.getDim(n.element), r
            }, n.prototype.getMouseTargetElement = function (t) {
                var e = this.containerContext.customTarget,
                    n = this.containerContext.document.elementFromPoint(t.clientX, t.clientY);
                return e ? e({event: t}) : n
            }, n.prototype.onDragStart = function (t) {
                this.eventHandlers.onDragStart && this.eventHandlers.onDragStart(t)
            }, n.prototype.endDrag = function () {
                this.dropDragged()
            }, n.prototype.cancelDrag = function () {
                var t, e, n = this.lastMoveData.targetNode;
                null === (e = (t = this.eventHandlers).onTargetChange) || void 0 === e || e.call(t, n, void 0), this.finalizeMove()
            }, n.prototype.finalizeMove = function () {
                var t, e, n, o;
                this.cleanupEventListeners(), this.triggerOnDragEndEvent(), null === (e = (t = this.eventHandlers).onEnd) || void 0 === e || e.call(t), null === (o = (n = this.eventHandlers).legacyOnEnd) || void 0 === o || o.call(n), this.restLastMoveData(), this.rateLimiter.clearTimeout()
            }, n.prototype.dropDragged = function () {
                var t, e, n = this.lastMoveData, o = n.targetNode, r = n.index;
                null === (e = (t = this.eventHandlers).onDrop) || void 0 === e || e.call(t, o, this.sourceNodes, r), this.finalizeMove()
            }, n.prototype.triggerOnDragEndEvent = function () {
                var t = this.lastMoveData.targetNode, e = this.sourceNodes[0];
                this.em.trigger('sorter:drag:end', {
                    targetCollection: t ? t.getChildren() : null,
                    modelToDrop: null == e ? void 0 : e.model,
                    warns: [''],
                    validResult: {
                        result: !0,
                        src: this.sourceNodes.map((function (t) {
                            return t.element
                        })),
                        srcModel: null == e ? void 0 : e.model,
                        trg: null == t ? void 0 : t.element,
                        trgModel: null == t ? void 0 : t.model,
                        draggable: !0,
                        droppable: !0
                    },
                    dst: null == t ? void 0 : t.element,
                    srcEl: null == e ? void 0 : e.element
                })
            }, n.prototype.getFirstElementWithAModel = function (t) {
                for (var e; t && this.containerContext.container.contains(t);) {
                    if (e = t, void 0 !== (0, l["default"])(e).data('model')) return t;
                    t = t.parentElement
                }
                return null
            }, n.prototype.getValidParent = function (t, e, n, o) {
                var r, i;
                if (t) {
                    var a = this.lastMoveData, s = a.targetNode, l = a.hoveredNode, c = a.hoveredIndex,
                        u = a.mouseEvent, p = t.equals(l);
                    t.nodeDimensions = p ? l.nodeDimensions : this.getDim(t.element);
                    var d = this.getIndexInParent(t, t.nodeDimensions, n, o) === c, f = t.isWithinDropBounds(n, o);
                    if (p && d && f === t.isWithinDropBounds(null !== (r = null == u ? void 0 : u.clientX) && void 0 !== r ? r : 0, null !== (i = null == u ? void 0 : u.clientY) && void 0 !== i ? i : 0) && s) return s;
                    if (!f) return this.handleParentTraversal(t, n, o);
                    var h = this.sourceNodes.some((function (n) {
                        return t.canMove(n, e)
                    }));
                    return this.triggerDragValidation(h, t), h ? t : this.handleParentTraversal(t, n, o)
                }
            }, n.prototype.handleParentTraversal = function (t, e, n) {
                var o = t.getParent();
                if (o) {
                    var r = this.getIndexInParent(t, t.nodeDimensions, e, n);
                    if (void 0 !== r) return this.getValidParent(o, r, e, n)
                }
            }, n.prototype.getIndexInParent = function (t, e, n, o) {
                var r = t.getParent();
                if (r) {
                    var i = null == r ? void 0 : r.indexOfChild(t);
                    return e.dir = this.getDirection(t.element, r.element), i += 'after' == e.determinePlacement(n, o) ? 1 : 0
                }
            }, n.prototype.triggerDragValidation = function (t, e) {
                var n = this.sourceNodes[0];
                return this.em.trigger('sorter:drag:validation', {
                    valid: t,
                    src: null == n ? void 0 : n.element,
                    srcModel: null == n ? void 0 : n.model,
                    trg: e.element,
                    trgModel: e.model
                }), n
            }, n.prototype.cleanupEventListeners = function () {
                var t = this.containerContext.container;
                (0, Z.AU)(t, 'dragstart', this.onDragStart), (0, Z.AU)(t, 'mousemove dragover', this.onMove), (0, Z.AU)(this.containerContext.document, 'mouseup dragend touchend', this.endDrag)
            }, n.prototype.getDirection = function (t, e) {
                var n;
                return n = this.dragDirection === Hn.A.Vertical || this.dragDirection !== Hn.A.Horizontal && function (t, e) {
                    if ((0, Z.ir)(t)) return !1;
                    var n = t.style || {}, o = (0, l["default"])(t), r = (0, l["default"])(e);
                    if (n.overflow && 'visible' !== n.overflow) return !1;
                    var i = o.css('float');
                    return (!i || 'none' === i) && ('flex' !== r.css('display') || 'column' === r.css('flex-direction')) && !!function (t) {
                        switch (t) {
                            case'static':
                            case'relative':
                            case'':
                                return !0;
                            default:
                                return !1
                        }
                    }(n.position) && (function (t) {
                        return ['TR', 'TBODY', 'THEAD', 'TFOOT'].includes(t.tagName)
                    }(t) || function (t) {
                        var e = t.css('display');
                        return ['block', 'list-item', 'table', 'flex', 'grid'].includes(e)
                    }(o))
                }(t, e), n
            }, n.prototype.getChildrenDim = function (e) {
                var n = this, o = [], r = e.element;
                if (!r) return [];
                var i = e.getChildren();
                return i && 0 !== i.length ? ((0, t.each)(i, (function (t, e) {
                    var i = t.element;
                    if (i && ((0, Z.ir)(i) || ud(i, n.containerContext.itemSel))) {
                        var a = n.getDim(i);
                        a.dir = n.getDirection(i, r), o.push(a)
                    }
                })), o) : []
            }, n.prototype.getMousePositionRelativeToContainer = function (t, e) {
                var n = e - this.containerOffset.top + this.containerContext.container.scrollTop,
                    o = t - this.containerOffset.left + this.containerContext.container.scrollLeft;
                if (this.positionOptions.canvasRelative) {
                    var r = this.em.Canvas.getMouseRelativeCanvas({clientX: t, clientY: e}, {noScroll: 1});
                    o = r.x, n = r.y
                }
                return {mouseXRelative: o, mouseYRelative: n}
            }, n.prototype.cacheContainerPosition = function () {
                var t = cd(this.containerContext.container),
                    e = this.positionOptions.windowMargin ? Math.abs(t.top) : t.top,
                    n = this.positionOptions.windowMargin ? Math.abs(t.left) : t.left;
                this.containerOffset = {top: e, left: n}
            }, n.prototype.getDim = function (t) {
                var e, n, o, r, i = this.em, a = this.positionOptions.relative, s = this.positionOptions.windowMargin,
                    l = null == i ? void 0 : i.Canvas, c = l ? l.getElementOffsets(t) : {};
                if (this.positionOptions.canvasRelative && this.em) {
                    var u = l.getElementPos(t, {noScroll: 1});
                    e = u.top, n = u.left, o = u.height, r = u.width
                } else {
                    var p = cd(t);
                    e = a ? t.offsetTop : p.top - (s ? -1 : 1) * this.containerOffset.top, n = a ? t.offsetLeft : p.left - (s ? -1 : 1) * this.containerOffset.left, o = t.offsetHeight, r = t.offsetWidth
                }
                return new vd({top: e, left: n, height: o, width: r, offsets: c})
            }, n
        }(u.Ss), md = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), bd = function (t) {
            function e(e) {
                var n = t.call(this) || this;
                return n.pfx = e.pfx || '', n.allowNesting = e.allowNesting || !1, n.container = e.container, n.setElement(e.el), n.offset = {
                    top: e.offset.top || 0,
                    left: e.offset.left || 0
                }, n.moveLimiter = new dd(100), n
            }

            return md(e, t), e.prototype.show = function () {
                this.el.style.display = 'block'
            }, e.prototype.hide = function () {
                this.moveLimiter.clearTimeout(), this.el.style.display = 'none'
            }, e.prototype.move = function (t, e) {
                var n = this, o = {elementDimension: t, placement: e};
                this.moveLimiter.updateArgs(o), this.moveLimiter.execute((function (t) {
                    var e = t.elementDimension, o = t.placement;
                    n._move(e, o)
                }))
            }, e.prototype._move = function (t, e) {
                var n = 0, o = 'px', r = 0, i = 0, a = '', s = '';
                this.setOrientationForDimension(t);
                var l = t.top, c = t.left, u = t.height, p = t.width, d = t.dir, f = t.offsets;
                if ('inside' === e) {
                    if (this.setOrientation('horizontal'), !this.allowNesting) return void this.hide();
                    var h = 5, v = (null == f ? void 0 : f.paddingTop) || h,
                        g = (null == f ? void 0 : f.paddingLeft) || h, y = (null == f ? void 0 : f.borderTopWidth) || 0,
                        m = (null == f ? void 0 : f.borderLeftWidth) || 0,
                        b = m + ((null == f ? void 0 : f.borderRightWidth) || 0);
                    r = l + v + y, i = c + g + m, a = Math.max(p - 2 * g - b, 1) + 'px', s = 'auto'
                } else d ? (a = p + o, s = 'auto', r = 'before' === e ? l - n : l + u - n, i = c) : (a = 'auto', s = u - 2 * n + o, r = l + n, i = 'before' === e ? c - n : c + p - n, this.setOrientation('vertical'));
                this.updateStyles(r, i, a, s), this.adjustOffset()
            }, e.prototype.setOrientationForDimension = function (t) {
                this.el.classList.remove('vertical'), this.el.classList.add('horizontal'), t && !t.dir && this.setOrientation('vertical')
            }, e.prototype.setOrientation = function (t) {
                this.el.classList.remove('horizontal'), this.el.classList.remove('vertical'), this.el.classList.add(t)
            }, e.prototype.updateStyles = function (t, e, n, o) {
                this.el.style.top = t + 'px', this.el.style.left = e + 'px', n && (this.el.style.width = n), o && (this.el.style.height = o)
            }, e.prototype.adjustOffset = function () {
                this.$el.css('top', '+=' + this.offset.top + 'px'), this.$el.css('left', '+=' + this.offset.left + 'px')
            }, e
        }(u.Ss), _d = void 0 && (void 0).__assign || function () {
            return _d = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, _d.apply(this, arguments)
        }, wd = function () {
            function e(e) {
                var n = function (t) {
                    var e = {
                        containerContext: {
                            container: '',
                            placeholderElement: '',
                            containerSel: '*',
                            itemSel: '*',
                            pfx: '',
                            document
                        },
                        positionOptions: {
                            borderOffset: 10,
                            relative: !1,
                            windowMargin: 0,
                            offsetTop: 0,
                            offsetLeft: 0,
                            scale: 1,
                            canvasRelative: !1
                        },
                        dragBehavior: {dragDirection: Hn.A.Vertical, nested: !1, selectOnEnd: !0},
                        eventHandlers: {}
                    };
                    return ld(ld(ld({}, e), t), {
                        containerContext: ld(ld({}, e.containerContext), t.containerContext),
                        positionOptions: ld(ld({}, e.positionOptions), t.positionOptions),
                        dragBehavior: ld(ld({}, e.dragBehavior), t.dragBehavior),
                        eventHandlers: ld(ld({}, e.eventHandlers), t.eventHandlers)
                    })
                }(e);
                (0, t.bindAll)(this, 'startSort', 'cancelDrag', 'recalculateTargetOnScroll', 'rollback', 'updateOffset', 'handlePlaceholderMove', 'finalizeMove'), this.containerContext = n.containerContext, this.positionOptions = n.positionOptions, this.dragBehavior = n.dragBehavior, this.eventHandlers = _d(_d({}, n.eventHandlers), {
                    onPlaceholderPositionChange: this.handlePlaceholderMove,
                    onEnd: this.finalizeMove
                }), this.em = e.em, this.treeClass = e.treeClass, this.updateOffset(), this.em.on(this.em.Canvas.events.refresh, this.updateOffset), this.placeholder = this.createPlaceholder(), this.dropLocationDeterminer = new yd({
                    em: this.em,
                    treeClass: this.treeClass,
                    containerContext: this.containerContext,
                    positionOptions: this.positionOptions,
                    dragDirection: this.dragBehavior.dragDirection,
                    eventHandlers: this.eventHandlers
                })
            }

            return e.prototype.startSort = function (t) {
                var e, n, o, r, i, a, s, l = this.getSourceNodes(t), c = l.sourceNodes, u = l.sourcesWithModel;
                this.sourceNodes = c, this.dropLocationDeterminer.startSort(c), this.bindDragEventHandlers(), null === (n = (e = this.eventHandlers).onStartSort) || void 0 === n || n.call(e, this.sourceNodes, this.containerContext.container);
                var p = null === (o = this.sourceNodes[0]) || void 0 === o ? void 0 : o.model;
                null === (i = (r = this.eventHandlers).legacyOnStartSort) || void 0 === i || i.call(r, {
                    sorter: this,
                    target: p,
                    parent: p && (null === (a = p.parent) || void 0 === a ? void 0 : a.call(p)),
                    index: p && (null === (s = p.index) || void 0 === s ? void 0 : s.call(p))
                }), this.em.trigger('sorter:drag:start', t[0], u[0])
            }, e.prototype.validTarget = function (t, e, n) {
                if (!t) return !1;
                var o = (0, l["default"])(t).data('model');
                if (!o) return !1;
                var r = new this.treeClass(o);
                return this.getSourceNodes(e).sourceNodes.some((function (t) {
                    return r.canMove(t, n)
                }))
            }, e.prototype.getSourceNodes = function (t) {
                var e = this, n = t.filter((function (t) {
                    return !!t.dragSource || e.findValidSourceElement(t.element)
                })).map((function (t) {
                    var e, n;
                    return {
                        model: (null === (e = t.dragSource) || void 0 === e ? void 0 : e.model) || (null === (n = (0, l["default"])(t.element)) || void 0 === n ? void 0 : n.data('model')),
                        content: t.dragSource
                    }
                }));
                return {
                    sourceNodes: n.sort((function (t, e) {
                        return function (t, e) {
                            var n = pd(t), o = pd(e), r = o.filter((function (t) {
                                return n.includes(t)
                            }))[0];
                            if (!r) return t.model.index() - e.model.index();
                            var i = o[o.indexOf(r) - 1];
                            return n[n.indexOf(r) - 1].index() - i.index()
                        }(t.model, e.model)
                    })).map((function (t) {
                        return new e.treeClass(t.model, t.content)
                    })), sourcesWithModel: n
                }
            }, e.prototype.recalculateTargetOnScroll = function () {
                this.dropLocationDeterminer.recalculateTargetOnScroll()
            }, e.prototype.cancelDrag = function () {
                this.triggerNullOnEndMove(!0), this.dropLocationDeterminer.cancelDrag()
            }, e.prototype.endDrag = function () {
                this.dropLocationDeterminer.endDrag()
            }, e.prototype.handlePlaceholderMove = function (t, e) {
                this.ensurePlaceholderElement(), this.updatePlaceholderPosition(t, e)
            }, e.prototype.createPlaceholder = function () {
                return new bd({
                    container: this.containerContext.container,
                    allowNesting: this.dragBehavior.nested,
                    pfx: this.containerContext.pfx,
                    el: this.containerContext.placeholderElement,
                    offset: {top: this.positionOptions.offsetTop, left: this.positionOptions.offsetLeft}
                })
            }, e.prototype.ensurePlaceholderElement = function () {
                var t = this.placeholder.el, e = this.containerContext.container;
                t.ownerDocument.contains(t) || e.append(this.placeholder.el)
            }, e.prototype.updateOffset = function () {
                var t, e = (null === (t = this.em) || void 0 === t ? void 0 : t.get('canvasOffset')) || {};
                this.positionOptions.offsetTop = e.top, this.positionOptions.offsetLeft = e.left
            }, e.prototype.findValidSourceElement = function (t) {
                return t && !ud(t, "".concat(this.containerContext.itemSel, ", ").concat(this.containerContext.containerSel)) && (t = function (t, e) {
                    if (t) for (var n = t.parentNode; n && 1 === n.nodeType;) {
                        if (ud(n, e)) return n;
                        n = n.parentNode
                    }
                }(t, this.containerContext.itemSel)), t
            }, e.prototype.bindDragEventHandlers = function () {
                (0, Z.on)(this.containerContext.document, 'keydown', this.rollback)
            }, e.prototype.updatePlaceholderPosition = function (t, e) {
                this.placeholder.move(t, e)
            }, e.prototype.cleanupEventListeners = function () {
                (0, Z.AU)(this.containerContext.document, 'keydown', this.rollback)
            }, e.prototype.finalizeMove = function () {
                this.cleanupEventListeners(), this.placeholder.hide(), delete this.sourceNodes
            }, e.prototype.rollback = function (t) {
                (0, Z.AU)(this.containerContext.document, 'keydown', this.rollback);
                'Escape' === t.key && this.cancelDrag()
            }, e.prototype.triggerNullOnEndMove = function (t) {
                var e, n, o, r, i, a = null === (e = this.sourceNodes) || void 0 === e ? void 0 : e[0].model, s = {
                    target: a,
                    parent: a && (null === (n = a.parent) || void 0 === n ? void 0 : n.call(a)),
                    index: a && (null === (o = a.index) || void 0 === o ? void 0 : o.call(a))
                };
                null === (i = (r = this.eventHandlers).legacyOnEndMove) || void 0 === i || i.call(r, null, this, _d(_d({}, s), {cancelled: t}))
            }, e
        }();
        const xd = wd;
        var Cd = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Sd = void 0 && (void 0).__assign || function () {
            return Sd = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Sd.apply(this, arguments)
        }, Od = {id: 'sorter-target', type: W.F.Target}, Td = function (e) {
            function n(n) {
                var o = n.em, r = n.treeClass, i = n.containerContext, a = n.dragBehavior, s = n.positionOptions,
                    l = void 0 === s ? {} : s, c = n.eventHandlers, u = void 0 === c ? {} : c, p = e.call(this, {
                        em: o,
                        treeClass: r,
                        containerContext: i,
                        positionOptions: l,
                        dragBehavior: a,
                        eventHandlers: Sd(Sd({}, u), {
                            onStartSort: function (t, e) {
                                var n;
                                null === (n = u.onStartSort) || void 0 === n || n.call(u, t, e), p.onStartSort()
                            }, onDrop: function (t, e, n) {
                                var o;
                                null === (o = u.onDrop) || void 0 === o || o.call(u, t, e, n), p.onDrop(t, e, n)
                            }, onTargetChange: function (t, e) {
                                var n;
                                null === (n = u.onTargetChange) || void 0 === n || n.call(u, t, e), p.onTargetChange(t, e)
                            }, onMouseMove: function (t) {
                                var e;
                                null === (e = u.onMouseMove) || void 0 === e || e.call(u, t), p.onMouseMove(t)
                            }
                        })
                    }) || this;
                return p.targetIsText = !1, p.onMouseMove = function (t) {
                    var e;
                    p.targetIsText && (null === (e = p.sourceNodes) || void 0 === e ? void 0 : e.some((function (t) {
                        return t.isTextable()
                    }))) && p.updateTextViewCursorPosition(t)
                }, p.onDrop = function (t, e, n) {
                    var o = 'number' == typeof n ? n : -1;
                    t && e.length > 0 ? 0 === p.handleNodeAddition(t, e, o).length && p.triggerNullOnEndMove(!1) : p.triggerNullOnEndMove(!0);
                    null == t || t.restNodeState(), p.placeholder.hide()
                }, p.onTargetChange = function (t, e) {
                    var n;
                    null == t || t.restNodeState();
                    var o = p.em.Canvas;
                    if (!e) return p.placeholder.hide(), void o.removeSpots(Od);
                    null == e || e.setSelectedParentState(), p.targetIsText = e.isTextNode(), p.targetIsText && (null === (n = p.sourceNodes) || void 0 === n ? void 0 : n.some((function (t) {
                        return t.isTextable()
                    }))) ? (e.setContentEditable(!0), p.placeholder.hide()) : p.placeholder.show(), [W.F.Select, W.F.Hover, W.F.Spacing].forEach((function (t) {
                        return o.removeSpots({type: t})
                    })), o.addSpot(Sd(Sd({}, Od), {component: e.model}))
                }, (0, t.bindAll)(p, 'handleScrollEvent'), p
            }

            return Cd(n, e), n.prototype.onStartSort = function () {
                this.em.clearSelection(), this.setAutoCanvasScroll(!0)
            }, n.prototype.bindDragEventHandlers = function () {
                this.em.on('frame:scroll', this.handleScrollEvent), e.prototype.bindDragEventHandlers.call(this)
            }, n.prototype.cleanupEventListeners = function () {
                this.em.off('frame:scroll', this.handleScrollEvent), e.prototype.cleanupEventListeners.call(this)
            }, n.prototype.handleScrollEvent = function () {
                for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
                var o = null === (t = null == e ? void 0 : e[0]) || void 0 === t ? void 0 : t.frame;
                this.em.Canvas.getCanvasView().frame === o && this.recalculateTargetOnScroll()
            }, n.prototype.handleNodeAddition = function (t, e, n) {
                var o = this;
                return e.reduce((function (e, r) {
                    if (!t.canMove(r, n)) return e;
                    if (o.isPositionChanged(t, r, n)) {
                        var i = o.moveNode(t, r, n), a = i.index, s = i.addedNode;
                        e.push(s), n = a
                    }
                    return n++, e
                }), [])
            }, n.prototype.isPositionChanged = function (t, e, n) {
                var o = e.getParent(), r = o ? o.indexOfChild(e) : -1;
                (null == o ? void 0 : o.model.cid) === t.model.cid && r < n && n--;
                var i = (null == o ? void 0 : o.model.cid) === t.model.cid, a = r === n,
                    s = this.targetIsText && e.isTextable();
                return !(i && a && !s)
            }, n.prototype.moveNode = function (t, e, n) {
                var o = e.getParent();
                if (o) {
                    var r = o.indexOfChild(e);
                    o.removeChildAt(r, {temporary: !0}), o.model.cid === t.model.cid && r < n && n--
                }
                var i = t.addChildAt(e, n, {action: 'move-component'});
                return i && this.triggerEndMoveEvent(i), {addedNode: i, index: n}
            }, n.prototype.triggerEndMoveEvent = function (t) {
                var e, n, o, r, i, a;
                null === (n = (e = this.eventHandlers).legacyOnEndMove) || void 0 === n || n.call(e, t.model, this, {
                    target: t.model,
                    parent: t.model && (null === (r = (o = t.model).parent) || void 0 === r ? void 0 : r.call(o)),
                    index: t.model && (null === (a = (i = t.model).index) || void 0 === a ? void 0 : a.call(i))
                })
            }, n.prototype.finalizeMove = function () {
                var t, n;
                null === (t = this.em) || void 0 === t || t.Canvas.removeSpots(Od), null === (n = this.sourceNodes) || void 0 === n || n.forEach((function (t) {
                    return t.restNodeState()
                })), this.setAutoCanvasScroll(!1), e.prototype.finalizeMove.call(this)
            }, n.prototype.updateTextViewCursorPosition = function (t) {
                var e = this.em;
                if (e) {
                    var n = e.Canvas, o = n.getDocument(), r = null, i = (0, Z.G2)(t);
                    if (o.caretPositionFromPoint) {
                        var a = o.caretPositionFromPoint(i.clientX, i.clientY);
                        a && (r = o.createRange()).setStart(a.offsetNode, a.offset)
                    } else o.caretRangeFromPoint ? r = o.caretRangeFromPoint(i.clientX, i.clientY) : t.rangeParent && (r = o.createRange()).setStart(t.rangeParent, t.rangeOffset);
                    var s = n.getWindow().getSelection();
                    n.getFrameEl().focus(), null == s || s.removeAllRanges(), r && (null == s || s.addRange(r))
                }
            }, n.prototype.setAutoCanvasScroll = function (t) {
                var e = this.em, n = null == e ? void 0 : e.Canvas;
                n && (t ? n.startAutoscroll() : n.stopAutoscroll())
            }, n
        }(xd);
        const Pd = Td;
        var Ed = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), kd = void 0 && (void 0).__assign || function () {
            return kd = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, kd.apply(this, arguments)
        }, Ad = function (t) {
            function n() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ed(n, t), n.prototype.defaults = function () {
                return {values: {}}
            }, n.prototype.initialize = function () {
                var t = this.collection;
                this.prop = null == t ? void 0 : t.prop
            }, n.prototype.getId = function () {
                return this.cid
            }, n.prototype.getIndex = function () {
                var t = this.collection;
                return t ? t.indexOf(this) : -1
            }, n.prototype.getValues = function (t) {
                void 0 === t && (t = {});
                var n = this.get('values');
                return t.camelCase ? Object.keys(n).reduce((function (t, o) {
                    return t[(0, e.camelCase)(o)] = n[o], t
                }), {}) : n
            }, n.prototype.getLabel = function () {
                var t;
                return null === (t = this.prop) || void 0 === t ? void 0 : t.getLayerLabel(this)
            }, n.prototype.isSelected = function () {
                var t;
                return (null === (t = this.prop) || void 0 === t ? void 0 : t.getSelectedLayer()) === this
            }, n.prototype.select = function () {
                var t;
                return null === (t = this.prop) || void 0 === t ? void 0 : t.selectLayer(this)
            }, n.prototype.remove = function () {
                var t;
                return null === (t = this.prop) || void 0 === t ? void 0 : t.removeLayer(this)
            }, n.prototype.move = function (t) {
                var e;
                return null === (e = this.prop) || void 0 === e ? void 0 : e.moveLayer(this, t)
            }, n.prototype.getStylePreview = function (t) {
                var e;
                return void 0 === t && (t = {}), null === (e = this.prop) || void 0 === e ? void 0 : e.getStylePreview(this, t)
            }, n.prototype.hasPreview = function () {
                var t;
                return !!(null === (t = this.prop) || void 0 === t ? void 0 : t.get('preview'))
            }, n.prototype.upValues = function (t) {
                return void 0 === t && (t = {}), this.set('values', kd(kd({}, this.getValues()), t))
            }, n
        }(u.Kx);
        const jd = Ad;
        var Md = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Dd = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Md(e, t), e.prototype.initialize = function (t, e) {
                void 0 === e && (e = {}), this.prop = e.prop
            }, e
        }(u.pM);
        const Ld = Dd;
        Dd.prototype.model = jd;
        var Id = n(3178), Nd = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Rd = function (t) {
            function e(e) {
                return t.call(this, e) || this
            }

            return Nd(e, t), e.prototype.getChildren = function () {
                return this.model instanceof Ld ? this.model.models.map((function (t) {
                    return new e(t)
                })) : null
            }, e.prototype.getParent = function () {
                var t = this.model instanceof jd ? this.model.collection : null;
                return t ? new e(t) : null
            }, e.prototype.addChildAt = function (t, n) {
                if (this.model instanceof jd) throw Error('Cannot add a layer model to another layer model');
                return new e(this.model.add(t.model, {at: n}))
            }, e.prototype.removeChildAt = function (t) {
                if (this.model instanceof jd) throw Error('Cannot remove a layer model from another layer model');
                var e = this.model.at(t);
                e && this.model.remove(e)
            }, e.prototype.indexOfChild = function (t) {
                return t.model instanceof jd && this.model instanceof Ld ? this.model.indexOf(t.model) : -1
            }, e.prototype.canMove = function (t, e) {
                return this.model instanceof Ld && !!t.model
            }, Object.defineProperty(e.prototype, "view", {
                get: function () {
                    return this.model.view
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "element", {
                get: function () {
                    var t;
                    return null === (t = this.view) || void 0 === t ? void 0 : t.el
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "model", {
                get: function () {
                    return this._model
                }, enumerable: !1, configurable: !0
            }), e
        }(Id.$), Vd = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Fd = void 0 && (void 0).__assign || function () {
            return Fd = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Fd.apply(this, arguments)
        }, Hd = function (t) {
            function e(e) {
                var n = e.em, o = e.containerContext, r = e.dragBehavior, i = e.positionOptions,
                    a = void 0 === i ? {} : i, s = e.eventHandlers, l = void 0 === s ? {} : s, c = t.call(this, {
                        em: n,
                        treeClass: Rd,
                        containerContext: o,
                        positionOptions: a,
                        dragBehavior: r,
                        eventHandlers: Fd({
                            onStartSort: function (t, e) {
                                var n;
                                null === (n = l.onStartSort) || void 0 === n || n.call(l, t, e), c.onLayerStartSort(t)
                            }, onDrop: function (t, e, n) {
                                var o;
                                null === (o = l.onDrop) || void 0 === o || o.call(l, t, e, n), c.onLayerDrop(t, e, n)
                            }, onEnd: function () {
                                c.placeholder.hide()
                            }
                        }, l)
                    }) || this;
                return c.onLayerStartSort = function (t) {
                    c.em.clearSelection();
                    var e = t[0];
                    c.em.trigger('sorter:drag:start', null == e ? void 0 : e.element, null == e ? void 0 : e.model), c.placeholder.show()
                }, c.onLayerDrop = function (t, e, n) {
                    if (t) {
                        n = 'number' == typeof n ? n : -1;
                        for (var o = 0; o < e.length; o++) {
                            var r = e[o];
                            if (t.canMove(r, o)) {
                                var i = r.getParent(), a = -1;
                                i && (a = i.indexOfChild(r), i.removeChildAt(a)), n = a < n ? n - 1 : n, t.addChildAt(r, n)
                            }
                        }
                        c.placeholder.hide()
                    }
                }, c
            }

            return Vd(e, t), e
        }(xd);
        const Ud = Hd;
        var zd = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Bd = void 0 && (void 0).__assign || function () {
            return Bd = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Bd.apply(this, arguments)
        };
        const Wd = function (t) {
            function n(n) {
                var o = t.call(this, n, 'Utils') || this;
                return o.Sorter = Pd, o.Resizer = sd, o.Dragger = Qn.A, o.ComponentSorter = Pd, o.StyleManagerSorter = Ud, o.helpers = Bd({}, e), o
            }

            return zd(n, t), n.prototype.destroy = function () {
            }, n
        }(m);
        var $d, qd = {}, Gd = {16: !1, 18: !1, 17: !1, 91: !1}, Kd = 'all', Yd = {
            '⇧': 16,
            shift: 16,
            '⌥': 18,
            alt: 18,
            option: 18,
            '⌃': 17,
            ctrl: 17,
            control: 17,
            '⌘': 91,
            command: 91
        }, Xd = {
            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
        }, Jd = function (t) {
            return Xd[t] || t.toUpperCase().charCodeAt(0)
        }, Zd = [];
        for ($d = 1; $d < 20; $d++) Xd['f' + $d] = 111 + $d;

        function Qd(t, e) {
            for (var n = t.length; n--;) if (t[n] === e) return n;
            return -1
        }

        function tf(t, e) {
            if (t.length != e.length) return !1;
            for (var n = 0; n < t.length; n++) if (t[n] !== e[n]) return !1;
            return !0
        }

        var ef = {16: 'shiftKey', 18: 'altKey', 17: 'ctrlKey', 91: 'metaKey'};

        function nf(t) {
            for ($d in Gd) Gd[$d] = t[ef[$d]]
        }

        function of(t) {
            var e, n = t.keyCode, o = Qd(Zd, n);
            if (o >= 0 && Zd.splice(o, 1), 93 != n && 224 != n || (n = 91), n in Gd) for (e in Gd[n] = !1, Yd) Yd[e] == n && (af[e] = !1)
        }

        function rf() {
            for ($d in Gd) Gd[$d] = !1;
            for ($d in Yd) af[$d] = !1
        }

        function af(t, e, n) {
            var o, r;
            o = lf(t), void 0 === n && (n = e, e = 'all');
            for (var i = 0; i < o.length; i++) r = [], (t = o[i].split('+')).length > 1 && (r = cf(t), t = [t[t.length - 1]]), t = t[0], (t = Jd(t)) in qd || (qd[t] = []), qd[t].push({
                shortcut: o[i],
                scope: e,
                method: n,
                key: o[i],
                mods: r
            })
        }

        for ($d in Yd) af[$d] = !1;

        function sf() {
            return Kd || 'all'
        }

        function lf(t) {
            var e;
            return '' == (e = (t = t.replace(/\s/g, '')).split(','))[e.length - 1] && (e[e.length - 2] += ','), e
        }

        function cf(t) {
            for (var e = t.slice(0, t.length - 1), n = 0; n < e.length; n++) e[n] = Yd[e[n]];
            return e
        }

        function uf(t, e, n) {
            t.addEventListener ? t.addEventListener(e, n, !1) : t.attachEvent && t.attachEvent('on' + e, (function () {
                n(window.event)
            }))
        }

        af.setScope = function (t) {
            Kd = t || 'all'
        }, af.getScope = sf, af.deleteScope = function (t) {
            var e, n, o;
            for (e in qd) for (n = qd[e], o = 0; o < n.length;) n[o].scope === t ? n.splice(o, 1) : o++
        }, af.filter = function (t) {
            var e = (t.target || t.srcElement).tagName;
            return !('INPUT' == e || 'SELECT' == e || 'TEXTAREA' == e)
        }, af.isPressed = function (t) {
            return 'string' == typeof t && (t = Jd(t)), -1 != Qd(Zd, t)
        }, af.getPressedKeyCodes = function () {
            return Zd.slice(0)
        }, af.unbind = function (t, e) {
            var n, o, r, i, a, s = [];
            for (n = lf(t), i = 0; i < n.length; i++) {
                if ((o = n[i].split('+')).length > 1 && (s = cf(o)), t = o[o.length - 1], t = Jd(t), void 0 === e && (e = sf()), !qd[t]) return;
                for (r = 0; r < qd[t].length; r++) (a = qd[t][r]).scope === e && tf(a.mods, s) && (qd[t][r] = {})
            }
        }, af.handlers = qd, af.init = function (t) {
            uf(t.document, 'keydown', (function (t) {
                !function (t) {
                    var e, n, o, r, i, a;
                    if (e = t.keyCode, -1 == Qd(Zd, e) && Zd.push(e), 93 != e && 224 != e || (e = 91), e in Gd) for (o in Gd[e] = !0, Yd) Yd[o] == e && (af[o] = !0); else if (nf(t), af.filter.call(this, t) && e in qd) for (a = sf(), r = 0; r < qd[e].length; r++) if ((n = qd[e][r]).scope == a || 'all' == n.scope) {
                        for (o in i = n.mods.length > 0, Gd) (!Gd[o] && Qd(n.mods, +o) > -1 || Gd[o] && -1 == Qd(n.mods, +o)) && (i = !1);
                        (0 != n.mods.length || Gd[16] || Gd[18] || Gd[17] || Gd[91]) && !i || !1 === n.method(t, n) && (t.preventDefault ? t.preventDefault() : t.returnValue = !1, t.stopPropagation && t.stopPropagation(), t.cancelBubble && (t.cancelBubble = !0))
                    }
                }(t)
            })), uf(t.document, 'keyup', of), uf(t, 'focus', rf)
        };
        const pf = af;
        const df = function () {
            return {
                defaults: {
                    'core:undo': {keys: '⌘+z, ctrl+z', handler: 'core:undo', opts: {prevent: !0}},
                    'core:redo': {keys: '⌘+shift+z, ctrl+shift+z', handler: 'core:redo', opts: {prevent: !0}},
                    'core:copy': {keys: '⌘+c, ctrl+c', handler: 'core:copy'},
                    'core:paste': {keys: '⌘+v, ctrl+v', handler: 'core:paste'},
                    'core:component-next': {keys: 's', handler: 'core:component-next'},
                    'core:component-prev': {keys: 'w', handler: 'core:component-prev'},
                    'core:component-enter': {keys: 'd', handler: 'core:component-enter'},
                    'core:component-exit': {keys: 'a', handler: 'core:component-exit'},
                    'core:component-delete': {
                        keys: 'backspace, delete',
                        handler: 'core:component-delete',
                        opts: {prevent: !0}
                    }
                }
            }
        };
        var ff = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), hf = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        };
        (0, e.hasWin)() && pf.init(window);
        var vf = function (e) {
            function n(t) {
                var n = e.call(this, t, 'Keymaps', df()) || this;
                return n.keymaster = pf, n.keymaps = {}, n
            }

            return ff(n, e), n.prototype.onLoad = function () {
                if (!this.em.isHeadless) {
                    var t = this.config.defaults;
                    for (var e in t) {
                        var n = t[e];
                        this.add(e, n.keys, n.handler, n.opts || {})
                    }
                }
            }, n.prototype.add = function (e, n, o, r) {
                void 0 === r && (r = {});
                var i = this.em, a = i.Commands, s = i.getEditor(), l = i.Canvas, c = {id: e, keys: n, handler: o};
                return this.keymaps[e] && this.remove(e), this.keymaps[e] = c, pf(n, (function (n, c) {
                    var u, p = {event: n, h: c}, d = (0, t.isString)(o) ? a.get(o) : o;
                    if (!i.isEditing() && !s.Canvas.isInputFocused() || r.force) {
                        r.prevent && (null === (u = l.getCanvasView()) || void 0 === u || u.preventDefault(n)), (0, t.isFunction)(d) ? d(s, 0, p) : a.runCommand(d, p);
                        var f = [e, c.shortcut, n];
                        i.trigger.apply(i, hf(['keymap:emit'], f, !1)), i.trigger.apply(i, hf(["keymap:emit:".concat(e)], f, !1))
                    }
                }), void 0), i.trigger('keymap:add', c), c
            }, n.prototype.get = function (t) {
                return this.keymaps[t]
            }, n.prototype.getAll = function () {
                return this.keymaps
            }, n.prototype.remove = function (t) {
                var e = this.em, n = this.get(t);
                if (n) return delete this.keymaps[t], n.keys.split(', ').forEach((function (t) {
                    pf.unbind(t.trim())
                })), null == e || e.trigger('keymap:remove', n), n
            }, n.prototype.removeAll = function () {
                var t = this;
                return Object.keys(this.keymaps).forEach((function (e) {
                    return t.remove(e)
                })), pf.handlers = {}, this
            }, n.prototype.destroy = function () {
                this.removeAll(), this.keymaps = {}
            }, n
        }(m);
        const gf = vf;
        const yf = function () {
            return {stylePrefix: 'mdl-', title: '', content: '', backdrop: !0, custom: !1, extend: {}}
        };
        var mf = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const bf = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return mf(e, t), e.prototype.defaults = function () {
                return {title: '', content: '', attributes: {}, open: !1}
            }, e.prototype.open = function () {
                this.set('open', !0)
            }, e.prototype.close = function () {
                this.set('open', !1)
            }, e
        }(x.A);
        var _f = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), wf = void 0 && (void 0).__assign || function () {
            return wf = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, wf.apply(this, arguments)
        }, xf = function (t) {
            function e(e) {
                var n = t.call(this, e) || this, o = n.model;
                return n.listenTo(o, 'change:open', n.updateOpen), n.listenTo(o, 'change:title', n.updateTitle), n.listenTo(o, 'change:content', n.updateContent), n
            }

            return _f(e, t), e.prototype.template = function (t) {
                var e = t.pfx, n = t.ppfx, o = t.content, r = t.title;
                return "<div class=\"".concat(e, "dialog ").concat(n, "one-bg ").concat(n, "two-color\">\n      <div class=\"").concat(e, "header\">\n        <div class=\"").concat(e, "title\">").concat(r, "</div>\n        <div class=\"").concat(e, "btn-close\" data-close-modal>&Cross;</div>\n      </div>\n      <div class=\"").concat(e, "content\">\n        <div id=\"").concat(e, "c\">").concat(o, "</div>\n        <div style=\"clear:both\"></div>\n      </div>\n    </div>\n    <div class=\"").concat(e, "collector\" style=\"display: none\"></div>")
            }, e.prototype.events = function () {
                return {click: 'onClick', 'click [data-close-modal]': 'hide'}
            }, e.prototype.onClick = function (t) {
                this.config.backdrop && t.target === this.el && this.hide()
            }, e.prototype.getCollector = function () {
                return this.$collector || (this.$collector = this.$el.find('.' + this.pfx + 'collector')), this.$collector
            }, e.prototype.getContent = function () {
                var t = this.pfx;
                return this.$content || (this.$content = this.$el.find(".".concat(t, "content #").concat(t, "c"))), this.$content
            }, e.prototype.getTitle = function (t) {
                return void 0 === t && (t = {}), this.$title || (this.$title = this.$el.find('.' + this.pfx + 'title')), t.$ ? this.$title : this.$title.get(0)
            }, e.prototype.updateContent = function () {
                var t = this.getContent(), e = t.children(), n = this.getCollector(), o = this.model.get('content');
                e.length && n.append(e), t.empty().append(o)
            }, e.prototype.updateTitle = function () {
                var t = this.getTitle({$: !0});
                t && t.empty().append(this.model.get('title'))
            }, e.prototype.updateOpen = function () {
                this.el.style.display = this.model.get('open') ? '' : 'none'
            }, e.prototype.hide = function () {
                this.model.close()
            }, e.prototype.show = function () {
                this.model.open()
            }, e.prototype.updateAttr = function (t) {
                var e = this, n = e.pfx, o = e.$el, r = e.el, i = [].slice.call(r.attributes).map((function (t) {
                    return t.name
                }));
                o.removeAttr(i.join(' ')), o.attr(wf(wf({}, t || {}), {class: "".concat(n, "container ").concat(t && t.class || '').trim()}))
            }, e.prototype.render = function () {
                var t = this.$el, e = this.model.toJSON();
                return e.pfx = this.pfx, e.ppfx = this.ppfx, t.html(this.template(e)), this.updateAttr(), this.updateOpen(), this
            }, e
        }(J);
        const Cf = xf;
        var Sf = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Of = function (e) {
            function n(n) {
                var o = e.call(this, n, 'Modal', yf()) || this;
                return o.model = new bf(o), o.model.on('change:open', (function (t, e) {
                    n.trigger("modal:".concat(e ? 'open' : 'close'))
                })), o.model.on('change', (0, t.debounce)((function () {
                    var e = o._evData(), r = o.config.custom;
                    (0, t.isFunction)(r) && r(e), n.trigger('modal', e)
                }), 0)), o
            }

            return Sf(n, e), n.prototype._evData = function () {
                var e = this, n = this.getTitle(), o = this.getContent(), r = this.model.attributes;
                return {
                    open: r.open,
                    attributes: r.attributes,
                    title: (0, t.isString)(n) ? (0, Z.GZ)(n) : n,
                    content: (0, t.isString)(o) ? (0, Z.GZ)(o) : o.get ? o.get(0) : o,
                    close: function () {
                        e.close()
                    }
                }
            }, n.prototype.postRender = function (t) {
                var e = t.model.config.el || t.el, n = this.render();
                n && (null == e || e.appendChild(n))
            }, n.prototype.open = function (t) {
                void 0 === t && (t = {});
                var e = t.attributes || {};
                return t.title && this.setTitle(t.title), t.content && this.setContent(t.content), this.model.set('attributes', e), this.model.open(), this.modal && this.modal.updateAttr(e), this
            }, n.prototype.close = function () {
                return this.model.close(), this
            }, n.prototype.onceClose = function (t) {
                return this.em.once('modal:close', t), this
            }, n.prototype.onceOpen = function (t) {
                return this.em.once('modal:open', t), this
            }, n.prototype.isOpen = function () {
                return !!this.model.get('open')
            }, n.prototype.setTitle = function (t) {
                return this.model.set('title', t), this
            }, n.prototype.getTitle = function () {
                return this.model.get('title')
            }, n.prototype.setContent = function (t) {
                return this.model.set('content', ' '), this.model.set('content', t), this
            }, n.prototype.getContent = function () {
                return this.model.get('content')
            }, n.prototype.getContentEl = function () {
                var t;
                return null === (t = this.modal) || void 0 === t ? void 0 : t.getContent().get(0)
            }, n.prototype.getModel = function () {
                return this.model
            }, n.prototype.render = function () {
                var t;
                if (!this.config.custom) {
                    var e = Cf.extend(this.config.extend), n = this.modal && this.modal.el;
                    return this.modal = new e({
                        el: n,
                        model: this.model,
                        config: this.config
                    }), null === (t = this.modal) || void 0 === t ? void 0 : t.render().el
                }
            }, n.prototype.destroy = function () {
                var t;
                null === (t = this.modal) || void 0 === t || t.remove()
            }, n
        }(m);
        const Tf = Of;
        var Pf = 'sw-visibility', Ef = 'export-template', kf = 'open-sm', Af = 'open-tm', jf = 'open-layers',
            Mf = 'open-blocks', Df = 'fullscreen', Lf = 'preview';
        const If = function () {
            return {
                stylePrefix: 'pn-',
                defaults: [{id: 'commands', buttons: [{}]}, {
                    id: 'options',
                    buttons: [{
                        active: !0,
                        id: Pf,
                        className: 'fa fa-square-o',
                        command: 'core:component-outline',
                        context: Pf,
                        attributes: {title: 'View components'}
                    }, {
                        id: Lf,
                        className: 'fa fa-eye',
                        command: Lf,
                        context: Lf,
                        attributes: {title: 'Preview'}
                    }, {
                        id: Df,
                        className: 'fa fa-arrows-alt',
                        command: Df,
                        context: Df,
                        attributes: {title: 'Fullscreen'}
                    }, {id: Ef, className: 'fa fa-code', command: Ef, attributes: {title: 'View code'}}]
                }, {
                    id: 'views',
                    buttons: [{
                        id: kf,
                        className: 'fa fa-paint-brush',
                        command: kf,
                        active: !0,
                        togglable: !1,
                        attributes: {title: 'Open Style Manager'}
                    }, {
                        id: Af,
                        className: 'fa fa-cog',
                        command: Af,
                        togglable: !1,
                        attributes: {title: 'Settings'}
                    }, {
                        id: jf,
                        className: 'fa fa-bars',
                        command: jf,
                        togglable: !1,
                        attributes: {title: 'Open Layer Manager'}
                    }, {
                        id: Mf,
                        className: 'fa fa-th-large',
                        command: Mf,
                        togglable: !1,
                        attributes: {title: 'Open Blocks'}
                    }]
                }]
            }
        };
        var Nf = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Rf = function (t) {
            function e(e, n) {
                var o = t.call(this, e, n) || this;
                return o.get('buttons').length && o.set('buttons', new Hf(o.module, o.get('buttons'))), o
            }

            return Nf(e, t), e.prototype.defaults = function () {
                return {
                    id: '',
                    label: '',
                    tagName: 'span',
                    className: '',
                    command: '',
                    context: '',
                    buttons: [],
                    attributes: {},
                    options: {},
                    active: !1,
                    dragDrop: !1,
                    togglable: !0,
                    runDefaultCommand: !0,
                    stopDefaultCommand: !1,
                    disable: !1
                }
            }, Object.defineProperty(e.prototype, "className", {
                get: function () {
                    return this.get('className')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "command", {
                get: function () {
                    return this.get('command')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "active", {
                get: function () {
                    return this.get('active')
                }, set: function (t) {
                    this.set('active', t)
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "togglable", {
                get: function () {
                    return this.get('togglable')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "runDefaultCommand", {
                get: function () {
                    return this.get('runDefaultCommand')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "stopDefaultCommand", {
                get: function () {
                    return this.get('stopDefaultCommand')
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(e.prototype, "disable", {
                get: function () {
                    return this.get('disable')
                }, enumerable: !1, configurable: !0
            }), e
        }(x.A);
        var Vf = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ff = function (t) {
            function e(e, n) {
                return t.call(this, e, n, Rf) || this
            }

            return Vf(e, t), e.prototype.deactivateAllExceptOne = function (t, e) {
                this.forEach((function (n, o) {
                    n !== t && (n.set('active', !1), e && n.get('buttons').length && n.get('buttons').deactivateAllExceptOne(t, e))
                }))
            }, e.prototype.deactivateAll = function (t, e) {
                var n = t || '';
                this.forEach((function (t) {
                    t.get('context') == n && t !== e && t.set('active', !1, {fromCollection: !0})
                }))
            }, e.prototype.disableAllButtons = function (t) {
                var e = t || '';
                this.forEach((function (t, n) {
                    t.get('context') == e && t.set('disable', !0)
                }))
            }, e.prototype.disableAllButtonsExceptOne = function (t, e) {
                this.forEach((function (n, o) {
                    n !== t && (n.set('disable', !0), e && n.get('buttons').length && n.get('buttons').disableAllButtonsExceptOne(t, e))
                }))
            }, e
        }(E);
        const Hf = Ff;
        Ff.prototype.model = Rf;
        var Uf = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const zf = function (t) {
            function e(e, n) {
                var o = t.call(this, e, n) || this, r = o.get('buttons') || [];
                return o.buttons = new Hf(e, r), o
            }

            return Uf(e, t), e.prototype.defaults = function () {
                return {id: '', content: '', visible: !0, buttons: [], attributes: {}}
            }, Object.defineProperty(e.prototype, "buttons", {
                get: function () {
                    return this.get('buttons')
                }, set: function (t) {
                    this.set('buttons', t)
                }, enumerable: !1, configurable: !0
            }), e
        }(x.A);
        var Bf = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Wf = function (t) {
            function e(e, n) {
                return t.call(this, e, n, zf) || this
            }

            return Bf(e, t), e
        }(E);
        const $f = Wf;
        Wf.prototype.model = zf;
        var qf = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Gf = void 0 && (void 0).__assign || function () {
            return Gf = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Gf.apply(this, arguments)
        }, Kf = function (e) {
            function n(n) {
                var o = e.call(this, n) || this, r = o, i = r.model, a = r.em, s = r.pfx, l = r.ppfx, c = i.className,
                    u = i.attributes, p = u.command, d = u.listen;
                if (o.id = s + i.get('id'), o.activeCls = "".concat(s, "active ").concat(l, "four-color"), o.disableCls = "".concat(l, "disabled"), o.btnsVisCls = "".concat(s, "visible"), o.className = s + 'btn' + (c ? ' ' + c : ''), o.listenTo(i, 'change', o.render), o.listenTo(i, 'change:active updateActive', o.updateActive), o.listenTo(i, 'checkActive', o.checkActive), o.listenTo(i, 'change:bntsVis', o.updateBtnsVis), o.listenTo(i, 'change:attributes', o.updateAttributes), o.listenTo(i, 'change:className', o.updateClassName), o.listenTo(i, 'change:disable', o.updateDisable), a && (0, t.isString)(p) && d) {
                    var f = {fromListen: !0};
                    o.listenTo(a, "run:".concat(p), (function () {
                        return i.set('active', !0, f)
                    })), o.listenTo(a, "stop:".concat(p), (function () {
                        return i.set('active', !1, f)
                    }))
                }
                return a && a.get && (o.commands = a.get('Commands')), o
            }

            return qf(n, e), n.prototype.tagName = function () {
                return this.model.get('tagName')
            }, n.prototype.events = function () {
                return {click: 'clicked'}
            }, n.prototype.updateClassName = function () {
                var t = this.model, e = this.pfx, n = t.className, o = t.get('attributes').class,
                    r = "".concat(o || '', " ").concat(e, "btn ").concat(n || '');
                this.$el.attr('class', r.trim())
            }, n.prototype.updateAttributes = function () {
                var t = this, e = t.em, n = t.model, o = t.$el, r = n.get('attributes') || {},
                    i = e && e.t && e.t("panels.buttons.titles.".concat(n.id));
                o.attr(r), i && o.attr({title: i}), this.updateClassName()
            }, n.prototype.updateBtnsVis = function () {
                this.$buttons && (this.model.get('bntsVis') ? this.$buttons.addClass(this.btnsVisCls) : this.$buttons.removeClass(this.btnsVisCls))
            }, n.prototype.updateActive = function (e, n, o) {
                var r;
                void 0 === o && (o = {});
                var i = this, a = i.model, s = i.commands, l = i.$el, c = i.activeCls, u = o.fromCollection,
                    p = o.fromListen, d = a.get('context'), f = a.get('options'), h = a.command, v = {};
                h && (s && (0, t.isString)(h) ? v = s.get(h) || {} : (0, t.isFunction)(h) ? v = s.create({run: h}) : null !== h && (0, t.isObject)(h) && (v = s.create(h)), a.active ? (!u && (null === (r = a.collection) || void 0 === r || r.deactivateAll(d, a)), a.set('active', !0, {silent: !0}).trigger('checkActive'), !p && s.runCommand(v, Gf(Gf({}, f), {sender: a})), v.noStop && a.set('active', !1)) : (l.removeClass(c), !p && s.stopCommand(v, Gf(Gf({}, f), {
                    sender: a,
                    force: 1
                }))))
            }, n.prototype.updateDisable = function () {
                var t = this.disableCls, e = this.model.disable;
                this.$el[e ? 'addClass' : 'removeClass'](t)
            }, n.prototype.checkActive = function () {
                var t = this, e = t.model, n = t.$el, o = t.activeCls;
                e.active ? n.addClass(o) : n.removeClass(o)
            }, n.prototype.clicked = function () {
                var t = this.model;
                t.get('bntsVis') || t.disable || !t.command || this.toggleActive()
            }, n.prototype.toggleActive = function () {
                var t = this.model, e = this.em, n = t.active, o = t.togglable;
                n && !o || (t.active = !n, n ? t.runDefaultCommand && e.runDefault() : t.stopDefaultCommand && e.stopDefault())
            }, n.prototype.render = function () {
                var t = this.model, e = t.get('label'), n = this.$el;
                return !t.get('el') && n.empty(), this.updateAttributes(), e && n.append(e), this.checkActive(), this.updateDisable(), this
            }, n
        }(J);
        const Yf = Kf;
        var Xf = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const Jf = function (e) {
            function n(t) {
                var n = e.call(this, {collection: t}) || this;
                return n.listenTo(n.collection, 'add', n.addTo), n.listenTo(n.collection, 'reset remove', n.render), n.className = n.pfx + 'buttons', n
            }

            return Xf(n, e), n.prototype.addTo = function (t) {
                this.addToCollection(t)
            }, n.prototype.addToCollection = function (t, e) {
                var n = e || null, o = t.get('el'), r = new Yf({el: o, model: t}).render().el;
                return n ? n.appendChild(r) : this.$el.append(r), r
            }, n.prototype.render = function () {
                var e = this, n = document.createDocumentFragment();
                return this.$el.empty(), this.collection.each((function (t) {
                    return e.addToCollection(t, n)
                })), this.$el.append(n), this.$el.attr('class', (0, t.result)(this, 'className')), this
            }, n
        }(J);
        var Zf = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Qf = void 0 && (void 0).__assign || function () {
            return Qf = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Qf.apply(this, arguments)
        }, th = function (t) {
            function e(e) {
                var n = t.call(this, {model: e, el: e.get('el')}) || this;
                return n.className = n.pfx + 'panel', n.id = n.pfx + e.get('id'), n.listenTo(e, 'change:appendContent', n.appendContent), n.listenTo(e, 'change:content', n.updateContent), n.listenTo(e, 'change:visible', n.toggleVisible), e.view = n, n
            }

            return Zf(e, t), e.prototype.appendContent = function () {
                this.$el.append(this.model.get('appendContent'))
            }, e.prototype.updateContent = function () {
                this.$el.html(this.model.get('content'))
            }, e.prototype.toggleVisible = function () {
                this.model.get('visible') ? this.$el.removeClass("".concat(this.ppfx, "hidden")) : this.$el.addClass("".concat(this.ppfx, "hidden"))
            }, e.prototype.attributes = function () {
                return this.model.get('attributes')
            }, e.prototype.initResize = function () {
                var t = this.em, e = null == t ? void 0 : t.Editor, n = this.model.get('resizable');
                if (e && n) {
                    var o = !0 === n ? [!0, !0, !0, !0] : n, r = o.length, i = void 0, a = void 0, s = void 0, l = !1;
                    if (2 == r) i = (c = o)[0], s = c[0], a = c[1], l = c[1]; else if (4 == r) {
                        var c;
                        i = (c = o)[0], a = c[1], s = c[2], l = c[3]
                    }
                    var u = new e.Utils.Resizer(Qf({
                        tc: i,
                        cr: a,
                        bc: s,
                        cl: l,
                        tl: !1,
                        tr: !1,
                        bl: !1,
                        br: !1,
                        appendTo: this.el,
                        silentFrames: !0,
                        avoidContainerUpdate: !0,
                        prefix: e.getConfig().stylePrefix,
                        onEnd: function () {
                            t.Canvas.refresh({all: !0})
                        },
                        posFetcher: function (t, e) {
                            var n = e.target, o = t.style, r = u.getConfig(), i = r.keyWidth, a = r.keyHeight,
                                s = t.getBoundingClientRect(), l = 'container' == n, c = o[i], p = o[a];
                            return {
                                left: 0,
                                top: 0,
                                width: c && !l ? parseFloat(c) : s.width,
                                height: p && !l ? parseFloat(p) : s.height
                            }
                        }
                    }, n && 'boolean' != typeof n ? n : {}));
                    u.blur = function () {
                    }, u.focus(this.el)
                }
            }, e.prototype.render = function () {
                var t = this.model.buttons, e = this.$el, n = this.ppfx,
                    o = "".concat(this.className, " ").concat(this.id, " ").concat(n, "one-bg ").concat(n, "two-color");
                if (e.addClass(o), this.toggleVisible(), t.length) {
                    var r = new Jf(t);
                    e.append(r.render().el)
                }
                return e.append(this.model.get('content')), this
            }, e
        }(J);
        const eh = th;
        var nh = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const oh = function (t) {
            function e(e) {
                var n = t.call(this, {collection: e}) || this;
                return n.listenTo(e, 'add', n.addTo), n.listenTo(e, 'reset', n.render), n.listenTo(e, 'remove', n.onRemove), n.className = n.pfx + 'panels', n
            }

            return nh(e, t), e.prototype.onRemove = function (t) {
                var e = t.view;
                e && e.remove()
            }, e.prototype.addTo = function (t) {
                this.addToCollection(t)
            }, e.prototype.addToCollection = function (t, e) {
                var n = e || null, o = t.get('el'), r = new eh(t), i = r.render().el, a = t.get('appendTo');
                if (o) ; else if (a) {
                    var s = document.querySelector(a);
                    null == s || s.appendChild(i)
                } else n ? n.appendChild(i) : this.$el.append(i);
                return r.initResize(), i
            }, e.prototype.render = function () {
                var t = this, e = this.$el, n = document.createDocumentFragment();
                return e.empty(), this.collection.each((function (e) {
                    return t.addToCollection(e, n)
                })), e.append(n), e.attr('class', this.className), this
            }, e
        }(J);
        var rh = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ih = function (t) {
            function e(e) {
                var n = t.call(this, e, 'Panels', If()) || this;
                return n.panels = new $f(n, n.config.defaults), n
            }

            return rh(e, t), e.prototype.getPanels = function () {
                return this.panels
            }, e.prototype.getPanelsEl = function () {
                var t;
                return null === (t = this.PanelsViewObj) || void 0 === t ? void 0 : t.el
            }, e.prototype.addPanel = function (t) {
                return this.panels.add(t)
            }, e.prototype.removePanel = function (t) {
                return this.panels.remove(t)
            }, e.prototype.getPanel = function (t) {
                var e = this.panels.where({id: t});
                return e.length ? e[0] : null
            }, e.prototype.addButton = function (t, e) {
                var n = this.getPanel(t);
                return n ? n.buttons.add(e) : null
            }, e.prototype.removeButton = function (t, e) {
                var n = this.getPanel(t);
                return n && n.buttons.remove(e)
            }, e.prototype.getButton = function (t, e) {
                var n = this.getPanel(t);
                if (n) {
                    var o = n.buttons.where({id: e});
                    return o.length ? o[0] : null
                }
                return null
            }, e.prototype.render = function () {
                var t;
                return null === (t = this.PanelsViewObj) || void 0 === t || t.remove(), this.PanelsViewObj = new oh(this.panels), this.PanelsViewObj.render().el
            }, e.prototype.active = function () {
                this.getPanels().each((function (t) {
                    t.buttons.each((function (t) {
                        t.get('active') && t.trigger('updateActive')
                    }))
                }))
            }, e.prototype.disableButtons = function () {
                this.getPanels().each((function (t) {
                    t.buttons.each((function (t) {
                        t.get('disable') && t.trigger('change:disable')
                    }))
                }))
            }, e.prototype.destroy = function () {
                this.panels.reset(), this.panels.stopListening(), this.PanelsViewObj && this.PanelsViewObj.remove()
            }, e
        }(m);
        const ah = ih;
        const sh = function () {
            return {stylePrefix: 'cm-', optsCodeViewer: {}}
        };
        var lh = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ch = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        };
        const uh = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return lh(e, t), e.prototype.build = function (t, e) {
                void 0 === e && (e = {});
                var n = e.em, o = ch(e, ["em"]);
                if (e.cleanId && n) {
                    var r = n.Css.getAll().toJSON().map((function (t) {
                        var e = t.selectors, n = e && 1 === e.length && e.models[0];
                        return n && n.isId() && n.get('name')
                    })).filter(Boolean);
                    o.attributes || (o.attributes = function (t, e) {
                        var n = e.id;
                        return n && 'i' === n[0] && !t.get('script') && !t.get('script-export') && !t.get('attributes').id && r.indexOf(n) < 0 && delete e.id, e
                    })
                }
                return t.toHTML(o)
            }, e
        }(u.Kx);
        var ph = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), dh = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return ph(n, e), n.prototype.build = function (e) {
                var n = this, o = e.toJSON();
                return this.beforeEach(o), (0, t.each)(o, (function (t, e) {
                    var r = o[e];
                    if (r instanceof u.Kx) o[e] = n.build(r); else if (r instanceof u.pM) {
                        var i = r;
                        o[e] = [], i.length && i.forEach((function (t, r) {
                            o[e][r] = n.build(t)
                        }))
                    }
                })), o
            }, n.prototype.beforeEach = function (t) {
                delete t.status
            }, n
        }(u.Kx);
        const fh = dh;
        var hh = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();

        function vh(t) {
            var e;
            return 0 === ((null === (e = t.toString().match(/\{([\s\S]*)\}/m)) || void 0 === e ? void 0 : e[1]) || '').replace(/^\s*\/\/.*$/gm, '').trim().length
        }

        var gh = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return hh(n, e), n.prototype.mapModel = function (e) {
                var n, o = this, r = '', i = e.get('script-export') || e.get('script'), a = e.get('type'),
                    s = e.get('components'), l = e.getId();
                if (i) {
                    var c = e.get('attributes');
                    c = (0, t.extend)({}, c, {id: l}), e.set('attributes', c, {silent: !0});
                    var u = e.getScriptString(i), p = e.get('script-props');
                    if (e.get('scriptUpdated') && !p) this.mapJs[a + '-' + l] = {ids: [l], code: u}; else {
                        var d = void 0, f = this.mapJs[a];
                        if (p && (d = e.__getScriptProps()), f) f.ids.push(l), d && (f.props[l] = d); else {
                            var h = {ids: [l], code: u};
                            d && (h.props = ((n = {})[l] = d, n)), this.mapJs[a] = h
                        }
                    }
                }
                return s.forEach((function (t) {
                    r += o.mapModel(t)
                })), r
            }, n.prototype.build = function (t) {
                this.mapJs = {}, this.mapModel(t);
                var e = '';
                for (var n in this.mapJs) {
                    var o = this.mapJs[n];
                    if (o.code) if (o.props) {
                        if (vh(o.code)) continue;
                        e += "\n          var props = ".concat(JSON.stringify(o.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(o.code, ".bind(el))(props[el.id]);\n          }")
                    } else {
                        var r = '#' + o.ids.join(', #');
                        e += "\n          var items = document.querySelectorAll('".concat(r, "');\n          for (var i = 0, len = items.length; i < len; i++) {\n            (function(){\n").concat(o.code, "\n}.bind(items[i]))();\n          }")
                    }
                }
                return e
            }, n
        }(u.Kx);
        const yh = gh;
        var mh, bh = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), _h = void 0 && (void 0).__assign || function () {
            return _h = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, _h.apply(this, arguments)
        };
        (0, e.hasWin)() && (mh = n(4408), n(8253), n(7389), n(3640));
        var wh = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return bh(n, e), n.prototype.defaults = function () {
                return {
                    input: '',
                    label: '',
                    codeName: '',
                    theme: 'hopscotch',
                    readOnly: !0,
                    lineNumbers: !0,
                    autoFormat: !0
                }
            }, n.prototype.init = function (e) {
                return (0, t.bindAll)(this, 'onChange'), this.editor = mh.fromTextArea(e, _h({
                    dragDrop: !1,
                    lineWrapping: !0,
                    mode: this.get('codeName')
                }, this.attributes)), this.element = e, this.editor.on('change', this.onChange), this
            }, n.prototype.onChange = function () {
                this.trigger('update', this)
            }, n.prototype.getEditor = function () {
                return this.editor
            }, n.prototype.getElement = function () {
                return this.element
            }, n.prototype.setElement = function (t) {
                return this.element = t, this
            }, n.prototype.refresh = function () {
                return this.getEditor().refresh(), this
            }, n.prototype.focus = function () {
                return this.getEditor().focus(), this
            }, n.prototype.getContent = function () {
                var t = this.getEditor();
                return t && t.getValue()
            }, n.prototype.setContent = function (t, e) {
                var n = this;
                void 0 === e && (e = {});
                var o = this.editor;
                if (o) {
                    o.setValue(t);
                    var r = this.get('autoFormat');
                    o.autoFormatRange && (!0 === r || Array.isArray(r) && r.includes(this.get('codeName'))) && (mh.commands.selectAll(o), o.autoFormatRange(o.getCursor(!0), o.getCursor(!1)), mh.commands.goDocStart(o)), !e.noRefresh && setTimeout((function () {
                        return n.refresh()
                    }))
                }
            }, n
        }(u.Kx);
        const xh = wh;
        wh.prototype.CodeMirror = mh;
        var Ch = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Sh = void 0 && (void 0).__makeTemplateObject || function (t, e) {
            return Object.defineProperty ? Object.defineProperty(t, "raw", {value: e}) : t.raw = e, t
        }, Oh = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Ch(e, t), e.prototype.template = function (t) {
                var e = t.pfx, n = t.codeName, o = t.label;
                return r(Ph || (Ph = Sh(["\n      <div class=\"", "editor\" id=\"", "", "\">\n        <div id=\"", "title\">", "</div>\n        <div id=\"", "code\"></div>\n      </div>\n    "], ["\n      <div class=\"", "editor\" id=\"", "", "\">\n        <div id=\"", "title\">", "</div>\n        <div id=\"", "code\"></div>\n      </div>\n    "])), e, e, n, e, o, e)
            }, e.prototype.initialize = function (t) {
                this.config = t.config || {}, this.pfx = this.config.stylePrefix
            }, e.prototype.render = function () {
                var t, e, n = this, o = n.model, r = n.pfx, i = n.$el, a = o.toJSON(),
                    s = o.get('input') || (null === (e = (t = o).getElement) || void 0 === e ? void 0 : e.call(t));
                return a.pfx = r, i.html(this.template(a)), i.attr('class', "".concat(r, "editor-c")), i.find("#".concat(r, "code")).append(s), this
            }, e
        }(u.Ss);
        const Th = Oh;
        var Ph, Eh = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), kh = void 0 && (void 0).__assign || function () {
            return kh = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, kh.apply(this, arguments)
        }, Ah = 'CodeMirror', jh = function (e) {
            function n(t) {
                var n = e.call(this, t, 'CodeManager', sh()) || this;
                n.EditorView = Th;
                var o = n.config, r = o.pStylePrefix;
                return r && (o.stylePrefix = r + o.stylePrefix), n.generators = {}, n.viewers = {}, n.defGenerators = {
                    html: new uh,
                    css: new Ua,
                    json: new fh,
                    js: new yh
                }, n.defViewers = {CodeMirror: new xh}, n.loadDefaultGenerators().loadDefaultViewers(), n
            }

            return Eh(n, e), n.prototype.addGenerator = function (t, e) {
                return this.generators[t] = e, this
            }, n.prototype.getGenerator = function (t) {
                return this.generators[t]
            }, n.prototype.getGenerators = function () {
                return this.generators
            }, n.prototype.addViewer = function (t, e) {
                return this.viewers[t] = e, this
            }, n.prototype.getViewer = function (t) {
                return this.viewers[t]
            }, n.prototype.getViewers = function () {
                return this.viewers
            }, n.prototype.createViewer = function (e) {
                void 0 === e && (e = {});
                var n = (0, t.isUndefined)(e.type) ? Ah : e.type, o = this.getViewer(n) && this.getViewer(n).clone(),
                    r = document.createElement('div'), i = document.createElement('textarea');
                return r.appendChild(i), o.set(kh(kh({}, this.config.optsCodeViewer), e)), o.init(i), o.setElement(r), o
            }, n.prototype.updateViewer = function (t, e) {
                t.setContent(e)
            }, n.prototype.getCode = function (t, e, n) {
                void 0 === n && (n = {}), n.em = this.em;
                var o = this.getGenerator(e);
                return o ? o.build(t, n) : ''
            }, n.prototype.loadDefaultGenerators = function () {
                for (var t in this.defGenerators) this.addGenerator(t, this.defGenerators[t]);
                return this
            }, n.prototype.loadDefaultViewers = function () {
                for (var t in this.defViewers) this.addViewer(t, this.defViewers[t]);
                return this
            }, n.prototype.destroy = function () {
            }, n
        }(m);
        const Mh = jh;
        var Dh = n(4729), Lh = n.n(Dh);
        const Ih = function () {
            return {maximumStackLength: 500, trackSelection: !0}
        };
        var Nh;
        !function (t) {
            t["update"] = "update", t["undo"] = "undo", t["redo"] = "redo", t["load"] = "load", t["projectLoad"] = "project:load", t["projectGet"] = "project:get", t["log"] = "log", t["telemetryInit"] = "telemetry:init", t["destroy"] = "destroy", t["destroyed"] = "destroyed"
        }(Nh || (Nh = {}));
        var Rh = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Vh = void 0 && (void 0).__assign || function () {
            return Vh = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Vh.apply(this, arguments)
        }, Fh = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Hh = function (t) {
            return t.avoidStore || t.noUndo || t.partial
        }, Uh = function (t) {
            return Object.keys(t.changedAttributes())
        }, zh = new WeakMap, Bh = function (e) {
            function n(n) {
                var o = e.call(this, n, 'UndoManager', Ih()) || this;
                o.config._disable && (o.config.maximumStackLength = 0);
                var r = !0;
                return o.um = new (Lh())(Vh({
                    track: !0,
                    register: []
                }, o.config)), o.um.changeUndoType('change', {
                    condition: function (e) {
                        var n = e.get('_undo');
                        if (n) {
                            var o = e.get('_undoexc');
                            if ((0, t.isArray)(o) && Uh(e).some((function (t) {
                                return o.indexOf(t) >= 0
                            }))) return !1;
                            if ((0, t.isBoolean)(n)) return !0;
                            if ((0, t.isArray)(n) && Uh(e).some((function (t) {
                                return n.indexOf(t) >= 0
                            }))) return !0
                        }
                        return !1
                    }, on: function (e, n, o) {
                        var i = zh.get(e);
                        i || (i = e.previousAttributes(), zh.set(e, i));
                        var a = o || n || {};
                        if (a.noUndo && setTimeout((function () {
                            zh.delete(e)
                        })), !Hh(a)) {
                            var s = e.toJSON({fromUndo: r}), l = {object: e, before: i, after: s};
                            if (zh.delete(e), !(0, t.isEmpty)(s)) return l
                        }
                    }
                }), o.um.changeUndoType('add', {
                    on: function (t, e, n) {
                        if (void 0 === n && (n = {}), !Hh(n) && o.isRegistered(e)) return {
                            object: e,
                            before: void 0,
                            after: t,
                            options: Vh(Vh({}, n), {fromUndo: r})
                        }
                    }
                }), o.um.changeUndoType('remove', {
                    on: function (t, e, n) {
                        if (void 0 === n && (n = {}), !Hh(n) && o.isRegistered(e)) return {
                            object: e,
                            before: t,
                            after: void 0,
                            options: Vh(Vh({}, n), {fromUndo: r})
                        }
                    }
                }), o.um.changeUndoType('reset', {
                    undo: function (t, e) {
                        t.reset(e, {fromUndo: r})
                    }, redo: function (t, e, n) {
                        t.reset(n, {fromUndo: r})
                    }, on: function (t, e) {
                        if (void 0 === e && (e = {}), !Hh(e) && o.isRegistered(t)) return {
                            object: t,
                            before: e.previousModels,
                            after: Fh([], t.models, !0),
                            options: Vh(Vh({}, e), {fromUndo: r})
                        }
                    }
                }), o.um.on('undo redo', (function () {
                    n.getSelectedAll().map((function (t) {
                        return t.trigger('rerender:layer')
                    }))
                })), [Nh.undo, Nh.redo].forEach((function (t) {
                    return o.um.on(t, (function () {
                        return n.trigger(t)
                    }))
                })), o
            }

            return Rh(n, e), n.prototype.postLoad = function () {
                var t = this.config, e = this.em;
                t.trackSelection && e && this.add(e.get('selected'))
            }, n.prototype.add = function (t) {
                return this.um.register(t), this
            }, n.prototype.remove = function (t) {
                return this.um.unregister(t), this
            }, n.prototype.removeAll = function () {
                return this.um.unregisterAll(), this
            }, n.prototype.start = function () {
                return this.um.startTracking(), this
            }, n.prototype.stop = function () {
                return this.um.stopTracking(), this
            }, n.prototype.undo = function (t) {
                void 0 === t && (t = !0);
                var e = this.em, n = this.um;
                return !e.isEditing() && n.undo(t), this
            }, n.prototype.undoAll = function () {
                return this.um.undoAll(), this
            }, n.prototype.redo = function (t) {
                void 0 === t && (t = !0);
                var e = this.em, n = this.um;
                return !e.isEditing() && n.redo(t), this
            }, n.prototype.redoAll = function () {
                return this.um.redoAll(), this
            }, n.prototype.hasUndo = function () {
                return !!this.um.isAvailable('undo')
            }, n.prototype.hasRedo = function () {
                return !!this.um.isAvailable('redo')
            }, n.prototype.isRegistered = function (t) {
                return !!this.getInstance().objectRegistry.isRegistered(t)
            }, n.prototype.getStack = function () {
                return this.um.stack
            }, n.prototype.getStackGroup = function () {
                var t = [], e = [];
                return this.getStack().forEach((function (n) {
                    var o = n.get('magicFusionIndex');
                    e.indexOf(o) < 0 && (e.push(o), t.push(n))
                })), t
            }, n.prototype.skip = function (t) {
                var e = !!this.um.isTracking();
                e && this.stop(), t(), e && this.start()
            }, n.prototype.getGroupedStack = function () {
                var e = {}, n = this.getStack();
                return n.forEach((function (t, n) {
                    var o = t.get('magicFusionIndex'), r = function (t, e) {
                        var n = t.attributes, o = n.type, r = n.after, i = n.before, a = n.object, s = n.options;
                        return {index: e, type: o, after: r, before: i, object: a, options: void 0 === s ? {} : s}
                    }(t, n);
                    e[o] ? e[o].push(r) : e[o] = [r]
                })), Object.keys(e).map((function (n) {
                    var o = e[n];
                    return {
                        index: o[o.length - 1].index, actions: o, labels: (0, t.unique)(o.reduce((function (t, e) {
                            var n, o = null === (n = e.options) || void 0 === n ? void 0 : n.action;
                            return o && t.push(o), t
                        }), []))
                    }
                }))
            }, n.prototype.goToGroup = function (e) {
                var n = this;
                if (e) {
                    var o = this.getPointer(), r = e.index - o;
                    (0, t.times)(Math.abs(r), (function () {
                        n[r < 0 ? 'undo' : 'redo'](!1)
                    }))
                }
            }, n.prototype.getPointer = function () {
                return this.getStack().pointer
            }, n.prototype.clear = function () {
                return this.um.clear(), this
            }, n.prototype.getInstance = function () {
                return this.um
            }, n.prototype.destroy = function () {
                this.clear().removeAll()
            }, n
        }(m);
        const Wh = Bh;
        const $h = function () {
            return {
                stylePrefix: 'rte-',
                adjustToolbar: !0,
                actions: ['bold', 'italic', 'underline', 'strikethrough', 'link', 'wrap'],
                custom: !1
            }
        };
        var qh, Gh = void 0 && (void 0).__assign || function () {
            return Gh = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Gh.apply(this, arguments)
        };
        !function (t) {
            t[t["ACTIVE"] = 1] = "ACTIVE", t[t["INACTIVE"] = 0] = "INACTIVE", t[t["DISABLED"] = -1] = "DISABLED"
        }(qh || (qh = {}));
        var Kh = '_rte', Yh = 1, Xh = 0, Jh = -1, Zh = function (t, e) {
            void 0 === e && (e = 'A');
            var n = t.selection() || {}, o = n.anchorNode, r = n.focusNode, i = null == o ? void 0 : o.parentNode,
                a = null == r ? void 0 : r.parentNode;
            return (null == i ? void 0 : i.nodeName) == e || (null == a ? void 0 : a.nodeName) == e
        }, Qh = 'data-selectme', tv = {
            bold: {
                name: 'bold', icon: '<b>B</b>', attributes: {title: 'Bold'}, result: function (t) {
                    return t.exec('bold')
                }
            },
            italic: {
                name: 'italic', icon: '<i>I</i>', attributes: {title: 'Italic'}, result: function (t) {
                    return t.exec('italic')
                }
            },
            underline: {
                name: 'underline', icon: '<u>U</u>', attributes: {title: 'Underline'}, result: function (t) {
                    return t.exec('underline')
                }
            },
            strikethrough: {
                name: 'strikethrough',
                icon: '<s>S</s>',
                attributes: {title: 'Strike-through'},
                result: function (t) {
                    return t.exec('strikeThrough')
                }
            },
            link: {
                icon: "<svg viewBox=\"0 0 24 24\">\n          <path fill=\"currentColor\" d=\"M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z\" />\n        </svg>",
                name: 'link',
                attributes: {style: 'font-size:1.4rem;padding:0 4px 2px;', title: 'Link'},
                state: function (t) {
                    return t && t.selection() && Zh(t) ? Yh : Xh
                },
                result: function (t) {
                    Zh(t) ? t.exec('unlink') : t.insertHTML("<a href=\"\" ".concat(Qh, ">").concat(t.selection(), "</a>"), {select: !0})
                }
            },
            wrap: {
                name: 'wrap',
                icon: "<svg viewBox=\"0 0 24 24\">\n            <path fill=\"currentColor\" d=\"M20.71,4.63L19.37,3.29C19,2.9 18.35,2.9 17.96,3.29L9,12.25L11.75,15L20.71,6.04C21.1,5.65 21.1,5 20.71,4.63M7,14A3,3 0 0,0 4,17C4,18.31 2.84,19 2,19C2.92,20.22 4.5,21 6,21A4,4 0 0,0 10,17A3,3 0 0,0 7,14Z\" />\n        </svg>",
                attributes: {title: 'Wrap for style'},
                state: function (t) {
                    return (null == t ? void 0 : t.selection()) && Zh(t, 'SPAN') ? Jh : Xh
                },
                result: function (t) {
                    !Zh(t, 'SPAN') && t.insertHTML("<span ".concat(Qh, ">").concat(t.selection(), "</span>"), {select: !0})
                }
            }
        }, ev = function () {
            function n(e, n, o) {
                void 0 === o && (o = {});
                var r = this;
                if (this.em = e, this.settings = o, n[Kh]) return n[Kh];
                n[Kh] = this, this.setEl(n), this.updateActiveActions = this.updateActiveActions.bind(this), this.__onKeydown = this.__onKeydown.bind(this), this.__onPaste = this.__onPaste.bind(this);
                var i = (o.actions || []).map((function (e) {
                    var n = e;
                    return (0, t.isString)(e) ? n = Gh({}, tv[e]) : tv[e.name] && (n = Gh(Gh({}, tv[e.name]), e)), n
                })), a = i.length ? i : Object.keys(tv).map((function (t) {
                    return tv[t]
                }));
                o.classes = Gh({
                    actionbar: 'actionbar',
                    button: 'action',
                    active: 'active',
                    disabled: 'disabled',
                    inactive: 'inactive'
                }, o.classes);
                var s = o.classes, l = o.actionbar;
                if (this.actionbar = l, this.classes = s, this.actions = a, !l) {
                    if (!this.isCustom(o.module)) {
                        var c = o.actionbarContainer;
                        (l = document.createElement('div')).className = s.actionbar, null == c || c.appendChild(l), this.actionbar = l
                    }
                    a.forEach((function (t) {
                        return r.addAction(t)
                    }))
                }
                return o.styleWithCSS && this.exec('styleWithCSS'), this
            }

            return n.prototype.isCustom = function (t) {
                var e = t || this.em.RichTextEditor;
                return !(!(null == e ? void 0 : e.config.custom) && !(null == e ? void 0 : e.customRte))
            }, n.prototype.destroy = function () {
            }, n.prototype.setEl = function (t) {
                this.el = t, this.doc = t.ownerDocument
            }, n.prototype.updateActiveActions = function () {
                var t = this, e = this.getActions();
                e.forEach((function (e) {
                    var n = e.update, o = e.btn, r = t.classes, i = r.active, a = r.inactive, s = r.disabled,
                        l = e.state, c = e.name, u = t.doc, p = qh.INACTIVE;
                    if (o && (o.className = o.className.replace(i, '').trim(), o.className = o.className.replace(a, '').trim(), o.className = o.className.replace(s, '').trim()), l) {
                        var d = l(t, u);
                        if (p = d, o) switch (d) {
                            case Yh:
                                o.className += " ".concat(i);
                                break;
                            case Xh:
                                o.className += " ".concat(a);
                                break;
                            case Jh:
                                o.className += " ".concat(s)
                        }
                    } else u.queryCommandSupported(c) && u.queryCommandState(c) && (o && (o.className += " ".concat(i)), p = qh.ACTIVE);
                    e.currentState = p, null == n || n(t, e)
                })), e.length && this.em.RichTextEditor.__dbdTrgCustom()
            }, n.prototype.enable = function (t) {
                return this.enabled ? this : this.__toggleEffects(!0, t)
            }, n.prototype.disable = function () {
                return this.__toggleEffects(!1)
            }, n.prototype.__toggleEffects = function (t, e) {
                void 0 === t && (t = !1), void 0 === e && (e = {});
                var n = t ? Z.on : Z.AU, o = this.el, r = this.doc, i = this.actionbarEl();
                if (i && (i.style.display = t ? '' : 'none'), o.contentEditable = "".concat(!!t), n(o, 'mouseup keyup', this.updateActiveActions), n(r, 'keydown', this.__onKeydown), n(r, 'paste', this.__onPaste), this.enabled = t, t) {
                    var a = e.event;
                    if (this.syncActions(), this.updateActiveActions(), a) {
                        var s = null;
                        if (r.caretRangeFromPoint) {
                            var l = (0, Z.G2)(a);
                            s = r.caretRangeFromPoint(l.clientX, l.clientY)
                        } else a.rangeParent && (s = r.createRange()).setStart(a.rangeParent, a.rangeOffset);
                        var c = r.getSelection();
                        null == c || c.removeAllRanges(), s && (null == c || c.addRange(s))
                    }
                    o.focus()
                }
                return this
            }, n.prototype.__onKeydown = function (t) {
                var e = this.em, n = e.RichTextEditor.getConfig().onKeydown;
                if (n) return n({ev: t, rte: this, editor: e.getEditor()});
                var o = this.doc;
                'Enter' !== t.key || ['insertOrderedList', 'insertUnorderedList'].some((function (t) {
                    return o.queryCommandState(t)
                })) || (o.execCommand('insertLineBreak'), t.preventDefault())
            }, n.prototype.__onPaste = function (t) {
                var e = this.em, n = e.RichTextEditor.getConfig().onPaste;
                if (n) return n({ev: t, rte: this, editor: e.getEditor()});
                var o = t.clipboardData, r = o.getData('text'), i = o.getData('text/html');
                if (r && !i) {
                    t.preventDefault();
                    var a = r.replace(/(?:\r\n|\r|\n)/g, '<br/>');
                    this.doc.execCommand('insertHTML', !1, a)
                }
            }, n.prototype.syncActions = function () {
                var t = this;
                this.getActions().forEach((function (e) {
                    if (t.actionbar && (!e.state || e.state && e.state(t, t.doc) >= 0)) {
                        var n = e.event || 'click', o = e.btn;
                        o && (o["on".concat(n)] = function () {
                            e.result(t, e), t.updateActiveActions()
                        })
                    }
                }))
            }, n.prototype.addAction = function (t, e) {
                void 0 === e && (e = {});
                var n = e.sync, o = this.actionbarEl();
                if (o) {
                    var r = t.icon, i = t.attributes, a = void 0 === i ? {} : i, s = document.createElement('span');
                    for (var l in s.className = this.classes.button, t.btn = s, a) s.setAttribute(l, a[l]);
                    'string' == typeof r ? s.innerHTML = r : s.appendChild(r), o.appendChild(s)
                }
                n && (this.actions.push(t), this.syncActions())
            }, n.prototype.getActions = function () {
                return this.actions
            }, n.prototype.selection = function () {
                return this.doc.getSelection()
            }, n.prototype.exec = function (t, e) {
                this.doc.execCommand(t, !1, e)
            }, n.prototype.actionbarEl = function () {
                return this.actionbar
            }, n.prototype.insertHTML = function (n, o) {
                var r = (void 0 === o ? {} : o).select, i = this, a = i.em, s = i.doc, l = i.el, c = s.getSelection();
                if (c && c.rangeCount) {
                    var u = (0, e.getComponentModel)(l) || a.getSelected(), p = s.createElement('div'),
                        d = c.getRangeAt(0);
                    d.deleteContents(), (0, t.isString)(n) ? p.innerHTML = n : n && p.appendChild(n), Array.prototype.slice.call(p.childNodes).forEach((function (t) {
                        d.insertNode(t)
                    })), c.removeAllRanges(), c.addRange(d), l.focus(), r && u && (u.once('rte:disable', (function () {
                        var t = u.find("[".concat(Qh, "]"))[0];
                        t && (a.setSelected(t), t.removeAttributes(Qh))
                    })), u.trigger('disable'))
                }
            }, n
        }();
        const nv = ev;
        var ov = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), rv = void 0 && (void 0).__assign || function () {
                return rv = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, rv.apply(this, arguments)
            }, iv = void 0 && (void 0).__awaiter || function (t, e, n, o) {
                return new (n || (n = Promise))((function (r, i) {
                    function a(t) {
                        try {
                            l(o.next(t))
                        } catch (t) {
                            i(t)
                        }
                    }

                    function s(t) {
                        try {
                            l(o["throw"](t))
                        } catch (t) {
                            i(t)
                        }
                    }

                    function l(t) {
                        var e;
                        t.done ? r(t.value) : (e = t.value, e instanceof n ? e : new n((function (t) {
                            t(e)
                        }))).then(a, s)
                    }

                    l((o = o.apply(t, e || [])).next())
                }))
            }, av = void 0 && (void 0).__generator || function (t, e) {
                var n, o, r, i, a = {
                    label: 0, sent: function () {
                        if (1 & r[0]) throw r[1];
                        return r[1]
                    }, trys: [], ops: []
                };
                return i = {
                    next: s(0),
                    throw: s(1),
                    return: s(2)
                }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
                    return this
                }), i;

                function s(s) {
                    return function (l) {
                        return function (s) {
                            if (n) throw new TypeError("Generator is already executing.");
                            for (; i && (i = 0, s[0] && (a = 0)), a;) try {
                                if (n = 1, o && (r = 2 & s[0] ? o["return"] : s[0] ? o["throw"] || ((r = o["return"]) && r.call(o), 0) : o.next) && !(r = r.call(o, s[1])).done) return r;
                                switch (o = 0, r && (s = [2 & s[0], r.value]), s[0]) {
                                    case 0:
                                    case 1:
                                        r = s;
                                        break;
                                    case 4:
                                        return a.label++, {value: s[1], done: !1};
                                    case 5:
                                        a.label++, o = s[1], s = [0];
                                        continue;
                                    case 7:
                                        s = a.ops.pop(), a.trys.pop();
                                        continue;
                                    default:
                                        if (!(r = a.trys, (r = r.length > 0 && r[r.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
                                            a = 0;
                                            continue
                                        }
                                        if (3 === s[0] && (!r || s[1] > r[0] && s[1] < r[3])) {
                                            a.label = s[1];
                                            break
                                        }
                                        if (6 === s[0] && a.label < r[1]) {
                                            a.label = r[1], r = s;
                                            break
                                        }
                                        if (r && a.label < r[2]) {
                                            a.label = r[2], a.ops.push(s);
                                            break
                                        }
                                        r[2] && a.ops.pop(), a.trys.pop();
                                        continue
                                }
                                s = e.call(t, a)
                            } catch (t) {
                                s = [6, t], o = 0
                            } finally {
                                n = r = 0
                            }
                            if (5 & s[0]) throw s[1];
                            return {value: s[0] ? s[1] : void 0, done: !0}
                        }([s, l])
                    }
                }
            }, sv = void 0 && (void 0).__spreadArray || function (t, e, n) {
                if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                return t.concat(o || Array.prototype.slice.call(e))
            }, lv = "".concat(A.refresh, " frame:scroll ").concat($.I.update),
            cv = {enable: 'rte:enable', disable: 'rte:disable', custom: 'rte:custom'}, uv = function (n) {
                function o(e) {
                    var o = n.call(this, e, 'RichTextEditor', $h()) || this;
                    o.events = cv;
                    var r = o.config, i = r.pStylePrefix;
                    i && (r.stylePrefix = i + r.stylePrefix), o.pfx = r.stylePrefix, o.actions = r.actions || [];
                    var a = new u.Kx;
                    return o.model = a, a.on('change:currentView', o.__trgCustom, o), o.__dbdTrgCustom = (0, t.debounce)((function () {
                        return o.__trgCustom()
                    }), 0), o
                }

                return ov(o, n), o.prototype.onLoad = function () {
                    if ((0, e.hasWin)()) {
                        var t = this.config, n = t.pStylePrefix, o = t.custom,
                            r = (0, Z.a_)('div', {class: (0, Z.cx)("".concat(n, "rte-toolbar"), !o && "".concat(n, "one-bg ").concat(n, "rte-toolbar-ui"))});
                        this.toolbar = r, this.initRte((0, Z.a_)('div')), (0, Z.on)(r, 'mousedown', (function (t) {
                            return t.stopPropagation()
                        }))
                    }
                }, o.prototype.__trgCustom = function () {
                    var t = this, e = t.model, n = t.em, o = t.events;
                    n.trigger(o.custom, {
                        enabled: !!e.get('currentView'),
                        container: this.getToolbarEl(),
                        actions: this.getAll()
                    })
                }, o.prototype.destroy = function () {
                    var t, e, n;
                    null === (t = this.globalRte) || void 0 === t || t.destroy(), null === (n = null === (e = this.customRte) || void 0 === e ? void 0 : e.destroy) || void 0 === n || n.call(e), this.model.stopListening().clear({silent: !0}), this.__dbdTrgCustom.cancel(), (0, Z.YZ)(this.toolbar)
                }, o.prototype.postRender = function (t) {
                    var e = t.model.get('Canvas');
                    this.toolbar.style.pointerEvents = 'all', this.hideToolbar(), e.getToolsEl().appendChild(this.toolbar)
                }, o.prototype.initRte = function (t) {
                    var e = this.globalRte, n = this, o = n.em, r = n.pfx, i = n.actionbar, a = n.config,
                        s = this.actions || sv([], a.actions, !0), l = {
                            actionbar: "".concat(r, "actionbar"),
                            button: "".concat(r, "action"),
                            active: "".concat(r, "active"),
                            inactive: "".concat(r, "inactive"),
                            disabled: "".concat(r, "disabled")
                        };
                    return e ? (e.em = o, e.setEl(t)) : (e = new nv(o, t, {
                        classes: l,
                        actions: s,
                        actionbar: i,
                        actionbarContainer: this.toolbar,
                        module: this
                    }), this.globalRte = e), e.actionbar && (this.actionbar = e.actionbar), e.actions && (this.actions = e.actions), e
                }, o.prototype.add = function (t, e) {
                    var n;
                    void 0 === e && (e = {}), e.name = t, null === (n = this.globalRte) || void 0 === n || n.addAction(e, {sync: !0})
                }, o.prototype.get = function (t) {
                    var e, n;
                    return null === (e = this.globalRte) || void 0 === e || e.getActions().forEach((function (e) {
                        e.name == t && (n = e)
                    })), n
                }, o.prototype.getAll = function () {
                    var t;
                    return (null === (t = this.globalRte) || void 0 === t ? void 0 : t.getActions()) || []
                }, o.prototype.remove = function (t) {
                    var e, n = this.getAll(), o = this.get(t);
                    if (o) {
                        var r = o.btn, i = n.indexOf(o);
                        null === (e = null == r ? void 0 : r.parentNode) || void 0 === e || e.removeChild(r), n.splice(i, 1)
                    }
                    return o
                }, o.prototype.run = function (e) {
                    var n = this.globalRte, o = (0, t.isString)(e) ? this.get(e) : e;
                    n && o && (o.result(n, o), n.updateActiveActions())
                }, o.prototype.getToolbarEl = function () {
                    return this.toolbar
                }, o.prototype.updatePosition = function () {
                    var n = this.em, o = this.toolbar, r = 'px', i = n.Canvas, a = o.style,
                        s = i.getTargetToElementFixed(this.lastEl, o, {event: 'rteToolbarPosUpdate', left: 0});
                    ['top', 'left', 'bottom', 'right'].forEach((function (n) {
                        var o = s[n];
                        (0, e.isDef)(o) && (a[n] = (0, t.isString)(o) ? o : (o || 0) + r)
                    }))
                }, o.prototype.enable = function (t, e, n) {
                    return iv(this, void 0, void 0, (function () {
                        var o, r, i, a, s;
                        return av(this, (function (l) {
                            switch (l.label) {
                                case 0:
                                    return this.lastEl = t.el, r = (o = this).customRte, i = o.em, a = t.getChildrenContainer(), this.toolbar.style.display = '', [4, r ? r.enable(a, e, n) : this.initRte(a).enable(n)];
                                case 1:
                                    return s = l.sent(), i && (setTimeout(this.updatePosition.bind(this), 0), i.off(lv, this.updatePosition, this), i.on(lv, this.updatePosition, this), i.trigger('rte:enable', t, s)), this.model.set({currentView: t}), [2, s]
                            }
                        }))
                    }))
                }, o.prototype.getContent = function (e, n) {
                    return iv(this, void 0, void 0, (function () {
                        var o, r;
                        return av(this, (function (i) {
                            switch (i.label) {
                                case 0:
                                    return o = this.customRte, r = e.getChildrenContainer(), o && n && (0, t.isFunction)(o.getContent) ? [4, o.getContent(r, n, {view: e})] : [3, 2];
                                case 1:
                                    return [2, i.sent()];
                                case 2:
                                    return [2, r.innerHTML]
                            }
                        }))
                    }))
                }, o.prototype.hideToolbar = function () {
                    var t = this.toolbar.style, e = '-1000px';
                    t.top = e, t.left = e, t.display = 'none'
                }, o.prototype.disable = function (t, e) {
                    return iv(this, arguments, void 0, (function (t, e, n) {
                        var o, r, i, a;
                        return void 0 === n && (n = {}), av(this, (function (s) {
                            switch (s.label) {
                                case 0:
                                    return o = {}, r = this.em, (i = this.customRte) ? [4, i.disable(t.getChildrenContainer(), e, rv(rv({}, n), {view: t}))] : [3, 2];
                                case 1:
                                    return (a = s.sent()) && (o = a), [3, 3];
                                case 2:
                                    e && e.disable(), s.label = 3;
                                case 3:
                                    return this.hideToolbar(), r && (r.off(lv, this.updatePosition, this), !n.fromMove && r.trigger('rte:disable', t, e)), this.model.unset('currentView'), [2, o]
                            }
                        }))
                    }))
                }, o
            }(m);
        const pv = uv;
        const dv = function () {
            return {
                sectors: [{
                    name: 'General',
                    open: !1,
                    properties: ['display', 'float', 'position', 'top', 'right', 'left', 'bottom']
                }, {
                    name: 'Flex',
                    open: !1,
                    properties: ['flex-direction', 'flex-wrap', 'justify-content', 'align-items', 'align-content', 'order', 'flex-basis', 'flex-grow', 'flex-shrink', 'align-self']
                }, {
                    name: 'Dimension',
                    open: !1,
                    properties: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding']
                }, {
                    name: 'Typography',
                    open: !1,
                    properties: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-align', 'text-shadow']
                }, {
                    name: 'Decorations',
                    open: !1,
                    properties: ['background-color', 'border-radius', 'border', 'box-shadow', 'background']
                }, {name: 'Extra', open: !1, properties: ['opacity', 'transition', 'transform']}],
                appendTo: '',
                stylePrefix: 'sm-',
                custom: !1,
                hideNotStylable: !0,
                highlightChanged: !0,
                highlightComputed: !0,
                showComputed: !0,
                clearProperties: !0,
                avoidComputed: ['width', 'height']
            }
        };
        var fv = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), hv = void 0 && (void 0).__assign || function () {
            return hv = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, hv.apply(this, arguments)
        }, vv = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        }, gv = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, yv = function (n) {
            function o() {
                return null !== n && n.apply(this, arguments) || this
            }

            return fv(o, n), o.getDefaults = function () {
                return (0, t.result)(this.prototype, 'defaults')
            }, o.prototype.defaults = function () {
                return {
                    name: '',
                    property: '',
                    type: '',
                    defaults: '',
                    info: '',
                    value: '',
                    icon: '',
                    functionName: '',
                    status: '',
                    visible: !0,
                    fixedValues: ['initial', 'inherit'],
                    full: !1,
                    important: !1,
                    toRequire: !1,
                    requires: void 0,
                    requiresParent: null,
                    parentTarget: null
                }
            }, o.prototype.initialize = function (t, n) {
                void 0 === t && (t = {}), void 0 === n && (n = {}), this.em = n.em;
                var r = this.getId() || '', i = this.get('name') || this.get('label') || '';
                !this.get('property') && this.set('property', (i || r).replace(/ /g, '-'));
                var a = this.get('property');
                !this.get('id') && this.set('id', a), !i && this.set('name', (0, e.capitalize)(a).replace(/-/g, ' ')), this.on('change', this.__upTargets), o.callInit(this, t, n)
            }, o.prototype.__getParentProp = function () {
                var t, e;
                return null === (e = null === (t = this.collection) || void 0 === t ? void 0 : t.opts) || void 0 === e ? void 0 : e.parentProp
            }, o.prototype.__upTargets = function (e, n) {
                var o, r = this;
                void 0 === n && (n = {});
                var i = this.em.Styles, a = this.getName(), s = n.__clear, l = s ? '' : this.__getFullValue(n),
                    c = this.__getParentProp(), u = this.changedAttributes(),
                    p = (0, t.keys)(u).reduce((function (t, e) {
                        return t[e] = r.previous(e), t
                    }), {}), d = gv(gv([], (0, t.keys)(this.__getClearProps()), !0), ['__p'], !1), f = (0, t.keys)(u),
                    h = !n.__up && !c && (s || d.some((function (t) {
                        return f.indexOf(t) >= 0
                    }))), v = this.get('onChange'), g = {property: this, from: p, to: u, value: l, opts: n};
                i.__trgEv(i.events.propertyUpdate, g), v && v(g), h && this.__upTargetsStyle(((o = {})[a] = l, o), n)
            }, o.prototype.__upTargetsStyle = function (t, e) {
                var n, o = null === (n = this.em) || void 0 === n ? void 0 : n.get('StyleManager');
                null == o || o.addStyleTargets(hv(hv({}, t), {__p: !!e.avoidStore}), e)
            }, o.prototype._up = function (t, e) {
                void 0 === e && (e = {}), e.noTarget && (e.__up = !0);
                var n = e.partial, o = vv(e, ["partial"]);
                return t.__p = !(!o.avoidStore && !n), this.set(t, hv(hv({}, o), {avoidStore: t.__p}))
            }, o.prototype.up = function (t, e) {
                void 0 === e && (e = {}), this.set(t, hv(hv({}, e), {__up: !0}))
            }, o.prototype.init = function () {
            }, o.prototype.getId = function () {
                return this.get('id')
            }, o.prototype.getType = function () {
                return this.get('type')
            }, o.prototype.getName = function () {
                return this.get('property')
            }, o.prototype.getLabel = function (t) {
                var e;
                void 0 === t && (t = {});
                var n = t.locale, o = void 0 === n || n, r = this.getId(), i = this.get('name') || this.get('label');
                return o && (null === (e = this.em) || void 0 === e ? void 0 : e.t("styleManager.properties.".concat(r))) || i
            }, o.prototype.getValue = function (t) {
                void 0 === t && (t = {});
                var e = t.noDefault, n = this.get('value');
                return this.hasValue() || e ? n : this.getDefaultValue()
            }, o.prototype.hasValue = function (e) {
                void 0 === e && (e = {});
                var n = e.noParent && this.getParentTarget(), o = this.get('value');
                return !(0, t.isUndefined)(o) && '' !== o && !n
            }, o.prototype.hasValueParent = function () {
                return this.hasValue() && !this.hasValue({noParent: !0})
            }, o.prototype.getStyle = function (t) {
                var n;
                void 0 === t && (t = {});
                var o = this.getName();
                return (n = {})[t.camelCase ? (0, e.camelCase)(o) : o] = this.__getFullValue(t), n
            }, o.prototype.getDefaultValue = function () {
                var e = this.get('default');
                return "".concat((0, t.isUndefined)(e) ? this.get('defaults') : e)
            }, o.prototype.upValue = function (t, e) {
                void 0 === e && (e = {});
                var n = null === t || '' === t ? this.__getClearProps() : this.__parseValue(t, e);
                return this._up(n, e)
            }, o.prototype.isVisible = function () {
                return !!this.get('visible')
            }, o.prototype.clear = function (t) {
                return void 0 === t && (t = {}), this._up(this.__getClearProps(), hv(hv({}, t), {__clear: !0})), this
            }, o.prototype.canClear = function () {
                var t = this.getParent();
                return t ? t.__canClearProp(this) : this.hasValue({noParent: !0})
            }, o.prototype.getParent = function () {
                return this.__getParentProp()
            }, o.prototype.isFull = function () {
                return !!this.get('full')
            }, o.prototype.__parseValue = function (t, e) {
                return this.parseValue(t, e)
            }, o.prototype.__getClearProps = function () {
                return {value: '', important: !1}
            }, o.prototype.setValue = function (t, e, n) {
                void 0 === e && (e = !0), void 0 === n && (n = {});
                var o = this.parseValue(t), r = !e;
                !r && this.set({value: void 0}, {avoidStore: r, silent: !0}), this.set(o, hv({avoidStore: r}, n))
            }, o.prototype.setValueFromInput = function (t, e, n) {
                void 0 === n && (n = {}), this.setValue(t, e, hv(hv({}, n), {fromInput: 1}))
            }, o.prototype.parseValue = function (e, n) {
                void 0 === n && (n = {});
                var o = {value: e}, r = '!important', i = this.get('functionName') || '';
                if ((0, t.isString)(e) && -1 !== e.indexOf(r) && (o.value = e.replace(r, '').trim(), o.important = !0), !i && !n.complete) return o;
                var a = [], s = "".concat(o.value).trim(), l = s.indexOf('(') + 1, c = i || s.substring(0, l - 1);
                if (c && (o.functionName = c), !i || 0 === s.indexOf("".concat(i, "("))) {
                    var u = s.lastIndexOf(')');
                    a.push(l), u >= 0 && a.push(u), o.value = String.prototype.substring.apply(s, a)
                }
                if (n.numeric) {
                    var p = parseFloat(o.value);
                    o.unit = o.value.replace(p, ''), o.value = p
                }
                return o
            }, o.prototype.__getFullValue = function (t) {
                var e = (void 0 === t ? {} : t).withDefault;
                return !this.hasValue() && e ? this.getDefaultValue() : this.getFullValue()
            }, o.prototype.getFullValue = function (e, n) {
                void 0 === n && (n = {});
                var o = this.get('functionName'), r = this.getDefaultValue(),
                    i = (0, t.isUndefined)(e) ? this.get('value') : e, a = this.hasValue();
                if (i && r && i === r) return r;
                if (o && a) {
                    var s = 'url' === o ? "'".concat(i.replace(/'|"/g, ''), "'") : i;
                    i = "".concat(o, "(").concat(s, ")")
                }
                return a && this.get('important') && !n.skipImportant && (i = "".concat(i, " !important")), i || ''
            }, o.prototype.__setParentTarget = function (t) {
                this.up({parentTarget: t})
            }, o.prototype.getParentTarget = function () {
                return this.get('parentTarget') || null
            }, o.prototype.__parseFn = function (t) {
                void 0 === t && (t = '');
                var e = t.indexOf('(') + 1, n = t.lastIndexOf(')');
                return {
                    name: t.substring(0, e - 1).trim(),
                    value: String.prototype.substring.apply(t, [e, n >= 0 ? n : void 0]).trim()
                }
            }, o.prototype.__checkVisibility = function (n) {
                var o = n.target, r = n.component, i = n.sector, a = n.sectors, s = r || o;
                if (!s) return !1;
                var l = this.getId(), c = this.getName(), u = this.attributes, p = u.requires, d = u.requiresParent,
                    f = u.toRequire, h = u.isVisible, v = s.get('unstylable'), g = s.get('stylable-require'),
                    y = s.get('stylable');
                if ((0, t.isFunction)(h)) return !!h({property: this, sector: i, target: o, component: r});
                if ((0, t.isArray)(y) && (y = y.indexOf(c) >= 0), (0, t.isArray)(v) && (y = v.indexOf(c) < 0), f && (y = !o || g && (g.indexOf(l) >= 0 || g.indexOf(c) >= 0)), a && p) {
                    var m = (0, t.keys)(p);
                    a.forEach((function (e) {
                        e.getProperties().forEach((function (e) {
                            if ((0, t.includes)(m, e.id)) {
                                var n = p[e.id];
                                y = y && (0, t.includes)(n, e.get('value'))
                            }
                        }))
                    }))
                }
                if (d) {
                    var b = r && r.parent(), _ = b && b.getEl();
                    if (_) {
                        var w = (0, e.hasWin)() ? window.getComputedStyle(_) : {};
                        (0, t.each)(d, (function (e, n) {
                            y = y && w[n] && (0, t.includes)(e, w[n])
                        }))
                    } else y = !1
                }
                return !!y
            }, o
        }(u.Kx);
        const mv = yv;
        yv.callParentInit = function (t, e, n, o) {
            void 0 === o && (o = {}), t.prototype.initialize.apply(e, [n, hv(hv({}, o), {skipInit: 1})])
        }, yv.callInit = function (t, e, n) {
            void 0 === n && (n = {}), !n.skipInit && t.init(e, n)
        };
        var bv = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), _v = void 0 && (void 0).__assign || function () {
            return _v = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, _v.apply(this, arguments)
        }, wv = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, xv = function (t) {
            return 'integer' === t || 'number' === t
        }, Cv = function (n) {
            function o() {
                return null !== n && n.apply(this, arguments) || this
            }

            return bv(o, n), o.prototype.defaults = function () {
                return _v(_v({}, mv.getDefaults()), {
                    detached: !1,
                    properties: [],
                    separator: ' ',
                    join: null,
                    fromStyle: null,
                    toStyle: null,
                    full: !0
                })
            }, o.prototype.initialize = function (t, e) {
                void 0 === t && (t = {}), void 0 === e && (e = {}), mv.callParentInit(mv, this, t, e);
                var n = this.em, o = new Ig(this.get('properties') || [], {em: n, parentProp: this});
                this.set('properties', o, {silent: !0}), this.listenTo(o, 'change', this.__upProperties), mv.callInit(this, t, e)
            }, Object.defineProperty(o.prototype, "properties", {
                get: function () {
                    return this.get('properties') || []
                }, enumerable: !1, configurable: !0
            }), o.prototype.getProperties = function () {
                return wv([], this.get('properties').models, !0)
            }, o.prototype.getProperty = function (t) {
                return this.properties.filter((function (e) {
                    return e.getId() === t || e.getName() === t
                }))[0]
            }, o.prototype.getPropertyAt = function (t) {
                return this.get('properties').at(t)
            }, o.prototype.isDetached = function () {
                return !!this.get('detached')
            }, o.prototype.getValues = function (t) {
                var e = (void 0 === t ? {} : t).byName;
                return this.getProperties().reduce((function (t, n) {
                    return t[e ? n.getName() : n.getId()] = "".concat(n.__getFullValue()), t
                }), {})
            }, o.prototype.getSeparator = function () {
                return this.getSplitSeparator()
            }, o.prototype.getJoin = function () {
                return this.__getJoin()
            }, o.prototype.getStyleFromProps = function (t) {
                var n;
                void 0 === t && (t = {});
                var o = this.getName(), r = this.__getJoin(), i = this.get('toStyle'), a = this.getValues(), s = {};
                if (i) s = i(a, {
                    join: r,
                    name: o,
                    property: this
                }); else if (a = this.getValues({byName: !0}), this.isDetached()) s = a; else {
                    var l = this.getProperties().map((function (t) {
                        return t.__getFullValue({withDefault: 1})
                    })).filter(Boolean).join(r);
                    (n = {})[o] = l, s = n
                }
                return this.isDetached() ? s[o] = '' : (s[o] = s[o] || '', s = _v(_v({}, s), this.getProperties().reduce((function (t, e) {
                    return t[e.getName()] = '', t
                }), {}))), t.camelCase ? Object.keys(s).reduce((function (t, n) {
                    return t[(0, e.camelCase)(n)] = s[n], t
                }), {}) : s
            }, o.prototype.getSplitSeparator = function () {
                return new RegExp("".concat(this.get('separator'), "(?![^\\(]*\\))"))
            }, o.prototype.__upProperties = function (t, e) {
                if (void 0 === e && (e = {}), !e.__up && !e.__clearIn) {
                    var n = this.__getParentProp();
                    if (n) return n.__upProperties(this, e);
                    this.__upTargetsStyleProps(e, t)
                }
            }, o.prototype.__upTargetsStyleProps = function (t, e) {
                var n;
                void 0 === t && (t = {});
                var o = this.getStyleFromProps();
                if (this.isDetached() && e) {
                    var r = e.getName();
                    (n = {})[r] = o[r], o = n
                }
                this.__upTargetsStyle(o, t)
            }, o.prototype._up = function (t, e) {
                return void 0 === e && (e = {}), this.__setProperties(this.__getSplitValue(t.value), e), mv.prototype._up.call(this, t, e), this
            }, o.prototype.getStyle = function (t) {
                return this.getStyleFromProps(t)
            }, o.prototype.__getFullValue = function (t) {
                if (void 0 === t && (t = {}), this.isDetached() || t.__clear) return '';
                var e = this.getStyleFromProps()[this.getName()] || '';
                return Ae(e)
            }, o.prototype.__getJoin = function () {
                var e = this.get('join');
                return (0, t.isString)(e) ? e : this.get('separator')
            }, o.prototype.__styleHasProps = function (e) {
                void 0 === e && (e = {});
                var n = this.getName(), o = this.getProperties().map((function (t) {
                    return t.getName()
                }));
                return wv([n], o, !0).some((function (n) {
                    return !(0, t.isUndefined)(e[n]) && '' !== e[n]
                }))
            }, o.prototype.__splitValue = function (t, e) {
                return Ae(t).split(e).map((function (t) {
                    return t.trim()
                })).filter(Boolean)
            }, o.prototype.__splitStyleName = function (t, e, n) {
                var o = t[e];
                return this.__splitValue(o || '', n)
            }, o.prototype.__getSplitValue = function (e, n) {
                void 0 === e && (e = '');
                var o = (void 0 === n ? {} : n).byName, r = this.getProperties(),
                    i = 4 === r.length && r.every((function (t) {
                        return xv(t.getType())
                    })), a = this.__splitValue(e, this.getSplitSeparator()), s = {};
                return r.forEach((function (e, n) {
                    var r = a[n], l = (0, t.isUndefined)(r) ? '' : r;
                    if (i) {
                        var c = a.length;
                        l = a[n] || a[n % c + (1 != c && c % 2 ? 1 : 0)] || l
                    }
                    var u = o ? e.getName() : e.getId();
                    s[u] = l || ''
                })), s
            }, o.prototype.__getPropsFromStyle = function (e, n) {
                if (void 0 === e && (e = {}), void 0 === n && (n = {}), !this.__styleHasProps(e)) return null;
                var o = n.byName, r = this.getName(), i = this.getProperties(), a = this.getSplitSeparator(),
                    s = this.get('fromStyle'), l = s ? s(e, {property: this, name: r, separator: a}) : {};
                if (!s) {
                    var c = e[r];
                    l = this.__getSplitValue(c || '', {byName: o}), i.forEach((function (n) {
                        var r = e[n.getName()], i = o ? n.getName() : n.getId();
                        (0, t.isUndefined)(r) || '' === r || (l[i] = r)
                    }))
                }
                return l
            }, o.prototype.__setProperties = function (e, n) {
                void 0 === e && (e = {}), void 0 === n && (n = {}), this.getProperties().forEach((function (t) {
                    var o = e[t.getId()];
                    t.__getFullValue() !== o && t.upValue(o, n)
                }));
                var o = (0, t.keys)(e).map((function (t) {
                    return e[t]
                })).join(' ');
                this.set('value', o, {silent: !0})
            }, o.prototype.clear = function () {
                var t = this;
                return this.getProperties().map((function (e) {
                    return e.clear({__clearIn: !t.isDetached()})
                })), mv.prototype.clear.call(this), this
            }, o.prototype.hasValue = function (t) {
                return this.getProperties().some((function (e) {
                    return e.hasValue(t)
                }))
            }, o.prototype.getFullValue = function () {
                return this.__getFullValue()
            }, o.prototype.__canClearProp = function (t) {
                return this.isDetached() && t.hasValue({noParent: !0})
            }, o
        }(mv);
        const Sv = Cv;
        var Ov = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Tv = void 0 && (void 0).__assign || function () {
            return Tv = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Tv.apply(this, arguments)
        }, Pv = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        }, Ev = /,(?![^\(]*\))/, kv = /\s(?![^(]*\))/, Av = function (n) {
            function o() {
                return null !== n && n.apply(this, arguments) || this
            }

            return Ov(o, n), o.prototype.defaults = function () {
                return Tv(Tv({}, Sv.getDefaults()), {
                    layers: [],
                    emptyValue: 'unset',
                    layerSeparator: ', ',
                    layerJoin: '',
                    prepend: 0,
                    preview: !1,
                    layerLabel: null,
                    selectedLayer: null
                })
            }, o.prototype.initialize = function (t, e) {
                void 0 === t && (t = {}), void 0 === e && (e = {}), Sv.callParentInit(Sv, this, t, e);
                var n = this.get('layers'), o = new Ld(n, {prop: this});
                o.property = this, o.properties = this.get('properties'), this.set('layers', o, {silent: !0}), this.on('change:selectedLayer', this.__upSelected), this.listenTo(o, 'add remove', this.__upLayers), Sv.callInit(this, t, e)
            }, Object.defineProperty(o.prototype, "layers", {
                get: function () {
                    return this.get('layers')
                }, enumerable: !1, configurable: !0
            }), o.prototype.getLayers = function () {
                return this.layers.models
            }, o.prototype.hasLayers = function () {
                return this.getLayers().length > 0
            }, o.prototype.getLayer = function (t) {
                return void 0 === t && (t = 0), this.layers.at(t) || void 0
            }, o.prototype.getSelectedLayer = function () {
                var t = this.get('selectedLayer');
                return t && t.getIndex() >= 0 ? t : void 0
            }, o.prototype.selectLayer = function (t) {
                return this.set('selectedLayer', t, {__select: !0})
            }, o.prototype.selectLayerAt = function (t) {
                void 0 === t && (t = 0);
                var e = this.getLayer(t);
                return e && this.selectLayer(e)
            }, o.prototype.moveLayer = function (e, n) {
                void 0 === n && (n = 0);
                var o = this.layers, r = e ? e.getIndex() : -1;
                r >= 0 && (0, t.isNumber)(n) && n >= 0 && n < o.length && r !== n && (this.removeLayer(e), o.add(e, {at: n}))
            }, o.prototype.addLayer = function (e, n) {
                void 0 === e && (e = {}), void 0 === n && (n = {});
                var o = {};
                return this.getProperties().forEach((function (n) {
                    var r = n.getId(), i = e[r];
                    o[r] = (0, t.isUndefined)(i) ? n.getDefaultValue() : i
                })), this.layers.push({values: o}, n)
            }, o.prototype.removeLayer = function (t) {
                return this.layers.remove(t)
            }, o.prototype.removeLayerAt = function (t) {
                void 0 === t && (t = 0);
                var e = this.getLayer(t);
                return e ? this.removeLayer(e) : null
            }, o.prototype.getLayerLabel = function (t) {
                var e = '';
                if (t) {
                    var n = this.get('layerLabel'), o = t.getValues(), r = t.getIndex();
                    if (n) e = n(t, {index: r, values: o, property: this}); else {
                        var i = [];
                        this.getProperties().map((function (t) {
                            i.push(o[t.getId()])
                        })), e = i.filter(Boolean).join(' ')
                    }
                }
                return e
            }, o.prototype.getStyleFromLayer = function (n, o) {
                var r;
                void 0 === o && (o = {});
                var i, a = this.__getJoin(), s = this.__getJoinLayers(), l = this.get('toStyle'), c = this.getName(),
                    u = n.getValues();
                if (l) i = l(u, {join: a, joinLayers: s, name: c, layer: n, property: this}); else {
                    var p = this.getProperties().map((function (e) {
                        var n = e.getName(), r = u[e.getId()], i = (0, t.isUndefined)(r) ? e.getDefaultValue() : r;
                        if (o.number && xv(e.getType())) {
                            var a = e.parseValue(r, o.number);
                            i = "".concat(a.value).concat(a.unit)
                        }
                        return {name: n, value: i}
                    }));
                    i = this.isDetached() ? p.reduce((function (t, e) {
                        return t[e.name] = e.value, t
                    }), {}) : ((r = {})[this.getName()] = p.map((function (t) {
                        return t.value
                    })).join(a), r)
                }
                return o.camelCase ? Object.keys(i).reduce((function (t, n) {
                    return t[(0, e.camelCase)(n)] = i[n], t
                }), {}) : i
            }, o.prototype.getStylePreview = function (t, e) {
                void 0 === e && (e = {});
                var n = {};
                return this.get('preview') && (n = this.getStyleFromLayer(t, e)), n
            }, o.prototype.getLayerSeparator = function () {
                var e = this.get('layerSeparator');
                return (0, t.isString)(e) ? new RegExp("".concat(e, "(?![^\\(]*\\))")) : e
            }, o.prototype.hasEmptyValue = function () {
                return !this.hasLayers() && !!this.attributes.isEmptyValue
            }, o.prototype.__upProperties = function (t, e) {
                var n;
                void 0 === e && (e = {});
                var o = this.getSelectedLayer();
                o && (o.upValues(((n = {})[t.getId()] = t.__getFullValue(), n)), e.__up || this.__upTargetsStyleProps(e))
            }, o.prototype.__upLayers = function (t, e, n) {
                this.__upTargetsStyleProps(n || e)
            }, o.prototype.__upTargets = function (t, e) {
                if (void 0 === e && (e = {}), !e.__select) return mv.prototype.__upTargets.call(this, t, e)
            }, o.prototype.__upTargetsStyleProps = function (t) {
                void 0 === t && (t = {}), this.__upTargetsStyle(this.getStyleFromLayers(t), t)
            }, o.prototype.__upTargetsStyle = function (t, e) {
                return mv.prototype.__upTargetsStyle.call(this, t, e)
            }, o.prototype.__upSelected = function (t, e) {
                var n = (void 0 === t ? {} : t).noEvent;
                void 0 === e && (e = {});
                var o = this.em.Styles, r = this.getSelectedLayer(), i = null == r ? void 0 : r.getValues();
                i && this.getProperties().forEach((function (t) {
                    var n, o = null !== (n = i[t.getId()]) && void 0 !== n ? n : '';
                    t.__getFullValue() !== o && t.upValue(o, Tv(Tv({}, e), {__up: !0}))
                })), !n && o.__trgEv(o.events.layerSelect, {property: this})
            }, o.prototype._up = function (t, e) {
                void 0 === e && (e = {});
                var n = t.__layers, o = void 0 === n ? [] : n, r = Pv(t, ["__layers"]);
                return !this.isDetached() && this.__setLayers(o), this.__upSelected({noEvent: !0}, e), mv.prototype._up.call(this, r, e), this
            }, o.prototype.__setLayers = function (t, e) {
                void 0 === t && (t = []), void 0 === e && (e = {});
                var n = this.layers, o = t.map((function (t) {
                    return {values: t}
                }));
                n.length === o.length ? o.map((function (t, e) {
                    var o;
                    return null === (o = n.at(e)) || void 0 === o ? void 0 : o.upValues(t.values)
                })) : n.reset(o), this.set({isEmptyValue: !!e.isEmptyValue}), this.__upSelected({noEvent: !0})
            }, o.prototype.__parseValue = function (t) {
                var e = this, n = this.parseValue(t);
                return n.__layers = t.split(Ev).map((function (t) {
                    return t.trim()
                })).map((function (t) {
                    return e.__parseLayer(t)
                })).filter(Boolean), n
            }, o.prototype.__parseLayer = function (e) {
                var n = this.get('parseLayer'), o = e.split(kv), r = this.getProperties();
                return n ? n({value: e, values: o}) : r.reduce((function (e, n, r) {
                    var i = o[r];
                    return e[n.getId()] = (0, t.isUndefined)(i) ? n.getDefaultValue() : i, e
                }), {})
            }, o.prototype.__getLayersFromStyle = function (e) {
                var n = this;
                if (void 0 === e && (e = {}), !this.__styleHasProps(e)) return null;
                if (this.isEmptyValueStyle(e)) return [];
                var o = this.getName(), r = this.getProperties(), i = this.getLayerSeparator(),
                    a = this.attributes.fromStyle, s = a ? a(e, {property: this, name: o, separatorLayers: i}) : [];
                if (!a) {
                    var l = this.__splitStyleName(e, o, i).map((function (t) {
                        return t.split(n.getSplitSeparator())
                    })).map((function (e) {
                        var n = {};
                        return r.forEach((function (o, r) {
                            var i = e[r];
                            n[o.getId()] = (0, t.isUndefined)(i) ? o.getDefaultValue() : i
                        })), n
                    }));
                    r.forEach((function (t) {
                        var o = t.getId();
                        n.__splitStyleName(e, t.getName(), i).map((function (e) {
                            var n;
                            return (n = {})[o] = e || t.getDefaultValue(), n
                        })).forEach((function (t, e) {
                            l[e] = l[e] ? Tv(Tv({}, l[e]), t) : t
                        }))
                    })), s = l
                }
                return (0, t.isArray)(s) ? s : [s]
            }, o.prototype.getStyle = function (t) {
                return void 0 === t && (t = {}), this.getStyleFromLayers(t)
            }, o.prototype.getStyleFromLayers = function (e) {
                var n = this;
                void 0 === e && (e = {});
                var o = {}, r = this.getName(), i = this.getLayers(), a = this.getProperties();
                if (i.map((function (t) {
                    return n.getStyleFromLayer(t, e)
                })).forEach((function (e) {
                    (0, t.keys)(e).map((function (t) {
                        o[t] || (o[t] = []), o[t].push(e[t])
                    }))
                })), (0, t.keys)(o).map((function (t) {
                    o[t] = o[t].join(n.__getJoinLayers())
                })), this.isDetached()) o[r] = '', !i.length && a.map((function (t) {
                    o[t.getName()] = ''
                })); else {
                    var s = a.reduce((function (t, e) {
                        return t[e.getName()] = '', t
                    }), {});
                    o[r] = o[r] || '', o = Tv(Tv({}, o), s)
                }
                return Tv(Tv({}, o), e.__clear ? {} : this.getEmptyValueStyle())
            }, o.prototype.isEmptyValueStyle = function (e) {
                void 0 === e && (e = {});
                var n = this.getEmptyValueStyle({force: !0}), o = (0, t.keys)(n);
                return !!o.length && o.every((function (t) {
                    return n[t] === e[t]
                }))
            }, o.prototype.getEmptyValueStyle = function (e) {
                void 0 === e && (e = {});
                var n = this.attributes.emptyValue;
                if (!n || this.hasLayers() && !e.force) return {};
                var o = this.getName(), r = this.getProperties(), i = (0, t.isString)(n) ? n : n({property: this});
                if ((0, t.isString)(i)) {
                    var a = {};
                    return this.isDetached() ? r.map((function (t) {
                        a[t.getName()] = i
                    })) : a[o] = i, a
                }
                return i
            }, o.prototype.__getJoinLayers = function () {
                var e = this.get('layerJoin'), n = this.get('layerSeparator');
                return e || ((0, t.isString)(n) ? n : e)
            }, o.prototype.__getFullValue = function () {
                if (this.get('detached')) return '';
                var t = this.getStyleFromLayers();
                return Ae(t[this.getName()])
            }, o.prototype.hasValue = function (t) {
                void 0 === t && (t = {});
                var e = t.noParent && this.getParentTarget();
                return (this.hasLayers() || this.hasEmptyValue()) && !e
            }, o.prototype.clear = function (t) {
                return void 0 === t && (t = {}), this.layers.reset(), this.__upTargetsStyleProps(Tv(Tv({}, t), {__clear: !0})), mv.prototype.clear.call(this), this
            }, o.prototype.__canClearProp = function () {
                return !1
            }, o.prototype.__getLayers = function () {
                return this.layers
            }, o
        }(Sv);
        const jv = Av;
        var Mv = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Dv = void 0 && (void 0).__assign || function () {
            return Dv = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Dv.apply(this, arguments)
        }, Lv = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        }, Iv = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Nv = 'data-clear-style', Rv = function (n) {
            function o(e) {
                void 0 === e && (e = {});
                var o = n.call(this, e) || this;
                (0, t.bindAll)(o, '__change', '__updateStyle');
                var r = e.config || {}, i = r.em;
                o.config = r, o.em = i, o.pfx = r.stylePrefix || '', o.ppfx = r.pStylePrefix || '', o.__destroyFn = o.destroy ? o.destroy.bind(o) : function () {
                };
                var a = o.model;
                a.view = o, o.onValueChange = (0, t.debounce)(o.onValueChange.bind(o), 10), o.updateStatus = (0, t.debounce)(o.updateStatus.bind(o), 0), o.listenTo(a, 'destroy remove', o.remove), o.listenTo(a, 'change:visible', o.updateVisibility), o.listenTo(a, 'change:name change:className change:full', o.render), o.listenTo(a, 'change:value', o.onValueChange), o.listenTo(a, 'change:parentTarget', o.updateStatus), o.listenTo(i, 'change:device', o.onValueChange);
                var s = o.init && o.init.bind(o);
                return s && s(), o
            }

            return Mv(o, n), o.prototype.events = function () {
                var t;
                return (t = {change: 'inputValueChanged'})["click [".concat(Nv, "]")] = 'clear', t
            }, o.prototype.template = function (t) {
                var e = this.pfx, n = this.ppfx;
                return "\n      <div class=\"".concat(e, "label\" data-sm-label></div>\n      <div class=\"").concat(n, "fields\" data-sm-fields></div>\n    ")
            }, o.prototype.templateLabel = function (t) {
                var e = this.pfx, n = this.em, o = t.parent, r = t.attributes, i = r.icon, a = void 0 === i ? '' : i,
                    s = r.info, l = void 0 === s ? '' : s, c = null == n ? void 0 : n.getConfig().icons,
                    u = (null == c ? void 0 : c.close) || '';
                return "\n      <span class=\"".concat(e, "icon ").concat(a, "\" title=\"").concat(l, "\">\n        ").concat(t.getLabel(), "\n      </span>\n      ").concat(o ? '' : "<div class=\"".concat(e, "clear\" style=\"display: none\" ").concat(Nv, ">").concat(u, "</div>"), "\n    ")
            }, o.prototype.templateInput = function (t) {
                return "\n      <div class=\"".concat(this.ppfx, "field\">\n        <input placeholder=\"").concat(t.getDefaultValue(), "\"/>\n      </div>\n    ")
            }, o.prototype.remove = function () {
                var t = this;
                return u.Ss.prototype.remove.apply(this, arguments), ['em', 'input', '$input', 'view'].forEach((function (e) {
                    return t[e] = null
                })), this.__destroyFn(this._getClbOpts()), this
            }, o.prototype.updateStatus = function () {
                var t, e = this, n = e.model, o = e.pfx, r = e.ppfx, i = e.config, a = "".concat(r, "four-color"),
                    s = "".concat(r, "color-warn"), l = this.$el.children(".".concat(o, "label")),
                    c = this.getClearEl(), u = c ? c.style : {};
                l.removeClass("".concat(a, " ").concat(s)), u.display = 'none', n.hasValue({noParent: !0}) && i.highlightChanged ? (l.addClass(a), i.clearProperties && (u.display = '')) : n.hasValue() && i.highlightComputed && l.addClass(s), null === (t = this.parent) || void 0 === t || t.updateStatus()
            }, o.prototype.clear = function (t) {
                t && t.stopPropagation(), this.model.clear()
            }, o.prototype.getClearEl = function () {
                return this.clearEl || (this.clearEl = this.el.querySelector("[".concat(Nv, "]"))), this.clearEl
            }, o.prototype.inputValueChanged = function (t) {
                t && t.stopPropagation(), this.emit || this.model.upValue(t.target.value)
            }, o.prototype.onValueChange = function (t, e, n) {
                void 0 === n && (n = {}), this.setValue(this.model.getFullValue(void 0, {skipImportant: !0})), this.updateStatus()
            }, o.prototype.setValue = function (e) {
                var n = this.model, o = (0, t.isUndefined)(e) || '' === e ? n.getDefaultValue() : e;
                if (this.update) return this.__update(o);
                this.__setValueInput(o)
            }, o.prototype.__setValueInput = function (t) {
                var e = this.getInputEl();
                e && (e.value = t)
            }, o.prototype.getInputEl = function () {
                return this.input || (this.input = this.el.querySelector('input')), this.input
            }, o.prototype.updateVisibility = function () {
                this.el.style.display = this.model.isVisible() ? '' : 'none'
            }, o.prototype.clearCached = function () {
                delete this.clearEl, delete this.input, delete this.$input
            }, o.prototype.__unset = function () {
                var t = this.unset && this.unset.bind(this);
                t && t(this._getClbOpts())
            }, o.prototype.__update = function (t) {
                var e = this.update && this.update.bind(this);
                e && e(Dv(Dv({}, this._getClbOpts()), {value: t}))
            }, o.prototype.__change = function () {
                for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                var n = this.emit && this.emit.bind(this);
                n && n.apply(void 0, Iv([this._getClbOpts()], t, !1))
            }, o.prototype.__updateStyle = function (t, n) {
                void 0 === n && (n = {});
                var o = n.complete, r = n.partial, i = (Lv(n, ["complete", "partial"]), this.model),
                    a = !1 !== o && !0 !== r;
                (0, e.isObject)(t) ? i.__upTargetsStyle(t, {avoidStore: !a}) : i.upValue(t, {partial: !a})
            }, o.prototype._getClbOpts = function () {
                var t = this, e = t.model;
                return {
                    el: t.el,
                    createdEl: t.createdEl,
                    property: e,
                    props: e.attributes,
                    change: this.__change,
                    updateStyle: this.__updateStyle
                }
            }, o.prototype.render = function () {
                this.clearCached();
                var t = this, e = t.pfx, n = t.model, o = t.el, r = t.$el, i = n.getName(), a = n.getType(),
                    s = n.get('className') || '', l = "".concat(e, "property"),
                    c = 'number' === a ? "".concat(e).concat(a, " ").concat(e, "integer") : "".concat(e).concat(a);
                this.createdEl && this.__destroyFn(this._getClbOpts()), r.empty().append(this.template(n)), r.find('[data-sm-label]').append(this.templateLabel(n));
                var u = this.create && this.create.bind(this);
                this.createdEl = u && u(this._getClbOpts()), r.find('[data-sm-fields]').append(this.createdEl || this.templateInput(n)), o.className = "".concat(l, " ").concat(c, " ").concat(l, "__").concat(i, " ").concat(s).trim(), o.className += n.isFull() ? " ".concat(l, "--full") : '';
                var p = this.onRender && this.onRender.bind(this);
                return p && p(), this.setValue(n.getValue()), this
            }, o.prototype.onRender = function () {
            }, o
        }(u.Ss);
        const Vv = Rv;
        var Fv = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Hv = function (t) {
            function e(e) {
                var n = t.call(this, e) || this;
                n.config = e.config || {}, n.pfx = n.config.stylePrefix || '', n.properties = [], n.parent = e.parent;
                var o = n.collection;
                return n.listenTo(o, 'add', n.addTo), n.listenTo(o, 'reset', n.render), n
            }

            return Fv(e, t), e.prototype.addTo = function (t, e, n) {
                this.add(t, null, n)
            }, e.prototype.add = function (t, e, n) {
                void 0 === n && (n = {});
                var o = this.parent, r = this.config, i = e || this.el, a = new t.typeView({model: t, config: r});
                o && (a.parent = o), a.render();
                var s = a.el;
                this.properties.push(a), (0, Z.Sc)(i, s, n.at)
            }, e.prototype.remove = function () {
                return u.Ss.prototype.remove.apply(this, arguments), this.clearItems(), this
            }, e.prototype.clearItems = function () {
                this.properties.forEach((function (t) {
                    return t.remove()
                })), this.properties = []
            }, e.prototype.render = function () {
                var t = this, e = this.$el, n = this.pfx;
                this.clearItems();
                var o = document.createDocumentFragment();
                return this.collection.forEach((function (e) {
                    return t.add(e, o)
                })), e.empty(), e.append(o), e.attr('class', "".concat(n, "properties")), this
            }, e
        }(u.Ss);
        const Uv = Hv;
        var zv = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Bv = void 0 && (void 0).__assign || function () {
            return Bv = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Bv.apply(this, arguments)
        }, Wv = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return zv(e, t), e.prototype.templateInput = function () {
                var t = this.pfx;
                return "\n      <div class=\"".concat(t, "field ").concat(t, "composite\">\n        <span id=\"").concat(t, "input-holder\"></span>\n      </div>\n    ")
            }, e.prototype.remove = function () {
                var t;
                return null === (t = this.props) || void 0 === t || t.remove(), Vv.prototype.remove.apply(this, arguments), this
            }, e.prototype.onValueChange = function () {
            }, e.prototype.onRender = function () {
                var t = this.pfx, e = this.model, n = e.get('properties');
                if (n.length && !this.props) {
                    var o = e.isDetached(), r = new Uv({
                        config: Bv(Bv({}, this.config), {highlightComputed: o, highlightChanged: o}),
                        collection: n,
                        parent: this
                    });
                    r.render(), this.$el.find("#".concat(t, "input-holder")).append(r.el), this.props = r
                }
            }, e.prototype.clearCached = function () {
                Vv.prototype.clearCached.apply(this, arguments), delete this.props
            }, e
        }(Vv);
        const $v = Wv;
        var qv = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Gv = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return qv(n, e), n.prototype.events = function () {
                return {
                    click: 'select',
                    'click [data-close-layer]': 'removeItem',
                    'mousedown [data-move-layer]': 'initSorter',
                    'touchstart [data-move-layer]': 'initSorter'
                }
            }, n.prototype.template = function () {
                var t = this, e = t.pfx, n = t.ppfx, o = t.em, r = null == o ? void 0 : o.getConfig().icons,
                    i = (null == r ? void 0 : r.close) || '', a = (null == r ? void 0 : r.move) || '';
                return "\n      <div class=\"".concat(e, "label-wrp\">\n        <div id=\"").concat(e, "move\" class=\"").concat(n, "no-touch-actions\" data-move-layer>\n          ").concat(a, "\n        </div>\n        <div id=\"").concat(e, "label\" data-label></div>\n        <div id=\"").concat(e, "preview-box\" class=\"").concat(e, "layer-preview\" style=\"display: none\" data-preview-box>\n          <div id=\"").concat(e, "preview\" class=\"").concat(e, "layer-preview-cnt\" data-preview></div>\n        </div>\n        <div id=\"").concat(e, "close-layer\" class=\"").concat(e, "btn-close\" data-close-layer>\n          ").concat(i, "\n        </div>\n      </div>\n      <div id=\"").concat(e, "inputs\" data-properties></div>\n    ")
            }, n.prototype.initialize = function (t) {
                void 0 === t && (t = {});
                var e = this.model, n = t.config || {};
                this.em = n.em, this.config = n, this.sorter = t.sorter, this.pfx = n.stylePrefix || '', this.ppfx = n.pStylePrefix || '', this.propertyView = t.propertyView;
                var o = this.propertyView.model;
                this.listenTo(e, 'destroy remove', this.remove), this.listenTo(e, 'change:values', this.updateLabel), this.listenTo(o, 'change:selectedLayer', this.updateVisibility), e.view = this, e.set({
                    droppable: 0,
                    draggable: 1
                }), this.$el.data('model', e)
            }, n.prototype.initSorter = function () {
                var t;
                null === (t = this.sorter) || void 0 === t || t.startSort([{element: this.el}])
            }, n.prototype.removeItem = function (t) {
                t && t.stopPropagation(), this.model.remove()
            }, n.prototype.select = function () {
                this.model.select()
            }, n.prototype.getPropertiesWrapper = function () {
                return this.propsWrapEl || (this.propsWrapEl = this.el.querySelector('[data-properties]')), this.propsWrapEl
            }, n.prototype.getPreviewEl = function () {
                return this.previewEl || (this.previewEl = this.el.querySelector('[data-preview]')), this.previewEl
            }, n.prototype.getLabelEl = function () {
                return this.labelEl || (this.labelEl = this.el.querySelector('[data-label]')), this.labelEl
            }, n.prototype.updateLabel = function () {
                var e = this.model, n = e.getLabel();
                if (this.getLabelEl().innerHTML = n, e.hasPreview()) {
                    var o = this.getPreviewEl(), r = e.getStylePreview({number: {min: -3, max: 3}}),
                        i = (0, t.keys)(r).map((function (t) {
                            return "".concat(t, ":").concat(r[t])
                        })).join(';');
                    o.setAttribute('style', i)
                }
            }, n.prototype.updateVisibility = function () {
                var t, e = this, n = e.pfx, o = e.model, r = e.propertyView, i = this.getPropertiesWrapper(),
                    a = o.isSelected();
                i.style.display = a ? '' : 'none', this.$el[a ? 'addClass' : 'removeClass']("".concat(n, "active")), a && i.appendChild(null === (t = r.props) || void 0 === t ? void 0 : t.el)
            }, n.prototype.render = function () {
                var t = this, e = t.el, n = t.pfx, o = t.model;
                return e.innerHTML = this.template(), e.className = "".concat(n, "layer"), o.hasPreview() && (e.querySelector('[data-preview-box]').style.display = ''), this.updateLabel(), this.updateVisibility(), this
            }, n
        }(u.Ss);
        const Kv = Gv;
        var Yv = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Xv = function (t) {
            function e(e) {
                var n = t.call(this, e) || this, o = n.collection, r = e.config || {}, i = r.em,
                    a = r.stylePrefix || '', s = r.pStylePrefix || '';
                n.config = r, n.pfx = a, n.ppfx = s, n.propertyView = e.propertyView, n.className = "".concat(a, "layers ").concat(s, "field"), n.listenTo(o, 'add', n.addTo), n.listenTo(o, 'reset', n.reset), n.items = [];
                var l = n.createPlaceholder(r.pStylePrefix);
                n.$el.append(l);
                var c = null == i ? void 0 : i.Utils;
                return n.sorter = c ? new c.StyleManagerSorter({
                    em: i,
                    containerContext: {
                        container: n.el,
                        containerSel: ".".concat(a, "layers"),
                        itemSel: ".".concat(a, "layer"),
                        pfx: r.pStylePrefix,
                        document,
                        placeholderElement: l
                    },
                    dragBehavior: {dragDirection: Hn.A.Vertical, nested: !1}
                }) : void 0, o.view = n, n.$el.data('model', o), n.$el.data('collection', o), n
            }

            return Yv(e, t), e.prototype.addTo = function (t) {
                var e = this.collection.indexOf(t);
                this.addToCollection(t, null, e)
            }, e.prototype.addToCollection = function (t, e, n) {
                var o = e || null, r = this, i = r.propertyView, a = r.config, s = r.sorter, l = r.$el,
                    c = new Kv({model: t, config: a, sorter: s, propertyView: i}), u = c.render().el;
                if (this.items.push(c), o) o.appendChild(u); else if (void 0 !== n) {
                    var p = 'before';
                    l.children().length === n && (n--, p = 'after'), n < 0 ? l.append(u) : l.children().eq(n)[p](u)
                } else l.append(u);
                return u
            }, e.prototype.reset = function (t, e) {
                this.clearItems(), this.render()
            }, e.prototype.remove = function () {
                return this.clearItems(), u.Ss.prototype.remove.apply(this, arguments), this
            }, e.prototype.clearItems = function () {
                this.items.forEach((function (t) {
                    return t.remove()
                })), this.items = []
            }, e.prototype.render = function () {
                var t = this, e = this.$el, n = document.createDocumentFragment();
                return e.empty(), this.collection.forEach((function (e) {
                    return t.addToCollection(e, n)
                })), e.append(n), e.attr('class', this.className), this
            }, e.prototype.createPlaceholder = function (t) {
                var e = document.createElement('div'), n = document.createElement('div');
                return this.el.parentNode, e.className = t + 'placeholder', e.style.display = 'none', e.style.pointerEvents = 'none', n.className = t + 'placeholder-int', e.appendChild(n), e
            }, e
        }(u.Ss);
        const Jv = Xv;
        var Zv = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Qv = void 0 && (void 0).__assign || function () {
            return Qv = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Qv.apply(this, arguments)
        }, tg = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Zv(e, t), e.prototype.events = function () {
                return Qv(Qv({}, $v.prototype.events()), {'click [data-add-layer]': 'addLayer', change: ''})
            }, e.prototype.templateInput = function () {
                var t = this.pfx, e = this.em, n = null == e ? void 0 : e.getConfig().icons,
                    o = (null == n ? void 0 : n.plus) || '+';
                return "\n      <div class=\"".concat(t, "field ").concat(t, "stack\">\n        <button type=\"button\" id=\"").concat(t, "add\" data-add-layer>\n          ").concat(o, "\n        </button>\n        <div data-layers-wrapper></div>\n      </div>\n    ")
            }, e.prototype.init = function () {
                var t = this.model;
                this.listenTo(t.layers, 'change reset', this.updateStatus), this.listenTo(t, 'change:isEmptyValue', this.updateStatus)
            }, e.prototype.addLayer = function () {
                this.model.addLayer({}, {at: 0})
            }, e.prototype.setValue = function () {
            }, e.prototype.remove = function () {
                var t;
                return null === (t = this.layersView) || void 0 === t || t.remove(), $v.prototype.remove.apply(this, arguments), this
            }, e.prototype.clearCached = function () {
                $v.prototype.clearCached.apply(this, arguments), delete this.layersView
            }, e.prototype.onRender = function () {
                var t = this, e = t.model, n = t.el, o = t.config, r = e.get('properties');
                if (r.length && !this.props) {
                    var i = new Uv({
                        config: Qv(Qv({}, o), {highlightComputed: !1, highlightChanged: !1}),
                        collection: r,
                        parent: this
                    });
                    i.render();
                    var a = new Jv({collection: e.layers, config: o, propertyView: this});
                    a.render(), n.querySelector('[data-layers-wrapper]').appendChild(a.el), this.props = i, this.layersView = a
                }
            }, e
        }($v);
        const eg = tg;
        var ng = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), og = void 0 && (void 0).__assign || function () {
            return og = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, og.apply(this, arguments)
        }, rg = function (e) {
            function n() {
                return null !== e && e.apply(this, arguments) || this
            }

            return ng(n, e), n.prototype.events = function () {
                return og(og({}, Vv.prototype.events()), {
                    'click [data-clear-asset]': 'clear',
                    'click [data-open-assets]': 'openAssetManager'
                })
            }, n.prototype.templateInput = function () {
                var t, e = this.pfx, n = this.em,
                    o = null === (t = this.em) || void 0 === t ? void 0 : t.getConfig().icons,
                    r = null == o ? void 0 : o.close;
                return "\n      <div class=\"".concat(e, "field ").concat(e, "file\">\n        <div id='").concat(e, "input-holder'>\n          <div class=\"").concat(e, "btn-c\">\n            <button class=\"").concat(e, "btn\" id=\"").concat(e, "images\" type=\"button\" data-open-assets>\n              ").concat(n.t('styleManager.fileButton'), "\n            </button>\n          </div>\n          <div style=\"clear:both;\"></div>\n        </div>\n        <div id=\"").concat(e, "preview-box\" class=\"").concat(e, "preview-file\" data-preview-box>\n          <div id=\"").concat(e, "preview-file\" class=\"").concat(e, "preview-file-cnt\" data-preview></div>\n          <div id=\"").concat(e, "close\" class=\"").concat(e, "preview-file-close\" data-clear-asset>").concat(r, "</div>\n        </div>\n      </div>\n    ")
            }, n.prototype.__setValueInput = function (t) {
                var e = this.model, n = this.el, o = e.getDefaultValue(), r = n.querySelector('[data-preview-box]'),
                    i = n.querySelector('[data-preview]');
                r.style.display = t && t !== o ? '' : 'none', i.style.backgroundImage = t || e.getDefaultValue()
            }, n.prototype.openAssetManager = function () {
                var e, n = this, o = null === (e = this.em) || void 0 === e ? void 0 : e.Assets;
                null == o || o.open({
                    select: function (e, r) {
                        var i = (0, t.isString)(e) ? e : e.get('src');
                        n.model.upValue(i, {partial: !r}), r && o.close()
                    }, types: ['image'], accept: 'image/*'
                })
            }, n
        }(Vv);
        const ig = rg;
        var ag = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), sg = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return ag(e, t), e.prototype.templateInput = function (t) {
                return ''
            }, e.prototype.init = function () {
                var t = this.model;
                this.listenTo(t, 'change:unit', this.onValueChange), this.listenTo(t, 'change:units', this.render)
            }, e.prototype.setValue = function (t) {
            }, e.prototype.onRender = function () {
                var t = this, e = t.ppfx, n = t.model, o = t.el;
                if (!this.inputInst) {
                    var r = n.input;
                    r.ppfx = e, r.render(), o.querySelector(".".concat(e, "fields")).appendChild(r.el), this.input = r.inputEl.get(0), this.inputInst = r
                }
            }, e.prototype.clearCached = function () {
                Vv.prototype.clearCached.apply(this, arguments), this.inputInst = null
            }, e
        }(Vv);
        const lg = sg;
        var cg = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ug = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return cg(e, t), e.prototype.setValue = function (t) {
                var e;
                null === (e = this.inputInst) || void 0 === e || e.setValue(t, {
                    fromTarget: 1,
                    def: this.model.getDefaultValue()
                })
            }, e.prototype.remove = function () {
                var t = this;
                lg.prototype.remove.apply(this, arguments);
                var e = this.inputInst;
                return e && e.remove && e.remove(), ['inputInst', '$color'].forEach((function (e) {
                    return t[e] = null
                })), this
            }, e.prototype.__handleChange = function (t, e) {
                this.model.upValue(t, {partial: e})
            }, e.prototype.onRender = function () {
                var t;
                if (!this.inputInst) {
                    this.__handleChange = this.__handleChange.bind(this);
                    var e = this, n = e.ppfx, o = e.model, r = e.em, i = e.el,
                        a = new Mc({target: r, model: o, ppfx: n, onChange: this.__handleChange}).render();
                    i.querySelector(".".concat(n, "fields")).appendChild(a.el), this.input = null === (t = a.inputEl) || void 0 === t ? void 0 : t.get(0), this.inputInst = a
                }
            }, e
        }(lg);
        const pg = ug;
        var dg = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), fg = void 0 && (void 0).__assign || function () {
            return fg = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, fg.apply(this, arguments)
        }, hg = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, vg = function (n) {
            function o() {
                return null !== n && n.apply(this, arguments) || this
            }

            return dg(o, n), o.prototype.defaults = function () {
                return fg(fg({}, mv.getDefaults()), {options: [], full: 0})
            }, o.prototype.getOptions = function () {
                var t = this.attributes, e = t.options, n = t.list;
                return (e && e.length ? e : n) || []
            }, o.prototype.getOption = function (t) {
                var n = this, o = (0, e.isDef)(t) ? t : this.getValue();
                return this.getOptions().filter((function (t) {
                    return n.getOptionId(t) === o
                }))[0] || null
            }, o.prototype.setOptions = function (t) {
                return void 0 === t && (t = []), this.set('options', t), this
            }, o.prototype.addOption = function (t) {
                if (t) {
                    var e = this.getOptions();
                    this.setOptions(hg(hg([], e, !0), [t], !1))
                }
                return this
            }, o.prototype.getOptionId = function (t) {
                return (0, e.isDef)(t.id) ? t.id : t.value
            }, o.prototype.getOptionLabel = function (e, n) {
                var o;
                void 0 === n && (n = {});
                var r = n.locale, i = void 0 === r || r, a = ((0, t.isString)(e) ? this.getOption(e) : e) || {},
                    s = this.getOptionId(a), l = a.label || a.name || s, c = n.property || this.getId();
                return i && (null === (o = this.em) || void 0 === o ? void 0 : o.t("styleManager.options.".concat(c, ".").concat(s))) || l
            }, o.prototype.initialize = function () {
                for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                mv.prototype.initialize.apply(this, t), this.listenTo(this, 'change:options', this.__onOptionChange)
            }, o.prototype.__onOptionChange = function () {
                this.set('list', this.get('options'))
            }, o
        }(mv);
        const gg = vg;
        var yg = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }();
        const mg = function (t) {
            function e(e) {
                var n = t.call(this, e) || this;
                return n.listenTo(n.model, 'change:options', n.updateOptions), n
            }

            return yg(e, t), e.prototype.templateInput = function () {
                var t = this.pfx, e = this.ppfx;
                return "\n      <div class=\"".concat(e, "field ").concat(e, "select\">\n        <span id=\"").concat(t, "input-holder\"></span>\n        <div class=\"").concat(e, "sel-arrow\">\n          <div class=\"").concat(e, "d-s-arrow\"></div>\n        </div>\n      </div>\n    ")
            }, e.prototype.updateOptions = function () {
                delete this.input, this.onRender()
            }, e.prototype.onRender = function () {
                var t = this.pfx, e = this.model, n = e.getOptions();
                if (!this.input) {
                    var o = [];
                    n.forEach((function (t) {
                        var n = e.getOptionId(t), r = e.getOptionLabel(n),
                            i = t.style ? t.style.replace(/"/g, '&quot;') : '', a = i ? "style=\"".concat(i, "\"") : '',
                            s = n.replace(/"/g, '&quot;');
                        o.push("<option value=\"".concat(s, "\" ").concat(a, ">").concat(r, "</option>"))
                    }));
                    var r = this.el.querySelector("#".concat(t, "input-holder"));
                    r.innerHTML = "<select>".concat(o.join(''), "</select>"), this.input = r.firstChild
                }
            }, e.prototype.__setValueInput = function (t) {
                var e = this.model, n = this.getInputEl(), o = e.getOptions()[0], r = o ? e.getOptionId(o) : '';
                n && (n.value = t || r)
            }, e
        }(Vv);
        var bg = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), _g = void 0 && (void 0).__assign || function () {
            return _g = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, _g.apply(this, arguments)
        };
        const wg = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return bg(e, t), e.prototype.defaults = function () {
                return _g(_g({}, gg.getDefaults()), {full: 1})
            }, e
        }(gg);
        var xg = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Cg = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return xg(e, t), e.prototype.templateInput = function () {
                var t = this.ppfx;
                return "<div class=\"".concat(t, "field ").concat(t, "field-radio\"></div>")
            }, e.prototype.onRender = function () {
                var t = this.pfx, e = this.ppfx, n = this.model, o = "".concat(e, "radio-item-label"), r = n.getName(),
                    i = n.getOptions(), a = "".concat(t, "radio ").concat(t, "radio-").concat(r), s = n.cid;
                if (!this.input) {
                    var l = [];
                    i.forEach((function (i) {
                        var c = i.className ? "".concat(i.className, " ").concat(t, "icon ").concat(o) : '',
                            u = n.getOptionId(i), p = "".concat(r, "-").concat(u, "-").concat(s),
                            d = c ? '' : n.getOptionLabel(u), f = i.title ? "title=\"".concat(i.title, "\"") : '',
                            h = n.getValue() === u ? 'checked' : '';
                        l.push("\n          <div class=\"".concat(e, "radio-item\">\n            <input type=\"radio\" class=\"").concat(a, "\" id=\"").concat(p, "\" name=\"").concat(r, "-").concat(s, "\" value=\"").concat(u, "\" ").concat(h, "/>\n            <label class=\"").concat(c || o, "\" ").concat(f, " for=\"").concat(p, "\">").concat(d, "</label>\n          </div>\n        "))
                    }));
                    var c = this.el.querySelector(".".concat(e, "field"));
                    c.innerHTML = "<div class=\"".concat(e, "radio-items\">").concat(l.join(''), "</div>"), this.input = c.firstChild
                }
            }, e.prototype.__setValueInput = function (t) {
                var e, n = this.model, o = t || n.getDefaultValue(),
                    r = null === (e = this.getInputEl()) || void 0 === e ? void 0 : e.querySelector("[value=\"".concat(o, "\"]"));
                r && (r.checked = !0)
            }, e
        }(mg);
        const Sg = Cg;
        var Og = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Tg = void 0 && (void 0).__assign || function () {
            return Tg = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Tg.apply(this, arguments)
        }, Pg = function (n) {
            function o() {
                return null !== n && n.apply(this, arguments) || this
            }

            return Og(o, n), o.prototype.defaults = function () {
                return Tg(Tg({}, mv.getDefaults()), {units: [], unit: '', min: '', max: '', step: 1})
            }, o.prototype.getUnits = function () {
                return this.get('units') || []
            }, o.prototype.getUnit = function () {
                return this.get('unit')
            }, o.prototype.getMin = function () {
                return this.get('min')
            }, o.prototype.getMax = function () {
                return this.get('max')
            }, o.prototype.getStep = function () {
                return this.get('step')
            }, o.prototype.upUnit = function (t, e) {
                return void 0 === e && (e = {}), this._up({unit: t}, e)
            }, o.prototype.initialize = function (t, n) {
                void 0 === t && (t = {}), void 0 === n && (n = {}), mv.callParentInit(mv, this, t, n);
                var o = this.get('unit'), r = this.getUnits();
                this.input = (0, e.hasWin)() ? new Rc({model: this}) : void 0, r.length && !o && this.set('unit', r[0], {silent: !0}), mv.callInit(this, t, n)
            }, o.prototype.__getClearProps = function () {
                return Tg(Tg({}, mv.prototype.__getClearProps()), {unit: ''})
            }, o.prototype.parseValue = function (t, e) {
                void 0 === e && (e = {});
                var n = mv.prototype.parseValue.apply(this, arguments),
                    o = this.input.validateInputValue(n.value, Tg({deepCheck: 1}, e)), r = o.value, i = o.unit;
                return n.value = r, n.unit = i, n
            }, o.prototype.getFullValue = function () {
                var e = this.get('value'), n = this.get('unit'), o = (0, t.isUndefined)(e) ? '' : "".concat(e),
                    r = !(0, t.isUndefined)(n) && o ? n : '', i = "".concat(o).concat(r);
                return mv.prototype.getFullValue.apply(this, [i])
            }, o
        }(mv);
        const Eg = Pg;
        var kg = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ag = void 0 && (void 0).__assign || function () {
            return Ag = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Ag.apply(this, arguments)
        };
        const jg = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return kg(e, t), e.prototype.defaults = function () {
                return Ag(Ag({}, Eg.getDefaults()), {showInput: 1})
            }, e
        }(Eg);
        var Mg = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Dg = void 0 && (void 0).__assign || function () {
            return Dg = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Dg.apply(this, arguments)
        };
        const Lg = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return Mg(e, t), e.prototype.events = function () {
                return Dg(Dg({}, lg.prototype.events()), {
                    'change [type=range]': 'inputValueChanged',
                    'input [type=range]': 'inputValueChangedSoft',
                    change: ''
                })
            }, e.prototype.templateInput = function (t) {
                var e = this.ppfx;
                return "\n      <div class=\"".concat(e, "field ").concat(e, "field-range\">\n        <input type=\"range\" min=\"").concat(t.get('min'), "\" max=\"").concat(t.get('max'), "\" step=\"").concat(t.get('step'), "\"/>\n      </div>\n    ")
            }, e.prototype.getSliderEl = function () {
                return this.slider || (this.slider = this.el.querySelector('input[type=range]')), this.slider
            }, e.prototype.inputValueChanged = function (t) {
                t.stopPropagation(), this.model.upValue(this.getSliderEl().value)
            }, e.prototype.inputValueChangedSoft = function (t) {
                t.stopPropagation(), this.model.upValue(this.getSliderEl().value, {partial: !0})
            }, e.prototype.setValue = function (t) {
                var e = this.model, n = e.parseValue(t);
                this.getSliderEl().value = '' === t ? e.getDefaultValue() : parseFloat(n.value), lg.prototype.setValue.apply(this, arguments)
            }, e.prototype.onRender = function () {
                lg.prototype.onRender.apply(this, arguments), this.model.get('showInput') || (this.inputInst.el.style.display = 'none')
            }, e.prototype.clearCached = function () {
                lg.prototype.clearCached.apply(this, arguments), delete this.slider
            }, e
        }(lg);
        const Ig = u.pM.extend(np).extend({
            extendViewApi: 1, init: function () {
                var t = this.opts, e = this.em, n = t.module || (null == e ? void 0 : e.get('StyleManager'));
                n && (n.__listenAdd(this, n.events.propertyAdd), n.__listenRemove(this, n.events.propertyRemove))
            }, types: [{
                id: 'stack', model: jv, view: eg, isType: function (t) {
                    if (t && 'stack' == t.type) return t
                }
            }, {
                id: 'composite', model: Sv, view: $v, isType: function (t) {
                    if (t && 'composite' == t.type) return t
                }
            }, {
                id: 'file', model: mv, view: ig, isType: function (t) {
                    if (t && 'file' == t.type) return t
                }
            }, {
                id: 'color', model: mv, view: pg, isType: function (t) {
                    if (t && 'color' == t.type) return t
                }
            }, {
                id: 'select', model: gg, view: mg, isType: function (t) {
                    if (t && 'select' == t.type) return t
                }
            }, {
                id: 'radio', model: wg, view: Sg, isType: function (t) {
                    if (t && 'radio' == t.type) return t
                }
            }, {
                id: 'slider', model: jg, view: Lg, isType: function (t) {
                    if (t && 'slider' == t.type) return t
                }
            }, {
                id: 'integer', model: Eg, view: lg, isType: function (t) {
                    if (t && 'integer' == t.type) return t
                }
            }, {
                id: 'number', model: Eg, view: lg, isType: function (t) {
                    if (t && 'number' == t.type) return t
                }
            }, {
                id: 'base', model: mv, view: Vv, isType: function (t) {
                    return t.type = 'base', t
                }
            }]
        });
        var Ng = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Rg = void 0 && (void 0).__assign || function () {
            return Rg = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Rg.apply(this, arguments)
        }, Vg = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        }, Fg = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Hg = function (e) {
            function n(n, o) {
                void 0 === o && (o = {});
                var r = e.call(this, n) || this, i = o.em;
                r.em = i;
                var a = n || {}, s = r.buildProperties(a.buildProps), l = r.get('name') || '', c = [];
                !r.get('id') && r.set('id', l.replace(/ /g, '_').toLowerCase()), c = (c = s ? r.extendProperties(s) : r.get('properties').map((function (e) {
                    return (0, t.isString)(e) ? r.buildProperties(e)[0] : e
                })).filter(Boolean)).map((function (t) {
                    return r.checkExtend(t)
                }));
                var u = new Ig(c, {em: i});
                return u.sector = r, r.set('properties', u), r
            }

            return Ng(n, e), n.prototype.defaults = function () {
                return {id: '', name: '', open: !0, visible: !0, extendBuilded: !0, properties: []}
            }, Object.defineProperty(n.prototype, "properties", {
                get: function () {
                    return this.get('properties')
                }, enumerable: !1, configurable: !0
            }), n.prototype.getId = function () {
                return this.get('id')
            }, n.prototype.getName = function () {
                var t, e = this.getId();
                return (null === (t = this.em) || void 0 === t ? void 0 : t.t("styleManager.sectors.".concat(e))) || this.get('name')
            }, n.prototype.setName = function (t) {
                return this.set('name', t)
            }, n.prototype.isOpen = function () {
                return !!this.get('open')
            }, n.prototype.setOpen = function (t) {
                return this.set('open', t)
            }, n.prototype.isVisible = function () {
                return !!this.get('visible')
            }, n.prototype.getProperties = function (t) {
                void 0 === t && (t = {});
                var e = this.properties;
                return (e.models ? Fg([], e.models, !0) : e).filter((function (e) {
                    var n = !0;
                    (t.withValue && (n = e.hasValue({noParent: !0})), t.withParentValue) && (n = !e.hasValue({noParent: !0}) && e.hasValue());
                    return n
                }))
            }, n.prototype.getProperty = function (t) {
                return this.getProperties().filter((function (e) {
                    return e.get('id') === t
                }))[0] || void 0
            }, n.prototype.addProperty = function (t, e) {
                return this.properties.add(this.checkExtend(t), e)
            }, n.prototype.extendProperties = function (e, n, o) {
                void 0 === o && (o = !1);
                for (var r = e.length, i = n || this.get('properties'), a = this.get('extendBuilded'), s = [], l = 0, c = i.length; l < c; l++) {
                    for (var u = i[l], p = 0, d = 0; d < r; d++) {
                        var f = e[d];
                        if (u.property != f.property && u.id != f.property) ; else {
                            var h = u.properties;
                            h && h.length && (u.properties = this.extendProperties(f.properties || [], h, 1)), e[d] = a ? (0, t.extend)(f, u) : u, s[d] = e[d], p = 1
                        }
                    }
                    p || (e.push(u), s.push(u))
                }
                return o ? s.filter((function (t) {
                    return t
                })) : e
            }, n.prototype.checkExtend = function (e) {
                var n = ((0, t.isString)(e) ? {extend: e} : e) || {}, o = n.extend, r = Vg(n, ["extend"]);
                return o ? Rg(Rg({}, this.buildProperties([o])[0] || {}), r) : e
            }, n.prototype.buildProperties = function (t) {
                var e, n = t || [];
                if (!n.length) return [];
                var o = null === (e = this.em) || void 0 === e ? void 0 : e.Styles.builtIn;
                return null == o ? void 0 : o.build(n)
            }, n
        }(u.Kx);
        const Ug = Hg;
        var zg = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Bg = void 0 && (void 0).__assign || function () {
            return Bg = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Bg.apply(this, arguments)
        };
        const Wg = function (t) {
            function e() {
                return null !== t && t.apply(this, arguments) || this
            }

            return zg(e, t), e.prototype.initialize = function (t, e) {
                void 0 === e && (e = {});
                var n = e.module, o = e.em;
                this.em = o, this.module = n, this.listenTo(this, 'reset', this.onReset)
            }, e.prototype.model = function (t, e) {
                void 0 === e && (e = {});
                var n = e.collection.em;
                return new Ug(t, Bg(Bg({}, e), {em: n}))
            }, e.prototype.onReset = function (t, e) {
                void 0 === e && (e = {}), (e.previousModels || []).forEach((function (t) {
                    return t.get('properties').reset()
                }))
            }, e
        }(u.pM);
        var $g = void 0 && (void 0).__assign || function () {
            return $g = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, $g.apply(this, arguments)
        }, qg = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        }, Gg = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Kg = function (t) {
            return t.map((function (t) {
                return {id: t}
            }))
        }, Yg = function () {
            function e() {
                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 t = ', sans-serif', e = ['flex-start', 'flex-end', 'center'],
                    n = Gg(Gg([], e, !0), ['baseline', 'stretch'], !1);
                this.optsBgSize = Kg(['auto', 'cover', 'contain']), this.optsBgAttach = Kg(['scroll', 'fixed', 'local']), this.optsBgRepeat = Kg(['repeat', 'repeat-x', 'repeat-y', 'no-repeat']), this.optsWrap = Kg(['nowrap', 'wrap', 'wrap-reverse']), this.optsOverflow = Kg(['visible', 'hidden', 'scroll', 'auto']), this.optsDir = Kg(['row', 'row-reverse', 'column', 'column-reverse']), this.opstDisplay = Kg(['block', 'inline', 'inline-block', 'flex', 'none']), this.optsTransitFn = Kg(['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out']), this.optsCursor = Kg(['auto', 'pointer', 'copy', 'crosshair', 'grab', 'grabbing', 'help', 'move', 'text']), this.optsFloat = Kg(['none', 'left', 'right']), this.optsPos = Kg(['static', 'relative', 'absolute', 'fixed']), this.optsTextAlign = Kg(['left', 'center', 'right', 'justify']), this.optsFlexAlign = Kg(n), this.optsJustCont = Kg(Gg(Gg([], e, !0), ['space-between', 'space-around', 'space-evenly'], !1)), this.optsAlignCont = Kg(Gg(Gg([], e, !0), ['space-between', 'space-around', 'stretch'], !1)), this.optsAlignSelf = Kg(Gg(['auto'], n, !0)), this.optsTransitProp = Kg(['all', 'width', 'height', 'background-color', 'transform', 'box-shadow', 'opacity']), this.optsBorderStyle = Kg(['none', 'solid', 'dotted', 'dashed', 'double', 'groove', 'ridge', 'inset', 'outset']), this.optsBgPos = Kg(['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' + t, 'Arial Black, Gadget' + t, 'Brush Script MT' + t, 'Comic Sans MS, cursive' + t, 'Courier New, Courier, monospace', 'Georgia, serif', 'Helvetica' + t, 'Impact, Charcoal' + t, 'Lucida Sans Unicode, Lucida Grande' + t, 'Tahoma, Geneva' + t, 'Times New Roman, Times, serif', 'Trebuchet MS, Helvetica' + t, 'Verdana, Geneva' + t].map((function (t) {
                    return {id: t, label: t.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 e.prototype.__sub = function (e) {
                var n = this;
                return function () {
                    return e.map((function (e) {
                        if ((0, t.isString)(e)) return n.get(e);
                        var o = e.extend, r = qg(e, ["extend"]);
                        return $g($g({}, n.get(o)), r)
                    }))
                }
            }, e.prototype.init = function () {
                var t = this, e = this, n = e.fixedValues, o = e.requireFlex, r = e.typeNumber;
                this.props = {};
                var i = [['text-shadow-h', {
                    type: r,
                    default: '0',
                    units: this.unitsSizeNoPerc
                }], ['top', {
                    default: 'auto',
                    units: this.unitsSize,
                    fixedValues: n
                }, '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: o}, '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: r,
                    default: '0',
                    requiresParent: o
                }], ['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',
                    full: !0
                }], ['text-shadow-color', {}, 'color'], ['border-color', {}, 'color'], ['box-shadow-color', {}, 'color'], ['background-color', {default: 'none'}, 'color'], ['background-image', {
                    type: this.typeFile,
                    functionName: 'url',
                    default: 'none',
                    full: !0
                }], ['opacity', {
                    type: this.typeSlider,
                    default: '1',
                    min: 0,
                    max: 1,
                    step: .01,
                    full: !0
                }], ['display', {
                    type: this.typeSelect,
                    default: 'block',
                    options: this.opstDisplay
                }], ['flex-direction', {
                    default: 'row',
                    options: this.optsDir,
                    requires: o
                }, '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: o
                }, '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-left-radius',
                        id: 'border-bottom-left-radius-sub'
                    }, {extend: 'border-bottom-right-radius', id: 'border-bottom-right-radius-sub'}])
                }, 'margin'], ['transition', {
                    type: this.typeStack,
                    properties: this.__sub([{
                        extend: 'transition-property',
                        id: 'transition-property-sub'
                    }, {
                        extend: 'transition-duration',
                        id: 'transition-duration-sub'
                    }, {extend: 'transition-timing-function', id: 'transition-timing-function-sub'}])
                }], ['box-shadow', {
                    preview: !0,
                    layerLabel: function (t, e) {
                        var n = e.values, o = n['box-shadow-h'], r = n['box-shadow-v'], i = n['box-shadow-blur'],
                            a = n['box-shadow-spread'];
                        return "".concat(o, " ").concat(r, " ").concat(i, " ").concat(a)
                    },
                    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 (t, e) {
                        var n = e.values, o = n['text-shadow-h'], r = n['text-shadow-v'], i = n['text-shadow-blur'];
                        return "".concat(o, " ").concat(r, " ").concat(i)
                    },
                    properties: this.__sub(['text-shadow-h', 'text-shadow-v', 'text-shadow-blur', 'text-shadow-color'])
                }, 'box-shadow'], ['background', {
                    detached: !0,
                    layerLabel: function (t, e) {
                        var n = e.values;
                        return [n['background-repeat-sub'] || '', n['background-position-sub'] || '', n['background-attachment-sub'] || '', n['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 (t, e) {
                        var n = e.property, o = t[e.name] || '', r = n.getLayerSeparator();
                        return o ? o.split(r).map((function (t) {
                            var e = n.__parseFn(t);
                            return {'transform-type': e.name, 'transform-value': e.value}
                        })) : []
                    },
                    toStyle: function (t, e) {
                        var n;
                        return (n = {})[e.name] = "".concat(t['transform-type'], "(").concat(t['transform-value'], ")"), n
                    },
                    properties: [{
                        property: 'transform-type',
                        name: 'Type',
                        type: this.typeSelect,
                        default: 'rotateZ',
                        full: !0,
                        options: [{id: 'scaleX', propValue: {units: [''], step: .01}}, {
                            id: 'scaleY',
                            propValue: {units: [''], step: .01}
                        }, {id: 'scaleZ', propValue: {units: [''], step: .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 (t) {
                            var e = t.property;
                            if (t.to.value) {
                                var n = e.getOption(), o = $g({}, n.propValue || {}),
                                    r = e.getParent().getProperty('transform-value'), i = r.getUnit();
                                (!i || (null == o ? void 0 : o.units.indexOf(i)) < 0) && (o.unit = (null == o ? void 0 : o.units[0]) || ''), r.up(o)
                            }
                        }
                    }, {property: 'transform-value', type: this.typeNumber, default: '0', full: !0}]
                }]];
                return i.forEach((function (e) {
                    var n = e[0], o = e[1], r = e[2];
                    t.add(n, o || {}, {from: r})
                })), this
            }, e.prototype.add = function (e, n, o) {
                void 0 === n && (n = {}), void 0 === o && (o = {});
                var r = o.from || '', i = this.props[r || e] || {}, a = $g($g($g({}, i), {property: e}), n);
                return a.properties && (0, t.isFunction)(a.properties) && (a.properties = a.properties()), this.props[e] = a, a
            }, e.prototype.get = function (t) {
                return this.props[t]
            }, e.prototype.build = function (e) {
                var n = this, o = [];
                return ((0, t.isString)(e) ? [e] : e).forEach((function (t) {
                    o.push(n.get(t) || {property: t})
                })), o
            }, e
        }();
        const Xg = Yg;
        var Jg = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Zg = void 0 && (void 0).__makeTemplateObject || function (t, e) {
            return Object.defineProperty ? Object.defineProperty(t, "raw", {value: e}) : t.raw = e, t
        }, Qg = function (t) {
            function e(e) {
                var n = t.call(this, e) || this, o = e.config || {}, r = n.model, i = o.em;
                return n.config = o, n.em = i, n.pfx = o.stylePrefix || '', n.listenTo(r, 'destroy remove', n.remove), n.listenTo(r, 'change:open', n.updateOpen), n.listenTo(r, 'change:visible', n.updateVisibility), n
            }

            return Jg(e, t), e.prototype.template = function (t) {
                var e, n = t.pfx, o = t.label,
                    i = null === (e = this.em) || void 0 === e ? void 0 : e.getConfig().icons,
                    a = (null == i ? void 0 : i.caret) || '', s = "".concat(n, "sector-");
                return r(ey || (ey = Zg(["\n      <div class=\"", "title\" data-sector-title>\n        <div class=\"", "caret\">$", "</div>\n        <div class=\"", "label\">", "</div>\n      </div>\n    "], ["\n      <div class=\"", "title\" data-sector-title>\n        <div class=\"", "caret\">$", "</div>\n        <div class=\"", "label\">", "</div>\n      </div>\n    "])), s, s, a, s, o)
            }, e.prototype.events = function () {
                return {'click [data-sector-title]': 'toggle'}
            }, e.prototype.updateOpen = function () {
                var t = this, e = t.$el, n = t.model, o = t.pfx, r = n.isOpen();
                e[r ? 'addClass' : 'removeClass']("".concat(o, "open")), this.getPropertiesEl().style.display = r ? '' : 'none'
            }, e.prototype.updateVisibility = function () {
                this.el.style.display = this.model.isVisible() ? '' : 'none'
            }, e.prototype.getPropertiesEl = function () {
                var t = this.$el, e = this.pfx;
                return t.find(".".concat(e, "properties")).get(0)
            }, e.prototype.toggle = function () {
                var t = this.model;
                t.setOpen(!t.get('open'))
            }, e.prototype.renderProperties = function () {
                var t = this.model, e = this.config, n = t.get('properties');
                if (n) {
                    var o = new Uv({collection: n, config: e});
                    this.$el.append(o.render().el)
                }
            }, e.prototype.render = function () {
                var t = this, e = t.pfx, n = t.model, o = t.$el, r = n.getId(), i = n.getName();
                return o.html(this.template({
                    pfx: e,
                    label: i
                })), this.renderProperties(), o.attr('class', "".concat(e, "sector ").concat(e, "sector__").concat(r, " no-select")), this.updateOpen(), this
            }, e
        }(u.Ss);
        const ty = Qg;
        var ey, ny = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), oy = function (t) {
            function e(e) {
                void 0 === e && (e = {});
                var n = t.call(this, e) || this, o = e.module, r = e.config, i = n.collection;
                return n.pfx = (null == r ? void 0 : r.stylePrefix) || '', n.ppfx = (null == r ? void 0 : r.pStylePrefix) || '', n.config = r, n.module = o, n.listenTo(i, 'add', n.addTo), n.listenTo(i, 'reset', n.render), n
            }

            return ny(e, t), e.prototype.remove = function () {
                var t = this;
                return u.Ss.prototype.remove.apply(this, arguments), ['config', 'module', 'em'].forEach((function (e) {
                    return t[e] = {}
                })), this
            }, e.prototype.addTo = function (t, e, n) {
                void 0 === n && (n = {}), this.addToCollection(t, null, n)
            }, e.prototype.addToCollection = function (t, e, n) {
                void 0 === n && (n = {});
                var o = this.config, r = this.el, i = e || r, a = new ty({model: t, config: o}).render().el;
                return (0, Z.Sc)(i, a, n.at), a
            }, e.prototype.render = function () {
                var t = this, e = this, n = e.$el, o = e.pfx, r = e.ppfx;
                n.empty();
                var i = document.createDocumentFragment();
                return this.collection.each((function (e) {
                    return t.addToCollection(e, i)
                })), n.append(i), n.addClass("".concat(o, "sectors ").concat(r, "one-bg ").concat(r, "two-color")), this
            }, e
        }(u.Ss);
        const ry = oy;
        var iy = void 0 && (void 0).__extends || function () {
                var t = function (e, n) {
                    return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                        t.__proto__ = e
                    } || function (t, e) {
                        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                    }, t(e, n)
                };
                return function (e, n) {
                    if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                    function o() {
                        this.constructor = e
                    }

                    t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
                }
            }(), ay = void 0 && (void 0).__assign || function () {
                return ay = Object.assign || function (t) {
                    for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                    return t
                }, ay.apply(this, arguments)
            }, sy = void 0 && (void 0).__spreadArray || function (t, e, n) {
                if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
                return t.concat(o || Array.prototype.slice.call(e))
            }, ly = 'style', cy = "".concat(ly, ":"), uy = "".concat(cy, "sector"), py = "".concat(uy, ":add"),
            dy = "".concat(uy, ":remove"), fy = "".concat(uy, ":update"), hy = "".concat(cy, "property"),
            vy = "".concat(hy, ":add"), gy = "".concat(hy, ":remove"), yy = "".concat(hy, ":update"),
            my = "".concat(cy, "layer:select"), by = "".concat(cy, "target"), _y = "".concat(cy, "custom"),
            wy = function (t) {
                return t || 0 === t
            }, xy = {
                all: ly,
                sectorAdd: py,
                sectorRemove: dy,
                sectorUpdate: fy,
                propertyAdd: vy,
                propertyRemove: gy,
                propertyUpdate: yy,
                layerSelect: my,
                target: by,
                custom: _y
            }, Cy = function (n) {
                function o(e) {
                    var o = n.call(this, e, 'StyleManager', new Wg([], {em: e}), xy, dv()) || this;
                    o.Sector = Ug, o.storageKey = '', (0, t.bindAll)(o, '__clearStateTarget');
                    var r = o.config, i = r.pStylePrefix;
                    i && (r.stylePrefix = i + r.stylePrefix), o.builtIn = new Xg, o.properties = new Ig([], {
                        em: e,
                        module: o
                    }), o.sectors = o.all;
                    var a = new u.Kx({targets: []});
                    o.model = a;
                    var s = $.I.update,
                        l = "component:toggled ".concat(s, ":classes change:state change:device frame:resized selector:type");
                    o.upAll = (0, t.debounce)((function () {
                        return o.__upSel()
                    }), 0), a.listenTo(e, l, o.upAll), a.listenTo(e, 'component:toggled', o.__clearStateTarget);
                    var c = (0, t.debounce)((function () {
                        o.__upProps(), o.__trgCustom()
                    }), 0);
                    a.listenTo(e, 'styleable:change undo redo', c);
                    var p = (0, t.debounce)((function () {
                        return o.__trgCustom()
                    }), 0);
                    return a.listenTo(e, "".concat(my, " ").concat(by), p), a.on('change:lastTarget', (function () {
                        return e.trigger(by, o.getSelected())
                    })), o
                }

                return iy(o, n), o.prototype.__upSel = function () {
                    this.select(this.em.getSelectedAll())
                }, o.prototype.__trgCustom = function (t) {
                    void 0 === t && (t = {}), this.__ctn = this.__ctn || t.container, this.em.trigger(this.events.custom, {container: this.__ctn})
                }, o.prototype.__trgEv = function (t) {
                    for (var e, n = [], o = 1; o < arguments.length; o++) n[o - 1] = arguments[o];
                    (e = this.em).trigger.apply(e, sy([t], n, !1))
                }, o.prototype.__clearStateTarget = function () {
                    var t = this, e = this.em, n = this.__getStateTarget();
                    n && (null == e || e.skip((function () {
                        e.Css.remove(n), t.model.set({stateTarget: null})
                    })))
                }, o.prototype.onLoad = function () {
                    this.sectors.add(this.config.sectors, {silent: !0})
                }, o.prototype.postRender = function () {
                    this.__appendTo()
                }, o.prototype.addSector = function (t, e, n) {
                    void 0 === n && (n = {});
                    var o = this.getSector(t);
                    return o || (e.id = t, o = this.sectors.add(e, n)), o
                }, o.prototype.getSector = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.sectors.where({id: t})[0];
                    return !n && e.warn && this._logNoSector(t), n || null
                }, o.prototype.getSectors = function (t) {
                    void 0 === t && (t = {});
                    var e = this.sectors, n = e && e.models ? t.array ? sy([], e.models, !0) : e : [];
                    return t.visible ? n.filter((function (t) {
                        return t.isVisible()
                    })) : n
                }, o.prototype.removeSector = function (t) {
                    return this.getSectors().remove(this.getSector(t, {warn: !0}))
                }, o.prototype.addProperty = function (t, e, n) {
                    void 0 === n && (n = {});
                    var o, r = this.getSector(t, {warn: !0});
                    return r && (o = r.addProperty(e, n)), o
                }, o.prototype.getProperty = function (t, e) {
                    var n, o = this.getSector(t, {warn: !0});
                    return o && (n = o.properties.filter((function (t) {
                        return t.get('property') === e || t.get('id') === e
                    }))[0]), n
                }, o.prototype.getProperties = function (t) {
                    var e, n = this.getSector(t, {warn: !0});
                    return n && (e = n.properties), e
                }, o.prototype.removeProperty = function (t, e) {
                    var n = this.getProperties(t);
                    return n ? n.remove(this.getProperty(t, e)) : null
                }, o.prototype.select = function (n, o) {
                    var r = this;
                    void 0 === o && (o = {});
                    var i = this.em, a = (0, t.isArray)(n) ? n : [n], s = o.stylable, l = i.Css, c = [];
                    a.filter(Boolean).forEach((function (e) {
                        var n = e;
                        if ((0, t.isString)(e)) {
                            var o = l.getRule(e) || l.setRule(e);
                            !(0, t.isUndefined)(s) && o.set({stylable: s}), n = o
                        }
                        c.push(n)
                    }));
                    var u = o.component || c.filter((function (t) {
                        return (0, e.isComponent)(t)
                    })).reverse()[0];
                    c = c.map((function (t) {
                        return r.getModelToStyle(t)
                    }));
                    var p = i.getState(), d = c.slice().reverse()[0], f = this.getParentRules(d, {state: p, component: u}),
                        h = this.__getStateTarget();
                    return i.skip((function () {
                        var t;
                        if (p && (null === (t = null == d ? void 0 : d.getState) || void 0 === t ? void 0 : t.call(d))) {
                            var e = d.getStyle();
                            h ? h.setStyle(e) : h = l.getAll().add({
                                selectors: 'gjs-selected',
                                style: e,
                                shallow: !0,
                                important: !0
                            })
                        } else h && (l.remove(h), h = void 0)
                    })), this.model.set({
                        targets: c,
                        lastTarget: d,
                        lastTargetParents: f,
                        stateTarget: h,
                        component: u
                    }), this.__upProps(o), c
                }, o.prototype.getSelected = function () {
                    return this.model.get('lastTarget')
                }, o.prototype.getSelectedAll = function () {
                    return this.model.get('targets')
                }, o.prototype.getSelectedParents = function () {
                    return this.model.get('lastTargetParents') || []
                }, o.prototype.__getStateTarget = function () {
                    return this.model.get('stateTarget')
                }, o.prototype.addStyleTargets = function (t, e) {
                    this.getSelectedAll().map((function (n) {
                        return n.addStyle(t, e)
                    }));
                    var n = this.getSelected();
                    n && this.__emitCmpStyleUpdate(t);
                    var o = this.__getStateTarget();
                    n && (null == o || o.setStyle(n.getStyle(), e))
                }, o.prototype.getBuiltIn = function (t) {
                    return this.builtIn.get(t)
                }, o.prototype.getBuiltInAll = function () {
                    return this.builtIn.props
                }, o.prototype.addBuiltIn = function (t, e) {
                    return this.builtIn.add(t, e)
                }, o.prototype.getModelToStyle = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.em, o = e.skipAdd;
                    if (n && (null == t ? void 0 : t.toHTML)) {
                        var r = n.getConfig(), i = n.UndoManager, a = n.Css, s = n.Selectors, l = s ? s.getConfig() : {},
                            c = r.devicePreviewMode ? '' : n.get('state'), u = t.get('classes').getStyleable(),
                            p = u.length, d = !l.componentFirst || e.useClasses, f = {noCount: 1},
                            h = {state: c, addOpts: f};
                        i.skip((function () {
                            var e;
                            if (p && d) {
                                var i = n.getCurrentMedia();
                                (e = a.get(u, c, i)) || o || (e = a.add(u, c, i, {}, f))
                            } else if (r.avoidInlineStyle) {
                                var s = t.getId();
                                !(e = a.getIdRule(s, h)) && !o && (e = a.setIdRule(s, {}, h)), t.is('wrapper') && e.set('wrapper', 1, f)
                            }
                            e && (t = e)
                        }))
                    }
                    return t
                }, o.prototype.getParentRules = function (e, n) {
                    var o = void 0 === n ? {} : n, r = o.state, i = o.component, a = this.em, s = [];
                    if (a && e) {
                        var l = i, c = a.Css, u = a.CodeManager.getGenerator('css'), p = e.toHTML ? e : e.getComponent(),
                            d = {array: !0}, f = [], h = [], v = [], g = [], y = function (t) {
                                return t.length ? c.getRules().filter((function (e) {
                                    var n = e.getSelectors().map((function (t) {
                                        return t.getFullName()
                                    }));
                                    return 0 !== n.length && n.every((function (e) {
                                        return t.indexOf(e) >= 0
                                    }))
                                })) : []
                            }, m = function (t) {
                                return t ? c.getRules().filter((function (e) {
                                    return e.selectorsToString() === t
                                })) : []
                            };
                        if (p) f = c.getRules("#".concat(p.getId())), h = m(p.get('tagName')), g = (l ? y(l.getSelectors().getFullName(d)) : []).concat(h).concat(f); else f = l ? c.getRules("#".concat(l.getId())) : [], h = m((null == l ? void 0 : l.get('tagName')) || ''), v = y(((null == l ? void 0 : l.getSelectors().getFullName(d)) || []).filter((function (t) {
                            return -1 === e.getSelectors().getFullName(d).findIndex((function (e) {
                                return e === t
                            }))
                        })).concat(e.getSelectors().getFullName(d))), g = h.concat(f).concat(v);
                        var b = g.filter((function (e) {
                            return (0, t.isUndefined)(r) ? 1 : e.get('state') === r
                        })).sort(u.sortRules).reverse();
                        s = b.slice(b.indexOf(e) + 1)
                    }
                    return s
                }, o.prototype.addType = function (t, e) {
                    this.properties.addType(t, e)
                }, o.prototype.getType = function (t) {
                    return this.properties.getType(t)
                }, o.prototype.getTypes = function () {
                    return this.properties.getTypes()
                }, o.prototype.createType = function (t, e) {
                    var n = void 0 === e ? {} : e, o = n.model, r = void 0 === o ? {} : o, i = n.view,
                        a = void 0 === i ? {} : i, s = this.config, l = this.getType(t);
                    if (l) return new l.view(ay({model: new l.model(r), config: s}, a))
                }, o.prototype.render = function () {
                    var t = this, e = t.config, n = t.em, o = t.SectView, r = o && o.el;
                    return this.SectView = new ry({
                        el: r,
                        em: n,
                        config: e,
                        module: this,
                        collection: this.sectors
                    }), this.SectView.render().el
                }, o.prototype._logNoSector = function (t) {
                    var e = this.em;
                    e && e.logWarning("'".concat(t, "' sector not found"))
                }, o.prototype.__emitCmpStyleUpdate = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.em;
                    if (!t.__p) {
                        var o = this.getSelectedAll(), r = e.components || n.getSelectedAll(),
                            i = Array.isArray(r) ? r : [r], a = ay({}, t);
                        delete a.__p, i.forEach((function (t) {
                            return !o.includes(t) && t.__onStyleChange(a)
                        }))
                    }
                }, o.prototype.__upProps = function (t) {
                    var e = this;
                    void 0 === t && (t = {});
                    var n = this.getSelected();
                    if (n) {
                        var o = this.sectors, r = this.model.get('component'), i = this.getSelectedParents(),
                            a = n.getStyle(), s = i.map((function (t) {
                                return {target: t, style: t.getStyle()}
                            }));
                        o.map((function (n) {
                            n.getProperties().map((function (n) {
                                e.__upProp(n, a, s, t)
                            }))
                        })), o.forEach((function (t) {
                            var e = t.getProperties();
                            e.forEach((function (e) {
                                var i = e.__checkVisibility({target: n, sector: t, component: r, sectors: o.models});
                                e.set('visible', i)
                            }));
                            var i = e.some((function (t) {
                                return t.isVisible()
                            }));
                            t.set('visible', i)
                        }))
                    }
                }, o.prototype.__upProp = function (t, e, n, o) {
                    var r = this, i = t.getName(), a = e[i], s = wy(a), l = 'stack' === t.getType(),
                        c = 'composite' === t.getType(), u = ay(ay({}, o), {__up: !0}), p = !c && !l, d = t, f = t,
                        h = l ? d.__getLayersFromStyle(e) : [], v = c ? f.__getPropsFromStyle(e) : {}, g = s ? a : null,
                        y = null;
                    if (l && null === h || c && null === v) {
                        var m = l ? '__getLayersFromStyle' : '__getPropsFromStyle';
                        if (_ = n.filter((function (t) {
                            return null !== d[m](t.style)
                        }))[0]) {
                            g = _.style[i], y = _.target;
                            var b = d[m](_.style);
                            l ? h = b : v = b
                        }
                    } else if (!s) {
                        var _;
                        g = null, (_ = n.filter((function (t) {
                            return wy(t.style[i])
                        }))[0]) && (g = _.style[i], y = _.target)
                    }
                    if (t.__setParentTarget(y), p && t.__getFullValue() !== g && t.upValue(g, u), l && d.__setLayers(h || [], {isEmptyValue: d.isEmptyValueStyle(e)}), c) {
                        var w = f.getProperties();
                        if (f.isDetached()) {
                            var x = f.__getPropsFromStyle(e, {byName: !0}) || {}, C = n.map((function (t) {
                                return ay(ay({}, t), {style: f.__getPropsFromStyle(t.style, {byName: !0}) || {}})
                            }));
                            w.map((function (t) {
                                return r.__upProp(t, x, C, o)
                            }))
                        } else f.__setProperties(v || {}, u), f.getProperties().map((function (t) {
                            return t.__setParentTarget(y)
                        }))
                    }
                }, o.prototype.destroy = function () {
                    var t;
                    [this.properties, this.sectors].forEach((function (t) {
                        t.reset(), t.stopListening()
                    })), null === (t = this.SectView) || void 0 === t || t.remove(), this.model.stopListening(), this.upAll.cancel()
                }, o
            }(b);
        const Sy = Cy;
        var Oy = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), Ty = void 0 && (void 0).__assign || function () {
            return Ty = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Ty.apply(this, arguments)
        };
        const Py = function (t) {
            function e(e, n) {
                var o = t.call(this, e, n) || this;
                return o.em = n, o.model = function (t, e) {
                    return void 0 === e && (e = {}), new pa(t, Ty(Ty({}, e), {em: n}))
                }, o
            }

            return Oy(e, t), e
        }(u.pM);
        var Ey = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), ky = function (t) {
            function n(e) {
                var n = t.call(this, e, 'DataSources', new Py([], e), yt) || this;
                return n.storageKey = 'dataSources', n.events = yt, Object.assign(n, a.Events), n
            }

            return Ey(n, t), n.prototype.destroy = function () {
            }, n.prototype.add = function (t, e) {
                void 0 === e && (e = {});
                var n = this.all;
                return t.id = t.id || this._createId(), n.add(t, e)
            }, n.prototype.get = function (t) {
                return this.all.get(t)
            }, n.prototype.getValue = function (t, n) {
                return (0, e.get)(this.getContext(), t, n)
            }, n.prototype.getContext = function () {
                return this.all.reduce((function (t, e) {
                    return t[e.id] = e.records.reduce((function (t, e, n) {
                        var o = e;
                        return t[o.id || n] = o.attributes, t
                    }), {}), t
                }), {})
            }, n.prototype.remove = function (t, e) {
                return this.__remove(t, e)
            }, n.prototype.fromPath = function (t) {
                var n = [], o = (0, e.stringToPath)(t || ''), r = o[0], i = o[1], a = o.slice(2), s = this.get(r),
                    l = null == s ? void 0 : s.records.get(i);
                return s && n.push(s), l && (n.push(l), a.length && n.push(a.join('.'))), n
            }, n.prototype.store = function () {
                var t, e = [];
                return this.all.forEach((function (t) {
                    var n = t.get('skipFromStorage');
                    n || e.push({id: t.id, name: t.get('name'), records: t.records.toJSON(), skipFromStorage: n})
                })), (t = {})[this.storageKey] = e, t
            }, n.prototype.load = function (t) {
                return this.loadProjectData(t)
            }, n.prototype.postLoad = function () {
                var t = this.em, e = this.all;
                t.listenTo(e, u.e2, (function (e, n, o) {
                    return t.changesUp(o || n)
                }))
            }, n
        }(b);
        const Ay = ky;
        var jy = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), My = void 0 && (void 0).__assign || function () {
            return My = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, My.apply(this, arguments)
        }, Dy = void 0 && (void 0).__awaiter || function (t, e, n, o) {
            return new (n || (n = Promise))((function (r, i) {
                function a(t) {
                    try {
                        l(o.next(t))
                    } catch (t) {
                        i(t)
                    }
                }

                function s(t) {
                    try {
                        l(o["throw"](t))
                    } catch (t) {
                        i(t)
                    }
                }

                function l(t) {
                    var e;
                    t.done ? r(t.value) : (e = t.value, e instanceof n ? e : new n((function (t) {
                        t(e)
                    }))).then(a, s)
                }

                l((o = o.apply(t, e || [])).next())
            }))
        }, Ly = void 0 && (void 0).__generator || function (t, e) {
            var n, o, r, i, a = {
                label: 0, sent: function () {
                    if (1 & r[0]) throw r[1];
                    return r[1]
                }, trys: [], ops: []
            };
            return i = {
                next: s(0),
                throw: s(1),
                return: s(2)
            }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
                return this
            }), i;

            function s(s) {
                return function (l) {
                    return function (s) {
                        if (n) throw new TypeError("Generator is already executing.");
                        for (; i && (i = 0, s[0] && (a = 0)), a;) try {
                            if (n = 1, o && (r = 2 & s[0] ? o["return"] : s[0] ? o["throw"] || ((r = o["return"]) && r.call(o), 0) : o.next) && !(r = r.call(o, s[1])).done) return r;
                            switch (o = 0, r && (s = [2 & s[0], r.value]), s[0]) {
                                case 0:
                                case 1:
                                    r = s;
                                    break;
                                case 4:
                                    return a.label++, {value: s[1], done: !1};
                                case 5:
                                    a.label++, o = s[1], s = [0];
                                    continue;
                                case 7:
                                    s = a.ops.pop(), a.trys.pop();
                                    continue;
                                default:
                                    if (!(r = a.trys, (r = r.length > 0 && r[r.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
                                        a = 0;
                                        continue
                                    }
                                    if (3 === s[0] && (!r || s[1] > r[0] && s[1] < r[3])) {
                                        a.label = s[1];
                                        break
                                    }
                                    if (6 === s[0] && a.label < r[1]) {
                                        a.label = r[1], r = s;
                                        break
                                    }
                                    if (r && a.label < r[2]) {
                                        a.label = r[2], a.ops.push(s);
                                        break
                                    }
                                    r[2] && a.ops.pop(), a.trys.pop();
                                    continue
                            }
                            s = e.call(t, a)
                        } catch (t) {
                            s = [6, t], o = 0
                        } finally {
                            n = r = 0
                        }
                        if (5 & s[0]) throw s[1];
                        return {value: s[0] ? s[1] : void 0, done: !0}
                    }([s, l])
                }
            }
        }, Iy = void 0 && (void 0).__rest || function (t, e) {
            var n = {};
            for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (n[o] = t[o]);
            if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                var r = 0;
                for (o = Object.getOwnPropertySymbols(t); r < o.length; r++) e.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[r]) && (n[o[r]] = t[o[r]])
            }
            return n
        }, Ny = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        };
        s().$ = l["default"];
        var Ry = [Wd, rd, gf, Wh, hc, Np, Ml, Sy, al, Tf, Mh, ah, pv, Zc, Ru, go, bu, Os, Ay],
            Vy = [wp, es, Xp, Na, Ay];
        !function (e) {
            var n = e.$;
            if (n && n.prototype && 'jQuery' !== n.prototype.constructor.name) {
                var o = n.fn;
                o.hide = function () {
                    return this.css('display', 'none')
                }, o.show = function () {
                    return this.css('display', 'block')
                }, o.focus = function () {
                    var t = this.get(0);
                    return t && t.focus(), this
                }, o.bind = function (t, e) {
                    return this.on(t, e)
                }, o.unbind = function (e, n) {
                    if ((0, t.isObject)(e)) {
                        for (var o in e) e.hasOwnProperty(o) && this.off(o, e[o]);
                        return this
                    }
                    return this.off(e, n)
                }, o.click = function (t) {
                    return t ? this.on('click', t) : this.trigger('click')
                }, o.change = function (t) {
                    return t ? this.on('change', t) : this.trigger('change')
                }, o.keydown = function (t) {
                    return t ? this.on('keydown', t) : this.trigger('keydown')
                }, o.delegate = function (t, e, n, o) {
                    return o || (o = n), this.on(e, t, (function (t) {
                        t.data = n, o(t)
                    }))
                }, o.scrollLeft = function () {
                    var t = this.get(0), e = (t = 9 == t.nodeType ? t.defaultView : t) instanceof Window ? t : null;
                    return e ? e.pageXOffset : t.scrollLeft || 0
                }, o.scrollTop = function () {
                    var t = this.get(0), e = (t = 9 == t.nodeType ? t.defaultView : t) instanceof Window ? t : null;
                    return e ? e.pageYOffset : t.scrollTop || 0
                };
                var r = n.prototype.offset;
                o.offset = function (t) {
                    var e, n;
                    return t && (e = t.top, n = t.left), void 0 !== e && this.css('top', "".concat(e, "px")), void 0 !== n && this.css('left', "".concat(n, "px")), r.call(this)
                }, n.map = function (t, e) {
                    for (var n = [], o = 0; o < t.length; o++) n.push(e(t[o], o));
                    return n
                };
                var i = Array.prototype.indexOf;
                n.inArray = function (t, e, n) {
                    return null == e ? -1 : i.call(e, t, n)
                }, n.Event = function (t, e) {
                    if (!(this instanceof n.Event)) return new n.Event(t, e);
                    this.type = t, this.isDefaultPrevented = function () {
                        return !1
                    }
                }
            }
        }({$: l["default"]});
        var Fy = {debug: console.log, info: console.info, warning: console.warn, error: console.error},
            Hy = function (n) {
                function o(e) {
                    void 0 === e && (e = {});
                    var o = n.call(this) || this;
                    o.Model = u.Kx, o.Collection = u.pM, o.events = Nh, o.__skip = !1, o.defaultRunning = !1, o.destroyed = !1, o._config = e;
                    var r = o.config;
                    o.set('Config', e), o.set('modules', []), o.set('toLoad', []), o.set('storables', []), o.set('selected', new f), o.set('dmode', r.dragMode);
                    var i = r.el, a = r.log, s = !0 === a ? (0, t.keys)(Fy) : (0, t.isArray)(a) ? a : [];
                    return (0, t.bindAll)(o, 'initBaseColorPicker'), i && r.fromElement && (r.components = i.innerHTML), o.attrsOrig = i ? (0, t.toArray)(i.attributes).reduce((function (t, e) {
                        return t[e.nodeName] = e.nodeValue, t
                    }), {}) : '', r.components && !r.pageManager && (r.pageManager = {pages: [{component: r.components}]}), Ry.forEach((function (t) {
                        return o.loadModule(t)
                    })), Vy.forEach((function (t) {
                        return o.loadStorableModule(t)
                    })), o.on('change:componentHovered', o.componentHovered, o), o.on('change:changesCount', o.updateChanges, o), o.on('change:readyLoad change:readyCanvas', o._checkReady, o), s.forEach((function (t) {
                        return o.listenLog(t)
                    })), [{from: 'change:selectedComponent', to: 'component:toggled'}].forEach((function (t) {
                        var e = t.from, n = t.to;
                        o.listenTo(o, e, (function () {
                            for (var t = [], r = 0; r < arguments.length; r++) t[r] = arguments[r];
                            o.trigger.apply(o, Ny([n], t, !1)), o.logWarning("The event '".concat(e, "' is deprecated, replace it with '").concat(n, "'"))
                        }))
                    })), o
                }

                return jy(o, n), o.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(o.prototype, "storables", {
                    get: function () {
                        return this.get('storables')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "modules", {
                    get: function () {
                        return this.get('modules')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "toLoad", {
                    get: function () {
                        return this.get('toLoad')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "selected", {
                    get: function () {
                        return this.get('selected')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "shallow", {
                    get: function () {
                        return this.get('shallow')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "I18n", {
                    get: function () {
                        return this.get('I18n')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Utils", {
                    get: function () {
                        return this.get('Utils')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Commands", {
                    get: function () {
                        return this.get('Commands')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Keymaps", {
                    get: function () {
                        return this.get('Keymaps')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Modal", {
                    get: function () {
                        return this.get('Modal')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Panels", {
                    get: function () {
                        return this.get('Panels')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "CodeManager", {
                    get: function () {
                        return this.get('CodeManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "UndoManager", {
                    get: function () {
                        return this.get('UndoManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "RichTextEditor", {
                    get: function () {
                        return this.get('RichTextEditor')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Canvas", {
                    get: function () {
                        return this.get('Canvas')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Editor", {
                    get: function () {
                        return this.get('Editor')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Components", {
                    get: function () {
                        return this.get('DomComponents')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Css", {
                    get: function () {
                        return this.get('CssComposer')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Blocks", {
                    get: function () {
                        return this.get('BlockManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Selectors", {
                    get: function () {
                        return this.get('SelectorManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Storage", {
                    get: function () {
                        return this.get('StorageManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Traits", {
                    get: function () {
                        return this.get('TraitManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Parser", {
                    get: function () {
                        return this.get('Parser')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Layers", {
                    get: function () {
                        return this.get('LayerManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Assets", {
                    get: function () {
                        return this.get('AssetManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Devices", {
                    get: function () {
                        return this.get('DeviceManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Pages", {
                    get: function () {
                        return this.get('PageManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "Styles", {
                    get: function () {
                        return this.get('StyleManager')
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "DataSources", {
                    get: function () {
                        return this.get('DataSources')
                    }, enumerable: !1, configurable: !0
                }), o.prototype._checkReady = function () {
                    this.get('readyLoad') && this.get('readyCanvas') && !this.get('ready') && this.set('ready', !0)
                }, o.prototype.getContainer = function () {
                    return this.config.el
                }, o.prototype.listenLog = function (t) {
                    this.listenTo(this, "log:".concat(t), Fy[t])
                }, Object.defineProperty(o.prototype, "config", {
                    get: function () {
                        return this._config
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "version", {
                    get: function () {
                        var t;
                        return (null === (t = this.config.grapesjs) || void 0 === t ? void 0 : t.version) || ''
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "isHeadless", {
                    get: function () {
                        return !!this.config.headless
                    }, enumerable: !1, configurable: !0
                }), Object.defineProperty(o.prototype, "isShallow", {
                    get: function () {
                        return !!this.get('isShallow')
                    }, enumerable: !1, configurable: !0
                }), o.prototype.initModules = function () {
                    this.modules.forEach((function (t) {
                        return t.onInit()
                    }))
                }, o.prototype.getConfig = function (e) {
                    var n = this.config;
                    return (0, t.isUndefined)(e) ? n : n[e]
                }, o.prototype.loadOnStart = function () {
                    var t = this, e = this.config, n = e.projectData, r = e.headless, i = {initial: !0},
                        a = this.Storage;
                    this.toLoad.reverse().forEach((function (t) {
                        return t.onLoad()
                    }));
                    var s = function () {
                        t.modules.forEach((function (e) {
                            return e.postLoad && e.postLoad(t)
                        })), t.set('readyLoad', 1)
                    };
                    r ? (n && this.loadData(n, i), s()) : this._storageTimeout = setTimeout((function () {
                        return Dy(t, void 0, void 0, (function () {
                            var t;
                            return Ly(this, (function (e) {
                                switch (e.label) {
                                    case 0:
                                        return n ? (this.loadData(n, i), [3, 5]) : [3, 1];
                                    case 1:
                                        if (!(null == a ? void 0 : a.canAutoload())) return [3, 5];
                                        e.label = 2;
                                    case 2:
                                        return e.trys.push([2, 4, , 5]), [4, this.load({}, i)];
                                    case 3:
                                        return e.sent(), [3, 5];
                                    case 4:
                                        return t = e.sent(), this.logError(t), [3, 5];
                                    case 5:
                                        return s(), [2]
                                }
                            }))
                        }))
                    }));
                    var l = new o({noticeOnUnload: !1, storageManager: !1, undoManager: !1});
                    l.set({isShallow: !0}), l.Pages.onLoad(), l.Canvas.postLoad(), this.set('shallow', l)
                }, o.prototype.updateChanges = function (t, e, n) {
                    var o = this, r = this.Storage, i = this.getDirtyCount();
                    n.isClear || (this.updateItr && clearTimeout(this.updateItr), this.updateItr = setTimeout((function () {
                        return o.trigger(Nh.update)
                    }))), this.config.noticeOnUnload && (window.onbeforeunload = i ? function () {
                        return !0
                    } : null), r.isAutosave() && i >= r.getStepsBeforeSave() && this.store().catch((function (t) {
                        return o.logError(t)
                    }))
                }, o.prototype.loadModule = function (t) {
                    var e = new t(this);
                    return this.set(e.name, e), e.onLoad && this.toLoad.push(e), this.modules.push(e), e
                }, o.prototype.loadStorableModule = function (t) {
                    var e = this.loadModule(t);
                    return this.storables.push(e), e
                }, o.prototype.init = function (t, e) {
                    void 0 === e && (e = {}), this.destroyed && (this.initialize(e), this.destroyed = !1), this.set('Editor', t)
                }, o.prototype.getEditor = function () {
                    return this.get('Editor')
                }, o.prototype.handleUpdates = function (t, e, n) {
                    var o = this;
                    void 0 === n && (n = {}), this.__skip || n.temporary || n.noCount || n.avoidStore || n.partial || !this.get('ready') || (this.timedInterval && clearTimeout(this.timedInterval), this.timedInterval = setTimeout((function () {
                        var t = o.getDirtyCount() || 0, e = (n.unset, Iy(n, ["unset"]));
                        o.set('changesCount', t + 1, e)
                    }), 0))
                }, o.prototype.changesUp = function (t) {
                    this.handleUpdates(0, 0, t)
                }, o.prototype.componentHovered = function (t, e, n) {
                    var o = this.previous('componentHovered');
                    o && this.trigger('component:unhovered', o, n), e && this.trigger('component:hovered', e, n)
                }, o.prototype.getSelected = function () {
                    return this.selected.lastComponent()
                }, o.prototype.getSelectedAll = function () {
                    return this.selected.allComponents()
                }, o.prototype.setSelected = function (e, n) {
                    var o = this;
                    void 0 === n && (n = {});
                    var r = n.event, i = r && (r.ctrlKey || r.metaKey), a = (r || {}).shiftKey,
                        s = ((0, t.isArray)(e) ? e : [e]).map((function (t) {
                            var e, n;
                            return (null === (n = null === (e = null == t ? void 0 : t.delegate) || void 0 === e ? void 0 : e.select) || void 0 === n ? void 0 : n.call(e, t)) || t
                        })).filter(Boolean), l = this.getSelectedAll(), c = this.getConfig().multipleSelection,
                        u = (0, t.isArray)(e);
                    !u && e || this.removeSelected(l.filter((function (e) {
                        return !(0, t.contains)(s, e)
                    }))), s.forEach((function (e) {
                        if (e && (o.trigger($.I.selectBefore, e, n), !e.get('selectable') || n.abort)) {
                            if (!n.useValid) return;
                            for (var r = e.parent(); r && !r.get('selectable');) r = r.parent();
                            e = r
                        }
                        if (i && c) return o.toggleSelected(e);
                        if (a && c) {
                            if (o.isEditing()) return;
                            o.clearSelection(o.Canvas.getWindow());
                            var s, p, d = e.collection, f = e.index();
                            if (o.getSelectedAll().forEach((function (e) {
                                var n = e.collection, o = e.index();
                                n === d && (o < f ? s = (0, t.isUndefined)(s) ? o : Math.max(s, o) : o > f && (p = (0, t.isUndefined)(p) ? o : Math.min(p, o)))
                            })), !(0, t.isUndefined)(s)) for (; s !== f;) o.addSelected(d.at(s), n), s++;
                            if (!(0, t.isUndefined)(p)) for (; p !== f;) o.addSelected(d.at(p), n), p--;
                            return o.addSelected(e, n)
                        }
                        !u && o.removeSelected(l.filter((function (t) {
                            return t !== e
                        }))), o.addSelected(e, n)
                    }))
                }, o.prototype.addSelected = function (e, n) {
                    var o = this;
                    void 0 === n && (n = {}), ((0, t.isArray)(e) ? e : [e]).forEach((function (e) {
                        var r = o.selected;
                        if (e && e.get('selectable') && !e.parents().some((function (t) {
                            return r.hasComponent(t)
                        })) && (n.forceChange && o.removeSelected(e, n), r.allComponents().filter((function (n) {
                            return (0, t.contains)(n.parents(), e)
                        })).forEach((function (t) {
                            return o.removeSelected(t, n)
                        })), r.addComponent(e, n), o.trigger($.I.select, e, n), o.Canvas.addSpot({
                            type: W.F.Select,
                            component: e
                        }), n.activate)) {
                            var i = e.getView();
                            (null == i ? void 0 : i.rendered) ? i.onActive(n.event) : e.once($.I.render, (function (t) {
                                return t.view.onActive(n.event)
                            }))
                        }
                    }))
                }, o.prototype.removeSelected = function (e, n) {
                    var o = this;
                    void 0 === n && (n = {}), this.selected.removeComponent(e, n), ((0, t.isArray)(e) ? e : [e]).forEach((function (t) {
                        return o.Canvas.removeSpots({type: W.F.Select, component: t})
                    }))
                }, o.prototype.toggleSelected = function (e, n) {
                    var o = this;
                    void 0 === n && (n = {}), ((0, t.isArray)(e) ? e : [e]).forEach((function (t) {
                        o.selected.hasComponent(t) ? o.removeSelected(t, n) : o.addSelected(t, n)
                    }))
                }, o.prototype.setHovered = function (t, e) {
                    var n = this;
                    void 0 === e && (e = {});
                    var o = function (t, e) {
                        var o = n, r = o.config, i = o.Canvas, a = n.getHovered(), s = n.getSelectedAll(),
                            l = W.F.Hover, c = W.F.Spacing;
                        n.set('componentHovered', t || null, e), a && (i.removeSpots({
                            type: l,
                            component: a
                        }), i.removeSpots({type: c, component: a})), t && (i.addSpot({
                            type: l,
                            component: t
                        }), s.includes(t) && !r.showOffsetsSelected || i.addSpot({type: c, component: t}))
                    };
                    if (!t) return o();
                    var r = 'component:hover';
                    if (e.forceChange && o(), this.trigger("".concat(r, ":before"), t, e), !t.get('hoverable')) {
                        if (!e.useValid || e.abort) return;
                        for (var i = t.parent(); i && !i.get('hoverable');) i = i.parent();
                        t = i
                    }
                    e.abort || (o(t, e), this.trigger(r, t, e))
                }, o.prototype.getHovered = function () {
                    return this.get('componentHovered')
                }, o.prototype.setComponents = function (t, e) {
                    return void 0 === e && (e = {}), this.Components.setComponents(t, e)
                }, o.prototype.getComponents = function () {
                    var t = this.Components, e = this.CodeManager;
                    if (t && e) {
                        var n = t.getComponents();
                        return e.getCode(n, 'json')
                    }
                }, o.prototype.setStyle = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.Css;
                    return n.clear(e), n.getAll().add(t, e), this
                }, o.prototype.addStyle = function (e, n) {
                    void 0 === n && (n = {});
                    var o = this.getStyle().add(e, n);
                    return (0, t.isArray)(o) ? o : [o]
                }, o.prototype.getStyle = function () {
                    return this.Css.getAll()
                }, o.prototype.setState = function (t) {
                    return this.set('state', t), this
                }, o.prototype.getState = function () {
                    return this.get('state') || ''
                }, o.prototype.getHtml = function (t) {
                    void 0 === t && (t = {});
                    var e = this.config, n = e.optsHtml, o = e.jsInHtml ? this.getJs(t) : '',
                        r = t.component || this.Components.getComponent(),
                        i = r ? this.CodeManager.getCode(r, 'html', My(My({}, n), t)) : '';
                    return i += o ? "<script>".concat(o, "<\/script>") : ''
                }, o.prototype.getCss = function (e) {
                    void 0 === e && (e = {});
                    var n = this.config, o = n.optsCss, r = e.avoidProtected,
                        i = (0, t.isUndefined)(e.keepUnusedStyles) ? n.keepUnusedStyles : e.keepUnusedStyles,
                        a = this.Css, s = e.component || this.Components.getComponent(), l = r ? '' : n.protectedCss,
                        c = s && this.CodeManager.getCode(s, 'css', My(My({cssc: a, keepUnusedStyles: i}, o), e));
                    return s ? e.json ? c : l + c : ''
                }, o.prototype.getJs = function (t) {
                    void 0 === t && (t = {});
                    var e = t.component || this.Components.getWrapper();
                    return e ? this.CodeManager.getCode(e, 'js').trim() : ''
                }, o.prototype.store = function (t) {
                    return Dy(this, void 0, void 0, (function () {
                        var e;
                        return Ly(this, (function (n) {
                            switch (n.label) {
                                case 0:
                                    return e = this.storeData(), [4, this.Storage.store(e, t)];
                                case 1:
                                    return n.sent(), this.clearDirtyCount(), [2, e]
                            }
                        }))
                    }))
                }, o.prototype.load = function (t) {
                    return Dy(this, arguments, void 0, (function (t, n) {
                        var o;
                        return void 0 === n && (n = {}), Ly(this, (function (r) {
                            switch (r.label) {
                                case 0:
                                    return [4, this.Storage.load(t)];
                                case 1:
                                    return o = r.sent(), this.loadData(o, n), [4, (0, e.wait)()];
                                case 2:
                                    return r.sent(), n.clear && (this.UndoManager.clear(), this.clearDirtyCount()), [2, o]
                            }
                        }))
                    }))
                }, o.prototype.storeData = function () {
                    var t = {}, e = this.getEditing();
                    e && e.trigger('sync:content', {noCount: !0}), this.storables.forEach((function (e) {
                        t = My(My({}, t), e.store(1))
                    }));
                    var n = JSON.parse(JSON.stringify(t));
                    return this.trigger(Nh.projectGet, {project: n}), n
                }, o.prototype.loadData = function (t, n) {
                    void 0 === t && (t = {}), void 0 === n && (n = {});
                    var o = !1;
                    return (0, e.isEmptyObj)(t) || (this.storables.forEach((function (t) {
                        return t.clear()
                    })), this.storables.forEach((function (e) {
                        return e.load(t)
                    })), o = !0), this.trigger(Nh.projectLoad, {project: t, loaded: o, initial: !!n.initial}), t
                }, o.prototype.getDeviceModel = function () {
                    var t = this.get('device');
                    return this.Devices.get(t)
                }, o.prototype.runDefault = function (t) {
                    void 0 === t && (t = {});
                    var e = this.Commands.get(this.config.defaultCommand);
                    e && !this.defaultRunning && (e.stop(this, this, t), e.run(this, this, t), this.defaultRunning = !0)
                }, o.prototype.stopDefault = function (t) {
                    void 0 === t && (t = {});
                    var e = this.Commands;
                    if (e) {
                        var n = e.get(this.config.defaultCommand);
                        n && this.defaultRunning && (n.stop(this, this, t), this.defaultRunning = !1)
                    }
                }, o.prototype.refreshCanvas = function (t) {
                    void 0 === t && (t = {}), this.Canvas.refresh({spots: t.tools})
                }, o.prototype.clearSelection = function (t) {
                    var e;
                    null === (e = (t || window).getSelection()) || void 0 === e || e.removeAllRanges()
                }, o.prototype.getCurrentMedia = function () {
                    var t = this.config, e = this.getDeviceModel(), n = t.mediaCondition, o = t.devicePreviewMode,
                        r = e && e.get('widthMedia');
                    return e && r && !o ? "(".concat(n, ": ").concat(r, ")") : ''
                }, o.prototype.getWrapper = function () {
                    return this.Components.getWrapper()
                }, o.prototype.setCurrentFrame = function (t) {
                    return this.set('currentFrame', t)
                }, o.prototype.getCurrentFrame = function () {
                    return this.get('currentFrame')
                }, o.prototype.getCurrentFrameModel = function () {
                    var t;
                    return null === (t = this.getCurrentFrame() || {}) || void 0 === t ? void 0 : t.model
                }, o.prototype.getIcon = function (t) {
                    return (this.config.icons || {})[t] || ''
                }, o.prototype.getDirtyCount = function () {
                    return this.get('changesCount')
                }, o.prototype.clearDirtyCount = function () {
                    return this.set({changesCount: 0}, {isClear: !0})
                }, o.prototype.getZoomDecimal = function () {
                    return this.Canvas.getZoomDecimal()
                }, o.prototype.getZoomMultiplier = function () {
                    return this.Canvas.getZoomMultiplier()
                }, o.prototype.setDragMode = function (t) {
                    return this.set('dmode', t)
                }, o.prototype.getDragMode = function (t) {
                    return (null == t ? void 0 : t.getDragMode()) || this.get('dmode') || ''
                }, o.prototype.t = function () {
                    for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                    var n = this.get('I18n');
                    return null == n ? void 0 : n.t.apply(n, t)
                }, o.prototype.inAbsoluteMode = function (t) {
                    return 'absolute' === this.getDragMode(t)
                }, o.prototype.destroyAll = function () {
                    var t = this, n = this.config, o = this.view;
                    this.trigger(Nh.destroy);
                    var r = this.getEditor(), i = (n.grapesjs || {}).editors, a = void 0 === i ? [] : i,
                        s = this.get('shallow');
                    this._storageTimeout && clearTimeout(this._storageTimeout), null == s || s.destroyAll(), this.stopListening(), this.stopDefault(), (this.modules || []).slice().reverse().forEach((function (t) {
                        return t.destroy()
                    })), (null == o ? void 0 : o.remove) && o.remove(), this.clear({silent: !0}), this.destroyed = !0, ['_config', 'view', '_previousAttributes', '_events', '_listeners'].forEach((function (e) {
                        return t[e] = {}
                    })), a.splice(a.indexOf(r), 1), (0, e.hasWin)() && (0, l["default"])(n.el).empty().attr(this.attrsOrig), this.trigger(Nh.destroyed)
                }, o.prototype.getEditing = function () {
                    var t = this.get('editing');
                    return t && t.model || void 0
                }, o.prototype.setEditing = function (t) {
                    return this.set('editing', t), this
                }, o.prototype.isEditing = function () {
                    return !!this.get('editing')
                }, o.prototype.log = function (t, e) {
                    void 0 === e && (e = {});
                    var n = Nh.log, o = e.ns, r = e.level, i = void 0 === r ? 'debug' : r;
                    if (this.trigger(n, t, e), i && this.trigger("".concat(n, ":").concat(i), t, e), o) {
                        var a = "".concat(n, "-").concat(o);
                        this.trigger(a, t, e), i && this.trigger("".concat(a, ":").concat(i), t, e)
                    }
                }, o.prototype.logInfo = function (t, e) {
                    this.log(t, My(My({}, e), {level: 'info'}))
                }, o.prototype.logWarning = function (t, e) {
                    this.log(t, My(My({}, e), {level: 'warning'}))
                }, o.prototype.logError = function (t, e) {
                    this.log(t, My(My({}, e), {level: 'error'}))
                }, o.prototype.initBaseColorPicker = function (t, e) {
                    void 0 === e && (e = {});
                    var n = this.config, o = n.colorPicker, r = void 0 === o ? {} : o, i = n.el, a = n.stylePrefix;
                    return (0, l["default"])(t).spectrum(My(My({
                        containerClassName: "".concat(a, "one-bg ").concat(a, "two-color"),
                        appendTo: i || 'body',
                        maxSelectionSize: 8,
                        showPalette: !0,
                        palette: [],
                        showAlpha: !0,
                        chooseText: 'Ok',
                        cancelText: '⨯'
                    }, e), r))
                }, o.prototype.skip = function (t) {
                    this.__skip = !0;
                    var e = this.UndoManager;
                    e ? e.skip(t) : t(), this.__skip = !1
                }, o.prototype.data = function (e, n, o) {
                    var r = '_gjs-data';
                    if (e[r] || (e[r] = {}), (0, t.isUndefined)(o)) return e[r][n];
                    e[r][n] = o
                },o
            }(u.Kx);
        const Uy = Hy;
        var zy = void 0 && (void 0).__extends || function () {
            var t = function (e, n) {
                return t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
                    t.__proto__ = e
                } || function (t, e) {
                    for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
                }, t(e, n)
            };
            return function (e, n) {
                if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");

                function o() {
                    this.constructor = e
                }

                t(e, n), e.prototype = null === n ? Object.create(n) : (o.prototype = n.prototype, new o)
            }
        }(), By = void 0 && (void 0).__awaiter || function (t, e, n, o) {
            return new (n || (n = Promise))((function (r, i) {
                function a(t) {
                    try {
                        l(o.next(t))
                    } catch (t) {
                        i(t)
                    }
                }

                function s(t) {
                    try {
                        l(o["throw"](t))
                    } catch (t) {
                        i(t)
                    }
                }

                function l(t) {
                    var e;
                    t.done ? r(t.value) : (e = t.value, e instanceof n ? e : new n((function (t) {
                        t(e)
                    }))).then(a, s)
                }

                l((o = o.apply(t, e || [])).next())
            }))
        }, Wy = void 0 && (void 0).__generator || function (t, e) {
            var n, o, r, i, a = {
                label: 0, sent: function () {
                    if (1 & r[0]) throw r[1];
                    return r[1]
                }, trys: [], ops: []
            };
            return i = {
                next: s(0),
                throw: s(1),
                return: s(2)
            }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
                return this
            }), i;

            function s(s) {
                return function (l) {
                    return function (s) {
                        if (n) throw new TypeError("Generator is already executing.");
                        for (; i && (i = 0, s[0] && (a = 0)), a;) try {
                            if (n = 1, o && (r = 2 & s[0] ? o["return"] : s[0] ? o["throw"] || ((r = o["return"]) && r.call(o), 0) : o.next) && !(r = r.call(o, s[1])).done) return r;
                            switch (o = 0, r && (s = [2 & s[0], r.value]), s[0]) {
                                case 0:
                                case 1:
                                    r = s;
                                    break;
                                case 4:
                                    return a.label++, {value: s[1], done: !1};
                                case 5:
                                    a.label++, o = s[1], s = [0];
                                    continue;
                                case 7:
                                    s = a.ops.pop(), a.trys.pop();
                                    continue;
                                default:
                                    if (!(r = a.trys, (r = r.length > 0 && r[r.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
                                        a = 0;
                                        continue
                                    }
                                    if (3 === s[0] && (!r || s[1] > r[0] && s[1] < r[3])) {
                                        a.label = s[1];
                                        break
                                    }
                                    if (6 === s[0] && a.label < r[1]) {
                                        a.label = r[1], r = s;
                                        break
                                    }
                                    if (r && a.label < r[2]) {
                                        a.label = r[2], a.ops.push(s);
                                        break
                                    }
                                    r[2] && a.ops.pop(), a.trys.pop();
                                    continue
                            }
                            s = e.call(t, a)
                        } catch (t) {
                            s = [6, t], o = 0
                        } finally {
                            n = r = 0
                        }
                        if (5 & s[0]) throw s[1];
                        return {value: s[0] ? s[1] : void 0, done: !0}
                    }([s, l])
                }
            }
        }, $y = function (t) {
            function n(e) {
                var n = t.call(this, {model: e}) || this, o = e.Panels, r = e.UndoManager;
                return e.view = n, e.once('change:ready', (function () {
                    o.active(), o.disableButtons(), r.clear(), e.getConfig().telemetry && n.sendTelemetryData().catch((function () {
                    })), setTimeout((function () {
                        e.trigger(Nh.load, e.Editor), e.clearDirtyCount()
                    }))
                })), n
            }

            return zy(n, t), n.prototype.render = function () {
                var t = this, n = this.$el, o = this.model, r = o.Panels, i = o.Canvas, a = o.config, s = o.modules,
                    c = a.stylePrefix, u = ["".concat(c, "editor")];
                !a.customUI && u.push("".concat(c, "one-bg ").concat(c, "two-color"));
                var p = (0, l["default"])(a.el || "body ".concat(a.container));
                a.cssIcons && (0, e.appendStyles)(a.cssIcons, {
                    unique: !0,
                    prepand: !0
                }), n.empty(), a.width && p.css('width', a.width), a.height && p.css('height', a.height), n.append(i.render()), n.append(r.render());
                var d = o.shallow.Canvas.render();
                return d.style.display = 'none', n.append(d), n.attr('class', u.join(' ')), p.addClass("".concat(c, "editor-cont")).empty().append(n), s.forEach((function (e) {
                    var n;
                    return null === (n = e.postRender) || void 0 === n ? void 0 : n.call(e, t)
                })), this
            }, n.prototype.sendTelemetryData = function () {
                return By(this, void 0, void 0, (function () {
                    var t, e, n, o, r, i, a;
                    return Wy(this, (function (s) {
                        switch (s.label) {
                            case 0:
                                return 'localhost' === (t = window.location.hostname) || t.includes('localhost') ? [2] : (e = 'gjs_telemetry_sent_', n = this.model.version, o = "".concat(e).concat(n), sessionStorage.getItem(o) ? [2] : [4, fetch("".concat('https://app.grapesjs.com', "/api/gjs/telemetry/collect"), {
                                    method: 'POST',
                                    body: JSON.stringify({domain: t, version: n})
                                })]);
                            case 1:
                                return (r = s.sent()).ok ? [3, 3] : (i = Error.bind, a = "Failed to send telemetry data ".concat, [4, r.text()]);
                            case 2:
                                throw new (i.apply(Error, [void 0, a.apply("Failed to send telemetry data ", [s.sent()])]));
                            case 3:
                                return sessionStorage.setItem(o, 'true'), Object.keys(sessionStorage).forEach((function (t) {
                                    t.startsWith(e) && t !== o && sessionStorage.removeItem(t)
                                })), this.trigger(Nh.telemetryInit), [2]
                        }
                    }))
                }))
            }, n
        }(u.Ss);
        const qy = $y;
        var Gy = void 0 && (void 0).__assign || function () {
            return Gy = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, Gy.apply(this, arguments)
        }, Ky = void 0 && (void 0).__awaiter || function (t, e, n, o) {
            return new (n || (n = Promise))((function (r, i) {
                function a(t) {
                    try {
                        l(o.next(t))
                    } catch (t) {
                        i(t)
                    }
                }

                function s(t) {
                    try {
                        l(o["throw"](t))
                    } catch (t) {
                        i(t)
                    }
                }

                function l(t) {
                    var e;
                    t.done ? r(t.value) : (e = t.value, e instanceof n ? e : new n((function (t) {
                        t(e)
                    }))).then(a, s)
                }

                l((o = o.apply(t, e || [])).next())
            }))
        }, Yy = void 0 && (void 0).__generator || function (t, e) {
            var n, o, r, i, a = {
                label: 0, sent: function () {
                    if (1 & r[0]) throw r[1];
                    return r[1]
                }, trys: [], ops: []
            };
            return i = {
                next: s(0),
                throw: s(1),
                return: s(2)
            }, "function" == typeof Symbol && (i[Symbol.iterator] = function () {
                return this
            }), i;

            function s(s) {
                return function (l) {
                    return function (s) {
                        if (n) throw new TypeError("Generator is already executing.");
                        for (; i && (i = 0, s[0] && (a = 0)), a;) try {
                            if (n = 1, o && (r = 2 & s[0] ? o["return"] : s[0] ? o["throw"] || ((r = o["return"]) && r.call(o), 0) : o.next) && !(r = r.call(o, s[1])).done) return r;
                            switch (o = 0, r && (s = [2 & s[0], r.value]), s[0]) {
                                case 0:
                                case 1:
                                    r = s;
                                    break;
                                case 4:
                                    return a.label++, {value: s[1], done: !1};
                                case 5:
                                    a.label++, o = s[1], s = [0];
                                    continue;
                                case 7:
                                    s = a.ops.pop(), a.trys.pop();
                                    continue;
                                default:
                                    if (!(r = a.trys, (r = r.length > 0 && r[r.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
                                        a = 0;
                                        continue
                                    }
                                    if (3 === s[0] && (!r || s[1] > r[0] && s[1] < r[3])) {
                                        a.label = s[1];
                                        break
                                    }
                                    if (6 === s[0] && a.label < r[1]) {
                                        a.label = r[1], r = s;
                                        break
                                    }
                                    if (r && a.label < r[2]) {
                                        a.label = r[2], a.ops.push(s);
                                        break
                                    }
                                    r[2] && a.ops.pop(), a.trys.pop();
                                    continue
                            }
                            s = e.call(t, a)
                        } catch (t) {
                            s = [6, t], o = 0
                        } finally {
                            n = r = 0
                        }
                        if (5 & s[0]) throw s[1];
                        return {value: s[0] ? s[1] : void 0, done: !0}
                    }([s, l])
                }
            }
        }, Xy = void 0 && (void 0).__spreadArray || function (t, e, n) {
            if (n || 2 === arguments.length) for (var o, r = 0, i = e.length; r < i; r++) !o && r in e || (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
            return t.concat(o || Array.prototype.slice.call(e))
        }, Jy = function () {
            function t(t, e) {
                var n;
                void 0 === t && (t = {}), void 0 === e && (e = {}), this.events = Nh, this.html = r;
                var o = i();
                this.config = Gy(Gy(Gy({}, o), t), {pStylePrefix: null !== (n = t.stylePrefix) && void 0 !== n ? n : o.stylePrefix}), this.em = new Uy(this.config), this.$ = e.$, this.em.init(this), this.editor = this.em
            }

            return Object.defineProperty(t.prototype, "Config", {
                get: function () {
                    return this.em.config
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "I18n", {
                get: function () {
                    return this.em.I18n
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Utils", {
                get: function () {
                    return this.em.Utils
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Commands", {
                get: function () {
                    return this.em.Commands
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Keymaps", {
                get: function () {
                    return this.em.Keymaps
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Modal", {
                get: function () {
                    return this.em.Modal
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Panels", {
                get: function () {
                    return this.em.Panels
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Canvas", {
                get: function () {
                    return this.em.Canvas
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Parser", {
                get: function () {
                    return this.em.Parser
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "CodeManager", {
                get: function () {
                    return this.em.CodeManager
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "UndoManager", {
                get: function () {
                    return this.em.UndoManager
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "RichTextEditor", {
                get: function () {
                    return this.em.RichTextEditor
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Pages", {
                get: function () {
                    return this.em.Pages
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Components", {
                get: function () {
                    return this.em.Components
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "DomComponents", {
                get: function () {
                    return this.em.Components
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Layers", {
                get: function () {
                    return this.em.Layers
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "LayerManager", {
                get: function () {
                    return this.em.Layers
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Css", {
                get: function () {
                    return this.em.Css
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "CssComposer", {
                get: function () {
                    return this.em.Css
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Storage", {
                get: function () {
                    return this.em.Storage
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "StorageManager", {
                get: function () {
                    return this.em.Storage
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Assets", {
                get: function () {
                    return this.em.Assets
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "AssetManager", {
                get: function () {
                    return this.em.Assets
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Blocks", {
                get: function () {
                    return this.em.Blocks
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "BlockManager", {
                get: function () {
                    return this.em.Blocks
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Traits", {
                get: function () {
                    return this.em.Traits
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "TraitManager", {
                get: function () {
                    return this.em.Traits
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Selectors", {
                get: function () {
                    return this.em.Selectors
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "SelectorManager", {
                get: function () {
                    return this.em.Selectors
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Styles", {
                get: function () {
                    return this.em.Styles
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "StyleManager", {
                get: function () {
                    return this.em.Styles
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "Devices", {
                get: function () {
                    return this.em.Devices
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "DeviceManager", {
                get: function () {
                    return this.em.Devices
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "DataSources", {
                get: function () {
                    return this.em.DataSources
                }, enumerable: !1, configurable: !0
            }), Object.defineProperty(t.prototype, "EditorModel", {
                get: function () {
                    return this.em
                }, enumerable: !1, configurable: !0
            }), t.prototype.getConfig = function (t) {
                return this.em.getConfig(t)
            }, t.prototype.getHtml = function (t) {
                return this.em.getHtml(t)
            }, t.prototype.getCss = function (t) {
                return this.em.getCss(t)
            }, t.prototype.getJs = function (t) {
                return this.em.getJs(t)
            }, t.prototype.getComponents = function () {
                return this.Components.getComponents()
            }, t.prototype.getWrapper = function () {
                return this.Components.getWrapper()
            }, t.prototype.setComponents = function (t, e) {
                return void 0 === e && (e = {}), this.em.setComponents(t, e), this
            }, t.prototype.addComponents = function (t, e) {
                return this.getWrapper().append(t, e)
            }, t.prototype.getStyle = function () {
                return this.em.Css.getAll()
            }, t.prototype.setStyle = function (t, e) {
                return void 0 === e && (e = {}), this.em.setStyle(t, e), this
            }, t.prototype.addStyle = function (t, e) {
                return void 0 === e && (e = {}), this.em.addStyle(t, e)
            }, t.prototype.getSelected = function () {
                return this.em.getSelected()
            }, t.prototype.getSelectedAll = function () {
                return this.em.getSelectedAll()
            }, t.prototype.getSelectedToStyle = function () {
                var t = this.em.getSelected();
                if (t) return this.StyleManager.getModelToStyle(t)
            }, t.prototype.select = function (t, e) {
                return this.em.setSelected(t, e), this
            }, t.prototype.selectAdd = function (t) {
                return this.em.addSelected(t), this
            }, t.prototype.selectRemove = function (t) {
                return this.em.removeSelected(t), this
            }, t.prototype.selectToggle = function (t) {
                return this.em.toggleSelected(t), this
            }, t.prototype.getEditing = function () {
                return this.em.getEditing()
            }, t.prototype.setDevice = function (t) {
                return this.em.set('device', t), this
            }, t.prototype.getDevice = function () {
                return this.em.get('device')
            }, t.prototype.runCommand = function (t, e) {
                if (e === undefined) {
                    e = {};
                }
                if (this.Commands) {
                    return this.Commands.run(t, e);
                }
                //return void 0 === e && (e = {}), this.Commands.run(t, e)
            }, t.prototype.stopCommand = function (t, e) {
                return void 0 === e && (e = {}), this.Commands.stop(t, e)
            }, t.prototype.store = function (t) {
                return Ky(this, void 0, void 0, (function () {
                    return Yy(this, (function (e) {
                        switch (e.label) {
                            case 0:
                                return [4, this.em.store(t)];
                            case 1:
                                return [2, e.sent()]
                        }
                    }))
                }))
            }, t.prototype.load = function (t) {
                return Ky(this, arguments, void 0, (function (t, e) {
                    return void 0 === e && (e = {}), Yy(this, (function (n) {
                        switch (n.label) {
                            case 0:
                                return [4, this.em.load(t, e)];
                            case 1:
                                return [2, n.sent()]
                        }
                    }))
                }))
            }, t.prototype.getProjectData = function () {
                return this.em.storeData()
            }, t.prototype.loadProjectData = function (t) {
                return this.em.loadData(t)
            }, t.prototype.storeData = function () {
                return this.em.storeData()
            }, t.prototype.loadData = function (t) {
                return this.em.loadData(t)
            }, t.prototype.getContainer = function () {
                return this.config.el
            }, t.prototype.getDirtyCount = function () {
                return this.em.getDirtyCount()
            }, t.prototype.clearDirtyCount = function () {
                return this.em.clearDirtyCount()
            }, t.prototype.refresh = function (t) {
                this.em.refreshCanvas(t)
            }, t.prototype.setCustomRte = function (t) {
                this.RichTextEditor.customRte = t
            }, t.prototype.setCustomParserCss = function (t) {
                return this.Parser.getConfig().parserCss = t, this
            }, t.prototype.setDragMode = function (t) {
                return this.em.setDragMode(t), this
            }, t.prototype.log = function (t, e) {
                return void 0 === e && (e = {}), this.em.log(t, e), this
            }, t.prototype.t = function () {
                for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n];
                return (t = this.em).t.apply(t, e)
            }, t.prototype.on = function (t, e) {
                return this.em.on(t, e), this
            }, t.prototype.once = function (t, e) {
                return this.em.once(t, e), this
            }, t.prototype.off = function (t, e) {
                return this.em.off(t, e), this
            }, t.prototype.trigger = function (t) {
                for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];
                return this.em.trigger.apply(this.em, Xy([t], e, !0)), this
            }, t.prototype.destroy = function () {
                this.em && (this.em.destroyAll(), this.editorView = void 0)
            }, t.prototype.getEl = function () {
                var t;
                return null === (t = this.editorView) || void 0 === t ? void 0 : t.el
            }, t.prototype.getModel = function () {
                return this.em
            }, t.prototype.render = function () {
                var t;
                return null === (t = this.editorView) || void 0 === t || t.remove(), this.editorView = new qy(this.em), this.editorView.render().el
            }, t.prototype.onReady = function (t) {
                this.em.get('ready') ? t(this) : this.em.on('load', t)
            }, t
        }();
        const Zy = Jy;
        var Qy = function (n, o) {
            return (0, t.isString)(n) ? function (t, n) {
                var o = n.get(t);
                if (!o) {
                    var r = (0, e.getGlobal)()[t];
                    o = (null == r ? void 0 : r.default) || r
                }
                return o
            }(n, o) : (null == n ? void 0 : n.default) || n
        }, tm = function (t, e) {
            t.getModel().logWarning("Plugin ".concat(e, " not found"), {context: 'plugins', plugin: e})
        };
        const em = function () {
            function t() {
                this.plugins = {}
            }

            return t.prototype.add = function (t, e) {
                var n = this.get(t);
                return n || (this.plugins[t] = e, e)
            }, t.prototype.get = function (t) {
                return this.plugins[t]
            }, t.prototype.getAll = function () {
                return this.plugins
            }, t
        }();
        var nm = void 0 && (void 0).__assign || function () {
            return nm = Object.assign || function (t) {
                for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
                return t
            }, nm.apply(this, arguments)
        };
        !function () {
            if ((0, e.hasWin)() && function () {
                for (var t, e = window.navigator.userAgent, n = [['edge', /Edge\/([0-9\._]+)/], ['ie', /MSIE\s(7\.0)/], ['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]], o = 0; o < n.length; o++) {
                    if (t = n[o][1].exec(e)) break
                }
                return !!t
            }()) {
                var t = DOMImplementation.prototype.createHTMLDocument;
                DOMImplementation.prototype.createHTMLDocument = function (e) {
                    return e || (e = ''), t.apply(document.implementation, [e])
                }
            }
        }();
        var om = new em, rm = [], im = {
            $: l["default"], editors: rm, plugins: om, usePlugin: function (t, e) {
                var n = Qy(t, om);
                return function (o) {
                    n ? n(o, e || {}) : tm(o, t)
                }
            }, version: '0.22.10', init: function (e) {
                void 0 === e && (e = {});
                var n = e.headless, o = e.container;
                if (!o && !n) throw new Error("'container' is required");
                var r = nm(nm({autorender: !0, plugins: [], pluginsOpts: {}}, e), {
                    grapesjs: this,
                    el: n ? void 0 : (0, t.isElement)(o) ? o : document.querySelector(o)
                }), i = new Zy(r, {$: l["default"]}), a = i.getModel();
                return a.initModules(), r.plugins.forEach((function (t) {
                    var e = Qy(t, om), n = r.pluginsOpts[t] || {};
                    e ? e(i, n) : tm(i, t)
                })), a.loadOnStart(), r.autorender && !n && i.render(), rm.push(i), i
            }
        };
        const am = im
    })(), o = o["default"]
})()));