@silexlabs/silex-dashboard 1.0.88 → 1.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitmodules +1 -1
- package/11ty/eleventy.config.mjs +4 -3
- package/package.json +7 -7
- package/tina/tina-lock.json +1 -1
- package/_site/js/main.js +0 -457
- package/_site/js/main.js.LICENSE.txt +0 -50
package/_site/js/main.js
DELETED
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
/*! For license information please see main.js.LICENSE.txt */
|
|
2
|
-
var silex;(()=>{var t={69:function(t){"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return n="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},n(t)}function r(t){var e=function(t){if("object"!==n(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(e)?e:String(e)}function o(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}t.r(e),t.d(e,{default:()=>a});const a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.on("load",(function(){var n=s(s({},{placeholder:"Search...",appendTo:null,appendBefore:null}),e),r=t.Config.selectorManager.pStylePrefix,o="".concat(r,"filter-styles"),i=document.createElement("div");i.innerHTML="\n <style>\n #".concat(o,"-btn {\n position: absolute;\n right: 0;\n border: none;\n padding: 5px;\n margin: 5px;\n line-height: 1;\n border-radius: 50%;\n width: 25px;\n height: 25px;\n border: 1px solid;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: opacity .15s ease;\n cursor: pointer;\n opacity: .75;\n }\n .empty #").concat(o,'-btn {\n cursor: initial;\n opacity: .25;\n }\n </style>\n\n <button\n id="').concat(o,'-btn"\n class="gjs-field gjs-sm-properties gjs-two-color"\n >X</button>\n <input id="').concat(o,'" type="text" class="gjs-field gjs-sm-properties gjs-two-color" placeholder="').concat(n.placeholder,'" />\n ');var a=t.getContainer().querySelector(".".concat(r,"clm-tags")),c="string"==typeof n.appendBefore?document.querySelector(n.appendBefore):n.appendBefore,u="string"==typeof n.appendTo?document.querySelector(n.appendTo):n.appendTo,p=c?c.parentElement:null!=u?u:a.parentElement.parentElement;p.insertBefore(i,null!=c?c:a.parentElement.parentElement.lastElementChild);var d=p.querySelector("#".concat(o));d.onkeyup=function(){return h(t,d,p)},p.querySelector("#".concat(o,"-btn")).onclick=function(){d.value="",h(t,d,p)},t.on("component:selected component:styleUpdate",(function(){l(t),setTimeout((function(){return h(t,d,p)}))}))}))};function l(t){f(t).forEach((function(t){!function(t){var e=c.get(t);null==e||e.sector.setOpen(null==e?void 0:e.initial),c.delete(t)}(t),t.getProperties().forEach((function(t){!function(t){var e=p.get(t);null==e||e.property.set("visible",null==e?void 0:e.initial),p.delete(t)}(t)}))}))}var c=new WeakMap;function u(t,e){c.has(t)||c.set(t,{sector:t,initial:t.isOpen()}),t.setOpen(e)}var p=new WeakMap;function d(t,e){p.has(t)||p.set(t,{property:t,initial:t.get("visible")}),t.set("visible",e)}function f(t){return t.StyleManager.getSectors().toArray().filter((function(t){return t.isVisible()}))}function h(t,e,n){if(e.value){n.classList.remove("empty");var r=function(t){return f(t).flatMap((function(t){return t.getProperties().flatMap((function(e){return"composite"===e.getType()?e.properties.map((function(n){return{sector:t,property:e,subprop:n}})):{sector:t,property:e}}))})).map((function(t){var e,n,r,o,i,s=t.sector,a=t.property,l=t.subprop;return{searchable:"\n ".concat(s.get("name"),"\n ").concat(a.get("name"),"\n ").concat(null!==(e=null===(n=a.get("options"))||void 0===n?void 0:n.map((function(t){return t.id})).join(", "))&&void 0!==e?e:"","\n ").concat(null!==(r=null==l?void 0:l.get("name"))&&void 0!==r?r:"","\n ").concat(null!==(o=null==l||null===(i=l.get("options"))||void 0===i?void 0:i.map((function(t){return t.id})).join(", "))&&void 0!==o?o:"","\n "),sector:s,property:a}}))}(t).filter((function(t){return t.searchable.toLowerCase().includes(e.value.toLowerCase())}));f(t).forEach((function(t){u(t,!1),t.getProperties().forEach((function(t){return d(t,!1)}))})),r.forEach((function(t){u(t.sector,!0),d(t.property,!0)}))}else n.classList.add("empty"),l(t)}return e})()},190:function(t){var e;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{cmdGetCss:()=>Ot,cmdGetHtml:()=>At,cmdOpenFonts:()=>ut,default:()=>Pt,fontsDialogPlugin:()=>mt,getHtml:()=>Tt,refresh:()=>St});const n=globalThis,r=n.trustedTypes,o=r?r.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",s=`lit$${Math.random().toFixed(9).slice(2)}$`,a="?"+s,l=`<${a}>`,c=document,u=()=>c.createComment(""),p=t=>null===t||"object"!=typeof t&&"function"!=typeof t,d=Array.isArray,f=t=>d(t)||"function"==typeof t?.[Symbol.iterator],h="[ \t\n\f\r]",g=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,m=/>/g,y=RegExp(`>|${h}(?:([^\\s"'>=/]+)(${h}*=${h}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),b=/'/g,w=/"/g,_=/^(?:script|style|textarea|title)$/i,x=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),C=x(1),S=(x(2),Symbol.for("lit-noChange")),T=Symbol.for("lit-nothing"),O=new WeakMap,A=c.createTreeWalker(c,129);function E(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==o?o.createHTML(e):e}const k=(t,e)=>{const n=t.length-1,r=[];let o,a=2===e?"<svg>":"",c=g;for(let e=0;e<n;e++){const n=t[e];let u,p,d=-1,f=0;for(;f<n.length&&(c.lastIndex=f,p=c.exec(n),null!==p);)f=c.lastIndex,c===g?"!--"===p[1]?c=v:void 0!==p[1]?c=m:void 0!==p[2]?(_.test(p[2])&&(o=RegExp("</"+p[2],"g")),c=y):void 0!==p[3]&&(c=y):c===y?">"===p[0]?(c=o??g,d=-1):void 0===p[1]?d=-2:(d=c.lastIndex-p[2].length,u=p[1],c=void 0===p[3]?y:'"'===p[3]?w:b):c===w||c===b?c=y:c===v||c===m?c=g:(c=y,o=void 0);const h=c===y&&t[e+1].startsWith("/>")?" ":"";a+=c===g?n+l:d>=0?(r.push(u),n.slice(0,d)+i+n.slice(d)+s+h):n+s+(-2===d?e:h)}return[E(t,a+(t[n]||"<?>")+(2===e?"</svg>":"")),r]};class P{constructor({strings:t,_$litType$:e},n){let o;this.parts=[];let l=0,c=0;const p=t.length-1,d=this.parts,[f,h]=k(t,e);if(this.el=P.createElement(f,n),A.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=A.nextNode())&&d.length<p;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(i)){const e=h[c++],n=o.getAttribute(t).split(s),r=/([.?@])?(.*)/.exec(e);d.push({type:1,index:l,name:r[2],strings:n,ctor:"."===r[1]?I:"?"===r[1]?$:"@"===r[1]?D:L}),o.removeAttribute(t)}else t.startsWith(s)&&(d.push({type:6,index:l}),o.removeAttribute(t));if(_.test(o.tagName)){const t=o.textContent.split(s),e=t.length-1;if(e>0){o.textContent=r?r.emptyScript:"";for(let n=0;n<e;n++)o.append(t[n],u()),A.nextNode(),d.push({type:2,index:++l});o.append(t[e],u())}}}else if(8===o.nodeType)if(o.data===a)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=o.data.indexOf(s,t+1));)d.push({type:7,index:l}),t+=s.length-1}l++}}static createElement(t,e){const n=c.createElement("template");return n.innerHTML=t,n}}function j(t,e,n=t,r){if(e===S)return e;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=p(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(t),o._$AT(t,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(e=j(t,o._$AS(t,e.values),o,r)),e}class M{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,r=(t?.creationScope??c).importNode(e,!0);A.currentNode=r;let o=A.nextNode(),i=0,s=0,a=n[0];for(;void 0!==a;){if(i===a.index){let e;2===a.type?e=new N(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new R(o,this,t)),this._$AV.push(e),a=n[++s]}i!==a?.index&&(o=A.nextNode(),i++)}return A.currentNode=c,r}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class N{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,r){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=j(this,t,e),p(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==S&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):f(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==T&&p(this._$AH)?this._$AA.nextSibling.data=t:this.T(c.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=P.createElement(E(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new M(r,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new P(t)),e}k(t){d(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,r=0;for(const o of t)r===e.length?e.push(n=new N(this.S(u()),this.S(u()),this,this.options)):n=e[r],n._$AI(o),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class L{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,r,o){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=T}_$AI(t,e=this,n,r){const o=this.strings;let i=!1;if(void 0===o)t=j(this,t,e,0),i=!p(t)||t!==this._$AH&&t!==S,i&&(this._$AH=t);else{const r=t;let s,a;for(t=o[0],s=0;s<o.length-1;s++)a=j(this,r[n+s],e,s),a===S&&(a=this._$AH[s]),i||=!p(a)||a!==this._$AH[s],a===T?t=T:t!==T&&(t+=(a??"")+o[s+1]),this._$AH[s]=a}i&&!r&&this.j(t)}j(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===T?void 0:t}}class $ extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==T)}}class D extends L{constructor(t,e,n,r,o){super(t,e,n,r,o),this.type=5}_$AI(t,e=this){if((t=j(this,t,e,0)??T)===S)return;const n=this._$AH,r=t===T&&n!==T||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==T&&(n===T||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class R{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){j(this,t)}}const H={P:i,A:s,C:a,M:1,L:k,R:M,D:f,V:j,I:N,H:L,N:$,U:D,B:I,F:R},F=n.litHtmlPolyfillSupport;F?.(P,N),(n.litHtmlVersions??=[]).push("3.1.3");const V=t=>(...e)=>({_$litDirective$:t,values:e});class U{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const{I:B}=H,z=t=>void 0===t.strings,W={},q=V(class extends U{constructor(t){if(super(t),3!==t.type&&1!==t.type&&4!==t.type)throw Error("The `live` directive is not allowed on child or event bindings");if(!z(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===S||e===T)return e;const n=t.element,r=t.name;if(3===t.type){if(e===n[r])return S}else if(4===t.type){if(!!e===n.hasAttribute(r))return S}else if(1===t.type&&n.getAttribute(r)===e+"")return S;return((t,e=W)=>{t._$AH=e})(t),e}});function*G(t,e){if(void 0!==t){let n=0;for(const r of t)yield e(r,n++)}}const K="important",Y=" !"+K,X=V(class extends U{constructor(t){if(super(t),1!==t.type||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,n)=>{const r=t[n];return null==r?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?n.removeProperty(t):n[t]=null);for(const t in e){const r=e[t];if(null!=r){this.ft.add(t);const e="string"==typeof r&&r.endsWith(Y);t.includes("-")||e?n.setProperty(t,e?r.slice(0,-11):r,e?K:""):n[t]=r}}return S}}),J=(t,e)=>{const n=t._$AN;if(void 0===n)return!1;for(const t of n)t._$AO?.(e,!1),J(t,e);return!0},Z=t=>{let e,n;do{if(void 0===(e=t._$AM))break;n=e._$AN,n.delete(t),t=e}while(0===n?.size)},Q=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(void 0===n)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),nt(e)}};function tt(t){void 0!==this._$AN?(Z(this),this._$AM=t,Q(this)):this._$AM=t}function et(t,e=!1,n=0){const r=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(r))for(let t=n;t<r.length;t++)J(r[t],!1),Z(r[t]);else null!=r&&(J(r,!1),Z(r));else J(this,t)}const nt=t=>{2==t.type&&(t._$AP??=et,t._$AQ??=tt)};class rt extends U{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),Q(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(J(this,t),Z(this))}setValue(t){if(z(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const ot=()=>new it;class it{}const st=new WeakMap,at=V(class extends rt{render(t){return T}update(t,[e]){const n=e!==this.Y;return n&&void 0!==this.Y&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),T}rt(t){if("function"==typeof this.Y){const e=this.ht??globalThis;let n=st.get(e);void 0===n&&(n=new WeakMap,st.set(e,n)),void 0!==n.get(this.Y)&&this.Y.call(this.ht,void 0),n.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){return"function"==typeof this.Y?st.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),lt=document.createElement("div");let ct;const ut="open-fonts",pt="silex-loaded-fonts-list";let dt,ft,ht=[],gt="https://fonts.googleapis.com",vt="https://www.googleapis.com";try{dt=JSON.parse(localStorage.getItem(pt))}catch(i){console.error("Could not get fonts from local storage:",i)}const mt=(t,e)=>{if(ht=t.StyleManager.getBuiltIn("font-family").options,e.server_url&&(gt=e.server_url),e.api_url&&(vt=e.api_url),!e.api_key)throw new Error(t.I18n.t("grapesjs-fonts.You must provide Google font api key"));t.Commands.add(ut,{run:(n,r)=>(ct=t.Modal.open({title:t.I18n.t("grapesjs-fonts.Fonts"),content:"",attributes:{class:"fonts-dialog"}}).onceClose((()=>{t.stopCommand(ut)})),ct.setContent(lt),async function(t){ft=structuredClone(t.getModel().get("fonts")||[])}(t),wt(t,e,[]),async function(t){return dt=dt??(await(await fetch(t)).json())?.items,localStorage.setItem(pt,JSON.stringify(dt)),await async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((e=>setTimeout((()=>e()),t)))}(),dt}(`${vt}/webfonts/v1/webfonts?key=${e.api_key}`).then((n=>{wt(t,e,n);const r=lt.querySelector("form");r.onsubmit=n=>{n.preventDefault(),function(t,e){const n=t.getModel();n.set("fonts",ft),xt(t,ft),Ct(t,ft,e),n.set("changesCount",t.getDirtyCount()+1)}(t,e),t.stopCommand(ut)},r.querySelector("input")?.focus()})),ct),stop:()=>{ct.close()}}),t.on("storage:start:store",(e=>{e.fonts=t.getModel().get("fonts")})),t.on("storage:end:load",(n=>{const r=n.fonts||[];t.getModel().set("fonts",r),setTimeout((()=>St(t,e)),1e3)})),t.on("canvas:frame:load",(()=>St(t,e))),t.on("page",(()=>St(t,e)))},yt=ot(),bt=ot();function wt(t,e,n){const r=yt.value,o=n.filter((t=>function(t,e){const n=new RegExp(e,"i");return-1!==t.search(n)}(t.family,r?.value||"")));r?.focus(),((t,e)=>{const n=e;let r=n._$litPart$;if(void 0===r){const t=null;n._$litPart$=r=new N(e.insertBefore(u(),t),t,void 0,{})}r._$AI(t)})(C`
|
|
3
|
-
<form class="silex-form grapesjs-fonts">
|
|
4
|
-
<div class="silex-form__group">
|
|
5
|
-
<div class="silex-bar">
|
|
6
|
-
<input
|
|
7
|
-
style=${X({width:"100%"})}
|
|
8
|
-
placeholder="${t.I18n.t("grapesjs-fonts.Search")}"
|
|
9
|
-
type="text"
|
|
10
|
-
${at(yt)}
|
|
11
|
-
@keydown=${()=>{setTimeout((()=>wt(t,e,n)))}}/>
|
|
12
|
-
<select
|
|
13
|
-
style=${X({width:"150px"})}
|
|
14
|
-
${at(bt)}
|
|
15
|
-
>
|
|
16
|
-
${G(o,(t=>C`
|
|
17
|
-
<option value=${t.family}>${t.family}</option>
|
|
18
|
-
`))}
|
|
19
|
-
</select>
|
|
20
|
-
<button class="silex-button"
|
|
21
|
-
?disabled=${!bt.value||0===o.length}
|
|
22
|
-
type="button" @click=${()=>{!function(t,e,n,r){const o=r.family,i=`"${r.family}", ${r.category}`;n.push({name:o,value:i,variants:[]})}(0,0,ft,o[bt.value.selectedIndex]),wt(t,e,n)}}>
|
|
23
|
-
${t.I18n.t("grapesjs-fonts.Add font")}
|
|
24
|
-
</button>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<hr/>
|
|
28
|
-
<div
|
|
29
|
-
class="silex-form__element">
|
|
30
|
-
<h2>${t.I18n.t("grapesjs-fonts.Installed fonts")}</h2>
|
|
31
|
-
<ol class="silex-list">
|
|
32
|
-
${G(ft,(r=>{return C`
|
|
33
|
-
<li>
|
|
34
|
-
<div class="silex-list__item__header">
|
|
35
|
-
<h4>${r.name}</h4>
|
|
36
|
-
</div>
|
|
37
|
-
<div class="silex-list__item__body">
|
|
38
|
-
<fieldset class="silex-group--simple full-width">
|
|
39
|
-
<legend>CSS rules</legend>
|
|
40
|
-
<input
|
|
41
|
-
class="full-width"
|
|
42
|
-
type="text"
|
|
43
|
-
name="name"
|
|
44
|
-
.value=${q(r.value)}
|
|
45
|
-
@change=${o=>{var i,s;i=r,s=o.target.value,i.value=s,wt(t,e,n)}}
|
|
46
|
-
/>
|
|
47
|
-
</fieldset>
|
|
48
|
-
<fieldset class="silex-group--simple full-width">
|
|
49
|
-
<legend>Variants</legend>
|
|
50
|
-
${G((o=r,n.find((t=>o.name===t.family)))?.variants.filter((t=>""===t.replace(/[a-z]/g,""))),(o=>C`
|
|
51
|
-
<div>
|
|
52
|
-
<input
|
|
53
|
-
id=${r.name+o}
|
|
54
|
-
type="checkbox"
|
|
55
|
-
value=${o}
|
|
56
|
-
?checked=${r.variants?.includes(o)}
|
|
57
|
-
@change=${i=>{!function(t,e,n,r,o){const i=n.variants?.includes(r);i&&!o?n.variants=n.variants.filter((t=>t!==r)):!i&&o&&n.variants.push(r)}(0,0,r,o,i.target.checked),wt(t,e,n)}}
|
|
58
|
-
/><label for=${r.name+o}>${o}</label>
|
|
59
|
-
</div>
|
|
60
|
-
`))}
|
|
61
|
-
</fieldset>
|
|
62
|
-
</div>
|
|
63
|
-
<div class="silex-list__item__footer">
|
|
64
|
-
<button class="silex-button" type="button" @click=${()=>{!function(t,e,n){const r=e.findIndex((t=>t===n));e.splice(r,1)}(0,ft,r),wt(t,e,n)}}>${t.I18n.t("grapesjs-fonts.Remove")}</button>
|
|
65
|
-
</div>
|
|
66
|
-
</li>
|
|
67
|
-
`;var o}))}
|
|
68
|
-
</ol>
|
|
69
|
-
</div>
|
|
70
|
-
<footer>
|
|
71
|
-
<input class="silex-button" type="button" @click=${()=>t.stopCommand(ut)} value="${t.I18n.t("grapesjs-fonts.Cancel")}">
|
|
72
|
-
<input class="silex-button" type="submit" value="${t.I18n.t("grapesjs-fonts.Save")}">
|
|
73
|
-
</footer>
|
|
74
|
-
</form>
|
|
75
|
-
`,lt)}const _t="data-silex-gstatic";function xt(t,e){const n=t.Canvas.getDocument();if(!n)return;!function(t,e){const n=t.head.querySelectorAll(`[${e}]`);Array.from(n).forEach((t=>t.remove()))}(n,_t);const r=Tt(e,_t);n.head.insertAdjacentHTML("beforeend",r)}function Ct(t,e,n){const r=t.StyleManager.getProperty("typography","font-family");r&&(n.preserveDefaultFonts?e=ht.concat(e):0===e.length&&(e=ht),r.setOptions(e))}function St(t,e){const n=t.getModel().get("fonts")||[];xt(t,n),Ct(t,n,e)}function Tt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=`<link href="${gt}" rel="preconnect" ${e}><link href="https://fonts.gstatic.com" rel="preconnect" crossorigin ${e}>`,r=t.map((t=>{const n=(t.variants.length?":":"")+t.variants.map((t=>t.replace(/\d+/g,""))).filter((t=>!!t)).join(",");return`<link href="${gt}/css?family=${t.name.replace(/ /g,"+")}${n}&display=swap" rel="stylesheet" ${e}>`})).join("");return n+r}const Ot="get-fonts-css",At="get-fonts-html",Et={"grapesjs-fonts":{Fonts:"Fonts","You must provide Google font api key":"You must provide Google font api key, see https://developers.google.com/fonts/docs/developer_api#APIKey",Search:"Search fonts...","Add font":"Install font",Remove:"Remove",Save:"Save",Cancel:"Cancel","Installed fonts":"Installed fonts"}},kt={"grapesjs-fonts":{Fonts:"Polices","You must provide Google font api key":"Vous devez fournir une clé API Google font, voir https://developers.google.com/fonts/docs/developer_api#APIKey",Family:"Famille",Search:"Rechercher une police","Add font":"Installer la police",Remove:"Supprimer",Save:"Enregistrer",Cancel:"Annuler","Installed fonts":"Polices installées"}},Pt=function(t){const e={i18n:{},preserveDefaultFonts:!0,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}};t.I18n&&t.I18n.addMessages({en:Et,fr:kt,...e.i18n}),function(t){t.Commands.add(Ot,(()=>{throw new Error("Not implemented")})),t.Commands.add(At,(t=>Tt(t.getModel().get("fonts")||[])))}(t),mt(t,e)};return e})(),t.exports=e()},175:function(t){var e;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{cmdKeymapsDialog:()=>Y,default:()=>J,defaultOptions:()=>X});const n=globalThis,r=n.trustedTypes,o=r?r.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",s=`lit$${Math.random().toFixed(9).slice(2)}$`,a="?"+s,l=`<${a}>`,c=document,u=()=>c.createComment(""),p=t=>null===t||"object"!=typeof t&&"function"!=typeof t,d=Array.isArray,f="[ \t\n\f\r]",h=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,g=/-->/g,v=/>/g,m=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),y=/'/g,b=/"/g,w=/^(?:script|style|textarea|title)$/i,_=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),x=_(1),C=(_(2),Symbol.for("lit-noChange")),S=Symbol.for("lit-nothing"),T=new WeakMap,O=c.createTreeWalker(c,129);function A(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==o?o.createHTML(e):e}const E=(t,e)=>{const n=t.length-1,r=[];let o,a=2===e?"<svg>":"",c=h;for(let e=0;e<n;e++){const n=t[e];let u,p,d=-1,f=0;for(;f<n.length&&(c.lastIndex=f,p=c.exec(n),null!==p);)f=c.lastIndex,c===h?"!--"===p[1]?c=g:void 0!==p[1]?c=v:void 0!==p[2]?(w.test(p[2])&&(o=RegExp("</"+p[2],"g")),c=m):void 0!==p[3]&&(c=m):c===m?">"===p[0]?(c=o??h,d=-1):void 0===p[1]?d=-2:(d=c.lastIndex-p[2].length,u=p[1],c=void 0===p[3]?m:'"'===p[3]?b:y):c===b||c===y?c=m:c===g||c===v?c=h:(c=m,o=void 0);const _=c===m&&t[e+1].startsWith("/>")?" ":"";a+=c===h?n+l:d>=0?(r.push(u),n.slice(0,d)+i+n.slice(d)+s+_):n+s+(-2===d?e:_)}return[A(t,a+(t[n]||"<?>")+(2===e?"</svg>":"")),r]};class k{constructor({strings:t,_$litType$:e},n){let o;this.parts=[];let l=0,c=0;const p=t.length-1,d=this.parts,[f,h]=E(t,e);if(this.el=k.createElement(f,n),O.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=O.nextNode())&&d.length<p;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(i)){const e=h[c++],n=o.getAttribute(t).split(s),r=/([.?@])?(.*)/.exec(e);d.push({type:1,index:l,name:r[2],strings:n,ctor:"."===r[1]?L:"?"===r[1]?I:"@"===r[1]?$:N}),o.removeAttribute(t)}else t.startsWith(s)&&(d.push({type:6,index:l}),o.removeAttribute(t));if(w.test(o.tagName)){const t=o.textContent.split(s),e=t.length-1;if(e>0){o.textContent=r?r.emptyScript:"";for(let n=0;n<e;n++)o.append(t[n],u()),O.nextNode(),d.push({type:2,index:++l});o.append(t[e],u())}}}else if(8===o.nodeType)if(o.data===a)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=o.data.indexOf(s,t+1));)d.push({type:7,index:l}),t+=s.length-1}l++}}static createElement(t,e){const n=c.createElement("template");return n.innerHTML=t,n}}function P(t,e,n=t,r){if(e===C)return e;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=p(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(t),o._$AT(t,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(e=P(t,o._$AS(t,e.values),o,r)),e}class j{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,r=(t?.creationScope??c).importNode(e,!0);O.currentNode=r;let o=O.nextNode(),i=0,s=0,a=n[0];for(;void 0!==a;){if(i===a.index){let e;2===a.type?e=new M(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new D(o,this,t)),this._$AV.push(e),a=n[++s]}i!==a?.index&&(o=O.nextNode(),i++)}return O.currentNode=c,r}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class M{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,r){this.type=2,this._$AH=S,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=P(this,t,e),p(t)?t===S||null==t||""===t?(this._$AH!==S&&this._$AR(),this._$AH=S):t!==this._$AH&&t!==C&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>d(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==S&&p(this._$AH)?this._$AA.nextSibling.data=t:this.T(c.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=k.createElement(A(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new j(r,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=T.get(t.strings);return void 0===e&&T.set(t.strings,e=new k(t)),e}k(t){d(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,r=0;for(const o of t)r===e.length?e.push(n=new M(this.S(u()),this.S(u()),this,this.options)):n=e[r],n._$AI(o),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class N{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,r,o){this.type=1,this._$AH=S,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=S}_$AI(t,e=this,n,r){const o=this.strings;let i=!1;if(void 0===o)t=P(this,t,e,0),i=!p(t)||t!==this._$AH&&t!==C,i&&(this._$AH=t);else{const r=t;let s,a;for(t=o[0],s=0;s<o.length-1;s++)a=P(this,r[n+s],e,s),a===C&&(a=this._$AH[s]),i||=!p(a)||a!==this._$AH[s],a===S?t=S:t!==S&&(t+=(a??"")+o[s+1]),this._$AH[s]=a}i&&!r&&this.j(t)}j(t){t===S?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class L extends N{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===S?void 0:t}}class I extends N{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==S)}}class $ extends N{constructor(t,e,n,r,o){super(t,e,n,r,o),this.type=5}_$AI(t,e=this){if((t=P(this,t,e,0)??S)===C)return;const n=this._$AH,r=t===S&&n!==S||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==S&&(n===S||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class D{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t)}}const R=n.litHtmlPolyfillSupport;R?.(k,M),(n.litHtmlVersions??=[]).push("3.1.3");var H,F,V,U,B,z=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},W=function(){function t(t,e){this.manager=t,this.options=e,this.isOpen=!1,this.renderDialog()}return t.prototype.open=function(){this.isOpen=!0,this.renderDialog()},t.prototype.close=function(){this.isOpen=!1,this.renderDialog()},t.prototype.renderCSS=function(){var t;return null!==(t=this.options.css)&&void 0!==t?t:"\n#keymaps-dialog {\n position: absolute;\n bottom: 50px;\n left: 50%;\n background-color: #333333;\n border: #404040 solid 1px;\n border-radius: 10px;\n z-index: 1000;\n padding: 15px 18px 25px 28px;\n box-shadow: 0 10px 25px rgba(0, 0, 0, 0.33);\n transform: scaleY(0.5) translate(-50%, 0);\n transform-origin: bottom center;\n opacity: 0;\n pointer-events: none;\n transition: transform 0.2s, opacity 0.2s;\n}\n\n#keymaps-dialog.open {\n transform: scaleY(1) translate(-50%, 0);\n opacity: 1;\n}\n\n#keymaps-dialog.fade-out {\n animation: keymaps-fade-out 0.2s;\n}\n\n#keymaps-dialog header {\n margin-bottom: 12px;\n}\n\n#keymaps-dialog main {\n display: flex;\n position: relative;\n max-width: 80vw;\n overflow-x: auto;\n overflow-y: hidden;\n}\n\n#keymaps-dialog .mask {\n position: sticky;\n flex-shrink: 0;\n top: 0;\n bottom: 0;\n width: 10px;\n right: 0;\n background-image: linear-gradient(to right, transparent, #333333 90%);\n}\n\n#keymaps-dialog .category {\n margin-right: 15px;\n}\n\n#keymaps-dialog .category:last-of-type {\n margin-right: 0;\n}\n\n#keymaps-dialog ul {\n display: grid;\n grid-auto-flow: column;\n grid-template-rows: repeat(9, 1fr);\n grid-template-columns: 1fr;\n grid-column-gap: 15px;\n grid-row-gap: 2px;\n list-style: none;\n}\n\n#keymaps-dialog * {\n cursor: default;\n padding: 0;\n margin: 0;\n color: #ddd;\n font-family: Ubuntu, sans-serif;\n}\n\n#keymap-dialog *::selection, #keymap-dialog *::-moz-selection {\n background-color: transparent;\n}\n\n#keymaps-dialog h3 {\n text-align: center;\n font-size: 0.85rem;\n opacity: 0.5;\n}\n\n#keymaps-dialog h4 {\n font-size: 0.85rem;\n margin-bottom: 12px;\n}\n\n#keymaps-dialog span {\n font-size: 0.75rem;\n}\n\n#keymaps-dialog .keymap {\n display: flex;\n align-items: center;\n border-radius: 7px;\n padding: 6px 20px 6px 5px;\n white-space: nowrap;\n}\n\n#keymaps-dialog .keymap:nth-child(odd) {\n background-color: #404040;\n}\n\n#keymaps-dialog .keys {\n display: flex;\n align-items: center;\n margin-right: 8px;\n}\n\n#keymaps-dialog .key {\n height: 1rem;\n line-height: 1rem;\n display: inline-block;\n vertical-align: middle;\n border-radius: 4px;\n background-color: #ffffff20;\n color: #ddd;\n padding: 0 5px;\n margin-right: 5px;\n}\n\n#keymaps-dialog .name {\n white-space: nowrap;\n}\n\n"},t.prototype.renderDialog=function(){var t=this.manager.keymapsRegistry;((t,e)=>{const n=e;let r=n._$litPart$;if(void 0===r){const t=null;n._$litPart$=r=new M(e.insertBefore(u(),t),t,void 0,{})}r._$AI(t)})(x(B||(B=z(["\n <style>",'</style>\n <div id="keymaps-dialog" class="','">\n <header>\n <h3>Keyboard Shortcuts ',"</h3>\n </header>\n <main>\n ",'\n <div class="mask"></div>\n </main>\n </div>\n '],["\n <style>",'</style>\n <div id="keymaps-dialog" class="','">\n <header>\n <h3>Keyboard Shortcuts ',"</h3>\n </header>\n <main>\n ",'\n <div class="mask"></div>\n </main>\n </div>\n '])),this.renderCSS(),this.isOpen?"open":"",this.options.longPressDuration&&this.options.longPressKey?x(H||(H=z(["(hold "," to show)"],["(hold "," to show)"])),q(this.options.longPressKey)):"",t&&Object.keys(t).map((function(e){return x(U||(U=z(['\n <section class="category">\n <h4>',"</h4>\n <ul>\n ","\n </ul>\n </section>\n "],['\n <section class="category">\n <h4>',"</h4>\n <ul>\n ","\n </ul>\n </section>\n "])),e,t[e].map((function(t){return x(V||(V=z(['\n <li class="keymap">\n <div class="keys">\n ','\n </div>\n <span class="name">',"</span>\n </li>\n "],['\n <li class="keymap">\n <div class="keys">\n ','\n </div>\n <span class="name">',"</span>\n </li>\n "])),t.keys.map((function(t){return x(F||(F=z(['\n <span class="key">',"</span>\n "],['\n <span class="key">',"</span>\n "])),t)})),t.name)})))}))),document.body)},t}();function q(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}var G=function(){function t(t,e){var n=this;this.editor=t,this.dialog=new W(this,e),this.keymapsRegistry={},t.on("keymap:add keymap:remove",(function(){n.updateRegistry()}))}return t.prototype.updateRegistry=function(){var t=this.editor.Keymaps.getAll();for(var e in this.keymapsRegistry={},t){var n=e.split(":"),r=q(n[0]),o=n[1].split("-").map(q).join(" "),i=t[e].keys.split(",")[0].replace(/\b/,"").split("+").map(q);this.keymapsRegistry[r]||(this.keymapsRegistry[r]=[]),this.keymapsRegistry[r].push({name:o,keys:i})}},t.prototype.openDialog=function(){this.dialog.open()},t.prototype.closeDialog=function(){this.dialog.close()},t}(),K=function(){return K=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},K.apply(this,arguments)},Y="open-keymaps-dialog",X={longPressKey:"shift",longPressDuration:800,shortcut:"shift+k",css:null};const J=function(t,e){void 0===e&&(e={});var n=K(K({},X),e),r=new G(t,n);t.Commands.add(Y,{run:function(t){r.openDialog()},stop:function(t){r.closeDialog()}});var o=!1;if(n.shortcut&&t.Keymaps.add("general:toggle-shortcuts-help",n.shortcut,(function(){t.Commands.isActive(Y)?(o=!1,t.stopCommand(Y)):(o=!0,t.runCommand(Y))})),n.longPressDuration&&n.longPressKey){var i=void 0;document.addEventListener("keydown",(function(e){e.key.toLowerCase()===n.longPressKey&&(i||(i=setTimeout((function(){t.runCommand(Y)}),n.longPressDuration)))})),document.addEventListener("keyup",(function(e){e.key.toLowerCase()!==n.longPressKey||o||(i&&(clearTimeout(i),i=void 0),t.stopCommand(Y))}))}};return e})(),t.exports=e()},924:function(t){"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t,e){Object.keys(e).forEach((function(n){t.style[n]=e[n]}))}t.r(e),t.d(e,{default:()=>r});const r=function(t,e){void 0===e&&(e={});var r={appendTo:document.body,start:!0,style:{padding:"4px",backgroundColor:"white",opacity:.6,position:"fixed",zIndex:10,transition:"width 0.2s ease-out",pointerEvents:"none"},visibleStyle:{visibility:"visible",width:"100%"},hiddenStyle:{visibility:"hidden",width:"0%"}},o=Object.assign(r,e),i=document.createElement("div");t.on("load",(function(){var t="string"==typeof o.appendTo?document.querySelector(o.appendTo):o.appendTo;o.start?t.insertBefore(i,t.firstChild):t.appendChild(i)})),n(i,o.style),i.style.visibility="hidden",t.on("storage:start",(function(){n(i,o.visibleStyle)})),t.on("storage:end",(function(){n(i,o.hiddenStyle)}))};return e})()},756:function(t,e,n){var r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,r=()=>(()=>{var t={298:(t,e,n)=>{var r,o,i;i="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g,r=[n(405),n(291),e],o=function(t,e,n){i.Backbone=function(t,e,n,r){var o=t.Backbone,i=Array.prototype.slice;e.VERSION="1.6.0",e.$=r,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s,a=e.Events={},l=/\s+/,c=function(t,e,r,o,i){var s,a=0;if(r&&"object"==typeof r){void 0!==o&&"context"in i&&void 0===i.context&&(i.context=o);for(s=n.keys(r);a<s.length;a++)e=c(t,e,s[a],r[s[a]],i)}else if(r&&l.test(r))for(s=r.split(l);a<s.length;a++)e=t(e,s[a],o,i);else e=t(e,r,o,i);return e};a.on=function(t,e,n){return this._events=c(u,this._events||{},t,e,{context:n,ctx:this,listening:s}),s&&((this._listeners||(this._listeners={}))[s.id]=s,s.interop=!1),this},a.listenTo=function(t,e,r){if(!t)return this;var o=t._listenId||(t._listenId=n.uniqueId("l")),i=this._listeningTo||(this._listeningTo={}),a=s=i[o];a||(this._listenId||(this._listenId=n.uniqueId("l")),a=s=i[o]=new v(this,t));var l=p(t,e,r,this);if(s=void 0,l)throw l;return a.interop&&a.on(e,r),this};var u=function(t,e,n,r){if(n){var o=t[e]||(t[e]=[]),i=r.context,s=r.ctx,a=r.listening;a&&a.count++,o.push({callback:n,context:i,ctx:i||s,listening:a})}return t},p=function(t,e,n,r){try{t.on(e,n,r)}catch(t){return t}};a.off=function(t,e,n){return this._events?(this._events=c(d,this._events,t,e,{context:n,listeners:this._listeners}),this):this},a.stopListening=function(t,e,r){var o=this._listeningTo;if(!o)return this;for(var i=t?[t._listenId]:n.keys(o),s=0;s<i.length;s++){var a=o[i[s]];if(!a)break;a.obj.off(e,r,this),a.interop&&a.off(e,r)}return n.isEmpty(o)&&(this._listeningTo=void 0),this};var d=function(t,e,r,o){if(t){var i,s=o.context,a=o.listeners,l=0;if(e||s||r){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(r&&r!==d.callback&&r!==d.callback._callback||s&&s!==d.context)u.push(d);else{var f=d.listening;f&&f.off(e,r)}}u.length?t[e]=u:delete t[e]}return t}for(i=n.keys(a);l<i.length;l++)a[i[l]].cleanup()}};a.once=function(t,e,n){var r=c(f,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(r,e,n)},a.listenToOnce=function(t,e,n){var r=c(f,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,r)};var f=function(t,e,r,o){if(r){var i=t[e]=n.once((function(){o(e,i),r.apply(this,arguments)}));i._callback=r}return t};a.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return c(h,this._events,t,void 0,n),this};var h=function(t,e,n,r){if(t){var o=t[e],i=t.all;o&&i&&(i=i.slice()),o&&g(o,r),i&&g(i,[e].concat(r))}return t},g=function(t,e){var n,r=-1,o=t.length,i=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++r<o;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i);return;case 2:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,s);return;case 3:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,s,a);return;default:for(;++r<o;)(n=t[r]).callback.apply(n.ctx,e);return}},v=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};v.prototype.on=a.on,v.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()},v.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},a.bind=a.on,a.unbind=a.off,n.extend(e,a);var m=e.Model=function(t,e){var r=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});var o=n.result(this,"defaults");r=n.defaults(n.extend({},o,r),o),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(m.prototype,a,{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,r){if(null==t)return this;var o;if("object"==typeof t?(o=t,r=e):(o={})[t]=e,r||(r={}),!this._validate(o,r))return!1;var i=r.unset,s=r.silent,a=[],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 o)e=o[d],n.isEqual(c[d],e)||a.push(d),n.isEqual(p[d],e)?delete u[d]:u[d]=e,i?delete c[d]:c[d]=e;if(this.idAttribute in o){var f=this.id;this.id=this.get(this.idAttribute),this.trigger("changeId",this,f,r)}if(!s){a.length&&(this._pending=r);for(var h=0;h<a.length;h++)this.trigger("change:"+a[h],this,c[a[h]],r)}if(l)return this;if(!s)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);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 r in this.attributes)e[r]=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,r=this._changing?this._previousAttributes:this.attributes,o={};for(var i in t){var s=t[i];n.isEqual(r[i],s)||(o[i]=s,e=!0)}return!!e&&o},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,r=t.success;return t.success=function(n){var o=t.parse?e.parse(n,t):n;if(!e.set(o,t))return!1;r&&r.call(t.context,e,n,t),e.trigger("sync",e,n,t)},z(this,t),this.sync("read",this,t)},save:function(t,e,r){var o;null==t||"object"==typeof t?(o=t,r=e):(o={})[t]=e;var i=(r=n.extend({validate:!0,parse:!0},r)).wait;if(o&&!i){if(!this.set(o,r))return!1}else if(!this._validate(o,r))return!1;var s=this,a=r.success,l=this.attributes;r.success=function(t){s.attributes=l;var e=r.parse?s.parse(t,r):t;if(i&&(e=n.extend({},o,e)),e&&!s.set(e,r))return!1;a&&a.call(r.context,s,t,r),s.trigger("sync",s,t,r)},z(this,r),o&&i&&(this.attributes=n.extend({},l,o));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=o);var u=this.sync(c,this,r);return this.attributes=l,u},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,o=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){o&&i(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var s=!1;return this.isNew()?n.defer(t.success):(z(this,t),s=this.sync("delete",this,t)),o||i(),s},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||B();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 r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,n.extend(e,{validationError:r})),!1)}});var y=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},w={add:!0,remove:!1},_=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var r,o=Array(t.length-n),i=e.length;for(r=0;r<o.length;r++)o[r]=t[r+n];for(r=0;r<i;r++)t[r+n]=e[r];for(r=0;r<o.length;r++)t[r+i+n]=o[r]};n.extend(y.prototype,a,{model:m,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,w))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:t.slice();var o=this._removeModels(t,e);return!e.silent&&o.length&&(e.changes={added:[],merged:[],removed:o},this.trigger("update",this,e)),r?o[0]:o},set:function(t,e){if(null!=t){(e=n.extend({},b,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var r=!n.isArray(t);t=r?[t]:t.slice();var o=e.at;null!=o&&(o=+o),o>this.length&&(o=this.length),o<0&&(o+=this.length+1);var i,s,a=[],l=[],c=[],u=[],p={},d=e.add,f=e.merge,h=e.remove,g=!1,v=this.comparator&&null==o&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(s=0;s<t.length;s++){i=t[s];var y=this.get(i);if(y){if(f&&i!==y){var w=this._isModel(i)?i.attributes:i;e.parse&&(w=y.parse(w,e)),y.set(w,e),c.push(y),v&&!g&&(g=y.hasChanged(m))}p[y.cid]||(p[y.cid]=!0,a.push(y)),t[s]=y}else d&&(i=t[s]=this._prepareModel(i,e))&&(l.push(i),this._addReference(i,e),p[i.cid]=!0,a.push(i))}if(h){for(s=0;s<this.length;s++)p[(i=this.models[s]).cid]||u.push(i);u.length&&this._removeModels(u,e)}var x=!1,C=!v&&d&&h;if(a.length&&C?(x=this.length!==a.length||n.some(this.models,(function(t,e){return t!==a[e]})),this.models.length=0,_(this.models,a,0),this.length=this.models.length):l.length&&(v&&(g=!0),_(this.models,l,null==o?this.length:o),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(s=0;s<l.length;s++)null!=o&&(e.index=o+s),(i=l[s]).trigger("add",i,this,e);(g||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 r?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],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 r=e.length;return n.isFunction(e)&&(e=e.bind(this)),1===r||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,r=this;return t.success=function(n){var o=t.reset?"reset":"set";r[o](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},z(this,t),this.sync("read",this,t)},create:function(t,e){var r=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;r||this.add(t,e);var o=this,i=e.success;return e.success=function(t,e,n){r&&(t.off("error",o._forwardPristineError,o),o.add(t,n)),i&&i.call(n.context,t,e,n)},r&&t.once("error",this._forwardPristineError,this),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,T)},entries:function(){return new C(this,O)},_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,(r=this.model.prototype?new this.model(t,e):this.model(t,e)).validationError?(this.trigger("invalid",this,r.validationError,e),!1):r);var r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var o=this.get(t[r]);if(o){var i=this.indexOf(o);this.models.splice(i,1),this.length--,delete this._byId[o.cid];var s=this.modelId(o.attributes,o.idAttribute);null!=s&&delete this._byId[s],e.silent||(e.index=i,o.trigger("remove",o,this,e)),n.push(o),this._removeReference(o,e)}}return t.length>0&&!e.silent&&delete e.index,n},_isModel:function(t){return t instanceof m},_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,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"changeId"===t){var o=this.modelId(e.previousAttributes(),e.idAttribute),i=this.modelId(e.attributes,e.idAttribute);null!=o&&delete this._byId[o],null!=i&&(this._byId[i]=e)}}this.trigger.apply(this,arguments)},_forwardPristineError:function(t,e,n){this.has(t)||this._onModelEvent("error",t,e,n)}});var x="function"==typeof Symbol&&Symbol.iterator;x&&(y.prototype[x]=y.prototype.values);var C=function(t,e){this._collection=t,this._kind=e,this._index=0},S=1,T=2,O=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===T?n:[n,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var A=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(A.prototype,a,{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 r=t[e];if(n.isFunction(r)||(r=this[r]),r){var o=e.match(E);this.delegate(o[1],o[2],r.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 P=function(t,e,r,o){n.each(r,(function(n,r){e[r]&&(t.prototype[r]=function(t,e,n,r){switch(e){case 1:return function(){return t[n](this[r])};case 2:return function(e){return t[n](this[r],e)};case 3:return function(e,o){return t[n](this[r],j(e,this),o)};case 4:return function(e,o,i){return t[n](this[r],j(e,this),o,i)};default:return function(){var e=i.call(arguments);return e.unshift(this[r]),t[n].apply(t,e)}}}(e,n,r,o))}))},j=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?M(t):n.isString(t)?function(e){return e.get(t)}:t},M=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}};n.each([[y,{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},"models"],[m,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes"]],(function(t){var e=t[0],r=t[1],o=t[2];e.mixin=function(t){var r=n.reduce(n.functions(t),(function(t,e){return t[e]=0,t}),{});P(e,t,r,o)},P(e,n,r,o)})),e.sync=function(t,r,o){var i=N[t];n.defaults(o||(o={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var s={type:i,dataType:"json"};if(o.url||(s.url=n.result(r,"url")||B()),null!=o.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(s.contentType="application/json",s.data=JSON.stringify(o.attrs||r.toJSON(o))),o.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),o.emulateHTTP&&("PUT"===i||"DELETE"===i||"PATCH"===i)){s.type="POST",o.emulateJSON&&(s.data._method=i);var a=o.beforeSend;o.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",i),a)return a.apply(this,arguments)}}"GET"===s.type||o.emulateJSON||(s.processData=!1);var l=o.error;o.error=function(t,e,n){o.textStatus=e,o.errorThrown=n,l&&l.call(o.context,t,e,n)};var c=o.xhr=e.ajax(n.extend(s,o));return r.trigger("request",r,c,o),c};var N={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var L=e.Router=function(t){t||(t={}),this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},I=/\((.*?)\)/g,$=/(\(\?)?:\w+/g,D=/\*\w+/g,R=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(L.prototype,a,{preinitialize:function(){},initialize:function(){},route:function(t,r,o){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(o=r,r=""),o||(o=this[r]);var i=this;return e.history.route(t,(function(n){var s=i._extractParameters(t,n);!1!==i.execute(o,s,r)&&(i.trigger.apply(i,["route:"+r].concat(s)),i.trigger("route",r,s),e.history.trigger("route",i,r,s))})),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(R,"\\$&").replace(I,"(?:$1)?").replace($,(function(t,e){return e?t:"([^/?]+)"})).replace(D,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,(function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null}))}});var H=e.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},F=/^[#\/]|\s+$/g,V=/^\/+|\/+$/g,U=/#.*$/;H.started=!1,n.extend(H.prototype,a,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(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(F,"")},start:function(t){if(H.started)throw new Error("Backbone.history has already been started");if(H.started=!0,this.options=n.extend({root:"/"},this.options,t),this.root=this.options.root,this._trailingSlash=this.options.trailingSlash,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(V,"/"),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 r=document.body,o=r.insertBefore(this.iframe,r.firstChild).contentWindow;o.document.open(),o.document.close(),o.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),H.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!this.matchRoot()&&this.notfound();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}))||this.notfound()):this.notfound()},notfound:function(){return this.trigger("notfound"),!1},navigate:function(t,e){if(!H.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;this._trailingSlash||""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;t=t.replace(U,"");var o=this.decodeFragment(t);if(this.fragment!==o){if(this.fragment=o,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);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 r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new H,m.extend=y.extend=L.extend=A.extend=H.extend=function(t,e){var r,o=this;return r=t&&n.has(t,"constructor")?t.constructor:function(){return o.apply(this,arguments)},n.extend(r,o,e),r.prototype=n.create(o.prototype,t),r.prototype.constructor=r,r.__super__=o.prototype,r};var B=function(){throw new Error('A "url" property or function must be specified')},z=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e._debug=function(){return{root:t,_:n}},e}(i,n,t,e)}.apply(e,r),void 0===o||(t.exports=o)},291:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(r,o){"use strict";var i=[],s=Object.getPrototypeOf,a=i.slice,l=i.flat?function(t){return i.flat.call(t)}:function(t){return i.concat.apply([],t)},c=i.push,u=i.indexOf,p={},d=p.toString,f=p.hasOwnProperty,h=f.toString,g=h.call(Object),v={},m=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},b=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function _(t,e,n){var r,o,i=(n=n||b).createElement("script");if(i.text=t,e)for(r in w)(o=e[r]||e.getAttribute&&e.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?p[d.call(t)]||"object":typeof t}var C="3.7.1",S=/HTML$/i,T=function(t,e){return new T.fn.init(t,e)};function O(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!m(t)&&!y(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function A(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}T.fn=T.prototype={jquery:C,constructor:T,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=T.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return T.each(this,t)},map:function(t){return this.pushStack(T.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(T.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(T.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:i.sort,splice:i.splice},T.extend=T.fn.extend=function(){var t,e,n,r,o,i,s=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||m(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)r=t[e],"__proto__"!==e&&s!==r&&(c&&r&&(T.isPlainObject(r)||(o=Array.isArray(r)))?(n=s[e],i=o&&!Array.isArray(n)?[]:o||T.isPlainObject(n)?n:{},o=!1,s[e]=T.extend(c,i,r)):void 0!==r&&(s[e]=r));return s},T.extend({expando:"jQuery"+(C+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==d.call(t)||(e=s(t))&&("function"!=typeof(n=f.call(e,"constructor")&&e.constructor)||h.call(n)!==g))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){_(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(O(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},text:function(t){var e,n="",r=0,o=t.nodeType;if(!o)for(;e=t[r++];)n+=T.text(e);return 1===o||11===o?t.textContent:9===o?t.documentElement.textContent:3===o||4===o?t.nodeValue:n},makeArray:function(t,e){var n=e||[];return null!=t&&(O(Object(t))?T.merge(n,"string"==typeof t?[t]:t):c.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:u.call(e,t,n)},isXMLDoc:function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!S.test(e||n&&n.nodeName||"HTML")},merge:function(t,e){for(var n=+e.length,r=0,o=t.length;r<n;r++)t[o++]=e[r];return t.length=o,t},grep:function(t,e,n){for(var r=[],o=0,i=t.length,s=!n;o<i;o++)!e(t[o],o)!==s&&r.push(t[o]);return r},map:function(t,e,n){var r,o,i=0,s=[];if(O(t))for(r=t.length;i<r;i++)null!=(o=e(t[i],i,n))&&s.push(o);else for(i in t)null!=(o=e(t[i],i,n))&&s.push(o);return l(s)},guid:1,support:v}),"function"==typeof Symbol&&(T.fn[Symbol.iterator]=i[Symbol.iterator]),T.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){p["[object "+e+"]"]=e.toLowerCase()}));var E=i.pop,k=i.sort,P=i.splice,j="[\\x20\\t\\r\\n\\f]",M=new RegExp("^"+j+"+|((?:^|[^\\\\])(?:\\\\.)*)"+j+"+$","g");T.contains=function(t,e){var n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(t.contains?t.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))};var N=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function L(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}T.escapeSelector=function(t){return(t+"").replace(N,L)};var I=b,$=c;!function(){var t,e,n,o,s,l,c,p,d,h,g=$,m=T.expando,y=0,b=0,w=tt(),_=tt(),x=tt(),C=tt(),S=function(t,e){return t===e&&(s=!0),0},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",N="(?:\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",L="\\["+j+"*("+N+")(?:"+j+"*([*^$|!~]?=)"+j+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+j+"*\\]",D=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+L+")*)|.*)\\)|)",R=new RegExp(j+"+","g"),H=new RegExp("^"+j+"*,"+j+"*"),F=new RegExp("^"+j+"*([>+~]|"+j+")"+j+"*"),V=new RegExp(j+"|>"),U=new RegExp(D),B=new RegExp("^"+N+"$"),z={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N+"|[*])"),ATTR:new RegExp("^"+L),PSEUDO:new RegExp("^"+D),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\([^\\r\\n\\f])","g"),X=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){lt()},Z=dt((function(t){return!0===t.disabled&&A(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(i=a.call(I.childNodes),I.childNodes),i[I.childNodes.length].nodeType}catch(t){g={apply:function(t,e){$.apply(t,a.call(e))},call:function(t){$.apply(t,a.call(arguments,1))}}}function Q(t,e,n,r){var o,i,s,a,c,u,f,h=e&&e.ownerDocument,y=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==y&&9!==y&&11!==y)return n;if(!r&&(lt(e),e=e||l,p)){if(11!==y&&(c=G.exec(t)))if(o=c[1]){if(9===y){if(!(s=e.getElementById(o)))return n;if(s.id===o)return g.call(n,s),n}else if(h&&(s=h.getElementById(o))&&Q.contains(e,s)&&s.id===o)return g.call(n,s),n}else{if(c[2])return g.apply(n,e.getElementsByTagName(t)),n;if((o=c[3])&&e.getElementsByClassName)return g.apply(n,e.getElementsByClassName(o)),n}if(!(C[t+" "]||d&&d.test(t))){if(f=t,h=e,1===y&&(V.test(t)||F.test(t))){for((h=K.test(t)&&at(e.parentNode)||e)==e&&v.scope||((a=e.getAttribute("id"))?a=T.escapeSelector(a):e.setAttribute("id",a=m)),i=(u=ut(t)).length;i--;)u[i]=(a?"#"+a:":scope")+" "+pt(u[i]);f=u.join(",")}try{return g.apply(n,h.querySelectorAll(f)),n}catch(e){C(t,!0)}finally{a===m&&e.removeAttribute("id")}}}return yt(t.replace(M,"$1"),e,n,r)}function tt(){var t=[];return function n(r,o){return t.push(r+" ")>e.cacheLength&&delete n[t.shift()],n[r+" "]=o}}function et(t){return t[m]=!0,t}function nt(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function rt(t){return function(e){return A(e,"input")&&e.type===t}}function ot(t){return function(e){return(A(e,"input")||A(e,"button"))&&e.type===t}}function it(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Z(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function st(t){return et((function(e){return e=+e,et((function(n,r){for(var o,i=t([],n.length,e),s=i.length;s--;)n[o=i[s]]&&(n[o]=!(r[o]=n[o]))}))}))}function at(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var n,r=t?t.ownerDocument||t:I;return r!=l&&9===r.nodeType&&r.documentElement?(c=(l=r).documentElement,p=!T.isXMLDoc(l),h=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&I!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",J),v.getById=nt((function(t){return c.appendChild(t).id=T.expando,!l.getElementsByName||!l.getElementsByName(T.expando).length})),v.disconnectedMatch=nt((function(t){return h.call(t,"*")})),v.scope=nt((function(){return l.querySelectorAll(":scope")})),v.cssHas=nt((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),v.getById?(e.filter.ID=function(t){var e=t.replace(Y,X);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace(Y,X);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n,r,o,i=e.getElementById(t);if(i){if((n=i.getAttributeNode("id"))&&n.value===t)return[i];for(o=e.getElementsByName(t),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===t)return[i]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&p)return e.getElementsByClassName(t)},d=[],nt((function(t){var e;c.appendChild(t).innerHTML="<a id='"+m+"' href='' disabled='disabled'></a><select id='"+m+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||d.push("\\["+j+"*(?:value|"+O+")"),t.querySelectorAll("[id~="+m+"-]").length||d.push("~="),t.querySelectorAll("a#"+m+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||d.push("\\["+j+"*name"+j+"*="+j+"*(?:''|\"\")")})),v.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),S=function(t,e){if(t===e)return s=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!v.sortDetached&&e.compareDocumentPosition(t)===n?t===l||t.ownerDocument==I&&Q.contains(I,t)?-1:e===l||e.ownerDocument==I&&Q.contains(I,e)?1:o?u.call(o,t)-u.call(o,e):0:4&n?-1:1)},l):l}for(t in Q.matches=function(t,e){return Q(t,null,null,e)},Q.matchesSelector=function(t,e){if(lt(t),p&&!C[e+" "]&&(!d||!d.test(e)))try{var n=h.call(t,e);if(n||v.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){C(e,!0)}return Q(e,l,null,[t]).length>0},Q.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),T.contains(t,e)},Q.attr=function(t,n){(t.ownerDocument||t)!=l&<(t);var r=e.attrHandle[n.toLowerCase()],o=r&&f.call(e.attrHandle,n.toLowerCase())?r(t,n,!p):void 0;return void 0!==o?o:t.getAttribute(n)},Q.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},T.uniqueSort=function(t){var e,n=[],r=0,i=0;if(s=!v.sortStable,o=!v.sortStable&&a.call(t,0),k.call(t,S),s){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)P.call(t,n[r],1)}return o=null,t},T.fn.uniqueSort=function(){return this.pushStack(T.uniqueSort(a.apply(this)))},e=T.expr={cacheLength:50,createPseudo:et,match:z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Y,X),t[3]=(t[3]||t[4]||t[5]||"").replace(Y,X),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Q.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Q.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return z.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&U.test(n)&&(e=ut(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Y,X).toLowerCase();return"*"===t?function(){return!0}:function(t){return A(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+j+")"+t+"("+j+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=Q.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o.replace(R," ")+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,l){var c,u,p,d,f,h=i!==s?"nextSibling":"previousSibling",g=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!l&&!a,w=!1;if(g){if(i){for(;h;){for(p=e;p=p[h];)if(a?A(p,v):1===p.nodeType)return!1;f=h="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?g.firstChild:g.lastChild],s&&b){for(w=(d=(c=(u=g[m]||(g[m]={}))[t]||[])[0]===y&&c[1])&&c[2],p=d&&g.childNodes[d];p=++d&&p&&p[h]||(w=d=0)||f.pop();)if(1===p.nodeType&&++w&&p===e){u[t]=[y,d,w];break}}else if(b&&(w=d=(c=(u=e[m]||(e[m]={}))[t]||[])[0]===y&&c[1]),!1===w)for(;(p=++d&&p&&p[h]||(w=d=0)||f.pop())&&(!(a?A(p,v):1===p.nodeType)||!++w||(b&&((u=p[m]||(p[m]={}))[t]=[y,w]),p!==e)););return(w-=o)===r||w%r==0&&w/r>=0}}},PSEUDO:function(t,n){var r,o=e.pseudos[t]||e.setFilters[t.toLowerCase()]||Q.error("unsupported pseudo: "+t);return o[m]?o(n):o.length>1?(r=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var r,i=o(t,n),s=i.length;s--;)t[r=u.call(t,i[s])]=!(e[r]=i[s])})):function(t){return o(t,0,r)}):o}},pseudos:{not:et((function(t){var e=[],n=[],r=mt(t.replace(M,"$1"));return r[m]?et((function(t,e,n,o){for(var i,s=r(t,null,o,[]),a=t.length;a--;)(i=s[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:et((function(t){return function(e){return Q(t,e).length>0}})),contains:et((function(t){return t=t.replace(Y,X),function(e){return(e.textContent||T.text(e)).indexOf(t)>-1}})),lang:et((function(t){return B.test(t||"")||Q.error("unsupported lang: "+t),t=t.replace(Y,X).toLowerCase(),function(e){var n;do{if(n=p?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=r.location&&r.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:it(!1),disabled:it(!0),checked:function(t){return A(t,"input")&&!!t.checked||A(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return q.test(t.nodeName)},input:function(t){return W.test(t.nodeName)},button:function(t){return A(t,"input")&&"button"===t.type||A(t,"button")},text:function(t){var e;return A(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:st((function(){return[0]})),last:st((function(t,e){return[e-1]})),eq:st((function(t,e,n){return[n<0?n+e:n]})),even:st((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:st((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:st((function(t,e,n){var r;for(r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t})),gt:st((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}},e.pseudos.nth=e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[t]=rt(t);for(t in{submit:!0,reset:!0})e.pseudos[t]=ot(t);function ct(){}function ut(t,n){var r,o,i,s,a,l,c,u=_[t+" "];if(u)return n?0:u.slice(0);for(a=t,l=[],c=e.preFilter;a;){for(s in r&&!(o=H.exec(a))||(o&&(a=a.slice(o[0].length)||a),l.push(i=[])),r=!1,(o=F.exec(a))&&(r=o.shift(),i.push({value:r,type:o[0].replace(M," ")}),a=a.slice(r.length)),e.filter)!(o=z[s].exec(a))||c[s]&&!(o=c[s](o))||(r=o.shift(),i.push({value:r,type:s,matches:o}),a=a.slice(r.length));if(!r)break}return n?a.length:a?Q.error(t):_(t,l).slice(0)}function pt(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function dt(t,e,n){var r=e.dir,o=e.next,i=o||r,s=n&&"parentNode"===i,a=b++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||s)return t(e,n,o);return!1}:function(e,n,l){var c,u,p=[y,a];if(l){for(;e=e[r];)if((1===e.nodeType||s)&&t(e,n,l))return!0}else for(;e=e[r];)if(1===e.nodeType||s)if(u=e[m]||(e[m]={}),o&&A(e,o))e=e[r]||e;else{if((c=u[i])&&c[0]===y&&c[1]===a)return p[2]=c[2];if(u[i]=p,p[2]=t(e,n,l))return!0}return!1}}function ft(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function ht(t,e,n,r,o){for(var i,s=[],a=0,l=t.length,c=null!=e;a<l;a++)(i=t[a])&&(n&&!n(i,r,o)||(s.push(i),c&&e.push(a)));return s}function gt(t,e,n,r,o,i){return r&&!r[m]&&(r=gt(r)),o&&!o[m]&&(o=gt(o,i)),et((function(i,s,a,l){var c,p,d,f,h=[],v=[],m=s.length,y=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)Q(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),b=!t||!i&&e?y:ht(y,h,t,a,l);if(n?n(b,f=o||(i?t:m||r)?[]:s,a,l):f=b,r)for(c=ht(f,v),r(c,[],a,l),p=c.length;p--;)(d=c[p])&&(f[v[p]]=!(b[v[p]]=d));if(i){if(o||t){if(o){for(c=[],p=f.length;p--;)(d=f[p])&&c.push(b[p]=d);o(null,f=[],c,l)}for(p=f.length;p--;)(d=f[p])&&(c=o?u.call(i,d):h[p])>-1&&(i[c]=!(s[c]=d))}}else f=ht(f===s?f.splice(m,f.length):f),o?o(null,s,f,l):g.apply(s,f)}))}function vt(t){for(var r,o,i,s=t.length,a=e.relative[t[0].type],l=a||e.relative[" "],c=a?1:0,p=dt((function(t){return t===r}),l,!0),d=dt((function(t){return u.call(r,t)>-1}),l,!0),f=[function(t,e,o){var i=!a&&(o||e!=n)||((r=e).nodeType?p(t,e,o):d(t,e,o));return r=null,i}];c<s;c++)if(o=e.relative[t[c].type])f=[dt(ft(f),o)];else{if((o=e.filter[t[c].type].apply(null,t[c].matches))[m]){for(i=++c;i<s&&!e.relative[t[i].type];i++);return gt(c>1&&ft(f),c>1&&pt(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(M,"$1"),o,c<i&&vt(t.slice(c,i)),i<s&&vt(t=t.slice(i)),i<s&&pt(t))}f.push(o)}return ft(f)}function mt(t,r){var o,i=[],s=[],a=x[t+" "];if(!a){for(r||(r=ut(t)),o=r.length;o--;)(a=vt(r[o]))[m]?i.push(a):s.push(a);a=x(t,function(t,r){var o=r.length>0,i=t.length>0,s=function(s,a,c,u,d){var f,h,v,m=0,b="0",w=s&&[],_=[],x=n,C=s||i&&e.find.TAG("*",d),S=y+=null==x?1:Math.random()||.1,O=C.length;for(d&&(n=a==l||a||d);b!==O&&null!=(f=C[b]);b++){if(i&&f){for(h=0,a||f.ownerDocument==l||(lt(f),c=!p);v=t[h++];)if(v(f,a||l,c)){g.call(u,f);break}d&&(y=S)}o&&((f=!v&&f)&&m--,s&&w.push(f))}if(m+=b,o&&b!==m){for(h=0;v=r[h++];)v(w,_,a,c);if(s){if(m>0)for(;b--;)w[b]||_[b]||(_[b]=E.call(u));_=ht(_)}g.apply(u,_),d&&!s&&_.length>0&&m+r.length>1&&T.uniqueSort(u)}return d&&(y=S,n=x),w};return o?et(s):s}(s,i)),a.selector=t}return a}function yt(t,n,r,o){var i,s,a,l,c,u="function"==typeof t&&t,d=!o&&ut(t=u.selector||t);if(r=r||[],1===d.length){if((s=d[0]=d[0].slice(0)).length>2&&"ID"===(a=s[0]).type&&9===n.nodeType&&p&&e.relative[s[1].type]){if(!(n=(e.find.ID(a.matches[0].replace(Y,X),n)||[])[0]))return r;u&&(n=n.parentNode),t=t.slice(s.shift().value.length)}for(i=z.needsContext.test(t)?0:s.length;i--&&(a=s[i],!e.relative[l=a.type]);)if((c=e.find[l])&&(o=c(a.matches[0].replace(Y,X),K.test(s[0].type)&&at(n.parentNode)||n))){if(s.splice(i,1),!(t=o.length&&pt(s)))return g.apply(r,o),r;break}}return(u||mt(t,d))(o,n,!p,r,!n||K.test(t)&&at(n.parentNode)||n),r}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,v.sortStable=m.split("").sort(S).join("")===m,lt(),v.sortDetached=nt((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),T.find=Q,T.expr[":"]=T.expr.pseudos,T.unique=T.uniqueSort,Q.compile=mt,Q.select=yt,Q.setDocument=lt,Q.tokenize=ut,Q.escape=T.escapeSelector,Q.getText=T.text,Q.isXML=T.isXMLDoc,Q.selectors=T.expr,Q.support=T.support,Q.uniqueSort=T.uniqueSort}();var D=function(t,e,n){for(var r=[],o=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&T(t).is(n))break;r.push(t)}return r},R=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},H=T.expr.match.needsContext,F=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function V(t,e,n){return m(e)?T.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?T.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?T.grep(t,(function(t){return u.call(e,t)>-1!==n})):T.filter(e,t,n)}T.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?T.find.matchesSelector(r,t)?[r]:[]:T.find.matches(t,T.grep(e,(function(t){return 1===t.nodeType})))},T.fn.extend({find:function(t){var e,n,r=this.length,o=this;if("string"!=typeof t)return this.pushStack(T(t).filter((function(){for(e=0;e<r;e++)if(T.contains(o[e],this))return!0})));for(n=this.pushStack([]),e=0;e<r;e++)T.find(t,o[e],n);return r>1?T.uniqueSort(n):n},filter:function(t){return this.pushStack(V(this,t||[],!1))},not:function(t){return this.pushStack(V(this,t||[],!0))},is:function(t){return!!V(this,"string"==typeof t&&H.test(t)?T(t):t||[],!1).length}});var U,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(t,e,n){var r,o;if(!t)return this;if(n=n||U,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:B.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof T?e[0]:e,T.merge(this,T.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),F.test(r[1])&&T.isPlainObject(e))for(r in e)m(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(o=b.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):m(t)?void 0!==n.ready?n.ready(t):t(T):T.makeArray(t,this)}).prototype=T.fn,U=T(b);var z=/^(?:parents|prev(?:Until|All))/,W={children:!0,contents:!0,next:!0,prev:!0};function q(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}T.fn.extend({has:function(t){var e=T(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(T.contains(this,e[t]))return!0}))},closest:function(t,e){var n,r=0,o=this.length,i=[],s="string"!=typeof t&&T(t);if(!H.test(t))for(;r<o;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&T.find.matchesSelector(n,t))){i.push(n);break}return this.pushStack(i.length>1?T.uniqueSort(i):i)},index:function(t){return t?"string"==typeof t?u.call(T(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),T.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return D(t,"parentNode")},parentsUntil:function(t,e,n){return D(t,"parentNode",n)},next:function(t){return q(t,"nextSibling")},prev:function(t){return q(t,"previousSibling")},nextAll:function(t){return D(t,"nextSibling")},prevAll:function(t){return D(t,"previousSibling")},nextUntil:function(t,e,n){return D(t,"nextSibling",n)},prevUntil:function(t,e,n){return D(t,"previousSibling",n)},siblings:function(t){return R((t.parentNode||{}).firstChild,t)},children:function(t){return R(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(A(t,"template")&&(t=t.content||t),T.merge([],t.childNodes))}},(function(t,e){T.fn[t]=function(n,r){var o=T.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=T.filter(r,o)),this.length>1&&(W[t]||T.uniqueSort(o),z.test(t)&&o.reverse()),this.pushStack(o)}}));var G=/[^\x20\t\r\n\f]+/g;function K(t){return t}function Y(t){throw t}function X(t,e,n,r){var o;try{t&&m(o=t.promise)?o.call(t).done(e).fail(n):t&&m(o=t.then)?o.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}T.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return T.each(t.match(G)||[],(function(t,n){e[n]=!0})),e}(t):T.extend({},t);var e,n,r,o,i=[],s=[],a=-1,l=function(){for(o=o||t.once,r=e=!0;s.length;a=-1)for(n=s.shift();++a<i.length;)!1===i[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=i.length,n=!1);t.memory||(n=!1),e=!1,o&&(i=n?[]:"")},c={add:function(){return i&&(n&&!e&&(a=i.length-1,s.push(n)),function e(n){T.each(n,(function(n,r){m(r)?t.unique&&c.has(r)||i.push(r):r&&r.length&&"string"!==x(r)&&e(r)}))}(arguments),n&&!e&&l()),this},remove:function(){return T.each(arguments,(function(t,e){for(var n;(n=T.inArray(e,i,n))>-1;)i.splice(n,1),n<=a&&a--})),this},has:function(t){return t?T.inArray(t,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=s=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=s=[],n||e||(i=n=""),this},locked:function(){return!!o},fireWith:function(t,n){return o||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},T.extend({Deferred:function(t){var e=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},catch:function(t){return o.then(null,t)},pipe:function(){var t=arguments;return T.Deferred((function(n){T.each(e,(function(e,r){var o=m(t[r[4]])&&t[r[4]];i[r[1]]((function(){var t=o&&o.apply(this,arguments);t&&m(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,o){var i=0;function s(t,e,n,o){return function(){var a=this,l=arguments,c=function(){var r,c;if(!(t<i)){if((r=n.apply(a,l))===e.promise())throw new TypeError("Thenable self-resolution");c=r&&("object"==typeof r||"function"==typeof r)&&r.then,m(c)?o?c.call(r,s(i,e,K,o),s(i,e,Y,o)):(i++,c.call(r,s(i,e,K,o),s(i,e,Y,o),s(i,e,K,e.notifyWith))):(n!==K&&(a=void 0,l=[r]),(o||e.resolveWith)(a,l))}},u=o?c:function(){try{c()}catch(r){T.Deferred.exceptionHook&&T.Deferred.exceptionHook(r,u.error),t+1>=i&&(n!==Y&&(a=void 0,l=[r]),e.rejectWith(a,l))}};t?u():(T.Deferred.getErrorHook?u.error=T.Deferred.getErrorHook():T.Deferred.getStackHook&&(u.error=T.Deferred.getStackHook()),r.setTimeout(u))}}return T.Deferred((function(r){e[0][3].add(s(0,r,m(o)?o:K,r.notifyWith)),e[1][3].add(s(0,r,m(t)?t:K)),e[2][3].add(s(0,r,m(n)?n:Y))})).promise()},promise:function(t){return null!=t?T.extend(t,o):o}},i={};return T.each(e,(function(t,r){var s=r[2],a=r[5];o[r[1]]=s.add,a&&s.add((function(){n=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(r[3].fire),i[r[0]]=function(){return i[r[0]+"With"](this===i?void 0:this,arguments),this},i[r[0]+"With"]=s.fireWith})),o.promise(i),t&&t.call(i,i),i},when:function(t){var e=arguments.length,n=e,r=Array(n),o=a.call(arguments),i=T.Deferred(),s=function(t){return function(n){r[t]=this,o[t]=arguments.length>1?a.call(arguments):n,--e||i.resolveWith(r,o)}};if(e<=1&&(X(t,i.done(s(n)).resolve,i.reject,!e),"pending"===i.state()||m(o[n]&&o[n].then)))return i.then();for(;n--;)X(o[n],s(n),i.reject);return i.promise()}});var J=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(t,e){r.console&&r.console.warn&&t&&J.test(t.name)&&r.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},T.readyException=function(t){r.setTimeout((function(){throw t}))};var Z=T.Deferred();function Q(){b.removeEventListener("DOMContentLoaded",Q),r.removeEventListener("load",Q),T.ready()}T.fn.ready=function(t){return Z.then(t).catch((function(t){T.readyException(t)})),this},T.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--T.readyWait:T.isReady)||(T.isReady=!0,!0!==t&&--T.readyWait>0||Z.resolveWith(b,[T]))}}),T.ready.then=Z.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(T.ready):(b.addEventListener("DOMContentLoaded",Q),r.addEventListener("load",Q));var tt=function(t,e,n,r,o,i,s){var a=0,l=t.length,c=null==n;if("object"===x(n))for(a in o=!0,n)tt(t,e,a,n[a],!0,i,s);else if(void 0!==r&&(o=!0,m(r)||(s=!0),c&&(s?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(T(t),n)})),e))for(;a<l;a++)e(t[a],n,s?r:r.call(t[a],a,e(t[a],n)));return o?t:c?e.call(t):l?e(t[0],n):i},et=/^-ms-/,nt=/-([a-z])/g;function rt(t,e){return e.toUpperCase()}function ot(t){return t.replace(et,"ms-").replace(nt,rt)}var it=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function st(){this.expando=T.expando+st.uid++}st.uid=1,st.prototype={cache:function(t){var e=t[this.expando];return e||(e={},it(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,o=this.cache(t);if("string"==typeof e)o[ot(e)]=n;else for(r in e)o[ot(r)]=e[r];return o},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][ot(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map(ot):(e=ot(e))in r?[e]:e.match(G)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||T.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!T.isEmptyObject(e)}};var at=new st,lt=new st,ct=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ut=/[A-Z]/g;function pt(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(ut,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:ct.test(t)?JSON.parse(t):t)}(n)}catch(t){}lt.set(t,e,n)}else n=void 0;return n}T.extend({hasData:function(t){return lt.hasData(t)||at.hasData(t)},data:function(t,e,n){return lt.access(t,e,n)},removeData:function(t,e){lt.remove(t,e)},_data:function(t,e,n){return at.access(t,e,n)},_removeData:function(t,e){at.remove(t,e)}}),T.fn.extend({data:function(t,e){var n,r,o,i=this[0],s=i&&i.attributes;if(void 0===t){if(this.length&&(o=lt.get(i),1===i.nodeType&&!at.get(i,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=ot(r.slice(5)),pt(i,r,o[r]));at.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof t?this.each((function(){lt.set(this,t)})):tt(this,(function(e){var n;if(i&&void 0===e)return void 0!==(n=lt.get(i,t))||void 0!==(n=pt(i,t))?n:void 0;this.each((function(){lt.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){lt.remove(this,t)}))}}),T.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=at.get(t,e),n&&(!r||Array.isArray(n)?r=at.access(t,e,T.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=T.queue(t,e),r=n.length,o=n.shift(),i=T._queueHooks(t,e);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===e&&n.unshift("inprogress"),delete i.stop,o.call(t,(function(){T.dequeue(t,e)}),i)),!r&&i&&i.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return at.get(t,n)||at.access(t,n,{empty:T.Callbacks("once memory").add((function(){at.remove(t,[e+"queue",n])}))})}}),T.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?T.queue(this[0],t):void 0===e?this:this.each((function(){var n=T.queue(this,t,e);T._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&T.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){T.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,o=T.Deferred(),i=this,s=this.length,a=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=at.get(i[s],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),o.promise(e)}});var dt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ft=new RegExp("^(?:([+-])=|)("+dt+")([a-z%]*)$","i"),ht=["Top","Right","Bottom","Left"],gt=b.documentElement,vt=function(t){return T.contains(t.ownerDocument,t)},mt={composed:!0};gt.getRootNode&&(vt=function(t){return T.contains(t.ownerDocument,t)||t.getRootNode(mt)===t.ownerDocument});var yt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&vt(t)&&"none"===T.css(t,"display")};function bt(t,e,n,r){var o,i,s=20,a=r?function(){return r.cur()}:function(){return T.css(t,e,"")},l=a(),c=n&&n[3]||(T.cssNumber[e]?"":"px"),u=t.nodeType&&(T.cssNumber[e]||"px"!==c&&+l)&&ft.exec(T.css(t,e));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;s--;)T.style(t,e,u+c),(1-i)*(1-(i=a()/l||.5))<=0&&(s=0),u/=i;u*=2,T.style(t,e,u+c),n=n||[]}return n&&(u=+u||+l||0,o=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=o)),o}var wt={};function _t(t){var e,n=t.ownerDocument,r=t.nodeName,o=wt[r];return o||(e=n.body.appendChild(n.createElement(r)),o=T.css(e,"display"),e.parentNode.removeChild(e),"none"===o&&(o="block"),wt[r]=o,o)}function xt(t,e){for(var n,r,o=[],i=0,s=t.length;i<s;i++)(r=t[i]).style&&(n=r.style.display,e?("none"===n&&(o[i]=at.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&yt(r)&&(o[i]=_t(r))):"none"!==n&&(o[i]="none",at.set(r,"display",n)));for(i=0;i<s;i++)null!=o[i]&&(t[i].style.display=o[i]);return t}T.fn.extend({show:function(){return xt(this,!0)},hide:function(){return xt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){yt(this)?T(this).show():T(this).hide()}))}});var Ct,St,Tt=/^(?:checkbox|radio)$/i,Ot=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,At=/^$|^module$|\/(?:java|ecma)script/i;Ct=b.createDocumentFragment().appendChild(b.createElement("div")),(St=b.createElement("input")).setAttribute("type","radio"),St.setAttribute("checked","checked"),St.setAttribute("name","t"),Ct.appendChild(St),v.checkClone=Ct.cloneNode(!0).cloneNode(!0).lastChild.checked,Ct.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!Ct.cloneNode(!0).lastChild.defaultValue,Ct.innerHTML="<option></option>",v.option=!!Ct.lastChild;var Et={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function kt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&A(t,e)?T.merge([t],n):n}function Pt(t,e){for(var n=0,r=t.length;n<r;n++)at.set(t[n],"globalEval",!e||at.get(e[n],"globalEval"))}Et.tbody=Et.tfoot=Et.colgroup=Et.caption=Et.thead,Et.th=Et.td,v.option||(Et.optgroup=Et.option=[1,"<select multiple='multiple'>","</select>"]);var jt=/<|&#?\w+;/;function Mt(t,e,n,r,o){for(var i,s,a,l,c,u,p=e.createDocumentFragment(),d=[],f=0,h=t.length;f<h;f++)if((i=t[f])||0===i)if("object"===x(i))T.merge(d,i.nodeType?[i]:i);else if(jt.test(i)){for(s=s||p.appendChild(e.createElement("div")),a=(Ot.exec(i)||["",""])[1].toLowerCase(),l=Et[a]||Et._default,s.innerHTML=l[1]+T.htmlPrefilter(i)+l[2],u=l[0];u--;)s=s.lastChild;T.merge(d,s.childNodes),(s=p.firstChild).textContent=""}else d.push(e.createTextNode(i));for(p.textContent="",f=0;i=d[f++];)if(r&&T.inArray(i,r)>-1)o&&o.push(i);else if(c=vt(i),s=kt(p.appendChild(i),"script"),c&&Pt(s),n)for(u=0;i=s[u++];)At.test(i.type||"")&&n.push(i);return p}var Nt=/^([^.]*)(?:\.(.+)|)/;function Lt(){return!0}function It(){return!1}function $t(t,e,n,r,o,i){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(r=r||n,n=void 0),e)$t(t,a,n,r,e[a],i);return t}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=It;else if(!o)return t;return 1===i&&(s=o,o=function(t){return T().off(t),s.apply(this,arguments)},o.guid=s.guid||(s.guid=T.guid++)),t.each((function(){T.event.add(this,e,o,r,n)}))}function Dt(t,e,n){n?(at.set(t,e,!1),T.event.add(t,e,{namespace:!1,handler:function(t){var n,r=at.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(T.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=a.call(arguments),at.set(this,e,r),this[e](),n=at.get(this,e),at.set(this,e,!1),r!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else r&&(at.set(this,e,T.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Lt)}})):void 0===at.get(t,e)&&T.event.add(t,e,Lt)}T.event={global:{},add:function(t,e,n,r,o){var i,s,a,l,c,u,p,d,f,h,g,v=at.get(t);if(it(t))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&T.find.matchesSelector(gt,o),n.guid||(n.guid=T.guid++),(l=v.events)||(l=v.events=Object.create(null)),(s=v.handle)||(s=v.handle=function(e){return void 0!==T&&T.event.triggered!==e.type?T.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(G)||[""]).length;c--;)f=g=(a=Nt.exec(e[c])||[])[1],h=(a[2]||"").split(".").sort(),f&&(p=T.event.special[f]||{},f=(o?p.delegateType:p.bindType)||f,p=T.event.special[f]||{},u=T.extend({type:f,origType:g,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&T.expr.match.needsContext.test(o),namespace:h.join(".")},i),(d=l[f])||((d=l[f]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(t,r,h,s)||t.addEventListener&&t.addEventListener(f,s)),p.add&&(p.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),o?d.splice(d.delegateCount++,0,u):d.push(u),T.event.global[f]=!0)},remove:function(t,e,n,r,o){var i,s,a,l,c,u,p,d,f,h,g,v=at.hasData(t)&&at.get(t);if(v&&(l=v.events)){for(c=(e=(e||"").match(G)||[""]).length;c--;)if(f=g=(a=Nt.exec(e[c])||[])[1],h=(a[2]||"").split(".").sort(),f){for(p=T.event.special[f]||{},d=l[f=(r?p.delegateType:p.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=i=d.length;i--;)u=d[i],!o&&g!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(d.splice(i,1),u.selector&&d.delegateCount--,p.remove&&p.remove.call(t,u));s&&!d.length&&(p.teardown&&!1!==p.teardown.call(t,h,v.handle)||T.removeEvent(t,f,v.handle),delete l[f])}else for(f in l)T.event.remove(t,f+e[c],n,r,!0);T.isEmptyObject(l)&&at.remove(t,"handle events")}},dispatch:function(t){var e,n,r,o,i,s,a=new Array(arguments.length),l=T.event.fix(t),c=(at.get(this,"events")||Object.create(null))[l.type]||[],u=T.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(s=T.event.handlers.call(this,l,c),e=0;(o=s[e++])&&!l.isPropagationStopped();)for(l.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==i.namespace&&!l.rnamespace.test(i.namespace)||(l.handleObj=i,l.data=i.data,void 0!==(r=((T.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,a))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,r,o,i,s,a=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(i=[],s={},n=0;n<l;n++)void 0===s[o=(r=e[n]).selector+" "]&&(s[o]=r.needsContext?T(o,this).index(c)>-1:T.find(o,this,null,[c]).length),s[o]&&i.push(r);i.length&&a.push({elem:c,handlers:i})}return c=this,l<e.length&&a.push({elem:c,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(T.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[T.expando]?t:new T.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return Tt.test(e.type)&&e.click&&A(e,"input")&&Dt(e,"click",!0),!1},trigger:function(t){var e=this||t;return Tt.test(e.type)&&e.click&&A(e,"input")&&Dt(e,"click"),!0},_default:function(t){var e=t.target;return Tt.test(e.type)&&e.click&&A(e,"input")&&at.get(e,"click")||A(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},T.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},T.Event=function(t,e){if(!(this instanceof T.Event))return new T.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Lt:It,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&T.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[T.expando]=!0},T.Event.prototype={constructor:T.Event,isDefaultPrevented:It,isPropagationStopped:It,isImmediatePropagationStopped:It,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Lt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Lt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Lt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},T.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},T.event.addProp),T.each({focus:"focusin",blur:"focusout"},(function(t,e){function n(t){if(b.documentMode){var n=at.get(this,"handle"),r=T.event.fix(t);r.type="focusin"===t.type?"focus":"blur",r.isSimulated=!0,n(t),r.target===r.currentTarget&&n(r)}else T.event.simulate(e,t.target,T.event.fix(t))}T.event.special[t]={setup:function(){var r;if(Dt(this,t,!0),!b.documentMode)return!1;(r=at.get(this,e))||this.addEventListener(e,n),at.set(this,e,(r||0)+1)},trigger:function(){return Dt(this,t),!0},teardown:function(){var t;if(!b.documentMode)return!1;(t=at.get(this,e)-1)?at.set(this,e,t):(this.removeEventListener(e,n),at.remove(this,e))},_default:function(e){return at.get(e.target,t)},delegateType:e},T.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,o=b.documentMode?this:r,i=at.get(o,e);i||(b.documentMode?this.addEventListener(e,n):r.addEventListener(t,n,!0)),at.set(o,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=b.documentMode?this:r,i=at.get(o,e)-1;i?at.set(o,e,i):(b.documentMode?this.removeEventListener(e,n):r.removeEventListener(t,n,!0),at.remove(o,e))}}})),T.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){T.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=t.relatedTarget,o=t.handleObj;return r&&(r===this||T.contains(this,r))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}})),T.fn.extend({on:function(t,e,n,r){return $t(this,t,e,n,r)},one:function(t,e,n,r){return $t(this,t,e,n,r,1)},off:function(t,e,n){var r,o;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,T(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=It),this.each((function(){T.event.remove(this,t,n,e)}))}});var Rt=/<script|<style|<link/i,Ht=/checked\s*(?:[^=]|=\s*.checked.)/i,Ft=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Vt(t,e){return A(t,"table")&&A(11!==e.nodeType?e:e.firstChild,"tr")&&T(t).children("tbody")[0]||t}function Ut(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Bt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function zt(t,e){var n,r,o,i,s,a;if(1===e.nodeType){if(at.hasData(t)&&(a=at.get(t).events))for(o in at.remove(e,"handle events"),a)for(n=0,r=a[o].length;n<r;n++)T.event.add(e,o,a[o][n]);lt.hasData(t)&&(i=lt.access(t),s=T.extend({},i),lt.set(e,s))}}function Wt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&Tt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function qt(t,e,n,r){e=l(e);var o,i,s,a,c,u,p=0,d=t.length,f=d-1,h=e[0],g=m(h);if(g||d>1&&"string"==typeof h&&!v.checkClone&&Ht.test(h))return t.each((function(o){var i=t.eq(o);g&&(e[0]=h.call(this,o,i.html())),qt(i,e,n,r)}));if(d&&(i=(o=Mt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(a=(s=T.map(kt(o,"script"),Ut)).length;p<d;p++)c=o,p!==f&&(c=T.clone(c,!0,!0),a&&T.merge(s,kt(c,"script"))),n.call(t[p],c,p);if(a)for(u=s[s.length-1].ownerDocument,T.map(s,Bt),p=0;p<a;p++)c=s[p],At.test(c.type||"")&&!at.access(c,"globalEval")&&T.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?T._evalUrl&&!c.noModule&&T._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):_(c.textContent.replace(Ft,""),c,u))}return t}function Gt(t,e,n){for(var r,o=e?T.filter(e,t):t,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||T.cleanData(kt(r)),r.parentNode&&(n&&vt(r)&&Pt(kt(r,"script")),r.parentNode.removeChild(r));return t}T.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,o,i,s,a=t.cloneNode(!0),l=vt(t);if(!(v.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||T.isXMLDoc(t)))for(s=kt(a),r=0,o=(i=kt(t)).length;r<o;r++)Wt(i[r],s[r]);if(e)if(n)for(i=i||kt(t),s=s||kt(a),r=0,o=i.length;r<o;r++)zt(i[r],s[r]);else zt(t,a);return(s=kt(a,"script")).length>0&&Pt(s,!l&&kt(t,"script")),a},cleanData:function(t){for(var e,n,r,o=T.event.special,i=0;void 0!==(n=t[i]);i++)if(it(n)){if(e=n[at.expando]){if(e.events)for(r in e.events)o[r]?T.event.remove(n,r):T.removeEvent(n,r,e.handle);n[at.expando]=void 0}n[lt.expando]&&(n[lt.expando]=void 0)}}}),T.fn.extend({detach:function(t){return Gt(this,t,!0)},remove:function(t){return Gt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?T.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return qt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Vt(this,t).appendChild(t)}))},prepend:function(){return qt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Vt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(T.cleanData(kt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return T.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Rt.test(t)&&!Et[(Ot.exec(t)||["",""])[1].toLowerCase()]){t=T.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(T.cleanData(kt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return qt(this,arguments,(function(e){var n=this.parentNode;T.inArray(this,t)<0&&(T.cleanData(kt(this)),n&&n.replaceChild(e,this))}),t)}}),T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){T.fn[t]=function(t){for(var n,r=[],o=T(t),i=o.length-1,s=0;s<=i;s++)n=s===i?this:this.clone(!0),T(o[s])[e](n),c.apply(r,n.get());return this.pushStack(r)}}));var Kt=new RegExp("^("+dt+")(?!px)[a-z%]+$","i"),Yt=/^--/,Xt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=r),e.getComputedStyle(t)},Jt=function(t,e,n){var r,o,i={};for(o in e)i[o]=t.style[o],t.style[o]=e[o];for(o in r=n.call(t),e)t.style[o]=i[o];return r},Zt=new RegExp(ht.join("|"),"i");function Qt(t,e,n){var r,o,i,s,a=Yt.test(e),l=t.style;return(n=n||Xt(t))&&(s=n.getPropertyValue(e)||n[e],a&&s&&(s=s.replace(M,"$1")||void 0),""!==s||vt(t)||(s=T.style(t,e)),!v.pixelBoxStyles()&&Kt.test(s)&&Zt.test(e)&&(r=l.width,o=l.minWidth,i=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=n.width,l.width=r,l.minWidth=o,l.maxWidth=i)),void 0!==s?s+"":s}function te(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",gt.appendChild(c).appendChild(u);var t=r.getComputedStyle(u);n="1%"!==t.top,l=12===e(t.marginLeft),u.style.right="60%",s=36===e(t.right),o=36===e(t.width),u.style.position="absolute",i=12===e(u.offsetWidth/3),gt.removeChild(c),u=null}}function e(t){return Math.round(parseFloat(t))}var n,o,i,s,a,l,c=b.createElement("div"),u=b.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===u.style.backgroundClip,T.extend(v,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),i},reliableTrDimensions:function(){var t,e,n,o;return null==a&&(t=b.createElement("table"),e=b.createElement("tr"),n=b.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="box-sizing:content-box;border:1px solid",e.style.height="1px",n.style.height="9px",n.style.display="block",gt.appendChild(t).appendChild(e).appendChild(n),o=r.getComputedStyle(e),a=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===e.offsetHeight,gt.removeChild(t)),a}}))}();var ee=["Webkit","Moz","ms"],ne=b.createElement("div").style,re={};function oe(t){return T.cssProps[t]||re[t]||(t in ne?t:re[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=ee.length;n--;)if((t=ee[n]+e)in ne)return t}(t)||t)}var ie=/^(none|table(?!-c[ea]).+)/,se={position:"absolute",visibility:"hidden",display:"block"},ae={letterSpacing:"0",fontWeight:"400"};function le(t,e,n){var r=ft.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function ce(t,e,n,r,o,i){var s="width"===e?1:0,a=0,l=0,c=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(c+=T.css(t,n+ht[s],!0,o)),r?("content"===n&&(l-=T.css(t,"padding"+ht[s],!0,o)),"margin"!==n&&(l-=T.css(t,"border"+ht[s]+"Width",!0,o))):(l+=T.css(t,"padding"+ht[s],!0,o),"padding"!==n?l+=T.css(t,"border"+ht[s]+"Width",!0,o):a+=T.css(t,"border"+ht[s]+"Width",!0,o));return!r&&i>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-i-l-a-.5))||0),l+c}function ue(t,e,n){var r=Xt(t),o=(!v.boxSizingReliable()||n)&&"border-box"===T.css(t,"boxSizing",!1,r),i=o,s=Qt(t,e,r),a="offset"+e[0].toUpperCase()+e.slice(1);if(Kt.test(s)){if(!n)return s;s="auto"}return(!v.boxSizingReliable()&&o||!v.reliableTrDimensions()&&A(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===T.css(t,"display",!1,r))&&t.getClientRects().length&&(o="border-box"===T.css(t,"boxSizing",!1,r),(i=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+ce(t,e,n||(o?"border":"content"),i,r,s)+"px"}function pe(t,e,n,r,o){return new pe.prototype.init(t,e,n,r,o)}T.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,i,s,a=ot(e),l=Yt.test(e),c=t.style;if(l||(e=oe(a)),s=T.cssHooks[e]||T.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(o=s.get(t,!1,r))?o:c[e];"string"==(i=typeof n)&&(o=ft.exec(n))&&o[1]&&(n=bt(t,e,o),i="number"),null!=n&&n==n&&("number"!==i||l||(n+=o&&o[3]||(T.cssNumber[a]?"":"px")),v.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,r))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var o,i,s,a=ot(e);return Yt.test(e)||(e=oe(a)),(s=T.cssHooks[e]||T.cssHooks[a])&&"get"in s&&(o=s.get(t,!0,n)),void 0===o&&(o=Qt(t,e,r)),"normal"===o&&e in ae&&(o=ae[e]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),T.each(["height","width"],(function(t,e){T.cssHooks[e]={get:function(t,n,r){if(n)return!ie.test(T.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ue(t,e,r):Jt(t,se,(function(){return ue(t,e,r)}))},set:function(t,n,r){var o,i=Xt(t),s=!v.scrollboxSize()&&"absolute"===i.position,a=(s||r)&&"border-box"===T.css(t,"boxSizing",!1,i),l=r?ce(t,e,r,a,i):0;return a&&s&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(i[e])-ce(t,e,"border",!1,i)-.5)),l&&(o=ft.exec(n))&&"px"!==(o[3]||"px")&&(t.style[e]=n,n=T.css(t,e)),le(0,n,l)}}})),T.cssHooks.marginLeft=te(v.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Qt(t,"marginLeft"))||t.getBoundingClientRect().left-Jt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),T.each({margin:"",padding:"",border:"Width"},(function(t,e){T.cssHooks[t+e]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[t+ht[r]+e]=i[r]||i[r-2]||i[0];return o}},"margin"!==t&&(T.cssHooks[t+e].set=le)})),T.fn.extend({css:function(t,e){return tt(this,(function(t,e,n){var r,o,i={},s=0;if(Array.isArray(e)){for(r=Xt(t),o=e.length;s<o;s++)i[e[s]]=T.css(t,e[s],!1,r);return i}return void 0!==n?T.style(t,e,n):T.css(t,e)}),t,e,arguments.length>1)}}),T.Tween=pe,pe.prototype={constructor:pe,init:function(t,e,n,r,o,i){this.elem=t,this.prop=n,this.easing=o||T.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=i||(T.cssNumber[n]?"":"px")},cur:function(){var t=pe.propHooks[this.prop];return t&&t.get?t.get(this):pe.propHooks._default.get(this)},run:function(t){var e,n=pe.propHooks[this.prop];return this.options.duration?this.pos=e=T.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):pe.propHooks._default.set(this),this}},pe.prototype.init.prototype=pe.prototype,pe.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=T.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){T.fx.step[t.prop]?T.fx.step[t.prop](t):1!==t.elem.nodeType||!T.cssHooks[t.prop]&&null==t.elem.style[oe(t.prop)]?t.elem[t.prop]=t.now:T.style(t.elem,t.prop,t.now+t.unit)}}},pe.propHooks.scrollTop=pe.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},T.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},T.fx=pe.prototype.init,T.fx.step={};var de,fe,he=/^(?:toggle|show|hide)$/,ge=/queueHooks$/;function ve(){fe&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ve):r.setTimeout(ve,T.fx.interval),T.fx.tick())}function me(){return r.setTimeout((function(){de=void 0})),de=Date.now()}function ye(t,e){var n,r=0,o={height:t};for(e=e?1:0;r<4;r+=2-e)o["margin"+(n=ht[r])]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function be(t,e,n){for(var r,o=(we.tweeners[e]||[]).concat(we.tweeners["*"]),i=0,s=o.length;i<s;i++)if(r=o[i].call(n,e,t))return r}function we(t,e,n){var r,o,i=0,s=we.prefilters.length,a=T.Deferred().always((function(){delete l.elem})),l=function(){if(o)return!1;for(var e=de||me(),n=Math.max(0,c.startTime+c.duration-e),r=1-(n/c.duration||0),i=0,s=c.tweens.length;i<s;i++)c.tweens[i].run(r);return a.notifyWith(t,[c,r,n]),r<1&&s?n:(s||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:T.extend({},e),opts:T.extend(!0,{specialEasing:{},easing:T.easing._default},n),originalProperties:e,originalOptions:n,startTime:de||me(),duration:n.duration,tweens:[],createTween:function(e,n){var r=T.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(r),r},stop:function(e){var n=0,r=e?c.tweens.length:0;if(o)return this;for(o=!0;n<r;n++)c.tweens[n].run(1);return e?(a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c,e])):a.rejectWith(t,[c,e]),this}}),u=c.props;for(function(t,e){var n,r,o,i,s;for(n in t)if(o=e[r=ot(n)],i=t[n],Array.isArray(i)&&(o=i[1],i=t[n]=i[0]),n!==r&&(t[r]=i,delete t[n]),(s=T.cssHooks[r])&&"expand"in s)for(n in i=s.expand(i),delete t[r],i)n in t||(t[n]=i[n],e[n]=o);else e[r]=o}(u,c.opts.specialEasing);i<s;i++)if(r=we.prefilters[i].call(c,t,u,c.opts))return m(r.stop)&&(T._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return T.map(u,be,c),m(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),T.fx.timer(T.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}T.Animation=T.extend(we,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return bt(n.elem,t,ft.exec(e),n),n}]},tweener:function(t,e){m(t)?(e=t,t=["*"]):t=t.match(G);for(var n,r=0,o=t.length;r<o;r++)n=t[r],we.tweeners[n]=we.tweeners[n]||[],we.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,o,i,s,a,l,c,u,p="width"in e||"height"in e,d=this,f={},h=t.style,g=t.nodeType&&yt(t),v=at.get(t,"fxshow");for(r in n.queue||(null==(s=T._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always((function(){d.always((function(){s.unqueued--,T.queue(t,"fx").length||s.empty.fire()}))}))),e)if(o=e[r],he.test(o)){if(delete e[r],i=i||"toggle"===o,o===(g?"hide":"show")){if("show"!==o||!v||void 0===v[r])continue;g=!0}f[r]=v&&v[r]||T.style(t,r)}if((l=!T.isEmptyObject(e))||!T.isEmptyObject(f))for(r in p&&1===t.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(c=v&&v.display)&&(c=at.get(t,"display")),"none"===(u=T.css(t,"display"))&&(c?u=c:(xt([t],!0),c=t.style.display||c,u=T.css(t,"display"),xt([t]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===T.css(t,"float")&&(l||(d.done((function(){h.display=c})),null==c&&(u=h.display,c="none"===u?"":u)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always((function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}))),l=!1,f)l||(v?"hidden"in v&&(g=v.hidden):v=at.access(t,"fxshow",{display:c}),i&&(v.hidden=!g),g&&xt([t],!0),d.done((function(){for(r in g||xt([t]),at.remove(t,"fxshow"),f)T.style(t,r,f[r])}))),l=be(g?v[r]:0,r,d),r in v||(v[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?we.prefilters.unshift(t):we.prefilters.push(t)}}),T.speed=function(t,e,n){var r=t&&"object"==typeof t?T.extend({},t):{complete:n||!n&&e||m(t)&&t,duration:t,easing:n&&e||e&&!m(e)&&e};return T.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in T.fx.speeds?r.duration=T.fx.speeds[r.duration]:r.duration=T.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&T.dequeue(this,r.queue)},r},T.fn.extend({fadeTo:function(t,e,n,r){return this.filter(yt).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var o=T.isEmptyObject(t),i=T.speed(e,n,r),s=function(){var e=we(this,T.extend({},t),i);(o||at.get(this,"finish"))&&e.stop(!0)};return s.finish=s,o||!1===i.queue?this.each(s):this.queue(i.queue,s)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,o=null!=t&&t+"queueHooks",i=T.timers,s=at.get(this);if(o)s[o]&&s[o].stop&&r(s[o]);else for(o in s)s[o]&&s[o].stop&&ge.test(o)&&r(s[o]);for(o=i.length;o--;)i[o].elem!==this||null!=t&&i[o].queue!==t||(i[o].anim.stop(n),e=!1,i.splice(o,1));!e&&n||T.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=at.get(this),r=n[t+"queue"],o=n[t+"queueHooks"],i=T.timers,s=r?r.length:0;for(n.finish=!0,T.queue(this,t,[]),o&&o.stop&&o.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===t&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<s;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish}))}}),T.each(["toggle","show","hide"],(function(t,e){var n=T.fn[e];T.fn[e]=function(t,r,o){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(ye(e,!0),t,r,o)}})),T.each({slideDown:ye("show"),slideUp:ye("hide"),slideToggle:ye("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){T.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}})),T.timers=[],T.fx.tick=function(){var t,e=0,n=T.timers;for(de=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||T.fx.stop(),de=void 0},T.fx.timer=function(t){T.timers.push(t),T.fx.start()},T.fx.interval=13,T.fx.start=function(){fe||(fe=!0,ve())},T.fx.stop=function(){fe=null},T.fx.speeds={slow:600,fast:200,_default:400},T.fn.delay=function(t,e){return t=T.fx&&T.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,n){var o=r.setTimeout(e,t);n.stop=function(){r.clearTimeout(o)}}))},function(){var t=b.createElement("input"),e=b.createElement("select").appendChild(b.createElement("option"));t.type="checkbox",v.checkOn=""!==t.value,v.optSelected=e.selected,(t=b.createElement("input")).value="t",t.type="radio",v.radioValue="t"===t.value}();var _e,xe=T.expr.attrHandle;T.fn.extend({attr:function(t,e){return tt(this,T.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){T.removeAttr(this,t)}))}}),T.extend({attr:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===t.getAttribute?T.prop(t,e,n):(1===i&&T.isXMLDoc(t)||(o=T.attrHooks[e.toLowerCase()]||(T.expr.match.bool.test(e)?_e:void 0)),void 0!==n?null===n?void T.removeAttr(t,e):o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:(t.setAttribute(e,n+""),n):o&&"get"in o&&null!==(r=o.get(t,e))?r:null==(r=T.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&A(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,o=e&&e.match(G);if(o&&1===t.nodeType)for(;n=o[r++];)t.removeAttribute(n)}}),_e={set:function(t,e,n){return!1===e?T.removeAttr(t,n):t.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=xe[e]||T.find.attr;xe[e]=function(t,e,r){var o,i,s=e.toLowerCase();return r||(i=xe[s],xe[s]=o,o=null!=n(t,e,r)?s:null,xe[s]=i),o}}));var Ce=/^(?:input|select|textarea|button)$/i,Se=/^(?:a|area)$/i;function Te(t){return(t.match(G)||[]).join(" ")}function Oe(t){return t.getAttribute&&t.getAttribute("class")||""}function Ae(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(G)||[]}T.fn.extend({prop:function(t,e){return tt(this,T.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[T.propFix[t]||t]}))}}),T.extend({prop:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&T.isXMLDoc(t)||(e=T.propFix[e]||e,o=T.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:t[e]=n:o&&"get"in o&&null!==(r=o.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=T.find.attr(t,"tabindex");return e?parseInt(e,10):Ce.test(t.nodeName)||Se.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(T.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){T.propFix[this.toLowerCase()]=this})),T.fn.extend({addClass:function(t){var e,n,r,o,i,s;return m(t)?this.each((function(e){T(this).addClass(t.call(this,e,Oe(this)))})):(e=Ae(t)).length?this.each((function(){if(r=Oe(this),n=1===this.nodeType&&" "+Te(r)+" "){for(i=0;i<e.length;i++)o=e[i],n.indexOf(" "+o+" ")<0&&(n+=o+" ");s=Te(n),r!==s&&this.setAttribute("class",s)}})):this},removeClass:function(t){var e,n,r,o,i,s;return m(t)?this.each((function(e){T(this).removeClass(t.call(this,e,Oe(this)))})):arguments.length?(e=Ae(t)).length?this.each((function(){if(r=Oe(this),n=1===this.nodeType&&" "+Te(r)+" "){for(i=0;i<e.length;i++)for(o=e[i];n.indexOf(" "+o+" ")>-1;)n=n.replace(" "+o+" "," ");s=Te(n),r!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(t,e){var n,r,o,i,s=typeof t,a="string"===s||Array.isArray(t);return m(t)?this.each((function(n){T(this).toggleClass(t.call(this,n,Oe(this),e),e)})):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(n=Ae(t),this.each((function(){if(a)for(i=T(this),o=0;o<n.length;o++)r=n[o],i.hasClass(r)?i.removeClass(r):i.addClass(r);else void 0!==t&&"boolean"!==s||((r=Oe(this))&&at.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":at.get(this,"__className__")||""))})))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+Te(Oe(n))+" ").indexOf(e)>-1)return!0;return!1}});var Ee=/\r/g;T.fn.extend({val:function(t){var e,n,r,o=this[0];return arguments.length?(r=m(t),this.each((function(n){var o;1===this.nodeType&&(null==(o=r?t.call(this,n,T(this).val()):t)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=T.map(o,(function(t){return null==t?"":t+""}))),(e=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))}))):o?(e=T.valHooks[o.type]||T.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(Ee,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(t){var e=T.find.attr(t,"value");return null!=e?e:Te(T.text(t))}},select:{get:function(t){var e,n,r,o=t.options,i=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?i+1:o.length;for(r=i<0?l:s?i:0;r<l;r++)if(((n=o[r]).selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(e=T(n).val(),s)return e;a.push(e)}return a},set:function(t,e){for(var n,r,o=t.options,i=T.makeArray(e),s=o.length;s--;)((r=o[s]).selected=T.inArray(T.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(t.selectedIndex=-1),i}}}}),T.each(["radio","checkbox"],(function(){T.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=T.inArray(T(t).val(),e)>-1}},v.checkOn||(T.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var ke=r.location,Pe={guid:Date.now()},je=/\?/;T.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||T.error("Invalid XML: "+(n?T.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Me=/^(?:focusinfocus|focusoutblur)$/,Ne=function(t){t.stopPropagation()};T.extend(T.event,{trigger:function(t,e,n,o){var i,s,a,l,c,u,p,d,h=[n||b],g=f.call(t,"type")?t.type:t,v=f.call(t,"namespace")?t.namespace.split("."):[];if(s=d=a=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!Me.test(g+T.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),c=g.indexOf(":")<0&&"on"+g,(t=t[T.expando]?t:new T.Event(g,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:T.makeArray(e,[t]),p=T.event.special[g]||{},o||!p.trigger||!1!==p.trigger.apply(n,e))){if(!o&&!p.noBubble&&!y(n)){for(l=p.delegateType||g,Me.test(l+g)||(s=s.parentNode);s;s=s.parentNode)h.push(s),a=s;a===(n.ownerDocument||b)&&h.push(a.defaultView||a.parentWindow||r)}for(i=0;(s=h[i++])&&!t.isPropagationStopped();)d=s,t.type=i>1?l:p.bindType||g,(u=(at.get(s,"events")||Object.create(null))[t.type]&&at.get(s,"handle"))&&u.apply(s,e),(u=c&&s[c])&&u.apply&&it(s)&&(t.result=u.apply(s,e),!1===t.result&&t.preventDefault());return t.type=g,o||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(h.pop(),e)||!it(n)||c&&m(n[g])&&!y(n)&&((a=n[c])&&(n[c]=null),T.event.triggered=g,t.isPropagationStopped()&&d.addEventListener(g,Ne),n[g](),t.isPropagationStopped()&&d.removeEventListener(g,Ne),T.event.triggered=void 0,a&&(n[c]=a)),t.result}},simulate:function(t,e,n){var r=T.extend(new T.Event,n,{type:t,isSimulated:!0});T.event.trigger(r,null,e)}}),T.fn.extend({trigger:function(t,e){return this.each((function(){T.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return T.event.trigger(t,e,n,!0)}});var Le=/\[\]$/,Ie=/\r?\n/g,$e=/^(?:submit|button|image|reset|file)$/i,De=/^(?:input|select|textarea|keygen)/i;function Re(t,e,n,r){var o;if(Array.isArray(e))T.each(e,(function(e,o){n||Le.test(t)?r(t,o):Re(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,n,r)}));else if(n||"object"!==x(e))r(t,e);else for(o in e)Re(t+"["+o+"]",e[o],n,r)}T.param=function(t,e){var n,r=[],o=function(t,e){var n=m(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!T.isPlainObject(t))T.each(t,(function(){o(this.name,this.value)}));else for(n in t)Re(n,t[n],e,o);return r.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=T.prop(this,"elements");return t?T.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!T(this).is(":disabled")&&De.test(this.nodeName)&&!$e.test(t)&&(this.checked||!Tt.test(t))})).map((function(t,e){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,(function(t){return{name:e.name,value:t.replace(Ie,"\r\n")}})):{name:e.name,value:n.replace(Ie,"\r\n")}})).get()}});var He=/%20/g,Fe=/#.*$/,Ve=/([?&])_=[^&]*/,Ue=/^(.*?):[ \t]*([^\r\n]*)$/gm,Be=/^(?:GET|HEAD)$/,ze=/^\/\//,We={},qe={},Ge="*/".concat("*"),Ke=b.createElement("a");function Ye(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,o=0,i=e.toLowerCase().match(G)||[];if(m(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Xe(t,e,n,r){var o={},i=t===qe;function s(a){var l;return o[a]=!0,T.each(t[a]||[],(function(t,a){var c=a(e,n,r);return"string"!=typeof c||i||o[c]?i?!(l=c):void 0:(e.dataTypes.unshift(c),s(c),!1)})),l}return s(e.dataTypes[0])||!o["*"]&&s("*")}function Je(t,e){var n,r,o=T.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:r||(r={}))[n]=e[n]);return r&&T.extend(!0,t,r),t}Ke.href=ke.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ge,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Je(Je(t,T.ajaxSettings),e):Je(T.ajaxSettings,t)},ajaxPrefilter:Ye(We),ajaxTransport:Ye(qe),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,o,i,s,a,l,c,u,p,d,f=T.ajaxSetup({},e),h=f.context||f,g=f.context&&(h.nodeType||h.jquery)?T(h):T.event,v=T.Deferred(),m=T.Callbacks("once memory"),y=f.statusCode||{},w={},_={},x="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(c){if(!s)for(s={};e=Ue.exec(i);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?i:null},setRequestHeader:function(t,e){return null==c&&(t=_[t.toLowerCase()]=_[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)C.always(t[C.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||x;return n&&n.abort(e),S(0,e),this}};if(v.promise(C),f.url=((t||f.url||ke.href)+"").replace(ze,ke.protocol+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(G)||[""],null==f.crossDomain){l=b.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ke.protocol+"//"+Ke.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=T.param(f.data,f.traditional)),Xe(We,f,e,C),c)return C;for(p in(u=T.event&&f.global)&&0==T.active++&&T.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Be.test(f.type),o=f.url.replace(Fe,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(He,"+")):(d=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(je.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(Ve,"$1"),d=(je.test(o)?"&":"?")+"_="+Pe.guid+++d),f.url=o+d),f.ifModified&&(T.lastModified[o]&&C.setRequestHeader("If-Modified-Since",T.lastModified[o]),T.etag[o]&&C.setRequestHeader("If-None-Match",T.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||e.contentType)&&C.setRequestHeader("Content-Type",f.contentType),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ge+"; q=0.01":""):f.accepts["*"]),f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(h,C,f)||c))return C.abort();if(x="abort",m.add(f.complete),C.done(f.success),C.fail(f.error),n=Xe(qe,f,e,C)){if(C.readyState=1,u&&g.trigger("ajaxSend",[C,f]),c)return C;f.async&&f.timeout>0&&(a=r.setTimeout((function(){C.abort("timeout")}),f.timeout));try{c=!1,n.send(w,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,s,l){var p,d,b,w,_,x=e;c||(c=!0,a&&r.clearTimeout(a),n=void 0,i=l||"",C.readyState=t>0?4:0,p=t>=200&&t<300||304===t,s&&(w=function(t,e,n){for(var r,o,i,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(o in a)if(a[o]&&a[o].test(r)){l.unshift(o);break}if(l[0]in n)i=l[0];else{for(o in n){if(!l[0]||t.converters[o+" "+l[0]]){i=o;break}s||(s=o)}i=i||s}if(i)return i!==l[0]&&l.unshift(i),n[i]}(f,C,s)),!p&&T.inArray("script",f.dataTypes)>-1&&T.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),w=function(t,e,n,r){var o,i,s,a,l,c={},u=t.dataTypes.slice();if(u[1])for(s in t.converters)c[s.toLowerCase()]=t.converters[s];for(i=u.shift();i;)if(t.responseFields[i]&&(n[t.responseFields[i]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=i,i=u.shift())if("*"===i)i=l;else if("*"!==l&&l!==i){if(!(s=c[l+" "+i]||c["* "+i]))for(o in c)if((a=o.split(" "))[1]===i&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[o]:!0!==c[o]&&(i=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+i}}}return{state:"success",data:e}}(f,w,C,p),p?(f.ifModified&&((_=C.getResponseHeader("Last-Modified"))&&(T.lastModified[o]=_),(_=C.getResponseHeader("etag"))&&(T.etag[o]=_)),204===t||"HEAD"===f.type?x="nocontent":304===t?x="notmodified":(x=w.state,d=w.data,p=!(b=w.error))):(b=x,!t&&x||(x="error",t<0&&(t=0))),C.status=t,C.statusText=(e||x)+"",p?v.resolveWith(h,[d,x,C]):v.rejectWith(h,[C,x,b]),C.statusCode(y),y=void 0,u&&g.trigger(p?"ajaxSuccess":"ajaxError",[C,f,p?d:b]),m.fireWith(h,[C,x]),u&&(g.trigger("ajaxComplete",[C,f]),--T.active||T.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,n){return T.get(t,e,n,"json")},getScript:function(t,e){return T.get(t,void 0,e,"script")}}),T.each(["get","post"],(function(t,e){T[e]=function(t,n,r,o){return m(n)&&(o=o||r,r=n,n=void 0),T.ajax(T.extend({url:t,type:e,dataType:o,data:n,success:r},T.isPlainObject(t)&&t))}})),T.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),T._evalUrl=function(t,e,n){return T.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){T.globalEval(t,e,n)}})},T.fn.extend({wrapAll:function(t){var e;return this[0]&&(m(t)&&(t=t.call(this[0])),e=T(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return m(t)?this.each((function(e){T(this).wrapInner(t.call(this,e))})):this.each((function(){var e=T(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=m(t);return this.each((function(n){T(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){T(this).replaceWith(this.childNodes)})),this}}),T.expr.pseudos.hidden=function(t){return!T.expr.pseudos.visible(t)},T.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Ze={0:200,1223:204},Qe=T.ajaxSettings.xhr();v.cors=!!Qe&&"withCredentials"in Qe,v.ajax=Qe=!!Qe,T.ajaxTransport((function(t){var e,n;if(v.cors||Qe&&!t.crossDomain)return{send:function(o,i){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)a.setRequestHeader(s,o[s]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?i(0,"error"):i(a.status,a.statusText):i(Ze[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),T.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return T.globalEval(t),t}}}),T.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),T.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,o){e=T("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&o("error"===t.type?404:200,t.type)}),b.head.appendChild(e[0])},abort:function(){n&&n()}}}));var tn,en=[],nn=/(=)\?(?=&|$)|\?\?/;T.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=en.pop()||T.expando+"_"+Pe.guid++;return this[t]=!0,t}}),T.ajaxPrefilter("json jsonp",(function(t,e,n){var o,i,s,a=!1!==t.jsonp&&(nn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(nn,"$1"+o):!1!==t.jsonp&&(t.url+=(je.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return s||T.error(o+" was not called"),s[0]},t.dataTypes[0]="json",i=r[o],r[o]=function(){s=arguments},n.always((function(){void 0===i?T(r).removeProp(o):r[o]=i,t[o]&&(t.jsonpCallback=e.jsonpCallback,en.push(o)),s&&m(i)&&i(s[0]),s=i=void 0})),"script"})),v.createHTMLDocument=((tn=b.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===tn.childNodes.length),T.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(v.createHTMLDocument?((r=(e=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,e.head.appendChild(r)):e=b),i=!n&&[],(o=F.exec(t))?[e.createElement(o[1])]:(o=Mt([t],e,i),i&&i.length&&T(i).remove(),T.merge([],o.childNodes)));var r,o,i},T.fn.load=function(t,e,n){var r,o,i,s=this,a=t.indexOf(" ");return a>-1&&(r=Te(t.slice(a)),t=t.slice(0,a)),m(e)?(n=e,e=void 0):e&&"object"==typeof e&&(o="POST"),s.length>0&&T.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done((function(t){i=arguments,s.html(r?T("<div>").append(T.parseHTML(t)).find(r):t)})).always(n&&function(t,e){s.each((function(){n.apply(this,i||[t.responseText,e,t])}))}),this},T.expr.pseudos.animated=function(t){return T.grep(T.timers,(function(e){return t===e.elem})).length},T.offset={setOffset:function(t,e,n){var r,o,i,s,a,l,c=T.css(t,"position"),u=T(t),p={};"static"===c&&(t.style.position="relative"),a=u.offset(),i=T.css(t,"top"),l=T.css(t,"left"),("absolute"===c||"fixed"===c)&&(i+l).indexOf("auto")>-1?(s=(r=u.position()).top,o=r.left):(s=parseFloat(i)||0,o=parseFloat(l)||0),m(e)&&(e=e.call(t,n,T.extend({},a))),null!=e.top&&(p.top=e.top-a.top+s),null!=e.left&&(p.left=e.left-a.left+o),"using"in e?e.using.call(t,p):u.css(p)}},T.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){T.offset.setOffset(this,t,e)}));var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],o={top:0,left:0};if("fixed"===T.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===T.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((o=T(t).offset()).top+=T.css(t,"borderTopWidth",!0),o.left+=T.css(t,"borderLeftWidth",!0))}return{top:e.top-o.top-T.css(r,"marginTop",!0),left:e.left-o.left-T.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===T.css(t,"position");)t=t.offsetParent;return t||gt}))}}),T.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;T.fn[t]=function(r){return tt(this,(function(t,r,o){var i;if(y(t)?i=t:9===t.nodeType&&(i=t.defaultView),void 0===o)return i?i[e]:t[r];i?i.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):t[r]=o}),t,r,arguments.length)}})),T.each(["top","left"],(function(t,e){T.cssHooks[e]=te(v.pixelPosition,(function(t,n){if(n)return n=Qt(t,e),Kt.test(n)?T(t).position()[e]+"px":n}))})),T.each({Height:"height",Width:"width"},(function(t,e){T.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,r){T.fn[r]=function(o,i){var s=arguments.length&&(n||"boolean"!=typeof o),a=n||(!0===o||!0===i?"margin":"border");return tt(this,(function(e,n,o){var i;return y(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])):void 0===o?T.css(e,n,a):T.style(e,n,o,a)}),e,s?o:void 0,s)}}))})),T.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){T.fn[e]=function(t){return this.on(e,t)}})),T.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.on("mouseenter",t).on("mouseleave",e||t)}}),T.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){T.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var rn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;T.proxy=function(t,e){var n,r,o;if("string"==typeof e&&(n=t[e],e=t,t=n),m(t))return r=a.call(arguments,2),o=function(){return t.apply(e||this,r.concat(a.call(arguments)))},o.guid=t.guid=t.guid||T.guid++,o},T.holdReady=function(t){t?T.readyWait++:T.ready(!0)},T.isArray=Array.isArray,T.parseJSON=JSON.parse,T.nodeName=A,T.isFunction=m,T.isWindow=y,T.camelCase=ot,T.type=x,T.now=Date.now,T.isNumeric=function(t){var e=T.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},T.trim=function(t){return null==t?"":(t+"").replace(rn,"$1")},void 0===(n=function(){return T}.apply(e,[]))||(t.exports=n);var on=r.jQuery,sn=r.$;return T.noConflict=function(t){return r.$===T&&(r.$=sn),t&&r.jQuery===T&&(r.jQuery=on),T},void 0===o&&(r.jQuery=r.$=T),T}))},405:(t,e,r)=>{"use strict";r.r(e),r.d(e,{VERSION:()=>i,after:()=>Ie,all:()=>en,allKeys:()=>mt,any:()=>nn,assign:()=>It,before:()=>$e,bind:()=>Ce,bindAll:()=>Oe,chain:()=>be,chunk:()=>Hn,clone:()=>Ht,collect:()=>Ye,compact:()=>En,compose:()=>Le,constant:()=>Q,contains:()=>rn,countBy:()=>yn,create:()=>Rt,debounce:()=>je,default:()=>zn,defaults:()=>$t,defer:()=>ke,delay:()=>Ee,detect:()=>qe,difference:()=>Pn,drop:()=>On,each:()=>Ke,escape:()=>ae,every:()=>en,extend:()=>Lt,extendOwn:()=>It,filter:()=>Qe,find:()=>qe,findIndex:()=>Fe,findKey:()=>Re,findLastIndex:()=>Ve,findWhere:()=>Ge,first:()=>Tn,flatten:()=>kn,foldl:()=>Je,foldr:()=>Ze,forEach:()=>Ke,functions:()=>Mt,get:()=>zt,groupBy:()=>vn,has:()=>Wt,head:()=>Tn,identity:()=>qt,include:()=>rn,includes:()=>rn,indexBy:()=>mn,indexOf:()=>ze,initial:()=>Sn,inject:()=>Je,intersection:()=>Ln,invert:()=>jt,invoke:()=>on,isArguments:()=>X,isArray:()=>G,isArrayBuffer:()=>R,isBoolean:()=>k,isDataView:()=>q,isDate:()=>L,isElement:()=>P,isEmpty:()=>ct,isEqual:()=>vt,isError:()=>$,isFinite:()=>J,isFunction:()=>V,isMap:()=>Tt,isMatch:()=>ut,isNaN:()=>Z,isNull:()=>A,isNumber:()=>N,isObject:()=>O,isRegExp:()=>I,isSet:()=>At,isString:()=>M,isSymbol:()=>D,isTypedArray:()=>it,isUndefined:()=>E,isWeakMap:()=>Ot,isWeakSet:()=>Et,iteratee:()=>Jt,keys:()=>lt,last:()=>An,lastIndexOf:()=>We,map:()=>Ye,mapObject:()=>Qt,matcher:()=>Gt,matches:()=>Gt,max:()=>ln,memoize:()=>Ae,methods:()=>Mt,min:()=>cn,mixin:()=>Vn,negate:()=>Ne,noop:()=>te,now:()=>oe,object:()=>Dn,omit:()=>Cn,once:()=>De,pairs:()=>Pt,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>sn,property:()=>Kt,propertyOf:()=>ee,random:()=>re,range:()=>Rn,reduce:()=>Je,reduceRight:()=>Ze,reject:()=>tn,rest:()=>On,restArguments:()=>T,result:()=>ve,sample:()=>dn,select:()=>Qe,shuffle:()=>fn,size:()=>wn,some:()=>nn,sortBy:()=>hn,sortedIndex:()=>Ue,tail:()=>On,take:()=>Tn,tap:()=>Ft,template:()=>ge,templateSettings:()=>ce,throttle:()=>Pe,times:()=>ne,toArray:()=>pn,toPath:()=>Vt,transpose:()=>In,unescape:()=>le,union:()=>Nn,uniq:()=>Mn,unique:()=>Mn,uniqueId:()=>ye,unzip:()=>In,values:()=>kt,where:()=>an,without:()=>jn,wrap:()=>Me,zip:()=>$n});var o={};r.r(o),r.d(o,{VERSION:()=>i,after:()=>Ie,all:()=>en,allKeys:()=>mt,any:()=>nn,assign:()=>It,before:()=>$e,bind:()=>Ce,bindAll:()=>Oe,chain:()=>be,chunk:()=>Hn,clone:()=>Ht,collect:()=>Ye,compact:()=>En,compose:()=>Le,constant:()=>Q,contains:()=>rn,countBy:()=>yn,create:()=>Rt,debounce:()=>je,default:()=>Un,defaults:()=>$t,defer:()=>ke,delay:()=>Ee,detect:()=>qe,difference:()=>Pn,drop:()=>On,each:()=>Ke,escape:()=>ae,every:()=>en,extend:()=>Lt,extendOwn:()=>It,filter:()=>Qe,find:()=>qe,findIndex:()=>Fe,findKey:()=>Re,findLastIndex:()=>Ve,findWhere:()=>Ge,first:()=>Tn,flatten:()=>kn,foldl:()=>Je,foldr:()=>Ze,forEach:()=>Ke,functions:()=>Mt,get:()=>zt,groupBy:()=>vn,has:()=>Wt,head:()=>Tn,identity:()=>qt,include:()=>rn,includes:()=>rn,indexBy:()=>mn,indexOf:()=>ze,initial:()=>Sn,inject:()=>Je,intersection:()=>Ln,invert:()=>jt,invoke:()=>on,isArguments:()=>X,isArray:()=>G,isArrayBuffer:()=>R,isBoolean:()=>k,isDataView:()=>q,isDate:()=>L,isElement:()=>P,isEmpty:()=>ct,isEqual:()=>vt,isError:()=>$,isFinite:()=>J,isFunction:()=>V,isMap:()=>Tt,isMatch:()=>ut,isNaN:()=>Z,isNull:()=>A,isNumber:()=>N,isObject:()=>O,isRegExp:()=>I,isSet:()=>At,isString:()=>M,isSymbol:()=>D,isTypedArray:()=>it,isUndefined:()=>E,isWeakMap:()=>Ot,isWeakSet:()=>Et,iteratee:()=>Jt,keys:()=>lt,last:()=>An,lastIndexOf:()=>We,map:()=>Ye,mapObject:()=>Qt,matcher:()=>Gt,matches:()=>Gt,max:()=>ln,memoize:()=>Ae,methods:()=>Mt,min:()=>cn,mixin:()=>Vn,negate:()=>Ne,noop:()=>te,now:()=>oe,object:()=>Dn,omit:()=>Cn,once:()=>De,pairs:()=>Pt,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>sn,property:()=>Kt,propertyOf:()=>ee,random:()=>re,range:()=>Rn,reduce:()=>Je,reduceRight:()=>Ze,reject:()=>tn,rest:()=>On,restArguments:()=>T,result:()=>ve,sample:()=>dn,select:()=>Qe,shuffle:()=>fn,size:()=>wn,some:()=>nn,sortBy:()=>hn,sortedIndex:()=>Ue,tail:()=>On,take:()=>Tn,tap:()=>Ft,template:()=>ge,templateSettings:()=>ce,throttle:()=>Pe,times:()=>ne,toArray:()=>pn,toPath:()=>Vt,transpose:()=>In,unescape:()=>le,union:()=>Nn,uniq:()=>Mn,unique:()=>Mn,uniqueId:()=>ye,unzip:()=>In,values:()=>kt,where:()=>an,without:()=>jn,wrap:()=>Me,zip:()=>$n});var i="1.13.6",s="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g||Function("return this")()||{},a=Array.prototype,l=Object.prototype,c="undefined"!=typeof Symbol?Symbol.prototype:null,u=a.push,p=a.slice,d=l.toString,f=l.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,g="undefined"!=typeof DataView,v=Array.isArray,m=Object.keys,y=Object.create,b=h&&ArrayBuffer.isView,w=isNaN,_=isFinite,x=!{toString:null}.propertyIsEnumerable("toString"),C=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],S=Math.pow(2,53)-1;function T(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),o=0;o<n;o++)r[o]=arguments[o+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var i=Array(e+1);for(o=0;o<e;o++)i[o]=arguments[o];return i[e]=r,t.apply(this,i)}}function O(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function A(t){return null===t}function E(t){return void 0===t}function k(t){return!0===t||!1===t||"[object Boolean]"===d.call(t)}function P(t){return!(!t||1!==t.nodeType)}function j(t){var e="[object "+t+"]";return function(t){return d.call(t)===e}}const M=j("String"),N=j("Number"),L=j("Date"),I=j("RegExp"),$=j("Error"),D=j("Symbol"),R=j("ArrayBuffer");var H=j("Function"),F=s.document&&s.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof F&&(H=function(t){return"function"==typeof t||!1});const V=H,U=j("Object");var B=g&&U(new DataView(new ArrayBuffer(8))),z="undefined"!=typeof Map&&U(new Map),W=j("DataView");const q=B?function(t){return null!=t&&V(t.getInt8)&&R(t.buffer)}:W,G=v||j("Array");function K(t,e){return null!=t&&f.call(t,e)}var Y=j("Arguments");!function(){Y(arguments)||(Y=function(t){return K(t,"callee")})}();const X=Y;function J(t){return!D(t)&&_(t)&&!isNaN(parseFloat(t))}function Z(t){return N(t)&&w(t)}function Q(t){return function(){return t}}function tt(t){return function(e){var n=t(e);return"number"==typeof n&&n>=0&&n<=S}}function et(t){return function(e){return null==e?void 0:e[t]}}const nt=et("byteLength"),rt=tt(nt);var ot=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const it=h?function(t){return b?b(t)&&!q(t):rt(t)&&ot.test(d.call(t))}:Q(!1),st=et("length");function at(t,e){e=function(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return!0===e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=C.length,r=t.constructor,o=V(r)&&r.prototype||l,i="constructor";for(K(t,i)&&!e.contains(i)&&e.push(i);n--;)(i=C[n])in t&&t[i]!==o[i]&&!e.contains(i)&&e.push(i)}function lt(t){if(!O(t))return[];if(m)return m(t);var e=[];for(var n in t)K(t,n)&&e.push(n);return x&&at(t,e),e}function ct(t){if(null==t)return!0;var e=st(t);return"number"==typeof e&&(G(t)||M(t)||X(t))?0===e:0===st(lt(t))}function ut(t,e){var n=lt(e),r=n.length;if(null==t)return!r;for(var o=Object(t),i=0;i<r;i++){var s=n[i];if(e[s]!==o[s]||!(s in o))return!1}return!0}function pt(t){return t instanceof pt?t:this instanceof pt?void(this._wrapped=t):new pt(t)}function dt(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,nt(t))}pt.VERSION=i,pt.prototype.value=function(){return this._wrapped},pt.prototype.valueOf=pt.prototype.toJSON=pt.prototype.value,pt.prototype.toString=function(){return String(this._wrapped)};var ft="[object DataView]";function ht(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var o=typeof t;return("function"===o||"object"===o||"object"==typeof e)&>(t,e,n,r)}function gt(t,e,n,r){t instanceof pt&&(t=t._wrapped),e instanceof pt&&(e=e._wrapped);var o=d.call(t);if(o!==d.call(e))return!1;if(B&&"[object Object]"==o&&q(t)){if(!q(e))return!1;o=ft}switch(o){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 c.valueOf.call(t)===c.valueOf.call(e);case"[object ArrayBuffer]":case ft:return gt(dt(t),dt(e),n,r)}var i="[object Array]"===o;if(!i&&it(t)){if(nt(t)!==nt(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 s=t.constructor,a=e.constructor;if(s!==a&&!(V(s)&&s instanceof s&&V(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var l=(n=n||[]).length;l--;)if(n[l]===t)return r[l]===e;if(n.push(t),r.push(e),i){if((l=t.length)!==e.length)return!1;for(;l--;)if(!ht(t[l],e[l],n,r))return!1}else{var u,p=lt(t);if(l=p.length,lt(e).length!==l)return!1;for(;l--;)if(!K(e,u=p[l])||!ht(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0}function vt(t,e){return ht(t,e)}function mt(t){if(!O(t))return[];var e=[];for(var n in t)e.push(n);return x&&at(t,e),e}function yt(t){var e=st(t);return function(n){if(null==n)return!1;var r=mt(n);if(st(r))return!1;for(var o=0;o<e;o++)if(!V(n[t[o]]))return!1;return t!==Ct||!V(n[bt])}}var bt="forEach",wt=["clear","delete"],_t=["get","has","set"],xt=wt.concat(bt,_t),Ct=wt.concat(_t),St=["add"].concat(wt,bt,"has");const Tt=z?yt(xt):j("Map"),Ot=z?yt(Ct):j("WeakMap"),At=z?yt(St):j("Set"),Et=j("WeakSet");function kt(t){for(var e=lt(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=t[e[o]];return r}function Pt(t){for(var e=lt(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=[e[o],t[e[o]]];return r}function jt(t){for(var e={},n=lt(t),r=0,o=n.length;r<o;r++)e[t[n[r]]]=n[r];return e}function Mt(t){var e=[];for(var n in t)V(t[n])&&e.push(n);return e.sort()}function Nt(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var o=1;o<r;o++)for(var i=arguments[o],s=t(i),a=s.length,l=0;l<a;l++){var c=s[l];e&&void 0!==n[c]||(n[c]=i[c])}return n}}const Lt=Nt(mt),It=Nt(lt),$t=Nt(mt,!0);function Dt(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 Rt(t,e){var n=Dt(t);return e&&It(n,e),n}function Ht(t){return O(t)?G(t)?t.slice():Lt({},t):t}function Ft(t,e){return e(t),t}function Vt(t){return G(t)?t:[t]}function Ut(t){return pt.toPath(t)}function Bt(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function zt(t,e,n){var r=Bt(t,Ut(e));return E(r)?n:r}function Wt(t,e){for(var n=(e=Ut(e)).length,r=0;r<n;r++){var o=e[r];if(!K(t,o))return!1;t=t[o]}return!!n}function qt(t){return t}function Gt(t){return t=It({},t),function(e){return ut(e,t)}}function Kt(t){return t=Ut(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,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)}}return function(){return t.apply(e,arguments)}}function Xt(t,e,n){return null==t?qt:V(t)?Yt(t,e,n):O(t)&&!G(t)?Gt(t):Kt(t)}function Jt(t,e){return Xt(t,e,1/0)}function Zt(t,e,n){return pt.iteratee!==Jt?pt.iteratee(t,e):Xt(t,e,n)}function Qt(t,e,n){e=Zt(e,n);for(var r=lt(t),o=r.length,i={},s=0;s<o;s++){var a=r[s];i[a]=e(t[a],a,t)}return i}function te(){}function ee(t){return null==t?te:function(e){return zt(t,e)}}function ne(t,e,n){var r=Array(Math.max(0,t));e=Yt(e,n,1);for(var o=0;o<t;o++)r[o]=e(o);return r}function re(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}pt.toPath=Vt,pt.iteratee=Jt;const oe=Date.now||function(){return(new Date).getTime()};function ie(t){var e=function(e){return t[e]},n="(?:"+lt(t).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(o,e):t}}const se={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},ae=ie(se),le=ie(jt(se)),ce=pt.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 ge(t,e,n){!e&&n&&(e=n),e=$t({},e,pt.templateSettings);var r=RegExp([(e.escape||ue).source,(e.interpolate||ue).source,(e.evaluate||ue).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(r,(function(e,n,r,s,a){return i+=t.slice(o,a).replace(de,fe),o=a+e.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(i+="';\n"+s+"\n__p+='"),e})),i+="';\n";var s,a=e.variable;if(a){if(!he.test(a))throw new Error("variable is not a bare identifier: "+a)}else i="with(obj||{}){\n"+i+"}\n",a="obj";i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{s=new Function(a,"_",i)}catch(t){throw t.source=i,t}var l=function(t){return s.call(this,t,pt)};return l.source="function("+a+"){\n"+i+"}",l}function ve(t,e,n){var r=(e=Ut(e)).length;if(!r)return V(n)?n.call(t):n;for(var o=0;o<r;o++){var i=null==t?void 0:t[e[o]];void 0===i&&(i=n,o=r),t=V(i)?i.call(t):i}return t}var me=0;function ye(t){var e=++me+"";return t?t+e:e}function be(t){var e=pt(t);return e._chain=!0,e}function we(t,e,n,r,o){if(!(r instanceof e))return t.apply(n,o);var i=Dt(t.prototype),s=t.apply(i,o);return O(s)?s:i}var _e=T((function(t,e){var n=_e.placeholder,r=function(){for(var o=0,i=e.length,s=Array(i),a=0;a<i;a++)s[a]=e[a]===n?arguments[o++]:e[a];for(;o<arguments.length;)s.push(arguments[o++]);return we(t,r,this,this,s)};return r}));_e.placeholder=pt;const xe=_e,Ce=T((function(t,e,n){if(!V(t))throw new TypeError("Bind must be called on a function");var r=T((function(o){return we(t,r,e,this,n.concat(o))}));return r})),Se=tt(st);function Te(t,e,n,r){if(r=r||[],e||0===e){if(e<=0)return r.concat(t)}else e=1/0;for(var o=r.length,i=0,s=st(t);i<s;i++){var a=t[i];if(Se(a)&&(G(a)||X(a)))if(e>1)Te(a,e-1,n,r),o=r.length;else for(var l=0,c=a.length;l<c;)r[o++]=a[l++];else n||(r[o++]=a)}return r}const Oe=T((function(t,e){var n=(e=Te(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=Ce(t[r],t)}return t}));function Ae(t,e){var n=function(r){var o=n.cache,i=""+(e?e.apply(this,arguments):r);return K(o,i)||(o[i]=t.apply(this,arguments)),o[i]};return n.cache={},n}const Ee=T((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),ke=xe(Ee,pt,1);function Pe(t,e,n){var r,o,i,s,a=0;n||(n={});var l=function(){a=!1===n.leading?0:oe(),r=null,s=t.apply(o,i),r||(o=i=null)},c=function(){var c=oe();a||!1!==n.leading||(a=c);var u=e-(c-a);return o=this,i=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),a=c,s=t.apply(o,i),r||(o=i=null)):r||!1===n.trailing||(r=setTimeout(l,u)),s};return c.cancel=function(){clearTimeout(r),a=0,r=o=i=null},c}function je(t,e,n){var r,o,i,s,a,l=function(){var c=oe()-o;e>c?r=setTimeout(l,e-c):(r=null,n||(s=t.apply(a,i)),r||(i=a=null))},c=T((function(c){return a=this,i=c,o=oe(),r||(r=setTimeout(l,e),n&&(s=t.apply(a,i))),s}));return c.cancel=function(){clearTimeout(r),r=i=a=null},c}function Me(t,e){return xe(e,t)}function Ne(t){return function(){return!t.apply(this,arguments)}}function Le(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function Ie(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function $e(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const De=xe($e,2);function Re(t,e,n){e=Zt(e,n);for(var r,o=lt(t),i=0,s=o.length;i<s;i++)if(e(t[r=o[i]],r,t))return r}function He(t){return function(e,n,r){n=Zt(n,r);for(var o=st(e),i=t>0?0:o-1;i>=0&&i<o;i+=t)if(n(e[i],i,e))return i;return-1}}const Fe=He(1),Ve=He(-1);function Ue(t,e,n,r){for(var o=(n=Zt(n,r,1))(e),i=0,s=st(t);i<s;){var a=Math.floor((i+s)/2);n(t[a])<o?i=a+1:s=a}return i}function Be(t,e,n){return function(r,o,i){var s=0,a=st(r);if("number"==typeof i)t>0?s=i>=0?i:Math.max(i+a,s):a=i>=0?Math.min(i+1,a):i+a+1;else if(n&&i&&a)return r[i=n(r,o)]===o?i:-1;if(o!=o)return(i=e(p.call(r,s,a),Z))>=0?i+s:-1;for(i=t>0?s:a-1;i>=0&&i<a;i+=t)if(r[i]===o)return i;return-1}}const ze=Be(1,Fe,Ue),We=Be(-1,Ve);function qe(t,e,n){var r=(Se(t)?Fe:Re)(t,e,n);if(void 0!==r&&-1!==r)return t[r]}function Ge(t,e){return qe(t,Gt(e))}function Ke(t,e,n){var r,o;if(e=Yt(e,n),Se(t))for(r=0,o=t.length;r<o;r++)e(t[r],r,t);else{var i=lt(t);for(r=0,o=i.length;r<o;r++)e(t[i[r]],i[r],t)}return t}function Ye(t,e,n){e=Zt(e,n);for(var r=!Se(t)&<(t),o=(r||t).length,i=Array(o),s=0;s<o;s++){var a=r?r[s]:s;i[s]=e(t[a],a,t)}return i}function Xe(t){return function(e,n,r,o){var i=arguments.length>=3;return function(e,n,r,o){var i=!Se(e)&<(e),s=(i||e).length,a=t>0?0:s-1;for(o||(r=e[i?i[a]:a],a+=t);a>=0&&a<s;a+=t){var l=i?i[a]:a;r=n(r,e[l],l,e)}return r}(e,Yt(n,o,4),r,i)}}const Je=Xe(1),Ze=Xe(-1);function Qe(t,e,n){var r=[];return e=Zt(e,n),Ke(t,(function(t,n,o){e(t,n,o)&&r.push(t)})),r}function tn(t,e,n){return Qe(t,Ne(Zt(e)),n)}function en(t,e,n){e=Zt(e,n);for(var r=!Se(t)&<(t),o=(r||t).length,i=0;i<o;i++){var s=r?r[i]:i;if(!e(t[s],s,t))return!1}return!0}function nn(t,e,n){e=Zt(e,n);for(var r=!Se(t)&<(t),o=(r||t).length,i=0;i<o;i++){var s=r?r[i]:i;if(e(t[s],s,t))return!0}return!1}function rn(t,e,n,r){return Se(t)||(t=kt(t)),("number"!=typeof n||r)&&(n=0),ze(t,e,n)>=0}const on=T((function(t,e,n){var r,o;return V(e)?o=e:(e=Ut(e),r=e.slice(0,-1),e=e[e.length-1]),Ye(t,(function(t){var i=o;if(!i){if(r&&r.length&&(t=Bt(t,r)),null==t)return;i=t[e]}return null==i?i:i.apply(t,n)}))}));function sn(t,e){return Ye(t,Kt(e))}function an(t,e){return Qe(t,Gt(e))}function ln(t,e,n){var r,o,i=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=Se(t)?t:kt(t)).length;a<l;a++)null!=(r=t[a])&&r>i&&(i=r);else e=Zt(e,n),Ke(t,(function(t,n,r){((o=e(t,n,r))>s||o===-1/0&&i===-1/0)&&(i=t,s=o)}));return i}function cn(t,e,n){var r,o,i=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=Se(t)?t:kt(t)).length;a<l;a++)null!=(r=t[a])&&r<i&&(i=r);else e=Zt(e,n),Ke(t,(function(t,n,r){((o=e(t,n,r))<s||o===1/0&&i===1/0)&&(i=t,s=o)}));return i}var un=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function pn(t){return t?G(t)?p.call(t):M(t)?t.match(un):Se(t)?Ye(t,qt):kt(t):[]}function dn(t,e,n){if(null==e||n)return Se(t)||(t=kt(t)),t[re(t.length-1)];var r=pn(t),o=st(r);e=Math.max(Math.min(e,o),0);for(var i=o-1,s=0;s<e;s++){var a=re(s,i),l=r[s];r[s]=r[a],r[a]=l}return r.slice(0,e)}function fn(t){return dn(t,1/0)}function hn(t,e,n){var r=0;return e=Zt(e,n),sn(Ye(t,(function(t,n,o){return{value:t,index:r++,criteria:e(t,n,o)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),"value")}function gn(t,e){return function(n,r,o){var i=e?[[],[]]:{};return r=Zt(r,o),Ke(n,(function(e,o){var s=r(e,o,n);t(i,e,s)})),i}}const vn=gn((function(t,e,n){K(t,n)?t[n].push(e):t[n]=[e]})),mn=gn((function(t,e,n){t[n]=e})),yn=gn((function(t,e,n){K(t,n)?t[n]++:t[n]=1})),bn=gn((function(t,e,n){t[n?0:1].push(e)}),!0);function wn(t){return null==t?0:Se(t)?t.length:lt(t).length}function _n(t,e,n){return e in n}const xn=T((function(t,e){var n={},r=e[0];if(null==t)return n;V(r)?(e.length>1&&(r=Yt(r,e[1])),e=mt(t)):(r=_n,e=Te(e,!1,!1),t=Object(t));for(var o=0,i=e.length;o<i;o++){var s=e[o],a=t[s];r(a,s,t)&&(n[s]=a)}return n})),Cn=T((function(t,e){var n,r=e[0];return V(r)?(r=Ne(r),e.length>1&&(n=e[1])):(e=Ye(Te(e,!1,!1),String),r=function(t,n){return!rn(e,n)}),xn(t,r,n)}));function Sn(t,e,n){return p.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function Tn(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 On(t,e,n){return p.call(t,null==e||n?1:e)}function An(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:On(t,Math.max(0,t.length-e))}function En(t){return Qe(t,Boolean)}function kn(t,e){return Te(t,e,!1)}const Pn=T((function(t,e){return e=Te(e,!0,!0),Qe(t,(function(t){return!rn(e,t)}))})),jn=T((function(t,e){return Pn(t,e)}));function Mn(t,e,n,r){k(e)||(r=n,n=e,e=!1),null!=n&&(n=Zt(n,r));for(var o=[],i=[],s=0,a=st(t);s<a;s++){var l=t[s],c=n?n(l,s,t):l;e&&!n?(s&&i===c||o.push(l),i=c):n?rn(i,c)||(i.push(c),o.push(l)):rn(o,l)||o.push(l)}return o}const Nn=T((function(t){return Mn(Te(t,!0,!0))}));function Ln(t){for(var e=[],n=arguments.length,r=0,o=st(t);r<o;r++){var i=t[r];if(!rn(e,i)){var s;for(s=1;s<n&&rn(arguments[s],i);s++);s===n&&e.push(i)}}return e}function In(t){for(var e=t&&ln(t,st).length||0,n=Array(e),r=0;r<e;r++)n[r]=sn(t,r);return n}const $n=T(In);function Dn(t,e){for(var n={},r=0,o=st(t);r<o;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}function Rn(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),o=Array(r),i=0;i<r;i++,t+=n)o[i]=t;return o}function Hn(t,e){if(null==e||e<1)return[];for(var n=[],r=0,o=t.length;r<o;)n.push(p.call(t,r,r+=e));return n}function Fn(t,e){return t._chain?pt(e).chain():e}function Vn(t){return Ke(Mt(t),(function(e){var n=pt[e]=t[e];pt.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),Fn(this,n.apply(pt,t))}})),pt}Ke(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=a[t];pt.prototype[t]=function(){var n=this._wrapped;return null!=n&&(e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Fn(this,n)}})),Ke(["concat","join","slice"],(function(t){var e=a[t];pt.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Fn(this,t)}}));const Un=pt;var Bn=Vn(o);Bn._=Bn;const zn=Bn}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.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";r.r(o),r.d(o,{default:()=>Mt});var t="notifications:add";const e={"@silexlabs/grapesjs-notifications":{Close:"✖ Dismiss",CloseAll:"✖ Dismiss all",Select:"✓ Select component",Show:"↓ Show"}};var n,i=r(298),s=r.n(i),a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)},l=function(){function e(t,e){var n=this;this.editor=t,this.model=e,this.componentId=null,this.group=null,this.options=this.getDefaultOptions(e.attributes),this.options.timeout&&(this.timeoutRef=setTimeout((function(){return n.remove()}),this.options.timeout)),this.message=this.options.message,this.type=this.options.type,this.componentId=e.attributes.componentId||null,this.group=e.attributes.group||null}return e.prototype.select=function(){var e=this;if(this.options.componentId){var n=this.getAllComponents(this.editor).find((function(t){var n=t.component;return t.page,n.getId()===e.options.componentId}))||null;if(n){var r=n.component,o=n.page;this.editor.Pages.select(o),this.editor.select(r),this.editor.Canvas.scrollTo(r)}else console.error("Component with ID ".concat(this.options.componentId," not found")),this.editor.runCommand(t,{message:"Component with ID ".concat(this.options.componentId," not found"),type:"error"})}},e.prototype.remove=function(){this.editor.NotificationManager.remove(this.model),this.timeoutRef&&clearTimeout(this.timeoutRef)},e.prototype.getSvgIcon=function(t){var e;return null===(e=this.options.icons)||void 0===e?void 0:e[t]},e.prototype.getDefaultOptions=function(t){return a({icons:a({info:"🚧",warning:"⚠",error:"🚫",success:"✅",group:"📌"},t.icons)},t)},e.prototype.getAllComponents=function(t){var e=this;return t.Pages.getAll().map((function(t){return e.getAllComponentInPage(t)})).flat()},e.prototype.getAllComponentInPage=function(t){var e=t.getMainComponent();return[{component:e,page:t}].concat(this.getAllChildrenComponent(e).map((function(e){return{component:e,page:t}})))},e.prototype.getAllChildrenComponent=function(t){var e=this,n=Array.from(t.components().models);return n.concat(n.map((function(t){return e.getAllChildrenComponent(t)})).flat())},e}(),c=(n=function(t,e){return n=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])},n(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 r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),u="notifications:changed",p=function(t){function e(e,n,r){var o=t.call(this,e,r)||this;return o.editor=n,o.options=r,o.editor.UndoManager.add(o),o.on("all",(function(){return o.modelChanged()})),o.on("reset",(function(){return o.editor.trigger("notifications:cleared")})),o.on("add",(function(t){return o.editor.trigger("notifications:added",t)})),o.on("remove",(function(t){return o.editor.trigger("notifications:removed",t)})),o.modelInit(),o}return c(e,t),e.prototype.getAll=function(){var t=this;return this.models.map((function(e){return new l(t.editor,e)}))},e.prototype.modelChanged=function(t){this.editor.trigger(u,null==t?void 0:t.detail)},e.prototype.modelInit=function(){this.models.forEach((function(t){console.warn("TODO: Remove listeners")})),this.models.forEach((function(t){console.warn("TODO: Add listeners")}))},e}(s().Collection);const d=globalThis,f=d.ShadowRoot&&(void 0===d.ShadyCSS||d.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,h=Symbol(),g=new WeakMap;class v{constructor(t,e,n){if(this._$cssResult$=!0,n!==h)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(f&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=g.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&g.set(e,t))}return t}toString(){return this.cssText}}const m=f?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return(t=>new v("string"==typeof t?t:t+"",void 0,h))(e)})(t):t,{is:y,defineProperty:b,getOwnPropertyDescriptor:w,getOwnPropertyNames:_,getOwnPropertySymbols:x,getPrototypeOf:C}=Object,S=globalThis,T=S.trustedTypes,O=T?T.emptyScript:"",A=S.reactiveElementPolyfillSupport,E=(t,e)=>t,k={toAttribute(t,e){switch(e){case Boolean:t=t?O:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},P=(t,e)=>!y(t,e),j={attribute:!0,type:String,converter:k,reflect:!1,hasChanged:P};Symbol.metadata??=Symbol("metadata"),S.litPropertyMetadata??=new WeakMap;class M extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=j){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(t,n,e);void 0!==r&&b(this.prototype,t,r)}}static getPropertyDescriptor(t,e,n){const{get:r,set:o}=w(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return r?.call(this)},set(e){const i=r?.call(this);o.call(this,e),this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??j}static _$Ei(){if(this.hasOwnProperty(E("elementProperties")))return;const t=C(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){const t=this.properties,e=[..._(t),...x(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(m(t))}else void 0!==t&&e.push(m(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(f)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of e){const e=document.createElement("style"),r=d.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=n.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EC(t,e){const n=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,n);if(void 0!==r&&!0===n.reflect){const o=(void 0!==n.converter?.toAttribute?n.converter:k).toAttribute(e,n.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){const n=this.constructor,r=n._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=n.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:k;this._$Em=r,this[r]=o.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,n){if(void 0!==t){if(n??=this.constructor.getPropertyOptions(t),!(n.hasChanged??P)(this[t],e))return;this.P(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,n){this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t)!0!==n.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}M.elementStyles=[],M.shadowRootOptions={mode:"open"},M[E("elementProperties")]=new Map,M[E("finalized")]=new Map,A?.({ReactiveElement:M}),(S.reactiveElementVersions??=[]).push("2.0.4");const N=globalThis,L=N.trustedTypes,I=L?L.createPolicy("lit-html",{createHTML:t=>t}):void 0,$="$lit$",D=`lit$${Math.random().toFixed(9).slice(2)}$`,R="?"+D,H=`<${R}>`,F=document,V=()=>F.createComment(""),U=t=>null===t||"object"!=typeof t&&"function"!=typeof t,B=Array.isArray,z="[ \t\n\f\r]",W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,G=/>/g,K=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Y=/'/g,X=/"/g,J=/^(?:script|style|textarea|title)$/i,Z=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),Q=Z(1),tt=(Z(2),Symbol.for("lit-noChange")),et=Symbol.for("lit-nothing"),nt=new WeakMap,rt=F.createTreeWalker(F,129);function ot(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==I?I.createHTML(e):e}class it{constructor({strings:t,_$litType$:e},n){let r;this.parts=[];let o=0,i=0;const s=t.length-1,a=this.parts,[l,c]=((t,e)=>{const n=t.length-1,r=[];let o,i=2===e?"<svg>":"",s=W;for(let e=0;e<n;e++){const n=t[e];let a,l,c=-1,u=0;for(;u<n.length&&(s.lastIndex=u,l=s.exec(n),null!==l);)u=s.lastIndex,s===W?"!--"===l[1]?s=q:void 0!==l[1]?s=G:void 0!==l[2]?(J.test(l[2])&&(o=RegExp("</"+l[2],"g")),s=K):void 0!==l[3]&&(s=K):s===K?">"===l[0]?(s=o??W,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?K:'"'===l[3]?X:Y):s===X||s===Y?s=K:s===q||s===G?s=W:(s=K,o=void 0);const p=s===K&&t[e+1].startsWith("/>")?" ":"";i+=s===W?n+H:c>=0?(r.push(a),n.slice(0,c)+$+n.slice(c)+D+p):n+D+(-2===c?e:p)}return[ot(t,i+(t[n]||"<?>")+(2===e?"</svg>":"")),r]})(t,e);if(this.el=it.createElement(l,n),rt.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=rt.nextNode())&&a.length<s;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith($)){const e=c[i++],n=r.getAttribute(t).split(D),s=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:s[2],strings:n,ctor:"."===s[1]?ut:"?"===s[1]?pt:"@"===s[1]?dt:ct}),r.removeAttribute(t)}else t.startsWith(D)&&(a.push({type:6,index:o}),r.removeAttribute(t));if(J.test(r.tagName)){const t=r.textContent.split(D),e=t.length-1;if(e>0){r.textContent=L?L.emptyScript:"";for(let n=0;n<e;n++)r.append(t[n],V()),rt.nextNode(),a.push({type:2,index:++o});r.append(t[e],V())}}}else if(8===r.nodeType)if(r.data===R)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(D,t+1));)a.push({type:7,index:o}),t+=D.length-1}o++}}static createElement(t,e){const n=F.createElement("template");return n.innerHTML=t,n}}function st(t,e,n=t,r){if(e===tt)return e;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=U(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(t),o._$AT(t,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(e=st(t,o._$AS(t,e.values),o,r)),e}class at{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,r=(t?.creationScope??F).importNode(e,!0);rt.currentNode=r;let o=rt.nextNode(),i=0,s=0,a=n[0];for(;void 0!==a;){if(i===a.index){let e;2===a.type?e=new lt(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new ft(o,this,t)),this._$AV.push(e),a=n[++s]}i!==a?.index&&(o=rt.nextNode(),i++)}return rt.currentNode=F,r}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class lt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,r){this.type=2,this._$AH=et,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=st(this,t,e),U(t)?t===et||null==t||""===t?(this._$AH!==et&&this._$AR(),this._$AH=et):t!==this._$AH&&t!==tt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>B(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==et&&U(this._$AH)?this._$AA.nextSibling.data=t:this.T(F.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=it.createElement(ot(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new at(r,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=nt.get(t.strings);return void 0===e&&nt.set(t.strings,e=new it(t)),e}k(t){B(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,r=0;for(const o of t)r===e.length?e.push(n=new lt(this.S(V()),this.S(V()),this,this.options)):n=e[r],n._$AI(o),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class ct{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,r,o){this.type=1,this._$AH=et,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=et}_$AI(t,e=this,n,r){const o=this.strings;let i=!1;if(void 0===o)t=st(this,t,e,0),i=!U(t)||t!==this._$AH&&t!==tt,i&&(this._$AH=t);else{const r=t;let s,a;for(t=o[0],s=0;s<o.length-1;s++)a=st(this,r[n+s],e,s),a===tt&&(a=this._$AH[s]),i||=!U(a)||a!==this._$AH[s],a===et?t=et:t!==et&&(t+=(a??"")+o[s+1]),this._$AH[s]=a}i&&!r&&this.j(t)}j(t){t===et?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ut extends ct{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===et?void 0:t}}class pt extends ct{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==et)}}class dt extends ct{constructor(t,e,n,r,o){super(t,e,n,r,o),this.type=5}_$AI(t,e=this){if((t=st(this,t,e,0)??et)===tt)return;const n=this._$AH,r=t===et&&n!==et||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==et&&(n===et||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class ft{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){st(this,t)}}const ht=N.litHtmlPolyfillSupport;ht?.(it,lt),(N.litHtmlVersions??=[]).push("3.1.3");const gt=(t,e,n)=>{const r=n?.renderBefore??e;let o=r._$litPart$;if(void 0===o){const t=n?.renderBefore??null;r._$litPart$=o=new lt(e.insertBefore(V(),t),t,void 0,n??{})}return o._$AI(t),o};class vt extends M{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=gt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return tt}}vt._$litElement$=!0,vt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:vt});const mt=globalThis.litElementPolyfillSupport;mt?.({LitElement:vt}),(globalThis.litElementVersions??=[]).push("4.0.5");const yt=t=>(...e)=>({_$litDirective$:t,values:e});class bt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const wt=yt(class extends bt{constructor(t){if(super(t),1!==t.type||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const r=!!e[t];r===this.st.has(t)||this.nt?.has(t)||(r?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return tt}});class _t extends bt{constructor(t){if(super(t),this.it=et,2!==t.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===et||null==t)return this._t=void 0,this.it=t;if(t===tt)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}_t.directiveName="unsafeHTML",_t.resultType=1;const xt=yt(_t);var Ct,St,Tt,Ot,At,Et=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t};function kt(t,e){return Q(At||(At=Et(["\n <li class=",'>\n <header class="gjs-sm-header gjs-label">\n <span>','</span>\n <span class="gjs-sm-header">','</span>\n </header>\n <footer class="gjs-sm-footer">\n <button @click=',' class="gjs-btn-prim">',"</button>\n ","\n </footer>\n </li>\n "],["\n <li class=",'>\n <header class="gjs-sm-header gjs-label">\n <span>','</span>\n <span class="gjs-sm-header">','</span>\n </header>\n <footer class="gjs-sm-footer">\n <button @click=',' class="gjs-btn-prim">',"</button>\n ","\n </footer>\n </li>\n "])),wt({"gjs-sm":!0,"gjs-one-bg":!0,"gjs-two-color":!0,"gjs-notification__item":!0,"gjs-notification__info":"info"===e.type,"gjs-notification__warning":"warning"===e.type,"gjs-notification__error":"error"===e.type,"gjs-notification__success":"success"===e.type}),e.getSvgIcon(e.type),xt(e.message),(function(){return e.remove()}),t.I18n.t("@silexlabs/grapesjs-notifications.Close"),e.componentId?Q(Ot||(Ot=Et(["\n <button @click=",' class="gjs-btn-prim">',"</button>\n "],["\n <button @click=",' class="gjs-btn-prim">',"</button>\n "])),(function(){return e.select()}),t.I18n.t("@silexlabs/grapesjs-notifications.Select")):"")}var Pt=function(){return Pt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Pt.apply(this,arguments)};function jt(t){if(t)return null;var e=document.createElement("ul");return e.style.position="fixed",e.style.bottom="10px",e.style.zIndex="9999",document.body.appendChild(e),e}const Mt=function(n,r){void 0===r&&(r={});var o=Pt({i18n:{},container:jt(r.container),storeKey:void 0,maxNotifications:100,reverse:!1},r);n.I18n&&n.I18n.addMessages(Pt({en:e},o.i18n));var i=o.storeKey?new Storage:null;n.NotificationManager=new p((null==i?void 0:i.getAll())||[],n,o),function(e){e.Commands.add(t,(function(t,e,n){t.NotificationManager.add(n)})),e.Commands.add("notifications:remove",(function(t,e,n){t.NotificationManager.remove(n)})),e.Commands.add("notifications:clear",(function(t,e){t.NotificationManager.reset()}))}(n),n.on(u,(function(){null==i||i.save(n.NotificationManager.getAll()),function(t,e,n,r){var o=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],n,!0);r.reverse&&o.reverse();var i=function(t){var e={},n=[];return t.forEach((function(t){t.group&&!e[t.group]?(e[t.group]=!0,n.push(t.group)):t.group||n.push(t)})),n}(o).slice(0,r.maxNotifications||o.length);gt(Q(Ct||(Ct=Et(['\n <style>\n .gjs-notification {\n top: 10px;\n right: 10px;\n max-width: 300px;\n z-index: 9999;\n list-style: none;\n padding: 10px;\n margin: 10px;\n font-family: var(--gjs-main-font);\n font-size: var(--gjs-font-size);\n max-height: 80vh;\n overflow-y: auto;\n }\n .gjs-notification details summary {\n list-style: none;\n }\n .gjs-notification li {\n border-radius: 5px;\n margin: 10px 0;\n padding: 10px;\n list-style: none;\n }\n .gjs-notification ul {\n padding: 0;\n }\n </style>\n <ul class="gjs-notification">\n ',"\n </ul>\n "],['\n <style>\n .gjs-notification {\n top: 10px;\n right: 10px;\n max-width: 300px;\n z-index: 9999;\n list-style: none;\n padding: 10px;\n margin: 10px;\n font-family: var(--gjs-main-font);\n font-size: var(--gjs-font-size);\n max-height: 80vh;\n overflow-y: auto;\n }\n .gjs-notification details summary {\n list-style: none;\n }\n .gjs-notification li {\n border-radius: 5px;\n margin: 10px 0;\n padding: 10px;\n list-style: none;\n }\n .gjs-notification ul {\n padding: 0;\n }\n </style>\n <ul class="gjs-notification">\n ',"\n </ul>\n "])),i.map((function(e){return"string"==typeof e?function(t,e,n,r){return Q(Tt||(Tt=Et(['\n <li class="gjs-sm gjs-one-bg gjs-two-color gjs-notification__group">\n <details class="gjs-sm gjs-one-bg gjs-two-color">\n <summary class="gjs-sm-header gjs-label">\n <div>📌 ',"</div>\n <button @click=",' class="gjs-btn-prim">',"</button>\n <button\n @click=",'\n class="gjs-btn-prim"\n >',"</button>\n </summary>\n <ul>\n ","\n </ul>\n </details>\n </li>\n "],['\n <li class="gjs-sm gjs-one-bg gjs-two-color gjs-notification__group">\n <details class="gjs-sm gjs-one-bg gjs-two-color">\n <summary class="gjs-sm-header gjs-label">\n <div>\\u{1F4CC} ',"</div>\n <button @click=",' class="gjs-btn-prim">',"</button>\n <button\n @click=",'\n class="gjs-btn-prim"\n >',"</button>\n </summary>\n <ul>\n ","\n </ul>\n </details>\n </li>\n "])),n,(function(){return r.forEach((function(t){return t.remove()}))}),t.I18n.t("@silexlabs/grapesjs-notifications.CloseAll"),(function(t){return t.currentTarget.closest("details").toggleAttribute("open")}),t.I18n.t("@silexlabs/grapesjs-notifications.Show"),r.slice(0,e.maxNotifications||r.length).map((function(e){return Q(St||(St=Et(["\n ","\n "],["\n ","\n "])),kt(t,e))})))}(t,r,e,o.filter((function(t){return t.group===e}))):kt(t,e)}))),function(t){return"string"==typeof t?document.querySelector(t):t}(e))}(n,o.container,n.NotificationManager.getAll(),o)}))}})(),o})(),t.exports=r()},858:function(t){var e;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,e=()=>(()=>{"use strict";var t,e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};function r(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}e.r(n),e.d(n,{default:()=>K});const o=window,i=o.trustedTypes,s=i?i.createPolicy("lit-html",{createHTML:t=>t}):void 0,a="$lit$",l=`lit$${(Math.random()+"").slice(9)}$`,c="?"+l,u=`<${c}>`,p=document,d=()=>p.createComment(""),f=t=>null===t||"object"!=typeof t&&"function"!=typeof t,h=Array.isArray,g="[ \t\n\f\r]",v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,m=/-->/g,y=/>/g,b=RegExp(`>|${g}(?:([^\\s"'>=/]+)(${g}*=${g}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),w=/'/g,_=/"/g,x=/^(?:script|style|textarea|title)$/i,C=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),S=C(1),T=(C(2),Symbol.for("lit-noChange")),O=Symbol.for("lit-nothing"),A=new WeakMap,E=p.createTreeWalker(p,129,null,!1),k=(t,e)=>{const n=t.length-1,r=[];let o,i=2===e?"<svg>":"",c=v;for(let e=0;e<n;e++){const n=t[e];let s,p,d=-1,f=0;for(;f<n.length&&(c.lastIndex=f,p=c.exec(n),null!==p);)f=c.lastIndex,c===v?"!--"===p[1]?c=m:void 0!==p[1]?c=y:void 0!==p[2]?(x.test(p[2])&&(o=RegExp("</"+p[2],"g")),c=b):void 0!==p[3]&&(c=b):c===b?">"===p[0]?(c=null!=o?o:v,d=-1):void 0===p[1]?d=-2:(d=c.lastIndex-p[2].length,s=p[1],c=void 0===p[3]?b:'"'===p[3]?_:w):c===_||c===w?c=b:c===m||c===y?c=v:(c=b,o=void 0);const h=c===b&&t[e+1].startsWith("/>")?" ":"";i+=c===v?n+u:d>=0?(r.push(s),n.slice(0,d)+a+n.slice(d)+l+h):n+l+(-2===d?(r.push(void 0),e):h)}const p=i+(t[n]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==s?s.createHTML(p):p,r]};class P{constructor({strings:t,_$litType$:e},n){let r;this.parts=[];let o=0,s=0;const u=t.length-1,p=this.parts,[f,h]=k(t,e);if(this.el=P.createElement(f,n),E.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=E.nextNode())&&p.length<u;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith(a)||e.startsWith(l)){const n=h[s++];if(t.push(e),void 0!==n){const t=r.getAttribute(n.toLowerCase()+a).split(l),e=/([.?@])?(.*)/.exec(n);p.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?I:"?"===e[1]?D:"@"===e[1]?R:L})}else p.push({type:6,index:o})}for(const e of t)r.removeAttribute(e)}if(x.test(r.tagName)){const t=r.textContent.split(l),e=t.length-1;if(e>0){r.textContent=i?i.emptyScript:"";for(let n=0;n<e;n++)r.append(t[n],d()),E.nextNode(),p.push({type:2,index:++o});r.append(t[e],d())}}}else if(8===r.nodeType)if(r.data===c)p.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(l,t+1));)p.push({type:7,index:o}),t+=l.length-1}o++}}static createElement(t,e){const n=p.createElement("template");return n.innerHTML=t,n}}function j(t,e,n=t,r){var o,i,s,a;if(e===T)return e;let l=void 0!==r?null===(o=n._$Co)||void 0===o?void 0:o[r]:n._$Cl;const c=f(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==c&&(null===(i=null==l?void 0:l._$AO)||void 0===i||i.call(l,!1),void 0===c?l=void 0:(l=new c(t),l._$AT(t,n,r)),void 0!==r?(null!==(s=(a=n)._$Co)&&void 0!==s?s:a._$Co=[])[r]=l:n._$Cl=l),void 0!==l&&(e=j(t,l._$AS(t,e.values),l,r)),e}class M{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:n},parts:r}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:p).importNode(n,!0);E.currentNode=o;let i=E.nextNode(),s=0,a=0,l=r[0];for(;void 0!==l;){if(s===l.index){let e;2===l.type?e=new N(i,i.nextSibling,this,t):1===l.type?e=new l.ctor(i,l.name,l.strings,this,t):6===l.type&&(e=new H(i,this,t)),this._$AV.push(e),l=r[++a]}s!==(null==l?void 0:l.index)&&(i=E.nextNode(),s++)}return o}v(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class N{constructor(t,e,n,r){var o;this.type=2,this._$AH=O,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cp=null===(o=null==r?void 0:r.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=j(this,t,e),f(t)?t===O||null==t||""===t?(this._$AH!==O&&this._$AR(),this._$AH=O):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>h(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==O&&f(this._$AH)?this._$AA.nextSibling.data=t:this.$(p.createTextNode(t)),this._$AH=t}g(t){var e;const{values:n,_$litType$:r}=t,o="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=P.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.v(n);else{const t=new M(o,this),e=t.u(this.options);t.v(n),this.$(e),this._$AH=t}}_$AC(t){let e=A.get(t.strings);return void 0===e&&A.set(t.strings,e=new P(t)),e}T(t){h(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,r=0;for(const o of t)r===e.length?e.push(n=new N(this.k(d()),this.k(d()),this,this.options)):n=e[r],n._$AI(o),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var n;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class L{constructor(t,e,n,r,o){this.type=1,this._$AH=O,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=O}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,r){const o=this.strings;let i=!1;if(void 0===o)t=j(this,t,e,0),i=!f(t)||t!==this._$AH&&t!==T,i&&(this._$AH=t);else{const r=t;let s,a;for(t=o[0],s=0;s<o.length-1;s++)a=j(this,r[n+s],e,s),a===T&&(a=this._$AH[s]),i||(i=!f(a)||a!==this._$AH[s]),a===O?t=O:t!==O&&(t+=(null!=a?a:"")+o[s+1]),this._$AH[s]=a}i&&!r&&this.j(t)}j(t){t===O?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class I extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===O?void 0:t}}const $=i?i.emptyScript:"";class D extends L{constructor(){super(...arguments),this.type=4}j(t){t&&t!==O?this.element.setAttribute(this.name,$):this.element.removeAttribute(this.name)}}class R extends L{constructor(t,e,n,r,o){super(t,e,n,r,o),this.type=5}_$AI(t,e=this){var n;if((t=null!==(n=j(this,t,e,0))&&void 0!==n?n:O)===T)return;const r=this._$AH,o=t===O&&r!==O||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==O&&(r===O||o);o&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==n?n:this.element,t):this._$AH.handleEvent(t)}}class H{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){j(this,t)}}const F=o.litHtmlPolyfillSupport;null==F||F(P,N),(null!==(t=o.litHtmlVersions)&&void 0!==t?t:o.litHtmlVersions=[]).push("2.7.3");class V{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const U="important",B=" !"+U,z=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends V{constructor(t){var e;if(super(t),1!==t.type||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,n)=>{const r=t[n];return null==r?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach((t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?n.removeProperty(t):n[t]="")}));for(const t in e){const r=e[t];if(null!=r){this.ut.add(t);const e="string"==typeof r&&r.endsWith(B);t.includes("-")||e?n.setProperty(t,e?r.slice(0,-11):r,e?U:""):n[t]=r}}return T}});var W,q,G;const K=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.SelectorManager,o=document.createElement("div"),i=t.Config.selectorManager.pStylePrefix,s={enablePerformance:!1,enableCount:!0,containerStyle:"\n .".concat(i,"suggest {\n position: absolute;\n z-index: 999;\n padding: 0;\n margin: 0;\n left: 0;\n right: 0;\n transition: opacity .25s ease;\n text-align: left;\n padding: 0 5px;\n }\n "),tagStyle:"\n div.".concat(i,"suggest__class {\n list-style: none;\n cursor: pointer;\n display: inline-block;\n }\n .").concat(i,"suggest__count {\n vertical-align: baseline;\n font-size: x-small;\n }\n "),...e};function a(e){var a,l,c,u;let p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";null!==(a=s.enablePerformance)&&void 0!==a||console.time("update"),null!==(l=s.enablePerformance)&&void 0!==l||console.time("all-comps");const f=[];s.enableCount&&t.Pages.getAll().forEach((t=>{t.getMainComponent().onAll((t=>f.push(t)))})),null!==(c=s.enablePerformance)&&void 0!==c||console.timeEnd("all-comps");const h=n.getAll().filter((t=>!t.private&&!n.getSelected().includes(t)&&t.getLabel().includes(p))),g=s.enableCount?h.map((t=>({sel:t,count:f.reduce(((e,n)=>n.getClasses().includes(t.id)?e+1:e),0)}))).sort(((t,e)=>e.count-t.count)).filter((t=>{let{sel:e,count:n}=t;return n>0})):h.map((t=>({sel:t,count:0})));((t,e)=>{const n=e;let r=n._$litPart$;if(void 0===r){const t=null;n._$litPart$=r=new N(e.insertBefore(d(),t),t,void 0,{})}r._$AI(t)})(S(W||(W=r(['\n <div\n class="',"suggest ",'one-bg"\n style=',"\n >\n ","\n </div>\n "])),i,i,z({opacity:e?"1":"0","pointer-events":e?"initial":"none"}),g.map((t=>{let{sel:e,count:o}=t;return S(q||(q=r(["\n <div\n data-sel-id=",'\n class="',"clm-tag ","three-bg ",'suggest__class"\n @mousedown=','\n >\n <span data-tag-name="">',"</span>\n ","\n </div>\n "])),e.id,i,i,i,(()=>function(t){var e,r;null!==(e=s.enablePerformance)&&void 0!==e||console.time("select");const o=n.getAll().find((e=>e.id===t));n.addSelected(o),null!==(r=s.enablePerformance)&&void 0!==r||console.timeEnd("select")}(e.id)),e.getLabel(),s.enableCount?S(G||(G=r(['<span class="',"clm-tag-status ",'suggest__count" data-tag-status="">',"</span>"])),i,i,o):"")}))),o),null!==(u=s.enablePerformance)&&void 0!==u||console.timeEnd("update")}t.on("load",(()=>{const e=t.getContainer().querySelector("#".concat(i,"clm-tags-field")),n=e.querySelector("#".concat(i,"clm-new"));e.parentNode.insertBefore(o,e.nextSibling);const r=document.createElement("style");r.innerHTML=s.containerStyle+s.tagStyle,document.head.appendChild(r),n.addEventListener("blur",(()=>a(!1))),n.addEventListener("focus",(()=>a(!0,n.value))),t.on("selector",(()=>a(!1))),n.addEventListener("keyup",(()=>a(!0,n.value)))}))};return n})(),t.exports=e()},391:(t,e,n)=>{var r,o,i;i="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g,r=[n(523),n(692),e],o=function(t,e,n){i.Backbone=function(t,e,n,r){var o=t.Backbone,i=Array.prototype.slice;e.VERSION="1.6.0",e.$=r,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s,a=e.Events={},l=/\s+/,c=function(t,e,r,o,i){var s,a=0;if(r&&"object"==typeof r){void 0!==o&&"context"in i&&void 0===i.context&&(i.context=o);for(s=n.keys(r);a<s.length;a++)e=c(t,e,s[a],r[s[a]],i)}else if(r&&l.test(r))for(s=r.split(l);a<s.length;a++)e=t(e,s[a],o,i);else e=t(e,r,o,i);return e};a.on=function(t,e,n){return this._events=c(u,this._events||{},t,e,{context:n,ctx:this,listening:s}),s&&((this._listeners||(this._listeners={}))[s.id]=s,s.interop=!1),this},a.listenTo=function(t,e,r){if(!t)return this;var o=t._listenId||(t._listenId=n.uniqueId("l")),i=this._listeningTo||(this._listeningTo={}),a=s=i[o];a||(this._listenId||(this._listenId=n.uniqueId("l")),a=s=i[o]=new v(this,t));var l=p(t,e,r,this);if(s=void 0,l)throw l;return a.interop&&a.on(e,r),this};var u=function(t,e,n,r){if(n){var o=t[e]||(t[e]=[]),i=r.context,s=r.ctx,a=r.listening;a&&a.count++,o.push({callback:n,context:i,ctx:i||s,listening:a})}return t},p=function(t,e,n,r){try{t.on(e,n,r)}catch(t){return t}};a.off=function(t,e,n){return this._events?(this._events=c(d,this._events,t,e,{context:n,listeners:this._listeners}),this):this},a.stopListening=function(t,e,r){var o=this._listeningTo;if(!o)return this;for(var i=t?[t._listenId]:n.keys(o),s=0;s<i.length;s++){var a=o[i[s]];if(!a)break;a.obj.off(e,r,this),a.interop&&a.off(e,r)}return n.isEmpty(o)&&(this._listeningTo=void 0),this};var d=function(t,e,r,o){if(t){var i,s=o.context,a=o.listeners,l=0;if(e||s||r){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(r&&r!==d.callback&&r!==d.callback._callback||s&&s!==d.context)u.push(d);else{var f=d.listening;f&&f.off(e,r)}}u.length?t[e]=u:delete t[e]}return t}for(i=n.keys(a);l<i.length;l++)a[i[l]].cleanup()}};a.once=function(t,e,n){var r=c(f,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(r,e,n)},a.listenToOnce=function(t,e,n){var r=c(f,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,r)};var f=function(t,e,r,o){if(r){var i=t[e]=n.once((function(){o(e,i),r.apply(this,arguments)}));i._callback=r}return t};a.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return c(h,this._events,t,void 0,n),this};var h=function(t,e,n,r){if(t){var o=t[e],i=t.all;o&&i&&(i=i.slice()),o&&g(o,r),i&&g(i,[e].concat(r))}return t},g=function(t,e){var n,r=-1,o=t.length,i=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++r<o;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i);return;case 2:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,s);return;case 3:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,s,a);return;default:for(;++r<o;)(n=t[r]).callback.apply(n.ctx,e);return}},v=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};v.prototype.on=a.on,v.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()},v.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},a.bind=a.on,a.unbind=a.off,n.extend(e,a);var m=e.Model=function(t,e){var r=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});var o=n.result(this,"defaults");r=n.defaults(n.extend({},o,r),o),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(m.prototype,a,{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,r){if(null==t)return this;var o;if("object"==typeof t?(o=t,r=e):(o={})[t]=e,r||(r={}),!this._validate(o,r))return!1;var i=r.unset,s=r.silent,a=[],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 o)e=o[d],n.isEqual(c[d],e)||a.push(d),n.isEqual(p[d],e)?delete u[d]:u[d]=e,i?delete c[d]:c[d]=e;if(this.idAttribute in o){var f=this.id;this.id=this.get(this.idAttribute),this.trigger("changeId",this,f,r)}if(!s){a.length&&(this._pending=r);for(var h=0;h<a.length;h++)this.trigger("change:"+a[h],this,c[a[h]],r)}if(l)return this;if(!s)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);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 r in this.attributes)e[r]=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,r=this._changing?this._previousAttributes:this.attributes,o={};for(var i in t){var s=t[i];n.isEqual(r[i],s)||(o[i]=s,e=!0)}return!!e&&o},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,r=t.success;return t.success=function(n){var o=t.parse?e.parse(n,t):n;if(!e.set(o,t))return!1;r&&r.call(t.context,e,n,t),e.trigger("sync",e,n,t)},z(this,t),this.sync("read",this,t)},save:function(t,e,r){var o;null==t||"object"==typeof t?(o=t,r=e):(o={})[t]=e;var i=(r=n.extend({validate:!0,parse:!0},r)).wait;if(o&&!i){if(!this.set(o,r))return!1}else if(!this._validate(o,r))return!1;var s=this,a=r.success,l=this.attributes;r.success=function(t){s.attributes=l;var e=r.parse?s.parse(t,r):t;if(i&&(e=n.extend({},o,e)),e&&!s.set(e,r))return!1;a&&a.call(r.context,s,t,r),s.trigger("sync",s,t,r)},z(this,r),o&&i&&(this.attributes=n.extend({},l,o));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=o);var u=this.sync(c,this,r);return this.attributes=l,u},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,o=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){o&&i(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var s=!1;return this.isNew()?n.defer(t.success):(z(this,t),s=this.sync("delete",this,t)),o||i(),s},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||B();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 r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,n.extend(e,{validationError:r})),!1)}});var y=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},w={add:!0,remove:!1},_=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var r,o=Array(t.length-n),i=e.length;for(r=0;r<o.length;r++)o[r]=t[r+n];for(r=0;r<i;r++)t[r+n]=e[r];for(r=0;r<o.length;r++)t[r+i+n]=o[r]};n.extend(y.prototype,a,{model:m,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,w))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:t.slice();var o=this._removeModels(t,e);return!e.silent&&o.length&&(e.changes={added:[],merged:[],removed:o},this.trigger("update",this,e)),r?o[0]:o},set:function(t,e){if(null!=t){(e=n.extend({},b,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var r=!n.isArray(t);t=r?[t]:t.slice();var o=e.at;null!=o&&(o=+o),o>this.length&&(o=this.length),o<0&&(o+=this.length+1);var i,s,a=[],l=[],c=[],u=[],p={},d=e.add,f=e.merge,h=e.remove,g=!1,v=this.comparator&&null==o&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(s=0;s<t.length;s++){i=t[s];var y=this.get(i);if(y){if(f&&i!==y){var w=this._isModel(i)?i.attributes:i;e.parse&&(w=y.parse(w,e)),y.set(w,e),c.push(y),v&&!g&&(g=y.hasChanged(m))}p[y.cid]||(p[y.cid]=!0,a.push(y)),t[s]=y}else d&&(i=t[s]=this._prepareModel(i,e))&&(l.push(i),this._addReference(i,e),p[i.cid]=!0,a.push(i))}if(h){for(s=0;s<this.length;s++)p[(i=this.models[s]).cid]||u.push(i);u.length&&this._removeModels(u,e)}var x=!1,C=!v&&d&&h;if(a.length&&C?(x=this.length!==a.length||n.some(this.models,(function(t,e){return t!==a[e]})),this.models.length=0,_(this.models,a,0),this.length=this.models.length):l.length&&(v&&(g=!0),_(this.models,l,null==o?this.length:o),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(s=0;s<l.length;s++)null!=o&&(e.index=o+s),(i=l[s]).trigger("add",i,this,e);(g||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 r?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],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 r=e.length;return n.isFunction(e)&&(e=e.bind(this)),1===r||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,r=this;return t.success=function(n){var o=t.reset?"reset":"set";r[o](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},z(this,t),this.sync("read",this,t)},create:function(t,e){var r=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;r||this.add(t,e);var o=this,i=e.success;return e.success=function(t,e,n){r&&(t.off("error",o._forwardPristineError,o),o.add(t,n)),i&&i.call(n.context,t,e,n)},r&&t.once("error",this._forwardPristineError,this),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,T)},entries:function(){return new C(this,O)},_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,(r=this.model.prototype?new this.model(t,e):this.model(t,e)).validationError?(this.trigger("invalid",this,r.validationError,e),!1):r);var r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var o=this.get(t[r]);if(o){var i=this.indexOf(o);this.models.splice(i,1),this.length--,delete this._byId[o.cid];var s=this.modelId(o.attributes,o.idAttribute);null!=s&&delete this._byId[s],e.silent||(e.index=i,o.trigger("remove",o,this,e)),n.push(o),this._removeReference(o,e)}}return t.length>0&&!e.silent&&delete e.index,n},_isModel:function(t){return t instanceof m},_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,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"changeId"===t){var o=this.modelId(e.previousAttributes(),e.idAttribute),i=this.modelId(e.attributes,e.idAttribute);null!=o&&delete this._byId[o],null!=i&&(this._byId[i]=e)}}this.trigger.apply(this,arguments)},_forwardPristineError:function(t,e,n){this.has(t)||this._onModelEvent("error",t,e,n)}});var x="function"==typeof Symbol&&Symbol.iterator;x&&(y.prototype[x]=y.prototype.values);var C=function(t,e){this._collection=t,this._kind=e,this._index=0},S=1,T=2,O=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===T?n:[n,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var A=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(A.prototype,a,{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 r=t[e];if(n.isFunction(r)||(r=this[r]),r){var o=e.match(E);this.delegate(o[1],o[2],r.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 P=function(t,e,r,o){n.each(r,(function(n,r){e[r]&&(t.prototype[r]=function(t,e,n,r){switch(e){case 1:return function(){return t[n](this[r])};case 2:return function(e){return t[n](this[r],e)};case 3:return function(e,o){return t[n](this[r],j(e,this),o)};case 4:return function(e,o,i){return t[n](this[r],j(e,this),o,i)};default:return function(){var e=i.call(arguments);return e.unshift(this[r]),t[n].apply(t,e)}}}(e,n,r,o))}))},j=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?M(t):n.isString(t)?function(e){return e.get(t)}:t},M=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}};n.each([[y,{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},"models"],[m,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes"]],(function(t){var e=t[0],r=t[1],o=t[2];e.mixin=function(t){var r=n.reduce(n.functions(t),(function(t,e){return t[e]=0,t}),{});P(e,t,r,o)},P(e,n,r,o)})),e.sync=function(t,r,o){var i=N[t];n.defaults(o||(o={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var s={type:i,dataType:"json"};if(o.url||(s.url=n.result(r,"url")||B()),null!=o.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(s.contentType="application/json",s.data=JSON.stringify(o.attrs||r.toJSON(o))),o.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),o.emulateHTTP&&("PUT"===i||"DELETE"===i||"PATCH"===i)){s.type="POST",o.emulateJSON&&(s.data._method=i);var a=o.beforeSend;o.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",i),a)return a.apply(this,arguments)}}"GET"===s.type||o.emulateJSON||(s.processData=!1);var l=o.error;o.error=function(t,e,n){o.textStatus=e,o.errorThrown=n,l&&l.call(o.context,t,e,n)};var c=o.xhr=e.ajax(n.extend(s,o));return r.trigger("request",r,c,o),c};var N={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var L=e.Router=function(t){t||(t={}),this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},I=/\((.*?)\)/g,$=/(\(\?)?:\w+/g,D=/\*\w+/g,R=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(L.prototype,a,{preinitialize:function(){},initialize:function(){},route:function(t,r,o){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(o=r,r=""),o||(o=this[r]);var i=this;return e.history.route(t,(function(n){var s=i._extractParameters(t,n);!1!==i.execute(o,s,r)&&(i.trigger.apply(i,["route:"+r].concat(s)),i.trigger("route",r,s),e.history.trigger("route",i,r,s))})),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(R,"\\$&").replace(I,"(?:$1)?").replace($,(function(t,e){return e?t:"([^/?]+)"})).replace(D,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,(function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null}))}});var H=e.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},F=/^[#\/]|\s+$/g,V=/^\/+|\/+$/g,U=/#.*$/;H.started=!1,n.extend(H.prototype,a,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(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(F,"")},start:function(t){if(H.started)throw new Error("Backbone.history has already been started");if(H.started=!0,this.options=n.extend({root:"/"},this.options,t),this.root=this.options.root,this._trailingSlash=this.options.trailingSlash,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(V,"/"),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 r=document.body,o=r.insertBefore(this.iframe,r.firstChild).contentWindow;o.document.open(),o.document.close(),o.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),H.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!this.matchRoot()&&this.notfound();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}))||this.notfound()):this.notfound()},notfound:function(){return this.trigger("notfound"),!1},navigate:function(t,e){if(!H.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;this._trailingSlash||""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;t=t.replace(U,"");var o=this.decodeFragment(t);if(this.fragment!==o){if(this.fragment=o,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);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 r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new H;m.extend=y.extend=L.extend=A.extend=H.extend=function(t,e){var r,o=this;return r=t&&n.has(t,"constructor")?t.constructor:function(){return o.apply(this,arguments)},n.extend(r,o,e),r.prototype=n.create(o.prototype,t),r.prototype.constructor=r,r.__super__=o.prototype,r};var B=function(){throw new Error('A "url" property or function must be specified')},z=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e._debug=function(){return{root:t,_:n}},e}(i,n,t,e)}.apply(e,r),void 0===o||(t.exports=o)},7:t=>{"use strict";var e,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};e=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}t.exports=i,t.exports.once=function(t,e){return new Promise((function(n,r){function o(n){t.removeListener(e,i),r(n)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),n([].slice.call(arguments))}g(t,e,i,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function c(t,e,n,r){var o,i,s,c;if(a(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),s=i[e]),void 0===s)s=i[e]=n,++t._eventsCount;else if("function"==typeof s?s=i[e]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=l(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return t}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=u.bind(r);return o.listener=n,r.wrapFn=o,o}function d(t,e,n){var r=t._events;if(void 0===r)return[];var o=r[e];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(o):h(o,o.length)}function f(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function g(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(i){r.once&&t.removeEventListener(e,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var o="error"===t,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[t];if(void 0===l)return!1;if("function"==typeof l)r(l,this,e);else{var c=l.length,u=h(l,c);for(n=0;n<c;++n)r(u[n],this,e)}return!0},i.prototype.addListener=function(t,e){return c(this,t,e,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(t,e){return c(this,t,e,!0)},i.prototype.once=function(t,e){return a(e),this.on(t,p(this,t,e)),this},i.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,p(this,t,e)),this},i.prototype.removeListener=function(t,e){var n,r,o,i,s;if(a(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===e||n[i].listener===e){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,o),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},i.prototype.listeners=function(t){return d(this,t,!0)},i.prototype.rawListeners=function(t){return d(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},109:function(t){var e;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>o});var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};const o=function(t,e){void 0===e&&(e={}),function(t,e){var r=t.BlockManager,o=e.category,i=e.blocks,s=e.stylePrefix,a=e.flexGrid,l=e.rowHeight,c=e.addBasicStyle,u="".concat(s,"row"),p="".concat(s,"cell"),d=a?"\n .".concat(u," {\n display: flex;\n justify-content: flex-start;\n align-items: stretch;\n flex-wrap: nowrap;\n padding: 10px;\n }\n @media (max-width: 768px) {\n .").concat(u," {\n flex-wrap: wrap;\n }\n }"):"\n .".concat(u," {\n display: table;\n padding: 10px;\n width: 100%;\n }\n @media (max-width: 768px) {\n .").concat(s,"cell, .").concat(s,"cell30, .").concat(s,"cell70 {\n width: 100%;\n display: block;\n }\n }"),f=a?"\n .".concat(p," {\n min-height: ").concat(l,"px;\n flex-grow: 1;\n flex-basis: 100%;\n }"):"\n .".concat(p," {\n width: 8%;\n display: table-cell;\n height: ").concat(l,"px;\n }"),h="\n .".concat(s,"cell30 {\n width: 30%;\n }"),g="\n .".concat(s,"cell70 {\n width: 70%;\n }"),v={tl:0,tc:0,tr:0,cl:0,cr:0,bl:0,br:0,minDim:1},m=n(n({},v),{cr:1,bc:0,currentUnit:1,minDim:1,step:.2});a&&(m.keyWidth="flex-basis");var y={class:u,"data-gjs-droppable":".".concat(p),"data-gjs-resizable":v,"data-gjs-name":"Row"},b={class:p,"data-gjs-draggable":".".concat(u),"data-gjs-resizable":m,"data-gjs-name":"Cell"};a&&(b["data-gjs-unstylable"]=["width"],b["data-gjs-stylable-require"]=["flex-basis"]);var w=[".".concat(u),".".concat(p)];t.on("selector:add",(function(t){return w.indexOf(t.getFullName())>=0&&t.set("private",1)}));var _=function(t){var e=[];for(var n in t){var r=t[n];r=r instanceof Array||r instanceof Object?JSON.stringify(r):r,e.push("".concat(n,"=").concat("'".concat(r,"'")))}return e.length?" ".concat(e.join(" ")):""},x=function(t){return i.indexOf(t)>=0},C=_(y),S=_(b),T={category:o,select:!0};x("column1")&&r.add("column1",n(n({},T),{label:e.labelColumn1,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M2 20h20V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h20a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1Z"/>\n </svg>',content:"<div ".concat(C,">\n <div ").concat(S,"></div>\n </div>\n ").concat(c?"<style>\n ".concat(d,"\n ").concat(f,"\n </style>"):"")})),x("column2")&&r.add("column2",n(n({},T),{label:e.labelColumn2,media:'<svg viewBox="0 0 23 24">\n <path fill="currentColor" d="M2 20h8V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1ZM13 20h8V4h-8v16Zm-1 0V4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1Z"/>\n </svg>',content:"<div ".concat(C,">\n <div ").concat(S,"></div>\n <div ").concat(S,"></div>\n </div>\n ").concat(c?"<style>\n ".concat(d,"\n ").concat(f,"\n </style>"):"")})),x("column3")&&r.add("column3",n(n({},T),{label:e.labelColumn3,media:'<svg viewBox="0 0 23 24">\n <path fill="currentColor" d="M2 20h4V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1ZM17 20h4V4h-4v16Zm-1 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1ZM9.5 20h4V4h-4v16Zm-1 0V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1Z"/>\n </svg>',content:"<div ".concat(C,">\n <div ").concat(S,"></div>\n <div ").concat(S,"></div>\n <div ").concat(S,"></div>\n </div>\n ").concat(c?"<style>\n ".concat(d,"\n ").concat(f,"\n </style>"):"")})),x("column3-7")&&r.add("column3-7",n(n({},T),{label:e.labelColumn37,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M2 20h5V4H2v16Zm-1 0V4a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1ZM10 20h12V4H10v16Zm-1 0V4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H10a1 1 0 0 1-1-1Z"/>\n </svg>',content:"<div ".concat(C,">\n <div ").concat(S," style='").concat(a?"flex-basis":"width",": 30%;'></div>\n <div ").concat(S," style='").concat(a?"flex-basis":"width",": 70%;'></div>\n </div>\n ").concat(c?"<style>\n ".concat(d,"\n ").concat(f,"\n ").concat(h,"\n ").concat(g,"\n </style>"):"")})),x("text")&&r.add("text",n(n({},T),{activate:!0,label:e.labelText,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z" />\n </svg>',content:{type:"text",content:"Insert your text here",style:{padding:"10px"}}})),x("link")&&r.add("link",n(n({},T),{label:e.labelLink,media:'<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>',content:{type:"link",content:"Link",style:{color:"#d983a6"}}})),x("image")&&r.add("image",n(n({},T),{activate:!0,label:e.labelImage,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M21,3H3C2,3 1,4 1,5V19A2,2 0 0,0 3,21H21C22,21 23,20 23,19V5C23,4 22,3 21,3M5,17L8.5,12.5L11,15.5L14.5,11L19,17H5Z" />\n </svg>',content:{style:{color:"black"},type:"image"}})),x("video")&&r.add("video",n(n({},T),{label:e.labelVideo,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M10,15L15.19,12L10,9V15M21.56,7.17C21.69,7.64 21.78,8.27 21.84,9.07C21.91,9.87 21.94,10.56 21.94,11.16L22,12C22,14.19 21.84,15.8 21.56,16.83C21.31,17.73 20.73,18.31 19.83,18.56C19.36,18.69 18.5,18.78 17.18,18.84C15.88,18.91 14.69,18.94 13.59,18.94L12,19C7.81,19 5.2,18.84 4.17,18.56C3.27,18.31 2.69,17.73 2.44,16.83C2.31,16.36 2.22,15.73 2.16,14.93C2.09,14.13 2.06,13.44 2.06,12.84L2,12C2,9.81 2.16,8.2 2.44,7.17C2.69,6.27 3.27,5.69 4.17,5.44C4.64,5.31 5.5,5.22 6.82,5.16C8.12,5.09 9.31,5.06 10.41,5.06L12,5C16.19,5 18.8,5.16 19.83,5.44C20.73,5.69 21.31,6.27 21.56,7.17Z" />\n </svg>',content:{type:"video",src:"img/video2.webm",style:{height:"350px",width:"615px"}}})),x("map")&&r.add("map",n(n({},T),{label:e.labelMap,media:'<svg viewBox="0 0 24 24">\n <path fill="currentColor" d="M20.5,3L20.34,3.03L15,5.1L9,3L3.36,4.9C3.15,4.97 3,5.15 3,5.38V20.5A0.5,0.5 0 0,0 3.5,21L3.66,20.97L9,18.9L15,21L20.64,19.1C20.85,19.03 21,18.85 21,18.62V3.5A0.5,0.5 0 0,0 20.5,3M10,5.47L14,6.87V18.53L10,17.13V5.47M5,6.46L8,5.45V17.15L5,18.31V6.46M19,17.54L16,18.55V6.86L19,5.7V17.54Z" />\n </svg>',content:{type:"map",style:{height:"350px"}}}))}(t,r({blocks:["column1","column2","column3","column3-7","text","link","image","video","map"],flexGrid:!1,stylePrefix:"gjs-",addBasicStyle:!0,category:"Basic",labelColumn1:"1 Column",labelColumn2:"2 Columns",labelColumn3:"3 Columns",labelColumn37:"2 Columns 3/7",labelText:"Text",labelLink:"Link",labelImage:"Image",labelVideo:"Video",labelMap:"Map",rowHeight:75},e))};return e})(),t.exports=e()},325:function(t){var e;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>c});var n="custom-code-plugin__code",r="custom-code",o="custom-code:open-modal",i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},s=function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},s.apply(this,arguments)},a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)},l=function(){return l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},l.apply(this,arguments)};const c=function(t,e){void 0===e&&(e={});var c=l({blockCustomCode:{},propsCustomCode:{},toolbarBtnCustomCode:{},placeholderScript:'<div style="pointer-events: none; padding: 10px;">\n <svg viewBox="0 0 24 24" style="height: 30px; vertical-align: middle;">\n <path d="M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z"></path>\n </svg>\n Custom code with <i><script></i> can\'t be rendered on the canvas\n </div>',modalTitle:"Insert your code",codeViewOptions:{},buttonLabel:"Save",commandCustomCode:{}},e);!function(t,e){void 0===e&&(e={});var i,s=t.Components,l=e.toolbarBtnCustomCode;s.addType("script",{view:{onRender:function(){var t=this.model,e=this.el;t.closestType(r)&&(e.innerHTML="")}}}),s.addType(r,{model:{defaults:a({name:"Custom Code",editable:!0,components:{tagName:"span",components:{type:"textnode",content:"Insert here your custom code"}}},e.propsCustomCode),init:function(){this.on("change:".concat(n),this.onCustomCodeChange);var t=this.get(n);!this.components().length&&this.components(t);var e=this.get("toolbar"),r="custom-code";l&&!e.filter((function(t){return t.id===r})).length&&e.unshift(a({id:r,command:o,label:'<svg viewBox="0 0 24 24">\n <path d="M14.6 16.6l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4m-5.2 0L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4z"></path>\n </svg>'},l))},onCustomCodeChange:function(){this.components(this.get(n))}},view:{events:{dblclick:"onActive"},init:function(){this.listenTo(this.model.components(),"add remove reset",this.onComponentsChange),this.onComponentsChange()},onComponentsChange:function(){var t=this;i&&clearInterval(i),i=setTimeout((function(){var r=t,o=r.model,i=r.el,s=!0;(o.get(n)||"").indexOf("<script")>=0&&e.placeholderScript&&(i.innerHTML=e.placeholderScript,s=!1),o.set({droppable:s})}),0)},onActive:function(){var t=this.model;this.em.get("Commands").run(o,{target:t})}}})}(t,c),function(t,e){var n=(void 0===e?{}:e).blockCustomCode,o=t.Blocks;n&&o.add(r,i({label:"Custom Code",media:'\n <svg viewBox="0 0 24 24">\n <path d="M14.6 16.6l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4m-5.2 0L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4z"></path>\n </svg>\n ',category:"Extra",activate:!0,select:!0,content:{type:r}},n))}(t,c),function(t,e){void 0===e&&(e={});var r=e.modalTitle,i=e.codeViewOptions,a=e.commandCustomCode,l=function(t,e){e instanceof HTMLElement?t.appendChild(e):e&&t.insertAdjacentHTML("beforeend",e)};t.Commands.add(o,s({keyCustomCode:n,target:null,codeViewer:null,run:function(t,e,n){void 0===n&&(n={});var r=n.target||t.getSelected();this.target=r,(null==r?void 0:r.get("editable"))&&this.showCustomCode(r,n)},stop:function(t){t.Modal.close()},showCustomCode:function(e,i){var s=i.title||r,a=e.get(n)||"",l=this.getContent();t.Modal.open({title:s,content:l}).onceClose((function(){return t.stopCommand(o)})),this.getCodeViewer().setContent(a)},getPreContent:function(){},getPostContent:function(){},getContent:function(){var e=this.getCodeViewer(),n=document.createElement("div"),r=t.getConfig("stylePrefix");return n.className="".concat(r,"custom-code"),l(n,this.getPreContent()),n.appendChild(e.getElement()),l(n,this.getPostContent()),l(n,this.getContentActions()),e.refresh(),setTimeout((function(){return e.focus()}),0),n},getContentActions:function(){var n=this,r=document.createElement("button");r.setAttribute("type","button");var o=t.getConfig("stylePrefix");return r.innerHTML=e.buttonLabel,r.className="".concat(o,"btn-prim ").concat(o,"btn-import__custom-code"),r.onclick=function(){return n.handleSave()},r},handleSave:function(){var e=this.target,r=this.getCodeViewer().getContent();null==e||e.set(n,r),t.Modal.close()},getCodeViewer:function(){return this.codeViewer||(this.codeViewer=t.CodeManager.createViewer(s({codeName:"htmlmixed",theme:"hopscotch",readOnly:0},i))),this.codeViewer}},a))}(t,c)};return e})(),t.exports=e()},753:function(t){var e;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>f});var n="form",r="input",o="textarea",i="select",s="checkbox",a="radio",l="button",c="label",u="option",p=function(){return p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},p.apply(this,arguments)},d=function(){return d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},d.apply(this,arguments)};const f=function(t,e){void 0===e&&(e={});var f=d({blocks:["form","input","textarea","select","button","label","checkbox","radio"],category:{id:"forms",label:"Forms"},block:function(){return{}}},e);!function(t){var e=t.Components,p={name:"name"},d={name:"placeholder"},f={type:"checkbox",name:"required"},h=function(t,e){return{type:u,content:e,attributes:{value:t}}},g=function(e){t.Commands.isActive("preview")||e.preventDefault()};e.addType(n,{isComponent:function(t){return"FORM"==t.tagName},model:{defaults:{tagName:"form",droppable:":not(form)",draggable:":not(form)",attributes:{method:"get"},traits:[{type:"select",name:"method",options:[{value:"get",name:"GET"},{value:"post",name:"POST"}]},{name:"action"}]}},view:{events:{submit:function(t){return t.preventDefault()}}}}),e.addType(r,{isComponent:function(t){return"INPUT"==t.tagName},model:{defaults:{tagName:"input",droppable:!1,highlightable:!1,attributes:{type:"text"},traits:[p,d,{type:"select",name:"type",options:[{value:"text"},{value:"email"},{value:"password"},{value:"number"}]},f]}},extendFnView:["updateAttributes"],view:{updateAttributes:function(){this.el.setAttribute("autocomplete","off")}}}),e.addType(o,{extend:r,isComponent:function(t){return"TEXTAREA"==t.tagName},model:{defaults:{tagName:"textarea",attributes:{},traits:[p,d,f]}}}),e.addType(u,{isComponent:function(t){return"OPTION"==t.tagName},model:{defaults:{tagName:"option",layerable:!1,droppable:!1,draggable:!1,highlightable:!1}}}),e.addType(i,{isComponent:function(t){return"SELECT"==t.tagName},model:{defaults:{tagName:"select",droppable:!1,highlightable:!1,components:[h("opt1","Option 1"),h("opt2","Option 2")],traits:[p,{name:"options",type:"select-options"},f]}},view:{events:{mousedown:g}}}),e.addType(s,{extend:r,isComponent:function(t){return"INPUT"==t.tagName&&"checkbox"==t.type},model:{defaults:{copyable:!1,attributes:{type:"checkbox"},traits:[{name:"id"},p,{name:"value"},f,{type:"checkbox",name:"checked"}]}},view:{events:{click:g},init:function(){this.listenTo(this.model,"change:attributes:checked",this.handleChecked)},handleChecked:function(){var t;this.el.checked=!!(null===(t=this.model.get("attributes"))||void 0===t?void 0:t.checked)}}}),e.addType(a,{extend:s,isComponent:function(t){return"INPUT"==t.tagName&&"radio"==t.type},model:{defaults:{attributes:{type:"radio"}}}}),e.addType(l,{extend:r,isComponent:function(t){return"BUTTON"==t.tagName},model:{defaults:{tagName:"button",attributes:{type:"button"},text:"Send",traits:[{name:"text",changeProp:!0},{type:"select",name:"type",options:[{value:"button"},{value:"submit"},{value:"reset"}]}]},init:function(){var t=this.components(),e=1===t.length&&t.models[0],n=e&&e.is("textnode")&&e.get("content")||"",r=n||this.get("text");this.set("text",r),this.on("change:text",this.__onTextChange),r!==n&&this.__onTextChange()},__onTextChange:function(){this.components(this.get("text"))}},view:{events:{click:g}}}),e.addType(c,{extend:"text",isComponent:function(t){return"LABEL"==t.tagName},model:{defaults:{tagName:"label",components:"Label",traits:[{name:"for"}]}}})}(t),function(t){t.TraitManager.addType("select-options",{events:{keyup:"onChange"},onValueChange:function(){for(var t,e=this.model,n=this.target,r=e.get("value").trim().split("\n"),o=[],i=0;i<r.length;i++){var s=r[i].split("::");o.push({type:u,components:s[1]||s[0],attributes:{value:s[0]}})}n.components().reset(o),null===(t=n.view)||void 0===t||t.render()},getInputEl:function(){if(!this.$input){for(var t=[],e=this.target.components(),n=0;n<e.length;n++){var r=e.models[n],o=r.get("attributes"),i=(null==o?void 0:o.value)||"",s=r.components().models[0],a=s&&s.get("content")||"";t.push("".concat(i,"::").concat(a))}var l=document.createElement("textarea");l.value=t.join("\n"),this.$input=l}return this.$input}})}(t),function(t,e){var u=e,d=t.BlockManager,f=function(t,n){var r;(null===(r=u.blocks)||void 0===r?void 0:r.indexOf(t))>=0&&d.add(t,p(p(p({},n),{category:u.category,select:!0}),e.block(t)))};f(n,{label:"Form",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 5.5c0-.3-.5-.5-1.3-.5H3.4c-.8 0-1.3.2-1.3.5v3c0 .3.5.5 1.3.5h17.4c.8 0 1.3-.2 1.3-.5v-3zM21 8H3V6h18v2zM22 10.5c0-.3-.5-.5-1.3-.5H3.4c-.8 0-1.3.2-1.3.5v3c0 .3.5.5 1.3.5h17.4c.8 0 1.3-.2 1.3-.5v-3zM21 13H3v-2h18v2z"/><rect width="10" height="3" x="2" y="15" rx=".5"/></svg>',content:{type:n,components:[{components:[{type:c,components:"Name"},{type:r}]},{components:[{type:c,components:"Email"},{type:r,attributes:{type:"email"}}]},{components:[{type:c,components:"Gender"},{type:s,attributes:{value:"M"}},{type:c,components:"M"},{type:s,attributes:{value:"F"}},{type:c,components:"F"}]},{components:[{type:c,components:"Message"},{type:o}]},{components:[{type:l}]}]}}),f(r,{label:"Input",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 9c0-.6-.5-1-1.3-1H3.4C2.5 8 2 8.4 2 9v6c0 .6.5 1 1.3 1h17.4c.8 0 1.3-.4 1.3-1V9zm-1 6H3V9h18v6z"/><path d="M4 10h1v4H4z"/></svg>',content:{type:r}}),f(o,{label:"Textarea",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 7.5c0-.9-.5-1.5-1.3-1.5H3.4C2.5 6 2 6.6 2 7.5v9c0 .9.5 1.5 1.3 1.5h17.4c.8 0 1.3-.6 1.3-1.5v-9zM21 17H3V7h18v10z"/><path d="M4 8h1v4H4zM19 7h1v10h-1zM20 8h1v1h-1zM20 15h1v1h-1z"/></svg>',content:{type:o}}),f(i,{label:"Select",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 9c0-.6-.5-1-1.3-1H3.4C2.5 8 2 8.4 2 9v6c0 .6.5 1 1.3 1h17.4c.8 0 1.3-.4 1.3-1V9zm-1 6H3V9h18v6z"/><path d="M18.5 13l1.5-2h-3zM4 11.5h11v1H4z"/></svg>',content:{type:i}}),f(l,{label:"Button",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 9c0-.6-.5-1-1.3-1H3.4C2.5 8 2 8.4 2 9v6c0 .6.5 1 1.3 1h17.4c.8 0 1.3-.4 1.3-1V9zm-1 6H3V9h18v6z"/><path d="M4 11.5h16v1H4z"/></svg>',content:{type:l}}),f(c,{label:"Label",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 11.9c0-.6-.5-.9-1.3-.9H3.4c-.8 0-1.3.3-1.3.9V17c0 .5.5.9 1.3.9h17.4c.8 0 1.3-.4 1.3-.9V12zM21 17H3v-5h18v5z"/><rect width="14" height="5" x="2" y="5" rx=".5"/><path d="M4 13h1v3H4z"/></svg>',content:{type:c}}),f(s,{label:"Checkbox",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 17l-5-5 1.41-1.42L10 14.17l7.59-7.59L19 8m0-5H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2z"></path></svg>',content:{type:s}}),f(a,{label:"Radio",media:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-18C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 5c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5z"></path></svg>',content:{type:a}})}(t,f)};return e})(),t.exports=e()},215:function(t){var e;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,e=()=>(()=>{var t={180:function(t){var e;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,e=()=>(()=>{var t={9:function(t){"undefined"!=typeof self&&self,t.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.on=function(t,e,n){e=e.split(/\s+/);for(var r=0;r<e.length;++r)t.addEventListener(e[r],n)},e.off=function(t,e,n){e=e.split(/\s+/);for(var r=0;r<e.length;++r)t.removeEventListener(e[r],n)},e.isFunction=function(t){return"function"==typeof t},e.isDef=function(t){return void 0!==t},e.getPointerEvent=function(t){return t.touches&&t.touches[0]||t}},function(t,e,n){"use strict";var r=function(t){return t&&t.__esModule?t:{default:t}}(n(2));t.exports=function(t){return new r.default(t)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=r(n(3)),s=r(n(4)),a=n(0),l=function(t,e){return t.position-e.position},c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));t=Object.assign({},t);var r={pfx:"grp",el:".grp",colorEl:"",min:0,max:100,direction:"90deg",type:"linear",height:"30px",width:"100%",emptyColor:"#000",onValuePos:function(t){return parseInt(t)}};for(var o in r)o in t||(t[o]=r[o]);var i=t.el;if(!((i="string"==typeof i?document.querySelector(i):i)instanceof HTMLElement))throw"Element not found, given "+i;return n.el=i,n.handlers=[],n.options=t,n.on("handler:color:change",(function(t,e){return n.change(e)})),n.on("handler:position:change",(function(t,e){return n.change(e)})),n.on("handler:remove",(function(t){return n.change(1)})),n.on("handler:add",(function(t){return n.change(1)})),n.render(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),o(e,[{key:"destroy",value:function(){var t=this;this.clear(),this.e={},["el","handlers","options","colorPicker"].forEach((function(e){return t[e]=0})),["previewEl","wrapperEl","sandEl"].forEach((function(e){var n=t[e];n&&n.parentNode&&n.parentNode.removeChild(n),delete t[e]}))}},{key:"setColorPicker",value:function(t){this.colorPicker=t}},{key:"getValue",value:function(t,e){var n=this.getColorValue(),r=t||this.getType(),o=["top","left","bottom","right","center"],i=e||this.getDirection();return["linear","repeating-linear"].indexOf(r)>=0&&o.indexOf(i)>=0&&(i="center"===i?"to right":"to "+i),["radial","repeating-radial"].indexOf(r)>=0&&o.indexOf(i)>=0&&(i="circle at "+i),n?r+"-gradient("+i+", "+n+")":""}},{key:"getSafeValue",value:function(t,e){var n=this.previewEl,r=this.getValue(t,e);if(!this.sandEl&&(this.sandEl=document.createElement("div")),!n||!r)return"";for(var o=this.sandEl.style,i=[r].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(this.getPrefixedValues(t,e))),s=void 0,a=0;a<i.length&&(s=i[a],o.backgroundImage=s,o.backgroundImage!=s);a++);return o.backgroundImage}},{key:"setValue",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.type,o=this.direction,i=e.indexOf("(")+1,s=e.lastIndexOf(")"),a=e.substring(i,s),l=a.split(/,(?![^(]*\)) /);if(this.clear(n),a){l.length>2&&(o=l.shift());var c=void 0;["repeating-linear","repeating-radial","linear","radial"].forEach((function(t){e.indexOf(function(t){return t+"-gradient("}(t))>-1&&!c&&(c=1,r=t)})),this.setDirection(o,n),this.setType(r,n),l.forEach((function(e){var r=e.split(" "),o=parseFloat(r.pop()),i=r.join("");t.addHandler(o,i,0,n)})),this.updatePreview()}else this.updatePreview()}},{key:"getColorValue",value:function(){var t=this.handlers;return t.sort(l),(t=1==t.length?[t[0],t[0]]:t).map((function(t){return t.getValue()})).join(", ")}},{key:"getPrefixedValues",value:function(t,e){var n=this.getValue(t,e);return["-moz-","-webkit-","-o-","-ms-"].map((function(t){return""+t+n}))}},{key:"change",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.updatePreview(),!e.silent&&this.emit("change",t)}},{key:"setDirection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options.direction=t;var n=e.complete,r=void 0===n?1:n;this.change(r,e)}},{key:"getDirection",value:function(){return this.options.direction}},{key:"setType",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options.type=t;var n=e.complete,r=void 0===n?1:n;this.change(r,e)}},{key:"getType",value:function(){return this.options.type}},{key:"addHandler",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=new s.default(this,t,e,n,r);return!r.silent&&this.emit("handler:add",o),o}},{key:"getHandler",value:function(t){return this.handlers[t]}},{key:"getHandlers",value:function(){return this.handlers}},{key:"clear",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.handlers,n=e.length-1;n>=0;n--)e[n].remove(t)}},{key:"getSelected",value:function(){for(var t=this.getHandlers(),e=0;e<t.length;e++){var n=t[e];if(n.isSelected())return n}return null}},{key:"updatePreview",value:function(){var t=this.previewEl;t&&(t.style.backgroundImage=this.getValue("linear","to right"))}},{key:"initEvents",value:function(){var t=this,e=this.previewEl;e&&(0,a.on)(e,"click",(function(n){var r=t.options,o=r.min,i=r.max,s={w:e.clientWidth,h:e.clientHeight},a=n.offsetX-e.clientLeft,l=n.offsetY-e.clientTop,c=a/s.w*100;if(!(c>i||c<o||l>s.h||l<0)){var u=document.createElement("canvas"),p=u.getContext("2d");u.width=s.w,u.height=s.h;var d=p.createLinearGradient(0,0,s.w,s.h);t.getHandlers().forEach((function(t){return d.addColorStop(t.position/100,t.color)})),p.fillStyle=d,p.fillRect(0,0,u.width,u.height),u.style.background="black";var f=u.getContext("2d").getImageData(a,l,1,1).data,h="rgba("+f[0]+", "+f[1]+", "+f[2]+", "+f[3]+")",g="rgba(0, 0, 0, 0)"==h?r.emptyColor:h;t.addHandler(c,g)}}))}},{key:"render",value:function(){var t=this.options,e=this.el,n=t.pfx,r=t.height,o=t.width;if(e){var i=n+"-wrapper",s=n+"-preview";e.innerHTML='\n <div class="'+i+'">\n <div class="'+s+'"></div>\n </div>\n ';var a=e.querySelector("."+i),l=e.querySelector("."+s),c=a.style;c.position="relative",this.wrapperEl=a,this.previewEl=l,r&&(c.height=r),o&&(c.width=o),this.initEvents(),this.updatePreview()}}}]),e}(i.default);e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return r(t,[{key:"on",value:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this}},{key:"once",value:function(t,e,n){function r(){o.off(t,r),e.apply(n,arguments)}var o=this;return r._=e,this.on(t,r,n)}},{key:"emit",value:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,e);return this}},{key:"off",value:function(t,e){var n=this.e||(this.e={}),r=n[t],o=[];if(r&&e)for(var i=0,s=r.length;i<s;i++)r[i].fn!==e&&r[i].fn._!==e&&o.push(r[i]);return o.length?n[t]=o:delete n[t],this}}]),t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(0),i=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"black",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),e.getHandlers().push(this),this.gp=e,this.position=n,this.color=r,this.selected=0,this.render(),o&&this.select(i)}return r(t,[{key:"toJSON",value:function(){return{position:this.position,selected:this.selected,color:this.color}}},{key:"setColor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.color=t,this.emit("handler:color:change",this,e)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.getEl();this.position=t,n&&(n.style.left=t+"%"),this.emit("handler:position:change",this,e)}},{key:"getColor",value:function(){return this.color}},{key:"getPosition",value:function(){var t=this.position,e=this.gp.options.onValuePos;return(0,o.isFunction)(e)?e(t):t}},{key:"isSelected",value:function(){return!!this.selected}},{key:"getValue",value:function(){return this.getColor()+" "+this.getPosition()+"%"}},{key:"select",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getEl(),n=this.gp.getHandlers();!t.keepSelect&&n.forEach((function(t){return t.deselect()})),this.selected=1;var r=this.getSelectedCls();e&&(e.className+=" "+r),this.emit("handler:select",this)}},{key:"deselect",value:function(){var t=this.getEl();this.selected=0;var e=this.getSelectedCls();t&&(t.className=t.className.replace(e,"").trim()),this.emit("handler:deselect",this)}},{key:"getSelectedCls",value:function(){return this.gp.options.pfx+"-handler-selected"}},{key:"remove",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.cpFn,r=this.getEl(),i=this.gp.getHandlers(),s=i.splice(i.indexOf(this),1)[0];return r&&r.parentNode.removeChild(r),!e.silent&&this.emit("handler:remove",s),(0,o.isFunction)(n)&&n(this),["el","gp"].forEach((function(e){return t[e]=0})),s}},{key:"getEl",value:function(){return this.el}},{key:"initEvents",value:function(){var t=this,e=this.getEl(),n=this.gp.previewEl,r=this.gp.options,i=r.min,s=r.max,a=e.querySelector("[data-toggle=handler-close]"),l=e.querySelector("[data-toggle=handler-color-c]"),c=e.querySelector("[data-toggle=handler-color-wrap]"),u=e.querySelector("[data-toggle=handler-color]"),p=e.querySelector("[data-toggle=handler-drag]"),d=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=e.target.value;t.setColor(r,n),c&&(c.style.backgroundColor=r)};if(l&&(0,o.on)(l,"click",(function(t){return t.stopPropagation()})),a&&(0,o.on)(a,"click",(function(e){e.stopPropagation(),t.remove()})),u&&((0,o.on)(u,"change",d),(0,o.on)(u,"input",(function(t){return d(t,0)}))),p){var f=0,h=0,g=0,v={},m={},y={},b=function(e){var n=(0,o.getPointerEvent)(e);g=1,y.x=n.clientX-m.x,y.y=n.clientY-m.y,f=100*y.x,f/=v.w,f=(f=(f=h+f)<i?i:f)>s?s:f,t.setPosition(f,0),t.emit("handler:drag",t,f),(0,o.isDef)(e.button)&&0===e.which&&w(e)},w=function e(n){(0,o.off)(document,"touchmove mousemove",b),(0,o.off)(document,"touchend mouseup",e),g&&(g=0,t.setPosition(f),t.emit("handler:drag:end",t,f))};(0,o.on)(p,"touchstart mousedown",(function(e){if(!(0,o.isDef)(e.button)||0===e.button){t.select();var r=(0,o.getPointerEvent)(e);h=t.position,v.w=n.clientWidth,v.h=n.clientHeight,m.x=r.clientX,m.y=r.clientY,(0,o.on)(document,"touchmove mousemove",b),(0,o.on)(document,"touchend mouseup",w),t.emit("handler:drag:start",t)}})),(0,o.on)(p,"click",(function(t){return t.stopPropagation()}))}}},{key:"emit",value:function(){var t;(t=this.gp).emit.apply(t,arguments)}},{key:"render",value:function(){var t=this.gp,e=t.options,n=t.previewEl,r=t.colorPicker,o=e.pfx,i=e.colorEl,s=this.getColor();if(n){var a=document.createElement("div"),l=a.style,c=o+"-handler";return a.className=c,a.innerHTML='\n <div class="'+c+'-close-c">\n <div class="'+c+'-close" data-toggle="handler-close">⨯</div>\n </div>\n <div class="'+c+'-drag" data-toggle="handler-drag"></div>\n <div class="'+c+'-cp-c" data-toggle="handler-color-c">\n '+(i||'\n <div class="'+c+'-cp-wrap" data-toggle="handler-color-wrap" style="background-color: '+s+'">\n <input type="color" data-toggle="handler-color" value="'+s+'">\n </div>')+"\n </div>\n ",l.position="absolute",l.top=0,l.left=this.position+"%",n.appendChild(a),this.el=a,this.initEvents(),this.cpFn=r&&r(this),a}}}]),t}();e.default=i}])}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].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 r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},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 r={};return(()=>{"use strict";n.r(r),n.d(r,{GRAD_DIRS:()=>c,GRAD_TYPES:()=>u,default:()=>v,getValidDir:()=>l,parseGradient:()=>s,toGradient:()=>a});var t=n(9),e=n.n(t),o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},o.apply(this,arguments)},i=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},s=function(t){var e=t.indexOf("(")+1,n=t.lastIndexOf(")"),r=t.substring(e,n),o=r.split(/,(?![^(]*\))/),i={direction:"left",type:"linear",content:r,colors:r,stops:[]};if(!r)return i;o.length>2&&(i.direction=o.shift(),i.colors=o.join(",").trim());var s=!1;return["repeating-linear","repeating-radial","linear","radial"].forEach((function(e){t.indexOf(function(t){return"".concat(t,"-gradient(")}(e))>-1&&!s&&(s=!0,i.type=e)})),i.stops=o.map((function(t){var e=t.split(" "),n=(e.length>1?e.pop():"").trim();return{color:e.join(" ").trim(),position:n}})),i},a=function(t,e,n){var r=i(i([],c,!0),["center"],!1),o=e;return["linear","repeating-linear"].indexOf(t)>=0&&r.indexOf(o)>=0&&(o="center"===o?"to right":"to ".concat(o)),["radial","repeating-radial"].indexOf(t)>=0&&r.indexOf(o)>=0&&(o="circle at ".concat(o)),n?"".concat(t,"-gradient(").concat(o,", ").concat(n,")"):""},l=function(t){return c.filter((function(e){return t.indexOf(e)>-1}))[0]},c=["right","bottom","left","top"],u=["linear","radial","repeating-linear","repeating-radial"],p='[data-toggle="handler-color-wrap"]',d="background-image-gradient",f="".concat(d,"-dir"),h="".concat(d,"-type"),g=function(){return g=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},g.apply(this,arguments)};const v=function(t,n){void 0===n&&(n={}),function(t,n){void 0===n&&(n={});var r=t.getModel(),i=t.Styles,g=n.colorPicker,v=n.builtInType,m=n.styleType,y=function(e){var n=e.getEl().querySelector(p),r=t.$(n);r.spectrum&&r.spectrum("destroy")};m&&i.addType(m,{create:function(t){var i=t.change,s=document.createElement("div");s.className="gp-container",s.style.width="100%";var a=new(e())(o({el:s},n.grapickOpts));return a.on("change",(function(t){return i({value:a.getValue(),partial:!t})})),this.gp=a,"default"===g&&(g=function(t){var e=t.getEl(),n=e.querySelector(p),o=e.querySelector("input");null==o||o.parentNode.removeChild(o);var i=n.style;i.backgroundColor=t.getColor();var s=function(e,n){void 0===n&&(n=1);var r=function(t){return(1==t.getAlpha()?t.toHexString():t.toRgbString()).replace(/ /g,"")}(e);i.backgroundColor=r,t.setColor(r,n)};r.initBaseColorPicker(n,{color:t.getColor(),change:function(t){s(t)},move:function(t){s(t,0)}})},a.on("handler:remove",y)),g&&a.setColorPicker(g),s},emit:function(t,e){var n=t.updateStyle,r=e.partial;n(e.value,{partial:r})},update:function(t){var e=t.value,r=this.gp;if(r.getValue()!==e){var o=r.getHandlers();o.map(y),r.setValue(e,{silent:!0}),n.selectEdgeStops&&[o[0],o[o.length-1]].filter(Boolean).map((function(t){return t.select({keepSelect:!0})}))}},destroy:function(){var t;null===(t=this.gp)||void 0===t||t.destroy()}}),v&&i.addBuiltIn(v,{type:"composite",fromStyle:function(t,e){var n,r=e.name,o=s(t[r]||""),i=o.type||u[0],p=l(o.direction)||c[0];return(n={})[d]=a(i,p,o.colors),n[h]=i,n[f]=p,n},toStyle:function(t,e){var n,r=e.name,o=t[d]||"",i=t[h]||u[0],l=t[f]||c[0],p=s(o),g=a(i,l,p.colors);return(n={})[r]=g,n},properties:[{name:" ",full:!0,defaults:"none",type:m,property:d},{name:"Direction",type:"select",defaults:"right",property:f,options:c.map((function(t){return{value:t}}))},{name:"Type",type:"select",defaults:"linear",property:h,options:u.map((function(t){return{value:t}}))}]})}(t,g({grapickOpts:{},selectEdgeStops:!0,styleType:"gradient",builtInType:"background-image"},n))}})(),r})(),t.exports=e()}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].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 r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},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 r={};return(()=>{"use strict";n.r(r),n.d(r,{BackgroundType:()=>t,default:()=>m});var t,e=n(180),o=n.n(e),i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};!function(t){t.Image="image",t.Color="color",t.Grad="grad"}(t||(t={}));var s=function(t){return t.map((function(t){return{id:t}}))},a=function(n){var r,o=((r={})[u]=t.Image,r);if(n.indexOf("url(")>-1)o[p]=n;else if(n.indexOf("gradient(")>-1){var i=(0,e.parseGradient)(n),s=i.stops;if(2===s.length&&"linear"===i.type&&s[0].color===s[1].color)o[u]=t.Color,o[d]=s[0].color;else{var a=(0,e.getValidDir)(i.direction)||e.GRAD_DIRS[0],l=i.type||e.GRAD_TYPES[0];o[u]=t.Grad,o[f]=(0,e.toGradient)(l,a,i.colors),o[g]=l,o[h]=a}}return o},l='style="max-height: 16px; display: block; margin: 0 auto" viewBox="0 0 24 24"',c="background-image",u="__background-type",p=c,d="".concat(p,"-color"),f="".concat(p,"-gradient"),h="".concat(f,"-dir"),g="".concat(f,"-type"),v="none";const m=function(n,r){void 0===r&&(r={});var m=i({styleGradientOpts:{},propExtender:function(t){return t}},r);o()(n,i({colorPicker:"default"},m.styleGradientOpts)),n.Styles.addBuiltIn("background",{type:"stack",layerSeparator:/(?<!\(.*[^)]),(?![^(]*\))/,layerJoin:", ",detached:!0,layerLabel:function(t,e){var n,r=e.values,o=e.property.getProperty(u).getOption(r[u]);return(null==o?void 0:o.title)?"".concat((n=o.title)&&n.charAt(0).toUpperCase()+n.substring(1)):""},fromStyle:function(t,e){var n=e.property,r=e.name,o=n.getLayerSeparator(),s=n.getProperties(),l=[];return t[c]?(l=n.__splitStyleName(t,c,o).map(a),s.forEach((function(e){var r=e.getId(),s=e.getName();s!==c&&n.__splitStyleName(t,s,o).map((function(t){var n;return(n={})[r]=t||e.getDefaultValue(),n})).forEach((function(t,e){l[e]=l[e]?i(i({},l[e]),t):t}))}))):t[r]&&(l=n.__splitStyleName(t,r,/(?![^)(]*\([^)(]*?\)\)),(?![^\(]*\))/).map((function(t){return t.substring(0,t.lastIndexOf(")")+1)})).map(a)),l},toStyle:function(n){var r=i({},n),o=r[u],s=r[p];if(o===t.Color){var a=r[d];s=a===v?v:"linear-gradient(".concat(a," 0%, ").concat(a," 100%)")}else if(o===t.Grad){var l=(0,e.parseGradient)(r[f]||"");s=(0,e.toGradient)(r[g]||e.GRAD_TYPES[0],r[h]||e.GRAD_DIRS[0],l.colors)}return delete r[p],delete r[d],delete r[f],delete r[h],delete r[g],i(i({},r),{"background-image":s||v})},properties:[{label:" ",property:u,type:"radio",default:t.Image,onChange:function(e){var n=e.property,r=e.to.value;r&&n.getParent().getProperties().forEach((function(e){var n=e.getName(),o=!1;n!==u&&((r===t.Image&&[d,f,h,g].indexOf(n)<0||r===t.Color&&n===d||r===t.Grad&&[f,h,g].indexOf(n)>=0)&&(o=!0),e.up({visible:o}))}))},options:[{id:t.Image,title:"Image",label:"<svg ".concat(l,'><path fill="currentColor" d="M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2z"/></svg>')},{id:t.Color,title:"Color",label:"<svg ".concat(l,'><path fill="currentColor" d="M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z"/></svg>')},{id:t.Grad,title:"Gradient",label:"<svg ".concat(l,'><path fill="currentColor" d="M11 9h2v2h-2V9m-2 2h2v2H9v-2m4 0h2v2h-2v-2m2-2h2v2h-2V9M7 9h2v2H7V9m12-6H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2M9 18H7v-2h2v2m4 0h-2v-2h2v2m4 0h-2v-2h2v2m2-7h-2v2h2v2h-2v-2h-2v2h-2v-2h-2v2H9v-2H7v2H5v-2h2v-2H5V5h14v6z"/></svg>')}]},{label:"Image",property:p,default:"none",functionName:"url",type:"file",full:!0},{property:"background-repeat",default:"repeat",type:"select",options:[{id:"repeat",label:"Repeat"},{id:"repeat-x",label:"Repeat x"},{id:"repeat-y",label:"Repeat y"},{id:"no-repeat",label:"No repeat"},{id:"space",label:"Space"},{id:"round",label:"Round"}]},{property:"background-position",default:"left top",type:"select",options:s(["left top","left center","left bottom","right top","right center","right bottom","center top","center center","center bottom"])},{property:"background-attachment",default:"scroll",type:"select",options:s(["scroll","fixed","local"])},{type:"select",default:"auto",property:"background-size",options:s(["auto","cover","contain"])},{label:"Color",property:d,default:"none",type:"color",full:!0},{label:"Gradient",property:f,default:"linear-gradient(right, black 0%, white 100%)",type:"gradient",full:!0},{name:"Direction",property:h,type:"select",default:"right",options:s(e.GRAD_DIRS)},{name:"Type",property:g,default:"linear",type:"select",options:s(e.GRAD_TYPES)}].map((function(t){var e;return(null===(e=m.propExtender)||void 0===e?void 0:e.call(m,t))||t}))})}})(),r})(),t.exports=e()},912:function(t){"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?r(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}t.r(e),t.d(e,{default:()=>i});const i=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=o(o({},{sector:"decorations",originalBorder:{sector:"decorations",name:"border"},extendType:{},extendWidth:{},extendStyle:{},extendColor:{},extendBorder:{},extendBorderTop:{},extendBorderLeft:{},extendBorderBottom:{},extendBorderRight:{},at:!1}),n),i=t.Styles,s=[],a=t.getConfig("stylePrefix"),l=".".concat(a,"sm-property"),c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";s.forEach((function(n){var r=(n.view||{}).$el;r&&(r.show(),n.get("property")==="border".concat(t)?e.view.$el.insertBefore(r.find(l).first()):r.hide())})),s.forEach((function(e){e.get("property")!=="border".concat(t)?e.set("requires",{display:"invisible"}):e.set("requires",null)}))},u=o({property:"border-type",type:"composite",properties:[o({property:"border-options",type:"radio",name:" ",default:"all",options:[{value:"all",title:"all",className:"fa fa-arrows"},{value:"top",title:"top",className:"fa fa-long-arrow-up"},{value:"right",title:"right",className:"fa fa-long-arrow-right"},{value:"bottom",title:"bottom",className:"fa fa-long-arrow-down"},{value:"left",title:"left",className:"fa fa-long-arrow-left"}],onChange:function(t){t.property;var e=t.to.value;if(null!=e){var n=e&&"all"!==e?"-".concat(e):"";c(n)}}},r.extendType)],toStyle:function(t,e){return e.name,{}}},r.extendType),p=o({property:"border-style",type:"select",default:"solid",full:"true",options:[{value:"none"},{value:"solid"},{value:"dotted"},{value:"dashed"},{value:"double"},{value:"groove"},{value:"ridge"},{value:"inset"},{value:"outset"}]},r.extendStyle),d=[o({property:"border-width",units:["px","em","rem","vh","vw"],unit:"px",type:"slider",defaults:1,min:0,max:20},r.extendWidth),p,o({property:"border-color",type:"color"},r.extendColor)],f=[o({property:"border",type:"composite",properties:d},r.extendBorder),o({property:"border-top",type:"composite",properties:d},r.extendBorderTop),o({property:"border-right",type:"composite",properties:d},r.extendBorderRight),o({property:"border-bottom",type:"composite",properties:d},r.extendBorderBottom),o({property:"border-left",type:"composite",properties:d},r.extendBorderLeft)];t.on("load",(function(){var t=r.originalBorder,n=r.sector,o=r.at;i.removeProperty(t.sector,t.name),e=i.addProperty(n,u,o?{at:o}:{}),f.forEach((function(t){s.push(i.addProperty(n,t,o?{at:o}:{}))})),c()}))};return e})()},600:function(t){var e;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>r});var n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};const r=function(t){t.Styles.addBuiltIn("filter",{type:"stack",layerSeparator:" ",fromStyle:function(t,e){var n=e.property,r=t[e.name]||"",o=n.getLayerSeparator();return r?r.split(o).map((function(t){var e=n.__parseFn(t);return{name:e.name,value:e.value}})):[]},toStyle:function(t,e){var n;return(n={})[e.name]="".concat(t.name,"(").concat(t.value,")"),n},properties:[{property:"name",name:"Type",type:"select",default:"sepia",full:!0,options:[{id:"blur",propValue:{min:0,units:["px","em","rem","vw","vh"]}},{id:"brightness",propValue:{min:0,units:["%"]}},{id:"contrast",propValue:{min:0,units:["%"]}},{id:"grayscale",propValue:{min:0,max:100,units:["%"]}},{id:"hue-rotate",propValue:{min:0,max:360,units:["deg","rad","grad"]}},{id:"invert",propValue:{min:0,max:100,units:["%"]}},{id:"saturate",propValue:{min:0,units:["%"]}},{id:"sepia",propValue:{min:0,max:100,units:["%"]}}],onChange:function(t){var e=t.property;if(t.to.value){var r=e.getOption(),o=n({},r.propValue||{}),i=e.getParent().getProperty("value"),s=i.getUnit();(!s||(null==o?void 0:o.units.indexOf(s))<0)&&(o.unit=(null==o?void 0:o.units[0])||""),i.up(o)}}},{property:"value",type:"slider",default:"0",full:!0}]})};return e})(),t.exports=e()},692:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(r,o){"use strict";var i=[],s=Object.getPrototypeOf,a=i.slice,l=i.flat?function(t){return i.flat.call(t)}:function(t){return i.concat.apply([],t)},c=i.push,u=i.indexOf,p={},d=p.toString,f=p.hasOwnProperty,h=f.toString,g=h.call(Object),v={},m=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},b=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function _(t,e,n){var r,o,i=(n=n||b).createElement("script");if(i.text=t,e)for(r in w)(o=e[r]||e.getAttribute&&e.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?p[d.call(t)]||"object":typeof t}var C="3.7.0",S=/HTML$/i,T=function(t,e){return new T.fn.init(t,e)};function O(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!m(t)&&!y(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function A(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}T.fn=T.prototype={jquery:C,constructor:T,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=T.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return T.each(this,t)},map:function(t){return this.pushStack(T.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(T.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(T.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:i.sort,splice:i.splice},T.extend=T.fn.extend=function(){var t,e,n,r,o,i,s=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||m(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)r=t[e],"__proto__"!==e&&s!==r&&(c&&r&&(T.isPlainObject(r)||(o=Array.isArray(r)))?(n=s[e],i=o&&!Array.isArray(n)?[]:o||T.isPlainObject(n)?n:{},o=!1,s[e]=T.extend(c,i,r)):void 0!==r&&(s[e]=r));return s},T.extend({expando:"jQuery"+(C+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==d.call(t)||(e=s(t))&&("function"!=typeof(n=f.call(e,"constructor")&&e.constructor)||h.call(n)!==g))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){_(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(O(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},text:function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o)return t.textContent;if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=T.text(e);return n},makeArray:function(t,e){var n=e||[];return null!=t&&(O(Object(t))?T.merge(n,"string"==typeof t?[t]:t):c.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:u.call(e,t,n)},isXMLDoc:function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!S.test(e||n&&n.nodeName||"HTML")},merge:function(t,e){for(var n=+e.length,r=0,o=t.length;r<n;r++)t[o++]=e[r];return t.length=o,t},grep:function(t,e,n){for(var r=[],o=0,i=t.length,s=!n;o<i;o++)!e(t[o],o)!==s&&r.push(t[o]);return r},map:function(t,e,n){var r,o,i=0,s=[];if(O(t))for(r=t.length;i<r;i++)null!=(o=e(t[i],i,n))&&s.push(o);else for(i in t)null!=(o=e(t[i],i,n))&&s.push(o);return l(s)},guid:1,support:v}),"function"==typeof Symbol&&(T.fn[Symbol.iterator]=i[Symbol.iterator]),T.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){p["[object "+e+"]"]=e.toLowerCase()}));var E=i.pop,k=i.sort,P=i.splice,j="[\\x20\\t\\r\\n\\f]",M=new RegExp("^"+j+"+|((?:^|[^\\\\])(?:\\\\.)*)"+j+"+$","g");T.contains=function(t,e){var n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(t.contains?t.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))};var N=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function L(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}T.escapeSelector=function(t){return(t+"").replace(N,L)};var I=b,$=c;!function(){var t,e,n,o,s,l,c,p,d,h,g=$,m=T.expando,y=0,b=0,w=tt(),_=tt(),x=tt(),C=tt(),S=function(t,e){return t===e&&(s=!0),0},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",N="(?:\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",L="\\["+j+"*("+N+")(?:"+j+"*([*^$|!~]?=)"+j+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+j+"*\\]",D=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+L+")*)|.*)\\)|)",R=new RegExp(j+"+","g"),H=new RegExp("^"+j+"*,"+j+"*"),F=new RegExp("^"+j+"*([>+~]|"+j+")"+j+"*"),V=new RegExp(j+"|>"),U=new RegExp(D),B=new RegExp("^"+N+"$"),z={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N+"|[*])"),ATTR:new RegExp("^"+L),PSEUDO:new RegExp("^"+D),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\([^\\r\\n\\f])","g"),X=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){lt()},Z=dt((function(t){return!0===t.disabled&&A(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(i=a.call(I.childNodes),I.childNodes),i[I.childNodes.length].nodeType}catch(t){g={apply:function(t,e){$.apply(t,a.call(e))},call:function(t){$.apply(t,a.call(arguments,1))}}}function Q(t,e,n,r){var o,i,s,a,c,u,f,h=e&&e.ownerDocument,y=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==y&&9!==y&&11!==y)return n;if(!r&&(lt(e),e=e||l,p)){if(11!==y&&(c=G.exec(t)))if(o=c[1]){if(9===y){if(!(s=e.getElementById(o)))return n;if(s.id===o)return g.call(n,s),n}else if(h&&(s=h.getElementById(o))&&Q.contains(e,s)&&s.id===o)return g.call(n,s),n}else{if(c[2])return g.apply(n,e.getElementsByTagName(t)),n;if((o=c[3])&&e.getElementsByClassName)return g.apply(n,e.getElementsByClassName(o)),n}if(!(C[t+" "]||d&&d.test(t))){if(f=t,h=e,1===y&&(V.test(t)||F.test(t))){for((h=K.test(t)&&at(e.parentNode)||e)==e&&v.scope||((a=e.getAttribute("id"))?a=T.escapeSelector(a):e.setAttribute("id",a=m)),i=(u=ut(t)).length;i--;)u[i]=(a?"#"+a:":scope")+" "+pt(u[i]);f=u.join(",")}try{return g.apply(n,h.querySelectorAll(f)),n}catch(e){C(t,!0)}finally{a===m&&e.removeAttribute("id")}}}return yt(t.replace(M,"$1"),e,n,r)}function tt(){var t=[];return function n(r,o){return t.push(r+" ")>e.cacheLength&&delete n[t.shift()],n[r+" "]=o}}function et(t){return t[m]=!0,t}function nt(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function rt(t){return function(e){return A(e,"input")&&e.type===t}}function ot(t){return function(e){return(A(e,"input")||A(e,"button"))&&e.type===t}}function it(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Z(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function st(t){return et((function(e){return e=+e,et((function(n,r){for(var o,i=t([],n.length,e),s=i.length;s--;)n[o=i[s]]&&(n[o]=!(r[o]=n[o]))}))}))}function at(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var n,r=t?t.ownerDocument||t:I;return r!=l&&9===r.nodeType&&r.documentElement?(c=(l=r).documentElement,p=!T.isXMLDoc(l),h=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,I!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",J),v.getById=nt((function(t){return c.appendChild(t).id=T.expando,!l.getElementsByName||!l.getElementsByName(T.expando).length})),v.disconnectedMatch=nt((function(t){return h.call(t,"*")})),v.scope=nt((function(){return l.querySelectorAll(":scope")})),v.cssHas=nt((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),v.getById?(e.filter.ID=function(t){var e=t.replace(Y,X);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace(Y,X);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n,r,o,i=e.getElementById(t);if(i){if((n=i.getAttributeNode("id"))&&n.value===t)return[i];for(o=e.getElementsByName(t),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===t)return[i]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&p)return e.getElementsByClassName(t)},d=[],nt((function(t){var e;c.appendChild(t).innerHTML="<a id='"+m+"' href='' disabled='disabled'></a><select id='"+m+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||d.push("\\["+j+"*(?:value|"+O+")"),t.querySelectorAll("[id~="+m+"-]").length||d.push("~="),t.querySelectorAll("a#"+m+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||d.push("\\["+j+"*name"+j+"*="+j+"*(?:''|\"\")")})),v.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),S=function(t,e){if(t===e)return s=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!v.sortDetached&&e.compareDocumentPosition(t)===n?t===l||t.ownerDocument==I&&Q.contains(I,t)?-1:e===l||e.ownerDocument==I&&Q.contains(I,e)?1:o?u.call(o,t)-u.call(o,e):0:4&n?-1:1)},l):l}for(t in Q.matches=function(t,e){return Q(t,null,null,e)},Q.matchesSelector=function(t,e){if(lt(t),p&&!C[e+" "]&&(!d||!d.test(e)))try{var n=h.call(t,e);if(n||v.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){C(e,!0)}return Q(e,l,null,[t]).length>0},Q.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),T.contains(t,e)},Q.attr=function(t,n){(t.ownerDocument||t)!=l&<(t);var r=e.attrHandle[n.toLowerCase()],o=r&&f.call(e.attrHandle,n.toLowerCase())?r(t,n,!p):void 0;return void 0!==o?o:t.getAttribute(n)},Q.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},T.uniqueSort=function(t){var e,n=[],r=0,i=0;if(s=!v.sortStable,o=!v.sortStable&&a.call(t,0),k.call(t,S),s){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)P.call(t,n[r],1)}return o=null,t},T.fn.uniqueSort=function(){return this.pushStack(T.uniqueSort(a.apply(this)))},e=T.expr={cacheLength:50,createPseudo:et,match:z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Y,X),t[3]=(t[3]||t[4]||t[5]||"").replace(Y,X),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Q.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Q.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return z.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&U.test(n)&&(e=ut(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Y,X).toLowerCase();return"*"===t?function(){return!0}:function(t){return A(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+j+")"+t+"("+j+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=Q.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o.replace(R," ")+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,l){var c,u,p,d,f,h=i!==s?"nextSibling":"previousSibling",g=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!l&&!a,w=!1;if(g){if(i){for(;h;){for(p=e;p=p[h];)if(a?A(p,v):1===p.nodeType)return!1;f=h="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?g.firstChild:g.lastChild],s&&b){for(w=(d=(c=(u=g[m]||(g[m]={}))[t]||[])[0]===y&&c[1])&&c[2],p=d&&g.childNodes[d];p=++d&&p&&p[h]||(w=d=0)||f.pop();)if(1===p.nodeType&&++w&&p===e){u[t]=[y,d,w];break}}else if(b&&(w=d=(c=(u=e[m]||(e[m]={}))[t]||[])[0]===y&&c[1]),!1===w)for(;(p=++d&&p&&p[h]||(w=d=0)||f.pop())&&(!(a?A(p,v):1===p.nodeType)||!++w||(b&&((u=p[m]||(p[m]={}))[t]=[y,w]),p!==e)););return(w-=o)===r||w%r==0&&w/r>=0}}},PSEUDO:function(t,n){var r,o=e.pseudos[t]||e.setFilters[t.toLowerCase()]||Q.error("unsupported pseudo: "+t);return o[m]?o(n):o.length>1?(r=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var r,i=o(t,n),s=i.length;s--;)t[r=u.call(t,i[s])]=!(e[r]=i[s])})):function(t){return o(t,0,r)}):o}},pseudos:{not:et((function(t){var e=[],n=[],r=mt(t.replace(M,"$1"));return r[m]?et((function(t,e,n,o){for(var i,s=r(t,null,o,[]),a=t.length;a--;)(i=s[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:et((function(t){return function(e){return Q(t,e).length>0}})),contains:et((function(t){return t=t.replace(Y,X),function(e){return(e.textContent||T.text(e)).indexOf(t)>-1}})),lang:et((function(t){return B.test(t||"")||Q.error("unsupported lang: "+t),t=t.replace(Y,X).toLowerCase(),function(e){var n;do{if(n=p?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=r.location&&r.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:it(!1),disabled:it(!0),checked:function(t){return A(t,"input")&&!!t.checked||A(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return q.test(t.nodeName)},input:function(t){return W.test(t.nodeName)},button:function(t){return A(t,"input")&&"button"===t.type||A(t,"button")},text:function(t){var e;return A(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:st((function(){return[0]})),last:st((function(t,e){return[e-1]})),eq:st((function(t,e,n){return[n<0?n+e:n]})),even:st((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:st((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:st((function(t,e,n){var r;for(r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t})),gt:st((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}},e.pseudos.nth=e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[t]=rt(t);for(t in{submit:!0,reset:!0})e.pseudos[t]=ot(t);function ct(){}function ut(t,n){var r,o,i,s,a,l,c,u=_[t+" "];if(u)return n?0:u.slice(0);for(a=t,l=[],c=e.preFilter;a;){for(s in r&&!(o=H.exec(a))||(o&&(a=a.slice(o[0].length)||a),l.push(i=[])),r=!1,(o=F.exec(a))&&(r=o.shift(),i.push({value:r,type:o[0].replace(M," ")}),a=a.slice(r.length)),e.filter)!(o=z[s].exec(a))||c[s]&&!(o=c[s](o))||(r=o.shift(),i.push({value:r,type:s,matches:o}),a=a.slice(r.length));if(!r)break}return n?a.length:a?Q.error(t):_(t,l).slice(0)}function pt(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function dt(t,e,n){var r=e.dir,o=e.next,i=o||r,s=n&&"parentNode"===i,a=b++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||s)return t(e,n,o);return!1}:function(e,n,l){var c,u,p=[y,a];if(l){for(;e=e[r];)if((1===e.nodeType||s)&&t(e,n,l))return!0}else for(;e=e[r];)if(1===e.nodeType||s)if(u=e[m]||(e[m]={}),o&&A(e,o))e=e[r]||e;else{if((c=u[i])&&c[0]===y&&c[1]===a)return p[2]=c[2];if(u[i]=p,p[2]=t(e,n,l))return!0}return!1}}function ft(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function ht(t,e,n,r,o){for(var i,s=[],a=0,l=t.length,c=null!=e;a<l;a++)(i=t[a])&&(n&&!n(i,r,o)||(s.push(i),c&&e.push(a)));return s}function gt(t,e,n,r,o,i){return r&&!r[m]&&(r=gt(r)),o&&!o[m]&&(o=gt(o,i)),et((function(i,s,a,l){var c,p,d,f,h=[],v=[],m=s.length,y=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)Q(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),b=!t||!i&&e?y:ht(y,h,t,a,l);if(n?n(b,f=o||(i?t:m||r)?[]:s,a,l):f=b,r)for(c=ht(f,v),r(c,[],a,l),p=c.length;p--;)(d=c[p])&&(f[v[p]]=!(b[v[p]]=d));if(i){if(o||t){if(o){for(c=[],p=f.length;p--;)(d=f[p])&&c.push(b[p]=d);o(null,f=[],c,l)}for(p=f.length;p--;)(d=f[p])&&(c=o?u.call(i,d):h[p])>-1&&(i[c]=!(s[c]=d))}}else f=ht(f===s?f.splice(m,f.length):f),o?o(null,s,f,l):g.apply(s,f)}))}function vt(t){for(var r,o,i,s=t.length,a=e.relative[t[0].type],l=a||e.relative[" "],c=a?1:0,p=dt((function(t){return t===r}),l,!0),d=dt((function(t){return u.call(r,t)>-1}),l,!0),f=[function(t,e,o){var i=!a&&(o||e!=n)||((r=e).nodeType?p(t,e,o):d(t,e,o));return r=null,i}];c<s;c++)if(o=e.relative[t[c].type])f=[dt(ft(f),o)];else{if((o=e.filter[t[c].type].apply(null,t[c].matches))[m]){for(i=++c;i<s&&!e.relative[t[i].type];i++);return gt(c>1&&ft(f),c>1&&pt(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(M,"$1"),o,c<i&&vt(t.slice(c,i)),i<s&&vt(t=t.slice(i)),i<s&&pt(t))}f.push(o)}return ft(f)}function mt(t,r){var o,i=[],s=[],a=x[t+" "];if(!a){for(r||(r=ut(t)),o=r.length;o--;)(a=vt(r[o]))[m]?i.push(a):s.push(a);a=x(t,function(t,r){var o=r.length>0,i=t.length>0,s=function(s,a,c,u,d){var f,h,v,m=0,b="0",w=s&&[],_=[],x=n,C=s||i&&e.find.TAG("*",d),S=y+=null==x?1:Math.random()||.1,O=C.length;for(d&&(n=a==l||a||d);b!==O&&null!=(f=C[b]);b++){if(i&&f){for(h=0,a||f.ownerDocument==l||(lt(f),c=!p);v=t[h++];)if(v(f,a||l,c)){g.call(u,f);break}d&&(y=S)}o&&((f=!v&&f)&&m--,s&&w.push(f))}if(m+=b,o&&b!==m){for(h=0;v=r[h++];)v(w,_,a,c);if(s){if(m>0)for(;b--;)w[b]||_[b]||(_[b]=E.call(u));_=ht(_)}g.apply(u,_),d&&!s&&_.length>0&&m+r.length>1&&T.uniqueSort(u)}return d&&(y=S,n=x),w};return o?et(s):s}(s,i)),a.selector=t}return a}function yt(t,n,r,o){var i,s,a,l,c,u="function"==typeof t&&t,d=!o&&ut(t=u.selector||t);if(r=r||[],1===d.length){if((s=d[0]=d[0].slice(0)).length>2&&"ID"===(a=s[0]).type&&9===n.nodeType&&p&&e.relative[s[1].type]){if(!(n=(e.find.ID(a.matches[0].replace(Y,X),n)||[])[0]))return r;u&&(n=n.parentNode),t=t.slice(s.shift().value.length)}for(i=z.needsContext.test(t)?0:s.length;i--&&(a=s[i],!e.relative[l=a.type]);)if((c=e.find[l])&&(o=c(a.matches[0].replace(Y,X),K.test(s[0].type)&&at(n.parentNode)||n))){if(s.splice(i,1),!(t=o.length&&pt(s)))return g.apply(r,o),r;break}}return(u||mt(t,d))(o,n,!p,r,!n||K.test(t)&&at(n.parentNode)||n),r}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,v.sortStable=m.split("").sort(S).join("")===m,lt(),v.sortDetached=nt((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),T.find=Q,T.expr[":"]=T.expr.pseudos,T.unique=T.uniqueSort,Q.compile=mt,Q.select=yt,Q.setDocument=lt,Q.escape=T.escapeSelector,Q.getText=T.text,Q.isXML=T.isXMLDoc,Q.selectors=T.expr,Q.support=T.support,Q.uniqueSort=T.uniqueSort}();var D=function(t,e,n){for(var r=[],o=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&T(t).is(n))break;r.push(t)}return r},R=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},H=T.expr.match.needsContext,F=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function V(t,e,n){return m(e)?T.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?T.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?T.grep(t,(function(t){return u.call(e,t)>-1!==n})):T.filter(e,t,n)}T.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?T.find.matchesSelector(r,t)?[r]:[]:T.find.matches(t,T.grep(e,(function(t){return 1===t.nodeType})))},T.fn.extend({find:function(t){var e,n,r=this.length,o=this;if("string"!=typeof t)return this.pushStack(T(t).filter((function(){for(e=0;e<r;e++)if(T.contains(o[e],this))return!0})));for(n=this.pushStack([]),e=0;e<r;e++)T.find(t,o[e],n);return r>1?T.uniqueSort(n):n},filter:function(t){return this.pushStack(V(this,t||[],!1))},not:function(t){return this.pushStack(V(this,t||[],!0))},is:function(t){return!!V(this,"string"==typeof t&&H.test(t)?T(t):t||[],!1).length}});var U,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(t,e,n){var r,o;if(!t)return this;if(n=n||U,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:B.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof T?e[0]:e,T.merge(this,T.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),F.test(r[1])&&T.isPlainObject(e))for(r in e)m(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(o=b.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):m(t)?void 0!==n.ready?n.ready(t):t(T):T.makeArray(t,this)}).prototype=T.fn,U=T(b);var z=/^(?:parents|prev(?:Until|All))/,W={children:!0,contents:!0,next:!0,prev:!0};function q(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}T.fn.extend({has:function(t){var e=T(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(T.contains(this,e[t]))return!0}))},closest:function(t,e){var n,r=0,o=this.length,i=[],s="string"!=typeof t&&T(t);if(!H.test(t))for(;r<o;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&T.find.matchesSelector(n,t))){i.push(n);break}return this.pushStack(i.length>1?T.uniqueSort(i):i)},index:function(t){return t?"string"==typeof t?u.call(T(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),T.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return D(t,"parentNode")},parentsUntil:function(t,e,n){return D(t,"parentNode",n)},next:function(t){return q(t,"nextSibling")},prev:function(t){return q(t,"previousSibling")},nextAll:function(t){return D(t,"nextSibling")},prevAll:function(t){return D(t,"previousSibling")},nextUntil:function(t,e,n){return D(t,"nextSibling",n)},prevUntil:function(t,e,n){return D(t,"previousSibling",n)},siblings:function(t){return R((t.parentNode||{}).firstChild,t)},children:function(t){return R(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(A(t,"template")&&(t=t.content||t),T.merge([],t.childNodes))}},(function(t,e){T.fn[t]=function(n,r){var o=T.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=T.filter(r,o)),this.length>1&&(W[t]||T.uniqueSort(o),z.test(t)&&o.reverse()),this.pushStack(o)}}));var G=/[^\x20\t\r\n\f]+/g;function K(t){return t}function Y(t){throw t}function X(t,e,n,r){var o;try{t&&m(o=t.promise)?o.call(t).done(e).fail(n):t&&m(o=t.then)?o.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}T.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return T.each(t.match(G)||[],(function(t,n){e[n]=!0})),e}(t):T.extend({},t);var e,n,r,o,i=[],s=[],a=-1,l=function(){for(o=o||t.once,r=e=!0;s.length;a=-1)for(n=s.shift();++a<i.length;)!1===i[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=i.length,n=!1);t.memory||(n=!1),e=!1,o&&(i=n?[]:"")},c={add:function(){return i&&(n&&!e&&(a=i.length-1,s.push(n)),function e(n){T.each(n,(function(n,r){m(r)?t.unique&&c.has(r)||i.push(r):r&&r.length&&"string"!==x(r)&&e(r)}))}(arguments),n&&!e&&l()),this},remove:function(){return T.each(arguments,(function(t,e){for(var n;(n=T.inArray(e,i,n))>-1;)i.splice(n,1),n<=a&&a--})),this},has:function(t){return t?T.inArray(t,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=s=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=s=[],n||e||(i=n=""),this},locked:function(){return!!o},fireWith:function(t,n){return o||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},T.extend({Deferred:function(t){var e=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},catch:function(t){return o.then(null,t)},pipe:function(){var t=arguments;return T.Deferred((function(n){T.each(e,(function(e,r){var o=m(t[r[4]])&&t[r[4]];i[r[1]]((function(){var t=o&&o.apply(this,arguments);t&&m(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,o){var i=0;function s(t,e,n,o){return function(){var a=this,l=arguments,c=function(){var r,c;if(!(t<i)){if((r=n.apply(a,l))===e.promise())throw new TypeError("Thenable self-resolution");c=r&&("object"==typeof r||"function"==typeof r)&&r.then,m(c)?o?c.call(r,s(i,e,K,o),s(i,e,Y,o)):(i++,c.call(r,s(i,e,K,o),s(i,e,Y,o),s(i,e,K,e.notifyWith))):(n!==K&&(a=void 0,l=[r]),(o||e.resolveWith)(a,l))}},u=o?c:function(){try{c()}catch(r){T.Deferred.exceptionHook&&T.Deferred.exceptionHook(r,u.error),t+1>=i&&(n!==Y&&(a=void 0,l=[r]),e.rejectWith(a,l))}};t?u():(T.Deferred.getErrorHook?u.error=T.Deferred.getErrorHook():T.Deferred.getStackHook&&(u.error=T.Deferred.getStackHook()),r.setTimeout(u))}}return T.Deferred((function(r){e[0][3].add(s(0,r,m(o)?o:K,r.notifyWith)),e[1][3].add(s(0,r,m(t)?t:K)),e[2][3].add(s(0,r,m(n)?n:Y))})).promise()},promise:function(t){return null!=t?T.extend(t,o):o}},i={};return T.each(e,(function(t,r){var s=r[2],a=r[5];o[r[1]]=s.add,a&&s.add((function(){n=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(r[3].fire),i[r[0]]=function(){return i[r[0]+"With"](this===i?void 0:this,arguments),this},i[r[0]+"With"]=s.fireWith})),o.promise(i),t&&t.call(i,i),i},when:function(t){var e=arguments.length,n=e,r=Array(n),o=a.call(arguments),i=T.Deferred(),s=function(t){return function(n){r[t]=this,o[t]=arguments.length>1?a.call(arguments):n,--e||i.resolveWith(r,o)}};if(e<=1&&(X(t,i.done(s(n)).resolve,i.reject,!e),"pending"===i.state()||m(o[n]&&o[n].then)))return i.then();for(;n--;)X(o[n],s(n),i.reject);return i.promise()}});var J=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(t,e){r.console&&r.console.warn&&t&&J.test(t.name)&&r.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},T.readyException=function(t){r.setTimeout((function(){throw t}))};var Z=T.Deferred();function Q(){b.removeEventListener("DOMContentLoaded",Q),r.removeEventListener("load",Q),T.ready()}T.fn.ready=function(t){return Z.then(t).catch((function(t){T.readyException(t)})),this},T.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--T.readyWait:T.isReady)||(T.isReady=!0,!0!==t&&--T.readyWait>0||Z.resolveWith(b,[T]))}}),T.ready.then=Z.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(T.ready):(b.addEventListener("DOMContentLoaded",Q),r.addEventListener("load",Q));var tt=function(t,e,n,r,o,i,s){var a=0,l=t.length,c=null==n;if("object"===x(n))for(a in o=!0,n)tt(t,e,a,n[a],!0,i,s);else if(void 0!==r&&(o=!0,m(r)||(s=!0),c&&(s?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(T(t),n)})),e))for(;a<l;a++)e(t[a],n,s?r:r.call(t[a],a,e(t[a],n)));return o?t:c?e.call(t):l?e(t[0],n):i},et=/^-ms-/,nt=/-([a-z])/g;function rt(t,e){return e.toUpperCase()}function ot(t){return t.replace(et,"ms-").replace(nt,rt)}var it=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function st(){this.expando=T.expando+st.uid++}st.uid=1,st.prototype={cache:function(t){var e=t[this.expando];return e||(e={},it(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,o=this.cache(t);if("string"==typeof e)o[ot(e)]=n;else for(r in e)o[ot(r)]=e[r];return o},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][ot(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map(ot):(e=ot(e))in r?[e]:e.match(G)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||T.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!T.isEmptyObject(e)}};var at=new st,lt=new st,ct=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ut=/[A-Z]/g;function pt(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(ut,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:ct.test(t)?JSON.parse(t):t)}(n)}catch(t){}lt.set(t,e,n)}else n=void 0;return n}T.extend({hasData:function(t){return lt.hasData(t)||at.hasData(t)},data:function(t,e,n){return lt.access(t,e,n)},removeData:function(t,e){lt.remove(t,e)},_data:function(t,e,n){return at.access(t,e,n)},_removeData:function(t,e){at.remove(t,e)}}),T.fn.extend({data:function(t,e){var n,r,o,i=this[0],s=i&&i.attributes;if(void 0===t){if(this.length&&(o=lt.get(i),1===i.nodeType&&!at.get(i,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=ot(r.slice(5)),pt(i,r,o[r]));at.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof t?this.each((function(){lt.set(this,t)})):tt(this,(function(e){var n;if(i&&void 0===e)return void 0!==(n=lt.get(i,t))||void 0!==(n=pt(i,t))?n:void 0;this.each((function(){lt.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){lt.remove(this,t)}))}}),T.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=at.get(t,e),n&&(!r||Array.isArray(n)?r=at.access(t,e,T.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=T.queue(t,e),r=n.length,o=n.shift(),i=T._queueHooks(t,e);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===e&&n.unshift("inprogress"),delete i.stop,o.call(t,(function(){T.dequeue(t,e)}),i)),!r&&i&&i.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return at.get(t,n)||at.access(t,n,{empty:T.Callbacks("once memory").add((function(){at.remove(t,[e+"queue",n])}))})}}),T.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?T.queue(this[0],t):void 0===e?this:this.each((function(){var n=T.queue(this,t,e);T._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&T.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){T.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,o=T.Deferred(),i=this,s=this.length,a=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=at.get(i[s],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),o.promise(e)}});var dt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ft=new RegExp("^(?:([+-])=|)("+dt+")([a-z%]*)$","i"),ht=["Top","Right","Bottom","Left"],gt=b.documentElement,vt=function(t){return T.contains(t.ownerDocument,t)},mt={composed:!0};gt.getRootNode&&(vt=function(t){return T.contains(t.ownerDocument,t)||t.getRootNode(mt)===t.ownerDocument});var yt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&vt(t)&&"none"===T.css(t,"display")};function bt(t,e,n,r){var o,i,s=20,a=r?function(){return r.cur()}:function(){return T.css(t,e,"")},l=a(),c=n&&n[3]||(T.cssNumber[e]?"":"px"),u=t.nodeType&&(T.cssNumber[e]||"px"!==c&&+l)&&ft.exec(T.css(t,e));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;s--;)T.style(t,e,u+c),(1-i)*(1-(i=a()/l||.5))<=0&&(s=0),u/=i;u*=2,T.style(t,e,u+c),n=n||[]}return n&&(u=+u||+l||0,o=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=o)),o}var wt={};function _t(t){var e,n=t.ownerDocument,r=t.nodeName,o=wt[r];return o||(e=n.body.appendChild(n.createElement(r)),o=T.css(e,"display"),e.parentNode.removeChild(e),"none"===o&&(o="block"),wt[r]=o,o)}function xt(t,e){for(var n,r,o=[],i=0,s=t.length;i<s;i++)(r=t[i]).style&&(n=r.style.display,e?("none"===n&&(o[i]=at.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&yt(r)&&(o[i]=_t(r))):"none"!==n&&(o[i]="none",at.set(r,"display",n)));for(i=0;i<s;i++)null!=o[i]&&(t[i].style.display=o[i]);return t}T.fn.extend({show:function(){return xt(this,!0)},hide:function(){return xt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){yt(this)?T(this).show():T(this).hide()}))}});var Ct,St,Tt=/^(?:checkbox|radio)$/i,Ot=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,At=/^$|^module$|\/(?:java|ecma)script/i;Ct=b.createDocumentFragment().appendChild(b.createElement("div")),(St=b.createElement("input")).setAttribute("type","radio"),St.setAttribute("checked","checked"),St.setAttribute("name","t"),Ct.appendChild(St),v.checkClone=Ct.cloneNode(!0).cloneNode(!0).lastChild.checked,Ct.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!Ct.cloneNode(!0).lastChild.defaultValue,Ct.innerHTML="<option></option>",v.option=!!Ct.lastChild;var Et={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function kt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&A(t,e)?T.merge([t],n):n}function Pt(t,e){for(var n=0,r=t.length;n<r;n++)at.set(t[n],"globalEval",!e||at.get(e[n],"globalEval"))}Et.tbody=Et.tfoot=Et.colgroup=Et.caption=Et.thead,Et.th=Et.td,v.option||(Et.optgroup=Et.option=[1,"<select multiple='multiple'>","</select>"]);var jt=/<|&#?\w+;/;function Mt(t,e,n,r,o){for(var i,s,a,l,c,u,p=e.createDocumentFragment(),d=[],f=0,h=t.length;f<h;f++)if((i=t[f])||0===i)if("object"===x(i))T.merge(d,i.nodeType?[i]:i);else if(jt.test(i)){for(s=s||p.appendChild(e.createElement("div")),a=(Ot.exec(i)||["",""])[1].toLowerCase(),l=Et[a]||Et._default,s.innerHTML=l[1]+T.htmlPrefilter(i)+l[2],u=l[0];u--;)s=s.lastChild;T.merge(d,s.childNodes),(s=p.firstChild).textContent=""}else d.push(e.createTextNode(i));for(p.textContent="",f=0;i=d[f++];)if(r&&T.inArray(i,r)>-1)o&&o.push(i);else if(c=vt(i),s=kt(p.appendChild(i),"script"),c&&Pt(s),n)for(u=0;i=s[u++];)At.test(i.type||"")&&n.push(i);return p}var Nt=/^([^.]*)(?:\.(.+)|)/;function Lt(){return!0}function It(){return!1}function $t(t,e,n,r,o,i){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(r=r||n,n=void 0),e)$t(t,a,n,r,e[a],i);return t}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=It;else if(!o)return t;return 1===i&&(s=o,o=function(t){return T().off(t),s.apply(this,arguments)},o.guid=s.guid||(s.guid=T.guid++)),t.each((function(){T.event.add(this,e,o,r,n)}))}function Dt(t,e,n){n?(at.set(t,e,!1),T.event.add(t,e,{namespace:!1,handler:function(t){var n,r=at.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(T.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=a.call(arguments),at.set(this,e,r),this[e](),n=at.get(this,e),at.set(this,e,!1),r!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else r&&(at.set(this,e,T.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Lt)}})):void 0===at.get(t,e)&&T.event.add(t,e,Lt)}T.event={global:{},add:function(t,e,n,r,o){var i,s,a,l,c,u,p,d,f,h,g,v=at.get(t);if(it(t))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&T.find.matchesSelector(gt,o),n.guid||(n.guid=T.guid++),(l=v.events)||(l=v.events=Object.create(null)),(s=v.handle)||(s=v.handle=function(e){return void 0!==T&&T.event.triggered!==e.type?T.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(G)||[""]).length;c--;)f=g=(a=Nt.exec(e[c])||[])[1],h=(a[2]||"").split(".").sort(),f&&(p=T.event.special[f]||{},f=(o?p.delegateType:p.bindType)||f,p=T.event.special[f]||{},u=T.extend({type:f,origType:g,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&T.expr.match.needsContext.test(o),namespace:h.join(".")},i),(d=l[f])||((d=l[f]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(t,r,h,s)||t.addEventListener&&t.addEventListener(f,s)),p.add&&(p.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),o?d.splice(d.delegateCount++,0,u):d.push(u),T.event.global[f]=!0)},remove:function(t,e,n,r,o){var i,s,a,l,c,u,p,d,f,h,g,v=at.hasData(t)&&at.get(t);if(v&&(l=v.events)){for(c=(e=(e||"").match(G)||[""]).length;c--;)if(f=g=(a=Nt.exec(e[c])||[])[1],h=(a[2]||"").split(".").sort(),f){for(p=T.event.special[f]||{},d=l[f=(r?p.delegateType:p.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=i=d.length;i--;)u=d[i],!o&&g!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(d.splice(i,1),u.selector&&d.delegateCount--,p.remove&&p.remove.call(t,u));s&&!d.length&&(p.teardown&&!1!==p.teardown.call(t,h,v.handle)||T.removeEvent(t,f,v.handle),delete l[f])}else for(f in l)T.event.remove(t,f+e[c],n,r,!0);T.isEmptyObject(l)&&at.remove(t,"handle events")}},dispatch:function(t){var e,n,r,o,i,s,a=new Array(arguments.length),l=T.event.fix(t),c=(at.get(this,"events")||Object.create(null))[l.type]||[],u=T.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(s=T.event.handlers.call(this,l,c),e=0;(o=s[e++])&&!l.isPropagationStopped();)for(l.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==i.namespace&&!l.rnamespace.test(i.namespace)||(l.handleObj=i,l.data=i.data,void 0!==(r=((T.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,a))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,r,o,i,s,a=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(i=[],s={},n=0;n<l;n++)void 0===s[o=(r=e[n]).selector+" "]&&(s[o]=r.needsContext?T(o,this).index(c)>-1:T.find(o,this,null,[c]).length),s[o]&&i.push(r);i.length&&a.push({elem:c,handlers:i})}return c=this,l<e.length&&a.push({elem:c,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(T.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[T.expando]?t:new T.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return Tt.test(e.type)&&e.click&&A(e,"input")&&Dt(e,"click",!0),!1},trigger:function(t){var e=this||t;return Tt.test(e.type)&&e.click&&A(e,"input")&&Dt(e,"click"),!0},_default:function(t){var e=t.target;return Tt.test(e.type)&&e.click&&A(e,"input")&&at.get(e,"click")||A(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},T.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},T.Event=function(t,e){if(!(this instanceof T.Event))return new T.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Lt:It,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&T.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[T.expando]=!0},T.Event.prototype={constructor:T.Event,isDefaultPrevented:It,isPropagationStopped:It,isImmediatePropagationStopped:It,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Lt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Lt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Lt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},T.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},T.event.addProp),T.each({focus:"focusin",blur:"focusout"},(function(t,e){function n(t){if(b.documentMode){var n=at.get(this,"handle"),r=T.event.fix(t);r.type="focusin"===t.type?"focus":"blur",r.isSimulated=!0,n(t),r.target===r.currentTarget&&n(r)}else T.event.simulate(e,t.target,T.event.fix(t))}T.event.special[t]={setup:function(){var r;if(Dt(this,t,!0),!b.documentMode)return!1;(r=at.get(this,e))||this.addEventListener(e,n),at.set(this,e,(r||0)+1)},trigger:function(){return Dt(this,t),!0},teardown:function(){var t;if(!b.documentMode)return!1;(t=at.get(this,e)-1)?at.set(this,e,t):(this.removeEventListener(e,n),at.remove(this,e))},_default:function(e){return at.get(e.target,t)},delegateType:e},T.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,o=b.documentMode?this:r,i=at.get(o,e);i||(b.documentMode?this.addEventListener(e,n):r.addEventListener(t,n,!0)),at.set(o,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=b.documentMode?this:r,i=at.get(o,e)-1;i?at.set(o,e,i):(b.documentMode?this.removeEventListener(e,n):r.removeEventListener(t,n,!0),at.remove(o,e))}}})),T.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){T.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=t.relatedTarget,o=t.handleObj;return r&&(r===this||T.contains(this,r))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}})),T.fn.extend({on:function(t,e,n,r){return $t(this,t,e,n,r)},one:function(t,e,n,r){return $t(this,t,e,n,r,1)},off:function(t,e,n){var r,o;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,T(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=It),this.each((function(){T.event.remove(this,t,n,e)}))}});var Rt=/<script|<style|<link/i,Ht=/checked\s*(?:[^=]|=\s*.checked.)/i,Ft=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Vt(t,e){return A(t,"table")&&A(11!==e.nodeType?e:e.firstChild,"tr")&&T(t).children("tbody")[0]||t}function Ut(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Bt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function zt(t,e){var n,r,o,i,s,a;if(1===e.nodeType){if(at.hasData(t)&&(a=at.get(t).events))for(o in at.remove(e,"handle events"),a)for(n=0,r=a[o].length;n<r;n++)T.event.add(e,o,a[o][n]);lt.hasData(t)&&(i=lt.access(t),s=T.extend({},i),lt.set(e,s))}}function Wt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&Tt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function qt(t,e,n,r){e=l(e);var o,i,s,a,c,u,p=0,d=t.length,f=d-1,h=e[0],g=m(h);if(g||d>1&&"string"==typeof h&&!v.checkClone&&Ht.test(h))return t.each((function(o){var i=t.eq(o);g&&(e[0]=h.call(this,o,i.html())),qt(i,e,n,r)}));if(d&&(i=(o=Mt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(a=(s=T.map(kt(o,"script"),Ut)).length;p<d;p++)c=o,p!==f&&(c=T.clone(c,!0,!0),a&&T.merge(s,kt(c,"script"))),n.call(t[p],c,p);if(a)for(u=s[s.length-1].ownerDocument,T.map(s,Bt),p=0;p<a;p++)c=s[p],At.test(c.type||"")&&!at.access(c,"globalEval")&&T.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?T._evalUrl&&!c.noModule&&T._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):_(c.textContent.replace(Ft,""),c,u))}return t}function Gt(t,e,n){for(var r,o=e?T.filter(e,t):t,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||T.cleanData(kt(r)),r.parentNode&&(n&&vt(r)&&Pt(kt(r,"script")),r.parentNode.removeChild(r));return t}T.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,o,i,s,a=t.cloneNode(!0),l=vt(t);if(!(v.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||T.isXMLDoc(t)))for(s=kt(a),r=0,o=(i=kt(t)).length;r<o;r++)Wt(i[r],s[r]);if(e)if(n)for(i=i||kt(t),s=s||kt(a),r=0,o=i.length;r<o;r++)zt(i[r],s[r]);else zt(t,a);return(s=kt(a,"script")).length>0&&Pt(s,!l&&kt(t,"script")),a},cleanData:function(t){for(var e,n,r,o=T.event.special,i=0;void 0!==(n=t[i]);i++)if(it(n)){if(e=n[at.expando]){if(e.events)for(r in e.events)o[r]?T.event.remove(n,r):T.removeEvent(n,r,e.handle);n[at.expando]=void 0}n[lt.expando]&&(n[lt.expando]=void 0)}}}),T.fn.extend({detach:function(t){return Gt(this,t,!0)},remove:function(t){return Gt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?T.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return qt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Vt(this,t).appendChild(t)}))},prepend:function(){return qt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Vt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(T.cleanData(kt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return T.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Rt.test(t)&&!Et[(Ot.exec(t)||["",""])[1].toLowerCase()]){t=T.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(T.cleanData(kt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return qt(this,arguments,(function(e){var n=this.parentNode;T.inArray(this,t)<0&&(T.cleanData(kt(this)),n&&n.replaceChild(e,this))}),t)}}),T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){T.fn[t]=function(t){for(var n,r=[],o=T(t),i=o.length-1,s=0;s<=i;s++)n=s===i?this:this.clone(!0),T(o[s])[e](n),c.apply(r,n.get());return this.pushStack(r)}}));var Kt=new RegExp("^("+dt+")(?!px)[a-z%]+$","i"),Yt=/^--/,Xt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=r),e.getComputedStyle(t)},Jt=function(t,e,n){var r,o,i={};for(o in e)i[o]=t.style[o],t.style[o]=e[o];for(o in r=n.call(t),e)t.style[o]=i[o];return r},Zt=new RegExp(ht.join("|"),"i");function Qt(t,e,n){var r,o,i,s,a=Yt.test(e),l=t.style;return(n=n||Xt(t))&&(s=n.getPropertyValue(e)||n[e],a&&s&&(s=s.replace(M,"$1")||void 0),""!==s||vt(t)||(s=T.style(t,e)),!v.pixelBoxStyles()&&Kt.test(s)&&Zt.test(e)&&(r=l.width,o=l.minWidth,i=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=n.width,l.width=r,l.minWidth=o,l.maxWidth=i)),void 0!==s?s+"":s}function te(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",gt.appendChild(c).appendChild(u);var t=r.getComputedStyle(u);n="1%"!==t.top,l=12===e(t.marginLeft),u.style.right="60%",s=36===e(t.right),o=36===e(t.width),u.style.position="absolute",i=12===e(u.offsetWidth/3),gt.removeChild(c),u=null}}function e(t){return Math.round(parseFloat(t))}var n,o,i,s,a,l,c=b.createElement("div"),u=b.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===u.style.backgroundClip,T.extend(v,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),i},reliableTrDimensions:function(){var t,e,n,o;return null==a&&(t=b.createElement("table"),e=b.createElement("tr"),n=b.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",n.style.height="9px",n.style.display="block",gt.appendChild(t).appendChild(e).appendChild(n),o=r.getComputedStyle(e),a=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===e.offsetHeight,gt.removeChild(t)),a}}))}();var ee=["Webkit","Moz","ms"],ne=b.createElement("div").style,re={};function oe(t){return T.cssProps[t]||re[t]||(t in ne?t:re[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=ee.length;n--;)if((t=ee[n]+e)in ne)return t}(t)||t)}var ie=/^(none|table(?!-c[ea]).+)/,se={position:"absolute",visibility:"hidden",display:"block"},ae={letterSpacing:"0",fontWeight:"400"};function le(t,e,n){var r=ft.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function ce(t,e,n,r,o,i){var s="width"===e?1:0,a=0,l=0,c=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(c+=T.css(t,n+ht[s],!0,o)),r?("content"===n&&(l-=T.css(t,"padding"+ht[s],!0,o)),"margin"!==n&&(l-=T.css(t,"border"+ht[s]+"Width",!0,o))):(l+=T.css(t,"padding"+ht[s],!0,o),"padding"!==n?l+=T.css(t,"border"+ht[s]+"Width",!0,o):a+=T.css(t,"border"+ht[s]+"Width",!0,o));return!r&&i>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-i-l-a-.5))||0),l+c}function ue(t,e,n){var r=Xt(t),o=(!v.boxSizingReliable()||n)&&"border-box"===T.css(t,"boxSizing",!1,r),i=o,s=Qt(t,e,r),a="offset"+e[0].toUpperCase()+e.slice(1);if(Kt.test(s)){if(!n)return s;s="auto"}return(!v.boxSizingReliable()&&o||!v.reliableTrDimensions()&&A(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===T.css(t,"display",!1,r))&&t.getClientRects().length&&(o="border-box"===T.css(t,"boxSizing",!1,r),(i=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+ce(t,e,n||(o?"border":"content"),i,r,s)+"px"}function pe(t,e,n,r,o){return new pe.prototype.init(t,e,n,r,o)}T.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,i,s,a=ot(e),l=Yt.test(e),c=t.style;if(l||(e=oe(a)),s=T.cssHooks[e]||T.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(o=s.get(t,!1,r))?o:c[e];"string"==(i=typeof n)&&(o=ft.exec(n))&&o[1]&&(n=bt(t,e,o),i="number"),null!=n&&n==n&&("number"!==i||l||(n+=o&&o[3]||(T.cssNumber[a]?"":"px")),v.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,r))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var o,i,s,a=ot(e);return Yt.test(e)||(e=oe(a)),(s=T.cssHooks[e]||T.cssHooks[a])&&"get"in s&&(o=s.get(t,!0,n)),void 0===o&&(o=Qt(t,e,r)),"normal"===o&&e in ae&&(o=ae[e]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),T.each(["height","width"],(function(t,e){T.cssHooks[e]={get:function(t,n,r){if(n)return!ie.test(T.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ue(t,e,r):Jt(t,se,(function(){return ue(t,e,r)}))},set:function(t,n,r){var o,i=Xt(t),s=!v.scrollboxSize()&&"absolute"===i.position,a=(s||r)&&"border-box"===T.css(t,"boxSizing",!1,i),l=r?ce(t,e,r,a,i):0;return a&&s&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(i[e])-ce(t,e,"border",!1,i)-.5)),l&&(o=ft.exec(n))&&"px"!==(o[3]||"px")&&(t.style[e]=n,n=T.css(t,e)),le(0,n,l)}}})),T.cssHooks.marginLeft=te(v.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Qt(t,"marginLeft"))||t.getBoundingClientRect().left-Jt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),T.each({margin:"",padding:"",border:"Width"},(function(t,e){T.cssHooks[t+e]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[t+ht[r]+e]=i[r]||i[r-2]||i[0];return o}},"margin"!==t&&(T.cssHooks[t+e].set=le)})),T.fn.extend({css:function(t,e){return tt(this,(function(t,e,n){var r,o,i={},s=0;if(Array.isArray(e)){for(r=Xt(t),o=e.length;s<o;s++)i[e[s]]=T.css(t,e[s],!1,r);return i}return void 0!==n?T.style(t,e,n):T.css(t,e)}),t,e,arguments.length>1)}}),T.Tween=pe,pe.prototype={constructor:pe,init:function(t,e,n,r,o,i){this.elem=t,this.prop=n,this.easing=o||T.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=i||(T.cssNumber[n]?"":"px")},cur:function(){var t=pe.propHooks[this.prop];return t&&t.get?t.get(this):pe.propHooks._default.get(this)},run:function(t){var e,n=pe.propHooks[this.prop];return this.options.duration?this.pos=e=T.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):pe.propHooks._default.set(this),this}},pe.prototype.init.prototype=pe.prototype,pe.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=T.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){T.fx.step[t.prop]?T.fx.step[t.prop](t):1!==t.elem.nodeType||!T.cssHooks[t.prop]&&null==t.elem.style[oe(t.prop)]?t.elem[t.prop]=t.now:T.style(t.elem,t.prop,t.now+t.unit)}}},pe.propHooks.scrollTop=pe.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},T.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},T.fx=pe.prototype.init,T.fx.step={};var de,fe,he=/^(?:toggle|show|hide)$/,ge=/queueHooks$/;function ve(){fe&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ve):r.setTimeout(ve,T.fx.interval),T.fx.tick())}function me(){return r.setTimeout((function(){de=void 0})),de=Date.now()}function ye(t,e){var n,r=0,o={height:t};for(e=e?1:0;r<4;r+=2-e)o["margin"+(n=ht[r])]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function be(t,e,n){for(var r,o=(we.tweeners[e]||[]).concat(we.tweeners["*"]),i=0,s=o.length;i<s;i++)if(r=o[i].call(n,e,t))return r}function we(t,e,n){var r,o,i=0,s=we.prefilters.length,a=T.Deferred().always((function(){delete l.elem})),l=function(){if(o)return!1;for(var e=de||me(),n=Math.max(0,c.startTime+c.duration-e),r=1-(n/c.duration||0),i=0,s=c.tweens.length;i<s;i++)c.tweens[i].run(r);return a.notifyWith(t,[c,r,n]),r<1&&s?n:(s||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:T.extend({},e),opts:T.extend(!0,{specialEasing:{},easing:T.easing._default},n),originalProperties:e,originalOptions:n,startTime:de||me(),duration:n.duration,tweens:[],createTween:function(e,n){var r=T.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(r),r},stop:function(e){var n=0,r=e?c.tweens.length:0;if(o)return this;for(o=!0;n<r;n++)c.tweens[n].run(1);return e?(a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c,e])):a.rejectWith(t,[c,e]),this}}),u=c.props;for(function(t,e){var n,r,o,i,s;for(n in t)if(o=e[r=ot(n)],i=t[n],Array.isArray(i)&&(o=i[1],i=t[n]=i[0]),n!==r&&(t[r]=i,delete t[n]),(s=T.cssHooks[r])&&"expand"in s)for(n in i=s.expand(i),delete t[r],i)n in t||(t[n]=i[n],e[n]=o);else e[r]=o}(u,c.opts.specialEasing);i<s;i++)if(r=we.prefilters[i].call(c,t,u,c.opts))return m(r.stop)&&(T._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return T.map(u,be,c),m(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),T.fx.timer(T.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}T.Animation=T.extend(we,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return bt(n.elem,t,ft.exec(e),n),n}]},tweener:function(t,e){m(t)?(e=t,t=["*"]):t=t.match(G);for(var n,r=0,o=t.length;r<o;r++)n=t[r],we.tweeners[n]=we.tweeners[n]||[],we.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,o,i,s,a,l,c,u,p="width"in e||"height"in e,d=this,f={},h=t.style,g=t.nodeType&&yt(t),v=at.get(t,"fxshow");for(r in n.queue||(null==(s=T._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always((function(){d.always((function(){s.unqueued--,T.queue(t,"fx").length||s.empty.fire()}))}))),e)if(o=e[r],he.test(o)){if(delete e[r],i=i||"toggle"===o,o===(g?"hide":"show")){if("show"!==o||!v||void 0===v[r])continue;g=!0}f[r]=v&&v[r]||T.style(t,r)}if((l=!T.isEmptyObject(e))||!T.isEmptyObject(f))for(r in p&&1===t.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(c=v&&v.display)&&(c=at.get(t,"display")),"none"===(u=T.css(t,"display"))&&(c?u=c:(xt([t],!0),c=t.style.display||c,u=T.css(t,"display"),xt([t]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===T.css(t,"float")&&(l||(d.done((function(){h.display=c})),null==c&&(u=h.display,c="none"===u?"":u)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always((function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}))),l=!1,f)l||(v?"hidden"in v&&(g=v.hidden):v=at.access(t,"fxshow",{display:c}),i&&(v.hidden=!g),g&&xt([t],!0),d.done((function(){for(r in g||xt([t]),at.remove(t,"fxshow"),f)T.style(t,r,f[r])}))),l=be(g?v[r]:0,r,d),r in v||(v[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?we.prefilters.unshift(t):we.prefilters.push(t)}}),T.speed=function(t,e,n){var r=t&&"object"==typeof t?T.extend({},t):{complete:n||!n&&e||m(t)&&t,duration:t,easing:n&&e||e&&!m(e)&&e};return T.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in T.fx.speeds?r.duration=T.fx.speeds[r.duration]:r.duration=T.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&T.dequeue(this,r.queue)},r},T.fn.extend({fadeTo:function(t,e,n,r){return this.filter(yt).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var o=T.isEmptyObject(t),i=T.speed(e,n,r),s=function(){var e=we(this,T.extend({},t),i);(o||at.get(this,"finish"))&&e.stop(!0)};return s.finish=s,o||!1===i.queue?this.each(s):this.queue(i.queue,s)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,o=null!=t&&t+"queueHooks",i=T.timers,s=at.get(this);if(o)s[o]&&s[o].stop&&r(s[o]);else for(o in s)s[o]&&s[o].stop&&ge.test(o)&&r(s[o]);for(o=i.length;o--;)i[o].elem!==this||null!=t&&i[o].queue!==t||(i[o].anim.stop(n),e=!1,i.splice(o,1));!e&&n||T.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=at.get(this),r=n[t+"queue"],o=n[t+"queueHooks"],i=T.timers,s=r?r.length:0;for(n.finish=!0,T.queue(this,t,[]),o&&o.stop&&o.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===t&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<s;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish}))}}),T.each(["toggle","show","hide"],(function(t,e){var n=T.fn[e];T.fn[e]=function(t,r,o){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(ye(e,!0),t,r,o)}})),T.each({slideDown:ye("show"),slideUp:ye("hide"),slideToggle:ye("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){T.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}})),T.timers=[],T.fx.tick=function(){var t,e=0,n=T.timers;for(de=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||T.fx.stop(),de=void 0},T.fx.timer=function(t){T.timers.push(t),T.fx.start()},T.fx.interval=13,T.fx.start=function(){fe||(fe=!0,ve())},T.fx.stop=function(){fe=null},T.fx.speeds={slow:600,fast:200,_default:400},T.fn.delay=function(t,e){return t=T.fx&&T.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,n){var o=r.setTimeout(e,t);n.stop=function(){r.clearTimeout(o)}}))},function(){var t=b.createElement("input"),e=b.createElement("select").appendChild(b.createElement("option"));t.type="checkbox",v.checkOn=""!==t.value,v.optSelected=e.selected,(t=b.createElement("input")).value="t",t.type="radio",v.radioValue="t"===t.value}();var _e,xe=T.expr.attrHandle;T.fn.extend({attr:function(t,e){return tt(this,T.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){T.removeAttr(this,t)}))}}),T.extend({attr:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===t.getAttribute?T.prop(t,e,n):(1===i&&T.isXMLDoc(t)||(o=T.attrHooks[e.toLowerCase()]||(T.expr.match.bool.test(e)?_e:void 0)),void 0!==n?null===n?void T.removeAttr(t,e):o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:(t.setAttribute(e,n+""),n):o&&"get"in o&&null!==(r=o.get(t,e))?r:null==(r=T.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&A(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,o=e&&e.match(G);if(o&&1===t.nodeType)for(;n=o[r++];)t.removeAttribute(n)}}),_e={set:function(t,e,n){return!1===e?T.removeAttr(t,n):t.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=xe[e]||T.find.attr;xe[e]=function(t,e,r){var o,i,s=e.toLowerCase();return r||(i=xe[s],xe[s]=o,o=null!=n(t,e,r)?s:null,xe[s]=i),o}}));var Ce=/^(?:input|select|textarea|button)$/i,Se=/^(?:a|area)$/i;function Te(t){return(t.match(G)||[]).join(" ")}function Oe(t){return t.getAttribute&&t.getAttribute("class")||""}function Ae(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(G)||[]}T.fn.extend({prop:function(t,e){return tt(this,T.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[T.propFix[t]||t]}))}}),T.extend({prop:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&T.isXMLDoc(t)||(e=T.propFix[e]||e,o=T.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:t[e]=n:o&&"get"in o&&null!==(r=o.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=T.find.attr(t,"tabindex");return e?parseInt(e,10):Ce.test(t.nodeName)||Se.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(T.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){T.propFix[this.toLowerCase()]=this})),T.fn.extend({addClass:function(t){var e,n,r,o,i,s;return m(t)?this.each((function(e){T(this).addClass(t.call(this,e,Oe(this)))})):(e=Ae(t)).length?this.each((function(){if(r=Oe(this),n=1===this.nodeType&&" "+Te(r)+" "){for(i=0;i<e.length;i++)o=e[i],n.indexOf(" "+o+" ")<0&&(n+=o+" ");s=Te(n),r!==s&&this.setAttribute("class",s)}})):this},removeClass:function(t){var e,n,r,o,i,s;return m(t)?this.each((function(e){T(this).removeClass(t.call(this,e,Oe(this)))})):arguments.length?(e=Ae(t)).length?this.each((function(){if(r=Oe(this),n=1===this.nodeType&&" "+Te(r)+" "){for(i=0;i<e.length;i++)for(o=e[i];n.indexOf(" "+o+" ")>-1;)n=n.replace(" "+o+" "," ");s=Te(n),r!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(t,e){var n,r,o,i,s=typeof t,a="string"===s||Array.isArray(t);return m(t)?this.each((function(n){T(this).toggleClass(t.call(this,n,Oe(this),e),e)})):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(n=Ae(t),this.each((function(){if(a)for(i=T(this),o=0;o<n.length;o++)r=n[o],i.hasClass(r)?i.removeClass(r):i.addClass(r);else void 0!==t&&"boolean"!==s||((r=Oe(this))&&at.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":at.get(this,"__className__")||""))})))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+Te(Oe(n))+" ").indexOf(e)>-1)return!0;return!1}});var Ee=/\r/g;T.fn.extend({val:function(t){var e,n,r,o=this[0];return arguments.length?(r=m(t),this.each((function(n){var o;1===this.nodeType&&(null==(o=r?t.call(this,n,T(this).val()):t)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=T.map(o,(function(t){return null==t?"":t+""}))),(e=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))}))):o?(e=T.valHooks[o.type]||T.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(Ee,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(t){var e=T.find.attr(t,"value");return null!=e?e:Te(T.text(t))}},select:{get:function(t){var e,n,r,o=t.options,i=t.selectedIndex,s="select-one"===t.type,a=s?null:[],l=s?i+1:o.length;for(r=i<0?l:s?i:0;r<l;r++)if(((n=o[r]).selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(e=T(n).val(),s)return e;a.push(e)}return a},set:function(t,e){for(var n,r,o=t.options,i=T.makeArray(e),s=o.length;s--;)((r=o[s]).selected=T.inArray(T.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(t.selectedIndex=-1),i}}}}),T.each(["radio","checkbox"],(function(){T.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=T.inArray(T(t).val(),e)>-1}},v.checkOn||(T.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var ke=r.location,Pe={guid:Date.now()},je=/\?/;T.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||T.error("Invalid XML: "+(n?T.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Me=/^(?:focusinfocus|focusoutblur)$/,Ne=function(t){t.stopPropagation()};T.extend(T.event,{trigger:function(t,e,n,o){var i,s,a,l,c,u,p,d,h=[n||b],g=f.call(t,"type")?t.type:t,v=f.call(t,"namespace")?t.namespace.split("."):[];if(s=d=a=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!Me.test(g+T.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),c=g.indexOf(":")<0&&"on"+g,(t=t[T.expando]?t:new T.Event(g,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:T.makeArray(e,[t]),p=T.event.special[g]||{},o||!p.trigger||!1!==p.trigger.apply(n,e))){if(!o&&!p.noBubble&&!y(n)){for(l=p.delegateType||g,Me.test(l+g)||(s=s.parentNode);s;s=s.parentNode)h.push(s),a=s;a===(n.ownerDocument||b)&&h.push(a.defaultView||a.parentWindow||r)}for(i=0;(s=h[i++])&&!t.isPropagationStopped();)d=s,t.type=i>1?l:p.bindType||g,(u=(at.get(s,"events")||Object.create(null))[t.type]&&at.get(s,"handle"))&&u.apply(s,e),(u=c&&s[c])&&u.apply&&it(s)&&(t.result=u.apply(s,e),!1===t.result&&t.preventDefault());return t.type=g,o||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(h.pop(),e)||!it(n)||c&&m(n[g])&&!y(n)&&((a=n[c])&&(n[c]=null),T.event.triggered=g,t.isPropagationStopped()&&d.addEventListener(g,Ne),n[g](),t.isPropagationStopped()&&d.removeEventListener(g,Ne),T.event.triggered=void 0,a&&(n[c]=a)),t.result}},simulate:function(t,e,n){var r=T.extend(new T.Event,n,{type:t,isSimulated:!0});T.event.trigger(r,null,e)}}),T.fn.extend({trigger:function(t,e){return this.each((function(){T.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return T.event.trigger(t,e,n,!0)}});var Le=/\[\]$/,Ie=/\r?\n/g,$e=/^(?:submit|button|image|reset|file)$/i,De=/^(?:input|select|textarea|keygen)/i;function Re(t,e,n,r){var o;if(Array.isArray(e))T.each(e,(function(e,o){n||Le.test(t)?r(t,o):Re(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,n,r)}));else if(n||"object"!==x(e))r(t,e);else for(o in e)Re(t+"["+o+"]",e[o],n,r)}T.param=function(t,e){var n,r=[],o=function(t,e){var n=m(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!T.isPlainObject(t))T.each(t,(function(){o(this.name,this.value)}));else for(n in t)Re(n,t[n],e,o);return r.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=T.prop(this,"elements");return t?T.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!T(this).is(":disabled")&&De.test(this.nodeName)&&!$e.test(t)&&(this.checked||!Tt.test(t))})).map((function(t,e){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,(function(t){return{name:e.name,value:t.replace(Ie,"\r\n")}})):{name:e.name,value:n.replace(Ie,"\r\n")}})).get()}});var He=/%20/g,Fe=/#.*$/,Ve=/([?&])_=[^&]*/,Ue=/^(.*?):[ \t]*([^\r\n]*)$/gm,Be=/^(?:GET|HEAD)$/,ze=/^\/\//,We={},qe={},Ge="*/".concat("*"),Ke=b.createElement("a");function Ye(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,o=0,i=e.toLowerCase().match(G)||[];if(m(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Xe(t,e,n,r){var o={},i=t===qe;function s(a){var l;return o[a]=!0,T.each(t[a]||[],(function(t,a){var c=a(e,n,r);return"string"!=typeof c||i||o[c]?i?!(l=c):void 0:(e.dataTypes.unshift(c),s(c),!1)})),l}return s(e.dataTypes[0])||!o["*"]&&s("*")}function Je(t,e){var n,r,o=T.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:r||(r={}))[n]=e[n]);return r&&T.extend(!0,t,r),t}Ke.href=ke.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ge,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Je(Je(t,T.ajaxSettings),e):Je(T.ajaxSettings,t)},ajaxPrefilter:Ye(We),ajaxTransport:Ye(qe),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,o,i,s,a,l,c,u,p,d,f=T.ajaxSetup({},e),h=f.context||f,g=f.context&&(h.nodeType||h.jquery)?T(h):T.event,v=T.Deferred(),m=T.Callbacks("once memory"),y=f.statusCode||{},w={},_={},x="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(c){if(!s)for(s={};e=Ue.exec(i);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?i:null},setRequestHeader:function(t,e){return null==c&&(t=_[t.toLowerCase()]=_[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)C.always(t[C.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||x;return n&&n.abort(e),S(0,e),this}};if(v.promise(C),f.url=((t||f.url||ke.href)+"").replace(ze,ke.protocol+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(G)||[""],null==f.crossDomain){l=b.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ke.protocol+"//"+Ke.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=T.param(f.data,f.traditional)),Xe(We,f,e,C),c)return C;for(p in(u=T.event&&f.global)&&0==T.active++&&T.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Be.test(f.type),o=f.url.replace(Fe,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(He,"+")):(d=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(je.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(Ve,"$1"),d=(je.test(o)?"&":"?")+"_="+Pe.guid+++d),f.url=o+d),f.ifModified&&(T.lastModified[o]&&C.setRequestHeader("If-Modified-Since",T.lastModified[o]),T.etag[o]&&C.setRequestHeader("If-None-Match",T.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||e.contentType)&&C.setRequestHeader("Content-Type",f.contentType),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ge+"; q=0.01":""):f.accepts["*"]),f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(h,C,f)||c))return C.abort();if(x="abort",m.add(f.complete),C.done(f.success),C.fail(f.error),n=Xe(qe,f,e,C)){if(C.readyState=1,u&&g.trigger("ajaxSend",[C,f]),c)return C;f.async&&f.timeout>0&&(a=r.setTimeout((function(){C.abort("timeout")}),f.timeout));try{c=!1,n.send(w,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,s,l){var p,d,b,w,_,x=e;c||(c=!0,a&&r.clearTimeout(a),n=void 0,i=l||"",C.readyState=t>0?4:0,p=t>=200&&t<300||304===t,s&&(w=function(t,e,n){for(var r,o,i,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(o in a)if(a[o]&&a[o].test(r)){l.unshift(o);break}if(l[0]in n)i=l[0];else{for(o in n){if(!l[0]||t.converters[o+" "+l[0]]){i=o;break}s||(s=o)}i=i||s}if(i)return i!==l[0]&&l.unshift(i),n[i]}(f,C,s)),!p&&T.inArray("script",f.dataTypes)>-1&&T.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),w=function(t,e,n,r){var o,i,s,a,l,c={},u=t.dataTypes.slice();if(u[1])for(s in t.converters)c[s.toLowerCase()]=t.converters[s];for(i=u.shift();i;)if(t.responseFields[i]&&(n[t.responseFields[i]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=i,i=u.shift())if("*"===i)i=l;else if("*"!==l&&l!==i){if(!(s=c[l+" "+i]||c["* "+i]))for(o in c)if((a=o.split(" "))[1]===i&&(s=c[l+" "+a[0]]||c["* "+a[0]])){!0===s?s=c[o]:!0!==c[o]&&(i=a[0],u.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+i}}}return{state:"success",data:e}}(f,w,C,p),p?(f.ifModified&&((_=C.getResponseHeader("Last-Modified"))&&(T.lastModified[o]=_),(_=C.getResponseHeader("etag"))&&(T.etag[o]=_)),204===t||"HEAD"===f.type?x="nocontent":304===t?x="notmodified":(x=w.state,d=w.data,p=!(b=w.error))):(b=x,!t&&x||(x="error",t<0&&(t=0))),C.status=t,C.statusText=(e||x)+"",p?v.resolveWith(h,[d,x,C]):v.rejectWith(h,[C,x,b]),C.statusCode(y),y=void 0,u&&g.trigger(p?"ajaxSuccess":"ajaxError",[C,f,p?d:b]),m.fireWith(h,[C,x]),u&&(g.trigger("ajaxComplete",[C,f]),--T.active||T.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,n){return T.get(t,e,n,"json")},getScript:function(t,e){return T.get(t,void 0,e,"script")}}),T.each(["get","post"],(function(t,e){T[e]=function(t,n,r,o){return m(n)&&(o=o||r,r=n,n=void 0),T.ajax(T.extend({url:t,type:e,dataType:o,data:n,success:r},T.isPlainObject(t)&&t))}})),T.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),T._evalUrl=function(t,e,n){return T.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){T.globalEval(t,e,n)}})},T.fn.extend({wrapAll:function(t){var e;return this[0]&&(m(t)&&(t=t.call(this[0])),e=T(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return m(t)?this.each((function(e){T(this).wrapInner(t.call(this,e))})):this.each((function(){var e=T(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=m(t);return this.each((function(n){T(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){T(this).replaceWith(this.childNodes)})),this}}),T.expr.pseudos.hidden=function(t){return!T.expr.pseudos.visible(t)},T.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Ze={0:200,1223:204},Qe=T.ajaxSettings.xhr();v.cors=!!Qe&&"withCredentials"in Qe,v.ajax=Qe=!!Qe,T.ajaxTransport((function(t){var e,n;if(v.cors||Qe&&!t.crossDomain)return{send:function(o,i){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)a.setRequestHeader(s,o[s]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?i(0,"error"):i(a.status,a.statusText):i(Ze[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),T.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return T.globalEval(t),t}}}),T.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),T.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,o){e=T("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&o("error"===t.type?404:200,t.type)}),b.head.appendChild(e[0])},abort:function(){n&&n()}}}));var tn,en=[],nn=/(=)\?(?=&|$)|\?\?/;T.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=en.pop()||T.expando+"_"+Pe.guid++;return this[t]=!0,t}}),T.ajaxPrefilter("json jsonp",(function(t,e,n){var o,i,s,a=!1!==t.jsonp&&(nn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(nn,"$1"+o):!1!==t.jsonp&&(t.url+=(je.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return s||T.error(o+" was not called"),s[0]},t.dataTypes[0]="json",i=r[o],r[o]=function(){s=arguments},n.always((function(){void 0===i?T(r).removeProp(o):r[o]=i,t[o]&&(t.jsonpCallback=e.jsonpCallback,en.push(o)),s&&m(i)&&i(s[0]),s=i=void 0})),"script"})),v.createHTMLDocument=((tn=b.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===tn.childNodes.length),T.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(v.createHTMLDocument?((r=(e=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,e.head.appendChild(r)):e=b),i=!n&&[],(o=F.exec(t))?[e.createElement(o[1])]:(o=Mt([t],e,i),i&&i.length&&T(i).remove(),T.merge([],o.childNodes)));var r,o,i},T.fn.load=function(t,e,n){var r,o,i,s=this,a=t.indexOf(" ");return a>-1&&(r=Te(t.slice(a)),t=t.slice(0,a)),m(e)?(n=e,e=void 0):e&&"object"==typeof e&&(o="POST"),s.length>0&&T.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done((function(t){i=arguments,s.html(r?T("<div>").append(T.parseHTML(t)).find(r):t)})).always(n&&function(t,e){s.each((function(){n.apply(this,i||[t.responseText,e,t])}))}),this},T.expr.pseudos.animated=function(t){return T.grep(T.timers,(function(e){return t===e.elem})).length},T.offset={setOffset:function(t,e,n){var r,o,i,s,a,l,c=T.css(t,"position"),u=T(t),p={};"static"===c&&(t.style.position="relative"),a=u.offset(),i=T.css(t,"top"),l=T.css(t,"left"),("absolute"===c||"fixed"===c)&&(i+l).indexOf("auto")>-1?(s=(r=u.position()).top,o=r.left):(s=parseFloat(i)||0,o=parseFloat(l)||0),m(e)&&(e=e.call(t,n,T.extend({},a))),null!=e.top&&(p.top=e.top-a.top+s),null!=e.left&&(p.left=e.left-a.left+o),"using"in e?e.using.call(t,p):u.css(p)}},T.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){T.offset.setOffset(this,t,e)}));var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],o={top:0,left:0};if("fixed"===T.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===T.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((o=T(t).offset()).top+=T.css(t,"borderTopWidth",!0),o.left+=T.css(t,"borderLeftWidth",!0))}return{top:e.top-o.top-T.css(r,"marginTop",!0),left:e.left-o.left-T.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===T.css(t,"position");)t=t.offsetParent;return t||gt}))}}),T.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;T.fn[t]=function(r){return tt(this,(function(t,r,o){var i;if(y(t)?i=t:9===t.nodeType&&(i=t.defaultView),void 0===o)return i?i[e]:t[r];i?i.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):t[r]=o}),t,r,arguments.length)}})),T.each(["top","left"],(function(t,e){T.cssHooks[e]=te(v.pixelPosition,(function(t,n){if(n)return n=Qt(t,e),Kt.test(n)?T(t).position()[e]+"px":n}))})),T.each({Height:"height",Width:"width"},(function(t,e){T.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,r){T.fn[r]=function(o,i){var s=arguments.length&&(n||"boolean"!=typeof o),a=n||(!0===o||!0===i?"margin":"border");return tt(this,(function(e,n,o){var i;return y(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])):void 0===o?T.css(e,n,a):T.style(e,n,o,a)}),e,s?o:void 0,s)}}))})),T.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){T.fn[e]=function(t){return this.on(e,t)}})),T.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),T.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){T.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var rn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;T.proxy=function(t,e){var n,r,o;if("string"==typeof e&&(n=t[e],e=t,t=n),m(t))return r=a.call(arguments,2),o=function(){return t.apply(e||this,r.concat(a.call(arguments)))},o.guid=t.guid=t.guid||T.guid++,o},T.holdReady=function(t){t?T.readyWait++:T.ready(!0)},T.isArray=Array.isArray,T.parseJSON=JSON.parse,T.nodeName=A,T.isFunction=m,T.isWindow=y,T.camelCase=ot,T.type=x,T.now=Date.now,T.isNumeric=function(t){var e=T.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},T.trim=function(t){return null==t?"":(t+"").replace(rn,"$1")},void 0===(n=function(){return T}.apply(e,[]))||(t.exports=n);var on=r.jQuery,sn=r.$;return T.noConflict=function(t){return r.$===T&&(r.$=sn),t&&r.jQuery===T&&(r.jQuery=on),T},void 0===o&&(r.jQuery=r.$=T),T}))},523:(t,e,n)=>{"use strict";n.r(e),n.d(e,{VERSION:()=>o,after:()=>Le,all:()=>tn,allKeys:()=>vt,any:()=>en,assign:()=>Lt,before:()=>Ie,bind:()=>xe,bindAll:()=>Te,chain:()=>ye,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ke,compact:()=>An,compose:()=>Ne,constant:()=>Z,contains:()=>nn,countBy:()=>mn,create:()=>Dt,debounce:()=>Pe,default:()=>Bn,defaults:()=>It,defer:()=>Ee,delay:()=>Ae,detect:()=>We,difference:()=>kn,drop:()=>Tn,each:()=>Ge,escape:()=>se,every:()=>tn,extend:()=>Nt,extendOwn:()=>Lt,filter:()=>Ze,find:()=>We,findIndex:()=>He,findKey:()=>De,findLastIndex:()=>Fe,findWhere:()=>qe,first:()=>Sn,flatten:()=>En,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ge,functions:()=>jt,get:()=>Bt,groupBy:()=>gn,has:()=>zt,head:()=>Sn,identity:()=>Wt,include:()=>nn,includes:()=>nn,indexBy:()=>vn,indexOf:()=>Be,initial:()=>Cn,inject:()=>Xe,intersection:()=>Nn,invert:()=>Pt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>D,isBoolean:()=>E,isDataView:()=>W,isDate:()=>N,isElement:()=>k,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>I,isFinite:()=>X,isFunction:()=>F,isMap:()=>St,isMatch:()=>ct,isNaN:()=>J,isNull:()=>O,isNumber:()=>M,isObject:()=>T,isRegExp:()=>L,isSet:()=>Ot,isString:()=>j,isSymbol:()=>$,isTypedArray:()=>ot,isUndefined:()=>A,isWeakMap:()=>Tt,isWeakSet:()=>At,iteratee:()=>Xt,keys:()=>at,last:()=>On,lastIndexOf:()=>ze,map:()=>Ke,mapObject:()=>Zt,matcher:()=>qt,matches:()=>qt,max:()=>an,memoize:()=>Oe,methods:()=>jt,min:()=>ln,mixin:()=>Fn,negate:()=>Me,noop:()=>Qt,now:()=>re,object:()=>$n,omit:()=>xn,once:()=>$e,pairs:()=>kt,partial:()=>_e,partition:()=>yn,pick:()=>_n,pluck:()=>on,property:()=>Gt,propertyOf:()=>te,random:()=>ne,range:()=>Dn,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>Qe,rest:()=>Tn,restArguments:()=>S,result:()=>ge,sample:()=>pn,select:()=>Ze,shuffle:()=>dn,size:()=>bn,some:()=>en,sortBy:()=>fn,sortedIndex:()=>Ve,tail:()=>Tn,take:()=>Sn,tap:()=>Ht,template:()=>he,templateSettings:()=>le,throttle:()=>ke,times:()=>ee,toArray:()=>un,toPath:()=>Ft,transpose:()=>Ln,unescape:()=>ae,union:()=>Mn,uniq:()=>jn,unique:()=>jn,uniqueId:()=>me,unzip:()=>Ln,values:()=>Et,where:()=>sn,without:()=>Pn,wrap:()=>je,zip:()=>In});var r={};n.r(r),n.d(r,{VERSION:()=>o,after:()=>Le,all:()=>tn,allKeys:()=>vt,any:()=>en,assign:()=>Lt,before:()=>Ie,bind:()=>xe,bindAll:()=>Te,chain:()=>ye,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ke,compact:()=>An,compose:()=>Ne,constant:()=>Z,contains:()=>nn,countBy:()=>mn,create:()=>Dt,debounce:()=>Pe,default:()=>Vn,defaults:()=>It,defer:()=>Ee,delay:()=>Ae,detect:()=>We,difference:()=>kn,drop:()=>Tn,each:()=>Ge,escape:()=>se,every:()=>tn,extend:()=>Nt,extendOwn:()=>Lt,filter:()=>Ze,find:()=>We,findIndex:()=>He,findKey:()=>De,findLastIndex:()=>Fe,findWhere:()=>qe,first:()=>Sn,flatten:()=>En,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ge,functions:()=>jt,get:()=>Bt,groupBy:()=>gn,has:()=>zt,head:()=>Sn,identity:()=>Wt,include:()=>nn,includes:()=>nn,indexBy:()=>vn,indexOf:()=>Be,initial:()=>Cn,inject:()=>Xe,intersection:()=>Nn,invert:()=>Pt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>D,isBoolean:()=>E,isDataView:()=>W,isDate:()=>N,isElement:()=>k,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>I,isFinite:()=>X,isFunction:()=>F,isMap:()=>St,isMatch:()=>ct,isNaN:()=>J,isNull:()=>O,isNumber:()=>M,isObject:()=>T,isRegExp:()=>L,isSet:()=>Ot,isString:()=>j,isSymbol:()=>$,isTypedArray:()=>ot,isUndefined:()=>A,isWeakMap:()=>Tt,isWeakSet:()=>At,iteratee:()=>Xt,keys:()=>at,last:()=>On,lastIndexOf:()=>ze,map:()=>Ke,mapObject:()=>Zt,matcher:()=>qt,matches:()=>qt,max:()=>an,memoize:()=>Oe,methods:()=>jt,min:()=>ln,mixin:()=>Fn,negate:()=>Me,noop:()=>Qt,now:()=>re,object:()=>$n,omit:()=>xn,once:()=>$e,pairs:()=>kt,partial:()=>_e,partition:()=>yn,pick:()=>_n,pluck:()=>on,property:()=>Gt,propertyOf:()=>te,random:()=>ne,range:()=>Dn,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>Qe,rest:()=>Tn,restArguments:()=>S,result:()=>ge,sample:()=>pn,select:()=>Ze,shuffle:()=>dn,size:()=>bn,some:()=>en,sortBy:()=>fn,sortedIndex:()=>Ve,tail:()=>Tn,take:()=>Sn,tap:()=>Ht,template:()=>he,templateSettings:()=>le,throttle:()=>ke,times:()=>ee,toArray:()=>un,toPath:()=>Ft,transpose:()=>Ln,unescape:()=>ae,union:()=>Mn,uniq:()=>jn,unique:()=>jn,uniqueId:()=>me,unzip:()=>Ln,values:()=>Et,where:()=>sn,without:()=>Pn,wrap:()=>je,zip:()=>In});var o="1.13.6",i="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},s=Array.prototype,a=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=s.push,u=s.slice,p=a.toString,d=a.hasOwnProperty,f="undefined"!=typeof ArrayBuffer,h="undefined"!=typeof DataView,g=Array.isArray,v=Object.keys,m=Object.create,y=f&&ArrayBuffer.isView,b=isNaN,w=isFinite,_=!{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),r=Array(n),o=0;o<n;o++)r[o]=arguments[o+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var i=Array(e+1);for(o=0;o<e;o++)i[o]=arguments[o];return i[e]=r,t.apply(this,i)}}function T(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function O(t){return null===t}function A(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 P(t){var e="[object "+t+"]";return function(t){return p.call(t)===e}}const j=P("String"),M=P("Number"),N=P("Date"),L=P("RegExp"),I=P("Error"),$=P("Symbol"),D=P("ArrayBuffer");var R=P("Function"),H=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof H&&(R=function(t){return"function"==typeof t||!1});const F=R,V=P("Object");var U=h&&V(new DataView(new ArrayBuffer(8))),B="undefined"!=typeof Map&&V(new Map),z=P("DataView");const W=U?function(t){return null!=t&&F(t.getInt8)&&D(t.buffer)}:z,q=g||P("Array");function G(t,e){return null!=t&&d.call(t,e)}var K=P("Arguments");!function(){K(arguments)||(K=function(t){return G(t,"callee")})}();const Y=K;function X(t){return!$(t)&&w(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 rt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const ot=f?function(t){return y?y(t)&&!W(t):nt(t)&&rt.test(p.call(t))}:Z(!1),it=tt("length");function st(t,e){e=function(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return!0===e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=x.length,r=t.constructor,o=F(r)&&r.prototype||a,i="constructor";for(G(t,i)&&!e.contains(i)&&e.push(i);n--;)(i=x[n])in t&&t[i]!==o[i]&&!e.contains(i)&&e.push(i)}function at(t){if(!T(t))return[];if(v)return v(t);var e=[];for(var n in t)G(t,n)&&e.push(n);return _&&st(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(at(t))}function ct(t,e){var n=at(e),r=n.length;if(null==t)return!r;for(var o=Object(t),i=0;i<r;i++){var s=n[i];if(e[s]!==o[s]||!(s in o))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=o,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,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var o=typeof t;return("function"===o||"object"===o||"object"==typeof e)&&ht(t,e,n,r)}function ht(t,e,n,r){t instanceof ut&&(t=t._wrapped),e instanceof ut&&(e=e._wrapped);var o=p.call(t);if(o!==p.call(e))return!1;if(U&&"[object Object]"==o&&W(t)){if(!W(e))return!1;o=dt}switch(o){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,r)}var i="[object Array]"===o;if(!i&&ot(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 s=t.constructor,a=e.constructor;if(s!==a&&!(F(s)&&s instanceof s&&F(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var c=(n=n||[]).length;c--;)if(n[c]===t)return r[c]===e;if(n.push(t),r.push(e),i){if((c=t.length)!==e.length)return!1;for(;c--;)if(!ft(t[c],e[c],n,r))return!1}else{var u,d=at(t);if(c=d.length,at(e).length!==c)return!1;for(;c--;)if(!G(e,u=d[c])||!ft(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0}function gt(t,e){return ft(t,e)}function vt(t){if(!T(t))return[];var e=[];for(var n in t)e.push(n);return _&&st(t,e),e}function mt(t){var e=it(t);return function(n){if(null==n)return!1;var r=vt(n);if(it(r))return!1;for(var o=0;o<e;o++)if(!F(n[t[o]]))return!1;return t!==xt||!F(n[yt])}}var yt="forEach",bt=["clear","delete"],wt=["get","has","set"],_t=bt.concat(yt,wt),xt=bt.concat(wt),Ct=["add"].concat(bt,yt,"has");const St=B?mt(_t):P("Map"),Tt=B?mt(xt):P("WeakMap"),Ot=B?mt(Ct):P("Set"),At=P("WeakSet");function Et(t){for(var e=at(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=t[e[o]];return r}function kt(t){for(var e=at(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=[e[o],t[e[o]]];return r}function Pt(t){for(var e={},n=at(t),r=0,o=n.length;r<o;r++)e[t[n[r]]]=n[r];return e}function jt(t){var e=[];for(var n in t)F(t[n])&&e.push(n);return e.sort()}function Mt(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var o=1;o<r;o++)for(var i=arguments[o],s=t(i),a=s.length,l=0;l<a;l++){var c=s[l];e&&void 0!==n[c]||(n[c]=i[c])}return n}}const Nt=Mt(vt),Lt=Mt(at),It=Mt(vt,!0);function $t(t){if(!T(t))return{};if(m)return m(t);var e=function(){};e.prototype=t;var n=new e;return e.prototype=null,n}function Dt(t,e){var n=$t(t);return e&&Lt(n,e),n}function Rt(t){return T(t)?q(t)?t.slice():Nt({},t):t}function Ht(t,e){return e(t),t}function Ft(t){return q(t)?t:[t]}function Vt(t){return ut.toPath(t)}function Ut(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function Bt(t,e,n){var r=Ut(t,Vt(e));return A(r)?n:r}function zt(t,e){for(var n=(e=Vt(e)).length,r=0;r<n;r++){var o=e[r];if(!G(t,o))return!1;t=t[o]}return!!n}function Wt(t){return t}function qt(t){return t=Lt({},t),function(e){return ct(e,t)}}function Gt(t){return t=Vt(t),function(e){return Ut(e,t)}}function Kt(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,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)}}return function(){return t.apply(e,arguments)}}function Yt(t,e,n){return null==t?Wt:F(t)?Kt(t,e,n):T(t)&&!q(t)?qt(t):Gt(t)}function Xt(t,e){return Yt(t,e,1/0)}function Jt(t,e,n){return ut.iteratee!==Xt?ut.iteratee(t,e):Yt(t,e,n)}function Zt(t,e,n){e=Jt(e,n);for(var r=at(t),o=r.length,i={},s=0;s<o;s++){var a=r[s];i[a]=e(t[a],a,t)}return i}function Qt(){}function te(t){return null==t?Qt:function(e){return Bt(t,e)}}function ee(t,e,n){var r=Array(Math.max(0,t));e=Kt(e,n,1);for(var o=0;o<t;o++)r[o]=e(o);return r}function ne(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}ut.toPath=Ft,ut.iteratee=Xt;const re=Date.now||function(){return(new Date).getTime()};function oe(t){var e=function(e){return t[e]},n="(?:"+at(t).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(o,e):t}}const ie={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},se=oe(ie),ae=oe(Pt(ie)),le=ut.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ce=/(.)^/,ue={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},pe=/\\|'|\r|\n|\u2028|\u2029/g;function de(t){return"\\"+ue[t]}var fe=/^\s*(\w|\$)+\s*$/;function he(t,e,n){!e&&n&&(e=n),e=It({},e,ut.templateSettings);var r=RegExp([(e.escape||ce).source,(e.interpolate||ce).source,(e.evaluate||ce).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(r,(function(e,n,r,s,a){return i+=t.slice(o,a).replace(pe,de),o=a+e.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(i+="';\n"+s+"\n__p+='"),e})),i+="';\n";var s,a=e.variable;if(a){if(!fe.test(a))throw new Error("variable is not a bare identifier: "+a)}else i="with(obj||{}){\n"+i+"}\n",a="obj";i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{s=new Function(a,"_",i)}catch(t){throw t.source=i,t}var l=function(t){return s.call(this,t,ut)};return l.source="function("+a+"){\n"+i+"}",l}function ge(t,e,n){var r=(e=Vt(e)).length;if(!r)return F(n)?n.call(t):n;for(var o=0;o<r;o++){var i=null==t?void 0:t[e[o]];void 0===i&&(i=n,o=r),t=F(i)?i.call(t):i}return t}var ve=0;function me(t){var e=++ve+"";return t?t+e:e}function ye(t){var e=ut(t);return e._chain=!0,e}function be(t,e,n,r,o){if(!(r instanceof e))return t.apply(n,o);var i=$t(t.prototype),s=t.apply(i,o);return T(s)?s:i}var we=S((function(t,e){var n=we.placeholder,r=function(){for(var o=0,i=e.length,s=Array(i),a=0;a<i;a++)s[a]=e[a]===n?arguments[o++]:e[a];for(;o<arguments.length;)s.push(arguments[o++]);return be(t,r,this,this,s)};return r}));we.placeholder=ut;const _e=we,xe=S((function(t,e,n){if(!F(t))throw new TypeError("Bind must be called on a function");var r=S((function(o){return be(t,r,e,this,n.concat(o))}));return r})),Ce=Q(it);function Se(t,e,n,r){if(r=r||[],e||0===e){if(e<=0)return r.concat(t)}else e=1/0;for(var o=r.length,i=0,s=it(t);i<s;i++){var a=t[i];if(Ce(a)&&(q(a)||Y(a)))if(e>1)Se(a,e-1,n,r),o=r.length;else for(var l=0,c=a.length;l<c;)r[o++]=a[l++];else n||(r[o++]=a)}return r}const Te=S((function(t,e){var n=(e=Se(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=xe(t[r],t)}return t}));function Oe(t,e){var n=function(r){var o=n.cache,i=""+(e?e.apply(this,arguments):r);return G(o,i)||(o[i]=t.apply(this,arguments)),o[i]};return n.cache={},n}const Ae=S((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),Ee=_e(Ae,ut,1);function ke(t,e,n){var r,o,i,s,a=0;n||(n={});var l=function(){a=!1===n.leading?0:re(),r=null,s=t.apply(o,i),r||(o=i=null)},c=function(){var c=re();a||!1!==n.leading||(a=c);var u=e-(c-a);return o=this,i=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),a=c,s=t.apply(o,i),r||(o=i=null)):r||!1===n.trailing||(r=setTimeout(l,u)),s};return c.cancel=function(){clearTimeout(r),a=0,r=o=i=null},c}function Pe(t,e,n){var r,o,i,s,a,l=function(){var c=re()-o;e>c?r=setTimeout(l,e-c):(r=null,n||(s=t.apply(a,i)),r||(i=a=null))},c=S((function(c){return a=this,i=c,o=re(),r||(r=setTimeout(l,e),n&&(s=t.apply(a,i))),s}));return c.cancel=function(){clearTimeout(r),r=i=a=null},c}function je(t,e){return _e(e,t)}function Me(t){return function(){return!t.apply(this,arguments)}}function Ne(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function Le(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Ie(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const $e=_e(Ie,2);function De(t,e,n){e=Jt(e,n);for(var r,o=at(t),i=0,s=o.length;i<s;i++)if(e(t[r=o[i]],r,t))return r}function Re(t){return function(e,n,r){n=Jt(n,r);for(var o=it(e),i=t>0?0:o-1;i>=0&&i<o;i+=t)if(n(e[i],i,e))return i;return-1}}const He=Re(1),Fe=Re(-1);function Ve(t,e,n,r){for(var o=(n=Jt(n,r,1))(e),i=0,s=it(t);i<s;){var a=Math.floor((i+s)/2);n(t[a])<o?i=a+1:s=a}return i}function Ue(t,e,n){return function(r,o,i){var s=0,a=it(r);if("number"==typeof i)t>0?s=i>=0?i:Math.max(i+a,s):a=i>=0?Math.min(i+1,a):i+a+1;else if(n&&i&&a)return r[i=n(r,o)]===o?i:-1;if(o!=o)return(i=e(u.call(r,s,a),J))>=0?i+s:-1;for(i=t>0?s:a-1;i>=0&&i<a;i+=t)if(r[i]===o)return i;return-1}}const Be=Ue(1,He,Ve),ze=Ue(-1,Fe);function We(t,e,n){var r=(Ce(t)?He:De)(t,e,n);if(void 0!==r&&-1!==r)return t[r]}function qe(t,e){return We(t,qt(e))}function Ge(t,e,n){var r,o;if(e=Kt(e,n),Ce(t))for(r=0,o=t.length;r<o;r++)e(t[r],r,t);else{var i=at(t);for(r=0,o=i.length;r<o;r++)e(t[i[r]],i[r],t)}return t}function Ke(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&at(t),o=(r||t).length,i=Array(o),s=0;s<o;s++){var a=r?r[s]:s;i[s]=e(t[a],a,t)}return i}function Ye(t){return function(e,n,r,o){var i=arguments.length>=3;return function(e,n,r,o){var i=!Ce(e)&&at(e),s=(i||e).length,a=t>0?0:s-1;for(o||(r=e[i?i[a]:a],a+=t);a>=0&&a<s;a+=t){var l=i?i[a]:a;r=n(r,e[l],l,e)}return r}(e,Kt(n,o,4),r,i)}}const Xe=Ye(1),Je=Ye(-1);function Ze(t,e,n){var r=[];return e=Jt(e,n),Ge(t,(function(t,n,o){e(t,n,o)&&r.push(t)})),r}function Qe(t,e,n){return Ze(t,Me(Jt(e)),n)}function tn(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&at(t),o=(r||t).length,i=0;i<o;i++){var s=r?r[i]:i;if(!e(t[s],s,t))return!1}return!0}function en(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&at(t),o=(r||t).length,i=0;i<o;i++){var s=r?r[i]:i;if(e(t[s],s,t))return!0}return!1}function nn(t,e,n,r){return Ce(t)||(t=Et(t)),("number"!=typeof n||r)&&(n=0),Be(t,e,n)>=0}const rn=S((function(t,e,n){var r,o;return F(e)?o=e:(e=Vt(e),r=e.slice(0,-1),e=e[e.length-1]),Ke(t,(function(t){var i=o;if(!i){if(r&&r.length&&(t=Ut(t,r)),null==t)return;i=t[e]}return null==i?i:i.apply(t,n)}))}));function on(t,e){return Ke(t,Gt(e))}function sn(t,e){return Ze(t,qt(e))}function an(t,e,n){var r,o,i=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=Ce(t)?t:Et(t)).length;a<l;a++)null!=(r=t[a])&&r>i&&(i=r);else e=Jt(e,n),Ge(t,(function(t,n,r){((o=e(t,n,r))>s||o===-1/0&&i===-1/0)&&(i=t,s=o)}));return i}function ln(t,e,n){var r,o,i=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=Ce(t)?t:Et(t)).length;a<l;a++)null!=(r=t[a])&&r<i&&(i=r);else e=Jt(e,n),Ge(t,(function(t,n,r){((o=e(t,n,r))<s||o===1/0&&i===1/0)&&(i=t,s=o)}));return i}var cn=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function un(t){return t?q(t)?u.call(t):j(t)?t.match(cn):Ce(t)?Ke(t,Wt):Et(t):[]}function pn(t,e,n){if(null==e||n)return Ce(t)||(t=Et(t)),t[ne(t.length-1)];var r=un(t),o=it(r);e=Math.max(Math.min(e,o),0);for(var i=o-1,s=0;s<e;s++){var a=ne(s,i),l=r[s];r[s]=r[a],r[a]=l}return r.slice(0,e)}function dn(t){return pn(t,1/0)}function fn(t,e,n){var r=0;return e=Jt(e,n),on(Ke(t,(function(t,n,o){return{value:t,index:r++,criteria:e(t,n,o)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),"value")}function hn(t,e){return function(n,r,o){var i=e?[[],[]]:{};return r=Jt(r,o),Ge(n,(function(e,o){var s=r(e,o,n);t(i,e,s)})),i}}const gn=hn((function(t,e,n){G(t,n)?t[n].push(e):t[n]=[e]})),vn=hn((function(t,e,n){t[n]=e})),mn=hn((function(t,e,n){G(t,n)?t[n]++:t[n]=1})),yn=hn((function(t,e,n){t[n?0:1].push(e)}),!0);function bn(t){return null==t?0:Ce(t)?t.length:at(t).length}function wn(t,e,n){return e in n}const _n=S((function(t,e){var n={},r=e[0];if(null==t)return n;F(r)?(e.length>1&&(r=Kt(r,e[1])),e=vt(t)):(r=wn,e=Se(e,!1,!1),t=Object(t));for(var o=0,i=e.length;o<i;o++){var s=e[o],a=t[s];r(a,s,t)&&(n[s]=a)}return n})),xn=S((function(t,e){var n,r=e[0];return F(r)?(r=Me(r),e.length>1&&(n=e[1])):(e=Ke(Se(e,!1,!1),String),r=function(t,n){return!nn(e,n)}),_n(t,r,n)}));function Cn(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function Sn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Cn(t,t.length-e)}function Tn(t,e,n){return u.call(t,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[t.length-1]:Tn(t,Math.max(0,t.length-e))}function An(t){return Ze(t,Boolean)}function En(t,e){return Se(t,e,!1)}const kn=S((function(t,e){return e=Se(e,!0,!0),Ze(t,(function(t){return!nn(e,t)}))})),Pn=S((function(t,e){return kn(t,e)}));function jn(t,e,n,r){E(e)||(r=n,n=e,e=!1),null!=n&&(n=Jt(n,r));for(var o=[],i=[],s=0,a=it(t);s<a;s++){var l=t[s],c=n?n(l,s,t):l;e&&!n?(s&&i===c||o.push(l),i=c):n?nn(i,c)||(i.push(c),o.push(l)):nn(o,l)||o.push(l)}return o}const Mn=S((function(t){return jn(Se(t,!0,!0))}));function Nn(t){for(var e=[],n=arguments.length,r=0,o=it(t);r<o;r++){var i=t[r];if(!nn(e,i)){var s;for(s=1;s<n&&nn(arguments[s],i);s++);s===n&&e.push(i)}}return e}function Ln(t){for(var e=t&&an(t,it).length||0,n=Array(e),r=0;r<e;r++)n[r]=on(t,r);return n}const In=S(Ln);function $n(t,e){for(var n={},r=0,o=it(t);r<o;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}function Dn(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),o=Array(r),i=0;i<r;i++,t+=n)o[i]=t;return o}function Rn(t,e){if(null==e||e<1)return[];for(var n=[],r=0,o=t.length;r<o;)n.push(u.call(t,r,r+=e));return n}function Hn(t,e){return t._chain?ut(e).chain():e}function Fn(t){return Ge(jt(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}Ge(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=s[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)}})),Ge(["concat","join","slice"],(function(t){var e=s[t];ut.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Hn(this,t)}}));const Vn=ut;var Un=Fn(r);Un._=Un;const Bn=Un}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].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 r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},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 r={};(()=>{"use strict";n.r(r),n.d(r,{ClientConfig:()=>p_,api:()=>o,cmdToggleBlocks:()=>Jw,cmdToggleLayers:()=>Xw,cmdToggleNotifications:()=>Qw,cmdToggleSymbols:()=>Zw,config:()=>d_,constants:()=>t,events:()=>i,getEditor:()=>i_,getEditorConfig:()=>n_,initEditor:()=>o_,page:()=>s,start:()=>f_,types:()=>e,utils:()=>a});var t={};n.r(t),n.d(t,{API_CONNECTOR_LIST:()=>v,API_CONNECTOR_LOGIN:()=>y,API_CONNECTOR_LOGIN_CALLBACK:()=>w,API_CONNECTOR_LOGOUT:()=>m,API_CONNECTOR_PATH:()=>h,API_CONNECTOR_SETTINGS:()=>b,API_CONNECTOR_USER:()=>g,API_PATH:()=>f,API_PUBLICATION_PATH:()=>_,API_PUBLICATION_PUBLISH:()=>x,API_PUBLICATION_STATUS:()=>C,API_WEBSITE_ASSETS_WRITE:()=>M,API_WEBSITE_ASSET_READ:()=>j,API_WEBSITE_CREATE:()=>A,API_WEBSITE_DELETE:()=>E,API_WEBSITE_DUPLICATE:()=>k,API_WEBSITE_LIST:()=>P,API_WEBSITE_META_READ:()=>N,API_WEBSITE_META_WRITE:()=>L,API_WEBSITE_PATH:()=>S,API_WEBSITE_READ:()=>T,API_WEBSITE_WRITE:()=>O,CLIENT_CONFIG_FILE_NAME:()=>d,DEFAULT_LANGUAGE:()=>p,DEFAULT_WEBSITE_ID:()=>u,DEV_MESSAGE:()=>$,SILEX_VERSION:()=>I,WEBSITE_DATA_FILE:()=>l,WEBSITE_META_DATA_FILE:()=>c});var e={};n.r(e),n.d(e,{ApiError:()=>ry,ClientSideFileType:()=>sy,ConnectorType:()=>ly,Initiator:()=>ay,JobStatus:()=>cy,Unit:()=>iy,defaultWebsiteData:()=>oy});var o={};n.r(o),n.d(o,{ApiRoute:()=>uy,api:()=>ky,connectorList:()=>yy,getServerUrl:()=>fy,getUser:()=>hy,logout:()=>gy,publicationStatus:()=>my,publish:()=>vy,setServerUrl:()=>dy,websiteAssetsLoad:()=>Ay,websiteAssetsSave:()=>Ey,websiteCreate:()=>Sy,websiteDelete:()=>xy,websiteDuplicate:()=>Cy,websiteList:()=>by,websiteLoad:()=>wy,websiteMetaRead:()=>Oy,websiteMetaWrite:()=>Ty,websiteSave:()=>_y});var i={};n.r(i),n.d(i,{ClientEvent:()=>Mb});var s={};n.r(s),n.d(s,{getPageLink:()=>Kb,getPageSlug:()=>Gb});var a={};n.r(a),n.d(a,{hashString:()=>Zb,isTextOrInputField:()=>tw,onAll:()=>Jb,selectBody:()=>Qb,titleCase:()=>ew});const l="website.json",c="meta.json",u="default",p="en",d="silex.js",f="/api",h="/connector",g="/user",v="/",m="/logout",y="/login",b="/settings",w="/login/callback",_="/publication",x="/",C="/publication/status",S="/website",T="/",O="/",A="/",E="/",k="/duplicate",P="/",j="/assets",M="/assets",N="/meta",L="/meta";let I;try{I="3.0.3"}catch(Bv){I=I||"3.0.0"}const $=`\n__________________________________________________________\n\n Create static websites visually, with dynamic content,\n in the free spirit of the web.\n\n ███████ ██ ██ ███████ ██ ██ ██ ██ ██████\n ██ ██ ██ ██ ██ ██ ██ ██ ██\n ███████ ██ ██ █████ ███ ██ ██ █████\n ██ ██ ██ ██ ██ ██ ██ ██ ██\n ███████ ██ ███████ ███████ ██ ██ ████ ██████ ${I.slice(1)}\n\n Users are expected to contribute:\n\n * Web designers: https://docs.silex.me/en/user/contribute\n * Developers: https://docs.silex.me/en/dev/contribute\n\n__________________________________________________________\n`;var D=function(){return D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},D.apply(this,arguments)},R=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},H=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};function F(t,e,n,r){return void 0===r&&(r=null),R(this,void 0,void 0,(function(){var o=this;return H(this,(function(i){return[2,Promise.all(e.map((function(e){return R(o,void 0,void 0,(function(){var o,i,s,a,l=this;return H(this,(function(c){switch(c.label){case 0:return[4,R(l,void 0,void 0,(function(){return H(this,(function(t){switch(t.label){case 0:switch(typeof e){case"function":return[3,1];case"string":return[3,2]}return[3,4];case 1:return[2,[e,e.toString()]];case 2:return[4,V(e,r)];case 3:return[2,[t.sent(),e]];case 4:throw new Error("Unknown type for plugin: ".concat(typeof e))}}))}))];case 1:return o=c.sent(),i=o[0],s=o[1],[2,i(t,s&&n&&null!==(a=n[s])&&void 0!==a?a:n)]}}))}))}))).then((function(e){return e.reduce((function(t,e){return D(D({},t),e)}),t)}))]}))}))}function V(t,e){var n;return R(this,void 0,void 0,(function(){var r,o;return H(this,(function(i){switch(i.label){case 0:return r=function(t,e){void 0===e&&(e=null);try{return new URL(t,e).toString()}catch(e){return t}}(t,e),[4,U(r)];case 1:return o=i.sent(),[2,null!==(n=null==o?void 0:o.default)&&void 0!==n?n:o]}}))}))}function U(t){return R(this,void 0,void 0,(function(){return H(this,(function(e){return[2,import(t)]}))}))}var B,z=n(7),W=(B=function(t,e){return B=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])},B(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}B(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),q=function(t){function e(e){void 0===e&&(e=null);var n=t.call(this)||this;return n.baseUrl=e,n}return W(e,t),e.prototype.addPlugin=function(t,e){return function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))}(this,void 0,void 0,(function(){var n;return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(r){switch(r.label){case 0:return[4,F(this,[].concat(t),e,this.baseUrl)];case 1:return n=r.sent(),Object.assign(this,n),[2,this]}}))}))},e}(n.n(z)()),G={982:(t,e,n)=>{var r,o,i;o=[n(523),n(391)],r=function(t,e){var n=Array.prototype.slice;function r(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function o(t,e){return n.call(t,e)}function i(e,n){return null!=e&&(t.isArray(n)||(n=o(arguments,1)),t.all(n,(function(t){return t in e})))}var s,a,l=(s=!1,a=-1,function(){return s||(a++,s=!0,t.defer((function(){s=!1}))),a});function c(){this.registeredObjects=[],this.cidIndexes=[]}function u(e,n,r,o){for(var i,s=0,a=n.length;s<a;s++)if(i=n[s]){if("on"===e){if(!o.objectRegistry.register(i))continue}else if(!o.objectRegistry.unregister(i))continue;t.isFunction(i[e])&&i[e]("all",r,o)}}function p(e,n){var r=n.type,o=n.undoTypes,i=!o[r]||o[r][e];t.isFunction(i)&&i(n.object,n.before,n.after,n.options)}function d(e,r,o,i,s){if(!(o.isCurrentlyUndoRedoing||"undo"===e&&-1===o.pointer||"redo"===e&&o.pointer===o.length-1)){o.isCurrentlyUndoRedoing=!0;var a,l,c="undo"===e;for(s?l=c&&o.pointer===o.length-1||!c&&-1===o.pointer?t.clone(o.models):n.apply(o.models,c?[0,o.pointer]:[o.pointer,o.length-1]):(a=o.at(c?o.pointer:o.pointer+1),l=i?o.where({magicFusionIndex:a.get("magicFusionIndex")}):[a]),o.pointer+=(c?-1:1)*l.length;a=c?l.pop():l.shift();)a[e]();o.isCurrentlyUndoRedoing=!1,r.trigger(e,r)}}function f(t,e,n,o){if(t.track&&!t.isCurrentlyUndoRedoing&&e in o&&function(t,e){var n=t.condition,o=typeof n;return"function"===o?!!r(n,t,e):"boolean"!==o||n}(o[e],n)){var s=r(o[e].on,o[e],n);if(i(s,"object","before","after")){if(s.type=e,s.magicFusionIndex=l(),s.undoTypes=o,t.pointer<t.length-1)for(var a=t.length-t.pointer-1;a--;)t.pop();t.pointer=t.length,t.add(s),t.length>t.maximumStackLength&&(t.shift(),t.pointer--)}}}c.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 h={add:{undo:function(t,e,n,r){t.remove(n,r)},redo:function(t,e,n,r){r.index&&(r.at=r.index),t.add(n,r)},on:function(e,n,r){return{object:n,before:void 0,after:e,options:t.clone(r)}}},remove:{undo:function(t,e,n,r){"index"in r&&(r.at=r.index),t.add(e,r)},redo:function(t,e,n,r){t.remove(e,r)},on:function(e,n,r){return{object:n,before:e,after:void 0,options:t.clone(r)}}},change:{undo:function(e,n,r,o){t.isEmpty(n)?t.each(t.keys(r),e.unset,e):(e.set(n),o&&o.unsetData&&o.unsetData.before&&o.unsetData.before.length&&t.each(o.unsetData.before,e.unset,e))},redo:function(e,n,r,o){t.isEmpty(r)?t.each(t.keys(n),e.unset,e):(e.set(r),o&&o.unsetData&&o.unsetData.after&&o.unsetData.after.length&&t.each(o.unsetData.after,e.unset,e))},on:function(e,n){var r=e.changedAttributes(),o=t.keys(r),i=t.pick(e.previousAttributes(),o),s=t.keys(i),a=(n||(n={})).unsetData={after:[],before:[]};return o.length!=s.length&&(o.length>s.length?t.each(o,(function(t){t in i||a.before.push(t)}),this):t.each(s,(function(t){t in r||a.after.push(t)}))),{object:e,before:i,after:r,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 g(){}function v(e,n,r,o){if("object"==typeof n)return t.each(n,(function(t,n){2===e?v(e,t,r,o):v(e,n,t,r)}));switch(e){case 0:i(r,"undo","redo","on")&&t.all(t.pick(r,"undo","redo","on"),t.isFunction)&&(o[n]=r);break;case 1:o[n]&&t.isObject(r)&&(o[n]=t.extend({},o[n],r));break;case 2:delete o[n]}return this}g.prototype=h;var m=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(t){p("undo",this.attributes)},redo:function(t){p("redo",this.attributes)}}),y=e.Collection.extend({model:m,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),b=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new y,this.objectRegistry=new c,this.undoTypes=new g,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)?r(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){f(this.stack,t,o(arguments,1),this.undoTypes)},register:function(){u("on",arguments,this._addToStack,this)},unregister:function(){u("off",arguments,this._addToStack,this)},unregisterAll:function(){r(this.unregister,this,this.objectRegistry.get())},undo:function(t){d("undo",this,this.stack,t)},undoAll:function(){d("undo",this,this.stack,!1,!0)},redo:function(t){d("redo",this,this.stack,t)},redoAll:function(){d("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,r=t.isArray(e)?e:o(arguments);n=r.pop();)n instanceof b&&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(b,{defaults:function(e){t.extend(b.prototype.defaults,e)},addUndoType:function(t,e){v(0,t,e,h)},changeUndoType:function(t,e){v(1,t,e,h)},removeUndoType:function(t){v(2,t,void 0,h)}}),e.UndoManager=b},void 0===(i=r.apply(e,o))||(t.exports=i)},391:(t,e,n)=>{var r,o,i;i="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g,r=[n(523),n(694),e],o=function(t,e,n){i.Backbone=function(t,e,n,r){var o=t.Backbone,i=Array.prototype.slice;e.VERSION="1.4.1",e.$=r,e.noConflict=function(){return t.Backbone=o,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s,a=e.Events={},l=/\s+/,c=function(t,e,r,o,i){var s,a=0;if(r&&"object"==typeof r){void 0!==o&&"context"in i&&void 0===i.context&&(i.context=o);for(s=n.keys(r);a<s.length;a++)e=c(t,e,s[a],r[s[a]],i)}else if(r&&l.test(r))for(s=r.split(l);a<s.length;a++)e=t(e,s[a],o,i);else e=t(e,r,o,i);return e};a.on=function(t,e,n){return this._events=c(u,this._events||{},t,e,{context:n,ctx:this,listening:s}),s&&((this._listeners||(this._listeners={}))[s.id]=s,s.interop=!1),this},a.listenTo=function(t,e,r){if(!t)return this;var o=t._listenId||(t._listenId=n.uniqueId("l")),i=this._listeningTo||(this._listeningTo={}),a=s=i[o];a||(this._listenId||(this._listenId=n.uniqueId("l")),a=s=i[o]=new v(this,t));var l=p(t,e,r,this);if(s=void 0,l)throw l;return a.interop&&a.on(e,r),this};var u=function(t,e,n,r){if(n){var o=t[e]||(t[e]=[]),i=r.context,s=r.ctx,a=r.listening;a&&a.count++,o.push({callback:n,context:i,ctx:i||s,listening:a})}return t},p=function(t,e,n,r){try{t.on(e,n,r)}catch(t){return t}};a.off=function(t,e,n){return this._events?(this._events=c(d,this._events,t,e,{context:n,listeners:this._listeners}),this):this},a.stopListening=function(t,e,r){var o=this._listeningTo;if(!o)return this;for(var i=t?[t._listenId]:n.keys(o),s=0;s<i.length;s++){var a=o[i[s]];if(!a)break;a.obj.off(e,r,this),a.interop&&a.off(e,r)}return n.isEmpty(o)&&(this._listeningTo=void 0),this};var d=function(t,e,r,o){if(t){var i,s=o.context,a=o.listeners,l=0;if(e||s||r){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(r&&r!==d.callback&&r!==d.callback._callback||s&&s!==d.context)u.push(d);else{var f=d.listening;f&&f.off(e,r)}}u.length?t[e]=u:delete t[e]}return t}for(i=n.keys(a);l<i.length;l++)a[i[l]].cleanup()}};a.once=function(t,e,n){var r=c(f,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(r,e,n)},a.listenToOnce=function(t,e,n){var r=c(f,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,r)};var f=function(t,e,r,o){if(r){var i=t[e]=n.once((function(){o(e,i),r.apply(this,arguments)}));i._callback=r}return t};a.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return c(h,this._events,t,void 0,n),this};var h=function(t,e,n,r){if(t){var o=t[e],i=t.all;o&&i&&(i=i.slice()),o&&g(o,r),i&&g(i,[e].concat(r))}return t},g=function(t,e){var n,r=-1,o=t.length,i=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++r<o;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i);return;case 2:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,s);return;case 3:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,s,a);return;default:for(;++r<o;)(n=t[r]).callback.apply(n.ctx,e);return}},v=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};v.prototype.on=a.on,v.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()},v.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},a.bind=a.on,a.unbind=a.off,n.extend(e,a);var m=e.Model=function(t,e){var r=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});var o=n.result(this,"defaults");r=n.defaults(n.extend({},o,r),o),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(m.prototype,a,{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,r){if(null==t)return this;var o;if("object"==typeof t?(o=t,r=e):(o={})[t]=e,r||(r={}),!this._validate(o,r))return!1;var i=r.unset,s=r.silent,a=[],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 o)e=o[d],n.isEqual(c[d],e)||a.push(d),n.isEqual(p[d],e)?delete u[d]:u[d]=e,i?delete c[d]:c[d]=e;if(this.idAttribute in o){var f=this.id;this.id=this.get(this.idAttribute),this.trigger("changeId",this,f,r)}if(!s){a.length&&(this._pending=r);for(var h=0;h<a.length;h++)this.trigger("change:"+a[h],this,c[a[h]],r)}if(l)return this;if(!s)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);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 r in this.attributes)e[r]=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,r=this._changing?this._previousAttributes:this.attributes,o={};for(var i in t){var s=t[i];n.isEqual(r[i],s)||(o[i]=s,e=!0)}return!!e&&o},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,r=t.success;return t.success=function(n){var o=t.parse?e.parse(n,t):n;if(!e.set(o,t))return!1;r&&r.call(t.context,e,n,t),e.trigger("sync",e,n,t)},z(this,t),this.sync("read",this,t)},save:function(t,e,r){var o;null==t||"object"==typeof t?(o=t,r=e):(o={})[t]=e;var i=(r=n.extend({validate:!0,parse:!0},r)).wait;if(o&&!i){if(!this.set(o,r))return!1}else if(!this._validate(o,r))return!1;var s=this,a=r.success,l=this.attributes;r.success=function(t){s.attributes=l;var e=r.parse?s.parse(t,r):t;if(i&&(e=n.extend({},o,e)),e&&!s.set(e,r))return!1;a&&a.call(r.context,s,t,r),s.trigger("sync",s,t,r)},z(this,r),o&&i&&(this.attributes=n.extend({},l,o));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=o);var u=this.sync(c,this,r);return this.attributes=l,u},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,o=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){o&&i(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var s=!1;return this.isNew()?n.defer(t.success):(z(this,t),s=this.sync("delete",this,t)),o||i(),s},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||B();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 r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,n.extend(e,{validationError:r})),!1)}});var y=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},w={add:!0,remove:!1},_=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var r,o=Array(t.length-n),i=e.length;for(r=0;r<o.length;r++)o[r]=t[r+n];for(r=0;r<i;r++)t[r+n]=e[r];for(r=0;r<o.length;r++)t[r+i+n]=o[r]};n.extend(y.prototype,a,{model:m,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,w))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:t.slice();var o=this._removeModels(t,e);return!e.silent&&o.length&&(e.changes={added:[],merged:[],removed:o},this.trigger("update",this,e)),r?o[0]:o},set:function(t,e){if(null!=t){(e=n.extend({},b,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var r=!n.isArray(t);t=r?[t]:t.slice();var o=e.at;null!=o&&(o=+o),o>this.length&&(o=this.length),o<0&&(o+=this.length+1);var i,s,a=[],l=[],c=[],u=[],p={},d=e.add,f=e.merge,h=e.remove,g=!1,v=this.comparator&&null==o&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(s=0;s<t.length;s++){i=t[s];var y=this.get(i);if(y){if(f&&i!==y){var w=this._isModel(i)?i.attributes:i;e.parse&&(w=y.parse(w,e)),y.set(w,e),c.push(y),v&&!g&&(g=y.hasChanged(m))}p[y.cid]||(p[y.cid]=!0,a.push(y)),t[s]=y}else d&&(i=t[s]=this._prepareModel(i,e))&&(l.push(i),this._addReference(i,e),p[i.cid]=!0,a.push(i))}if(h){for(s=0;s<this.length;s++)p[(i=this.models[s]).cid]||u.push(i);u.length&&this._removeModels(u,e)}var x=!1,C=!v&&d&&h;if(a.length&&C?(x=this.length!==a.length||n.some(this.models,(function(t,e){return t!==a[e]})),this.models.length=0,_(this.models,a,0),this.length=this.models.length):l.length&&(v&&(g=!0),_(this.models,l,null==o?this.length:o),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(s=0;s<l.length;s++)null!=o&&(e.index=o+s),(i=l[s]).trigger("add",i,this,e);(g||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 r?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],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 r=e.length;return n.isFunction(e)&&(e=e.bind(this)),1===r||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,r=this;return t.success=function(n){var o=t.reset?"reset":"set";r[o](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},z(this,t),this.sync("read",this,t)},create:function(t,e){var r=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;r||this.add(t,e);var o=this,i=e.success;return e.success=function(t,e,n){r&&o.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,T)},entries:function(){return new C(this,O)},_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,(r=this.model.prototype?new this.model(t,e):this.model(t,e)).validationError?(this.trigger("invalid",this,r.validationError,e),!1):r);var r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var o=this.get(t[r]);if(o){var i=this.indexOf(o);this.models.splice(i,1),this.length--,delete this._byId[o.cid];var s=this.modelId(o.attributes,o.idAttribute);null!=s&&delete this._byId[s],e.silent||(e.index=i,o.trigger("remove",o,this,e)),n.push(o),this._removeReference(o,e)}}return n},_isModel:function(t){return t instanceof m},_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,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"changeId"===t){var o=this.modelId(e.previousAttributes(),e.idAttribute),i=this.modelId(e.attributes,e.idAttribute);null!=o&&delete this._byId[o],null!=i&&(this._byId[i]=e)}}this.trigger.apply(this,arguments)}});var x="function"==typeof Symbol&&Symbol.iterator;x&&(y.prototype[x]=y.prototype.values);var C=function(t,e){this._collection=t,this._kind=e,this._index=0},S=1,T=2,O=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===T?n:[n,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var A=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(A.prototype,a,{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 r=t[e];if(n.isFunction(r)||(r=this[r]),r){var o=e.match(E);this.delegate(o[1],o[2],r.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 P=function(t,e,r,o){n.each(r,(function(n,r){e[r]&&(t.prototype[r]=function(t,e,n,r){switch(e){case 1:return function(){return t[n](this[r])};case 2:return function(e){return t[n](this[r],e)};case 3:return function(e,o){return t[n](this[r],j(e,this),o)};case 4:return function(e,o,i){return t[n](this[r],j(e,this),o,i)};default:return function(){var e=i.call(arguments);return e.unshift(this[r]),t[n].apply(t,e)}}}(e,n,r,o))}))},j=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?M(t):n.isString(t)?function(e){return e.get(t)}:t},M=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}};n.each([[y,{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},"models"],[m,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes"]],(function(t){var e=t[0],r=t[1],o=t[2];e.mixin=function(t){var r=n.reduce(n.functions(t),(function(t,e){return t[e]=0,t}),{});P(e,t,r,o)},P(e,n,r,o)})),e.sync=function(t,r,o){var i=N[t];n.defaults(o||(o={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var s={type:i,dataType:"json"};if(o.url||(s.url=n.result(r,"url")||B()),null!=o.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(s.contentType="application/json",s.data=JSON.stringify(o.attrs||r.toJSON(o))),o.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),o.emulateHTTP&&("PUT"===i||"DELETE"===i||"PATCH"===i)){s.type="POST",o.emulateJSON&&(s.data._method=i);var a=o.beforeSend;o.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",i),a)return a.apply(this,arguments)}}"GET"===s.type||o.emulateJSON||(s.processData=!1);var l=o.error;o.error=function(t,e,n){o.textStatus=e,o.errorThrown=n,l&&l.call(o.context,t,e,n)};var c=o.xhr=e.ajax(n.extend(s,o));return r.trigger("request",r,c,o),c};var N={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var L=e.Router=function(t){t||(t={}),this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},I=/\((.*?)\)/g,$=/(\(\?)?:\w+/g,D=/\*\w+/g,R=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(L.prototype,a,{preinitialize:function(){},initialize:function(){},route:function(t,r,o){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(o=r,r=""),o||(o=this[r]);var i=this;return e.history.route(t,(function(n){var s=i._extractParameters(t,n);!1!==i.execute(o,s,r)&&(i.trigger.apply(i,["route:"+r].concat(s)),i.trigger("route",r,s),e.history.trigger("route",i,r,s))})),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(R,"\\$&").replace(I,"(?:$1)?").replace($,(function(t,e){return e?t:"([^/?]+)"})).replace(D,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,(function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null}))}});var H=e.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},F=/^[#\/]|\s+$/g,V=/^\/+|\/+$/g,U=/#.*$/;H.started=!1,n.extend(H.prototype,a,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(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(F,"")},start:function(t){if(H.started)throw new Error("Backbone.history has already been started");if(H.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(V,"/"),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 r=document.body,o=r.insertBefore(this.iframe,r.firstChild).contentWindow;o.document.open(),o.document.close(),o.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),H.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(!H.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 r=n+t;t=t.replace(U,"");var o=this.decodeFragment(t);if(this.fragment!==o){if(this.fragment=o,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);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 r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new H;m.extend=y.extend=L.extend=A.extend=H.extend=function(t,e){var r,o=this;return r=t&&n.has(t,"constructor")?t.constructor:function(){return o.apply(this,arguments)},n.extend(r,o,e),r.prototype=n.create(o.prototype,t),r.prototype.constructor=r,r.__super__=o.prototype,r};var B=function(){throw new Error('A "url" property or function must be specified')},z=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e}(i,n,t,e)}.apply(e,r),void 0===o||(t.exports=o)},862:(t,e,n)=>{!function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,r){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!r.lexical||")"!=r.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,r,o){var i=!1;return"html"==this.configuration&&(i=!!o.context&&e.test(o.context.tagName)),!i&&("tag"==t&&/>$/.test(n)&&o.context||/^</.test(r))}}),t.defineExtension("commentRange",(function(e,n,r){var o=this,i=t.innerMode(o.getMode(),o.getTokenAt(n).state).mode;o.operation((function(){if(e)o.replaceRange(i.commentEnd,r),o.replaceRange(i.commentStart,n),n.line==r.line&&n.ch==r.ch&&o.setCursor(n.line,n.ch+i.commentStart.length);else{var t=o.getRange(n,r),s=t.indexOf(i.commentStart),a=t.lastIndexOf(i.commentEnd);s>-1&&a>-1&&a>s&&(t=t.substr(0,s)+t.substring(s+i.commentStart.length,a)+t.substr(a+i.commentEnd.length)),o.replaceRange(t,n,r)}}))})),t.defineExtension("autoIndentRange",(function(t,e){var n=this;this.operation((function(){for(var r=t.line;r<=e.line;r++)n.indentLine(r,"smart")}))})),t.defineExtension("autoFormatRange",(function(e,n){var r=this,o=r.getMode(),i=r.getRange(e,n).split("\n"),s=t.copyState(o,r.getTokenAt(e).state),a=r.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],a);!f.eol();){var h=t.innerMode(o,s),g=o.token(f,s),v=f.current();f.start=f.pos,u&&!/\S/.test(v)||(l+=v,u=!1),!u&&h.mode.newlineAfterToken&&h.mode.newlineAfterToken(g,v,f.string.slice(f.pos)||i[d+1]||"",h.state)&&p()}!f.pos&&o.blankLine&&o.blankLine(s),!u&&d<i.length-1&&p()}r.operation((function(){r.replaceRange(l,e,n);for(var t=e.line+1,o=e.line+c;t<=o;++t)r.indentLine(t,"smart");r.setSelection(e,r.getCursor(!1))}))}))}(n(237))},237:function(t){t.exports=function(){var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),o=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),i=/Edge\/(\d+)/.exec(t),s=r||o||i,a=s&&(r?document.documentMode||6:+(i||o)[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),g=d&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),v=/Android/.test(t),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),w=/win/i.test(e),_=p&&t.match(/Version\/(\d*\.\d*)/);_&&(_=Number(_[1])),_&&_>=15&&(p=!1,l=!0);var x=y&&(c||p&&(null==_||_<12.11)),C=n||s&&a>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var T,O=function(t,e){var n=t.className,r=S(e).exec(n);if(r){var o=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function A(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function E(t,e){return A(t).appendChild(e)}function k(t,e,n,r){var o=document.createElement(t);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof e)o.appendChild(document.createTextNode(e));else if(e)for(var i=0;i<e.length;++i)o.appendChild(e[i]);return o}function P(t,e,n,r){var o=k(t,e,n,r);return o.setAttribute("role","presentation"),o}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 N(t,e){var n=t.className;S(e).test(n)||(t.className+=(n?" ":"")+e)}function L(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(e)&&(e+=" "+n[r]);return e}T=document.createRange?function(t,e,n,r){var o=document.createRange();return o.setEnd(r||t,n),o.setStart(t,e),o}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(t){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r};var I=function(t){t.select()};function $(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function D(t,e,n){for(var r in e||(e={}),t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function R(t,e,n,r,o){null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length);for(var i=r||0,s=o||0;;){var a=t.indexOf("\t",i);if(a<0||a>=e)return s+(e-i);s+=a-i,s+=n-s%n,i=a+1}}g?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:s&&(I=function(t){try{t.select()}catch(t){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=$(this.onTimeout,this)};function F(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}H.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},H.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 V={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},B={origin:"*mouse"},z={origin:"+move"};function W(t,e,n){for(var r=0,o=0;;){var i=t.indexOf("\t",r);-1==i&&(i=t.length);var s=i-r;if(i==t.length||o+s>=e)return r+Math.min(s,e-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=e)return r}}var q=[""];function G(t){for(;q.length<=t;)q.push(K(q)+" ");return q[t]}function K(t){return t[t.length-1]}function Y(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function X(){}function J(t,e){var n;return Object.create?n=Object.create(t):(X.prototype=t,n=new X),e&&D(e,n),n}var Z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(t){return/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||Z.test(t))}function tt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&Q(t))||e.test(t):Q(t)}function et(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var nt=/[\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 rt(t){return t.charCodeAt(0)>=768&&nt.test(t)}function ot(t,e,n){for(;(n<0?e>0:e<t.length)&&rt(t.charAt(e));)e+=n;return e}function it(t,e,n){for(var r=e>n?-1:1;;){if(e==n)return e;var o=(e+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==e)return t(i)?e:n;t(i)?n=i:e=i+r}}var st=null;function at(t,e,n){var r;st=null;for(var o=0;o<t.length;++o){var i=t[o];if(i.from<e&&i.to>e)return o;i.to==e&&(i.from!=i.to&&"before"==n?r=o:st=o),i.from==e&&(i.from!=i.to&&"before"!=n?r=o:st=o)}return null!=r?r:st}var lt=function(){function t(t){return t<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(t):1424<=t&&t<=1524?"R":1536<=t&&t<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(t-1536):1774<=t&&t<=2220?"r":8192<=t&&t<=8203?"w":8204==t?"b":"L"}var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,r=/[LRr]/,o=/[Lb1n]/,i=/[1n]/;function s(t,e,n){this.level=t,this.from=e,this.to=n}return function(a,l){var c="ltr"==l?"L":"R";if(0==a.length||"ltr"==l&&!e.test(a))return!1;for(var u=a.length,p=[],d=0;d<u;++d)p.push(t(a.charCodeAt(d)));for(var f=0,h=c;f<u;++f){var g=p[f];"m"==g?p[f]=h:h=g}for(var v=0,m=c;v<u;++v){var y=p[v];"1"==y&&"r"==m?p[v]="n":r.test(y)&&(m=y,"r"==y&&(p[v]="R"))}for(var b=1,w=p[0];b<u-1;++b){var _=p[b];"+"==_&&"1"==w&&"1"==p[b+1]?p[b]="1":","!=_||w!=p[b+1]||"1"!=w&&"n"!=w||(p[b]=w),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 T=x&&"!"==p[x-1]||S<u&&"1"==p[S]?"1":"N",O=x;O<S;++O)p[O]=T;x=S-1}}for(var A=0,E=c;A<u;++A){var k=p[A];"L"==E&&"1"==k?p[A]="L":r.test(k)&&(E=k)}for(var P=0;P<u;++P)if(n.test(p[P])){var j=void 0;for(j=P+1;j<u&&n.test(p[j]);++j);for(var M="L"==(P?p[P-1]:c),N=M==("L"==(j<u?p[j]:c))?M?"L":"R":c,L=P;L<j;++L)p[L]=N;P=j-1}for(var I,$=[],D=0;D<u;)if(o.test(p[D])){var R=D;for(++D;D<u&&o.test(p[D]);++D);$.push(new s(0,R,D))}else{var H=D,F=$.length,V="rtl"==l?1:0;for(++D;D<u&&"L"!=p[D];++D);for(var U=H;U<D;)if(i.test(p[U])){H<U&&($.splice(F,0,new s(1,H,U)),F+=V);var B=U;for(++U;U<D&&i.test(p[U]);++U);$.splice(F,0,new s(2,B,U)),F+=V,H=U}else++U;H<D&&$.splice(F,0,new s(1,H,D))}return"ltr"==l&&(1==$[0].level&&(I=a.match(/^\s+/))&&($[0].from=I[0].length,$.unshift(new s(0,0,I[0].length))),1==K($).level&&(I=a.match(/\s+$/))&&(K($).to-=I[0].length,$.push(new s(0,u-I[0].length,u)))),"rtl"==l?$.reverse():$}}();function ct(t,e){var n=t.order;return null==n&&(n=t.order=lt(t.text,e)),n}var ut=[],pt=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={});r[e]=(r[e]||ut).concat(n)}};function dt(t,e){return t._handlers&&t._handlers[e]||ut}function ft(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers,o=r&&r[e];if(o){var i=F(o,n);i>-1&&(r[e]=o.slice(0,i).concat(o.slice(i+1)))}}}function ht(t,e){var n=dt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o<n.length;++o)n[o].apply(null,r)}function gt(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),ht(t,n||e.type,t,e),_t(e)||e.codemirrorIgnore}function vt(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==F(n,e[r])&&n.push(e[r])}function mt(t,e){return dt(t,e).length>0}function yt(t){t.prototype.on=function(t,e){pt(this,t,e)},t.prototype.off=function(t,e){ft(this,t,e)}}function bt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function wt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function _t(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function xt(t){bt(t),wt(t)}function Ct(t){return t.target||t.srcElement}function St(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Tt,Ot,At=function(){if(s&&a<9)return!1;var t=k("div");return"draggable"in t||"dragDrop"in t}();function Et(t){if(null==Tt){var e=k("span","");E(t,k("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Tt=e.offsetWidth<=1&&e.offsetHeight>2&&!(s&&a<8))}var n=Tt?k("span",""):k("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function kt(t){if(null!=Ot)return Ot;var e=E(t,document.createTextNode("AخA")),n=T(e,0,1).getBoundingClientRect(),r=T(e,1,2).getBoundingClientRect();return A(t),!(!n||n.left==n.right)&&(Ot=r.right-n.right<3)}var Pt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var o=t.indexOf("\n",e);-1==o&&(o=t.length);var i=t.slice(e,"\r"==t.charAt(o-1)?o-1:o),s=i.indexOf("\r");-1!=s?(n.push(i.slice(0,s)),e+=s+1):(n.push(i),e=o+1)}return n}:function(t){return t.split(/\r\n?|\n/)},jt=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)},Mt=function(){var t=k("div");return"oncopy"in t||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),Nt=null;var Lt={},It={};function $t(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Lt[t]=e}function Dt(t){if("string"==typeof t&&It.hasOwnProperty(t))t=It[t];else if(t&&"string"==typeof t.name&&It.hasOwnProperty(t.name)){var e=It[t.name];"string"==typeof e&&(e={name:e}),(t=J(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Dt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Dt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Rt(t,e){e=Dt(e);var n=Lt[e.name];if(!n)return Rt(t,"text/plain");var r=n(t,e);if(Ht.hasOwnProperty(e.name)){var o=Ht[e.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)r[s]=e.modeProps[s];return r}var Ht={};function Ft(t,e){D(e,Ht.hasOwnProperty(t)?Ht[t]:Ht[t]={})}function Vt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var o=e[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Ut(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 Bt(t,e,n){return!t.startState||t.startState(e,n)}var zt=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 Wt(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 r=0;;++r){var o=n.children[r],i=o.chunkSize();if(e<i){n=o;break}e-=i}return n.lines[e]}function qt(t,e,n){var r=[],o=e.line;return t.iter(e.line,n.line+1,(function(t){var i=t.text;o==n.line&&(i=i.slice(0,n.ch)),o==e.line&&(i=i.slice(e.ch)),r.push(i),++o})),r}function Gt(t,e,n){var r=[];return t.iter(e,n,(function(t){r.push(t.text)})),r}function Kt(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function Yt(t){if(null==t.parent)return null;for(var e=t.parent,n=F(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var o=0;r.children[o]!=e;++o)n+=r.children[o].chunkSize();return n+e.first}function Xt(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var o=t.children[r],i=o.height;if(e<i){t=o;continue t}e-=i,n+=o.chunkSize()}return n}while(!t.lines);for(var s=0;s<t.lines.length;++s){var a=t.lines[s].height;if(e<a)break;e-=a}return n+s}function Jt(t,e){return e>=t.first&&e<t.first+t.size}function Zt(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function Qt(t,e,n){if(void 0===n&&(n=null),!(this instanceof Qt))return new Qt(t,e,n);this.line=t,this.ch=e,this.sticky=n}function te(t,e){return t.line-e.line||t.ch-e.ch}function ee(t,e){return t.sticky==e.sticky&&0==te(t,e)}function ne(t){return Qt(t.line,t.ch)}function re(t,e){return te(t,e)<0?e:t}function oe(t,e){return te(t,e)<0?t:e}function ie(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function se(t,e){if(e.line<t.first)return Qt(t.first,0);var n=t.first+t.size-1;return e.line>n?Qt(n,Wt(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?Qt(t.line,e):n<0?Qt(t.line,0):t}(e,Wt(t,e.line).text.length)}function ae(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=se(t,e[r]);return n}zt.prototype.eol=function(){return this.pos>=this.string.length},zt.prototype.sol=function(){return this.pos==this.lineStart},zt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},zt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},zt.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},zt.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},zt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},zt.prototype.skipToEnd=function(){this.pos=this.string.length},zt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},zt.prototype.backUp=function(t){this.pos-=t},zt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=R(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},zt.prototype.indentation=function(){return R(this.string,null,this.tabSize)-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},zt.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var o=function(t){return n?t.toLowerCase():t};if(o(this.string.substr(this.pos,t.length))==o(t))return!1!==e&&(this.pos+=t.length),!0},zt.prototype.current=function(){return this.string.slice(this.start,this.pos)},zt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},zt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},zt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var le=function(t,e){this.state=t,this.lookAhead=e},ce=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ue(t,e,n,r){var o=[t.state.modeGen],i={};be(t,e.text,t.doc.mode,n,(function(t,e){return o.push(t,e)}),i,r);for(var s=n.state,a=function(r){n.baseTokens=o;var a=t.state.overlays[r],l=1,c=0;n.state=!0,be(t,e.text,a.mode,n,(function(t,e){for(var n=l;c<t;){var r=o[l];r>t&&o.splice(l,1,t,o[l+1],r),l+=2,c=Math.min(t,r)}if(e)if(a.opaque)o.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"overlay "+e}}),i),n.state=s,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)a(l);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function pe(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=de(t,Yt(e)),o=e.text.length>t.options.maxHighlightLength&&Vt(t.doc.mode,r.state),i=ue(t,e,r);o&&(r.state=o),e.stateAfter=r.save(!o),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 de(t,e,n){var r=t.doc,o=t.display;if(!r.mode.startState)return new ce(r,!0,e);var i=function(t,e,n){for(var r,o,i=t.doc,s=n?-1:e-(t.doc.mode.innerMode?1e3:100),a=e;a>s;--a){if(a<=i.first)return i.first;var l=Wt(i,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof le?c.lookAhead:0)<=i.modeFrontier))return a;var u=R(l.text,null,t.options.tabSize);(null==o||r>u)&&(o=a-1,r=u)}return o}(t,e,n),s=i>r.first&&Wt(r,i-1).stateAfter,a=s?ce.fromSaved(r,s,i):new ce(r,Bt(r.mode),i);return r.iter(i,e,(function(n){fe(t,n.text,a);var r=a.line;n.stateAfter=r==e-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?a.save():null,a.nextLine()})),n&&(r.modeFrontier=a.line),a}function fe(t,e,n,r){var o=t.doc.mode,i=new zt(e,t.options.tabSize,n);for(i.start=i.pos=r||0,""==e&&he(o,n.state);!i.eol();)ge(o,i,n.state),i.start=i.pos}function he(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Ut(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function ge(t,e,n,r){for(var o=0;o<10;o++){r&&(r[0]=Ut(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.")}ce.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ce.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}},ce.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ce.fromSaved=function(t,e,n){return e instanceof le?new ce(t,Vt(t.mode,e.state),n,e.lookAhead):new ce(t,Vt(t.mode,e),n)},ce.prototype.save=function(t){var e=!1!==t?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new le(e,this.maxLookAhead):e};var ve=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function me(t,e,n,r){var o,i,s=t.doc,a=s.mode,l=Wt(s,(e=se(s,e)).line),c=de(t,e.line,n),u=new zt(l.text,t.options.tabSize,c);for(r&&(i=[]);(r||u.pos<e.ch)&&!u.eol();)u.start=u.pos,o=ge(a,u,c.state),r&&i.push(new ve(u,o,Vt(s.mode,c.state)));return r?i:new ve(u,o,c.state)}function ye(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 r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(e[r])||(e[r]+=" "+n[2])}return t}function be(t,e,n,r,o,i,s){var a=n.flattenSpans;null==a&&(a=t.options.flattenSpans);var l,c=0,u=null,p=new zt(e,t.options.tabSize,r),d=t.options.addModeClass&&[null];for(""==e&&ye(he(n,r.state),i);!p.eol();){if(p.pos>t.options.maxHighlightLength?(a=!1,s&&fe(t,e,r,p.pos),p.pos=e.length,l=null):l=ye(ge(n,p,r.state,d),i),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;c<p.start;)o(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);o(h,u),c=h}}var we=!1,_e=!1;function xe(t,e,n){this.marker=t,this.from=e,this.to=n}function Ce(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function Se(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Te(t,e){if(e.full)return null;var n=Jt(t,e.from.line)&&Wt(t,e.from.line).markedSpans,r=Jt(t,e.to.line)&&Wt(t,e.to.line).markedSpans;if(!n&&!r)return null;var o=e.from.ch,i=e.to.ch,s=0==te(e.from,e.to),a=function(t,e,n){var r;if(t)for(var o=0;o<t.length;++o){var i=t[o],s=i.marker;if(null==i.from||(s.inclusiveLeft?i.from<=e:i.from<e)||i.from==e&&"bookmark"==s.type&&(!n||!i.marker.insertLeft)){var a=null==i.to||(s.inclusiveRight?i.to>=e:i.to>e);(r||(r=[])).push(new xe(s,i.from,a?null:i.to))}}return r}(n,o,s),l=function(t,e,n){var r;if(t)for(var o=0;o<t.length;++o){var i=t[o],s=i.marker;if(null==i.to||(s.inclusiveRight?i.to>=e:i.to>e)||i.from==e&&"bookmark"==s.type&&(!n||i.marker.insertLeft)){var a=null==i.from||(s.inclusiveLeft?i.from<=e:i.from<e);(r||(r=[])).push(new xe(s,a?null:i.from-e,null==i.to?null:i.to-e))}}return r}(r,i,s),c=1==e.text.length,u=K(e.text).length+(c?o:0);if(a)for(var p=0;p<a.length;++p){var d=a[p];if(null==d.to){var f=Ce(l,d.marker);f?c&&(d.to=null==f.to?null:f.to+u):d.to=o}}if(l)for(var h=0;h<l.length;++h){var g=l[h];null!=g.to&&(g.to+=u),null==g.from?Ce(a,g.marker)||(g.from=u,c&&(a||(a=[])).push(g)):(g.from+=u,c&&(a||(a=[])).push(g))}a&&(a=Oe(a)),l&&l!=a&&(l=Oe(l));var v=[a];if(!c){var m,y=e.text.length-2;if(y>0&&a)for(var b=0;b<a.length;++b)null==a[b].to&&(m||(m=[])).push(new xe(a[b].marker,null,null));for(var w=0;w<y;++w)v.push(m);v.push(l)}return v}function Oe(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 Ae(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Ee(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function ke(t){return t.inclusiveLeft?-1:0}function Pe(t){return t.inclusiveRight?1:0}function je(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),o=e.find(),i=te(r.from,o.from)||ke(t)-ke(e);return i?-i:te(r.to,o.to)||Pe(t)-Pe(e)||e.id-t.id}function Me(t,e){var n,r=_e&&t.markedSpans;if(r)for(var o=void 0,i=0;i<r.length;++i)(o=r[i]).marker.collapsed&&null==(e?o.from:o.to)&&(!n||je(n,o.marker)<0)&&(n=o.marker);return n}function Ne(t){return Me(t,!0)}function Le(t){return Me(t,!1)}function Ie(t,e){var n,r=_e&&t.markedSpans;if(r)for(var o=0;o<r.length;++o){var i=r[o];i.marker.collapsed&&(null==i.from||i.from<e)&&(null==i.to||i.to>e)&&(!n||je(n,i.marker)<0)&&(n=i.marker)}return n}function $e(t,e,n,r,o){var i=Wt(t,e),s=_e&&i.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var c=l.marker.find(0),u=te(c.from,n)||ke(l.marker)-ke(o),p=te(c.to,r)||Pe(l.marker)-Pe(o);if(!(u>=0&&p<=0||u<=0&&p>=0)&&(u<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?te(c.to,n)>=0:te(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?te(c.from,r)<=0:te(c.from,r)<0)))return!0}}}function De(t){for(var e;e=Ne(t);)t=e.find(-1,!0).line;return t}function Re(t,e){var n=Wt(t,e),r=De(n);return n==r?e:Yt(r)}function He(t,e){if(e>t.lastLine())return e;var n,r=Wt(t,e);if(!Fe(t,r))return e;for(;n=Le(r);)r=n.find(1,!0).line;return Yt(r)+1}function Fe(t,e){var n=_e&&e.markedSpans;if(n)for(var r=void 0,o=0;o<n.length;++o)if((r=n[o]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Ve(t,e,r))return!0}}function Ve(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return Ve(t,r.line,Ce(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var o=void 0,i=0;i<e.markedSpans.length;++i)if((o=e.markedSpans[i]).marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.from)&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ve(t,e,o))return!0}function Ue(t){for(var e=0,n=(t=De(t)).parent,r=0;r<n.lines.length;++r){var o=n.lines[r];if(o==t)break;e+=o.height}for(var i=n.parent;i;i=(n=i).parent)for(var s=0;s<i.children.length;++s){var a=i.children[s];if(a==n)break;e+=a.height}return e}function Be(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=Ne(r);){var o=e.find(0,!0);r=o.from.line,n+=o.from.ch-o.to.ch}for(r=t;e=Le(r);){var i=e.find(0,!0);n-=r.text.length-i.from.ch,n+=(r=i.to.line).text.length-i.to.ch}return n}function ze(t){var e=t.display,n=t.doc;e.maxLine=Wt(n,n.first),e.maxLineLength=Be(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=Be(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var We=function(t,e,n){this.text=t,Ee(this,e),this.height=n?n(this):1};function qe(t){t.parent=null,Ae(t)}We.prototype.lineNo=function(){return Yt(this)},yt(We);var Ge={},Ke={};function Ye(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?Ke:Ge;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function Xe(t,e){var n=P("span",null,null,l?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var o=0;o<=(e.rest?e.rest.length:0);o++){var i=o?e.rest[o-1]:e.line,s=void 0;r.pos=0,r.addToken=Ze,kt(t.display.measure)&&(s=ct(i,t.doc.direction))&&(r.addToken=Qe(r.addToken,s)),r.map=[],en(i,r,pe(t,i,e!=t.display.externalMeasured&&Yt(i))),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=L(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=L(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Et(t.display.measure))),0==o?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ht(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=L(r.pre.className,r.textClass||"")),r}function Je(t){var e=k("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function Ze(t,e,n,r,o,i,l){if(e){var c,u=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",o=0;o<t.length;o++){var i=t.charAt(o);" "!=i||!n||o!=t.length-1&&32!=t.charCodeAt(o+1)||(i=" "),r+=i,n=" "==i}return r}(e,t.trailingSpace):e,p=t.cm.state.specialChars,d=!1;if(p.test(e)){c=document.createDocumentFragment();for(var f=0;;){p.lastIndex=f;var h=p.exec(e),g=h?h.index-f:e.length-f;if(g){var v=document.createTextNode(u.slice(f,f+g));s&&a<9?c.appendChild(k("span",[v])):c.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!h)break;f+=g+1;var m=void 0;if("\t"==h[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(m=c.appendChild(k("span",G(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=b}else"\r"==h[0]||"\n"==h[0]?((m=c.appendChild(k("span","\r"==h[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",h[0]),t.col+=1):((m=t.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),s&&a<9?c.appendChild(k("span",[m])):c.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),s&&a<9&&(d=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||r||o||d||i||l){var w=n||"";r&&(w+=r),o&&(w+=o);var _=k("span",[c],w,i);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&_.setAttribute(x,l[x]);return t.content.appendChild(_)}t.content.appendChild(c)}}function Qe(t,e){return function(n,r,o,i,s,a,l){o=o?o+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.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,r,o,i,s,a,l);t(n,r.slice(0,p.to-c),o,i,null,a,l),i=null,r=r.slice(p.to-c),c=p.to}}}function tn(t,e,n,r){var o=!r&&n.widgetNode;o&&t.map.push(t.pos,t.pos+e,o),!r&&t.cm.display.input.needsContentAttribute&&(o||(o=t.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(t.cm.display.input.setUneditable(o),t.content.appendChild(o)),t.pos+=e,t.trailingSpace=!1}function en(t,e,n){var r=t.markedSpans,o=t.text,i=0;if(r)for(var s,a,l,c,u,p,d,f=o.length,h=0,g=1,v="",m=0;;){if(m==h){l=c=u=a="",d=null,p=null,m=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var _=r[w],x=_.marker;if("bookmark"==x.type&&_.from==h&&x.widgetNode)y.push(x);else if(_.from<=h&&(null==_.to||_.to>h||x.collapsed&&_.to==h&&_.from==h)){if(null!=_.to&&_.to!=h&&m>_.to&&(m=_.to,c=""),x.className&&(l+=" "+x.className),x.css&&(a=(a?a+";":"")+x.css),x.startStyle&&_.from==h&&(u+=" "+x.startStyle),x.endStyle&&_.to==m&&(b||(b=[])).push(x.endStyle,_.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||je(p.marker,x)<0)&&(p=_)}else _.from>h&&m>_.from&&(m=_.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==m&&(c+=" "+b[S]);if(!p||p.from==h)for(var T=0;T<y.length;++T)tn(e,0,y[T]);if(p&&(p.from||0)==h){if(tn(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 O=Math.min(f,m);;){if(v){var A=h+v.length;if(!p){var E=A>O?v.slice(0,O-h):v;e.addToken(e,E,s?s+l:l,u,h+E.length==m?c:"",a,d)}if(A>=O){v=v.slice(O-h),h=O;break}h=A,u=""}v=o.slice(i,i=n[g++]),s=Ye(n[g++],e.cm.options)}}else for(var k=1;k<n.length;k+=2)e.addToken(e,o.slice(i,i=n[k]),Ye(n[k+1],e.cm.options))}function nn(t,e,n){this.line=e,this.rest=function(t){for(var e,n;e=Le(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}(e),this.size=this.rest?Yt(K(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Fe(t,e)}function rn(t,e,n){for(var r,o=[],i=e;i<n;i=r){var s=new nn(t.doc,Wt(t.doc,i),i);r=i+s.size,o.push(s)}return o}var on=null;var sn=null;function an(t,e){var n=dt(t,e);if(n.length){var r,o=Array.prototype.slice.call(arguments,2);on?r=on.delayedCallbacks:sn?r=sn:(r=sn=[],setTimeout(ln,0));for(var i=function(t){r.push((function(){return n[t].apply(null,o)}))},s=0;s<n.length;++s)i(s)}}function ln(){var t=sn;sn=null;for(var e=0;e<t.length;++e)t[e]()}function cn(t,e,n,r){for(var o=0;o<e.changes.length;o++){var i=e.changes[o];"text"==i?dn(t,e):"gutter"==i?hn(t,e,n,r):"class"==i?fn(t,e):"widget"==i&&gn(t,e,r)}e.changes=null}function un(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),s&&a<8&&(t.node.style.zIndex=2)),t.node}function pn(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):Xe(t,e)}function dn(t,e){var n=e.text.className,r=pn(t,e);e.text==e.node&&(e.node=r.pre),e.text.parentNode.replaceChild(r.pre,e.text),e.text=r.pre,r.bgClass!=e.bgClass||r.textClass!=e.textClass?(e.bgClass=r.bgClass,e.textClass=r.textClass,fn(t,e)):n&&(e.text.className=n)}function fn(t,e){(function(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 r=un(e);e.background=r.insertBefore(k("div",null,n),r.firstChild),t.display.input.setUneditable(e.background)}})(t,e),e.line.wrapClass?un(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 hn(t,e,n,r){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 o=un(e);e.gutterBackground=k("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),o.insertBefore(e.gutterBackground,e.text)}var i=e.line.gutterMarkers;if(t.options.lineNumbers||i){var s=un(e),a=e.gutter=k("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),t.display.input.setUneditable(a),s.insertBefore(a,e.text),e.line.gutterClass&&(a.className+=" "+e.line.gutterClass),!t.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(e.lineNumber=a.appendChild(k("div",Zt(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.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&&a.appendChild(k("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function gn(t,e,n){e.alignable&&(e.alignable=null);for(var r=S("CodeMirror-linewidget"),o=e.node.firstChild,i=void 0;o;o=i)i=o.nextSibling,r.test(o.className)&&e.node.removeChild(o);mn(t,e,n)}function vn(t,e,n,r){var o=pn(t,e);return e.text=e.node=o.pre,o.bgClass&&(e.bgClass=o.bgClass),o.textClass&&(e.textClass=o.textClass),fn(t,e),hn(t,e,n,r),mn(t,e,r),e.node}function mn(t,e,n){if(yn(t,e.line,e,n,!0),e.rest)for(var r=0;r<e.rest.length;r++)yn(t,e.rest[r],e,n,!1)}function yn(t,e,n,r,o){if(e.widgets)for(var i=un(n),s=0,a=e.widgets;s<a.length;++s){var l=a[s],c=k("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),bn(l,c,n,r),t.display.input.setUneditable(c),o&&l.above?i.insertBefore(c,n.gutter||n.text):i.appendChild(c),an(l,"redraw")}}function bn(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var o=r.wrapperWidth;e.style.left=r.fixedPos+"px",t.coverGutter||(o-=r.gutterTotalWidth,e.style.paddingLeft=r.gutterTotalWidth+"px"),e.style.width=o+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px"))}function wn(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 _n(t,e){for(var n=Ct(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 xn(t){return t.lineSpace.offsetTop}function Cn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Sn(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,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(t.cachedPaddingH=r),r}function Tn(t){return 50-t.display.nativeBarWidth}function On(t){return t.display.scroller.clientWidth-Tn(t)-t.display.barWidth}function An(t){return t.display.scroller.clientHeight-Tn(t)-t.display.barHeight}function En(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var o=0;o<t.rest.length;o++)if(Yt(t.rest[o])>n)return{map:t.measure.maps[o],cache:t.measure.caches[o],before:!0}}function kn(t,e,n,r){return Mn(t,jn(t,e),n,r)}function Pn(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[cr(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function jn(t,e){var n=Yt(e),r=Pn(t,n);r&&!r.text?r=null:r&&r.changes&&(cn(t,r,n,or(t)),t.curOp.forceUpdate=!0),r||(r=function(t,e){var n=Yt(e=De(e)),r=t.display.externalMeasured=new nn(t.doc,e,n);r.lineN=n;var o=r.built=Xe(t,r);return r.text=o.pre,E(t.display.lineMeasure,o.pre),r}(t,e));var o=En(r,e,n);return{line:e,view:r,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Mn(t,e,n,r,o){e.before&&(n=-1);var i,l=n+(r||"");return e.cache.hasOwnProperty(l)?i=e.cache[l]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(function(t,e,n){var r=t.options.lineWrapping,o=r&&On(t);if(!e.measure.heights||r&&e.measure.width!=o){var i=e.measure.heights=[];if(r){e.measure.width=o;for(var s=e.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],c=s[a+1];Math.abs(l.bottom-c.bottom)>2&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(i=function(t,e,n,r){var o,i=In(e.map,n,r),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&&rt(e.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u<i.coverEnd&&rt(e.line.text.charAt(i.coverStart+u));)++u;if((o=s&&a<9&&0==c&&u==i.coverEnd-i.coverStart?l.parentNode.getBoundingClientRect():$n(T(l,c,u).getClientRects(),r)).left||o.right||0==c)break;u=c,c-=1,p="right"}s&&a<11&&(o=function(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(t){if(null!=Nt)return Nt;var e=E(t,k("span","x")),n=e.getBoundingClientRect(),r=T(e,0,1).getBoundingClientRect();return Nt=Math.abs(n.left-r.left)>1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}(t.display.measure,o))}else{var f;c>0&&(p=r="right"),o=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(s&&a<9&&!c&&(!o||!o.left&&!o.right)){var h=l.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+rr(t.display),top:h.top,bottom:h.bottom}:Ln}for(var g=o.top-e.rect.top,v=o.bottom-e.rect.top,m=(g+v)/2,y=e.view.measure.heights,b=0;b<y.length-1&&!(m<y[b]);b++);var w=b?y[b-1]:0,_=y[b],x={left:("right"==p?o.right:o.left)-e.rect.left,right:("left"==p?o.left:o.right)-e.rect.left,top:w,bottom:_};return o.left||o.right||(x.bogus=!0),t.options.singleCursorHeightPerLine||(x.rtop=g,x.rbottom=v),x}(t,e,n,r)).bogus||(e.cache[l]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var Nn,Ln={left:0,right:0,top:0,bottom:0};function In(t,e,n){for(var r,o,i,s,a,l,c=0;c<t.length;c+=3)if(a=t[c],l=t[c+1],e<a?(o=0,i=1,s="left"):e<l?i=1+(o=e-a):(c==t.length-3||e==l&&t[c+3]>e)&&(o=(i=l-a)-1,e>=l&&(s="right")),null!=o){if(r=t[c+2],a==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==o)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)r=t[2+(c-=3)],s="left";if("right"==n&&o==l-a)for(;c<t.length-3&&t[c+3]==t[c+4]&&!t[c+5].insertLeft;)r=t[(c+=3)+2],s="right";break}return{node:r,start:o,end:i,collapse:s,coverStart:a,coverEnd:l}}function $n(t,e){var n=Ln;if("left"==e)for(var r=0;r<t.length&&(n=t[r]).left==n.right;r++);else for(var o=t.length-1;o>=0&&(n=t[o]).left==n.right;o--);return n}function Dn(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 Rn(t){t.display.externalMeasure=null,A(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)Dn(t.display.view[e])}function Hn(t){Rn(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function Fn(){return u&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Vn(){return u&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Un(t){var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;++n)t.widgets[n].above&&(e+=wn(t.widgets[n]));return e}function Bn(t,e,n,r,o){if(!o){var i=Un(e);n.top+=i,n.bottom+=i}if("line"==r)return n;r||(r="local");var s=Ue(e);if("local"==r?s+=xn(t.display):s-=t.display.viewOffset,"page"==r||"window"==r){var a=t.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==r?0:Vn());var l=a.left+("window"==r?0:Fn());n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function zn(t,e,n){if("div"==n)return e;var r=e.left,o=e.top;if("page"==n)r-=Fn(),o-=Vn();else if("local"==n||!n){var i=t.display.sizer.getBoundingClientRect();r+=i.left,o+=i.top}var s=t.display.lineSpace.getBoundingClientRect();return{left:r-s.left,top:o-s.top}}function Wn(t,e,n,r,o){return r||(r=Wt(t.doc,e.line)),Bn(t,r,kn(t,r,e.ch,o),n)}function qn(t,e,n,r,o,i){function s(e,s){var a=Mn(t,o,e,s?"right":"left",i);return s?a.left=a.right:a.right=a.left,Bn(t,r,a,n)}r=r||Wt(t.doc,e.line),o||(o=jn(t,r));var a=ct(r,t.doc.direction),l=e.ch,c=e.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return s("before"==c?l-1:l,"before"==c);function u(t,e,n){return s(n?t-1:t,1==a[e].level!=n)}var p=at(a,l,c),d=st,f=u(l,p,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function Gn(t,e){var n=0;e=se(t.doc,e),t.options.lineWrapping||(n=rr(t.display)*e.ch);var r=Wt(t.doc,e.line),o=Ue(r)+xn(t.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Kn(t,e,n,r,o){var i=Qt(t,e,n);return i.xRel=o,r&&(i.outside=r),i}function Yn(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return Kn(r.first,0,null,-1,-1);var o=Xt(r,n),i=r.first+r.size-1;if(o>i)return Kn(r.first+r.size-1,Wt(r,i).text.length,null,1,1);e<0&&(e=0);for(var s=Wt(r,o);;){var a=Qn(t,s,o,e,n),l=Ie(s,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var c=l.find(1);if(c.line==o)return c;s=Wt(r,o=c.line)}}function Xn(t,e,n,r){r-=Un(e);var o=e.text.length,i=it((function(e){return Mn(t,n,e-1).bottom<=r}),o,0);return{begin:i,end:o=it((function(e){return Mn(t,n,e).top>r}),i,o)}}function Jn(t,e,n,r){return n||(n=jn(t,e)),Xn(t,e,n,Bn(t,e,Mn(t,n,r),"line").top)}function Zn(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function Qn(t,e,n,r,o){o-=Ue(e);var i=jn(t,e),s=Un(e),a=0,l=e.text.length,c=!0,u=ct(e,t.doc.direction);if(u){var p=(t.options.lineWrapping?er:tr)(t,e,n,i,u,r,o);a=(c=1!=p.level)?p.from:p.to-1,l=c?p.to:p.from-1}var d,f,h=null,g=null,v=it((function(e){var n=Mn(t,i,e);return n.top+=s,n.bottom+=s,!!Zn(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=e,g=n),!0)}),a,l),m=!1;if(g){var y=r-g.left<g.right-r,b=y==c;v=h+(b?0:1),f=b?"after":"before",d=y?g.left:g.right}else{c||v!=l&&v!=a||v++,f=0==v?"after":v==e.text.length?"before":Mn(t,i,v-(c?1:0)).bottom+s<=o==c?"after":"before";var w=qn(t,Qt(n,v,f),"line",e,i);d=w.left,m=o<w.top?-1:o>=w.bottom?1:0}return Kn(n,v=ot(e.text,v,1),f,m,r-d)}function tr(t,e,n,r,o,i,s){var a=it((function(a){var l=o[a],c=1!=l.level;return Zn(qn(t,Qt(n,c?l.to:l.from,c?"before":"after"),"line",e,r),i,s,!0)}),0,o.length-1),l=o[a];if(a>0){var c=1!=l.level,u=qn(t,Qt(n,c?l.from:l.to,c?"after":"before"),"line",e,r);Zn(u,i,s,!0)&&u.top>s&&(l=o[a-1])}return l}function er(t,e,n,r,o,i,s){var a=Xn(t,e,r,s),l=a.begin,c=a.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,p=null,d=0;d<o.length;d++){var f=o[d];if(!(f.from>=c||f.to<=l)){var h=Mn(t,r,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=h<i?i-h+1e9:h-i;(!u||p>g)&&(u=f,p=g)}}return u||(u=o[o.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 nr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Nn){Nn=k("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(k("br"));Nn.appendChild(document.createTextNode("x"))}E(t.measure,Nn);var n=Nn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),A(t.measure),n||1}function rr(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 r=e.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(t.cachedCharWidth=o),o||10}function or(t){for(var e=t.display,n={},r={},o=e.gutters.clientLeft,i=e.gutters.firstChild,s=0;i;i=i.nextSibling,++s){var a=t.display.gutterSpecs[s].className;n[a]=i.offsetLeft+i.clientLeft+o,r[a]=i.clientWidth}return{fixedPos:ir(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function ir(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function sr(t){var e=nr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/rr(t.display)-3);return function(o){if(Fe(t.doc,o))return 0;var i=0;if(o.widgets)for(var s=0;s<o.widgets.length;s++)o.widgets[s].height&&(i+=o.widgets[s].height);return n?i+(Math.ceil(o.text.length/r)||1)*e:i+e}}function ar(t){var e=t.doc,n=sr(t);e.iter((function(t){var e=n(t);e!=t.height&&Kt(t,e)}))}function lr(t,e,n,r){var o=t.display;if(!n&&"true"==Ct(e).getAttribute("cm-not-content"))return null;var i,s,a=o.lineSpace.getBoundingClientRect();try{i=e.clientX-a.left,s=e.clientY-a.top}catch(t){return null}var l,c=Yn(t,i,s);if(r&&c.xRel>0&&(l=Wt(t.doc,c.line).text).length==c.ch){var u=R(l,l.length,t.options.tabSize)-l.length;c=Qt(c.line,Math.max(0,Math.round((i-Sn(t.display).left)/rr(t.display))-u))}return c}function cr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;r<n.length;r++)if((e-=n[r].size)<0)return r}function ur(t,e,n,r){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),r||(r=0);var o=t.display;if(r&&n<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>e)&&(o.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=o.viewTo)_e&&Re(t.doc,e)<o.viewTo&&dr(t);else if(n<=o.viewFrom)_e&&He(t.doc,n+r)>o.viewFrom?dr(t):(o.viewFrom+=r,o.viewTo+=r);else if(e<=o.viewFrom&&n>=o.viewTo)dr(t);else if(e<=o.viewFrom){var i=fr(t,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):dr(t)}else if(n>=o.viewTo){var s=fr(t,e,e,-1);s?(o.view=o.view.slice(0,s.index),o.viewTo=s.lineN):dr(t)}else{var a=fr(t,e,e,-1),l=fr(t,n,n+r,1);a&&l?(o.view=o.view.slice(0,a.index).concat(rn(t,a.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=r):dr(t)}var c=o.externalMeasured;c&&(n<c.lineN?c.lineN+=r:e<c.lineN+c.size&&(o.externalMeasured=null))}function pr(t,e,n){t.curOp.viewChanged=!0;var r=t.display,o=t.display.externalMeasured;if(o&&e>=o.lineN&&e<o.lineN+o.size&&(r.externalMeasured=null),!(e<r.viewFrom||e>=r.viewTo)){var i=r.view[cr(t,e)];if(null!=i.node){var s=i.changes||(i.changes=[]);-1==F(s,n)&&s.push(n)}}}function dr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function fr(t,e,n,r){var o,i=cr(t,e),s=t.display.view;if(!_e||n==t.doc.first+t.doc.size)return{index:i,lineN:n};for(var a=t.display.viewFrom,l=0;l<i;l++)a+=s[l].size;if(a!=e){if(r>0){if(i==s.length-1)return null;o=a+s[i].size-e,i++}else o=a-e;e+=o,n+=o}for(;Re(t.doc,n)!=n;){if(i==(r<0?0:s.length-1))return null;n+=r*s[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function hr(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var o=e[r];o.hidden||o.node&&!o.changes||++n}return n}function gr(t){t.display.input.showSelection(t.display.input.prepareSelection())}function vr(t,e){void 0===e&&(e=!0);for(var n=t.doc,r={},o=r.cursors=document.createDocumentFragment(),i=r.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(e||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=t.display.viewTo||a.to().line<t.display.viewFrom)){var l=a.empty();(l||t.options.showCursorWhenSelecting)&&mr(t,a.head,o),l||br(t,a,i)}}return r}function mr(t,e,n){var r=qn(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),o=n.appendChild(k("div"," ","CodeMirror-cursor"));if(o.style.left=r.left+"px",o.style.top=r.top+"px",o.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var i=Wn(t,e,"div",null,null);i.right-i.left>0&&(o.style.width=i.right-i.left+"px")}if(r.other){var s=n.appendChild(k("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function yr(t,e){return t.top-e.top||t.left-e.left}function br(t,e,n){var r=t.display,o=t.doc,i=document.createDocumentFragment(),s=Sn(t.display),a=s.left,l=Math.max(r.sizerWidth,On(t)-r.sizer.offsetLeft)-s.right,c="ltr"==o.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),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: "+(r-e)+"px"))}function p(e,n,r){var i,s,p=Wt(o,e),d=p.text.length;function f(n,r){return Wn(t,Qt(e,n),"div",p,r)}function h(e,n,r){var o=Jn(t,p,null,e),i="ltr"==n==("after"==r)?"left":"right";return f("after"==r?o.begin:o.end-(/\s/.test(p.text.charAt(o.end-1))?2:1),i)[i]}var g=ct(p,o.direction);return function(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var o=!1,i=0;i<t.length;++i){var s=t[i];(s.from<n&&s.to>e||e==n&&s.to==e)&&(r(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr",i),o=!0)}o||r(e,n,"ltr")}(g,n||0,null==r?d:r,(function(t,e,o,p){var v="ltr"==o,m=f(t,v?"left":"right"),y=f(e-1,v?"right":"left"),b=null==n&&0==t,w=null==r&&e==d,_=0==p,x=!g||p==g.length-1;if(y.top-m.top<=3){var C=(c?w:b)&&x,S=(c?b:w)&&_?a:(v?m:y).left,T=C?l:(v?y:m).right;u(S,m.top,T-S,m.bottom)}else{var O,A,E,k;v?(O=c&&b&&_?a:m.left,A=c?l:h(t,o,"before"),E=c?a:h(e,o,"after"),k=c&&w&&x?l:y.right):(O=c?h(t,o,"before"):a,A=!c&&b&&_?l:m.right,E=!c&&w&&x?a:y.left,k=c?h(e,o,"after"):l),u(O,m.top,A-O,m.bottom),m.bottom<y.top&&u(a,m.bottom,null,y.top),u(E,y.top,k-E,y.bottom)}(!i||yr(m,i)<0)&&(i=m),yr(y,i)<0&&(i=y),(!s||yr(m,s)<0)&&(s=m),yr(y,s)<0&&(s=y)})),{start:i,end:s}}var d=e.from(),f=e.to();if(d.line==f.line)p(d.line,d.ch,f.ch);else{var h=Wt(o,d.line),g=Wt(o,f.line),v=De(h)==De(g),m=p(d.line,d.ch,v?h.text.length+1:null).end,y=p(f.line,v?0:null,f.ch).start;v&&(m.top<y.top-2?(u(m.right,m.top,null,m.bottom),u(a,y.top,y.left,y.bottom)):u(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&u(a,m.bottom,null,y.top)}n.appendChild(i)}function wr(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()||Sr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function _r(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Cr(t))}function xr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Sr(t))}),100)}function Cr(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(ht(t,"focus",t,e),t.state.focused=!0,N(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()),wr(t))}function Sr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(ht(t,"blur",t,e),t.state.focused=!1,O(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,r=Math.max(0,e.scroller.getBoundingClientRect().top),o=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(o+=c.line.height,s&&a<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 g=c.line.height-p;if((g>.005||g<-.005)&&(o<r&&(i-=g),Kt(c.line,p),Or(c.line),c.rest))for(var v=0;v<c.rest.length;v++)Or(c.rest[v]);if(d>t.display.sizerWidth){var m=Math.ceil(d/rr(t.display));m>t.display.maxLineLength&&(t.display.maxLineLength=m,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(e.scroller.scrollTop+=i)}function Or(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Ar(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-xn(t));var o=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,i=Xt(e,r),s=Xt(e,o);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;a<i?(i=a,s=Xt(e,Ue(Wt(e,a))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=s&&(i=Xt(e,Ue(Wt(e,l))-t.wrapper.clientHeight),s=l)}return{from:i,to:Math.max(s,i+1)}}function Er(t,e){var n=t.display,r=nr(t.display);e.top<0&&(e.top=0);var o=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,i=An(t),s={};e.bottom-e.top>i&&(e.bottom=e.top+i);var a=t.doc.height+Cn(n),l=e.top<r,c=e.bottom>a-r;if(e.top<o)s.scrollTop=l?0:e.top;else if(e.bottom>o+i){var u=Math.min(e.top,(c?a:e.bottom)-i);u!=o&&(s.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=On(t)-n.gutters.offsetWidth,h=e.right-e.left>f;return h&&(e.right=e.left+f),e.left<10?s.scrollLeft=0:e.left<d?s.scrollLeft=Math.max(0,e.left+p-(h?0:10)):e.right>f+d-3&&(s.scrollLeft=e.right+(h?0:10)-f),s}function kr(t,e){null!=e&&(Mr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Pr(t){Mr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function jr(t,e,n){null==e&&null==n||Mr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Mr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Nr(t,Gn(t,e.from),Gn(t,e.to),e.margin))}function Nr(t,e,n,r){var o=Er(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});jr(t,o.scrollLeft,o.scrollTop)}function Lr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||ao(t,{top:e}),Ir(t,e,!0),n&&ao(t),no(t,100))}function Ir(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 $r(t,e,n,r){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)&&!r||(t.doc.scrollLeft=e,uo(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function Dr(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Cn(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:r,scrollHeight:r+Tn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var Rr=function(t,e,n){this.cm=n;var r=this.vert=k("div",[k("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=k("div",[k("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,t(r),t(o),pt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),pt(o,"scroll",(function(){o.clientWidth&&e(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Rr.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var o=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var i=t.viewWidth-t.barLeft-(n?r: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==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},Rr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Rr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Rr.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},Rr.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,(function r(){var o=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}))},Rr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Hr=function(){};function Fr(t,e){e||(e=Dr(t));var n=t.display.barWidth,r=t.display.barHeight;Vr(t,e);for(var o=0;o<4&&n!=t.display.barWidth||r!=t.display.barHeight;o++)n!=t.display.barWidth&&t.options.lineWrapping&&Tr(t),Vr(t,Dr(t)),n=t.display.barWidth,r=t.display.barHeight}function Vr(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}Hr.prototype.update=function(){return{bottom:0,right:0}},Hr.prototype.setScrollLeft=function(){},Hr.prototype.setScrollTop=function(){},Hr.prototype.clear=function(){};var Ur={native:Rr,null:Hr};function Br(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&O(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Ur[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),pt(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?$r(t,e):Lr(t,e)}),t),t.display.scrollbars.addClass&&N(t.display.wrapper,t.display.scrollbars.addClass)}var zr=0;function Wr(t){var e;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:++zr,markArrays:null},e=t.curOp,on?on.ops.push(e):e.ownsGroup=on={ops:[e],delayedCallbacks:[]}}function qr(t){var e=t.curOp;e&&function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var r=0;r<t.ops.length;r++){var o=t.ops[r];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(n<e.length)}(n)}finally{on=null,e(n)}}(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;!function(t){for(var e=t.ops,n=0;n<e.length;n++)Gr(e[n]);for(var r=0;r<e.length;r++)Kr(e[r]);for(var o=0;o<e.length;o++)Yr(e[o]);for(var i=0;i<e.length;i++)Xr(e[i]);for(var s=0;s<e.length;s++)Jr(e[s])}(t)}))}function Gr(t){var e=t.cm,n=e.display;(function(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Tn(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Tn(t)+"px",e.scrollbarsClipped=!0)})(e),t.updateMaxLine&&ze(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 oo(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Kr(t){t.updatedDisplay=t.mustUpdate&&io(t.cm,t.update)}function Yr(t){var e=t.cm,n=e.display;t.updatedDisplay&&Tr(e),t.barMeasure=Dr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=kn(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+Tn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-On(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Xr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&$r(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)&&Fr(e,t.barMeasure),t.updatedDisplay&&co(e,t.barMeasure),t.selectionChanged&&wr(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&_r(t.cm)}function Jr(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&so(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&Ir(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&$r(e,t.scrollLeft,!0,!0),t.scrollToPos&&function(t,e){if(!gt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),o=null;if(e.top+r.top<0?o=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!h){var i=k("div","",null,"position: absolute;\n top: "+(e.top-n.viewOffset-xn(t.display))+"px;\n height: "+(e.bottom-e.top+Tn(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(o),t.display.lineSpace.removeChild(i)}}}(e,function(t,e,n,r){var o;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?Qt(e.line,e.ch+1,"before"):e,e=e.ch?Qt(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var i=0;i<5;i++){var s=!1,a=qn(t,e),l=n&&n!=e?qn(t,n):a,c=Er(t,o={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-r,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+r}),u=t.doc.scrollTop,p=t.doc.scrollLeft;if(null!=c.scrollTop&&(Lr(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(s=!0)),null!=c.scrollLeft&&($r(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-p)>1&&(s=!0)),!s)break}return o}(e,se(r,t.scrollToPos.from),se(r,t.scrollToPos.to),t.scrollToPos.margin));var o=t.maybeHiddenMarkers,i=t.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||ht(o[s],"hide");if(i)for(var a=0;a<i.length;++a)i[a].lines.length&&ht(i[a],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&ht(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Zr(t,e){if(t.curOp)return e();Wr(t);try{return e()}finally{qr(t)}}function Qr(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Wr(t);try{return e.apply(t,arguments)}finally{qr(t)}}}function to(t){return function(){if(this.curOp)return t.apply(this,arguments);Wr(this);try{return t.apply(this,arguments)}finally{qr(this)}}}function eo(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Wr(e);try{return t.apply(this,arguments)}finally{qr(e)}}}function no(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,$(ro,t))}function ro(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=de(t,e.highlightFrontier),o=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(i){if(r.line>=t.display.viewFrom){var s=i.styles,a=i.text.length>t.options.maxHighlightLength?Vt(e.mode,r.state):null,l=ue(t,i,r,!0);a&&(r.state=a),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var p=!s||s.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!p&&d<s.length;++d)p=s[d]!=i.styles[d];p&&o.push(r.line),i.stateAfter=r.save(),r.nextLine()}else i.text.length<=t.options.maxHighlightLength&&fe(t,i.text,r),i.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return no(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),o.length&&Zr(t,(function(){for(var e=0;e<o.length;e++)pr(t,o[e],"text")}))}}var oo=function(t,e,n){var r=t.display;this.viewport=e,this.visible=Ar(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=On(t),this.force=n,this.dims=or(t),this.events=[]};function io(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden)return dr(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==hr(t))return!1;po(t)&&(dr(t),e.dims=or(t));var o=r.first+r.size,i=Math.max(e.visible.from-t.options.viewportMargin,r.first),s=Math.min(o,e.visible.to+t.options.viewportMargin);n.viewFrom<i&&i-n.viewFrom<20&&(i=Math.max(r.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(o,n.viewTo)),_e&&(i=Re(t.doc,i),s=He(t.doc,s));var a=i!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;(function(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=rn(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=rn(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(cr(t,e))),r.viewFrom=e,r.viewTo<n?r.view=r.view.concat(rn(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,cr(t,n)))),r.viewTo=n})(t,i,s),n.viewOffset=Ue(Wt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var c=hr(t);if(!a&&0==c&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(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 r=window.getSelection();r.anchorNode&&r.extend&&j(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(t);return c>4&&(n.lineDiv.style.display="none"),function(t,e,n){var r=t.display,o=t.options.lineNumbers,i=r.lineDiv,s=i.firstChild;function a(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=r.view,u=r.viewFrom,p=0;p<c.length;p++){var d=c[p];if(d.hidden);else if(d.node&&d.node.parentNode==i){for(;s!=d.node;)s=a(s);var f=o&&null!=e&&e<=u&&d.lineNumber;d.changes&&(F(d.changes,"gutter")>-1&&(f=!1),cn(t,d,u,n)),f&&(A(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Zt(t.options,u)))),s=d.node.nextSibling}else{var h=vn(t,d,u,n);i.insertBefore(h,s)}u+=d.size}for(;s;)s=a(s)}(t,n.updateLineNumbers,e.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(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)}}(u),A(n.cursorDiv),A(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,no(t,400)),n.updateLineNumbers=null,!0}function so(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=On(t))r&&(e.visible=Ar(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Cn(t.display)-An(t),n.top)}),e.visible=Ar(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!io(t,e))break;Tr(t);var o=Dr(t);gr(t),Fr(t,o),co(t,o),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 ao(t,e){var n=new oo(t,e);if(io(t,n)){Tr(t),so(t,n);var r=Dr(t);gr(t),Fr(t,r),co(t,r),n.finish()}}function lo(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",an(t,"gutterChanged",t)}function co(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+Tn(t)+"px"}function uo(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=ir(e)-e.scroller.scrollLeft+t.doc.scrollLeft,o=e.gutters.offsetWidth,i=r+"px",s=0;s<n.length;s++)if(!n[s].hidden){t.options.fixedGutter&&(n[s].gutter&&(n[s].gutter.style.left=i),n[s].gutterBackground&&(n[s].gutterBackground.style.left=i));var a=n[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=i}t.options.fixedGutter&&(e.gutters.style.left=r+o+"px")}}function po(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=Zt(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var o=r.measure.appendChild(k("div",[k("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=o.firstChild.offsetWidth,s=o.offsetWidth-i;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(i,r.lineGutter.offsetWidth-s)+1,r.lineNumWidth=r.lineNumInnerWidth+s,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",lo(t.display),!0}return!1}function fo(t,e){for(var n=[],r=!1,o=0;o<t.length;o++){var i=t[o],s=null;if("string"!=typeof i&&(s=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!e)continue;r=!0}n.push({className:i,style:s})}return e&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ho(t){var e=t.gutters,n=t.gutterSpecs;A(e),t.lineGutter=null;for(var r=0;r<n.length;++r){var o=n[r],i=o.className,s=o.style,a=e.appendChild(k("div",null,"CodeMirror-gutter "+i));s&&(a.style.cssText=s),"CodeMirror-linenumbers"==i&&(t.lineGutter=a,a.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",lo(t)}function go(t){ho(t.display),ur(t),uo(t)}function vo(t,e,r,o){var i=this;this.input=r,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=P("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=P("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var c=P("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: 50px; 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"),s&&a<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||n&&m||(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=fo(o.gutters,o.lineNumbers),ho(i),r.init(i)}oo.prototype.signal=function(t,e){mt(t,e)&&this.events.push(arguments)},oo.prototype.finish=function(){for(var t=0;t<this.events.length;t++)ht.apply(null,this.events[t])};var mo=0,yo=null;function bo(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 wo(t){var e=bo(t);return e.x*=yo,e.y*=yo,e}function _o(t,e){var r=bo(e),o=r.x,i=r.y,s=t.display,a=s.scroller,c=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(o&&c||i&&u){if(i&&y&&l)t:for(var d=e.target,f=s.view;d!=a;d=d.parentNode)for(var h=0;h<f.length;h++)if(f[h].node==d){t.display.currentWheelTarget=d;break t}if(o&&!n&&!p&&null!=yo)return i&&u&&Lr(t,Math.max(0,a.scrollTop+i*yo)),$r(t,Math.max(0,a.scrollLeft+o*yo)),(!i||i&&u)&&bt(e),void(s.wheelStartX=null);if(i&&null!=yo){var g=i*yo,v=t.doc.scrollTop,m=v+s.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):m=Math.min(t.doc.height,m+g+50),ao(t,{top:v,bottom:m})}mo<20&&(null==s.wheelStartX?(s.wheelStartX=a.scrollLeft,s.wheelStartY=a.scrollTop,s.wheelDX=o,s.wheelDY=i,setTimeout((function(){if(null!=s.wheelStartX){var t=a.scrollLeft-s.wheelStartX,e=a.scrollTop-s.wheelStartY,n=e&&s.wheelDY&&e/s.wheelDY||t&&s.wheelDX&&t/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(yo=(yo*mo+n)/(mo+1),++mo)}}),200)):(s.wheelDX+=o,s.wheelDY+=i))}}s?yo=-.53:n?yo=15:u?yo=-.7:d&&(yo=-1/3);var xo=function(t,e){this.ranges=t,this.primIndex=e};xo.prototype.primary=function(){return this.ranges[this.primIndex]},xo.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],r=t.ranges[e];if(!ee(n.anchor,r.anchor)||!ee(n.head,r.head))return!1}return!0},xo.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new Co(ne(this.ranges[e].anchor),ne(this.ranges[e].head));return new xo(t,this.primIndex)},xo.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},xo.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(te(e,r.from())>=0&&te(t,r.to())<=0)return n}return-1};var Co=function(t,e){this.anchor=t,this.head=e};function So(t,e,n){var r=t&&t.options.selectionsMayTouch,o=e[n];e.sort((function(t,e){return te(t.from(),e.from())})),n=F(e,o);for(var i=1;i<e.length;i++){var s=e[i],a=e[i-1],l=te(a.to(),s.from());if(r&&!s.empty()?l>0:l>=0){var c=oe(a.from(),s.from()),u=re(a.to(),s.to()),p=a.empty()?s.from()==s.head:a.from()==a.head;i<=n&&--n,e.splice(--i,2,new Co(p?u:c,p?c:u))}}return new xo(e,n)}function To(t,e){return new xo([new Co(t,e||t)],0)}function Oo(t){return t.text?Qt(t.from.line+t.text.length-1,K(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Ao(t,e){if(te(t,e.from)<0)return t;if(te(t,e.to)<=0)return Oo(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=Oo(e).ch-e.to.ch),Qt(n,r)}function Eo(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var o=t.sel.ranges[r];n.push(new Co(Ao(o.anchor,e),Ao(o.head,e)))}return So(t.cm,n,t.sel.primIndex)}function ko(t,e,n){return t.line==e.line?Qt(n.line,t.ch-e.ch+n.ch):Qt(n.line+(t.line-e.line),t.ch)}function Po(t){t.doc.mode=Rt(t.options,t.doc.modeOption),jo(t)}function jo(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,no(t,100),t.state.modeGen++,t.curOp&&ur(t)}function Mo(t,e){return 0==e.from.ch&&0==e.to.ch&&""==K(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function No(t,e,n,r){function o(t){return n?n[t]:null}function i(t,n,o){(function(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ae(t),Ee(t,n);var o=r?r(t):1;o!=t.height&&Kt(t,o)})(t,n,o,r),an(t,"change",t,e)}function s(t,e){for(var n=[],i=t;i<e;++i)n.push(new We(c[i],o(i),r));return n}var a=e.from,l=e.to,c=e.text,u=Wt(t,a.line),p=Wt(t,l.line),d=K(c),f=o(c.length-1),h=l.line-a.line;if(e.full)t.insert(0,s(0,c.length)),t.remove(c.length,t.size-c.length);else if(Mo(t,e)){var g=s(0,c.length-1);i(p,p.text,f),h&&t.remove(a.line,h),g.length&&t.insert(a.line,g)}else if(u==p)if(1==c.length)i(u,u.text.slice(0,a.ch)+d+u.text.slice(l.ch),f);else{var v=s(1,c.length-1);v.push(new We(d+u.text.slice(l.ch),f,r)),i(u,u.text.slice(0,a.ch)+c[0],o(0)),t.insert(a.line+1,v)}else if(1==c.length)i(u,u.text.slice(0,a.ch)+c[0]+p.text.slice(l.ch),o(0)),t.remove(a.line+1,h);else{i(u,u.text.slice(0,a.ch)+c[0],o(0)),i(p,d+p.text.slice(l.ch),f);var m=s(1,c.length-1);h>1&&t.remove(a.line+1,h-1),t.insert(a.line+1,m)}an(t,"change",t,e)}function Lo(t,e,n){!function t(r,o,i){if(r.linked)for(var s=0;s<r.linked.length;++s){var a=r.linked[s];if(a.doc!=o){var l=i&&a.sharedHist;n&&!l||(e(a.doc,l),t(a.doc,r,l))}}}(t,null,!0)}function Io(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,ar(t),Po(t),$o(t),t.options.direction=e.direction,t.options.lineWrapping||ze(t),t.options.mode=e.modeOption,ur(t)}function $o(t){("rtl"==t.doc.direction?N:O)(t.display.lineDiv,"CodeMirror-rtl")}function Do(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 Ro(t,e){var n={from:ne(e.from),to:Oo(e),text:qt(t,e.from,e.to)};return Bo(t,n,e.from.line,e.to.line+1),Lo(t,(function(t){return Bo(t,n,e.from.line,e.to.line+1)}),!0),n}function Ho(t){for(;t.length&&K(t).ranges;)t.pop()}function Fo(t,e,n,r){var o=t.history;o.undone.length=0;var i,s,a=+new Date;if((o.lastOp==r||o.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&o.lastModTime>a-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(i=function(t,e){return e?(Ho(t.done),K(t.done)):t.done.length&&!K(t.done).ranges?K(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),K(t.done)):void 0}(o,o.lastOp==r)))s=K(i.changes),0==te(e.from,e.to)&&0==te(e.from,s.to)?s.to=Oo(e):i.changes.push(Ro(t,e));else{var l=K(o.done);for(l&&l.ranges||Uo(t.sel,o.done),i={changes:[Ro(t,e)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=a,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=e.origin,s||ht(t,"historyAdded")}function Vo(t,e,n,r){var o=t.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(t,e,n,r){var o=e.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,i,K(o.done),e))?o.done[o.done.length-1]=e:Uo(e,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&Ho(o.undone)}function Uo(t,e){var n=K(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Bo(t,e,n,r){var o=e["spans_"+t.id],i=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((o||(o=e["spans_"+t.id]={}))[i]=n.markedSpans),++i}))}function zo(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 Wo(t,e){var n=function(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=[],o=0;o<e.text.length;++o)r.push(zo(n[o]));return r}(t,e),r=Te(t,e);if(!n)return r;if(!r)return n;for(var o=0;o<n.length;++o){var i=n[o],s=r[o];if(i&&s)t:for(var a=0;a<s.length;++a){for(var l=s[a],c=0;c<i.length;++c)if(i[c].marker==l.marker)continue t;i.push(l)}else s&&(n[o]=s)}return n}function qo(t,e,n){for(var r=[],o=0;o<t.length;++o){var i=t[o];if(i.ranges)r.push(n?xo.prototype.deepCopy.call(i):i);else{var s=i.changes,a=[];r.push({changes:a});for(var l=0;l<s.length;++l){var c=s[l],u=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),e)for(var p in c)(u=p.match(/^spans_(\d+)$/))&&F(e,Number(u[1]))>-1&&(K(a)[p]=c[p],delete c[p])}}}return r}function Go(t,e,n,r){if(r){var o=t.anchor;if(n){var i=te(e,o)<0;i!=te(n,o)<0?(o=e,e=n):i!=te(e,n)<0&&(e=n)}return new Co(o,e)}return new Co(n||e,e)}function Ko(t,e,n,r,o){null==o&&(o=t.cm&&(t.cm.display.shift||t.extend)),Qo(t,new xo([Go(t.sel.primary(),e,n,o)],0),r)}function Yo(t,e,n){for(var r=[],o=t.cm&&(t.cm.display.shift||t.extend),i=0;i<t.sel.ranges.length;i++)r[i]=Go(t.sel.ranges[i],e[i],null,o);Qo(t,So(t.cm,r,t.sel.primIndex),n)}function Xo(t,e,n,r){var o=t.sel.ranges.slice(0);o[e]=n,Qo(t,So(t.cm,o,t.sel.primIndex),r)}function Jo(t,e,n,r){Qo(t,To(e,n),r)}function Zo(t,e,n){var r=t.history.done,o=K(r);o&&o.ranges?(r[r.length-1]=e,ti(t,e,n)):Qo(t,e,n)}function Qo(t,e,n){ti(t,e,n),Vo(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function ti(t,e,n){(mt(t,"beforeSelectionChange")||t.cm&&mt(t.cm,"beforeSelectionChange"))&&(e=function(t,e,n){var r={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new Co(se(t,e[n].anchor),se(t,e[n].head))},origin:n&&n.origin};return ht(t,"beforeSelectionChange",t,r),t.cm&&ht(t.cm,"beforeSelectionChange",t.cm,r),r.ranges!=e.ranges?So(t.cm,r.ranges,r.ranges.length-1):e}(t,e,n));var r=n&&n.bias||(te(e.primary().head,t.sel.primary().head)<0?-1:1);ei(t,ri(t,e,r,!0)),n&&!1===n.scroll||!t.cm||"nocursor"==t.cm.getOption("readOnly")||Pr(t.cm)}function ei(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,vt(t.cm)),an(t,"cursorActivity",t))}function ni(t){ei(t,ri(t,t.sel,null,!1))}function ri(t,e,n,r){for(var o,i=0;i<e.ranges.length;i++){var s=e.ranges[i],a=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[i],l=ii(t,s.anchor,a&&a.anchor,n,r),c=ii(t,s.head,a&&a.head,n,r);(o||l!=s.anchor||c!=s.head)&&(o||(o=e.ranges.slice(0,i)),o[i]=new Co(l,c))}return o?So(t.cm,o,e.primIndex):e}function oi(t,e,n,r,o){var i=Wt(t,e.line);if(i.markedSpans)for(var s=0;s<i.markedSpans.length;++s){var a=i.markedSpans[s],l=a.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==a.from||(c?a.from<=e.ch:a.from<e.ch))&&(null==a.to||(u?a.to>=e.ch:a.to>e.ch))){if(o&&(ht(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var p=l.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(p=si(t,p,-r,p&&p.line==e.line?i:null)),p&&p.line==e.line&&(d=te(p,n))&&(r<0?d<0:d>0))return oi(t,p,e,r,o)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=si(t,f,r,f.line==e.line?i:null)),f?oi(t,f,e,r,o):null}}return e}function ii(t,e,n,r,o){var i=r||1;return oi(t,e,n,i,o)||!o&&oi(t,e,n,i,!0)||oi(t,e,n,-i,o)||!o&&oi(t,e,n,-i,!0)||(t.cantEdit=!0,Qt(t.first,0))}function si(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?se(t,Qt(e.line-1)):null:n>0&&e.ch==(r||Wt(t,e.line)).text.length?e.line<t.first+t.size-1?Qt(e.line+1,0):null:new Qt(e.line,e.ch+n)}function ai(t){t.setSelection(Qt(t.firstLine(),0),Qt(t.lastLine()),U)}function li(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(e,n,o,i){e&&(r.from=se(t,e)),n&&(r.to=se(t,n)),o&&(r.text=o),void 0!==i&&(r.origin=i)}),ht(t,"beforeChange",t,r),t.cm&&ht(t.cm,"beforeChange",t.cm,r),r.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ci(t,e,n){if(t.cm){if(!t.cm.curOp)return Qr(t.cm,ci)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(mt(t,"beforeChange")||t.cm&&mt(t.cm,"beforeChange"))||(e=li(t,e,!0))){var r=we&&!n&&function(t,e,n){var r=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||r&&-1!=F(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var o=[{from:e,to:n}],i=0;i<r.length;++i)for(var s=r[i],a=s.find(0),l=0;l<o.length;++l){var c=o[l];if(!(te(c.to,a.from)<0||te(c.from,a.to)>0)){var u=[l,1],p=te(c.from,a.from),d=te(c.to,a.to);(p<0||!s.inclusiveLeft&&!p)&&u.push({from:c.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&u.push({from:a.to,to:c.to}),o.splice.apply(o,u),l+=u.length-3}}return o}(t,e.from,e.to);if(r)for(var o=r.length-1;o>=0;--o)ui(t,{from:r[o].from,to:r[o].to,text:o?[""]:e.text,origin:e.origin});else ui(t,e)}}function ui(t,e){if(1!=e.text.length||""!=e.text[0]||0!=te(e.from,e.to)){var n=Eo(t,e);Fo(t,e,n,t.cm?t.cm.curOp.id:NaN),fi(t,e,n,Te(t,e));var r=[];Lo(t,(function(t,n){n||-1!=F(r,t.history)||(mi(t.history,e),r.push(t.history)),fi(t,e,null,Te(t,e))}))}}function pi(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var o,i=t.history,s=t.sel,a="undo"==e?i.done:i.undone,l="undo"==e?i.undone:i.done,c=0;c<a.length&&(o=a[c],n?!o.ranges||o.equals(t.sel):o.ranges);c++);if(c!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;;){if(!(o=a.pop()).ranges){if(r)return void a.push(o);break}if(Uo(o,l),n&&!o.equals(t.sel))return void Qo(t,o,{clearRedo:!1});s=o}var u=[];Uo(s,l),l.push({changes:u,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var p=mt(t,"beforeChange")||t.cm&&mt(t.cm,"beforeChange"),d=function(n){var r=o.changes[n];if(r.origin=e,p&&!li(t,r,!1))return a.length=0,{};u.push(Ro(t,r));var i=n?Eo(t,r):K(a);fi(t,r,i,Wo(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:Oo(r)});var s=[];Lo(t,(function(t,e){e||-1!=F(s,t.history)||(mi(t.history,r),s.push(t.history)),fi(t,r,null,Wo(t,r))}))},f=o.changes.length-1;f>=0;--f){var h=d(f);if(h)return h.v}}}}function di(t,e){if(0!=e&&(t.first+=e,t.sel=new xo(Y(t.sel.ranges,(function(t){return new Co(Qt(t.anchor.line+e,t.anchor.ch),Qt(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){ur(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)pr(t.cm,r,"gutter")}}function fi(t,e,n,r){if(t.cm&&!t.cm.curOp)return Qr(t.cm,fi)(t,e,n,r);if(e.to.line<t.first)di(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 o=e.text.length-1-(t.first-e.from.line);di(t,o),e={from:Qt(t.first,0),to:Qt(e.to.line+o,e.to.ch),text:[K(e.text)],origin:e.origin}}var i=t.lastLine();e.to.line>i&&(e={from:e.from,to:Qt(i,Wt(t,i).text.length),text:[e.text[0]],origin:e.origin}),e.removed=qt(t,e.from,e.to),n||(n=Eo(t,e)),t.cm?function(t,e,n){var r=t.doc,o=t.display,i=e.from,s=e.to,a=!1,l=i.line;t.options.lineWrapping||(l=Yt(De(Wt(r,i.line))),r.iter(l,s.line+1,(function(t){if(t==o.maxLine)return a=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&vt(t),No(r,e,n,sr(t)),t.options.lineWrapping||(r.iter(l,i.line+e.text.length,(function(t){var e=Be(t);e>o.maxLineLength&&(o.maxLine=t,o.maxLineLength=e,o.maxLineChanged=!0,a=!1)})),a&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,r=e-1;r>n;r--){var o=Wt(t,r).stateAfter;if(o&&(!(o instanceof le)||r+o.lookAhead<e)){n=r+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}(r,i.line),no(t,400);var c=e.text.length-(s.line-i.line)-1;e.full?ur(t):i.line!=s.line||1!=e.text.length||Mo(t.doc,e)?ur(t,i.line,s.line+1,c):pr(t,i.line,"text");var u=mt(t,"changes"),p=mt(t,"change");if(p||u){var d={from:i,to:s,text:e.text,removed:e.removed,origin:e.origin};p&&an(t,"change",t,d),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}(t.cm,e,r):No(t,e,r),ti(t,n,U),t.cantEdit&&ii(t,Qt(t.firstLine(),0))&&(t.cantEdit=!1)}}function hi(t,e,n,r,o){var i;r||(r=n),te(r,n)<0&&(n=(i=[r,n])[0],r=i[1]),"string"==typeof e&&(e=t.splitLines(e)),ci(t,{from:n,to:r,text:e,origin:o})}function gi(t,e,n,r){n<t.line?t.line+=r:e<t.line&&(t.line=e,t.ch=0)}function vi(t,e,n,r){for(var o=0;o<t.length;++o){var i=t[o],s=!0;if(i.ranges){i.copied||((i=t[o]=i.deepCopy()).copied=!0);for(var a=0;a<i.ranges.length;a++)gi(i.ranges[a].anchor,e,n,r),gi(i.ranges[a].head,e,n,r)}else{for(var l=0;l<i.changes.length;++l){var c=i.changes[l];if(n<c.from.line)c.from=Qt(c.from.line+r,c.from.ch),c.to=Qt(c.to.line+r,c.to.ch);else if(e<=c.to.line){s=!1;break}}s||(t.splice(0,o+1),o=0)}}}function mi(t,e){var n=e.from.line,r=e.to.line,o=e.text.length-(r-n)-1;vi(t.done,n,r,o),vi(t.undone,n,r,o)}function yi(t,e,n,r){var o=e,i=e;return"number"==typeof e?i=Wt(t,ie(t,e)):o=Yt(e),null==o?null:(r(i,o)&&t.cm&&pr(t.cm,o,n),i)}function bi(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 wi(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var o=t[r];e+=o.chunkSize(),n+=o.height,o.parent=this}this.size=e,this.height=n,this.parent=null}Co.prototype.from=function(){return oe(this.anchor,this.head)},Co.prototype.to=function(){return re(this.anchor,this.head)},Co.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},bi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;n<r;++n){var o=this.lines[n];this.height-=o.height,qe(o),an(o,"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 r=0;r<e.length;++r)e[r].parent=this},iterN:function(t,e,n){for(var r=t+e;t<r;++t)if(n(this.lines[t]))return!0}},wi.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var r=this.children[n],o=r.chunkSize();if(t<o){var i=Math.min(e,o-t),s=r.height;if(r.removeInner(t,i),this.height-=s-r.height,o==i&&(this.children.splice(n--,1),r.parent=null),0==(e-=i))break;t=0}else t-=o}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof bi))){var a=[];this.collapse(a),this.children=[new bi(a)],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 r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(t<=i){if(o.insertInner(t,e,n),o.lines&&o.lines.length>50){for(var s=o.lines.length%25+25,a=s;a<o.lines.length;){var l=new bi(o.lines.slice(a,a+=25));o.height-=l.height,this.children.splice(++r,0,l),l.parent=this}o.lines=o.lines.slice(0,s),this.maybeSpill()}break}t-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=new wi(t.children.splice(t.children.length-5,5));if(t.parent){t.size-=e.size,t.height-=e.height;var n=F(t.parent.children,t);t.parent.children.splice(n+1,0,e)}else{var r=new wi(t.children);r.parent=t,t.children=[r,e],t=r}e.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(t<i){var s=Math.min(e,i-t);if(o.iterN(t,s,n))return!0;if(0==(e-=s))break;t=0}else t-=i}}};var _i=function(t,e,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=t,this.node=e};function xi(t,e,n){Ue(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&kr(t,n)}_i.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,r=Yt(n);if(null!=r&&e){for(var o=0;o<e.length;++o)e[o]==this&&e.splice(o--,1);e.length||(n.widgets=null);var i=wn(this);Kt(n,Math.max(0,n.height-i)),t&&(Zr(t,(function(){xi(t,n,-i),pr(t,r,"widget")})),an(t,"lineWidgetCleared",t,this,r))}},_i.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,r=this.line;this.height=null;var o=wn(this)-e;o&&(Fe(this.doc,r)||Kt(r,r.height+o),n&&Zr(n,(function(){n.curOp.forceUpdate=!0,xi(n,r,o),an(n,"lineWidgetChanged",n,t,Yt(r))})))},yt(_i);var Ci=0,Si=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++Ci};function Ti(t,e,n,r,o){if(r&&r.shared)return function(t,e,n,r,o){(r=D(r)).shared=!1;var i=[Ti(t,e,n,r,o)],s=i[0],a=r.widgetNode;return Lo(t,(function(t){a&&(r.widgetNode=a.cloneNode(!0)),i.push(Ti(t,se(t,e),se(t,n),r,o));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;s=K(i)})),new Oi(i,s)}(t,e,n,r,o);if(t.cm&&!t.cm.curOp)return Qr(t.cm,Ti)(t,e,n,r,o);var i=new Si(t,o),s=te(e,n);if(r&&D(r,i,!1),s>0||0==s&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=P("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if($e(t,e.line,e,n,i)||e.line!=n.line&&$e(t,n.line,e,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");_e=!0}i.addToHistory&&Fo(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var a,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(r){c&&i.collapsed&&!c.options.lineWrapping&&De(r)==c.display.maxLine&&(a=!0),i.collapsed&&l!=e.line&&Kt(r,0),function(t,e,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&r.has(t.markedSpans)?t.markedSpans.push(e):(t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],r&&r.add(t.markedSpans)),e.marker.attachLine(t)}(r,new xe(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){Fe(t,e)&&Kt(e,0)})),i.clearOnEnter&&pt(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(we=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),i.collapsed&&(i.id=++Ci,i.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),i.collapsed)ur(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++)pr(c,u,"text");i.atomic&&ni(c.doc),an(c,"markerAdded",c,i)}return i}Si.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Wr(t),mt(this,"clear")){var n=this.find();n&&an(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;i<this.lines.length;++i){var s=this.lines[i],a=Ce(s.markedSpans,this);t&&!this.collapsed?pr(t,Yt(s),"text"):t&&(null!=a.to&&(o=Yt(s)),null!=a.from&&(r=Yt(s))),s.markedSpans=Se(s.markedSpans,a),null==a.from&&this.collapsed&&!Fe(this.doc,s)&&t&&Kt(s,nr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=De(this.lines[l]),u=Be(c);u>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&ur(t,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ni(t.doc)),t&&an(t,"markerCleared",t,this,r,o),e&&qr(t),this.parent&&this.parent.clear()}},Si.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],s=Ce(i.markedSpans,this);if(null!=s.from&&(n=Qt(e?i:Yt(i),s.from),-1==t))return n;if(null!=s.to&&(r=Qt(e?i:Yt(i),s.to),1==t))return r}return n&&{from:n,to:r}},Si.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,r=this.doc.cm;e&&r&&Zr(r,(function(){var o=e.line,i=Yt(e.line),s=Pn(r,i);if(s&&(Dn(s),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Fe(n.doc,o)&&null!=n.height){var a=n.height;n.height=null;var l=wn(n)-a;l&&Kt(o,o.height+l)}an(r,"markerChanged",r,t)}))},Si.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=F(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},Si.prototype.detachLine=function(t){if(this.lines.splice(F(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},yt(Si);var Oi=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function Ai(t){return t.findMarks(Qt(t.first,0),t.clipPos(Qt(t.lastLine())),(function(t){return t.parent}))}function Ei(t){for(var e=function(e){var n=t[e],r=[n.primary.doc];Lo(n.primary.doc,(function(t){return r.push(t)}));for(var o=0;o<n.markers.length;o++){var i=n.markers[o];-1==F(r,i.doc)&&(i.parent=null,n.markers.splice(o--,1))}},n=0;n<t.length;n++)e(n)}Oi.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();an(this,"clear")}},Oi.prototype.find=function(t,e){return this.primary.find(t,e)},yt(Oi);var ki=0,Pi=function(t,e,n,r,o){if(!(this instanceof Pi))return new Pi(t,e,n,r,o);null==n&&(n=0),wi.call(this,[new bi([new We("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=Qt(n,0);this.sel=To(i),this.history=new Do(null),this.id=++ki,this.modeOption=e,this.lineSep=r,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),No(this,{from:i,to:i,text:t}),Qo(this,To(i),U)};Pi.prototype=J(wi.prototype,{constructor:Pi,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,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=Gt(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:eo((function(t){var e=Qt(this.first,0),n=this.first+this.size-1;ci(this,{from:e,to:Qt(n,Wt(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&jr(this.cm,0,0),Qo(this,To(e),U)})),replaceRange:function(t,e,n,r){hi(this,t,e=se(this,e),n=n?se(this,n):e,r)},getRange:function(t,e,n){var r=qt(this,se(this,t),se(this,e));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(Jt(this,t))return Wt(this,t)},getLineNumber:function(t){return Yt(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=Wt(this,t)),De(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return se(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:eo((function(t,e,n){Jo(this,se(this,"number"==typeof t?Qt(t,e||0):t),null,n)})),setSelection:eo((function(t,e,n){Jo(this,se(this,t),se(this,e||t),n)})),extendSelection:eo((function(t,e,n){Ko(this,se(this,t),e&&se(this,e),n)})),extendSelections:eo((function(t,e){Yo(this,ae(this,t),e)})),extendSelectionsBy:eo((function(t,e){Yo(this,ae(this,Y(this.sel.ranges,t)),e)})),setSelections:eo((function(t,e,n){if(t.length){for(var r=[],o=0;o<t.length;o++)r[o]=new Co(se(this,t[o].anchor),se(this,t[o].head||t[o].anchor));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Qo(this,So(this.cm,r,e),n)}})),addSelection:eo((function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new Co(se(this,t),se(this,e||t))),Qo(this,So(this.cm,r,r.length-1),n)})),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var o=qt(this,n[r].from(),n[r].to());e=e?e.concat(o):o}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,r=0;r<n.length;r++){var o=qt(this,n[r].from(),n[r].to());!1!==t&&(o=o.join(t||this.lineSeparator())),e[r]=o}return e},replaceSelection:function(t,e,n){for(var r=[],o=0;o<this.sel.ranges.length;o++)r[o]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:eo((function(t,e,n){for(var r=[],o=this.sel,i=0;i<o.ranges.length;i++){var s=o.ranges[i];r[i]={from:s.from(),to:s.to(),text:this.splitLines(t[i]),origin:n}}for(var a=e&&"end"!=e&&function(t,e,n){for(var r=[],o=Qt(t.first,0),i=o,s=0;s<e.length;s++){var a=e[s],l=ko(a.from,o,i),c=ko(Oo(a),o,i);if(o=a.to,i=c,"around"==n){var u=t.sel.ranges[s],p=te(u.head,u.anchor)<0;r[s]=new Co(p?c:l,p?l:c)}else r[s]=new Co(l,l)}return new xo(r,t.sel.primIndex)}(this,r,e),l=r.length-1;l>=0;l--)ci(this,r[l]);a?Zo(this,a):this.cm&&Pr(this.cm)})),undo:eo((function(){pi(this,"undo")})),redo:eo((function(){pi(this,"redo")})),undoSelection:eo((function(){pi(this,"undo",!0)})),redoSelection:eo((function(){pi(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,r=0;r<t.done.length;r++)t.done[r].ranges||++e;for(var o=0;o<t.undone.length;o++)t.undone[o].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new Do(this.history),Lo(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:qo(this.history.done),undone:qo(this.history.undone)}},setHistory:function(t){var e=this.history=new Do(this.history);e.done=qo(t.done.slice(0),null,!0),e.undone=qo(t.undone.slice(0),null,!0)},setGutterMarker:eo((function(t,e,n){return yi(this,t,"gutter",(function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&et(r)&&(t.gutterMarkers=null),!0}))})),clearGutter:eo((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&yi(e,n,"gutter",(function(){return n.gutterMarkers[t]=null,et(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!Jt(this,t))return null;if(e=t,!(t=Wt(this,t)))return null}else if(null==(e=Yt(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:eo((function(t,e,n){return yi(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(S(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0}))})),removeLineClass:eo((function(t,e,n){return yi(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",o=t[r];if(!o)return!1;if(null==n)t[r]=null;else{var i=o.match(S(n));if(!i)return!1;var s=i.index+i[0].length;t[r]=o.slice(0,i.index)+(i.index&&s!=o.length?" ":"")+o.slice(s)||null}return!0}))})),addLineWidget:eo((function(t,e,n){return function(t,e,n,r){var o=new _i(t,n,r),i=t.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),yi(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==o.insertAt?n.push(o):n.splice(Math.min(n.length,Math.max(0,o.insertAt)),0,o),o.line=e,i&&!Fe(t,e)){var r=Ue(e)<t.scrollTop;Kt(e,e.height+wn(o)),r&&kr(i,o.height),i.curOp.forceUpdate=!0}return!0})),i&&an(i,"lineWidgetAdded",i,o,"number"==typeof e?e:Yt(e)),o}(this,t,e,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return Ti(this,se(this,t),se(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 Ti(this,t=se(this,t),t,n,"bookmark")},findMarksAt:function(t){var e=[],n=Wt(this,(t=se(this,t)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var o=n[r];(null==o.from||o.from<=t.ch)&&(null==o.to||o.to>=t.ch)&&e.push(o.marker.parent||o.marker)}return e},findMarks:function(t,e,n){t=se(this,t),e=se(this,e);var r=[],o=t.line;return this.iter(t.line,e.line+1,(function(i){var s=i.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&o==t.line&&t.ch>=l.to||null==l.from&&o!=t.line||null!=l.from&&o==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++o})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)})),t},posFromIndex:function(t){var e,n=this.first,r=this.lineSeparator().length;return this.iter((function(o){var i=o.text.length+r;if(i>t)return e=t,!0;t-=i,++n})),se(this,Qt(n,e))},indexFromPos:function(t){var e=(t=se(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 Pi(Gt(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 r=new Pi(Gt(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n],o=r.find(),i=t.clipPos(o.from),s=t.clipPos(o.to);if(te(i,s)){var a=Ti(t,i,s,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}(r,Ai(this)),r},unlinkDoc:function(t){if(t instanceof Os&&(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),Ei(Ai(this));break}if(t.history==this.history){var n=[t.id];Lo(t,(function(t){return n.push(t.id)}),!0),t.history=new Do(null),t.history.done=qo(this.history.done,n),t.history.undone=qo(this.history.undone,n)}},iterLinkedDocs:function(t){Lo(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):Pt(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:eo((function(t){var e;"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&Zr(e=this.cm,(function(){$o(e),ur(e)})))}))}),Pi.prototype.eachLine=Pi.prototype.iter;var ji=0;function Mi(t){var e=this;if(Ni(e),!gt(e,t)&&!_n(e.display,t)){bt(t),s&&(ji=+new Date);var n=lr(e,t,!0),r=t.dataTransfer.files;if(n&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var o=r.length,i=Array(o),a=0,l=function(){++a==o&&Qr(e,(function(){var t={from:n=se(e.doc,n),to:n,text:e.doc.splitLines(i.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};ci(e.doc,t),Zo(e.doc,To(se(e.doc,n),se(e.doc,Oo(t))))}))()},c=function(t,n){if(e.options.allowDropFileTypes&&-1==F(e.options.allowDropFileTypes,t.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var t=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(i[n]=t),l()},r.readAsText(t)}},u=0;u<r.length;u++)c(r[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()),ti(e.doc,To(n,n)),d)for(var f=0;f<d.length;++f)hi(e.doc,"",d[f].anchor,d[f].head,"drag");e.replaceSelection(p,"around","paste"),e.display.input.focus()}}catch(t){}}}}function Ni(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Li(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<e.length;r++){var o=e[r].CodeMirror;o&&n.push(o)}n.length&&n[0].operation((function(){for(var e=0;e<n.length;e++)t(n[e])}))}}var Ii=!1;function $i(){var t;Ii||(pt(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,Li(Di)}),100))})),pt(window,"blur",(function(){return Li(Sr)})),Ii=!0)}function Di(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var Ri={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"},Hi=0;Hi<10;Hi++)Ri[Hi+48]=Ri[Hi+96]=String(Hi);for(var Fi=65;Fi<=90;Fi++)Ri[Fi]=String.fromCharCode(Fi);for(var Vi=1;Vi<=12;Vi++)Ri[Vi+111]=Ri[Vi+63235]="F"+Vi;var Ui={};function Bi(t){var e,n,r,o,i=t.split(/-(?!$)/);t=i[i.length-1];for(var s=0;s<i.length-1;s++){var a=i[s];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))e=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),o&&(t="Cmd-"+t),r&&(t="Shift-"+t),t}function zi(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var o=Y(n.split(" "),Bi),i=0;i<o.length;i++){var s=void 0,a=void 0;i==o.length-1?(a=o.join(" "),s=r):(a=o.slice(0,i+1).join(" "),s="...");var l=e[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else e[a]=s}delete t[n]}for(var c in e)t[c]=e[c];return t}function Wi(t,e,n,r){var o=(e=Yi(e)).call?e.call(t,r):e[t];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Wi(t,e.fallthrough,n,r);for(var i=0;i<e.fallthrough.length;i++){var s=Wi(t,e.fallthrough[i],n,r);if(s)return s}}}function qi(t){var e="string"==typeof t?t:Ri[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function Gi(t,e,n){var r=t;return e.altKey&&"Alt"!=r&&(t="Alt-"+t),(x?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(t="Ctrl-"+t),(x?e.ctrlKey:e.metaKey)&&"Mod"!=r&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=r&&(t="Shift-"+t),t}function Ki(t,e){if(p&&34==t.keyCode&&t.char)return!1;var n=Ri[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),Gi(n,t,e))}function Yi(t){return"string"==typeof t?Ui[t]:t}function Xi(t,e){for(var n=t.doc.sel.ranges,r=[],o=0;o<n.length;o++){for(var i=e(n[o]);r.length&&te(i.from,K(r).to)<=0;){var s=r.pop();if(te(s.from,i.from)<0){i.from=s.from;break}}r.push(i)}Zr(t,(function(){for(var e=r.length-1;e>=0;e--)hi(t.doc,"",r[e].from,r[e].to,"+delete");Pr(t)}))}function Ji(t,e,n){var r=ot(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Zi(t,e,n){var r=Ji(t,e.ch,n);return null==r?null:new Qt(e.line,r,n<0?"after":"before")}function Qi(t,e,n,r,o){if(t){"rtl"==e.doc.direction&&(o=-o);var i=ct(n,e.doc.direction);if(i){var s,a=o<0?K(i):i[0],l=o<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var c=jn(e,n);s=o<0?n.text.length-1:0;var u=Mn(e,c,s).top;s=it((function(t){return Mn(e,c,t).top==u}),o<0==(1==a.level)?a.from:a.to-1,s),"before"==l&&(s=Ji(n,s,1))}else s=o<0?a.to:a.from;return new Qt(r,s,l)}}return new Qt(r,o<0?n.text.length:0,o<0?"before":"after")}Ui.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"},Ui.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"},Ui.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"},Ui.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"]},Ui.default=y?Ui.macDefault:Ui.pcDefault;var ts={selectAll:ai,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),U)},killLine:function(t){return Xi(t,(function(e){if(e.empty()){var n=Wt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:Qt(e.head.line+1,0)}:{from:e.head,to:Qt(e.head.line,n)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return Xi(t,(function(e){return{from:Qt(e.from().line,0),to:se(t.doc,Qt(e.to().line+1,0))}}))},delLineLeft:function(t){return Xi(t,(function(t){return{from:Qt(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Xi(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 Xi(t,(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}}))},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(Qt(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(Qt(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return es(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return ns(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return function(t,e){var n=Wt(t.doc,e),r=function(t){for(var e;e=Le(t);)t=e.find(1,!0).line;return t}(n);return r!=n&&(e=Yt(r)),Qi(!0,t,n,e,-1)}(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")}),z)},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")}),z)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?ns(t,e.head):r}),z)},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(),r=t.options.tabSize,o=0;o<n.length;o++){var i=n[o].from(),s=R(t.getLine(i.line),i.ch,r);e.push(G(r-s%r))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Zr(t,(function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++)if(e[r].empty()){var o=e[r].head,i=Wt(t.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new Qt(o.line,o.ch-1)),o.ch>0)o=new Qt(o.line,o.ch+1),t.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),Qt(o.line,o.ch-2),o,"+transpose");else if(o.line>t.doc.first){var s=Wt(t.doc,o.line-1).text;s&&(o=new Qt(o.line,1),t.replaceRange(i.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),Qt(o.line-1,s.length-1),o,"+transpose"))}n.push(new Co(o,o))}t.setSelections(n)}))},newlineAndIndent:function(t){return Zr(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 r=0;r<e.length;r++)t.indentLine(e[r].from().line,null,!0);Pr(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function es(t,e){var n=Wt(t.doc,e),r=De(n);return r!=n&&(e=Yt(r)),Qi(!0,t,r,e,1)}function ns(t,e){var n=es(t,e.line),r=Wt(t.doc,n.line),o=ct(r,t.doc.direction);if(!o||0==o[0].level){var i=Math.max(n.ch,r.text.search(/\S/)),s=e.line==n.line&&e.ch<=i&&e.ch;return Qt(n.line,s?0:i,n.sticky)}return n}function rs(t,e,n){if("string"==typeof e&&!(e=ts[e]))return!1;t.display.input.ensurePolled();var r=t.display.shift,o=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),o=e(t)!=V}finally{t.display.shift=r,t.state.suppressEdits=!1}return o}var os=new H;function is(t,e,n,r){var o=t.state.keySeq;if(o){if(qi(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:os.set(50,(function(){t.state.keySeq==o&&(t.state.keySeq=null,t.display.input.reset())})),ss(t,o+" "+e,n,r))return!0}return ss(t,e,n,r)}function ss(t,e,n,r){var o=function(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var o=Wi(e,t.state.keyMaps[r],n,t);if(o)return o}return t.options.extraKeys&&Wi(e,t.options.extraKeys,n,t)||Wi(e,t.options.keyMap,n,t)}(t,e,r);return"multi"==o&&(t.state.keySeq=e),"handled"==o&&an(t,"keyHandled",t,e,n),"handled"!=o&&"multi"!=o||(bt(n),wr(t)),!!o}function as(t,e){var n=Ki(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?is(t,"Shift-"+n,e,(function(e){return rs(t,e,!0)}))||is(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return rs(t,e)})):is(t,n,e,(function(e){return rs(t,e)})))}var ls=null;function cs(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||(e.curOp.focus=M(),gt(e,t)))){s&&a<11&&27==t.keyCode&&(t.returnValue=!1);var r=t.keyCode;e.display.shift=16==r||t.shiftKey;var o=as(e,t);p&&(ls=o?r:null,o||88!=r||Mt||!(y?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),n&&!y&&!o&&46==r&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||function(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(O(e,"CodeMirror-crosshair"),ft(document,"keyup",n),ft(document,"mouseover",n))}N(e,"CodeMirror-crosshair"),pt(document,"keyup",n),pt(document,"mouseover",n)}(e)}}function us(t){16==t.keyCode&&(this.doc.sel.shift=!1),gt(this,t)}function ps(t){var e=this;if(!(t.target&&t.target!=e.display.input.getField()||_n(e.display,t)||gt(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(p&&n==ls)return ls=null,void bt(t);if(!p||t.which&&!(t.which<10)||!as(e,t)){var o=String.fromCharCode(null==r?n:r);"\b"!=o&&(function(t,e,n){return is(t,"'"+n+"'",e,(function(e){return rs(t,e,!0)}))}(e,t,o)||e.display.input.onKeyPress(t))}}}var ds,fs,hs=function(t,e,n){this.time=t,this.pos=e,this.button=n};function gs(t){var e=this,n=e.display;if(!(gt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,_n(n,t))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ys(e,t)){var r=lr(e,t),o=St(t),i=r?function(t,e){var n=+new Date;return fs&&fs.compare(n,t,e)?(ds=fs=null,"triple"):ds&&ds.compare(n,t,e)?(fs=new hs(n,t,e),ds=null,"double"):(ds=new hs(n,t,e),fs=null,"single")}(r,o):"single";window.focus(),1==o&&e.state.selectingText&&e.state.selectingText(t),r&&function(t,e,n,r,o){var i="Click";return"double"==r?i="Double"+i:"triple"==r&&(i="Triple"+i),is(t,Gi(i=(1==e?"Left":2==e?"Middle":"Right")+i,o),o,(function(e){if("string"==typeof e&&(e=ts[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,n)!=V}finally{t.state.suppressEdits=!1}return r}))}(e,o,r,i,t)||(1==o?r?function(t,e,n,r){s?setTimeout($(_r,t),0):t.curOp.focus=M();var o,i=function(t,e,n){var r=t.getOption("configureMouse"),o=r?r(t,e,n):{};if(null==o.unit){var i=b?n.shiftKey&&n.metaKey:n.altKey;o.unit=i?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==o.extend||t.doc.extend)&&(o.extend=t.doc.extend||n.shiftKey),null==o.addNew&&(o.addNew=y?n.metaKey:n.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(y?n.altKey:n.ctrlKey)),o}(t,n,r),c=t.doc.sel;t.options.dragDrop&&At&&!t.isReadOnly()&&"single"==n&&(o=c.contains(e))>-1&&(te((o=c.ranges[o]).from(),e)<0||e.xRel>0)&&(te(o.to(),e)>0||e.xRel<0)?function(t,e,n,r){var o=t.display,i=!1,c=Qr(t,(function(e){l&&(o.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:xr(t)),ft(o.wrapper.ownerDocument,"mouseup",c),ft(o.wrapper.ownerDocument,"mousemove",u),ft(o.scroller,"dragstart",p),ft(o.scroller,"drop",c),i||(bt(e),r.addNew||Ko(t.doc,n,null,null,r.extend),l&&!d||s&&9==a?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.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&&(o.scroller.draggable=!0),t.state.draggingText=c,c.copy=!r.moveOnDrag,pt(o.wrapper.ownerDocument,"mouseup",c),pt(o.wrapper.ownerDocument,"mousemove",u),pt(o.scroller,"dragstart",p),pt(o.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}(t,r,e,i):function(t,e,n,r){s&&xr(t);var o=t.display,i=t.doc;bt(e);var a,l,c=i.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=i.sel.contains(n),a=l>-1?u[l]:new Co(n,n)):(a=i.sel.primary(),l=i.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Co(n,n)),n=lr(t,e,!0,!0),l=-1;else{var p=vs(t,n,r.unit);a=r.extend?Go(a,p.anchor,p.head,r.extend):p}r.addNew?-1==l?(l=u.length,Qo(i,So(t,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(Qo(i,So(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Xo(i,l,a,B):(l=0,Qo(i,new xo([a],0),B),c=i.sel);var d=n;function f(e){if(0!=te(d,e))if(d=e,"rectangle"==r.unit){for(var o=[],s=t.options.tabSize,u=R(Wt(i,n.line).text,n.ch,s),p=R(Wt(i,e.line).text,e.ch,s),f=Math.min(u,p),h=Math.max(u,p),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var m=Wt(i,g).text,y=W(m,f,s);f==h?o.push(new Co(Qt(g,y),Qt(g,y))):m.length>y&&o.push(new Co(Qt(g,y),Qt(g,W(m,h,s))))}o.length||o.push(new Co(n,n)),Qo(i,So(t,c.ranges.slice(0,l).concat(o),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=a,_=vs(t,e,r.unit),x=w.anchor;te(_.anchor,x)>0?(b=_.head,x=oe(w.from(),_.anchor)):(b=_.anchor,x=re(w.to(),_.head));var C=c.ranges.slice(0);C[l]=function(t,e){var n=e.anchor,r=e.head,o=Wt(t.doc,n.line);if(0==te(n,r)&&n.sticky==r.sticky)return e;var i=ct(o);if(!i)return e;var s=at(i,n.ch,n.sticky),a=i[s];if(a.from!=n.ch&&a.to!=n.ch)return e;var l,c=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==c||c==i.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=at(i,r.ch,r.sticky),p=u-s||(r.ch-n.ch)*(1==a.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,g=f?"after":"before";return n.ch==h&&n.sticky==g?e:new Co(new Qt(n.line,h,g),r)}(t,new Co(se(i,x),b)),Qo(i,So(t,C,l),B)}}var h=o.wrapper.getBoundingClientRect(),g=0;function v(e){var n=++g,s=lr(t,e,!0,"rectangle"==r.unit);if(s)if(0!=te(s,d)){t.curOp.focus=M(),f(s);var a=Ar(o,i);(s.line>=a.to||s.line<a.from)&&setTimeout(Qr(t,(function(){g==n&&v(e)})),150)}else{var l=e.clientY<h.top?-20:e.clientY>h.bottom?20:0;l&&setTimeout(Qr(t,(function(){g==n&&(o.scroller.scrollTop+=l,v(e))})),50)}}function m(e){t.state.selectingText=!1,g=1/0,e&&(bt(e),o.input.focus()),ft(o.wrapper.ownerDocument,"mousemove",y),ft(o.wrapper.ownerDocument,"mouseup",b),i.history.lastSelOrigin=null}var y=Qr(t,(function(t){0!==t.buttons&&St(t)?v(t):m(t)})),b=Qr(t,m);t.state.selectingText=b,pt(o.wrapper.ownerDocument,"mousemove",y),pt(o.wrapper.ownerDocument,"mouseup",b)}(t,r,e,i)}(e,r,i,t):Ct(t)==n.scroller&&bt(t):2==o?(r&&Ko(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==o&&(C?e.display.input.onContextMenu(t):xr(e)))}}function vs(t,e,n){if("char"==n)return new Co(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Co(Qt(e.line,0),se(t.doc,Qt(e.line+1,0)));var r=n(t,e);return new Co(r.from,r.to)}function ms(t,e,n,r){var o,i;if(e.touches)o=e.touches[0].clientX,i=e.touches[0].clientY;else try{o=e.clientX,i=e.clientY}catch(t){return!1}if(o>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&bt(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(i>a.bottom||!mt(t,n))return _t(e);i-=a.top-s.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var c=s.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=o)return ht(t,n,t,Xt(t.doc,i),t.display.gutterSpecs[l].className,e),_t(e)}}function ys(t,e){return ms(t,e,"gutterClick",!0)}function bs(t,e){_n(t.display,e)||function(t,e){return!!mt(t,"gutterContextMenu")&&ms(t,e,"gutterContextMenu",!1)}(t,e)||gt(t,e,"contextmenu")||C||t.display.input.onContextMenu(e)}function ws(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hn(t)}hs.prototype.compare=function(t,e,n){return this.time+400>t&&0==te(e,this.pos)&&n==this.button};var _s={toString:function(){return"CodeMirror.Init"}},xs={},Cs={};function Ss(t,e,n){if(!e!=!(n&&n!=_s)){var r=t.display.dragFunctions,o=e?pt:ft;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function Ts(t){t.options.lineWrapping?(N(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(O(t.display.wrapper,"CodeMirror-wrap"),ze(t)),ar(t),ur(t),Hn(t),setTimeout((function(){return Fr(t)}),100)}function Os(t,e){var n=this;if(!(this instanceof Os))return new Os(t,e);this.options=e=e?D(e):{},D(xs,e,!1);var r=e.value;"string"==typeof r?r=new Pi(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var o=new Os.inputStyles[e.inputStyle](this),i=this.display=new vo(t,r,o,e);for(var c in i.wrapper.CodeMirror=this,ws(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Br(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 H,keySeq:null,specialChars:null},e.autofocus&&!m&&i.input.focus(),s&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(t){var e=t.display;pt(e.scroller,"mousedown",Qr(t,gs)),pt(e.scroller,"dblclick",s&&a<11?Qr(t,(function(e){if(!gt(t,e)){var n=lr(t,e);if(n&&!ys(t,e)&&!_n(t.display,e)){bt(e);var r=t.findWordAt(n);Ko(t.doc,r.anchor,r.head)}}})):function(e){return gt(t,e)||bt(e)}),pt(e.scroller,"contextmenu",(function(e){return bs(t,e)})),pt(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||bs(t,n)}));var n,r={end:0};function o(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(r=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,r=e.top-t.top;return n*n+r*r>400}pt(e.scroller,"touchstart",(function(o){if(!gt(t,o)&&!i(o)&&!ys(t,o)){e.input.ensurePolled(),clearTimeout(n);var s=+new Date;e.activeTouch={start:s,moved:!1,prev:s-r.end<=300?r:null},1==o.touches.length&&(e.activeTouch.left=o.touches[0].pageX,e.activeTouch.top=o.touches[0].pageY)}})),pt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),pt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!_n(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,s=t.coordsChar(e.activeTouch,"page");i=!r.prev||l(r,r.prev)?new Co(s,s):!r.prev.prev||l(r,r.prev.prev)?t.findWordAt(s):new Co(Qt(s.line,0),se(t.doc,Qt(s.line+1,0))),t.setSelection(i.anchor,i.head),t.focus(),bt(n)}o()})),pt(e.scroller,"touchcancel",o),pt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Lr(t,e.scroller.scrollTop),$r(t,e.scroller.scrollLeft,!0),ht(t,"scroll",t))})),pt(e.scroller,"mousewheel",(function(e){return _o(t,e)})),pt(e.scroller,"DOMMouseScroll",(function(e){return _o(t,e)})),pt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){gt(t,e)||xt(e)},over:function(e){gt(t,e)||(function(t,e){var n=lr(t,e);if(n){var r=document.createDocumentFragment();mr(t,n,r),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,r)}}(t,e),xt(e))},start:function(e){return function(t,e){if(s&&(!t.state.draggingText||+new Date-ji<100))xt(e);else if(!gt(t,e)&&!_n(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)}}(t,e)},drop:Qr(t,Mi),leave:function(e){gt(t,e)||Ni(t)}};var c=e.input.getField();pt(c,"keyup",(function(e){return us.call(t,e)})),pt(c,"keydown",Qr(t,cs)),pt(c,"keypress",Qr(t,ps)),pt(c,"focus",(function(e){return Cr(t,e)})),pt(c,"blur",(function(e){return Sr(t,e)}))}(this),$i(),Wr(this),this.curOp.forceUpdate=!0,Io(this,r),e.autofocus&&!m||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Cr(n)}),20):Sr(this),Cs)Cs.hasOwnProperty(c)&&Cs[c](this,e[c],_s);po(this),e.finishInit&&e.finishInit(this);for(var u=0;u<As.length;++u)As[u](this);qr(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}Os.defaults=xs,Os.optionHandlers=Cs;var As=[];function Es(t,e,n,r){var o,i=t.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?o=de(t,e).state:n="prev");var s=t.options.tabSize,a=Wt(i,e),l=R(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&((c=i.mode.indent(o,a.text.slice(u.length),a.text))==V||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>i.first?R(Wt(i,e-1).text,null,s):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/s);f;--f)d+=s,p+="\t";if(d<c&&(p+=G(c-d)),p!=u)return hi(i,p,Qt(e,0),Qt(e,u.length),"+input"),a.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var g=i.sel.ranges[h];if(g.head.line==e&&g.head.ch<u.length){var v=Qt(e,u.length);Xo(i,h,new Co(v,v));break}}}Os.defineInitHook=function(t){return As.push(t)};var ks=null;function Ps(t){ks=t}function js(t,e,n,r,o){var i=t.doc;t.display.shift=!1,r||(r=i.sel);var s=+new Date-200,a="paste"==o||t.state.pasteIncoming>s,l=Pt(e),c=null;if(a&&r.ranges.length>1)if(ks&&ks.text.join("\n")==e){if(r.ranges.length%ks.text.length==0){c=[];for(var u=0;u<ks.text.length;u++)c.push(i.splitLines(ks.text[u]))}}else l.length==r.ranges.length&&t.options.pasteLinesPerSelection&&(c=Y(l,(function(t){return[t]})));for(var p=t.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var f=r.ranges[d],h=f.from(),g=f.to();f.empty()&&(n&&n>0?h=Qt(h.line,h.ch-n):t.state.overwrite&&!a?g=Qt(g.line,Math.min(Wt(i,g.line).text.length,g.ch+K(l).length)):a&&ks&&ks.lineWise&&ks.text.join("\n")==l.join("\n")&&(h=g=Qt(h.line,0)));var v={from:h,to:g,text:c?c[d%c.length]:l,origin:o||(a?"paste":t.state.cutIncoming>s?"cut":"+input")};ci(t.doc,v),an(t,"inputRead",t,v)}e&&!a&&Ns(t,e),Pr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=p),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ms(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Zr(e,(function(){return js(e,n,0,null,"paste")})),!0}function Ns(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=t.getModeAt(o.head),s=!1;if(i.electricChars){for(var a=0;a<i.electricChars.length;a++)if(e.indexOf(i.electricChars.charAt(a))>-1){s=Es(t,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Wt(t.doc,o.head.line).text.slice(0,o.head.ch))&&(s=Es(t,o.head.line,"smart"));s&&an(t,"electricInput",t,o.head.line)}}}function Ls(t){for(var e=[],n=[],r=0;r<t.doc.sel.ranges.length;r++){var o=t.doc.sel.ranges[r].head.line,i={anchor:Qt(o,0),head:Qt(o+1,0)};n.push(i),e.push(t.getRange(i.anchor,i.head))}return{text:e,ranges:n}}function Is(t,e,n,r){t.setAttribute("autocorrect",n?"":"off"),t.setAttribute("autocapitalize",r?"":"off"),t.setAttribute("spellcheck",!!e)}function $s(){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"),g&&(t.style.border="1px solid black"),Is(t),e}function Ds(t,e,n,r,o){var i=e,s=n,a=Wt(t,e.line),l=o&&"rtl"==t.direction?-n:n;function c(i){var s;if("codepoint"==r){var c=a.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(c))s=null;else{var u=n>0?c>=55296&&c<56320:c>=56320&&c<57343;s=new Qt(e.line,Math.max(0,Math.min(a.text.length,e.ch+n*(u?2:1))),-n)}}else s=o?function(t,e,n,r){var o=ct(e,t.doc.direction);if(!o)return Zi(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=at(o,n.ch,n.sticky),s=o[i];if("ltr"==t.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from<n.ch))return Zi(e,n,r);var a,l=function(t,n){return Ji(e,t instanceof Qt?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(a=a||jn(t,e),Jn(t,e,a,n)):{begin:0,end:e.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==s.level){var p=1==s.level==r<0,d=l(n,p?1:-1);if(null!=d&&(p?d<=s.to&&d<=u.end:d>=s.from&&d>=u.begin)){var f=p?"before":"after";return new Qt(n.line,d,f)}}var h=function(t,e,r){for(var i=function(t,e){return e?new Qt(n.line,l(t,1),"before"):new Qt(n.line,t,"after")};t>=0&&t<o.length;t+=e){var s=o[t],a=e>0==(1!=s.level),c=a?r.begin:l(r.end,-1);if(s.from<=c&&c<s.to)return i(c,a);if(c=a?s.from:l(s.to,-1),r.begin<=c&&c<r.end)return i(c,a)}},g=h(i+r,r,u);if(g)return g;var v=r>0?u.end:l(u.begin,-1);return null==v||r>0&&v==e.text.length||!(g=h(r>0?0:o.length-1,r,c(v)))?null:g}(t.cm,a,e,n):Zi(a,e,n);if(null==s){if(i||!function(){var n=e.line+l;return!(n<t.first||n>=t.first+t.size)&&(e=new Qt(n,e.ch,e.sticky),a=Wt(t,n))}())return!1;e=Qi(o,t.cm,a,e.line,l)}else e=s;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,p="group"==r,d=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||c(!f);f=!1){var h=a.text.charAt(e.ch)||"\n",g=tt(h,d)?"w":p&&"\n"==h?"n":!p||/\s/.test(h)?null:"p";if(!p||f||g||(g="s"),u&&u!=g){n<0&&(n=1,c(),e.sticky="after");break}if(g&&(u=g),n>0&&!c(!f))break}var v=ii(t,e,i,s,!0);return ee(i,v)&&(v.hitSide=!0),v}function Rs(t,e,n,r){var o,i,s=t.doc,a=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*nr(t.display),3);o=(n>0?e.bottom:e.top)+n*c}else"line"==r&&(o=n>0?e.bottom+3:e.top-3);for(;(i=Yn(t,a,o)).outside;){if(n<0?o<=0:o>=s.height){i.hitSide=!0;break}o+=5*n}return i}var Hs=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Fs(t,e){var n=Pn(t,e.line);if(!n||n.hidden)return null;var r=Wt(t.doc,e.line),o=En(n,r,e.line),i=ct(r,t.doc.direction),s="left";i&&(s=at(i,e.ch)%2?"right":"left");var a=In(o.map,e.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function Vs(t,e){return e&&(t.bad=!0),t}function Us(t,e,n){var r;if(e==t.display.lineDiv){if(!(r=t.display.lineDiv.childNodes[n]))return Vs(t.clipPos(Qt(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var o=0;o<t.display.view.length;o++){var i=t.display.view[o];if(i.node==r)return Bs(i,e,n)}}function Bs(t,e,n){var r=t.text.firstChild,o=!1;if(!e||!j(r,e))return Vs(Qt(Yt(t.line),0),!0);if(e==r&&(o=!0,e=r.childNodes[n],n=0,!e)){var i=t.rest?K(t.rest):t.line;return Vs(Qt(Yt(i),i.text.length),o)}var s=3==e.nodeType?e:null,a=e;for(s||1!=e.childNodes.length||3!=e.firstChild.nodeType||(s=e.firstChild,n&&(n=s.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var l=t.measure,c=l.maps;function u(e,n,r){for(var o=-1;o<(c?c.length:0);o++)for(var i=o<0?l.map:c[o],s=0;s<i.length;s+=3){var a=i[s+2];if(a==e||a==n){var u=Yt(o<0?t.line:t.rest[o]),p=i[s]+r;return(r<0||a!=e)&&(p=i[s+(r?1:0)]),Qt(u,p)}}}var p=u(s,a,n);if(p)return Vs(p,o);for(var d=a.nextSibling,f=s?s.nodeValue.length-n:0;d;d=d.nextSibling){if(p=u(d,d.firstChild,0))return Vs(Qt(p.line,p.ch-f),o);f+=d.textContent.length}for(var h=a.previousSibling,g=n;h;h=h.previousSibling){if(p=u(h,h.firstChild,-1))return Vs(Qt(p.line,p.ch+g),o);g+=h.textContent.length}}Hs.prototype.init=function(t){var e=this,n=this,r=n.cm,o=n.div=t.lineDiv;function i(t){for(var e=t.target;e;e=e.parentNode){if(e==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function s(t){if(i(t)&&!gt(r,t)){if(r.somethingSelected())Ps({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=Ls(r);Ps({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation((function(){r.setSelections(e.ranges,0,U),r.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var s=ks.text.join("\n");if(t.clipboardData.setData("Text",s),t.clipboardData.getData("Text")==s)return void t.preventDefault()}var a=$s(),l=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),l.value=ks.text.join("\n");var c=M();I(l),setTimeout((function(){r.display.lineSpace.removeChild(a),c.focus(),c==o&&n.showPrimarySelection()}),50)}}o.contentEditable=!0,Is(o,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),pt(o,"paste",(function(t){!i(t)||gt(r,t)||Ms(t,r)||a<=11&&setTimeout(Qr(r,(function(){return e.updateFromDOM()})),20)})),pt(o,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),pt(o,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),pt(o,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),pt(o,"touchstart",(function(){return n.forceCompositionEnd()})),pt(o,"input",(function(){e.composing||e.readFromDOMSoon()})),pt(o,"copy",s),pt(o,"cut",s)},Hs.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},Hs.prototype.prepareSelection=function(){var t=vr(this.cm,!1);return t.focus=M()==this.div,t},Hs.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},Hs.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Hs.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,r=e.doc.sel.primary(),o=r.from(),i=r.to();if(e.display.viewTo==e.display.viewFrom||o.line>=e.display.viewTo||i.line<e.display.viewFrom)t.removeAllRanges();else{var s=Us(e,t.anchorNode,t.anchorOffset),a=Us(e,t.focusNode,t.focusOffset);if(!s||s.bad||!a||a.bad||0!=te(oe(s,a),o)||0!=te(re(s,a),i)){var l=e.display.view,c=o.line>=e.display.viewFrom&&Fs(e,o)||{node:l[0].measure.map[2],offset:0},u=i.line<e.display.viewTo&&Fs(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=T(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()}}},Hs.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)},Hs.prototype.showMultipleSelections=function(t){E(this.cm.display.cursorDiv,t.cursors),E(this.cm.display.selectionDiv,t.selection)},Hs.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},Hs.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return j(this.div,e)},Hs.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&M()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Hs.prototype.blur=function(){this.div.blur()},Hs.prototype.getField=function(){return this.div},Hs.prototype.supportsTouch=function(){return!0},Hs.prototype.receivedFocus=function(){var t=this,e=this;this.selectionInEditor()?setTimeout((function(){return t.pollSelection()}),20):Zr(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Hs.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},Hs.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&function(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}(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=Us(e,t.anchorNode,t.anchorOffset),r=Us(e,t.focusNode,t.focusOffset);n&&r&&Zr(e,(function(){Qo(e.doc,To(n,r),U),(n.bad||r.bad)&&(e.curOp.selectionChanged=!0)}))}}},Hs.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,r=this.cm,o=r.display,i=r.doc.sel.primary(),s=i.from(),a=i.to();if(0==s.ch&&s.line>r.firstLine()&&(s=Qt(s.line-1,Wt(r.doc,s.line-1).length)),a.ch==Wt(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=Qt(a.line+1,0)),s.line<o.viewFrom||a.line>o.viewTo-1)return!1;s.line==o.viewFrom||0==(t=cr(r,s.line))?(e=Yt(o.view[0].line),n=o.view[0].node):(e=Yt(o.view[t].line),n=o.view[t-1].node.nextSibling);var l,c,u=cr(r,a.line);if(u==o.view.length-1?(l=o.viewTo-1,c=o.lineDiv.lastChild):(l=Yt(o.view[u+1].line)-1,c=o.view[u+1].node.previousSibling),!n)return!1;for(var p=r.doc.splitLines(function(t,e,n,r,o){var i="",s=!1,a=t.doc.lineSeparator(),l=!1;function c(){s&&(i+=a,l&&(i+=a),s=l=!1)}function u(t){t&&(c(),i+=t)}function p(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void u(n);var i,d=e.getAttribute("cm-marker");if(d){var f=t.findMarks(Qt(r,0),Qt(o+1,0),(v=+d,function(t){return t.id==v}));return void(f.length&&(i=f[0].find(0))&&u(qt(t.doc,i.from,i.to).join(a)))}if("false"==e.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;h&&c();for(var g=0;g<e.childNodes.length;g++)p(e.childNodes[g]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),h&&(s=!0)}else 3==e.nodeType&&u(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;p(e),e!=n;)e=e.nextSibling,l=!1;return i}(r,n,c,e,l)),d=qt(r.doc,Qt(e,0),Qt(l,Wt(r.doc,l).text.length));p.length>1&&d.length>1;)if(K(p)==K(d))p.pop(),d.pop(),l--;else{if(p[0]!=d[0])break;p.shift(),d.shift(),e++}for(var f=0,h=0,g=p[0],v=d[0],m=Math.min(g.length,v.length);f<m&&g.charCodeAt(f)==v.charCodeAt(f);)++f;for(var y=K(p),b=K(d),w=Math.min(y.length-(1==p.length?f:0),b.length-(1==d.length?f:0));h<w&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==p.length&&1==d.length&&e==s.line)for(;f&&f>s.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;p[p.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(f).replace(/\u200b+$/,"");var _=Qt(e,f),x=Qt(l,d.length?K(d).length-h:0);return p.length>1||p[0]||te(_,x)?(hi(r.doc,p,_,x,"+input"),!0):void 0},Hs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Hs.prototype.reset=function(){this.forceCompositionEnd()},Hs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Hs.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))},Hs.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Zr(this.cm,(function(){return ur(t.cm)}))},Hs.prototype.setUneditable=function(t){t.contentEditable="false"},Hs.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Qr(this.cm,js)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Hs.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Hs.prototype.onContextMenu=function(){},Hs.prototype.resetPosition=function(){},Hs.prototype.needsContentAttribute=!0;var zs=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null};zs.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var o=this.textarea;function i(t){if(!gt(r,t)){if(r.somethingSelected())Ps({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Ls(r);Ps({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,U):(n.prevInput="",o.value=e.text.join("\n"),I(o))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(o.style.width="0px"),pt(o,"input",(function(){s&&a>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),pt(o,"paste",(function(t){gt(r,t)||Ms(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pt(o,"cut",i),pt(o,"copy",i),pt(t.scroller,"paste",(function(e){if(!_n(t,e)&&!gt(r,e)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=e.clipboardData,o.dispatchEvent(i)}})),pt(t.lineSpace,"selectstart",(function(e){_n(t,e)||bt(e)})),pt(o,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pt(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},zs.prototype.createField=function(t){this.wrapper=$s(),this.textarea=this.wrapper.firstChild},zs.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},zs.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=vr(t);if(t.options.moveInputWithCursor){var o=qn(t,n.sel.primary().head,"div"),i=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,o.top+s.top-i.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,o.left+s.left-i.left))}return r},zs.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")},zs.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),s&&a>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null))}},zs.prototype.getField=function(){return this.textarea},zs.prototype.supportsTouch=function(){return!1},zs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||M()!=this.textarea))try{this.textarea.focus()}catch(t){}},zs.prototype.blur=function(){this.textarea.blur()},zs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},zs.prototype.receivedFocus=function(){this.slowPoll()},zs.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},zs.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,(function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}))},zs.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||jt(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var o=n.value;if(o==r&&!e.somethingSelected())return!1;if(s&&a>=9&&this.hasSelection===o||y&&/[\uf700-\uf7ff]/.test(o))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,o.length);l<c&&r.charCodeAt(l)==o.charCodeAt(l);)++l;return Zr(e,(function(){js(e,o.slice(l),r.length-l,null,t.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=o,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},zs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},zs.prototype.onKeyPress=function(){s&&a>=9&&(this.hasSelection=null),this.fastPoll()},zs.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,o=e.textarea;e.contextMenuPending&&e.contextMenuPending();var i=lr(n,t),c=r.scroller.scrollTop;if(i&&!p){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&Qr(n,Qo)(n.doc,To(i),U);var u,d=o.style.cssText,f=e.wrapper.style.cssText,h=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",o.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: "+(s?"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),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(o.value=e.prevInput=" "),e.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&a>=9&&v(),C){xt(t);var g=function(){ft(window,"mouseup",g),setTimeout(m,20)};pt(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=o.selectionStart){var t=n.somethingSelected(),i=""+(t?o.value:"");o.value="⇚",o.value=i,e.prevInput=t?"":"",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function m(){if(e.contextMenuPending==m&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,o.style.cssText=d,s&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=o.selectionStart)){(!s||s&&a<9)&&v();var t=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&""==e.prevInput?Qr(n,ai)(n):t++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},zs.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},zs.prototype.setUneditable=function(){},zs.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,r,o,i){t.defaults[n]=r,o&&(e[n]=i?function(t,e,n){n!=_s&&o(t,e,n)}:o)}t.defineOption=n,t.Init=_s,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,Po(t)}),!0),n("indentUnit",2,Po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){jo(t),Hn(t),ur(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var o=0;;){var i=t.text.indexOf(e,o);if(-1==i)break;o=i+e.length,n.push(Qt(r,i))}r++}));for(var o=n.length-1;o>=0;o--)hi(t.doc,e,n[o],Qt(n[o].line,n[o].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!=_s&&t.refresh()})),n("specialCharPlaceholder",Je,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",m?"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",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){ws(t),go(t)}),!0),n("keyMap","default",(function(t,e,n){var r=Yi(e),o=n!=_s&&Yi(n);o&&o.detach&&o.detach(t,r),r.attach&&r.attach(t,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ts,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=fo(e,t.options.lineNumbers),go(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?ir(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return Fr(t)}),!0),n("scrollbarStyle","native",(function(t){Br(t),Fr(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=fo(t.options.gutters,e),go(t)}),!0),n("firstLineNumber",1,go,!0),n("lineNumberFormatter",(function(t){return t}),go,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Sr(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,Ss),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,jo,!0),n("addModeClass",!1,jo,!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,jo,!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)}(Os),function(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 r=this.options,o=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&Qr(this,e[t])(this,n,o),ht(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"](Yi(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:to((function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");(function(t,e,n){for(var r=0,o=n(e);r<t.length&&n(t[r])<=o;)r++;t.splice(r,0,e)})(this.state.overlays,{mode:r,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority})),this.state.modeGen++,ur(this)})),removeOverlay:to((function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var r=e[n].modeSpec;if(r==t||"string"==typeof t&&r.name==t)return e.splice(n,1),this.state.modeGen++,void ur(this)}})),indentLine:to((function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),Jt(this.doc,t)&&Es(this,t,e,n)})),indentSelection:to((function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var o=e[r];if(o.empty())o.head.line>n&&(Es(this,o.head.line,t,!0),n=o.head.line,r==this.doc.sel.primIndex&&Pr(this));else{var i=o.from(),s=o.to(),a=Math.max(n,i.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l<n;++l)Es(this,l,t);var c=this.doc.sel.ranges;0==i.ch&&e.length==c.length&&c[r].from().ch>0&&Xo(this.doc,r,new Co(i,c[r].to()),U)}}})),getTokenAt:function(t,e){return me(this,t,e)},getLineTokens:function(t,e){return me(this,Qt(t),e,!0)},getTokenTypeAt:function(t){t=se(this.doc,t);var e,n=pe(this,Wt(this.doc,t.line)),r=0,o=(n.length-1)/2,i=t.ch;if(0==i)e=n[2];else for(;;){var s=r+o>>1;if((s?n[2*s-1]:0)>=i)o=s;else{if(!(n[2*s+1]<i)){e=n[2*s+2];break}r=s+1}}var a=e?e.indexOf("overlay "):-1;return a<0?e:0==a?null:e.slice(0,a-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 r=[];if(!n.hasOwnProperty(e))return r;var o=n[e],i=this.getModeAt(t);if("string"==typeof i[e])o[i[e]]&&r.push(o[i[e]]);else if(i[e])for(var s=0;s<i[e].length;s++){var a=o[i[e][s]];a&&r.push(a)}else i.helperType&&o[i.helperType]?r.push(o[i.helperType]):o[i.name]&&r.push(o[i.name]);for(var l=0;l<o._global.length;l++){var c=o._global[l];c.pred(i,this)&&-1==F(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(t,e){var n=this.doc;return de(this,(t=ie(n,null==t?n.first+n.size-1:t))+1,e).state},cursorCoords:function(t,e){var n=this.doc.sel.primary();return qn(this,null==t?n.head:"object"==typeof t?se(this.doc,t):t?n.from():n.to(),e||"page")},charCoords:function(t,e){return Wn(this,se(this.doc,t),e||"page")},coordsChar:function(t,e){return Yn(this,(t=zn(this,t,e||"page")).left,t.top)},lineAtHeight:function(t,e){return t=zn(this,{top:t,left:0},e||"page").top,Xt(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var r,o=!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,o=!0),r=Wt(this.doc,t)}else r=t;return Bn(this,r,{top:0,left:0},e||"page",n||o).top+(o?this.doc.height-Ue(r):0)},defaultTextHeight:function(){return nr(this.display)},defaultCharWidth:function(){return rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,o){var i,s,a,l=this.display,c=(t=qn(this,se(this.doc,t))).bottom,u=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==r)c=t.top;else if("above"==r||"near"==r){var p=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>p)&&t.top>e.offsetHeight?c=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=p&&(c=t.bottom),u+e.offsetWidth>d&&(u=d-e.offsetWidth)}e.style.top=c+"px",e.style.left=e.style.right="","right"==o?(u=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=u+"px"),n&&(i=this,s={left:u,top:c,right:u+e.offsetWidth,bottom:c+e.offsetHeight},null!=(a=Er(i,s)).scrollTop&&Lr(i,a.scrollTop),null!=a.scrollLeft&&$r(i,a.scrollLeft))},triggerOnKeyDown:to(cs),triggerOnKeyPress:to(ps),triggerOnKeyUp:us,triggerOnMouseDown:to(gs),execCommand:function(t){if(ts.hasOwnProperty(t))return ts[t].call(null,this)},triggerElectric:to((function(t){Ns(this,t)})),findPosH:function(t,e,n,r){var o=1;e<0&&(o=-1,e=-e);for(var i=se(this.doc,t),s=0;s<e&&!(i=Ds(this.doc,i,o,n,r)).hitSide;++s);return i},moveH:to((function(t,e){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Ds(n.doc,r.head,t,e,n.options.rtlMoveVisually):t<0?r.from():r.to()}),z)})),deleteH:to((function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Xi(this,(function(n){var o=Ds(r,n.head,t,e,!1);return t<0?{from:o,to:n.head}:{from:n.head,to:o}}))})),findPosV:function(t,e,n,r){var o=1,i=r;e<0&&(o=-1,e=-e);for(var s=se(this.doc,t),a=0;a<e;++a){var l=qn(this,s,"div");if(null==i?i=l.left:l.left=i,(s=Rs(this,l,o,n)).hitSide)break}return s},moveV:to((function(t,e){var n=this,r=this.doc,o=[],i=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(s){if(i)return t<0?s.from():s.to();var a=qn(n,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),o.push(a.left);var l=Rs(n,a,t,e);return"page"==e&&s==r.sel.primary()&&kr(n,Wn(n,l,"div").top-a.top),l}),z),o.length)for(var s=0;s<r.sel.ranges.length;s++)r.sel.ranges[s].goalColumn=o[s]})),findWordAt:function(t){var e=Wt(this.doc,t.line).text,n=t.ch,r=t.ch;if(e){var o=this.getHelper(t,"wordChars");"before"!=t.sticky&&r!=e.length||!n?++r:--n;for(var i=e.charAt(n),s=tt(i,o)?function(t){return tt(t,o)}:/\s/.test(i)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!tt(t)};n>0&&s(e.charAt(n-1));)--n;for(;r<e.length&&s(e.charAt(r));)++r}return new Co(Qt(t.line,n),Qt(t.line,r))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):O(this.display.cursorDiv,"CodeMirror-overwrite"),ht(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:to((function(t,e){jr(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Tn(this)-this.display.barHeight,width:t.scrollWidth-Tn(this)-this.display.barWidth,clientHeight:An(this),clientWidth:On(this)}},scrollIntoView:to((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:Qt(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?function(t,e){Mr(t),t.curOp.scrollToPos=e}(this,t):Nr(this,t.from,t.to,t.margin)})),setSize:to((function(t,e){var n=this,r=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=r(t)),null!=e&&(this.display.wrapper.style.height=r(e)),this.options.lineWrapping&&Rn(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){pr(n,o,"widget");break}++o})),this.curOp.forceUpdate=!0,ht(this,"refresh",this)})),operation:function(t){return Zr(this,t)},startOperation:function(){return Wr(this)},endOperation:function(){return qr(this)},refresh:to((function(){var t=this.display.cachedTextHeight;ur(this),this.curOp.forceUpdate=!0,Hn(this),jr(this,this.doc.scrollLeft,this.doc.scrollTop),lo(this.display),(null==t||Math.abs(t-nr(this.display))>.5||this.options.lineWrapping)&&ar(this),ht(this,"refresh",this)})),swapDoc:to((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Io(this,t),Hn(this),this.display.input.reset(),jr(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,an(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}},yt(t),t.registerHelper=function(e,r,o){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=o},t.registerGlobalHelper=function(e,r,o,i){t.registerHelper(e,r,i),n[e]._global.push({pred:o,val:i})}}(Os);var Ws="iter insert remove copy getEditor constructor".split(" ");for(var qs in Pi.prototype)Pi.prototype.hasOwnProperty(qs)&&F(Ws,qs)<0&&(Os.prototype[qs]=function(t){return function(){return t.apply(this.doc,arguments)}}(Pi.prototype[qs]));return yt(Pi),Os.inputStyles={textarea:zs,contenteditable:Hs},Os.defineMode=function(t){Os.defaults.mode||"null"==t||(Os.defaults.mode=t),$t.apply(this,arguments)},Os.defineMIME=function(t,e){It[t]=e},Os.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Os.defineMIME("text/plain","null"),Os.defineExtension=function(t,e){Os.prototype[t]=e},Os.defineDocExtension=function(t,e){Pi.prototype[t]=e},Os.fromTextArea=function(t,e){if((e=e?D(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 r(){t.value=a.getValue()}var o;if(t.form&&(pt(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var i=t.form;o=i.submit;try{var s=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=s}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(ft(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=o))}},t.style.display="none";var a=Os((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return a},function(t){t.off=ft,t.on=pt,t.wheelEventPixels=wo,t.Doc=Pi,t.splitLines=Pt,t.countColumn=R,t.findColumn=W,t.isWordChar=Q,t.Pass=V,t.signal=ht,t.Line=We,t.changeEnd=Oo,t.scrollbarModel=Ur,t.Pos=Qt,t.cmpPos=te,t.modes=Lt,t.mimeModes=It,t.resolveMode=Dt,t.getMode=Rt,t.modeExtensions=Ht,t.extendMode=Ft,t.copyState=Vt,t.startState=Bt,t.innerMode=Ut,t.commands=ts,t.keyMap=Ui,t.keyName=Ki,t.isModifierKey=qi,t.lookupKey=Wi,t.normalizeKeyMap=zi,t.StringStream=zt,t.SharedTextMarker=Oi,t.TextMarker=Si,t.LineWidget=_i,t.e_preventDefault=bt,t.e_stopPropagation=wt,t.e_stop=xt,t.addClass=N,t.contains=j,t.rmClass=O,t.keyNames=Ri}(Os),Os.version="5.63.0",Os}()},656:(t,e,n)=>{!function(t){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 r=n.inline;n.propertyKeywords||(n=t.resolveMode("text/css"));var o,i,s=e.indentUnit,a=n.tokenHooks,l=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},p=n.mediaValueKeywords||{},d=n.propertyKeywords||{},f=n.nonStandardPropertyKeywords||{},h=n.fontProperties||{},g=n.counterDescriptors||{},v=n.colorKeywords||{},m=n.valueKeywords||{},y=n.allowNested,b=n.lineComment,w=!0===n.supportsAtComponent,_=!1!==e.highlightNonStandardPropertyKeywords;function x(t,e){return o=e,t}function C(t,e){var n=t.next();if(a[n]){var r=a[n](t,e);if(!1!==r)return r}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=T),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 r,o=!1;null!=(r=e.next());){if(r==t&&!o){")"==t&&e.backUp(1);break}o=!o&&"\\"==r}return(r==t||!o&&")"!=t)&&(n.tokenize=null),x("string","string")}}function T(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=S(")"),x(null,"(")}function O(t,e,n){this.type=t,this.indent=e,this.prev=n}function A(t,e,n,r){return t.context=new O(n,e.indentation()+(!1===r?0:s),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 P(t,e,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return k(t,e,n)}function j(t){var e=t.current().toLowerCase();i=m.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var M={top:function(t,e,n){if("{"==t)return A(n,e,"block");if("}"==t&&n.context.prev)return E(n);if(w&&/@component/i.test(t))return A(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return A(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return A(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 A(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 A(n,e,"interpolation");if(":"==t)return"pseudo";if(y&&"("==t)return A(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return d.hasOwnProperty(r)?(i="property","maybeprop"):f.hasOwnProperty(r)?(i=_?"string-2":"property","maybeprop"):y?(i=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==t?"block":y||"hash"!=t&&"qualifier"!=t?M.top(t,e,n):(i="error","block")},maybeprop:function(t,e,n){return":"==t?A(n,e,"prop"):k(t,e,n)},prop:function(t,e,n){if(";"==t)return E(n);if("{"==t&&y)return A(n,e,"propBlock");if("}"==t||"{"==t)return P(t,e,n);if("("==t)return A(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 A(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?P(t,e,n):")"==t?E(n):"("==t?A(n,e,"parens"):"interpolation"==t?A(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 A(n,e,"atBlock_parens");if("}"==t||";"==t)return P(t,e,n);if("{"==t)return E(n)&&A(n,e,y?"block":"top");if("interpolation"==t)return A(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?"keyword":d.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?_?"string-2":"property":m.hasOwnProperty(r)?"atom":v.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?P(t,e,n):"{"==t?E(n)&&A(n,e,y?"block":"top",!1):("word"==t&&(i="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?E(n):"{"==t||"}"==t?P(t,e,n,2):M.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?A(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&&!g.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(t,e,n){return"word"==t?(i="variable","keyframes"):"{"==t?A(n,e,"top"):k(t,e,n)},at:function(t,e,n){return";"==t?E(n):"{"==t||"}"==t?P(t,e,n):("word"==t?i="tag":"hash"==t&&(i="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?E(n):"{"==t||";"==t?P(t,e,n):("word"==t?i="variable":"variable"!=t&&"("!=t&&")"!=t&&(i="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new O(r?"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&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(e.state=M[e.state](o,t,e)),i},indent:function(t,e){var n=t.context,r=e&&e.charAt(0),o=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(o=Math.max(0,n.indent-s)):o=(n=n.prev).indent),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=e(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(o),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme"],a=e(s),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"]),g=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=e(v),y=["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(y),w=n.concat(o).concat(s).concat(l).concat(u).concat(d).concat(v).concat(y);function _(t,e){for(var n,r=!1;null!=(n=t.next());){if(r&&"/"==n){e.tokenize=null;break}r="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",w),t.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:m,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=_,_(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=_,_(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:a,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:m,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=_,_(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:r,mediaTypes:i,mediaFeatures:a,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:m,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=_,_(t,e))}},name:"css",helperType:"gss"})}(n(237))},520:(t,e,n)=>{!function(t){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"]]};var n={};function r(t,e){var r=t.match(function(t){return n[t]||(n[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(e));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function o(t,e){return new RegExp((e?"^":"")+"</s*"+t+"s*>","i")}function i(t,e){for(var n in t)for(var r=e[n]||(e[n]=[]),o=t[n],i=o.length-1;i>=0;i--)r.unshift(o[i])}t.defineMode("htmlmixed",(function(n,s){var a=t.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:s.multilineTagIndentFactor,multilineTagIndentPastTag:s.multilineTagIndentPastTag,allowMissingTagName:s.allowMissingTagName}),l={},c=s&&s.tags,u=s&&s.scriptTypes;if(i(e,l),c&&i(c,l),u)for(var p=u.length-1;p>=0;p--)l.script.unshift(["type",u[p].matches,u[p].mode]);function d(e,i){var s,c=a.token(e,i.htmlState),u=/\btag\b/.test(c);if(u&&!/[<>\s\/]/.test(e.current())&&(s=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(s))i.inTag=s+" ";else if(i.inTag&&u&&/>$/.test(e.current())){var p=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var f=">"==e.current()&&function(t,e){for(var n=0;n<t.length;n++){var o=t[n];if(!o[0]||o[1].test(r(e,o[0])))return o[2]}}(l[p[1]],p[2]),h=t.getMode(n,f),g=o(p[1],!0),v=o(p[1],!1);i.token=function(t,e){return t.match(g,!1)?(e.token=d,e.localState=e.localMode=null,null):function(t,e,n){var r=t.current(),o=r.search(e);return o>-1?t.backUp(r.length-o):r.match(/<\/?$/)&&(t.backUp(r.length),t.match(e,!1)||t.match(r)),n}(t,v,e.localMode.token(t,e.localState))},i.localMode=h,i.localState=t.startState(h,a.indent(i.htmlState,"",""))}else i.inTag&&(i.inTag+=e.current(),e.eol()&&(i.inTag+=" "));return c}return{startState:function(){return{token:d,inTag:null,localMode:null,localState:null,htmlState:t.startState(a)}},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(a,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,r){return!e.localMode||/^\s*<\//.test(n)?a.indent(e.htmlState,n,r):e.localMode.indent?e.localMode.indent(e.localState,n,r):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||a}}}}),"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}(n(237),n(576),n(792),n(656))},792:(t,e,n)=>{!function(t){t.defineMode("javascript",(function(e,n){var r,o,i=e.indentUnit,s=n.statementIndent,a=n.jsonld,l=n.json||a,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"),r=t("keyword c"),o=t("keyword d"),i=t("operator"),s={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:t("new"),delete:r,void:r,throw:r,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:s,false:s,null:s,undefined:s,NaN:s,Infinity:s,this:t("this"),class:t("class"),super:t("atom"),yield:r,export:t("export"),import:t("import"),extends:r,await:r}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t,e,n){return r=t,o=n,e}function v(t,e){var n,r=t.next();if('"'==r||"'"==r)return e.tokenize=(n=r,function(t,e){var r,o=!1;if(a&&"@"==t.peek()&&t.match(h))return e.tokenize=v,g("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=n||o);)o=!o&&"\\"==r;return o||(e.tokenize=v),g("string","string")}),e.tokenize(t,e);if("."==r&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==r&&t.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&t.eat(">"))return g("=>","operator");if("0"==r&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(r))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==r)return t.eat("*")?(e.tokenize=m,m(t,e)):t.eat("/")?(t.skipToEnd(),g("comment","comment")):Qt(t,e,1)?(function(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(t.eat("="),g("operator","operator",t.current()));if("`"==r)return e.tokenize=y,y(t,e);if("#"==r&&"!"==t.peek())return t.skipToEnd(),g("meta","meta");if("#"==r&&t.eatWhile(p))return g("variable","property");if("<"==r&&t.match("!--")||"-"==r&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),g("comment","comment");if(f.test(r))return">"==r&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=r&&"="!=r||t.eat("="):/[<>*+\-|&?]/.test(r)&&(t.eat(r),">"==r&&t.eat(r))),"?"==r&&t.eat(".")?g("."):g("operator","operator",t.current());if(p.test(r)){t.eatWhile(p);var o=t.current();if("."!=e.lastType){if(d.propertyIsEnumerable(o)){var i=d[o];return g(i.type,i.style,o)}if("async"==o&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",o)}return g("variable","variable",o)}}function m(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=v;break}r="*"==n}return g("comment","comment")}function y(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=v;break}r=!r&&"\\"==n}return g("quasi","string-2",t.current())}function b(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));r&&(n=r.index)}for(var o=0,i=!1,s=n-1;s>=0;--s){var a=t.string.charAt(s),l="([{}])".indexOf(a);if(l>=0&&l<3){if(!o){++s;break}if(0==--o){"("==a&&(i=!0);break}}else if(l>=3&&l<6)++o;else if(p.test(a))i=!0;else if(/["'\/`]/.test(a))for(;;--s){if(0==s)return;if(t.string.charAt(s-1)==a&&"\\"!=t.string.charAt(s-2)){s--;break}}else if(i&&!o){++s;break}}i&&!o&&(e.fatArrowAt=s)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function _(t,e,n,r,o,i){this.indented=t,this.column=e,this.type=n,this.prev=o,this.info=i,null!=r&&(this.align=r)}function x(t,e){if(!c)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==e)return!0}function C(t,e,n,r,o){var i=t.cc;for(S.state=t,S.stream=o,S.marked=null,S.cc=i,S.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;)if((i.length?i.pop():l?U:F)(n,r)){for(;i.length&&i[i.length-1].lex;)i.pop()();return S.marked?S.marked:"variable"==n&&x(t,r)?"variable-2":e}}var S={state:null,column:null,marked:null,cc:null};function T(){for(var t=arguments.length-1;t>=0;t--)S.cc.push(arguments[t])}function O(){return T.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 E(t){var e=S.state;if(S.marked="def",c){if(e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var r=k(t,e.context);if(null!=r)return void(e.context=r)}else if(!A(t,e.localVars))return void(e.localVars=new M(t,e.localVars));n.globalVars&&!A(t,e.globalVars)&&(e.globalVars=new M(t,e.globalVars))}}function k(t,e){if(e){if(e.block){var n=k(t,e.prev);return n?n==e.prev?e:new j(n,e.vars,!0):null}return A(t,e.vars)?e:new j(e.prev,new M(t,e.vars),!1)}return null}function P(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function j(t,e,n){this.prev=t,this.vars=e,this.block=n}function M(t,e){this.name=t,this.next=e}var N=new M("this",new M("arguments",null));function L(){S.state.context=new j(S.state.context,S.state.localVars,!1),S.state.localVars=N}function I(){S.state.context=new j(S.state.context,S.state.localVars,!0),S.state.localVars=null}function $(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function D(t,e){var n=function(){var n=S.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var o=n.lexical;o&&")"==o.type&&o.align;o=o.prev)r=o.indented;n.lexical=new _(r,S.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function R(){var t=S.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function H(t){return function e(n){return n==t?O():";"==t||"}"==n||")"==n||"]"==n?T():O(e)}}function F(t,e){return"var"==t?O(D("vardef",e),St,H(";"),R):"keyword a"==t?O(D("form"),z,F,R):"keyword b"==t?O(D("form"),F,R):"keyword d"==t?S.stream.match(/^\s*$/,!1)?O():O(D("stat"),q,H(";"),R):"debugger"==t?O(H(";")):"{"==t?O(D("}"),I,lt,R,$):";"==t?O():"if"==t?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==R&&S.state.cc.pop()(),O(D("form"),z,F,R,Pt)):"function"==t?O(Lt):"for"==t?O(D("form"),I,jt,F,$,R):"class"==t||u&&"interface"==e?(S.marked="keyword",O(D("form","class"==t?t:e),Ht,R)):"variable"==t?u&&"declare"==e?(S.marked="keyword",O(F)):u&&("module"==e||"enum"==e||"type"==e)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==e?O(Jt):"type"==e?O($t,H("operator"),ft,H(";")):O(D("form"),Tt,H("{"),D("}"),lt,R,R)):u&&"namespace"==e?(S.marked="keyword",O(D("form"),U,F,R)):u&&"abstract"==e?(S.marked="keyword",O(F)):O(D("stat"),et):"switch"==t?O(D("form"),z,H("{"),D("}","switch"),I,lt,R,R,$):"case"==t?O(U,H(":")):"default"==t?O(H(":")):"catch"==t?O(D("form"),L,V,F,R,$):"export"==t?O(D("stat"),Bt,R):"import"==t?O(D("stat"),Wt,R):"async"==t?O(F):"@"==e?O(U,F):T(D("stat"),U,H(";"),R)}function V(t){if("("==t)return O(Dt,H(")"))}function U(t,e){return W(t,e,!1)}function B(t,e){return W(t,e,!0)}function z(t){return"("!=t?T():O(D(")"),q,H(")"),R)}function W(t,e,n){if(S.state.fatArrowAt==S.stream.start){var r=n?Z:J;if("("==t)return O(L,D(")"),st(Dt,")"),R,H("=>"),r,$);if("variable"==t)return T(L,Tt,H("=>"),r,$)}var o=n?K:G;return w.hasOwnProperty(t)?O(o):"function"==t?O(Lt,o):"class"==t||u&&"interface"==e?(S.marked="keyword",O(D("form"),Rt,R)):"keyword c"==t||"async"==t?O(n?B:U):"("==t?O(D(")"),q,H(")"),R,o):"operator"==t||"spread"==t?O(n?B:U):"["==t?O(D("]"),Xt,R,o):"{"==t?at(rt,"}",null,o):"quasi"==t?T(Y,o):"new"==t?O(function(t){return function(e){return"."==e?O(t?tt:Q):"variable"==e&&u?O(_t,t?K:G):T(t?B:U)}}(n)):O()}function q(t){return t.match(/[;\}\)\],]/)?T():T(U)}function G(t,e){return","==t?O(q):K(t,e,!1)}function K(t,e,n){var r=0==n?G:K,o=0==n?U:B;return"=>"==t?O(L,n?Z:J,$):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?O(r):u&&"<"==e&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?O(D(">"),st(ft,">"),R,r):"?"==e?O(U,H(":"),o):O(o):"quasi"==t?T(Y,r):";"!=t?"("==t?at(B,")","call",r):"."==t?O(nt,r):"["==t?O(D("]"),q,H("]"),R,r):u&&"as"==e?(S.marked="keyword",O(ft,r)):"regexp"==t?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),O(o)):void 0:void 0}function Y(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?O(Y):O(q,X)}function X(t){if("}"==t)return S.marked="string-2",S.state.tokenize=y,O(Y)}function J(t){return b(S.stream,S.state),T("{"==t?F:U)}function Z(t){return b(S.stream,S.state),T("{"==t?F:B)}function Q(t,e){if("target"==e)return S.marked="keyword",O(G)}function tt(t,e){if("target"==e)return S.marked="keyword",O(K)}function et(t){return":"==t?O(R,F):T(G,H(";"),R)}function nt(t){if("variable"==t)return S.marked="property",O()}function rt(t,e){return"async"==t?(S.marked="property",O(rt)):"variable"==t||"keyword"==S.style?(S.marked="property","get"==e||"set"==e?O(ot):(u&&S.state.fatArrowAt==S.stream.start&&(n=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+n[0].length),O(it))):"number"==t||"string"==t?(S.marked=a?"property":S.style+" property",O(it)):"jsonld-keyword"==t?O(it):u&&P(e)?(S.marked="keyword",O(rt)):"["==t?O(U,ct,H("]"),it):"spread"==t?O(B,it):"*"==e?(S.marked="keyword",O(rt)):":"==t?T(it):void 0;var n}function ot(t){return"variable"!=t?T(it):(S.marked="property",O(Lt))}function it(t){return":"==t?O(B):"("==t?T(Lt):void 0}function st(t,e,n){function r(o,i){if(n?n.indexOf(o)>-1:","==o){var s=S.state.lexical;return"call"==s.info&&(s.pos=(s.pos||0)+1),O((function(n,r){return n==e||r==e?T():T(t)}),r)}return o==e||i==e?O():n&&n.indexOf(";")>-1?T(t):O(H(e))}return function(n,o){return n==e||o==e?O():T(t,r)}}function at(t,e,n){for(var r=3;r<arguments.length;r++)S.cc.push(arguments[r]);return O(D(e,n),st(t,e),R)}function lt(t){return"}"==t?O():T(F,lt)}function ct(t,e){if(u){if(":"==t)return O(ft);if("?"==e)return O(ct)}}function ut(t,e){if(u&&(":"==t||"in"==e))return O(ft)}function pt(t){if(u&&":"==t)return S.stream.match(/^\s*\w+\s+is\b/,!1)?O(U,dt,ft):O(ft)}function dt(t,e){if("is"==e)return S.marked="keyword",O()}function ft(t,e){return"keyof"==e||"typeof"==e||"infer"==e||"readonly"==e?(S.marked="keyword",O("typeof"==e?B:ft)):"variable"==t||"void"==e?(S.marked="type",O(wt)):"|"==e||"&"==e?O(ft):"string"==t||"number"==t||"atom"==t?O(wt):"["==t?O(D("]"),st(ft,"]",","),R,wt):"{"==t?O(D("}"),gt,R,wt):"("==t?O(st(bt,")"),ht,wt):"<"==t?O(st(ft,">"),ft):"quasi"==t?T(mt,wt):void 0}function ht(t){if("=>"==t)return O(ft)}function gt(t){return t.match(/[\}\)\]]/)?O():","==t||";"==t?O(gt):T(vt,gt)}function vt(t,e){return"variable"==t||"keyword"==S.style?(S.marked="property",O(vt)):"?"==e||"number"==t||"string"==t?O(vt):":"==t?O(ft):"["==t?O(H("variable"),ut,H("]"),vt):"("==t?T(It,vt):t.match(/[;\}\)\],]/)?void 0:O()}function mt(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?O(mt):O(ft,yt)}function yt(t){if("}"==t)return S.marked="string-2",S.state.tokenize=y,O(mt)}function bt(t,e){return"variable"==t&&S.stream.match(/^\s*[?:]/,!1)||"?"==e?O(bt):":"==t?O(ft):"spread"==t?O(bt):T(ft)}function wt(t,e){return"<"==e?O(D(">"),st(ft,">"),R,wt):"|"==e||"."==t||"&"==e?O(ft):"["==t?O(ft,H("]"),wt):"extends"==e||"implements"==e?(S.marked="keyword",O(ft)):"?"==e?O(ft,H(":"),ft):void 0}function _t(t,e){if("<"==e)return O(D(">"),st(ft,">"),R,wt)}function xt(){return T(ft,Ct)}function Ct(t,e){if("="==e)return O(ft)}function St(t,e){return"enum"==e?(S.marked="keyword",O(Jt)):T(Tt,ct,Et,kt)}function Tt(t,e){return u&&P(e)?(S.marked="keyword",O(Tt)):"variable"==t?(E(e),O()):"spread"==t?O(Tt):"["==t?at(At,"]"):"{"==t?at(Ot,"}"):void 0}function Ot(t,e){return"variable"!=t||S.stream.match(/^\s*:/,!1)?("variable"==t&&(S.marked="property"),"spread"==t?O(Tt):"}"==t?T():"["==t?O(U,H("]"),H(":"),Ot):O(H(":"),Tt,Et)):(E(e),O(Et))}function At(){return T(Tt,Et)}function Et(t,e){if("="==e)return O(B)}function kt(t){if(","==t)return O(St)}function Pt(t,e){if("keyword b"==t&&"else"==e)return O(D("form","else"),F,R)}function jt(t,e){return"await"==e?O(jt):"("==t?O(D(")"),Mt,R):void 0}function Mt(t){return"var"==t?O(St,Nt):"variable"==t?O(Nt):T(Nt)}function Nt(t,e){return")"==t?O():";"==t?O(Nt):"in"==e||"of"==e?(S.marked="keyword",O(U,Nt)):T(U,Nt)}function Lt(t,e){return"*"==e?(S.marked="keyword",O(Lt)):"variable"==t?(E(e),O(Lt)):"("==t?O(L,D(")"),st(Dt,")"),R,pt,F,$):u&&"<"==e?O(D(">"),st(xt,">"),R,Lt):void 0}function It(t,e){return"*"==e?(S.marked="keyword",O(It)):"variable"==t?(E(e),O(It)):"("==t?O(L,D(")"),st(Dt,")"),R,pt,$):u&&"<"==e?O(D(">"),st(xt,">"),R,It):void 0}function $t(t,e){return"keyword"==t||"variable"==t?(S.marked="type",O($t)):"<"==e?O(D(">"),st(xt,">"),R):void 0}function Dt(t,e){return"@"==e&&O(U,Dt),"spread"==t?O(Dt):u&&P(e)?(S.marked="keyword",O(Dt)):u&&"this"==t?O(ct,Et):T(Tt,ct,Et)}function Rt(t,e){return"variable"==t?Ht(t,e):Ft(t,e)}function Ht(t,e){if("variable"==t)return E(e),O(Ft)}function Ft(t,e){return"<"==e?O(D(">"),st(xt,">"),R,Ft):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(S.marked="keyword"),O(u?ft:U,Ft)):"{"==t?O(D("}"),Vt,R):void 0}function Vt(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&P(e))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",O(Vt)):"variable"==t||"keyword"==S.style?(S.marked="property",O(Ut,Vt)):"number"==t||"string"==t?O(Ut,Vt):"["==t?O(U,ct,H("]"),Ut,Vt):"*"==e?(S.marked="keyword",O(Vt)):u&&"("==t?T(It,Vt):";"==t||","==t?O(Vt):"}"==t?O():"@"==e?O(U,Vt):void 0}function Ut(t,e){if("!"==e)return O(Ut);if("?"==e)return O(Ut);if(":"==t)return O(ft,Et);if("="==e)return O(B);var n=S.state.lexical.prev;return T(n&&"interface"==n.info?It:Lt)}function Bt(t,e){return"*"==e?(S.marked="keyword",O(Yt,H(";"))):"default"==e?(S.marked="keyword",O(U,H(";"))):"{"==t?O(st(zt,"}"),Yt,H(";")):T(F)}function zt(t,e){return"as"==e?(S.marked="keyword",O(H("variable"))):"variable"==t?T(B,zt):void 0}function Wt(t){return"string"==t?O():"("==t?T(U):"."==t?T(G):T(qt,Gt,Yt)}function qt(t,e){return"{"==t?at(qt,"}"):("variable"==t&&E(e),"*"==e&&(S.marked="keyword"),O(Kt))}function Gt(t){if(","==t)return O(qt,Gt)}function Kt(t,e){if("as"==e)return S.marked="keyword",O(qt)}function Yt(t,e){if("from"==e)return S.marked="keyword",O(U)}function Xt(t){return"]"==t?O():T(st(B,"]"))}function Jt(){return T(D("form"),Tt,H("{"),D("}"),st(Zt,"}"),R,R)}function Zt(){return T(Tt,Et)}function Qt(t,e,n){return e.tokenize==v&&/^(?: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 $.lex=!0,R.lex=!0,{startState:function(t){var e={tokenize:v,lastType:"sof",cc:[],lexical:new _((t||0)-i,0,"block",!1),localVars:n.localVars,context:n.localVars&&new j(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(),b(t,e)),e.tokenize!=m&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==r?n:(e.lastType="operator"!=r||"++"!=o&&"--"!=o?r:"incdec",C(e,n,r,o,t))},indent:function(e,r){if(e.tokenize==m||e.tokenize==y)return t.Pass;if(e.tokenize!=v)return 0;var o,a=r&&r.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(r))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==R)l=l.prev;else if(u!=Pt&&u!=$)break}for(;("stat"==l.type||"form"==l.type)&&("}"==a||(o=e.cc[e.cc.length-1])&&(o==G||o==K)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;s&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var p=l.type,d=a==p;return"vardef"==p?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==p&&"{"==a?l.indented:"form"==p?l.indented+i:"stat"==p?l.indented+(function(t,e){return"operator"==t.lastType||","==t.lastType||f.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}(e,r)?s||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(r)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:a,jsonMode:l,expressionAllowed:Qt,skipExpression:function(e){C(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(237))},576:(t,e,n)=>{!function(t){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(r,o){var i,s,a=r.indentUnit,l={},c=o.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in o)l[u]=o[u];function p(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(f("atom","]]>")):null:t.match("--")?n(f("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(h(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=f("meta","?>"),"meta"):(i=t.eat("/")?"closeTag":"openTag",e.tokenize=d,"tag bracket"):"&"==r?(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,r,o=t.next();if(">"==o||"/"==o&&t.eat(">"))return e.tokenize=p,i=">"==o?"endTag":"selfcloseTag","tag bracket";if("="==o)return i="equals",null;if("<"==o){e.tokenize=p,e.state=b,e.tagName=e.tagStart=null;var s=e.tokenize(t,e);return s?s+" tag error":"tag error"}return/[\'\"]/.test(o)?(e.tokenize=(n=o,r=function(t,e){for(;!t.eol();)if(t.next()==n){e.tokenize=d;break}return"string"},r.isInAttribute=!0,r),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=p;break}n.next()}return t}}function h(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=h(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=p;break}return n.tokenize=h(t-1),n.tokenize(e,n)}}return"meta"}}function g(t){return t&&t.toLowerCase()}function v(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 y(t,e){for(var n;;){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 b(t,e,n){return"openTag"==t?(n.tagStart=e.column(),w):"closeTag"==t?_:b}function w(t,e,n){return"word"==t?(n.tagName=e.current(),s="tag",S):l.allowMissingTagName&&"endTag"==t?(s="tag bracket",S(t,0,n)):(s="error",w)}function _(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&m(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(s="tag",x):(s="tag error",C)}return l.allowMissingTagName&&"endTag"==t?(s="tag bracket",x(t,0,n)):(s="error",C)}function x(t,e,n){return"endTag"!=t?(s="error",x):(m(n),b)}function C(t,e,n){return s="error",x(t,0,n)}function S(t,e,n){if("word"==t)return s="attribute",T;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(g(r))?y(n,r):(y(n,r),n.context=new v(n,r,o==n.indented)),b}return s="error",S}function T(t,e,n){return"equals"==t?O:(l.allowMissing||(s="error"),S(t,0,n))}function O(t,e,n){return"string"==t?A:"word"==t&&l.allowUnquoted?(s="string",S):(s="error",S(t,0,n))}function A(t,e,n){return"string"==t?A:S(t,0,n)}return p.isInText=!0,{startState:function(t){var e={tokenize:p,state:b,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&&(s=null,e.state=e.state(i||n,t,e),s&&(n="error"==s?n+" error":s)),n},indent:function(e,n,r){var o=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(o&&o.noIndent)return t.Pass;if(e.tokenize!=d&&e.tokenize!=p)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var i=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(i&&i[1])for(;o;){if(o.tagName==i[2]){o=o.prev;break}if(!l.implicitlyClosed.hasOwnProperty(g(o.tagName)))break;o=o.prev}else if(i)for(;o;){var s=l.contextGrabbers[g(o.tagName)];if(!s||!s.hasOwnProperty(g(i[2])))break;o=o.prev}for(;o&&o.prev&&!o.startOfLine;)o=o.prev;return o?o.indent+a: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==O&&(t.state=S)},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(237))},578:(t,e,n)=>{n.d(e,{A:()=>s});var r=n(268),o=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(t){function e(e,n,r){var o=t.call(this,n,r)||this;return o._module=e,o}return o(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);const s=i},683:(t,e,n)=>{n.d(e,{A:()=>a,F:()=>r});var r,o=n(578),i=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){t.Select="select",t.Hover="hover",t.Spacing="spacing",t.Target="target",t.Resize="resize"}(r||(r={}));var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(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();return this.get("boxRect")||(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,r=e.height,o=e.x,i=e.y;return{width:"".concat(n,"px"),height:"".concat(r,"px"),top:"0",left:"0",position:"absolute",translate:"".concat(o,"px ").concat(i,"px")}},e.prototype.isType=function(t){return this.type===t},e}(o.A);const a=s},242:(t,e,n)=>{var r;n.d(e,{A:()=>o}),function(t){t.run="command:run",t._run="run",t.runCommand="command:run:",t._runCommand="run:",t.runBeforeCommand="command:run:before:",t.abort="command:abort:",t._abort="abort:",t.stop="command:stop",t._stop="stop",t.stopCommand="command:stop:",t._stopCommand="stop:",t.stopBeforeCommand="command:stop:before:"}(r||(r={}));const o=r},404:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){t.Components.clear(),t.Css.clear()}}},228:(t,e,n)=>{n.r(e),n.d(e,{default:()=>s});var r=n(523),o=n(14),i=n(926);const s={run:function(t){(0,r.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,r=this.em,i=this.dragger,s=t?"add":"remove";this.getCanvas().classList[s]("".concat(this.ppfx,"is__grabbing")),i||(i=new o.A({getPosition:function(){return{x:n.get("x"),y:n.get("y")}},setPosition:function(t){var e=t.x,r=t.y;n.set({x:e,y:r})},onStart:function(t,e){r.trigger("canvas:move:start",e)},onDrag:function(t,e){r.trigger("canvas:move",e)},onEnd:function(t,e){r.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",r=t?"on":"off",o={on:i.on,off:i.AU},s=this.getCanvas(),a=["".concat(e,"is__grab")];!t&&a.push("".concat(e,"is__grabbing")),a.forEach((function(t){return s.classList[n](t)})),o[r](document,"keyup",this.onKeyUp),o[r](s,"mousedown",this.enableDragger),o[r](document,"mouseup",this.disableDragger)}}},570:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l,defineCommand:()=>s});var r=n(268),o=n(242),i=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function s(t){return t}var a=function(t){function e(e){var n=t.call(this,0)||this;n.config=e||{},n.em=n.config.em||{};var r=n.config.stylePrefix;return n.pfx=r,n.ppfx=n.config.pStylePrefix,n.hoverClass="".concat(r,"hover"),n.badgeClass="".concat(r,"badge"),n.plhClass="".concat(r,"placeholder"),n.freezClass="".concat(n.ppfx,"freezed"),n.canvas=n.em.Canvas,n.init(n.config),n}return i(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(o.A.runBeforeCommand).concat(n),{options:e}),t.trigger("".concat(o.A._runCommand).concat(n,":before"),e),e.abort)return t.trigger("".concat(o.A.abort).concat(n),{options:e}),void t.trigger("".concat(o.A._abort).concat(n),e);var r=e.sender||t,i=this.run(t,r,e),s={id:n,result:i,options:e};return t.trigger("".concat(o.A.runCommand).concat(n),s),t.trigger(o.A.run,s),t.trigger("".concat(o.A._runCommand).concat(n),i,e),t.trigger(o.A._run,n,i,e),i},e.prototype.callStop=function(t,e){void 0===e&&(e={});var n=this.id,r=e.sender||t;t.trigger("".concat(o.A.stopBeforeCommand).concat(n),{options:e}),t.trigger("".concat(o.A._stopCommand).concat(n,":before"),e);var i=this.stop(t,r,e),s={id:n,result:i,options:e};return t.trigger("".concat(o.A.stopCommand).concat(n),s),t.trigger(o.A.stop,s),t.trigger("".concat(o.A._stopCommand).concat(n),i,e),t.trigger(o.A._stop,n,i,e),i},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);const l=a},377:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(523),o={run:function(t,e,n){var o=this;void 0===n&&(n={});var i=[],s=n.component||t.getSelectedAll();return(s=(0,r.isArray)(s)?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],s,!0):[s]).filter(Boolean).forEach((function(t){var e,n;if(!t.get("removable"))return o.em.logWarning("The element is not removable",{component:t});i.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(i),i}};const i=o},728:(t,e,n)=>{n.r(e),n.d(e,{default:()=>a});var r=n(523),o=n(14),i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},s="dmode";const a={run:function(t,e,n){var a=this;void 0===n&&(n={}),(0,r.bindAll)(this,"setPosition","onStart","onDrag","onEnd","getPosition","getGuidesStatic","renderGuide","getGuidesTarget");var l=n.target,c=n.event,u=n.mode,p=n.dragger,d=void 0===p?{}:p,f=l.getEl(),h=i({doc:f.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return a.guidesStatic},guidesTarget:function(){return a.guidesTarget}},d);this.setupGuides(),this.opts=n,this.editor=t,this.em=t.getModel(),this.target=l,this.isTran="translate"==u,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var g=this.dragger;return g?g.setOptions(h):(g=new o.A(h),this.dragger=g),c&&g.start(c),this.toggleDrag(1),this.em.trigger("".concat(s,":start"),this.getEventOpts()),g},getEventOpts:function(){return{mode:this.opts.mode,target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach((function(t){var e=t.guide;e&&e.parentNode.removeChild(e)})),this.guides=[]},getGuidesContainer:function(){var t=this,e=this.guidesEl;if(!e){var n=this,o=n.editor,i=n.em,s=n.opts,a=o.getConfig().stylePrefix,l=document.createElement("div"),c=document.createElement("div"),u='<div class="'.concat(a,"guide-info__line ").concat(a,'danger-bg">\n <div class="').concat(a,"guide-info__content ").concat(a,'danger-color"></div>\n </div>');(e=document.createElement("div")).className="".concat(a,"guides"),l.className="".concat(a,"guide-info ").concat(a,"guide-info__x"),c.className="".concat(a,"guide-info ").concat(a,"guide-info__y"),l.innerHTML=u,c.innerHTML=u,e.appendChild(l),e.appendChild(c),o.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=l,this.elGuideInfoY=c,this.elGuideInfoContentX=l.querySelector(".".concat(a,"guide-info__content")),this.elGuideInfoContentY=c.querySelector(".".concat(a,"guide-info__content")),i.on("canvas:update frame:scroll",(0,r.debounce)((function(){var e;t.updateGuides(),s.debug&&(null===(e=t.guides)||void 0===e||e.forEach((function(e){return t.renderGuide(e)})))}),200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),o=n.parentNode,i=void 0===o?{}:o;return(0,r.each)(i.children,(function(r){return e=e.concat(n!==r?t.getElementGuides(r):[])})),e.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,o=this;(t||this.guides).forEach((function(t){var i=t.origin,s=e===i?n:o.getElementPos(i);e=i,n=s,(0,r.each)(o.getGuidePosUpdate(t,s),(function(e,n){return t[n]=e})),t.originRect=s}))},getGuidePosUpdate:function(t,e){var n={},r=e.top,o=e.height,i=e.left,s=e.width;switch(t.type){case"t":n.y=r;break;case"b":n.y=r+o;break;case"l":n.x=i;break;case"r":n.x=i+s;break;case"x":n.x=i+s/2;break;case"y":n.y=r+o/2}return n},renderGuide:function(t){void 0===t&&(t={});var e=t.guide||document.createElement("div"),n="px",r=t.active?2:1,o=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?"green":"red",";"),e.children.length||((o=document.createElement("div")).style="position: absolute; color: red; padding: 5px; top: 0; left: 0;",e.appendChild(o)),t.y?(e.style.width="100%",e.style.height="".concat(r).concat(n),e.style.top="".concat(t.y).concat(n),e.style.left=0):(e.style.width="".concat(r).concat(n),e.style.height="100%",e.style.left="".concat(t.x).concat(n),e.style.top="0".concat(n)),!t.guide&&this.guidesContainer.appendChild(e),e},getElementPos:function(t){return this.editor.Canvas.getElementPos(t,{noScroll:1})},getElementGuides:function(t){var e=this,n=this.opts,r=this.getElementPos(t),o=r.top,s=r.height,a=r.left,l=r.width,c=[{type:"t",y:o},{type:"b",y:o+s},{type:"l",x:a},{type:"r",x:a+l},{type:"x",x:a+l/2},{type:"y",y:o+s/2}].map((function(o){return i(i({},o),{origin:t,originRect:r,guide:n.debug&&e.renderGuide(o)})}));return c.forEach((function(t){var n;return null===(n=e.guides)||void 0===n?void 0:n.push(t)})),c},getTranslate:function(t,e){void 0===e&&(e="x");var n=0;return(t||"").split(" ").forEach((function(t){var r=t.trim(),o="translate".concat(e.toUpperCase(),"(");0===r.indexOf(o)&&(n=parseFloat(r.replace(o,"")))})),n},setTranslate:function(t,e,n){var r="translate".concat(e.toUpperCase(),"("),o="".concat(r).concat(n,")"),i=(t||"").split(" ").map((function(t){return 0===t.trim().indexOf(r)&&(t=o),t})).join(" ");return i.indexOf(r)<0&&(i+=" ".concat(o)),i},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),r=n.left,o=n.top,i=n.transform,s=0,a=0;return e?(s=this.getTranslate(i),a=this.getTranslate(i,"y")):(s=parseFloat(r||0),a=parseFloat(o||0)),{x:s,y:a}},setPosition:function(t){var e=t.x,n=t.y,o=t.end,i=t.position,s=t.width,a=t.height,l=this,c=l.target,u=l.isTran,p=l.em,d=!o,f="".concat(parseInt(e,10)).concat("px"),h="".concat(parseInt(n,10)).concat("px"),g={};if(u){var v=c.getStyle().transform||"";v=this.setTranslate(v,"x",f),g={transform:v=this.setTranslate(v,"y",h),__p:d},c.addStyle(g,{avoidStore:!o})}else{var m={position:i,width:s,height:a},y={left:f,top:h,__p:d};(0,r.keys)(m).forEach((function(t){var e=m[t];e&&(y[t]=e)})),g=y,c.addStyle(g,{avoidStore:!o})}null==p||p.Styles.__emitCmpStyleUpdate(g,{components:p.getSelected()})},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this,n=e.target,r=e.editor,o=e.isTran,i=e.opts,s=i.center,a=i.onStart,l=r.Canvas,c=n.getStyle(),u="absolute",p=[u,"relative"];if(a&&a(this._getDragData()),!o&&c.position!==u){var d=l.offset(n.getEl()),f=d.left,h=d.top,g=d.width,v=d.height,m=n.parent(),y=void 0;do{var b=m.getStyle();y=p.indexOf(b.position)>=0?m:null,m=m.parent()}while(m&&!y);if(s){var w=l.getMouseRelativeCanvas(t);f=w.x,h=w.y}else if(y){var _=l.offset(y.getEl());f-=_.left,h-=_.top}this.setPosition({x:f,y:h,width:"".concat(g,"px"),height:"".concat(v,"px"),position:u})}},onDrag:function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.guidesTarget,o=this.opts,i=o.onDrag;this.updateGuides(r),o.debug&&r.forEach((function(e){return t.renderGuide(e)})),o.guidesInfo&&this.renderGuideInfo(r.filter((function(t){return t.active}))),i&&i(this._getDragData())},onEnd:function(t,e,n){void 0===n&&(n={});var r=this,o=r.editor,a=r.opts,l=r.id,c=a.onEnd;c&&c(t,n,i(i({event:t},n),this._getDragData())),o.stopCommand(l),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=[]);var n=this.guidesStatic;this.hideGuidesInfo(),t.forEach((function(t){var o=t.origin,a=t.x,l=e.getElementPos(o),c=(0,r.isUndefined)(a)?"y":"x",u="y"===c,p=l[u?"left":"top"],d=l.rect[u?"left":"top"],f=u?p+l.width:p+l.height,h=u?d+l.rect.width:d+l.rect.height,g=e["elGuideInfo".concat(c.toUpperCase())],v=e["elGuideInfoContent".concat(c.toUpperCase())],m=g.style,y=null==n?void 0:n.filter((function(e){return e.type===t.type})).map((function(t){var e=t.originRect,n=e.left,r=e.width,o=e.top,i=e.height,s=u?n+r:o+i;return{gap:s<p?p-s:(u?n:o)-f,guide:t}})).filter((function(t){return t.gap>0})).sort((function(t,e){return t.gap-e.gap})).map((function(t){return t.guide}))[0];if(y){var b=y.originRect,w=b.left,_=b.width,x=b.top,C=b.height,S=b.rect,T=u?w<l.left:x<l.top,O=u?w:x,A=u?S.left:S.top,E=u?w+_:x+C,k=u?S.left+S.width:S.top+S.height,P=u?t.y:t.x,j=T?E:f,M="".concat(P,"px"),N=T?p-E:O-f,L=T?d-k:A-h;m.display="",m[u?"top":"left"]=M,m[u?"left":"top"]="".concat(j,"px"),m[u?"width":"height"]="".concat(N,"px"),v.innerHTML="".concat(Math.round(L),"px"),e.em.trigger("".concat(s,":active"),i(i({},e.getEventOpts()),{guide:t,guidesStatic:n,matched:y,posFirst:P,posSecond:j,size:N,sizeRaw:L,elGuideInfo:g,elGuideInfoCnt:v}))}}))},toggleDrag:function(t){var e=this.ppfx,n=this.editor,r=t?"add":"remove",o=["".concat(e,"is__grabbing")],i=n.Canvas,s=i.getBody();o.forEach((function(t){return s.classList[r](t)})),i[t?"startAutoscroll":"stopAutoscroll"]()}}},462:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.components(),r=n&&n.filter((function(t){return t.get("selectable")}))[0];r&&e.push(r)})),e.length&&t.select(e)}}}},658:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t,e,n){if(void 0===n&&(n={}),t.Canvas.hasFocus()||n.force){var r=[];t.getSelectedAll().forEach((function(t){for(var e=t.parent();e&&!e.get("selectable");)e=e.parent();e&&r.push(e)})),r.length&&t.select(r)}}}},619:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,o=n.components().length,i=0,s=0;do{i++,r=(s=t.index()+i)<=o?n.getChildAt(s):null}while(r&&!r.get("selectable"));e.push(r||t)}})),e.length&&t.select(e)}}}},935:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,o=0,i=0;do{o++,r=(i=t.index()-o)>=0?n.getChildAt(i):null}while(r&&!r.get("selectable"));e.push(r||t)}})),e.length&&t.select(e)}}}},536:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(523);const o={run:function(t,e,n){void 0===n&&(n={});var o=n.target,i=[];if(!o.get("styles"))return i;var s=o.get("type"),a=t.Pages.getAllWrappers();if(!(0,r.flatten)(a.map((function(t){return t.findType(s)}))).length){var l=t.CssComposer.getAll();i=l.filter((function(t){return t.get("group")==="cmp:".concat(s)})),l.remove(i)}return i}}},957:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){var e=t.getModel(),n=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],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)}}},413:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(926);const o={run:function(t,e,n){var o=this;void 0===n&&(n={}),e&&e.set&&e.set("active",0);var i=t.getConfig(),s=t.Modal,a=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,r.a_)("div",{class:"".concat(a,"export-dl")});u.appendChild(l.el),u.appendChild(c.el),this.editors=u}s.open({title:i.textViewCode,content:this.editors}).getModel().once("change:open",(function(){return t.stopCommand("".concat(o.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 r=this.em.CodeManager,o=r.createViewer({label:n,codeName:t,theme:e});return{model:o,el:new r.EditorView({model:o,config:r.getConfig()}).render().el}}}},516:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(523);const o={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 o=n.target,i=(0,r.isElement)(o)?o:document.querySelector(o),s=this.enable(i||t.getContainer());this.fsChanged=this.fsChanged.bind(this,s),document.addEventListener(s+"fullscreenchange",this.fsChanged)},stop:function(t,e){e&&e.set&&e.set("active",!1),this.disable()}}},13:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l});var r=n(523),o=n(694),i=n(926),s=n(194),a=n(582);const l=(0,r.extend)({},a.default,s.default,{init:function(t){s.default.init.apply(this,arguments),(0,r.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];s.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,o.default)(t.target).data("model").get("draggable");e&&(this.cacheEl=null,this.startSelectPosition(t.target,this.frameEl.contentDocument),this.sorter.draggable=e,this.sorter.onEndMove=this.onEndMove.bind(this),this.stopSelectComponent(),this.$wrapper.off("mousedown",this.initSorter),(0,i.on)(this.getContentWindow(),"keydown",this.rollback))},initSorterFromModel:function(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.onEndMove=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(),r=e.getEl(null==n?void 0:n.model),o=r.ownerDocument;this.startSelectPosition(r,o,{onStart:this.onStart}),this.sorter.draggable=e.get("draggable"),this.sorter.toMove=t,this.sorter.onMoveClb=this.onDrag,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,i.on)(this.getContentWindow(),"keydown",this.rollback)},onEndMoveFromModel:function(){(0,i.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.moved=!1,this.sorter.endMove())},getBadgeEl:function(){return this.$badge||(this.$badge=(0,o.default)(this.getBadge())),this.$badge},getHighlighterEl:function(){return this.$hl||(this.$hl=(0,o.default)(this.canvas.getHighlighter())),this.$hl},stop:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];s.default.stop.apply(this,t),this.getBadgeEl().removeClass(this.badgeClass),this.getHighlighterEl().removeClass(this.hoverClass),this.$wrapper.css("cursor","").unbind().removeClass(this.noSelClass)}})},204:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(523),o=n(926);const i={open:function(t){var e=this,n=this,o=n.editor,i=n.title,s=n.config,a=n.am,l=s.custom;if((0,r.isFunction)(l.open))return l.open(a.__customData());o.Modal.open({title:i,content:t}).onceClose((function(){return o.stopCommand(e.id)}))},close:function(){var t=this.config.custom;if((0,r.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 r=t.AssetManager,i=r.getConfig(),s=n.types,a=void 0===s?[]:s,l=n.accept,c=n.select;if(this.title=n.modalTitle||t.t("assetManager.modalTitle")||"",this.editor=t,this.config=i,this.am=r,r.setTarget(n.target),r.onClick(n.onClick),r.onDblClick(n.onDblClick),r.onSelect(n.onSelect),r.__behaviour({select:c,types:a,options:n}),i.custom)this.rendered=this.rendered||(0,o.a_)("div"),this.rendered.className="".concat(i.stylePrefix,"custom-wrp"),r.__behaviour({container:this.rendered}),r.__trgCustom();else{if(!this.rendered||a){var u=r.getAll().filter((function(t){return t}));a&&a.length&&(u=u.filter((function(t){return-1!==a.indexOf(t.get("type"))}))),r.render(u),this.rendered=r.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)}}},195:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(523),o=n(926);const i={open:function(){var t=this,e=t.container,n=t.editor,o=t.bm,i=t.config,s=i.custom,a=i.appendTo;if((0,r.isFunction)(s.open))return s.open(o.__customData());if(this.firstRender&&!a){var l="views-container",c=n.Panels;(c.getPanel(l)||c.addPanel({id:l})).set("appendContent",e).trigger("change:appendContent"),s||e.appendChild(o.render())}e&&(e.style.display="block")},close:function(){var t=this.container,e=this.config.custom;if((0,r.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,o.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()}}},671:(t,e,n)=>{n.r(e),n.d(e,{default:()=>r});const r={run:function(t){var e=t.LayerManager,n=t.Panels,r=e.getConfig();if(!r.appendTo){if(!this.layers){var o="views-container",i=document.createElement("div"),s=n.getPanel(o)||n.addPanel({id:o});r.custom?e.__trgCustom({container:i}):i.appendChild(e.render()),s.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")}}},49:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(694);const o={run:function(t,e){if(this.sender=e,!this.$cnt){var n=t.getConfig(),o=t.Panels,i=t.DeviceManager,s=t.SelectorManager,a=t.StyleManager,l="change:appendContent",c=(0,r.default)("<div></div>"),u=(0,r.default)("<div></div>"),p=(0,r.default)("<div></div>"),d=(0,r.default)("<div></div>");if(this.$cnt=c,this.$cntInner=u,u.append(p),u.append(d),c.append(u),i&&n.showDevices){var f=o.addPanel({id:"devices-c"}),h=i.render();f.set("appendContent",h).trigger(l)}var g=s.getConfig();g.custom?s.__trgCustom({container:p.get(0)}):g.appendTo||p.append(s.render([])),this.sm=a;var v=a.getConfig(),m=v.stylePrefix;this.$header=(0,r.default)('<div class="'.concat(m,'header">').concat(t.t("styleManager.empty"),"</div>")),c.append(this.$header),v.custom?a.__trgCustom({container:d.get(0)}):v.appendTo||d.append(a.render());var y="views-container";(o.getPanel(y)||o.addPanel({id:y})).set("appendContent",c).trigger(l);var b=t.getModel();this.listenTo(b,a.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this,e=t.sender,n=t.sm,r=t.$cntInner,o=t.$header;e&&e.get&&!e.get("active")||!n||(n.getSelected()?(null==r||r.show(),null==o||o.hide()):(null==r||r.hide(),null==o||o.show()))},stop:function(){var t,e;null===(t=this.$cntInner)||void 0===t||t.hide(),null===(e=this.$header)||void 0===e||e.hide()}}},590:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(694);const o={run:function(t,e){this.sender=e;var n,o=t.getModel(),i=t.Config.stylePrefix,s=t.TraitManager,a=s.getConfig();if(!a.appendTo){if(!this.$cn){this.$cn=(0,r.default)("<div></div>"),this.$cn2=(0,r.default)("<div></div>"),this.$cn.append(this.$cn2),this.$header=(0,r.default)("<div>").append('<div class="'.concat(a.stylePrefix,'header">').concat(o.t("traitManager.empty"),"</div>")),this.$cn.append(this.$header),a.custom?s.__trgCustom({container:this.$cn2.get(0)}):(this.$cn2.append('<div class="'.concat(i,'traits-label">').concat(o.t("traitManager.label"),"</div>")),this.$cn2.append(s.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()}}},483:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(523);const o={run:function(t,e,n){void 0===n&&(n={});var o=t.getModel(),s=o.get("clipboard"),a=t.getSelected();(null==s?void 0:s.length)&&a&&(t.getSelectedAll().forEach((function(e){var a,l,c,u,p=(null===(l=null===(a=e.delegate)||void 0===a?void 0:a.copy)||void 0===l?void 0:l.call(a,e))||e,d=p.collection;if(d){var f={at:p.index()+1,action:n.action||"paste-component"};u=(0,r.contains)(s,p)&&p.get("copyable")?d.add(p.clone(),f):i(t,s,p.parent(),f)}else{var h=null===(c=o.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,s,h,f)}(u=(0,r.isArray)(u)?u:[u]).forEach((function(e){return t.trigger("component:paste",e)}))})),a.emitUpdate())}};function i(t,e,n,r){var o=e.filter((function(t){return t.get("copyable")})).filter((function(e){return t.Components.canMove(n,e).result}));return n.components().add(o.map((function(t){return t.clone()})),r)}},857:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(523),o="core:component-outline";const i={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 o=e.Canvas,i=o.getBody(),s=o.getToolbarEl();s&&(s.style.display=t?"none":"");var a=i.querySelectorAll(".".concat(this.ppfx,"no-pointer"));(0,r.each)(a,(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=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],t.getSelectedAll(),!0),t.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=t.Commands.isActive(o)),this.shouldRunSwVisibility&&t.stopCommand(o),t.getModel().stopDefault();var r=this.getPanels(t),i=t.Canvas.getElement(),s=t.getEl(),a=t.Config.stylePrefix;if(!this.helper){var l=document.createElement("span");l.className="".concat(a,"off-prv fa fa-eye-slash"),s.appendChild(l),l.onclick=function(){return n.stopCommand()},this.helper=l}this.helper.style.display="inline-block",r.forEach((function(t){return t.set("visible",!1)}));var c=i.style;c.width="100%",c.height="100%",c.top="0",c.left="0",c.padding="0",c.margin="0",t.refresh(),this.tglEffects(1)},stop:function(t){var e=this.sender,n=void 0===e?{}:e,r=this.selected;n.set&&n.set("active",0);var i=this.getPanels(t);this.shouldRunSwVisibility&&(t.runCommand(o),this.shouldRunSwVisibility=!1),t.getModel().runDefault(),i.forEach((function(t){return t.set("visible",!0)})),t.Canvas.getElement().setAttribute("style",""),r&&t.select(r),delete this.selected,this.helper&&(this.helper.style.display="none"),t.refresh(),this.tglEffects()}}},869:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};const o={run:function(t,e,n){var o=n||{},i=t.Canvas,s=i.getCanvasView(),a=r({appendTo:i.getResizerEl(),prefix:t.getConfig().stylePrefix,posFetcher:s.getElementPos.bind(s),mousePosFetcher:i.getMouseRelativePos.bind(i)},o.options||{}),l=this.canvasResizer;return l&&!o.forceNew||(this.canvasResizer=new t.Utils.Resizer(a),l=this.canvasResizer),l.setOptions(a,!0),l.blur(),l.focus(o.el),l},stop:function(){var t;null===(t=this.canvasResizer)||void 0===t||t.blur()}}},194:(t,e,n)=>{n.r(e),n.d(e,{default:()=>S});var r=n(523),o=n(268),i=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.defaults=function(){return{command:"",attributes:{}}},e}(o.Kx);var a=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(o.pM);const c=l;l.prototype.model=s;var u=n(754),p=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=function(){return d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},d.apply(this,arguments)},f=function(t){function e(e){var n=t.call(this,e)||this;return n.em=e.config.em,n}return p(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(),r=n.left,o=n.top,i=d(d({},t),{clientX:t.clientX-r,clientY:t.clientY-o});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,r=t.model,o=r.get("id"),i=r.get("label"),s=e.getConfig().stylePrefix;return n.addClass("".concat(s,"toolbar-item")),o&&n.addClass("".concat(s,"toolbar-item__").concat(o)),i&&n.append(i),this},e}(o.Ss);const h=f;var g=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e){var n=t.call(this,e)||this,r=e.em;return n.em=r,n.config={em:r},n.listenTo(n.collection,"reset",n.render),n}return g(e,t),e.prototype.onRender=function(){var t=this.em.config.stylePrefix;this.el.className="".concat(t,"toolbar-items")},e}(u.A);const m=v;v.prototype.itemView=h;var y,b=n(926),w=n(342),_=n(683),x=n(249),C=function(){return C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);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","onFrameScroll","onFrameResize","onFrameUpdated","onContainerChange")},enable:function(){this.frameOff=this.canvasOff=this.adjScroll=null,this.startSelectComponent(),y=!0},startSelectComponent:function(){this.toggleSelectComponent(1),this.em.getSelected()&&this.onSelect()},stopSelectComponent:function(){this.toggleSelectComponent()},toggleSelectComponent:function(t){var e=this,n=this.em,r=n.getConfig().listenToEl,o=n.getContainer().parentNode,i=t?"on":"off",s={on:b.on,off:b.AU},a=x.I.update;!r.length&&o&&r.push(o),s[i](window,"resize",this.onFrameUpdated),s[i](r,"scroll",this.onContainerChange),n[i]("component:toggled ".concat(a," undo redo"),this.onSelect,this),n[i]("change:componentHovered",this.onHovered,this),n[i]("component:resize styleable:change component:input",this.updateGlobalPos,this),n[i]("".concat(a,":toolbar"),this._upToolbar,this),n[i]("frame:updated",this.onFrameUpdated,this),n[i]("canvas:updateTools",this.onFrameUpdated,this),n[i](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){s[i](n,"mouseover",e.onHover),s[i](n,"mouseleave",e.onOut),s[i](n,"click",e.onClick),s[i](t,"scroll",e.onFrameScroll,!0),s[i](t,"resize",e.onFrameResize)}(r,null==n?void 0:n.getBody())}))},onHover:function(t){t.stopPropagation();var e=this.em,n=t.target,r=(0,w.getComponentView)(n),o=null==r?void 0:r.frameView,i=null==r?void 0:r.model;if(!i)for(var s=n.parentNode;!i&&s&&!(0,b.ZQ)(s);)i=(0,w.getComponentModel)(s),s=s.parentNode;this.currentDoc=n.ownerDocument,e.setHovered(i,{useValid:!0}),o&&e.setCurrentFrame(o)},onFrameUpdated:function(){this.updateLocalPos(),this.updateGlobalPos()},onHovered:function(t,e){var n,r=this,o={};e?null===(n=e.views)||void 0===n||n.forEach((function(t){var n=t.el,i=r.getElementPos(n);o={el:n,pos:i,component:e,view:(0,w.getViewEl)(n)},n.ownerDocument===r.currentDoc&&(r.elHovered=o),r.updateToolsLocal(o)})):(this.currentDoc=null,this.elHovered=0,this.updateToolsLocal(),this.canvas.getFrames().forEach((function(t){var e=t.view,n=e&&e.getToolsEl();n&&r.toggleToolsEl(0,0,{el:n})})))},onSelect:function(){var t=this.em,e=t.getSelected(),n=t.getCurrentFrame(),r=e&&e.getView(null==n?void 0:n.model),o=r&&r.el,i={};o&&(0,b.zN)(o)&&(i={el:o,pos:this.getElementPos(o),component:e,view:(0,w.getViewEl)(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 r=n.el||this.canvas.getToolsEl(e);return r&&(r.style.display=t?"":"none"),r||{}},showElementOffset:function(t,e,n){void 0===n&&(n={}),y&&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,r=(0,w.getComponentModel)(n);if(!r)for(var o=n.parentNode;!r&&o&&!(0,b.ZQ)(o);)r=(0,w.getComponentModel)(o),o=o.parentNode;if(r){if(e.isEditing()&&(!r.get("textable")&&r.isChildOf("text")||e.getEditing()!==r))return;this.select(r,t)}},select:function(t,e){void 0===e&&(e={}),t&&(this.editor.select(t,{event:e,useValid:!0}),this.initResize(t))},updateBadge:function(t,e,n){void 0===n&&(n={});var r=this.canvas,o=(0,w.getComponentModel)(t),i=this.getBadge(n),s=i.style;if(o&&o.get("badgable")){if(!n.posOnly){var a=this.canvas.getConfig(),l=o.getIcon(),c=a.pStylePrefix||"",u="".concat(c,"badge"),p=a.customBadgeLabel,d="".concat(l?'<div class="'.concat(u,'__icon">').concat(l,"</div>"):"",'\n <div class="').concat(u,'__name">').concat(o.getName(),"</div>");i.innerHTML=p?p(o):d}s.display="block";var f=r.getTargetToElementFixed(t,i,{pos:e}).top,h=n.leftOff<0?-n.leftOff:0;s.top=f+"px",s.left=h+"px"}else s.display="none"},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=""},initResize:function(t){var e=this.em,n=this.canvas,o=e.Editor,i=!(0,r.isElement)(t)&&(0,b.GW)(t)?t:e.getSelected(),s=null==i?void 0:i.get("resizable"),a=_.F.Resize,l=n.hasCustomSpot(a);if(n.removeSpots({type:a}),i&&s){n.addSpot({type:a,component:i});var c,u=(0,r.isElement)(t)?t:i.getEl(),p=(0,w.isObject)(s)?s:{},d=p.onStart,f=void 0===d?function(){}:d,h=p.onMove,g=void 0===h?function(){}:h,v=p.onEnd,m=void 0===v?function(){}:v,x=p.updateTarget,S=void 0===x?function(){}:x,T=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(p,["onStart","onMove","onEnd","updateTarget"]);if(l||!u||this.activeResizer)return;var O=e.config.stylePrefix||"",A="".concat(O,"resizing"),E=this,k={component:i,el:u},P=function(t,e,n){var r=n.docs;r&&r.forEach((function(e){var n=e.body,r=n.className||"";n.className=("add"==t?"".concat(r," ").concat(A):r.replace(A,"")).trim()}))},j=C({onStart:function(t,r){f(t,r);var s=r.el,a=r.config,l=r.resizer,u=a.keyHeight,p=a.keyWidth,d=a.currentUnit,h=a.keepAutoHeight,g=a.keepAutoWidth;P("add",0,r),c=e.Styles.getModelToStyle(i),n.toggleFramesEvents(!1);var v=getComputedStyle(s),m=c.getStyle(),b=m[p];a.autoWidth=g&&"auto"===b,isNaN(parseFloat(b))&&(b=v[p]);var _=m[u];a.autoHeight=h&&"auto"===_,isNaN(parseFloat(_))&&(_=v[u]),l.startDim.w=parseFloat(b),l.startDim.h=parseFloat(_),y=!1,d&&(a.unitHeight=(0,w.getUnitFromValue)(_),a.unitWidth=(0,w.getUnitFromValue)(b)),E.activeResizer=!0,o.trigger("component:resize",C(C({},k),{type:"start"}))},onMove:function(t){g(t),o.trigger("component:resize",C(C({},k),{type:"move"}))},onEnd:function(t,e){m(t,e),P("remove",0,e),o.trigger("component:resize",C(C({},k),{type:"end"})),n.toggleFramesEvents(!0),y=!0,E.activeResizer=!1},updateTarget:function(t,r,o){if(S(t,r,o),c){var s=o.store,a=o.selectedHandler,l=o.config,u=l.keyHeight,p=l.keyWidth,d=l.autoHeight,f=l.autoWidth,h=l.unitWidth,g=l.unitHeight,v=["tc","bc"].indexOf(a)>=0,m=["cl","cr"].indexOf(a)>=0,y={};if(!v){var b=n.getBody().offsetWidth,w=r.w<b?r.w:b;y[p]=f?"auto":"".concat(w).concat(h)}m||(y[u]=d?"auto":"".concat(r.h).concat(g)),e.getDragMode(i)&&(y.top="".concat(r.t).concat(g),y.left="".concat(r.l).concat(h));var _=C(C({},y),{__p:!s});c.addStyle(_,{avoidStore:!s}),e.Styles.__emitCmpStyleUpdate(_,{components:e.getSelected()})}}},T);this.resizer=o.runCommand("resize",{el:u,options:j,force:1})}else{if(l)return;o.stopCommand("resize"),this.resizer=null}},updateToolbar:function(t){var e=this.canvas,n=this.config.em,r=t===n?n.getSelected():t,o=e.getToolbarEl(),i=o.style,s=r.get("toolbar"),a=n.config.showToolbar,l=!e.hasCustomSpot(_.F.Select);if(r&&a&&s&&s.length&&l){if(i.display="",!this.toolbar){o.innerHTML="",this.toolbar=new c(s);var u=new m({collection:this.toolbar,em:n});o.appendChild(u.render().el)}this.toolbar.reset(s),i.top="-100px",i.left="0"}else i.display="none"},updateToolbarPos:function(t){var e=this.canvas.getToolbarEl().style;e.top="".concat(t.top).concat("px"),e.left="".concat(t.left).concat("px"),e.opacity=""},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},getBadge:function(t){return void 0===t&&(t={}),this.canvas.getBadgeEl(t.view)},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(),r=n.el,o=n.pos,i=n.view,s=n.component;if(r){var a=s.get("hoverable"),l=this.lastHovered!==r,c=l?{}:{posOnly:1},u=this.canvas.hasCustomSpot(_.F.Hover);l&&a&&(this.lastHovered=r,u?this.hideHighlighter(i):this.showHighlighter(i),this.showElementOffset(r,o,{view:i})),this.isCompSelected(s)&&(this.hideHighlighter(i),!e.showOffsetsSelected&&this.hideElementOffset(i));var p="px",d=this.toggleToolsEl(1,i),f=d.style,h=this.canvas.canvasRectOffset(r,o),g=h.top,v=h.left;!u&&this.updateBadge(r,o,C(C({},c),{view:i,topOff:g,leftOff:v})),f.top=g+p,f.left=v+p,f.width=o.width+p,f.height=o.height+p,this._trgToolUp("local",{component:s,el:d,top:g,left:v,width:o.width,height:o.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,r=e.pos,o=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(o));var s="px",a=this.toggleToolsEl(1),l=a.style,c=i.getTargetToElementFixed(n,i.getToolbarEl(),{pos:r}),u=c.canvasOffsetTop,p=c.canvasOffsetLeft;l.top=u+s,l.left=p+s,l.width=r.width+s,l.height=r.height+s,this.updateToolbarPos({top:c.top,left:c.left}),this._trgToolUp("global",{component:o,el:a,top:u,left:p,width:r.width,height:r.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,w.hasWin)()&&(this.editor=t&&t.get("Editor"),this.enable())},stop:function(t,e,n){if(void 0===n&&(n={}),(0,w.hasWin)()){var r=this.em,o=this.editor;this.onHovered(),this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(),this.toggleToolsEl(),o&&o.stopCommand("resize")}}}},582:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var r=n(694);const o={startSelectPosition:function(t,e,n){var r=this;void 0===n&&(n={}),this.isPointed=!1;var o=this.em.Utils,i=t.ownerDocument.body;o&&!this.sorter&&(this.sorter=new o.Sorter({container:i,placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:e,wmargin:1,nested:1,em:this.em,canvasRelative:1,scale:function(){return r.em.getZoomDecimal()}})),n.onStart&&(this.sorter.onStart=n.onStart),t&&this.sorter.startSort(t,{container:i})},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.moved=0,this.sorter.endMove()),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&"after"==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?(0,r.default)(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?(0,r.default)(this.cDim[this.posIndex][5]).parent():(0,r.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 r=t||0,o=e||"before",i=n.length,s=0!==i&&"after"==o&&r==i;return 0!==i&&(!s&&!n[r][4]||n[r-1]&&!n[r-1][4]||s&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}},131:(t,e,n)=>{n.r(e),n.d(e,{default:()=>a});var r=n(523),o=n(683),i=n(694),s=function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},s.apply(this,arguments)};const a={getOffsetMethod:function(t){return"get"+(t||"")+"OffsetViewerEl"},run:function(t,e,n){var a=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(!a.hasCustomSpot(o.F.Spacing)){var f=s({},l.elPos||a.getElementPos(d));(0,r.isUndefined)(l.top)||(f.top=l.top),(0,r.isUndefined)(l.left)||(f.left=l.left);var h=window.getComputedStyle(d),g=this.ppfx,v=c+"State",m=a[this.getOffsetMethod(c)](n.view);m.style.opacity="";var y=this["marginT"+c],b=this["marginB"+c],w=this["marginL"+c],_=this["marginR"+c],x=this["padT"+c],C=this["padB"+c],S=this["padL"+c],T=this["padR"+c];if(m.childNodes.length&&(this[v]="1",y=m.querySelector("[data-offset-m-t]"),b=m.querySelector("[data-offset-m-b]"),w=m.querySelector("[data-offset-m-l]"),_=m.querySelector("[data-offset-m-r]"),x=m.querySelector("[data-offset-p-t]"),C=m.querySelector("[data-offset-p-b]"),S=m.querySelector("[data-offset-p-l]"),T=m.querySelector("[data-offset-p-r]")),!this[v]){var O=c.toLowerCase(),A=O+"margin-v",E=O+"padding-v",k=(0,i.default)('<div class="'.concat(g,'marginName">')).get(0),P=(0,i.default)('<div class="'.concat(g,'paddingName">')).get(0),j=g+E+"-el",M="".concat(g+A+"-el"," ").concat(g+A),N="".concat(j," ").concat(g+E);y=(0,i.default)('<div class="'.concat(M,'-top"></div>')).get(0),b=(0,i.default)('<div class="'.concat(M,'-bottom"></div>')).get(0),w=(0,i.default)('<div class="'.concat(M,'-left"></div>')).get(0),_=(0,i.default)('<div class="'.concat(M,'-right"></div>')).get(0),x=(0,i.default)('<div class="'.concat(N,'-top"></div>')).get(0),C=(0,i.default)('<div class="'.concat(N,'-bottom"></div>')).get(0),S=(0,i.default)('<div class="'.concat(N,'-left"></div>')).get(0),T=(0,i.default)('<div class="'.concat(N,'-right"></div>')).get(0),this["marginT"+c]=y,this["marginB"+c]=b,this["marginL"+c]=w,this["marginR"+c]=_,this["padT"+c]=x,this["padB"+c]=C,this["padL"+c]=S,this["padR"+c]=T,k.appendChild(y),k.appendChild(b),k.appendChild(w),k.appendChild(_),P.appendChild(x),P.appendChild(C),P.appendChild(S),P.appendChild(T),m.appendChild(k),m.appendChild(P),this[v]="1"}var L="px",I=parseFloat(h.marginLeft.replace(L,""))*p,$=parseFloat(h.marginRight.replace(L,""))*p,D=parseFloat(h.marginTop.replace(L,""))*p,R=parseFloat(h.marginBottom.replace(L,""))*p,H=y.style,F=b.style,V=w.style,U=_.style,B=x.style,z=C.style,W=S.style,q=T.style,G=parseFloat(f.left),K=parseFloat(h.width)*p+L;H.height=D+L,H.width=K,H.top=f.top-D+L,H.left=G+L,F.height=R+L,F.width=K,F.top=f.top+f.height+L,F.left=G+L;var Y=f.height+D+R+L,X=f.top-D+L;V.height=Y,V.width=I+L,V.top=X,V.left=G-I+L,U.height=Y,U.width=$+L,U.top=X,U.left=G+f.width+L;var J=parseFloat(h.paddingTop)*p;B.height=J+L;var Z=parseFloat(h.paddingBottom)*p;z.height=Z+L;var Q=f.height-Z-J+L,tt=f.top+J+L;W.height=Q,W.width=parseFloat(h.paddingLeft)*p+L,W.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 r=(n||{}).state||"",o=this.getOffsetMethod(r),i=n.view;this.canvas[o](i).style.opacity=0}}},229:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var r=n(523),o=n(342);const i={init:function(){(0,r.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,r=e?"on":"off";n.getModel()[r]("change:frames",this._onFramesChange),this.handleFrames(n.getFrames(),e)}},handleFrames:function(t,e){var n=this;t.forEach((function(t){var r;(null===(r=t.view)||void 0===r?void 0:r.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,r=this,i=r.ppfx,s=r.em,a=r.id,l=((0,o.isDef)(e)?e:s.Commands.isActive(a))?"add":"remove",c="".concat(i,"dashed");null===(n=t.view)||void 0===n||n.getBody().classList[l](c)}}},268:(t,e,n)=>{n.d(e,{Kx:()=>l,Ss:()=>u,lK:()=>p,pM:()=>c,x2:()=>r});var r,o=n(391),i=n.n(o),s=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)},l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(i().Model),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(i().Collection),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(i().View);!function(t){t.Screen="screen",t.World="world"}(r||(r={}));var p={x:0,y:0};a(a({},p),{width:0,height:0})},249:(t,e,n)=>{var r,o;n.d(e,{I:()=>o,t:()=>r}),function(t){t.remove="component:remove",t.add="component:add",t.move="component:move"}(r||(r={})),function(t){t.add="component:add",t.remove="component:remove",t.removeBefore="component:remove:before",t.create="component:create",t.update="component:update",t.updateInside="component:update-inside",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"}(o||(o={}))},754:(t,e,n)=>{n.d(e,{A:()=>a});var r=n(523),o=n(268),i=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),s=function(t){function e(e,n,r){void 0===e&&(e={}),void 0===r&&(r=!1);var o=t.call(this,e)||this;return o.itemsView="",o.itemType="type",o.reuseView=!1,o.config=n||e.config||{},r&&o.listenTo(o.collection,"add",o.addTo),o.items=[],o}return i(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){var e=this.config,n=this.ns,r=e.em,o="".concat(n?"[".concat(n,"]: "):"","'").concat(t,"' type not found");r&&r.logWarning(o)},e.prototype.add=function(t,e){var n,o=this,i=o.config,s=o.reuseView,a=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&&s?t.view:new u({model:t,config:i},i),a&&a.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}(o.Ss);const a=s;s.prototype.itemView=""},14:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(523),o=n(926),i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},s=["x","y"],a=function(){function t(t){return void 0===t&&(t={}),this.opts={snapOffset:5,scale:1},(0,r.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(),r=this.getWindowEl(),i=t?"on":"off",s={on:o.on,off:o.AU};s[i](n,"mousemove dragover",this.drag),s[i](e,"mouseup dragend touchend",this.stop),s[i](e,"keydown",this.keyHandle),s[i](r,"scroll",this.handleScroll)},t.prototype.handleScroll=function(){var t=this.lastScroll,e=this.delta,n=this.getScrollInfo(),r={x:n.x-t.x,y:n.y-t.y};this.move(e.x+r.x,e.y+r.y),this.lastScrollDiff=r},t.prototype.start=function(t){var e=this.opts,n=e.onStart;this.toggleDrag(!0),this.startPointer=this.getPointerPos(t),this.guidesStatic=(0,r.result)(e,"guidesStatic")||[],this.guidesTarget=(0,r.result)(e,"guidesTarget")||[],(0,r.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,o=n.opts,a=n.lastScrollDiff,l=n.globScrollDiff,c=o.onDrag,u=this.startPointer,p=this.getPointerPos(t),d={x:l.x+a.x,y:l.y+a.y};this.globScrollDiff=d;var f={x:p.x-u.x+d.x,y:p.y-u.y+d.y};this.lastScrollDiff={x:0,y:0};var h=this.lockedAxis;"x"===(h=t.shiftKey?!h&&this.detectAxisLock(f.x,f.y):null)?f.x=u.x:"y"===h&&(f.y=u.y);var g=function(n){s.forEach((function(t){return n[t]=n[t]*(0,r.result)(o,"scale")})),e.delta=n,e.move(n.x,n.y),(0,r.isFunction)(c)&&c(t,e)},v=i({},f);if(this.currentPointer=p,this.lockedAxis=h,this.lastScroll=this.getScrollInfo(),g(f),this.guidesTarget.length){var m=this.snapGuides(v),y=m.newDelta,b=m.trgX,w=m.trgY;(b||w)&&g(y)}0===t.which&&this.stop(t)},t.prototype.snapGuides=function(t){var e=this,n=t,o=this.trgX,i=this.trgY;return this.guidesTarget.forEach((function(n){n.x&&e.trgX||n.y&&e.trgY||(n.active=!1,e.guidesStatic.forEach((function(s){if(!(n.y&&s.x||n.x&&s.y)){var a=n.y&&s.y,l=a?"y":"x",c=n[l],u=s[l],p=t[l],d=a?i:o;if(e.isPointIn(c,u)&&(0,r.isUndefined)(d)){var f=p-(c-u);e.setGuideLock(n,f)}}})))})),o=this.trgX,i=this.trgY,s.forEach((function(o){var i=o.toUpperCase(),s=e["trg".concat(i)];s&&!e.isPointIn(t[o],s.lock)&&(e.setGuideLock(s,null),s=null),s&&!(0,r.isUndefined)(s.lock)&&(n[o]=s.lock)})),{newDelta:n,trgX:this.trgX,trgY:this.trgY}},t.prototype.isPointIn=function(t,e,n){var r=(void 0===n?{}:n).offset||this.opts.snapOffset||0;return t>=e&&t<=e+r||t<=e&&t>=e-r},t.prototype.setGuideLock=function(t,e){var n=(0,r.isUndefined)(t.x)?"Y":"X",o="trg".concat(n);return null!==e?(t.active=!0,t.lock=e,this[o]=t):(delete t.active,delete t.lock,delete this[o]),t},t.prototype.stop=function(t,e){void 0===e&&(e={});var n=this.delta,o=!!e.cancel,i=o?0:n.x,s=o?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,s,!0);var a=this.opts.onEnd;(0,r.isFunction)(a)&&a(t,this,{cancelled:o})},t.prototype.keyHandle=function(t){(0,o.v$)(t)&&this.stop(t,{cancel:!0})},t.prototype.move=function(t,e,n){var o=this.el,i=this.opts,s=this.startPosition;if(s){var a=i.setPosition,l=s.x+t,c=s.y+e;this.position={x:l,y:c,end:n},(0,r.isFunction)(a)&&a(this.position),o&&(o.style.left="".concat(l,"px"),o.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,o.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,r.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,r=e,o=Math.abs(n),i=Math.abs(r);return r>=o||r<=-o?"x":n>i||n<-i?"y":void 0},t}();const l=a},694:(t,e,n)=>{n.r(e),n.d(e,{default:()=>gt});var r="undefined"!=typeof document?document:null,o="undefined"!=typeof window?window:null,i=Array.prototype,s=i.filter,a=i.indexOf,l=i.map,c=i.push,u=i.reverse,p=i.slice,d=i.splice,f=/^#[\w-]*$/,h=/^\.[\w-]*$/,g=/<.+>/,v=/^\w+$/;function m(t,e){return void 0===e&&(e=r),h.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function y(t,e){if(void 0===e&&(e=r),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)):g.test(t)?dt(t):m(t,e)))return}else if(A(t))return this.ready(t);(n.nodeType||n===o)&&(n=[n]),this.length=n.length;for(var i=0,s=this.length;i<s;i++)this[i]=n[i]}}function b(t,e){return new y(t,e)}var w=b.fn=b.prototype=y.prototype={constructor:b,__cash:!0,length:0,splice:d};w.get=function(t){return void 0===t?p.call(this):this[t<0?t+this.length:t]},w.eq=function(t){return b(this.get(t))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)},w.map=function(t){return b(l.call(this,(function(e,n){return t.call(e,n,e)})))},w.slice=function(){return b(p.apply(this,arguments))};var _=/(?:^\w|[A-Z]|\b\w)/g,x=/[\s-_]+/g;function C(t){return t.replace(_,(function(t,e){return t[e?"toUpperCase":"toLowerCase"]()})).replace(x,"")}function S(t,e){for(var n=0,r=t.length;n<r&&!1!==e.call(t[n],t[n],n,t);n++);}b.camelCase=C,b.each=S,w.each=function(t){return S(this,(function(e,n){return t.call(e,n,e)})),this},w.removeProp=function(t){return this.each((function(e,n){delete n[t]}))},b.extend=w.extend=function(t){void 0===t&&(t=this);for(var e=arguments,n=e.length,r=n<2?0:1;r<n;r++)for(var o in e[r])t[o]=e[r][o];return t};var T=1;function O(t,e){var n=t&&(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector);return!!n&&n.call(t,e)}function A(t){return"function"==typeof t}function E(t){return"string"==typeof t}function k(t){return!isNaN(parseFloat(t))&&isFinite(t)}b.guid=T,b.matches=O,b.isFunction=A,b.isString=E,b.isNumeric=k;var P=Array.isArray;function j(t){return E(t)?function(e,n){return O(n,t)}:t.__cash?function(e,n){return t.is(n)}:function(t,e,n){return e===n}}b.isArray=P,w.prop=function(t,e){if(t){if(E(t))return arguments.length<2?this[0]&&this[0][t]:this.each((function(n,r){r[t]=e}));for(var n in t)this.prop(n,t[n]);return this}},w.filter=function(t){if(!t)return b();var e=A(t)?t:j(t);return b(s.call(this,(function(n,r){return e.call(n,r,n,t)})))};var M=/\S+/g;function N(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 r=o.getComputedStyle(t,null);return e?n?r.getPropertyValue(e):r[e]:r}}function $(t,e){return parseInt(I(t,e),10)||0}w.hasClass=function(t){var e=N(t),n=!1;return e.length&&this.each((function(t,r){return!(n=r.classList.contains(e[0]))})),n},w.removeAttr=function(t){var e=N(t);return e.length?this.each((function(t,n){S(e,(function(t){n.removeAttribute(t)}))})):this},w.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,r){r.setAttribute(t,e)}))}for(var r in t)this.attr(r,t[r]);return this}},w.toggleClass=function(t,e){var n=N(t),r=void 0!==e;return n.length?this.each((function(t,o){S(n,(function(t){r?e?o.classList.add(t):o.classList.remove(t):o.classList.toggle(t)}))})):this},w.addClass=function(t){return this.toggleClass(t,!0)},w.removeClass=function(t){return arguments.length?this.toggleClass(t,!1):this.attr("class","")},b.unique=L,w.add=function(t,e){return b(L(this.get().concat(b(t,e).get())))};var D=/^--/;function R(t){return D.test(t)}var H={},F=r&&r.createElement("div"),V=F?F.style:{},U=["webkit","moz","ms","o"];function B(t,e){if(void 0===e&&(e=R(t)),e)return t;if(!H[t]){var n=C(t),r=""+n.charAt(0).toUpperCase()+n.slice(1);S((n+" "+U.join(r+" ")+r).split(" "),(function(e){if(e in V)return H[t]=e,!1}))}return H[t]}b.prefixedProp=B;var z={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function W(t,e,n){return void 0===n&&(n=R(t)),n||z[t]||!k(e)?e:e+"px"}w.css=function(t,e){if(E(t)){var n=R(t);return t=B(t,n),arguments.length<2?this[0]&&I(this[0],t,n):t?(e=W(t,e,n),this.each((function(r,o){1===o.nodeType&&(n?o.style.setProperty(t,e):o.style[t]=e)}))):this}for(var r in t)this.css(r,t[r]);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 r=t.dataset?t.dataset[e]||t.dataset[C(e)]:b(t).attr("data-"+e);if(void 0!==r){try{r=JSON.parse(r)}catch(t){}n[e]=r}}return n[e]}return n}function X(t,e){return $(t,"border"+(e?"Left":"Top")+"Width")+$(t,"padding"+(e?"Left":"Top"))+$(t,"padding"+(e?"Right":"Bottom"))+$(t,"border"+(e?"Right":"Bottom")+"Width")}function J(t,e){for(var n=0,r=e.length;n<r;n++)if(t.indexOf(e[n])<0)return!1;return!0}function Z(t,e,n){S(t[n],(function(t){t[0];var r=t[1];e.removeEventListener(n,r)})),delete t[n]}b.hasData=function(t){return q in t},w.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,r){return function(t,e,n){K(t)[e]=n}(r,t,e)}));for(var r in t)this.data(r,t[r]);return this},w.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){w["inner"+t]=function(){if(this[0])return this[0]===o?o["inner"+t]:this[0]["client"+t]}})),S(["width","height"],(function(t,e){w[t]=function(n){return this[0]?arguments.length?(n=parseInt(n,10),this.each((function(r,o){if(1===o.nodeType){var i=I(o,"boxSizing");o.style[t]=W(t,n+("border-box"===i?X(o,!e):0))}}))):this[0]===o?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){w["outer"+t]=function(n){if(this[0])return this[0]===o?o["outer"+t]:this[0]["offset"+t]+(n?$(this[0],"margin"+(e?"Top":"Left"))+$(this[0],"margin"+(e?"Bottom":"Right")):0)}}));var Q="__cashEvents";function tt(t){return t[Q]=t[Q]||{}}function et(t){var e=t.split(".");return[e[0],e.slice(1).sort()]}function nt(t,e,n,r){var o=tt(t);if(e){var i=o[e];if(!i)return;r&&(r.guid=r.guid||T++),o[e]=i.filter((function(o){var i=o[0],s=o[1];if(r&&s.guid!==r.guid||!J(i,n))return!0;t.removeEventListener(e,s)}))}else if(n&&n.length)for(e in o)nt(t,e,n,r);else for(e in o)Z(o,t,e)}w.off=function(t,e){var n=this;return void 0===t?this.each((function(t,e){return nt(e)})):S(N(t),(function(t){var r=et(t),o=r[0],i=r[1];n.each((function(t,n){return nt(n,o,i,e)}))})),this},w.on=function(t,e,n,r){var o=this;if(!E(t)){for(var i in t)this.on(i,e,t[i]);return this}return A(e)&&(n=e,e=!1),S(N(t),(function(t){var i=et(t),s=i[0],a=i[1];o.each((function(t,o){var i=function t(i){if(!i.namespace||J(a,i.namespace.split("."))){var l=o;if(e){for(var c=i.target;!O(c,e);){if(c===o)return;if(!(c=c.parentNode))return}l=c}i.namespace=i.namespace||"";var u=n.call(l,i,i.data);r&&nt(o,s,a,t),!1===u&&(i.preventDefault(),i.stopPropagation())}};i.guid=n.guid=n.guid||T++,function(t,e,n,r){r.guid=r.guid||T++;var o=tt(t);o[e]=o[e]||[],o[e].push([n,r]),t.addEventListener(e,r)}(o,s,a,i)}))})),this},w.one=function(t,e,n){return this.on(t,e,n,!0)},w.ready=function(t){var e=function(){return t(b)};return"loading"!==r.readyState?setTimeout(e):r.addEventListener("DOMContentLoaded",e),this},w.trigger=function(t,e){var n=t;if(E(t)){var o=et(t),i=o[0],s=o[1];(n=r.createEvent("HTMLEvents")).initEvent(i,!0,!0),n.namespace=s.join(".")}return n.data=e,this.each((function(t,e){e.dispatchEvent(n)}))};var rt=/select-one/i,ot=/select-multiple/i;function it(t){var e=t.type;return rt.test(e)?function(t){return t.selectedIndex<0?null:t.options[t.selectedIndex].value}(t):ot.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,at=/file|reset|submit|button|image/i,lt=/radio|checkbox/i;w.serialize=function(){var t="";return this.each((function(e,n){S(n.elements||[n],(function(e){if(!e.disabled&&e.name&&"FIELDSET"!==e.tagName&&!at.test(e.type)&&(!lt.test(e.type)||e.checked)){var n=it(e);void 0!==n&&S(P(n)?n:[n],(function(n){t+=function(t,e){return"&"+encodeURIComponent(t)+"="+encodeURIComponent(e).replace(st,"+")}(e.name,n)}))}}))})),t.substr(1)},w.val=function(t){return void 0===t?this[0]&&it(this[0]):this.each((function(e,n){var r=ot.test(n.type),o=null===t?r?[]:"":t;r&&P(o)?S(n.options,(function(t){t.selected=o.indexOf(t.value)>=0})):n.value=o}))},w.clone=function(){return this.map((function(t,e){return e.cloneNode(!0)}))},w.detach=function(){return this.each((function(t,e){e.parentNode&&e.parentNode.removeChild(e)}))};var ct,ut=/^\s*<(\w+)[^>]*>/,pt=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function dt(t){if(function(){if(!ct){var t=r.createElement("table"),e=r.createElement("tr");ct={"*":r.createElement("div"),tr:r.createElement("tbody"),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!E(t))return[];if(pt.test(t))return[r.createElement(RegExp.$1)];var e=ut.test(t)&&RegExp.$1,n=ct[e]||ct["*"];return n.innerHTML=t,b(n.childNodes).detach().get()}function ft(t,e,n){if(void 0!==e){var r=E(e);!r&&e.length?S(e,(function(e){return ft(t,e,n)})):S(t,r?function(t){t.insertAdjacentHTML(n?"afterbegin":"beforeend",e)}:function(t,r){return function(t,e,n){n?t.insertBefore(e,t.childNodes[0]):t.appendChild(e)}(t,r?e.cloneNode(!0):e,n)})}}b.parseHTML=dt,w.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},w.append=function(){var t=this;return S(arguments,(function(e){ft(t,e)})),this},w.appendTo=function(t){return ft(b(t),this),this},w.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}))},w.insertAfter=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,o){r.insertBefore(t?o.cloneNode(!0):o,n.nextSibling)}))})),this},w.after=function(){var t=this;return S(u.apply(arguments),(function(e){u.apply(b(e).slice()).insertAfter(t)})),this},w.insertBefore=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,o){r.insertBefore(t?o.cloneNode(!0):o,n)}))})),this},w.before=function(){var t=this;return S(arguments,(function(e){b(e).insertBefore(t)})),this},w.prepend=function(){var t=this;return S(arguments,(function(e){ft(t,e,!0)})),this},w.prependTo=function(t){return ft(b(t),u.apply(this.slice()),!0),this},w.remove=function(){return this.detach().off()},w.replaceWith=function(t){var e=this;return this.each((function(n,r){var o=r.parentNode;if(o){var i=n?b(t).clone():b(t);if(!i[0])return e.remove(),!1;o.replaceChild(i[0],r),b(i[0]).after(i.slice(1))}}))},w.replaceAll=function(t){return b(t).replaceWith(this),this},w.text=function(t){return void 0===t?this[0]?this[0].textContent:"":this.each((function(e,n){n.textContent=t}))};var ht=r&&r.documentElement;w.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+o.pageYOffset-ht.clientTop,left:e.left+o.pageXOffset-ht.clientLeft}}},w.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},w.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},w.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 O(n,t)})):e},w.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))},w.find=function(t){for(var e=[],n=0,r=this.length;n<r;n++){var o=m(t,this[n]);o.length&&c.apply(e,o)}return b(e.length&&L(e))},w.has=function(t){var e=E(t)?function(e,n){return!!m(t,n).length}:function(e,n){return n.contains(t)};return this.filter(e)},w.is=function(t){if(!t||!this[0])return!1;var e=j(t),n=!1;return this.each((function(r,o){return!(n=e(r,o,t))})),n},w.next=function(){return b(this[0]&&this[0].nextElementSibling)},w.not=function(t){if(!t||!this[0])return this;var e=j(t);return this.filter((function(n,r){return!e(n,r,t)}))},w.parent=function(){var t=[];return this.each((function(e,n){n&&n.parentNode&&t.push(n.parentNode)})),b(L(t))},w.index=function(t){var e=t?b(t)[0]:this[0],n=t?this:b(e).parent().children();return a.call(n,e)},w.closest=function(t){return t&&this[0]?this.is(t)?this.filter(t):this.parent().closest(t):b()},w.parents=function(t){var e,n=[];return this.each((function(o,i){for(e=i;e&&e.parentNode&&e!==r.body.parentNode;)e=e.parentNode,(!t||t&&O(e,t))&&n.push(e)})),b(L(n))},w.prev=function(){return b(this[0]&&this[0].previousElementSibling)},w.siblings=function(){var t=this[0];return this.parent().children().filter((function(e,n){return n!==t}))};const gt=b},926:(t,e,n)=>{n.d(e,{AU:()=>M,BC:()=>h,C8:()=>_,Ch:()=>S,Ci:()=>A,D8:()=>i,G2:()=>T,GW:()=>w,GZ:()=>v,I6:()=>c,LJ:()=>k,Sc:()=>f,X6:()=>u,Xy:()=>x,YZ:()=>a,ZQ:()=>s,a_:()=>g,af:()=>y,bG:()=>d,cx:()=>l,ir:()=>b,kk:()=>P,on:()=>j,rp:()=>E,v$:()=>O,yL:()=>m,zN:()=>p});var r=n(523),o=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},i="transitionend oTransitionEnd transitionend webkitTransitionEnd",s=function(t){return(null==t?void 0:t.nodeType)===Node.DOCUMENT_NODE},a=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)};function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(Array.isArray(t[0])?t[0]:o([],t,!0)).filter(Boolean).join(" ")}var c=function(t,e){return t.querySelectorAll(e)},u=function(t,e){return void 0===e&&(e={}),t&&t.setAttribute&&(0,r.each)(e,(function(e,n){return t.setAttribute(n,e)}))},p=function(t){var e;return t&&!!(t.offsetWidth||t.offsetHeight||(null===(e=t.getClientRects)||void 0===e?void 0:e.call(t).length))},d=function(t,e){var n;null===(n=t.parentNode)||void 0===n||n.replaceChild(e,t)},f=function(t,e,n){var o=t.childNodes,i=o.length,s=(0,r.isUndefined)(n)?i:n;(0,r.isString)(e)&&(t.insertAdjacentHTML("beforeEnd",e),e=t.lastChild,t.removeChild(e)),s>=i?t.appendChild(e):t.insertBefore(e,o[s])},h=function(t,e){return f(t,e)},g=function(t,e,n){void 0===e&&(e={});var o=document.createElement(t);return e&&(0,r.each)(e,(function(t,e){return o.setAttribute(e,t)})),n&&((0,r.isString)(n)?o.innerHTML=n:o.appendChild(n)),o},v=function(t){return document.createTextNode(t)},m=function(t,e){var n,r=t.type;try{n=new window[e](r,t)}catch(t){(n=document.createEvent(e)).initEvent(r,!0,!0)}return n._parentEvent=t,0===r.indexOf("key")&&(n.keyCodeVal=t.keyCode,["keyCode","which"].forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})}))),n},y=function(t,e){void 0===e&&(e=[]),(Array.isArray(e)?e:[e]).forEach((function(e){var n=e.tag||"div",o=e.attributes||{},i=document.createElement(n);(0,r.each)(o,(function(t,e){i.setAttribute(e,t)})),t.appendChild(i)}))},b=function(t){return(null==t?void 0:t.nodeType)===Node.TEXT_NODE},w=function(t){return t&&!b(t)&&!function(t){return(null==t?void 0:t.nodeType)===Node.COMMENT_NODE}(t)},_=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(b(t)){var r=document.createRange();r.selectNode(t),e=r.getBoundingClientRect(),r.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},x=function(t){var e=(null==t?void 0:t.ownerDocument)||document,n=e.documentElement,r=e.defaultView||window;return{x:(r.pageXOffset||n.scrollLeft||0)-(n.clientLeft||0),y:(r.pageYOffset||n.scrollTop||0)-(n.clientTop||0)}},C=function(t){return t.which||t.keyCode},S=function(t){return String.fromCharCode(C(t))},T=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},O=function(t){return 27===C(t)},A=function(t){return 13===C(t)},E=function(t){return function(t){return t.ctrlKey}(t)||t.metaKey},k=function(t){if(!t)return"";var e=t.name,n=t.publicId,r=t.systemId,o=n?' PUBLIC "'.concat(n,'"'):"",i=!n&&r?' SYSTEM "'.concat(r,'"'):"";return"<!DOCTYPE ".concat(e).concat(o).concat(i,">")},P=function(t){void 0===t&&(t={});var e=[];return(0,r.each)(t,(function(t,n){return e.push("".concat(n,'="').concat(t,'"'))})),e.join(" ")},j=function(t,e,n,o){var i=e.split(/\s+/),s=(0,r.isArray)(t)?t:[t];i.forEach((function(t){s.forEach((function(e){return null==e?void 0:e.addEventListener(t,n,o)}))}))},M=function(t,e,n,o){var i=e.split(/\s+/),s=(0,r.isArray)(t)?t:[t];i.forEach((function(t){s.forEach((function(e){return null==e?void 0:e.removeEventListener(t,n,o)}))}))}},342:(t,e,n)=>{n.r(e),n.d(e,{appendStyles:()=>m,buildBase64UrlFromSvg:()=>F,camelCase:()=>_,capitalize:()=>M,createId:()=>H,deepMerge:()=>E,escape:()=>O,escapeNodeContent:()=>A,find:()=>T,getComponentModel:()=>D,getComponentView:()=>$,getElement:()=>S,getGlobal:()=>d,getModel:()=>k,getUiClass:()=>v,getUnitFromValue:()=>b,getViewEl:()=>L,hasDnd:()=>C,hasWin:()=>p,isBultInMethod:()=>a,isComponent:()=>I,isDef:()=>u,isEmptyObj:()=>j,isObject:()=>P,isRule:()=>N,matches:()=>g,normalizeFloat:()=>x,normalizeKey:()=>l,setViewEl:()=>R,shallowDiff:()=>y,toLowerCase:()=>f,upFirst:()=>w,wait:()=>c});var r=n(523),o=n(926),i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)},s={},a=function(t){return(0,r.isFunction)(s[t])},l=function(t){return a(t)?"_".concat(t):t},c=function(t){return void 0===t&&(t=0),new Promise((function(e){return setTimeout(e,t)}))},u=function(t){return void 0!==t},p=function(){return"undefined"!=typeof window},d=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:n.g},f=function(t){return(t||"").toLowerCase()},h=p()?window.Element.prototype:{},g=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.msMatchesSelector,v=function(t,e){var n=t.getConfig(),r=n.stylePrefix;return[n.customUI&&"".concat(r,"cui"),e].filter((function(t){return t})).join(" ")},m=function(t,e){void 0===e&&(e={});var n=(0,r.isArray)(t)?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],t,!0):[t];if(n.length){var o=n.shift();if(o&&(!e.unique||!document.querySelector('link[href="'.concat(o,'"]')))){var i=document.head,s=document.createElement("link");s.href=o,s.rel="stylesheet",e.prepand?i.insertBefore(s,i.firstChild):i.appendChild(s)}m(n)}},y=function(t,e){var n={},o=(0,r.keys)(e);for(var i in t)if(t.hasOwnProperty(i)){var s=t[i],a=e[i];o.indexOf(i)>=0?s!==a&&(n[i]=a):n[i]=null}for(var i in e)e.hasOwnProperty(i)&&(0,r.isUndefined)(t[i])&&(n[i]=e[i]);return n},b=function(t){return t.replace(parseFloat(t),"")},w=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},_=function(t){return t.replace(/-./g,(function(t){return t[1].toUpperCase()}))},x=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=0);var r=0;if(isNaN(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var o=e.toString().split(".")[1];r=o?o.length:0}return r?parseFloat(t.toFixed(r)):t},C=function(t){return"draggable"in document.createElement("i")&&(!t||t.config.nativeDnD)},S=function(t){return(0,r.isElement)(t)||(0,o.ir)(t)?t:t&&t.getEl?t.getEl():void 0},T=function(t,e){var n=null;return t.some((function(r,o){return e(r,o,t)?(n=r,1):0})),n},O=function(t){return void 0===t&&(t=""),"".concat(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")},A=function(t){return void 0===t&&(t=""),"".concat(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},E=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=i({},t[0]),r=1;r<t.length;r++){var o=i({},t[r]);for(var s in o){var a=n[s],l=o[s];P(a)&&P(l)?n[s]=E(a,l):n[s]=l}}return n},k=function(t,e){var n;return!e&&t&&t.__cashData?n=t.__cashData.model:e&&(0,r.isElement)(t)&&(n=e(t).data("model")),n},P=function(t){return t&&!Array.isArray(t)&&"object"==typeof t},j=function(t){return Object.keys(t).length<=0},M=function(t){return void 0===t&&(t=""),t&&t.charAt(0).toUpperCase()+t.substring(1)},N=function(t){return t&&t.toCSS},L=function(t){return null==t?void 0:t.__gjsv},I=function(t){return!!(null==t?void 0:t.toHTML)},$=function(t){return L(t)},D=function(t){var e;return null===(e=$(t))||void 0===e?void 0:e.model},R=function(t,e){t.__gjsv=e},H=function(t){void 0===t&&(t=16);for(var e="",n=0;n<t;n++)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return e},F=function(t){if(t&&"<svg"===t.substr(0,4)){var e="";return p()?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}},585:(t,e,n)=>{var r={"./CanvasClear":404,"./CanvasClear.ts":404,"./CanvasMove":228,"./CanvasMove.ts":228,"./CommandAbstract":570,"./CommandAbstract.ts":570,"./ComponentDelete":377,"./ComponentDelete.ts":377,"./ComponentDrag":728,"./ComponentDrag.ts":728,"./ComponentEnter":462,"./ComponentEnter.ts":462,"./ComponentExit":658,"./ComponentExit.ts":658,"./ComponentNext":619,"./ComponentNext.ts":619,"./ComponentPrev":935,"./ComponentPrev.ts":935,"./ComponentStyleClear":536,"./ComponentStyleClear.ts":536,"./CopyComponent":957,"./CopyComponent.ts":957,"./ExportTemplate":413,"./ExportTemplate.ts":413,"./Fullscreen":516,"./Fullscreen.ts":516,"./MoveComponent":13,"./MoveComponent.ts":13,"./OpenAssets":204,"./OpenAssets.ts":204,"./OpenBlocks":195,"./OpenBlocks.ts":195,"./OpenLayers":671,"./OpenLayers.ts":671,"./OpenStyleManager":49,"./OpenStyleManager.ts":49,"./OpenTraitManager":590,"./OpenTraitManager.ts":590,"./PasteComponent":483,"./PasteComponent.ts":483,"./Preview":857,"./Preview.ts":857,"./Resize":869,"./Resize.ts":869,"./SelectComponent":194,"./SelectComponent.ts":194,"./SelectPosition":582,"./SelectPosition.ts":582,"./ShowOffset":131,"./ShowOffset.ts":131,"./SwitchVisibility":229,"./SwitchVisibility.ts":229};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=585},523:(t,e,n)=>{n.r(e),n.d(e,{VERSION:()=>o,after:()=>Le,all:()=>tn,allKeys:()=>vt,any:()=>en,assign:()=>Lt,before:()=>Ie,bind:()=>xe,bindAll:()=>Te,chain:()=>ye,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ke,compact:()=>An,compose:()=>Ne,constant:()=>Z,contains:()=>nn,countBy:()=>gn,create:()=>Dt,debounce:()=>Pe,default:()=>Bn,defaults:()=>It,defer:()=>Ee,delay:()=>Ae,detect:()=>We,difference:()=>kn,drop:()=>Tn,each:()=>Ge,escape:()=>se,every:()=>tn,extend:()=>Nt,extendOwn:()=>Lt,filter:()=>Ze,find:()=>We,findIndex:()=>He,findKey:()=>De,findLastIndex:()=>Fe,findWhere:()=>qe,first:()=>Sn,flatten:()=>En,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ge,functions:()=>jt,get:()=>Bt,groupBy:()=>fn,has:()=>zt,head:()=>Sn,identity:()=>Wt,include:()=>nn,includes:()=>nn,indexBy:()=>hn,indexOf:()=>Be,initial:()=>Cn,inject:()=>Xe,intersection:()=>Nn,invert:()=>Pt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>D,isBoolean:()=>E,isDataView:()=>W,isDate:()=>N,isElement:()=>k,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>I,isFinite:()=>X,isFunction:()=>F,isMap:()=>St,isMatch:()=>ct,isNaN:()=>J,isNull:()=>O,isNumber:()=>M,isObject:()=>T,isRegExp:()=>L,isSet:()=>Ot,isString:()=>j,isSymbol:()=>$,isTypedArray:()=>ot,isUndefined:()=>A,isWeakMap:()=>Tt,isWeakSet:()=>At,iteratee:()=>Xt,keys:()=>at,last:()=>On,lastIndexOf:()=>ze,map:()=>Ke,mapObject:()=>Zt,matcher:()=>qt,matches:()=>qt,max:()=>an,memoize:()=>Oe,methods:()=>jt,min:()=>ln,mixin:()=>Fn,negate:()=>Me,noop:()=>Qt,now:()=>re,object:()=>$n,omit:()=>xn,once:()=>$e,pairs:()=>kt,partial:()=>_e,partition:()=>vn,pick:()=>_n,pluck:()=>on,property:()=>Gt,propertyOf:()=>te,random:()=>ne,range:()=>Dn,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>Qe,rest:()=>Tn,restArguments:()=>S,result:()=>ge,sample:()=>cn,select:()=>Ze,shuffle:()=>un,size:()=>bn,some:()=>en,sortBy:()=>pn,sortedIndex:()=>Ve,tail:()=>Tn,take:()=>Sn,tap:()=>Ht,template:()=>he,templateSettings:()=>le,throttle:()=>ke,times:()=>ee,toArray:()=>yn,toPath:()=>Ft,transpose:()=>Ln,unescape:()=>ae,union:()=>Mn,uniq:()=>jn,unique:()=>jn,uniqueId:()=>me,unzip:()=>Ln,values:()=>Et,where:()=>sn,without:()=>Pn,wrap:()=>je,zip:()=>In});var r={};n.r(r),n.d(r,{VERSION:()=>o,after:()=>Le,all:()=>tn,allKeys:()=>vt,any:()=>en,assign:()=>Lt,before:()=>Ie,bind:()=>xe,bindAll:()=>Te,chain:()=>ye,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ke,compact:()=>An,compose:()=>Ne,constant:()=>Z,contains:()=>nn,countBy:()=>gn,create:()=>Dt,debounce:()=>Pe,default:()=>Vn,defaults:()=>It,defer:()=>Ee,delay:()=>Ae,detect:()=>We,difference:()=>kn,drop:()=>Tn,each:()=>Ge,escape:()=>se,every:()=>tn,extend:()=>Nt,extendOwn:()=>Lt,filter:()=>Ze,find:()=>We,findIndex:()=>He,findKey:()=>De,findLastIndex:()=>Fe,findWhere:()=>qe,first:()=>Sn,flatten:()=>En,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ge,functions:()=>jt,get:()=>Bt,groupBy:()=>fn,has:()=>zt,head:()=>Sn,identity:()=>Wt,include:()=>nn,includes:()=>nn,indexBy:()=>hn,indexOf:()=>Be,initial:()=>Cn,inject:()=>Xe,intersection:()=>Nn,invert:()=>Pt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>D,isBoolean:()=>E,isDataView:()=>W,isDate:()=>N,isElement:()=>k,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>I,isFinite:()=>X,isFunction:()=>F,isMap:()=>St,isMatch:()=>ct,isNaN:()=>J,isNull:()=>O,isNumber:()=>M,isObject:()=>T,isRegExp:()=>L,isSet:()=>Ot,isString:()=>j,isSymbol:()=>$,isTypedArray:()=>ot,isUndefined:()=>A,isWeakMap:()=>Tt,isWeakSet:()=>At,iteratee:()=>Xt,keys:()=>at,last:()=>On,lastIndexOf:()=>ze,map:()=>Ke,mapObject:()=>Zt,matcher:()=>qt,matches:()=>qt,max:()=>an,memoize:()=>Oe,methods:()=>jt,min:()=>ln,mixin:()=>Fn,negate:()=>Me,noop:()=>Qt,now:()=>re,object:()=>$n,omit:()=>xn,once:()=>$e,pairs:()=>kt,partial:()=>_e,partition:()=>vn,pick:()=>_n,pluck:()=>on,property:()=>Gt,propertyOf:()=>te,random:()=>ne,range:()=>Dn,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>Qe,rest:()=>Tn,restArguments:()=>S,result:()=>ge,sample:()=>cn,select:()=>Ze,shuffle:()=>un,size:()=>bn,some:()=>en,sortBy:()=>pn,sortedIndex:()=>Ve,tail:()=>Tn,take:()=>Sn,tap:()=>Ht,template:()=>he,templateSettings:()=>le,throttle:()=>ke,times:()=>ee,toArray:()=>yn,toPath:()=>Ft,transpose:()=>Ln,unescape:()=>ae,union:()=>Mn,uniq:()=>jn,unique:()=>jn,uniqueId:()=>me,unzip:()=>Ln,values:()=>Et,where:()=>sn,without:()=>Pn,wrap:()=>je,zip:()=>In});var o="1.13.1",i="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},s=Array.prototype,a=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=s.push,u=s.slice,p=a.toString,d=a.hasOwnProperty,f="undefined"!=typeof ArrayBuffer,h="undefined"!=typeof DataView,g=Array.isArray,v=Object.keys,m=Object.create,y=f&&ArrayBuffer.isView,b=isNaN,w=isFinite,_=!{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),r=Array(n),o=0;o<n;o++)r[o]=arguments[o+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var i=Array(e+1);for(o=0;o<e;o++)i[o]=arguments[o];return i[e]=r,t.apply(this,i)}}function T(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function O(t){return null===t}function A(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 P(t){var e="[object "+t+"]";return function(t){return p.call(t)===e}}const j=P("String"),M=P("Number"),N=P("Date"),L=P("RegExp"),I=P("Error"),$=P("Symbol"),D=P("ArrayBuffer");var R=P("Function"),H=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof H&&(R=function(t){return"function"==typeof t||!1});const F=R,V=P("Object");var U=h&&V(new DataView(new ArrayBuffer(8))),B="undefined"!=typeof Map&&V(new Map),z=P("DataView");const W=U?function(t){return null!=t&&F(t.getInt8)&&D(t.buffer)}:z,q=g||P("Array");function G(t,e){return null!=t&&d.call(t,e)}var K=P("Arguments");!function(){K(arguments)||(K=function(t){return G(t,"callee")})}();const Y=K;function X(t){return!$(t)&&w(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 rt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const ot=f?function(t){return y?y(t)&&!W(t):nt(t)&&rt.test(p.call(t))}:Z(!1),it=tt("length");function st(t,e){e=function(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=x.length,r=t.constructor,o=F(r)&&r.prototype||a,i="constructor";for(G(t,i)&&!e.contains(i)&&e.push(i);n--;)(i=x[n])in t&&t[i]!==o[i]&&!e.contains(i)&&e.push(i)}function at(t){if(!T(t))return[];if(v)return v(t);var e=[];for(var n in t)G(t,n)&&e.push(n);return _&&st(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(at(t))}function ct(t,e){var n=at(e),r=n.length;if(null==t)return!r;for(var o=Object(t),i=0;i<r;i++){var s=n[i];if(e[s]!==o[s]||!(s in o))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=o,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,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var o=typeof t;return("function"===o||"object"===o||"object"==typeof e)&&ht(t,e,n,r)}function ht(t,e,n,r){t instanceof ut&&(t=t._wrapped),e instanceof ut&&(e=e._wrapped);var o=p.call(t);if(o!==p.call(e))return!1;if(U&&"[object Object]"==o&&W(t)){if(!W(e))return!1;o=dt}switch(o){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,r)}var i="[object Array]"===o;if(!i&&ot(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 s=t.constructor,a=e.constructor;if(s!==a&&!(F(s)&&s instanceof s&&F(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var c=(n=n||[]).length;c--;)if(n[c]===t)return r[c]===e;if(n.push(t),r.push(e),i){if((c=t.length)!==e.length)return!1;for(;c--;)if(!ft(t[c],e[c],n,r))return!1}else{var u,d=at(t);if(c=d.length,at(e).length!==c)return!1;for(;c--;)if(!G(e,u=d[c])||!ft(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0}function gt(t,e){return ft(t,e)}function vt(t){if(!T(t))return[];var e=[];for(var n in t)e.push(n);return _&&st(t,e),e}function mt(t){var e=it(t);return function(n){if(null==n)return!1;var r=vt(n);if(it(r))return!1;for(var o=0;o<e;o++)if(!F(n[t[o]]))return!1;return t!==xt||!F(n[yt])}}var yt="forEach",bt=["clear","delete"],wt=["get","has","set"],_t=bt.concat(yt,wt),xt=bt.concat(wt),Ct=["add"].concat(bt,yt,"has");const St=B?mt(_t):P("Map"),Tt=B?mt(xt):P("WeakMap"),Ot=B?mt(Ct):P("Set"),At=P("WeakSet");function Et(t){for(var e=at(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=t[e[o]];return r}function kt(t){for(var e=at(t),n=e.length,r=Array(n),o=0;o<n;o++)r[o]=[e[o],t[e[o]]];return r}function Pt(t){for(var e={},n=at(t),r=0,o=n.length;r<o;r++)e[t[n[r]]]=n[r];return e}function jt(t){var e=[];for(var n in t)F(t[n])&&e.push(n);return e.sort()}function Mt(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var o=1;o<r;o++)for(var i=arguments[o],s=t(i),a=s.length,l=0;l<a;l++){var c=s[l];e&&void 0!==n[c]||(n[c]=i[c])}return n}}const Nt=Mt(vt),Lt=Mt(at),It=Mt(vt,!0);function $t(t){if(!T(t))return{};if(m)return m(t);var e=function(){};e.prototype=t;var n=new e;return e.prototype=null,n}function Dt(t,e){var n=$t(t);return e&&Lt(n,e),n}function Rt(t){return T(t)?q(t)?t.slice():Nt({},t):t}function Ht(t,e){return e(t),t}function Ft(t){return q(t)?t:[t]}function Vt(t){return ut.toPath(t)}function Ut(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function Bt(t,e,n){var r=Ut(t,Vt(e));return A(r)?n:r}function zt(t,e){for(var n=(e=Vt(e)).length,r=0;r<n;r++){var o=e[r];if(!G(t,o))return!1;t=t[o]}return!!n}function Wt(t){return t}function qt(t){return t=Lt({},t),function(e){return ct(e,t)}}function Gt(t){return t=Vt(t),function(e){return Ut(e,t)}}function Kt(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,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)}}return function(){return t.apply(e,arguments)}}function Yt(t,e,n){return null==t?Wt:F(t)?Kt(t,e,n):T(t)&&!q(t)?qt(t):Gt(t)}function Xt(t,e){return Yt(t,e,1/0)}function Jt(t,e,n){return ut.iteratee!==Xt?ut.iteratee(t,e):Yt(t,e,n)}function Zt(t,e,n){e=Jt(e,n);for(var r=at(t),o=r.length,i={},s=0;s<o;s++){var a=r[s];i[a]=e(t[a],a,t)}return i}function Qt(){}function te(t){return null==t?Qt:function(e){return Bt(t,e)}}function ee(t,e,n){var r=Array(Math.max(0,t));e=Kt(e,n,1);for(var o=0;o<t;o++)r[o]=e(o);return r}function ne(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}ut.toPath=Ft,ut.iteratee=Xt;const re=Date.now||function(){return(new Date).getTime()};function oe(t){var e=function(e){return t[e]},n="(?:"+at(t).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(o,e):t}}const ie={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},se=oe(ie),ae=oe(Pt(ie)),le=ut.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ce=/(.)^/,ue={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},pe=/\\|'|\r|\n|\u2028|\u2029/g;function de(t){return"\\"+ue[t]}var fe=/^\s*(\w|\$)+\s*$/;function he(t,e,n){!e&&n&&(e=n),e=It({},e,ut.templateSettings);var r=RegExp([(e.escape||ce).source,(e.interpolate||ce).source,(e.evaluate||ce).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(r,(function(e,n,r,s,a){return i+=t.slice(o,a).replace(pe,de),o=a+e.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(i+="';\n"+s+"\n__p+='"),e})),i+="';\n";var s,a=e.variable;if(a){if(!fe.test(a))throw new Error("variable is not a bare identifier: "+a)}else i="with(obj||{}){\n"+i+"}\n",a="obj";i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{s=new Function(a,"_",i)}catch(t){throw t.source=i,t}var l=function(t){return s.call(this,t,ut)};return l.source="function("+a+"){\n"+i+"}",l}function ge(t,e,n){var r=(e=Vt(e)).length;if(!r)return F(n)?n.call(t):n;for(var o=0;o<r;o++){var i=null==t?void 0:t[e[o]];void 0===i&&(i=n,o=r),t=F(i)?i.call(t):i}return t}var ve=0;function me(t){var e=++ve+"";return t?t+e:e}function ye(t){var e=ut(t);return e._chain=!0,e}function be(t,e,n,r,o){if(!(r instanceof e))return t.apply(n,o);var i=$t(t.prototype),s=t.apply(i,o);return T(s)?s:i}var we=S((function(t,e){var n=we.placeholder,r=function(){for(var o=0,i=e.length,s=Array(i),a=0;a<i;a++)s[a]=e[a]===n?arguments[o++]:e[a];for(;o<arguments.length;)s.push(arguments[o++]);return be(t,r,this,this,s)};return r}));we.placeholder=ut;const _e=we,xe=S((function(t,e,n){if(!F(t))throw new TypeError("Bind must be called on a function");var r=S((function(o){return be(t,r,e,this,n.concat(o))}));return r})),Ce=Q(it);function Se(t,e,n,r){if(r=r||[],e||0===e){if(e<=0)return r.concat(t)}else e=1/0;for(var o=r.length,i=0,s=it(t);i<s;i++){var a=t[i];if(Ce(a)&&(q(a)||Y(a)))if(e>1)Se(a,e-1,n,r),o=r.length;else for(var l=0,c=a.length;l<c;)r[o++]=a[l++];else n||(r[o++]=a)}return r}const Te=S((function(t,e){var n=(e=Se(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=xe(t[r],t)}return t}));function Oe(t,e){var n=function(r){var o=n.cache,i=""+(e?e.apply(this,arguments):r);return G(o,i)||(o[i]=t.apply(this,arguments)),o[i]};return n.cache={},n}const Ae=S((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),Ee=_e(Ae,ut,1);function ke(t,e,n){var r,o,i,s,a=0;n||(n={});var l=function(){a=!1===n.leading?0:re(),r=null,s=t.apply(o,i),r||(o=i=null)},c=function(){var c=re();a||!1!==n.leading||(a=c);var u=e-(c-a);return o=this,i=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),a=c,s=t.apply(o,i),r||(o=i=null)):r||!1===n.trailing||(r=setTimeout(l,u)),s};return c.cancel=function(){clearTimeout(r),a=0,r=o=i=null},c}function Pe(t,e,n){var r,o,i,s,a,l=function(){var c=re()-o;e>c?r=setTimeout(l,e-c):(r=null,n||(s=t.apply(a,i)),r||(i=a=null))},c=S((function(c){return a=this,i=c,o=re(),r||(r=setTimeout(l,e),n&&(s=t.apply(a,i))),s}));return c.cancel=function(){clearTimeout(r),r=i=a=null},c}function je(t,e){return _e(e,t)}function Me(t){return function(){return!t.apply(this,arguments)}}function Ne(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function Le(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Ie(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const $e=_e(Ie,2);function De(t,e,n){e=Jt(e,n);for(var r,o=at(t),i=0,s=o.length;i<s;i++)if(e(t[r=o[i]],r,t))return r}function Re(t){return function(e,n,r){n=Jt(n,r);for(var o=it(e),i=t>0?0:o-1;i>=0&&i<o;i+=t)if(n(e[i],i,e))return i;return-1}}const He=Re(1),Fe=Re(-1);function Ve(t,e,n,r){for(var o=(n=Jt(n,r,1))(e),i=0,s=it(t);i<s;){var a=Math.floor((i+s)/2);n(t[a])<o?i=a+1:s=a}return i}function Ue(t,e,n){return function(r,o,i){var s=0,a=it(r);if("number"==typeof i)t>0?s=i>=0?i:Math.max(i+a,s):a=i>=0?Math.min(i+1,a):i+a+1;else if(n&&i&&a)return r[i=n(r,o)]===o?i:-1;if(o!=o)return(i=e(u.call(r,s,a),J))>=0?i+s:-1;for(i=t>0?s:a-1;i>=0&&i<a;i+=t)if(r[i]===o)return i;return-1}}const Be=Ue(1,He,Ve),ze=Ue(-1,Fe);function We(t,e,n){var r=(Ce(t)?He:De)(t,e,n);if(void 0!==r&&-1!==r)return t[r]}function qe(t,e){return We(t,qt(e))}function Ge(t,e,n){var r,o;if(e=Kt(e,n),Ce(t))for(r=0,o=t.length;r<o;r++)e(t[r],r,t);else{var i=at(t);for(r=0,o=i.length;r<o;r++)e(t[i[r]],i[r],t)}return t}function Ke(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&at(t),o=(r||t).length,i=Array(o),s=0;s<o;s++){var a=r?r[s]:s;i[s]=e(t[a],a,t)}return i}function Ye(t){return function(e,n,r,o){var i=arguments.length>=3;return function(e,n,r,o){var i=!Ce(e)&&at(e),s=(i||e).length,a=t>0?0:s-1;for(o||(r=e[i?i[a]:a],a+=t);a>=0&&a<s;a+=t){var l=i?i[a]:a;r=n(r,e[l],l,e)}return r}(e,Kt(n,o,4),r,i)}}const Xe=Ye(1),Je=Ye(-1);function Ze(t,e,n){var r=[];return e=Jt(e,n),Ge(t,(function(t,n,o){e(t,n,o)&&r.push(t)})),r}function Qe(t,e,n){return Ze(t,Me(Jt(e)),n)}function tn(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&at(t),o=(r||t).length,i=0;i<o;i++){var s=r?r[i]:i;if(!e(t[s],s,t))return!1}return!0}function en(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&at(t),o=(r||t).length,i=0;i<o;i++){var s=r?r[i]:i;if(e(t[s],s,t))return!0}return!1}function nn(t,e,n,r){return Ce(t)||(t=Et(t)),("number"!=typeof n||r)&&(n=0),Be(t,e,n)>=0}const rn=S((function(t,e,n){var r,o;return F(e)?o=e:(e=Vt(e),r=e.slice(0,-1),e=e[e.length-1]),Ke(t,(function(t){var i=o;if(!i){if(r&&r.length&&(t=Ut(t,r)),null==t)return;i=t[e]}return null==i?i:i.apply(t,n)}))}));function on(t,e){return Ke(t,Gt(e))}function sn(t,e){return Ze(t,qt(e))}function an(t,e,n){var r,o,i=-1/0,s=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=Ce(t)?t:Et(t)).length;a<l;a++)null!=(r=t[a])&&r>i&&(i=r);else e=Jt(e,n),Ge(t,(function(t,n,r){((o=e(t,n,r))>s||o===-1/0&&i===-1/0)&&(i=t,s=o)}));return i}function ln(t,e,n){var r,o,i=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=Ce(t)?t:Et(t)).length;a<l;a++)null!=(r=t[a])&&r<i&&(i=r);else e=Jt(e,n),Ge(t,(function(t,n,r){((o=e(t,n,r))<s||o===1/0&&i===1/0)&&(i=t,s=o)}));return i}function cn(t,e,n){if(null==e||n)return Ce(t)||(t=Et(t)),t[ne(t.length-1)];var r=Ce(t)?Rt(t):Et(t),o=it(r);e=Math.max(Math.min(e,o),0);for(var i=o-1,s=0;s<e;s++){var a=ne(s,i),l=r[s];r[s]=r[a],r[a]=l}return r.slice(0,e)}function un(t){return cn(t,1/0)}function pn(t,e,n){var r=0;return e=Jt(e,n),on(Ke(t,(function(t,n,o){return{value:t,index:r++,criteria:e(t,n,o)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),"value")}function dn(t,e){return function(n,r,o){var i=e?[[],[]]:{};return r=Jt(r,o),Ge(n,(function(e,o){var s=r(e,o,n);t(i,e,s)})),i}}const fn=dn((function(t,e,n){G(t,n)?t[n].push(e):t[n]=[e]})),hn=dn((function(t,e,n){t[n]=e})),gn=dn((function(t,e,n){G(t,n)?t[n]++:t[n]=1})),vn=dn((function(t,e,n){t[n?0:1].push(e)}),!0);var mn=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function yn(t){return t?q(t)?u.call(t):j(t)?t.match(mn):Ce(t)?Ke(t,Wt):Et(t):[]}function bn(t){return null==t?0:Ce(t)?t.length:at(t).length}function wn(t,e,n){return e in n}const _n=S((function(t,e){var n={},r=e[0];if(null==t)return n;F(r)?(e.length>1&&(r=Kt(r,e[1])),e=vt(t)):(r=wn,e=Se(e,!1,!1),t=Object(t));for(var o=0,i=e.length;o<i;o++){var s=e[o],a=t[s];r(a,s,t)&&(n[s]=a)}return n})),xn=S((function(t,e){var n,r=e[0];return F(r)?(r=Me(r),e.length>1&&(n=e[1])):(e=Ke(Se(e,!1,!1),String),r=function(t,n){return!nn(e,n)}),_n(t,r,n)}));function Cn(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function Sn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Cn(t,t.length-e)}function Tn(t,e,n){return u.call(t,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[t.length-1]:Tn(t,Math.max(0,t.length-e))}function An(t){return Ze(t,Boolean)}function En(t,e){return Se(t,e,!1)}const kn=S((function(t,e){return e=Se(e,!0,!0),Ze(t,(function(t){return!nn(e,t)}))})),Pn=S((function(t,e){return kn(t,e)}));function jn(t,e,n,r){E(e)||(r=n,n=e,e=!1),null!=n&&(n=Jt(n,r));for(var o=[],i=[],s=0,a=it(t);s<a;s++){var l=t[s],c=n?n(l,s,t):l;e&&!n?(s&&i===c||o.push(l),i=c):n?nn(i,c)||(i.push(c),o.push(l)):nn(o,l)||o.push(l)}return o}const Mn=S((function(t){return jn(Se(t,!0,!0))}));function Nn(t){for(var e=[],n=arguments.length,r=0,o=it(t);r<o;r++){var i=t[r];if(!nn(e,i)){var s;for(s=1;s<n&&nn(arguments[s],i);s++);s===n&&e.push(i)}}return e}function Ln(t){for(var e=t&&an(t,it).length||0,n=Array(e),r=0;r<e;r++)n[r]=on(t,r);return n}const In=S(Ln);function $n(t,e){for(var n={},r=0,o=it(t);r<o;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}function Dn(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),o=Array(r),i=0;i<r;i++,t+=n)o[i]=t;return o}function Rn(t,e){if(null==e||e<1)return[];for(var n=[],r=0,o=t.length;r<o;)n.push(u.call(t,r,r+=e));return n}function Hn(t,e){return t._chain?ut(e).chain():e}function Fn(t){return Ge(jt(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}Ge(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=s[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)}})),Ge(["concat","join","slice"],(function(t){var e=s[t];ut.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Hn(this,t)}}));const Vn=ut;var Un=Fn(r);Un._=Un;const Bn=Un}},K={};function Y(t){var e=K[t];if(void 0!==e)return e.exports;var n=K[t]={exports:{}};return G[t].call(n.exports,n,n.exports,Y),n.exports}Y.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return Y.d(e,{a:e}),e},Y.d=(t,e)=>{for(var n in e)Y.o(e,n)&&!Y.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},Y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),Y.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Y.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var X={};Y.d(X,{Ay:()=>Qg,I0:()=>Zg,nu:()=>Jg});var J=Y(523),Z=Y(342);function Q(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=t.raw;return r.reduce((function(t,n,o){var i=e[o-1],s=r[o-1];return Array.isArray(i)?i=i.join(""):s&&"$"===s.slice(-1)?t=t.slice(0,-1):i=(0,Z.escape)(i),t+i+n}))}const tt={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};var et=Y(391),nt=Y.n(et),rt=Y(694),ot=Y(268),it=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return it(e,t),e}(ot.Kx),at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return it(e,t),e.prototype.getByComponent=function(t){var e=this;return this.filter((function(n){return e.getComponent(n)===t}))[0]},e.prototype.addComponent=function(t,e){var n=this,r=((0,J.isArray)(t)?t:[t]).filter((function(t){return!n.hasComponent(t)})).map((function(t){return new st({component:t})}))[0];return this.push(r,e)},e.prototype.getComponent=function(t){return t.get("component")},e.prototype.hasComponent=function(t){var e=this.getByComponent(t);return e&&this.contains(e)},e.prototype.lastComponent=function(){var t=this.last();return t?this.getComponent(t):void 0},e.prototype.allComponents=function(){var t=this;return this.map((function(e){return t.getComponent(e)})).filter((function(t){return t}))},e.prototype.removeComponent=function(t,e){var n=this,r=((0,J.isArray)(t)?t:[t]).map((function(t){return n.getByComponent(t)}));return this.remove(r,e)},e}(ot.pM);const lt=at;var ct=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ut=function(){return ut=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ut.apply(this,arguments)},pt=function(){function t(t,e,n){this.debounced=[],this.collections=[],this.cls=[],this._em=t,this._name=e;var r=this.name.charAt(0).toLowerCase()+this.name.slice(1),o=(0,J.isUndefined)(t.config[r])?t.config[this.name]:t.config[r],i=!0===o?{}:o||{};i.pStylePrefix=t.config.pStylePrefix||"",(0,J.isUndefined)(o)||o||(i._disable=1),i.em=t,this._config=(0,Z.deepMerge)(n||{},i)}return Object.defineProperty(t.prototype,"em",{get:function(){return this._em},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),t.prototype.render=function(t){},t.prototype.postLoad=function(t){},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t.prototype.getConfig=function(t){return t?this.config[t]:this.config},t.prototype.__logWarn=function(t,e){void 0===e&&(e={}),this.em.logWarning("[".concat(this.name,"]: ").concat(t),e)},t.prototype.destroy=function(){this.__destroy()},t.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()}))},t.prototype.__appendTo=function(){var t=this.getConfig().appendTo;if(t){var e=(0,J.isElement)(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}},t}();const dt=pt;var ft=function(t){function e(e,n,r,o,i,s){void 0===s&&(s={});var a=t.call(this,e,n,i)||this;return a.cls=[],a.private=!1,a.all=r,a.events=o,!s.skipListen&&a.__initListen(),a}return ct(e,t),e.prototype.postLoad=function(t){},e.prototype.render=function(t){},e.prototype.getProjectData=function(t){var e={},n=this.storageKey;return n&&(e[n]=t||this.getAll()),e},e.prototype.loadProjectData=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n=e.all,r=e.onResult,o=e.reset,i=this.storageKey,s={action:"load"},a=n||this.all,l=t[i];if("string"==typeof l)try{l=JSON.parse(l)}catch(t){this.__logWarn("Data parsing failed",{input:l})}return o&&l&&a.reset(void 0,s),r?l&&r(l,s):l&&(0,Z.isDef)(l.length)&&a.reset(l,s),l},e.prototype.clear=function(t){void 0===t&&(t={});var e=this.all;return e&&e.reset(void 0,t),this},e.prototype.getAll=function(){return function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],this.all.models,!0)},e.prototype.getAllMap=function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})},e.prototype.__initListen=function(t){void 0===t&&(t={});var e=this,n=e.all,r=e.em,o=e.events;n&&r&&n.on("add",(function(t,e,n){return r.trigger(o.add,t,n)})).on("remove",(function(t,e,n){return r.trigger(o.remove,t,n)})).on("change",(function(t,e){return r.trigger(o.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,o=t.event;e.on("all",(function(t,e,i,s){var a=ut({event:t},s||i);[r,n].map((function(t){return t.trigger(o,e,a)}))}))}))},e.prototype.__remove=function(t,e){var n=this;void 0===e&&(e={});var r=this.em,o=(0,J.isString)(t)?this.get(t):t,i=function(){return o&&n.all.remove(o,e),o};return!e.silent&&(null==r||r.trigger(this.events.removeBefore,o,i,e)),!e.abort&&i()},e.prototype.__catchAllEvent=function(t,e,n,r){var o=this.em,i=this.events,s=r||n;o&&i.all&&o.trigger(i.all,{event:t,model:e,options:s}),this.__onAllEvent()},e.prototype.__appendTo=function(t){var e=this.config.appendTo;if(e){var n=(0,J.isElement)(e)?e:document.querySelector(e);if(!n)return this.__logWarn('"appendTo" element not found');n.appendChild(this.render(t))}},e.prototype.__onAllEvent=function(){},e.prototype._createId=function(t){void 0===t&&(t=16);var e,n=this.getAll().length+t,r=this.getAllMap();do{e=(0,Z.createId)(n)}while(r[e]);return e},e.prototype.__listenAdd=function(t,e){var n=this;t.on("add",(function(t,r,o){return n.em.trigger(e,t,o)}))},e.prototype.__listenRemove=function(t,e){var n=this;t.on("remove",(function(t,r,o){return n.em.trigger(e,t,o)}))},e.prototype.__listenUpdate=function(t,e){var n=this;t.on("change",(function(t,r){return n.em.trigger(e,t,t.changedAttributes(),r)}))},e.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},e}(pt);const ht={stylePrefix:"cv-",scripts:[],styles:[],customBadgeLabel:void 0,autoscrollLimit:50,extHl:!1,frameContent:"<!DOCTYPE html>",frameStyle:"\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n ",notTextable:["button","a","input[type=checkbox]","input[type=radio]"],allowExternalDrop:!0};var gt=Y(578);const vt={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 mt=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return mt(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}(ot.Kx);var bt=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return bt(e,t),e}(ot.pM);const _t=wt;wt.prototype.model=yt;var xt=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ct=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 xt(e,t),e.prototype.template=function(t){var e,n,r=t.ppfx,o=t.label;return Q(Tt||(e=['\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=['\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 '],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,Tt=e),r,o,r,r,r,r,r,r,r)},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 r=t.attributes,o=r.name,i=r.id,s=e&&e.t&&e.t("deviceManager.devices.".concat(i))||o;n+='<option value="'.concat(i||o,'">').concat(s,"</option>")})),n},e.prototype.render=function(){var t=this,e=t.em,n=t.ppfx,r=t.$el,o=t.el,i=e&&e.t&&e.t("deviceManager.device");return r.html(this.template({ppfx:n,label:i})),this.devicesEl=r.find(".".concat(n,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(e.get("device")),o.className="".concat(n,"devices-c"),this},e}(ot.Ss);const St=Ct;var Tt,Ot=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),At=function(){return At=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},At.apply(this,arguments)},Et="device",kt="".concat(Et,":"),Pt="".concat(kt,"select"),jt=("".concat(Pt,":before"),"".concat(kt,"update")),Mt="".concat(kt,"add"),Nt=("".concat(Mt,":before"),"".concat(kt,"remove")),Lt="".concat(Nt,":before"),It={all:Et,select:Pt,update:jt,add:Mt,remove:Nt,removeBefore:Lt},$t=function(t){function e(e){var n,r=t.call(this,e,"DeviceManager",new _t,It,vt)||this;return r.Device=yt,r.Devices=_t,r.storageKey="",r.devices=r.all,null===(n=r.config.devices)||void 0===n||n.forEach((function(t){return r.add(t,{silent:!0})})),r.select(r.config.default||r.devices.at(0)),e.on("change:device",r._onSelect,r),r}return Ot(e,t),e.prototype._onSelect=function(t,e,n){var r=this.em,o=this.events,i=t.previous("device"),s=this.get(e),a=o.select;r.trigger(a,s,this.get(i)),this.__catchAllEvent(a,s,n)},e.prototype.add=function(t,e){var n;void 0===e&&(e={});var r=e;if((0,J.isString)(t)){var o=e;n=At(At({},r=arguments[2]||{}),{id:t,name:r.name||t,width:o})}else n=t;return n.id||(n.id=n.name||this._createId()),this.devices.add(n,r)},e.prototype.get=function(t){var e=this.getAll().filter((function(e){return e.get("name")===t}))[0];return e||this.devices.get(t)||null},e.prototype.remove=function(t,e){return void 0===e&&(e={}),this.__remove(t,e)},e.prototype.getDevices=function(){return this.devices.models},e.prototype.select=function(t,e){void 0===e&&(e={});var n=(0,J.isString)(t)?this.get(t):t;return n&&this.em.set("device",n.get("id"),e),this},e.prototype.getSelected=function(){return this.get(this.em.get("device"))},e.prototype.getAll=function(){return this.devices},e.prototype.render=function(){var t,e=this.em;return null===(t=this.view)||void 0===t||t.remove(),this.view=new St({collection:this.devices,config:At({em:e},this.config)}),this.view.render().el},e.prototype.destroy=function(){this.__destroy()},e}(ft);const Dt=$t;var Rt;!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"}(Rt||(Rt={}));const Ht=Rt;var Ft=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vt=function(t){function e(e,n,r){return t.call(this,n,{module:e,modelConstructor:r})||this}return Ft(e,t),e.prototype.add=function(e,n){var r,o=this,i=(0,J.isArray)(e)?e:(0,J.isUndefined)(e)?void 0:[e];return i=null!==(r=null==i?void 0:i.map((function(t){return t instanceof o.newModel?t:new o.newModel(o.module,t)})))&&void 0!==r?r:[void 0],t.prototype.add.call(this,(0,J.isArray)(e)?i:i[0],n)},e.prototype.preinitialize=function(t,e){this.newModel=e.modelConstructor,this.module=e.module},e}(ot.pM);const Ut=Vt;var Bt=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zt=function(){return zt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},zt.apply(this,arguments)},Wt=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},qt="__aw",Gt="__ah",Kt=function(t,e){var n,r=t.get(e),o=null===(n=t.view)||void 0===n?void 0:n.el["width"===e?"offsetWidth":"offsetHeight"];return(0,J.isNumber)(r)?r:(0,J.isString)(r)&&r.endsWith("px")?parseFloat(r):o||0},Yt=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=r.em,i=r.attributes,s=i.styles,a=i.component,l=o.Components,c=l.getConfig(),u=o.Css.getAll(),p={},d={em:o,config:c,frame:r,idMap:p};if(!(0,Z.isComponent)(a)){var f=(0,Z.isObject)(a)?a:{components:a};!f.type&&(f.type="wrapper");var h=l.getType("wrapper").model;r.set("component",new h(f,d))}if(s){if(!(0,Z.isObject)(s)){var g=s;(0,J.keys)(p).length&&(g=(0,J.isString)(g)?o.Parser.parseCss(g):g,o.Css.checkId(g,{idMap:p})),u.add(g),r.set("styles",u)}}else r.set("styles",u);return!n.width&&r.set(qt,1),!n.height&&r.set(Gt,1),!r.id&&r.set("id",(0,Z.createId)()),r}return Bt(e,t),e.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(e.prototype,"width",{get:function(){return Kt(this,"width")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Kt(this,"height")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"head",{get:function(){return this.get("head")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refFrame",{get:function(){return this.get("refFrame")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){var t=this.refFrame;return(null==t?void 0:t.getComponent())||this.getComponent()},enumerable:!1,configurable:!0}),e.prototype.initRefs=function(){var t=this.refFrame;if((0,J.isString)(t)){var e=this.module.framesById[t];e&&this.set({refFrame:e},{silent:!0})}},e.prototype.getBoxRect=function(){var t=this.attributes;return{x:t.x,y:t.y,width:this.width,height:this.height}},e.prototype.onRemove=function(){!this.refFrame&&this.getComponent().remove({root:1})},e.prototype.changesUp=function(t){void 0===t&&(t={}),t.temporary||t.noCount||t.avoidStore||this.set("changesCount",this.get("changesCount")+1)},e.prototype.getComponent=function(){return this.get("component")},e.prototype.getStyles=function(){return this.get("styles")},e.prototype.disable=function(){this.trigger("disable")},e.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)},e.prototype.getHead=function(){return Wt([],this.head,!0)},e.prototype.setHead=function(t){return this.set("head",Wt([],t,!0))},e.prototype.addHeadItem=function(t){this.head.push(t)},e.prototype.getHeadByAttr=function(t,e,n){return this.head.filter((function(r){return r.attributes&&r.attributes[t]==e&&(!n||n===r.tag)}))[0]},e.prototype.removeHeadByAttr=function(t,e,n){var r=this.getHeadByAttr(t,e,n),o=this.head.indexOf(r);o>=0&&this.head.splice(o,1)},e.prototype.addLink=function(t){var e="link";!this.getHeadByAttr("href",t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:"stylesheet"}})},e.prototype.removeLink=function(t){this.removeHeadByAttr("href",t,"link")},e.prototype.addScript=function(t){var e="script";!this.getHeadByAttr("src",t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},e.prototype.removeScript=function(t){this.removeHeadByAttr("src",t,"script")},e.prototype.getPage=function(){var t;return null===(t=this.collection)||void 0===t?void 0:t.page},e.prototype._emitUpdated=function(t){void 0===t&&(t={}),this.em.trigger("frame:updated",zt({frame:this},t))},e.prototype.hasAutoHeight=function(){return!("auto"!==this.attributes.height&&!this.config.infiniteCanvas)},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=gt.A.prototype.toJSON.call(this,t),n=(0,J.result)(this,"defaults");return t.fromUndo&&delete e.component,delete e.styles,delete e.changesCount,e[qt]&&delete e.width,e[Gt]&&delete e.height,e.refFrame&&(e.refFrame=e.refFrame.id,delete e.component),(0,J.forEach)(e,(function(t,n){0===n.indexOf("_")&&delete e[n]})),(0,J.forEach)(n,(function(t,n){e[n]===t&&delete e[n]})),(0,J.forEach)(["attributes","head"],(function(t){(0,J.isEmpty)(e[t])&&delete e[t]})),e},e}(gt.A);const Xt=Yt;var Jt=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zt=function(t){function e(e,n){void 0===n&&(n=[]);var r=t.call(this,e,n,Xt)||this;return r.loadedItems=0,r.itemsToLoad=0,(0,J.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 Jt(e,t),e.prototype.onAdd=function(t){this.module.framesById[t.id]=t},e.prototype.onReset=function(t,e){var n=this;((null==e?void 0:e.previousModels)||[]).map((function(t){return n.onRemove(t)}))},e.prototype.onRemove=function(t){t.onRemove(),delete this.module.framesById[t.id]},e.prototype.initRefs=function(){this.forEach((function(t){return t.initRefs()}))},e.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger("loaded:all"),this.listenToLoadItems(!1))},e.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},e.prototype.listenToLoadItems=function(t){var e=this;this.forEach((function(n){return n[t?"on":"off"]("loaded",e.itemLoaded)}))},e}(Ut);const Qt=Zt;var te=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ee=function(t){function e(e){var n=this,r=e.em,o=e.config,i=o.scripts,s=o.styles;return(n=t.call(this,e,{scripts:i,styles:s})||this).set("frames",new Qt(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(r,"change:device ".concat(jt),n.updateDevice),n.listenTo(r,Ht.select,n._pageUpdated),n}return te(e,t),e.prototype.defaults=function(){return{frame:"",frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[],pointer:ot.lK,pointerScreen:ot.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){return t.disable()})),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(),r=t.frame||e.getCurrentFrameModel();if(r&&n){var o=n.attributes,i=o.width,s=o.height;r.set({width:i,height:s},{noUndo:1})}},e.prototype.onZoomChange=function(){var t=this.em,e=this.module;this.get("zoom")<1&&this.set("zoom",1),t.trigger(e.events.zoom)},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=ot.x2.World);var e=this.attributes,n=e.pointer,r=e.pointerScreen;return t===ot.x2.World?n:r},e}(gt.A);const ne=ee;var re=Y(683),oe=Y(249),ie=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),se=function(t){function e(e,n){void 0===n&&(n=[]);var r=t.call(this,e,n,re.A)||this;r.on("add",r.onAdd),r.on("change",r.onChange),r.on("remove",r.onRemove);var o=r.em;r.refreshDbn=(0,J.debounce)((function(){return r.refresh()}),0);var i="component:resize styleable:change component:input ".concat(oe.I.update," frame:updated undo redo");return r.listenTo(o,i,(function(){return r.refreshDbn()})),r}return ie(e,t),Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this.module.events},enumerable:!1,configurable:!0}),e.prototype.refresh=function(){var t=this.em,e=this.events;t.trigger(e.spot)},e.prototype.onAdd=function(t){this.__trgEvent(this.events.spotAdd,{spot:t})},e.prototype.onChange=function(t){this.__trgEvent(this.events.spotUpdate,{spot:t})},e.prototype.onRemove=function(t){this.__trgEvent(this.events.spotRemove,{spot:t})},e.prototype.__trgEvent=function(t,e){this.module.em.trigger(t,e),this.refreshDbn()},e}(Ut);const ae=se;var le;!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"}(le||(le={}));const ce=le;var ue=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(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}(ot.Ss);const de=pe;var fe=Y(926),he=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ge=function(t){function e(e,n){void 0===e&&(e={}),void 0===n&&(n=!1);var r=t.call(this,e)||this;return r.itemsView="",r.itemType="type",r.reuseView=!1,r.viewCollection=[],n&&r.listenTo(r.collection,"add",r.addTo),r}return he(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){},e.prototype.add=function(t,e){var n,r=this.reuseView,o=this.viewCollection,i=e||null,s=t.get(this.itemType);n=t.view&&r?t.view:this.renderView(t,s),o.push(n);var a=n.render().el;i?i.appendChild(a):this.$el.append(a)},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(),ot.Ss.prototype.remove.apply(this,t),this.onRemove(e,t),this},e.prototype.clearItems=function(){this.viewCollection},e}(de);var ve=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),me=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{};var r=n.model;return n.listenTo(r,"change",n.render),n.listenTo(r,"destroy remove",n.remove),n.listenTo(r.get("selectors"),"change",n.render),n}return ve(e,t),e.prototype.tagName=function(){return"style"},e.prototype.render=function(){var t=this.model,e=this.el,n=t.get("important");return e.innerHTML=t.toCSS({important:n}),this},e}(ot.Ss);const ye=me;var be=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const we=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return be(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}(ye);var _e=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xe=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):"")},Ce=function(t){function e(e){var n=t.call(this,e)||this;(0,J.bindAll)(n,"sortRules");var r=e.config||{};n.atRules={},n.config=r,n.em=r.em,n.pfx=r.stylePrefix||"",n.className=n.pfx+"rules";var o=n.collection;return n.listenTo(o,"add",n.addTo),n.listenTo(o,"reset",n.render),n}return _e(e,t),e.prototype.addTo=function(t){this.addToCollection(t)},e.prototype.addToCollection=function(t,e){if(this.renderStarted){var n,r,o=e||null,i={model:t,config:this.config};if("keyframes"===t.get("atRuleType")){var s=t.getAtRule(),a=this.atRules[s];if(!a){var l=document.createElement("style");a=document.createTextNode(""),l.appendChild(document.createTextNode("".concat(s,"{"))),l.appendChild(a),l.appendChild(document.createTextNode("}")),this.atRules[s]=a,n=l}r=new we(i),a.appendData(r.render().el.textContent)}else n=(r=new ye(i)).render().el;var c=this.className,u=t.get("mediaText"),p=xe(c),d=p;if(u&&(d=xe(c,this.getMediaWidth(u))),n){var f=o||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}},e.prototype.getMediaWidth=function(t){return t&&t.replace("(".concat(this.em.getConfig().mediaCondition,": "),"").replace(")","")},e.prototype.sortRules=function(t,e){var n=-1!==(this.em.getConfig().mediaCondition||"").indexOf("min-width");return n?(n?t:e)-(n?e:t):0},e.prototype.render=function(){var t=this;this.renderStarted=!0,this.atRules={};var e=this,n=e.em,r=e.$el,o=e.collection,i=this.className,s=document.createDocumentFragment();r.empty();var a=n.Devices.getAll().pluck("priority").sort(this.sortRules);return a.every((function(t){return t}))&&a.unshift(0),a.forEach((function(t){return s.appendChild((0,fe.a_)("div",{id:xe(i,t)}))})),o.each((function(e){return t.addToCollection(e,s)})),r.append(s),r.attr("class",i),this},e}(ot.Ss);const Se=Ce;var Te="text/html",Oe=Te,Ae=function(){return Ae=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ae.apply(this,arguments)},Ee="parse:html";const ke=function(t,e){return void 0===e&&(e={}),{compTypes:[],modelAttrStart:"data-gjs-",getPropAttribute:function(t,e){var n=t.replace(this.modelAttrStart,""),r=(null==e?void 0:e.length)||0,o=null==e?void 0:e.substring(0,1),i=null==e?void 0:e.substring(r-1),s="true"===e||"false"!==e&&e;try{s="{"==o&&"}"==i||"["==o&&"]"==i?JSON.parse(s):s}catch(t){}return{name:n,value:s}},splitPropsFromAttr:function(t){var e=this;void 0===t&&(t={});var n={},r={};return(0,J.each)(t,(function(t,o){if(0===o.indexOf(e.modelAttrStart)){var i=e.getPropAttribute(o,t);n[i.name]=i.value}else r[o]=t})),{props:n,attrs:r}},parseStyle:function(t){for(var e={};t.indexOf("/*")>=0;){var n=t.indexOf("/*"),r=t.indexOf("*/")+2;t=t.replace(t.slice(n,r),"")}for(var o=t.split(";"),i=0,s=o.length;i<s;i++){var a=o[i].trim();if(a){var l=a.split(":"),c=l[0].trim(),u=l.slice(1).join(":").trim();e[c]?((0,J.isArray)(e[c])||(e[c]=[e[c]]),e[c].push(u)):e[c]=u}}return e},parseClass:function(t){for(var e=[],n=t.split(" "),r=0,o=n.length;r<o;r++){var i=n[r].trim();i&&e.push(i)}return e},parseNodeAttr:function(t,e){for(var n=e||{},r=t.attributes||[],o=r.length,i=0;i<o;i++){var s=r[i].nodeName,a=r[i].nodeValue;if("style"==s)n.style=this.parseStyle(a);else if("class"==s)n.classes=this.parseClass(a);else{if("contenteditable"==s)continue;if(0===s.indexOf(this.modelAttrStart)){var l=this.getPropAttribute(s,a);n[l.name]=l.value}else""===a&&!0===t[s]&&(a=!0),n.attributes||(n.attributes={}),n.attributes[s]=a}}return n},detectNode:function(t,e){var n;void 0===e&&(e={});var r=this.compTypes,o={};if(r){var i=null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"".concat(this.modelAttrStart,"type"));if(i)o={type:i};else for(var s=0;s<r.length;s++){var a=r[s],l=a.model.isComponent(t,e);if(l){"object"!=typeof l&&(l={type:a.id}),o=l;break}}}return o},parseNode:function(t,n){var r;void 0===n&&(n={});var o=(null===(r=t.content)||void 0===r?void 0:r.childNodes)||t.childNodes,i=o.length,s=this.detectNode(t,n);if(!s.tagName){var a=t.tagName||"",l=t.namespaceURI||"";s.tagName=a&&"http://www.w3.org/1999/xhtml"===l?a.toLowerCase():a}if(s=this.parseNodeAttr(t,s),i||"/>"!=="".concat(t.outerHTML).slice(-2)||(s.void=!0),i&&!s.components&&!n.skipChildren){var c=o[0];1===i&&3===c.nodeType?(!s.type&&(s.type="text"),s.components={type:"textnode",content:c.nodeValue}):s.components=this.parseNodes(t,Ae(Ae({},n),{inSvg:n.inSvg||"svg"===s.type}))}var u=s.components;if(!s.type&&(null==u?void 0:u.length)){for(var p=e.textTypes,d=void 0===p?[]:p,f=e.textTags,h=void 0===f?[]:f,g=!0,v=!1,m=0;m<u.length;m++){var y=u[m],b=y.type;if(!d.includes(b)&&!h.includes(y.tagName)){g=!1;break}"textnode"===b&&(v=!0)}g&&v&&(s.type="text")}return s},parseNodes:function(t,e){var n;void 0===e&&(e={});for(var r=[],o=(null===(n=t.content)||void 0===n?void 0:n.childNodes)||t.childNodes,i=o.length,s=0;s<i;s++){var a=o[s],l=r[r.length-1],c=this.parseNode(a,e);if("textnode"===c.type){if("textnode"===(null==l?void 0:l.type)){l.content+=c.content;continue}if(!e.keepEmptyTextNodes){var u=a.nodeValue||"",p=0===s||s===i-1,d=u.includes("\n");if(" "!=u&&!u.trim()&&(p||d))continue}}!c.tagName&&(0,J.isUndefined)(c.content)||r.push(c)}return r},parse:function(n,r,o){var i,s,a;void 0===o&&(o={});var l=(null==t?void 0:t.get("Config"))||{},c={html:[]},u=Ae(Ae({},e),o),p=Ae(Ae(Ae({},e.optionsHtml),{htmlType:(null===(i=e.optionsHtml)||void 0===i?void 0:i.htmlType)||e.htmlType}),o),d=p.preParser,f=p.asDocument,h=(0,J.isFunction)(d)?d(n,{editor:null==t?void 0:t.getEditor()}):n,g=(0,J.isFunction)(u.parserHtml)?u.parserHtml(h,p):function(t,e){void 0===e&&(e={});var n,r=new DOMParser,o=e.htmlType||Oe,i=o===Te,s=i?t:"<div>".concat(t,"</div>"),a=r.parseFromString(s,o);if(i){if(e.asDocument)return a;var l=a.head,c=a.body,u=l.querySelectorAll("script");(0,J.each)(u,(function(t){return c.appendChild(t)}));var p=[];(0,J.each)(l.children,(function(t){return p.push(t)})),(0,J.each)(p,(function(t,e){return c.insertBefore(t,c.children[e])})),n=c}else n=a.firstChild;return n}(h,p),v=g,m=g;f&&(v=m.documentElement,c.doctype=(0,fe.LJ)(m.doctype));var y=v.querySelectorAll("script"),b=y.length;if(!((0,J.isUndefined)(l.allowScripts)?p.allowScripts:l.allowScripts))for(;b--;)null===(s=y[b].parentNode)||void 0===s||s.removeChild(y[b]);if(p.allowUnsafeAttr&&p.allowUnsafeAttrValue||this.__sanitizeNode(v,p),r){for(var w=v.querySelectorAll("style"),_=w.length,x="";_--;)x=w[_].innerHTML+x,null===(a=w[_].parentNode)||void 0===a||a.removeChild(w[_]);x&&(c.css=r.parse(x))}null==t||t.trigger("".concat(Ee,":root"),{input:h,root:v});var C=[];if(f)c.head=this.parseNode(m.head,u),c.root=this.parseNodeAttr(v),C=this.parseNode(m.body,u);else{var S=this.parseNodes(v,u);C=1!==S.length||u.returnArray?S:S[0]}return c.html=C,null==t||t.trigger(Ee,{input:h,output:c}),c},__sanitizeNode:function(t,e){var n=this,r=t.attributes||[],o=t.childNodes||[],i=[];(0,J.each)(r,(function(t){var n=t.nodeName||"",r=t.nodeValue||"";!e.allowUnsafeAttr&&n.startsWith("on")&&i.push(n),!e.allowUnsafeAttrValue&&r.startsWith("javascript:")&&i.push(n)})),i.map((function(e){return t.removeAttribute(e)})),(0,J.each)(o,(function(t){return n.__sanitizeNode(t,e)}))}}};var Pe=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),je=function(){return je=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},je.apply(this,arguments)},Me=ke(),Ne=function(t){return(0,J.isArray)(t)?t[t.length-1]:t},Le=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Pe(e,t),e.prototype.parseStyle=function(t){return Me.parseStyle(t)},e.prototype.extendStyle=function(t){return je(je({},this.getStyle()),t)},e.prototype.getStyle=function(t){var e=this.get("style")||{},n=je({},e);return t&&(0,J.isString)(t)?n[t]:n},e.prototype.setStyle=function(t,e){var n=this;void 0===t&&(t={}),void 0===e&&(e={}),(0,J.isString)(t)&&(t=this.parseStyle(t));var r=this.getStyle(e);e.partial||e.avoidStore?(e.avoidStore=!0,t.__p=!0):delete t.__p;var o=je({},t),i=je({},o);(0,J.keys)(i).forEach((function(t){""===i[t]&&delete i[t]})),this.set("style",i,e);var s=(0,Z.shallowDiff)(r,o);return delete s.__p,(0,J.keys)(s).forEach((function(t){var r=n.em;e.noEvent||(n.trigger("change:style:".concat(t)),r&&(r.trigger("styleable:change",n,t,e),r.trigger("styleable:change:".concat(t),n,t,e)))})),o},e.prototype.addStyle=function(t,e,n){var r;void 0===e&&(e=""),void 0===n&&(n={}),"string"==typeof t?((r={})[t]=e,t=r):n=e||{},n.addStyle=t,t=this.extendStyle(t),this.setStyle(t,n)},e.prototype.removeStyle=function(t){var e=this.getStyle();delete e[t],this.setStyle(e)},e.prototype.styleToString=function(t){void 0===t&&(t={});var e=[],n=this.getStyle(t),r=t.important,o=function(t){var o=(0,J.isArray)(r)?r.indexOf(t)>=0:r;if("__"===t.substring(0,2))return"continue";var i=n[t];((0,J.isArray)(i)?i:[i]).forEach((function(n){var r="".concat(n).concat(o?" !important":"");r&&e.push("".concat(t,":").concat(r,";"))}))};for(var i in n)o(i);return e.join("")},e.prototype.getSelectors=function(){return this.get("selectors")||this.get("classes")},e.prototype.getSelectorsString=function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},e}(ot.Kx);const Ie=Le;var $e=function(){return $e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},$e.apply(this,arguments)},De=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Re=function(t){return(0,J.isArray)(t.get(Hn))},He=function(t){return!!t.get(Fn)},Fe=function(t){return!(!Re(t)&&!He(t))},Ve=function(t){var e=t.parent();return Fe(t)&&(!e||!Fe(e))},Ue=function(t){t.__symbReady||(t.on("change",t.__upSymbProps),t.__symbReady=!0)},Be=function(t){var e=t.get(Fn);if(e&&(0,J.isString)(e)){var n=t.__getAllById()[e];n?(e=n,t.set(Fn,n)):e=0}return e||void 0},ze=function(t){var e=null==t?void 0:t.get(Hn);return e&&(0,J.isArray)(e)&&(e.forEach((function(n,r){n&&(0,J.isString)(n)&&(e[r]=t.__getAllById()[n])})),e=e.filter((function(t){return t&&!(0,J.isString)(t)}))),e||void 0},We=function(t,e){void 0===e&&(e="");var n=null==t?void 0:t.get(Vn),r=e.split(":")[0],o=e!==r?[e,r]:[e];return!0===n||(0,J.isArray)(n)&&o.some((function(t){return n.indexOf(t)>=0}))},qe=function(t,e){void 0===e&&(e={});var n=[],r=e.changed;if(e.fromInstance||e.noPropagate||e.fromUndo||r&&We(t,r))return n;var o=ze(t)||[],i=Be(t);return n=(i?De([i],ze(i)||[],!0):o).filter((function(e){return e!==t})).filter((function(t){return!(r&&We(t,r))})),n},Ge=function(t,e){for(var n=t,r=t.parent(e);r&&Fe(r);)n=r,r=r.parent(e);return n},Ke=function(t,e){void 0===e&&(e={});var n=Be(t),r=n&&ze(n);!e.skipRefs&&r&&n.set(Hn,r.filter((function(e){return e!==t}))),t.set(Fn,0),t.components().forEach((function(t){return Ke(t,e)}))},Ye=function(t,e,n,r){void 0===r&&(r={});var o=Be(t),i=ze(t);(o||i)&&t.em.log(e,{model:t,toUp:n,context:"symbols",opts:r})},Xe=function(t,e,n,r){var o=r||n||{},i={fromInstance:o.fromInstance,fromUndo:o.fromUndo},s=e.opt.temporary;if(r)if(r.add){var a=[],l=!!ze(t);if((y=qe(t,$e($e({},i),{changed:"components:add"}))).length){var c=Be(e);a=ze(c||e)||[],(a=De([],a,!0)).push(c||e)}!s&&Ye(t,"add",y,{opts:r,addedInstances:a.map((function(t){return t.cid})),added:e.cid}),y.forEach((function(n){var o=Ge(n),i=a.filter((function(t){var e=Ge(t,{prev:1});return o&&e&&e===o}))[0]||e.clone({symbol:!0,symbolInv:l});n.append(i,$e({fromInstance:t},r))}))}else{var u=Be(e);if(u&&!r.temporary&&u.set(Hn,ze(u).filter((function(t){return t!==e}))),!Ve(e)&&!r.skipRefsUp){var p="components:remove",d=r.index,f=e.parent(),h=$e({fromInstance:e},r),g=Ve(e),v=function(t){var e=t.parent();e&&!We(e,p)&&t.remove(h)};y=We(f,p)?[]:qe(e,i),g&&(y=f&&qe(f,$e($e({},i),{changed:p})),v=function(t){var e=t.components().at(d);e&&e.remove($e({fromInstance:f},h))}),!s&&Ye(t,"remove",y,{opts:r,removed:e.cid,isSymbNested:g}),y.forEach(v)}}else{var m=e,y=qe(t,$e($e({},i),{changed:"components:reset"})),b=m.models,w=new Set;Ye(t,"reset",y,{components:b}),y.forEach((function(e){var r=e.components(),o=b.map((function(t,e){return!Fe(t)||w.has(t)?(w.add(t),t.clone({symbol:!0})):r.at(e)}));r.reset(o,$e({fromInstance:t},n))}))}t.__changesUp(o)},Je=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ze=function(){return Ze=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ze.apply(this,arguments)},Qe=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},tn=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},en=function(t,e){return void 0===e&&(e=[]),t?(((0,J.isArray)(t)||(0,J.isFunction)(t.map)?t:[t]).map((function(t){e.push(t.getId()),en(t.components().models,e)})),e):[]},nn=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={}),n.visitedCmps=n.visitedCmps||{};var r=n.visitedCmps;return((0,J.isArray)(t)?t:[t]).map((function(t){var o=t.attributes,i=void 0===o?{}:o,s=t.components,a=t.tagName,l=t.style,c=i.id,u=(i.draggable,Qe(i,["id","draggable"])),p=t;if(c)if(r[c])r[c].push(p),c=Wn.getNewId(e),p.attributes.id=c;else if(r[c]=[],e[c]){var d=p=e[c];a&&d.set({tagName:a},Ze(Ze({},n),{silent:!0})),(0,J.keys)(u).length&&d.addAttributes(u,Ze({},n)),(0,J.keys)(l).length&&d.addStyle(l,n)}if(s){var f=nn(s,e);if((0,J.isFunction)(p.components)){var h=p.components();h.length>0&&h.reset(f,n)}else p.components=f}return p}))},rn=function(t){function e(e,n){var r=t.call(this,e,n)||this;r.opt=n,r.listenTo(r,"add",r.onAdd),r.listenTo(r,"remove",r.removeChildren),r.listenTo(r,"reset",r.resetChildren);var o=n.em,i=n.config;return r.config=i,r.em=o,r.domc=n.domc||(null==o?void 0:o.Components),r}return Je(e,t),Object.defineProperty(e.prototype,"events",{get:function(){var t;return null===(t=this.domc)||void 0===t?void 0:t.events},enumerable:!1,configurable:!0}),e.prototype.resetChildren=function(t,e){var n=this;void 0===e&&(e={});var r=this,o=e.previousModels||[],i=o.filter((function(e){return!t.get(e.cid)})),s=en(t),a=en(o).filter((function(t){return s.indexOf(t)>=0}));e.keepIds=(e.keepIds||[]).concat(a),i.forEach((function(t){return n.removeChildren(t,r,e)})),t.each((function(t){return n.onAdd(t)}))},e.prototype.resetFromString=function(t,e){var n,r;void 0===t&&(t=""),void 0===e&&(e={}),e.keepIds=en(this);var o=this,i=o.domc,s=o.em,a=o.parent,l=null==s?void 0:s.Css,c=(null==i?void 0:i.allById())||{},u=this.parseString(t,e),p=nn(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==s||s.trigger("component:content",a,e,t),null===(r=(n=a).__checkInnerChilds)||void 0===r||r.call(n)},e.prototype.removeChildren=function(t,e,n){var r=this;if(void 0===n&&(n={}),t){var o=this.domc,i=this.em,s=n.temporary||n.fromUndo;if(t.prevColl=this,!s){var a=t.getId(),l=i.Selectors.getAll(),c=i.Css.getAll(),u=(n.keepIds||[]).indexOf(a)<0;delete(o?o.allById():{})[a];var p=u?c.remove(c.filter((function(t){return t.getSelectors().getFullString()==="#".concat(a)})),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.removed(),t.trigger("removed"),i.trigger(oe.I.remove,t),o&&He(t)&&Ve(t)&&o.symbols.__trgEvent(o.events.symbolInstanceRemove,{component:t},!0));var d=t.components();d.forEach((function(t){Xe(t,t,d,Ze(Ze({},n),{skipRefsUp:!0})),r.removeChildren(t,e,n)}))}var f=t.components();i.stopListening(f),i.stopListening(t),i.stopListening(t.get("classes")),t.__postRemove()}},e.prototype.model=function(t,e){var n,r=e.collection.opt,o=r.em,i=o.Components.componentTypes;e.em=o,e.config=r.config,e.componentTypes=i,e.domc=r.domc;for(var s=0;s<i.length;s++)if(i[s].id==t.type){n=i[s].model;break}return n||(n=i[i.length-1].model,o&&t.type&&o.logWarning("Component type '".concat(t.type,"' not found"),{attrs:t,options:e})),new n(t,e)},e.prototype.parseString=function(t,e){void 0===e&&(e={});var n=this,r=n.em,o=n.domc,i=n.parent,s=e.asDocument&&(null==i?void 0:i.is("wrapper")),a=r.Css,l=r.Parser.parseHtml(t,Ze({asDocument:s},e.parserOptions)),c=l.html;if(s){var u=i,p=l.html||{},d=p.components,f=Qe(p,["components"]),h=l.head||{},g=h.components,v=Qe(h,["components"]);c=d,u.set(f,e),u.head.set(v,e),u.head.components(g,e),u.docEl.set(l.root,e),u.set({doctype:l.doctype})}if(Wn.checkId(c,l.css,o.componentsById,e),l.css&&a&&!e.temporary){e.at;var m=Qe(e,["at"]);a.addCollection(l.css,Ze(Ze({},m),{extend:1}))}return c},e.prototype.add=function(e,n){var r=this;if(void 0===n&&(n={}),null!=e){n.keepIds=tn(tn([],n.keepIds||[],!0),en(n.previousModels),!0),(0,J.isString)(e)?e=this.parseString(e,n):(0,J.isArray)(e)&&e.forEach((function(t,o){if((0,J.isString)(t)){var i=r.parseString(t,n);e[o]=(0,J.isArray)(i)&&!i.length?null:i}}));var o=((0,J.isArray)(e)?e:[e]).filter(Boolean).map((function(t){return r.processDef(t)}));return e=(0,J.isArray)(e)?(0,J.flatten)(o,1):o[0],t.prototype.add.call(this,e,n)}},e.prototype.processDef=function(t){if(t.cid&&t.ccid)return t;var e=this.em,n=this.config,r=(void 0===n?{}:n).processor,o=t;if(r){var i=r(o=Ze({},o));i&&((0,J.each)(o,(function(t,e){return delete o[e]})),(0,J.extend)(o,i))}if(o.$$typeof&&"object"==typeof o.props){(o=Ze({},o)).props=Ze({},o.props);var s=e.Components,a=e.Parser.parserHtml;(0,J.each)(o,(function(t,e){(0,J.includes)(["props","type"],e)||delete o[e]}));var l=o.props,c=l.children;delete l.children,delete o.props;var u=a.splitPropsFromAttr(l);o.attributes=u.attrs,c&&(o.components=c),o.type?s.getType(o.type)||(o.tagName=o.type,delete o.type):o.type="textnode",(0,J.extend)(o,u.props)}return o},e.prototype.onAdd=function(t,e,n){void 0===n&&(n={});var r=this.domc,o=this.em,i=t.getStyle(),s=o&&o.getConfig().avoidInlineStyle;if(r&&r.Component.ensureInList(t),!(0,J.isEmpty)(i)&&!s&&o&&o.getConfig().forceClass&&!n.temporary){var a=t.cid;o.Css.setClassRule(a,i),t.setStyle({}),t.addClass(a)}if(t.__postAdd({recursive:!0}),o&&!n.temporary){var l=function(t){o.trigger(oe.I.add,t,n),t.components().forEach((function(t){return l(t)}))};l(t),r&&He(t)&&Ve(t)&&r.symbols.__trgEvent(r.events.symbolInstanceAdd,{component:t},!0)}},e}(ot.pM);const on=rn;var sn=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),an=function(t){function e(n,r){void 0===r&&(r={});var o=t.call(this,n,r)||this,i=r.config,s=void 0===i?{}:i,a=o.get("name"),l=o.get("label");a?l||o.set("label",a):o.set("name",l);var c=o.get("name"),u=s.escapeName,p=u?u(c):e.escapeName(c);return o.set("name",p),o.em=r.em,o}return sn(e,t),e.prototype.defaults=function(){return{name:"",label:"",type:1,active:!0,private:!1,protected:!1,_undo:!0}},e.prototype.isId=function(){return 2===this.get("type")},e.prototype.isClass=function(){return 1===this.get("type")},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.escape,n=this.get("name"),r="";switch(this.get("type")){case 1:r=".";break;case 2:r="#"}return r+(e?e(n):n)},e.prototype.toString=function(){return this.getFullName()},e.prototype.getName=function(){return this.get("name")||""},e.prototype.getLabel=function(){return this.get("label")||""},e.prototype.setLabel=function(t){return this.set("label",t)},e.prototype.getActive=function(){return!!this.get("active")},e.prototype.setActive=function(t){return this.set("active",t)},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=this.em,n=ot.Kx.prototype.toJSON.call(this,[t]),r=(0,J.result)(this,"defaults");if(null==e?void 0:e.getConfig().avoidDefaults){(0,J.forEach)(r,(function(t,e){n[e]===t&&delete n[e]})),n.label===n.name&&delete n.label;var o=(0,J.keys)(n).length;1===o&&n.name&&(n=n.name),2===o&&n.name&&n.type&&(n=this.getFullName())}return n},e.escapeName=function(t){return"".concat(t).trim().replace(/\s+/g,"-")},e.TYPE_CLASS=1,e.TYPE_ID=2,e}(ot.Kx);const ln=an;an.prototype.idAttribute="name";var cn=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),un=function(t,e){return t.reduce((function(n,r,o){return n.concat(un(t.slice(o+1),"".concat(e).concat(r)))}),[e])},pn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return cn(e,t),e.prototype.modelId=function(t){return"".concat(t.name,"_").concat(t.type||ln.TYPE_CLASS)},e.prototype.getStyleable=function(){return(0,J.filter)(this.models,(function(t){return t.getActive()&&!t.get("private")}))},e.prototype.getValid=function(t){var e=(void 0===t?{}:t).noDisabled;return(0,J.filter)(this.models,(function(t){return!t.get("private")})).filter((function(t){return e?t.get("active"):1}))},e.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()},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.combination,n=t.array,r=[],o=this.map((function(e){return e.getFullName(t)})).sort();return e?o.forEach((function(t,e){r=r.concat(un(o.slice(e+1),t))})):r=o,n?r:e?r.join(","):r.join("")},e}(ot.pM);const dn=pn;pn.prototype.model=ln;var fn=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hn=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};const gn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fn(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}(ot.Kx);function vn(t){var e=new Set,n=new Map,r={items:[]};t.forEach((function(t){var o=t.category;if(o){e.add(o);var i=n.get(o);i?i.push(t):n.set(o,[t])}else r.items.push(t)}));var o=Array.from(e).map((function(t){return{category:t,items:n.get(t)||[]}}));return hn(hn([],o,!0),[r],!1)}var mn=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yn="category",bn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return mn(e,t),e.prototype.initCategory=function(t){var e=t.get(yn),n=e instanceof gn;if(e&&!n){(0,J.isString)(e)?e={id:e,label:e}:(0,Z.isObject)(e)&&!e.id&&(e.id=e.label);var r=this.getCategories().add(e);return t.set(yn,r,{silent:!0}),r}if(n)return r=e,this.getCategories().add(r),r},e}(ot.pM),wn=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_n=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e,n)||this,o=n.events,i=n.em,s=null==o?void 0:o.update;return i&&s&&r.on("change",(function(t,e){return i.trigger(s,{category:t,changes:t.changedAttributes(),options:e})})),r}return wn(e,t),e.prototype.add=function(e,n){return((0,J.isArray)(e)?e:[e]).forEach((function(t){return t&&(t.id=(0,Z.normalizeKey)("".concat(t.id)))})),t.prototype.add.call(this,e,n)},e.prototype.get=function(e){return t.prototype.get.call(this,(0,J.isString)(e)?(0,Z.normalizeKey)(e):e)},e}(ot.pM);const xn=_n;var Cn;_n.prototype.model=gn,function(t){t.select="trait:select",t.value="trait:value",t.categoryUpdate="trait:category:update",t.custom="trait:custom",t.all="trait"}(Cn||(Cn={}));const Sn=Cn;var Tn=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),On=function(){return On=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},On.apply(this,arguments)},An=function(t){function e(e,n){var r=t.call(this,e)||this,o=r.attributes,i=o.target,s=o.name;return!r.get("id")&&r.set("id",s),i&&r.setTarget(i),r.em=n,r}return Tn(e,t),e.prototype.defaults=function(){return{type:"text",label:"",name:"",unit:"",step:1,value:"",default:"",placeholder:"",category:"",changeProp:!1,options:[]}},Object.defineProperty(e.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){var t=this.get("category");return t instanceof gn?t:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"component",{get:function(){return this.target},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changeProp",{get:function(){return!!this.get("changeProp")},enumerable:!1,configurable:!0}),e.prototype.setTarget=function(t){if(t){var e=this.attributes,n=e.name,r=e.changeProp,o=e.value,i=e.getValue;this.target=t,this.unset("target");var s=r?"change:".concat(n):"change:attributes:".concat(n);this.listenTo(t,s,this.targetUpdated);var a=o||(i?void 0:this.getValue());!(0,J.isUndefined)(a)&&this.set({value:a},{silent:!0})}},e.prototype.getId=function(){return this.get("id")},e.prototype.getType=function(){return this.get("type")},e.prototype.getName=function(){return this.get("name")},e.prototype.getLabel=function(t){var e;void 0===t&&(t={});var n=t.locale,r=void 0===n||n,o=this.getId(),i=this.get("label")||this.getName();return r&&(null===(e=this.em)||void 0===e?void 0:e.t("traitManager.traits.labels.".concat(o)))||i},e.prototype.getValue=function(t){return this.getTargetValue(t)},e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={});var r=this.component,o=this.em,i=e.partial,s={},a=this.attributes.setValue;a?a({value:t,component:r,editor:null==o?void 0:o.getEditor(),trait:this,partial:!!i,options:e,emitUpdate:function(){return n.targetUpdated()}}):(i&&(s.avoidStore=!0),this.setTargetValue(t,s))},e.prototype.getDefault=function(){return this.get("default")},e.prototype.getOptions=function(){return this.get("options")||[]},e.prototype.getOption=function(t){var e=this,n=(0,Z.isDef)(t)?t:this.getValue();return this.getOptions().filter((function(t){return e.getOptionId(t)===n}))[0]},e.prototype.getOptionId=function(t){return t.id||t.value},e.prototype.getOptionLabel=function(t,e){var n;void 0===e&&(e={});var r=e.locale,o=void 0===r||r,i=(0,J.isString)(t)?this.getOption(t):t,s=this.getOptionId(i),a=i.label||i.name||s,l=this.getName();return o&&(null===(n=this.em)||void 0===n?void 0:n.t("traitManager.traits.options.".concat(l,".").concat(s)))||a},e.prototype.getCategoryLabel=function(t){void 0===t&&(t={});var e=this.em,n=this.category,r=t.locale,o=void 0===r||r,i=null==n?void 0:n.getId(),s=null==n?void 0:n.getLabel();return o&&(null==e?void 0:e.t("traitManager.categories.".concat(i)))||s||""},e.prototype.runCommand=function(){var t=this.em,e=this.attributes.command;if(e&&t)return(0,J.isString)(e)?t.Commands.run(e):e(t.Editor,this)},e.prototype.props=function(){return this.attributes},e.prototype.targetUpdated=function(){var t=this.component,e=this.em,n=this.getTargetValue({useType:!0});this.set({value:n},{fromTarget:1});var r={trait:this,component:t,value:n};t.trigger(Sn.value,r),null==e||e.trigger(Sn.value,r),null==e||e.trigger("trait:update",r)},e.prototype.getTargetValue=function(t){void 0===t&&(t={});var e,n=this.component,r=this.em,o=this.getName(),i=this.get("getValue");if(e=i?i({editor:null==r?void 0:r.getEditor(),trait:this,component:n}):this.changeProp?n.get(o):n.getAttributes()[o],t.useType&&"checkbox"===this.getType()){var s=this.attributes,a=s.valueTrue,l=s.valueFalse;(0,J.isUndefined)(a)||a!==e?(0,J.isUndefined)(l)||l!==e||(e=!1):e=!0}return(0,J.isUndefined)(e)?"":e},e.prototype.setTargetValue=function(t,e){var n;void 0===e&&(e={});var r=this.component,o=this.attributes,i=this.getName();if(!(0,J.isUndefined)(t)){var s=t;if("false"===t?s=!1:"true"===t&&(s=!0),"checkbox"===this.getType()){var a=o.valueTrue,l=o.valueFalse;s&&!(0,J.isUndefined)(a)&&(s=a),s||(0,J.isUndefined)(l)||(s=l)}var c=((n={})[i]=s,n);c.__p=e.avoidStore?null:void 0,this.changeProp?r.set(c,e):r.addAttributes(c,e)}},e.prototype.setValueFromInput=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n={});var r={value:t};this.set(r,On(On({},n),{avoidStore:1})),e&&(this.set("value","",n),this.set(r,n))},e.prototype.getInitValue=function(){var t,e=this.component,n=this.getName();if(e){var r=e.get("attributes");t=this.changeProp?e.get(n):r[n]}return t||this.get("value")||this.get("default")},e}(ot.Kx);const En=An;const kn=function(){function t(t){void 0===t&&(t={}),this.config=t}return t.prototype.build=function(t,e){return(0,J.isString)(t)?this.buildFromString(t,e):new En(t,e)},t.prototype.buildFromString=function(t,e){var n={name:t,type:"text"};return"target"===t&&(n.type="select",n.default=!1,n.options=this.config.optionsTarget),new En(n,e)},t}();var Pn=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jn=function(t){function e(e,n){var r=t.call(this,e)||this;r.categories=new xn;var o=n.em;r.em=o,r.categories=new xn([],{em:o,events:{update:Sn.categoryUpdate}}),r.on("add",r.handleAdd),r.on("reset",r.handleReset);var i=r.module,s=null==i?void 0:i.getConfig();return r.tf=new kn(s),r}return Pn(e,t),Object.defineProperty(e.prototype,"module",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),e.prototype.getCategories=function(){return this.categories},e.prototype.handleReset=function(t,e){var n=(void 0===e?{}:e).previousModels;(void 0===n?[]:n).forEach((function(t){return t.trigger("remove")}))},e.prototype.handleAdd=function(t){t.em=this.em;var e=this.target;e&&(t.target=e),this.initCategory(t)},e.prototype.setTarget=function(t){this.target=t,this.models.forEach((function(e){return e.setTarget(t)}))},e.prototype.add=function(e,n){if(null!=e){var r=this.target,o=this.em;if((0,J.isArray)(e)){for(var i=[],s=0,a=e.length;s<a;s++){var l=e[s];i[s]=l instanceof En?l:this.tf.build(l,o),i[s].setTarget(r)}return t.prototype.add.call(this,i,n)}var c=e instanceof En?e:this.tf.build(e,o);return c.setTarget(r),t.prototype.add.call(this,c,n)}},e}(bn);const Mn=jn;var Nn=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ln=function(){return Ln=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ln.apply(this,arguments)},In=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},$n=function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},Dn=function(t){return!!(null==t?void 0:t.getConfig().avoidInlineStyle)},Rn="component:drag",Hn="__symbols",Fn="__symbol",Vn="__symbol_ovrd",Un=oe.I.update,Bn=oe.I.updateInside,zn=function(t){function e(n,r){void 0===n&&(n={});var o=t.call(this,n,r)||this;(0,J.bindAll)(o,"__upSymbProps","__upSymbCls","__upSymbComps");var i=r.em,s=o.parent(),a=null==s?void 0:s.attributes,l=o.get("propagate");if(l&&o.set("propagate",(0,J.isArray)(l)?l:[l]),a&&a.propagate&&!l){var c={},u=a.propagate;u.forEach((function(t){return c[t]=s.get(t)})),c.propagate=u,o.set(Ln(Ln({},c),n))}if(r&&r.config&&r.config.voidElements.indexOf(o.get("tagName"))>=0&&o.set("void",!0),r.em=i,o.opt=r,o.em=i,o.frame=r.frame,o.config=r.config||{},o.set("attributes",Ln(Ln({},(0,J.result)(o,"defaults").attributes||{}),o.get("attributes")||{})),o.ccid=e.createId(o,r),o.initClasses(),o.initComponents(),o.initTraits(),o.initToolbar(),o.initScriptProps(),o.listenTo(o,"change:script",o.scriptUpdated),o.listenTo(o,"change:tagName",o.tagUpdated),o.listenTo(o,"change:attributes",o.attrUpdated),o.listenTo(o,"change:attributes:id",o._idUpdated),o.on("change:toolbar",o.__emitUpdateTlb),o.on("change",o.__onChange),o.on(Bn,o.__propToParent),o.set("status",""),o.views=[],["classes","traits","components"].forEach((function(t){var e="add remove ".concat("components"!==t?"change":"");o.listenTo(o.get(t),e.trim(),(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o.emitUpdate.apply(o,In([t],e,!1))}))})),!r.temporary){var p=i&&i.Css,d=o.attributes,f=d.styles,h=d.type;f&&p&&p.addCollection(f,{avoidUpdateStyle:!0},{group:"cmp:".concat(h)}),o.__postAdd(),o.init(),Fe(o)&&Ue(o),null==i||i.trigger(oe.I.create,o,r)}return o}return Nn(e,t),Object.defineProperty(e.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})[Fn]=0,t[Hn]=0,t[Vn]=0,t._undo=!0,t._undoexc=["status","open"],t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.get("tagName")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classes",{get:function(){return this.get("classes")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"traits",{get:function(){return this.get("traits")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){var t;return null!==(t=this.get("content"))&&void 0!==t?t:""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toolbar",{get:function(){return this.get("toolbar")||[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resizable",{get:function(){return this.get("resizable")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"delegate",{get:function(){return this.get("delegate")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locked",{get:function(){return this.get("locked")},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.updated=function(t,e,n){},e.prototype.removed=function(){},e.prototype.__postAdd=function(t){void 0===t&&(t={});var e=this.em,n=null==e?void 0:e.UndoManager,r=this.components();n&&!this.__hasUm&&(n.add(r),n.add(this.getSelectors()),this.__hasUm=!0),t.recursive&&r.map((function(e){return e.__postAdd(t)}))},e.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)},e.prototype.__onChange=function(t,e){var n=this,r=this.changedAttributes()||{};(0,J.keys)(r).forEach((function(t){return n.emitUpdate(t)})),["status","open","toolbar","traits"].forEach((function(t){return delete r[t]})),(0,Z.isEmptyObj)(r)||(this.__changesUp(e),this.__propSelfToParent({component:this,changed:r,options:e}))},e.prototype.__onStyleChange=function(t){var e=this,n=this.em;if(n){var r="component:styleUpdate",o=(0,J.keys)(t),i={style:t};n.trigger(r,this,i),o.forEach((function(t){return n.trigger("".concat(r,":").concat(t),e,i)}))}},e.prototype.__changesUp=function(t){var e=this.em;[this.frame,e].forEach((function(e){return e&&e.changesUp(t)}))},e.prototype.__propSelfToParent=function(t){this.trigger(Un,t),this.__propToParent(t)},e.prototype.__propToParent=function(t){var e=this.parent();e&&e.trigger(Bn,t)},e.prototype.__emitUpdateTlb=function(){this.emitUpdate("toolbar")},e.prototype.__getAllById=function(){var t=this.em;return t?t.Components.allById():{}},e.prototype.__upSymbProps=function(t,e){void 0===e&&(e={}),function(t,e){void 0===e&&(e={});var n=t.changedAttributes()||{},r=n.attributes||{};if(delete n.status,delete n.open,delete n[Hn],delete n[Fn],delete n[Vn],delete n.attributes,delete r.id,(0,Z.isEmptyObj)(r)||(n.attributes=r),!(0,Z.isEmptyObj)(n)){var o=qe(t,e);(0,J.keys)(n).map((function(e){We(t,e)&&delete n[e]})),Ye(t,"props",o,{opts:e,changed:n}),o.forEach((function(r){var o=$e({},n);(0,J.keys)(o).map((function(t){We(r,t)&&delete o[t]})),r.set(o,$e({fromInstance:t},e))}))}}(this,e)},e.prototype.__upSymbCls=function(t,e,n){void 0===n&&(n={}),function(t,e){void 0===e&&(e={});var n=qe(t,e);Ye(t,"classes",n,{opts:e}),n.forEach((function(e){e.set("classes",t.get("classes"),{fromInstance:t})})),t.__changesUp(e)}(this,n)},e.prototype.__upSymbComps=function(t,e,n){Xe(this,t,e,n)},e.prototype.is=function(t){return!(this.get("type")!=t)},e.prototype.props=function(){return this.attributes},e.prototype.index=function(){var t=this.collection;return t?t.indexOf(this):0},e.prototype.setDragMode=function(t){return this.set("dmode",t)},e.prototype.getDragMode=function(){return this.get("dmode")||""},e.prototype.setSymbolOverride=function(t){var e;this.set(Vn,null!==(e=(0,J.isString)(t)?[t]:t)&&void 0!==e?e:0)},e.prototype.getSymbolOverride=function(){return this.get(Vn)},e.prototype.find=function(t){var e,n=[],r=null===(e=this.view)||void 0===e?void 0:e.$el.find(t);return null==r||r.each((function(t){var e=r.eq(t).data("model");e&&n.push(e)})),n},e.prototype.findType=function(t){var e=[],n=function(r){return r.forEach((function(r){r.is(t)&&e.push(r),n(r.components())}))};return n(this.components()),e},e.prototype.findFirstType=function(t){return this.findType(t).at(0)},e.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},e.prototype.closestType=function(t){for(var e=this.parent();e&&!e.is(t);)e=e.parent();return e},e.prototype.contains=function(t){var e=!1;if(!t)return e;var n=function(r){!e&&r.forEach((function(r){r===t&&(e=!0),!e&&n(r.components())}))};return n(this.components()),e},e.prototype.tagUpdated=function(){this.trigger("rerender")},e.prototype.replaceWith=function(t,e){void 0===e&&(e={});var n=this.collection,r=n.indexOf(this);n.remove(this);var o=n.add(t,Ln(Ln({},e),{at:r}));return(0,J.isArray)(o)?o:[o]},e.prototype.attrUpdated=function(t,e,n){var r=this;void 0===n&&(n={});var o=this.get("attributes"),i=o.class;i&&this.setClass(i),delete o.class;var s=o.style;s&&this.setStyle(s,n),delete o.style;var a=Ln({},this.previous("attributes")),l=(0,Z.shallowDiff)(a,this.get("attributes"));(0,J.keys)(l).forEach((function(t){var e,o="attributes:".concat(t);r.trigger("change:".concat(o),r,l[t],n),null===(e=r.em)||void 0===e||e.trigger("".concat(Un,":").concat(o),r,l[t],n)}))},e.prototype.setAttributes=function(t,e){return void 0===e&&(e={}),this.set("attributes",Ln({},t),e),this},e.prototype.addAttributes=function(t,e){return void 0===e&&(e={}),this.setAttributes(Ln(Ln({},this.getAttributes({noClass:!0})),t),e)},e.prototype.removeAttributes=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var n=Array.isArray(t)?t:[t],r=this.getAttributes();return n.map((function(t){return delete r[t]})),this.setAttributes(r,e)},e.prototype.getStyle=function(e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=this.em,o=(0,J.isString)(e)?e:"",i=o?n:e;if(Dn(r)&&!i.inline){var s=r.get("state"),a=r.Css.getIdRule(this.getId(),Ln({state:s},i));return this.rule=a,a?a.getStyle(o):{}}return t.prototype.getStyle.call(this,o)},e.prototype.setStyle=function(e,n){var r=this;void 0===e&&(e={}),void 0===n&&(n={});var o=this.opt,i=this.em;if(!Dn(i)||o.temporary||n.inline)e=t.prototype.setStyle.apply(this,arguments);else{var s=this.get("style")||{};e=(0,J.isString)(e)?this.parseStyle(e):e,e=Ln(Ln({},e),s);var a=i.get("state"),l=i.Css,c=this.getStyle(n);this.rule=l.setIdRule(this.getId(),e,Ln({state:a},n));var u=(0,Z.shallowDiff)(c,e);this.set("style","",{silent:!0}),(0,J.keys)(u).forEach((function(t){return r.trigger("change:style:".concat(t))}))}return o.temporary||this.__onStyleChange(n.addStyle||e),e},e.prototype.getAttributes=function(t){void 0===t&&(t={});var e=this.em,n=[],r=Ln({},this.get("attributes")),o=null==e?void 0:e.Selectors,i=this.getId();if(t.noClass?delete r.class:(this.classes.forEach((function(t){return n.push((0,J.isString)(t)?t:t.getName())})),n.length&&(r.class=n.join(" "))),!t.noStyle){var s=this.getStyle({inline:!0});(0,Z.isObject)(s)&&!(0,Z.isEmptyObj)(s)&&(r.style=this.styleToString({inline:!0}))}if(!(0,J.has)(r,"id")){var a=!1;!Dn(e)&&(0,J.isEmpty)(this.getStyle())||(a=!!(null==o?void 0:o.get(i,o.Selector.TYPE_ID))),(Fe(this)||this.get("script-export")||this.get("script"))&&(a=!0),a&&(r.id=i)}return r},e.prototype.addClass=function(t){var e=this.em.Selectors.addClass(t);return this.classes.add(e)},e.prototype.setClass=function(t){return this.classes.reset(),this.addClass(t)},e.prototype.removeClass=function(t){var e=[];t=(0,J.isArray)(t)?t:[t];var n=this.classes,r=ln.TYPE_CLASS;return t.forEach((function(t){t.split(" ").forEach((function(t){var o=n.where({name:t,type:r})[0];o&&e.push(n.remove(o))}))})),e},e.prototype.getClasses=function(){var t=this.getAttributes().class;return t?t.split(" "):[]},e.prototype.initClasses=function(t,e,n){void 0===n&&(n={});var r=this.get("attributes")||{},o=r.class,i=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(r,["class"]),s=[this,"change:classes",this.initClasses],a=this.get("classes")||o||[],l=(0,J.isString)(a)?a.split(" "):a;this.stopListening.apply(this,s);var c=this.normalizeClasses(l),u=new dn([]);return this.set("classes",u,n),u.add(c),u.on("add remove reset",this.__upSymbCls),o&&c.length&&this.set("attributes",i),this.listenTo.apply(this,s),this},e.prototype.initComponents=function(){var t=[this,"change:components",this.initComponents];this.stopListening.apply(this,t);var e=new on([],this.opt);e.parent=this;var n=this.get("components"),r=!this.opt.avoidChildren;return this.set("components",e),r&&n&&e.add((0,J.isFunction)(n)?n(this):n,this.opt),e.on("add remove reset",this.__upSymbComps),this.listenTo.apply(this,t),this},e.prototype.initTraits=function(t){var e=this.em,n="change:traits";this.off(n,this.initTraits),this.__loadTraits();var r=Ln({},this.get("attributes")),o=this.traits;return o.each((function(t){if(!t.changeProp){var e=t.getName(),n=t.getInitValue();e&&n&&(r[e]=n)}})),o.length&&this.set("attributes",r),this.on(n,this.initTraits),t&&e&&e.trigger("component:toggled"),this},e.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)||[],r=this.get(t)||[],o=n.map((function(t){return"change:".concat(t)})).join(" "),i=r.map((function(t){return"change:".concat(t)})).join(" ");o&&this.off(o,this.__scriptPropsChange),i&&this.on(i,this.__scriptPropsChange),this.on.apply(this,e)}},e.prototype.__scriptPropsChange=function(t,e,n){void 0===n&&(n={}),n.avoidStore||this.trigger("rerender")},e.prototype.append=function(t,e){void 0===e&&(e={});var n=((0,J.isArray)(t)?In([],t,!0):[t]).map((function(t){return(0,J.isString)(t)||t.collection&&t.collection.remove(t,{temporary:!0}),t})),r=this.components().add(n,Ln({action:oe.t.add},e));return(0,J.isArray)(r)?r:[r]},e.prototype.components=function(t,e){void 0===e&&(e={});var n=this.get("components");return(0,J.isUndefined)(t)?n:(n.reset(void 0,e),t?this.append(t,e):[])},e.prototype.getChildAt=function(t){return this.components().at(t||0)||void 0},e.prototype.getLastChild=function(){var t=this.components();return t.at(t.length-1)||null},e.prototype.empty=function(t){return void 0===t&&(t={}),this.components().reset(void 0,t),this},e.prototype.parent=function(t){void 0===t&&(t={});var e=this.collection||t.prev&&this.prevColl;return e?e.parent:void 0},e.prototype.parents=function(){var t=this.parent();return t?[t].concat(t.parents()):[]},e.prototype.scriptUpdated=function(){this.set("scriptUpdated",1)},e.prototype.initToolbar=function(){var t=this.em,e=this,n=t&&t.getConfig().stylePrefix||"";if(!e.get("toolbar")&&t){var r=[];e.collection&&r.push({label:t.getIcon("arrowUp"),command:function(t){return t.runCommand("core:component-exit",{force:1})}}),e.get("draggable")&&r.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:t.getIcon("move"),command:"tlb-move"}),e.get("copyable")&&r.push({label:t.getIcon("copy"),command:"tlb-clone"}),e.get("removable")&&r.push({label:t.getIcon("delete"),command:"tlb-delete"}),e.set("toolbar",r)}},e.prototype.__loadTraits=function(t,e){void 0===e&&(e={});var n=t||this.traits;if(!(n instanceof Mn)){n=(0,J.isFunction)(n)?n(this):n;var r=new Mn([],this.opt);r.setTarget(this),n.length&&(n.forEach((function(t){return t.attributes&&delete t.attributes.value})),r.add(n)),this.set({traits:r},e)}return this},e.prototype.getTraits=function(){return this.__loadTraits(),In([],this.traits.models,!0)},e.prototype.setTraits=function(t){var e=(0,J.isArray)(t)?t:[t];return this.set({traits:e}),this.getTraits()},e.prototype.getTrait=function(t){return this.getTraits().filter((function(e){return e.get("id")===t||e.get("name")===t}))[0]||null},e.prototype.updateTrait=function(t,e){var n,r=this.getTrait(t);return r&&r.set(e),null===(n=this.em)||void 0===n||n.trigger("component:toggled"),this},e.prototype.getTraitIndex=function(t){var e=this.getTrait(t);return e?this.traits.indexOf(e):-1},e.prototype.removeTrait=function(t){var e,n=this,r=((0,J.isArray)(t)?t:[t]).map((function(t){return n.getTrait(t)})),o=this.traits,i=r.length?o.remove(r):[];return null===(e=this.em)||void 0===e||e.trigger("component:toggled"),(0,J.isArray)(i)?i:[i]},e.prototype.addTrait=function(t,e){var n;void 0===e&&(e={}),this.__loadTraits();var r=this.traits.add(t,e);return null===(n=this.em)||void 0===n||n.trigger("component:toggled"),(0,J.isArray)(r)?r:[r]},e.prototype.normalizeClasses=function(t){var e=[],n=this.em,r=null==n?void 0:n.Selectors;return r?t.models?In([],t.models,!0):(t.forEach((function(t){return e.push(r.add(t))})),e):[]},e.prototype.clone=function(t){void 0===t&&(t={});var e=this.em,n=Ln({},this.attributes),r=Ln({},this.opt),o=this.getId(),i=null==e?void 0:e.Css;n.attributes=Ln({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],Ve(this)&&(t.symbol=!0),this.get("components").each((function(e,r){n.components[r]=e.clone(Ln(Ln({},t),{_inner:1}))})),this.get("traits").each((function(t,e){n.traits[e]=t.clone()})),this.get("classes").each((function(t,e){n.classes[e]=t.get("name")})),n.status="",r.collection=null;var s=new this.constructor(n,r),a="#".concat(s.getId());(i?i.getRules("#".concat(o)):[]).forEach((function(t){var e=t.clone();e.set("selectors",[a]),i.getAll().add(e)})),s.set(Hn,0);var l=Be(this),c=ze(this);t.symbol||!l&&!c?l?(l.set(Hn,In(In([],ze(l),!0),[s],!1)),Ue(s)):t.symbol&&(Re(this)?(this.set(Hn,In(In([],c,!0),[s],!1)),s.set(Fn,this),Ue(s)):t.symbolInv?(this.set(Hn,[s]),s.set(Fn,this),[this,s].map((function(t){return Ue(t)}))):(s.set(Hn,[this]),[this,s].map((function(t){return Ue(t)})),this.set(Fn,s))):(s.set(Fn,0),s.set(Hn,0));var u="component:clone";return e&&e.trigger(u,s),this.trigger(u,s),s},e.prototype.getName=function(t){void 0===t&&(t={});var e=this.em,n=this.attributes,r=n.type,o=n.tagName,i=n.name,s=r||o,a=r?"":o,l="domComponents.names.",c=i&&(null==e?void 0:e.t("".concat(l).concat(i))),u=a&&(null==e?void 0:e.t("".concat(l).concat(a))),p=e&&(e.t("".concat(l).concat(r))||e.t("".concat(l).concat(o))),d=this.get("custom-name");return(t.noCustom?"":d)||c||i||u||(0,Z.capitalize)(a)||p||(0,Z.capitalize)(s)},e.prototype.setName=function(t,e){void 0===e&&(e={}),this.set("custom-name",t,e)},e.prototype.getIcon=function(){var t=this.get("icon");return t?t+" ":""},e.prototype.toHTML=function(t){void 0===t&&(t={});var e=this,n=[],r=t.tag||e.get("tagName"),o=e.get("void"),i=t.attributes,s=this.getAttrToHTML(t);if(delete t.tag,i&&((0,J.isFunction)(i)?s=i(e,s)||{}:(0,Z.isObject)(i)&&(s=i)),t.withProps){var a=this.toJSON();(0,J.forEach)(a,(function(t,e){"_"!==e[0]&&["classes","attributes","components"].indexOf(e)<0&&(s["data-gjs-".concat(e)]=(0,J.isArray)(t)||(0,Z.isObject)(t)?JSON.stringify(t):(0,J.isBoolean)(t)?"".concat(t):t)}))}for(var l in s){var c=s[l];if(!(0,J.isUndefined)(c)&&null!==c)if((0,J.isBoolean)(c))c&&n.push(l);else{var u="";if(t.altQuoteAttr&&(0,J.isString)(c)&&c.indexOf('"')>=0)u="'".concat(c.replace(/'/g,"'"),"'");else{var p=(0,J.isString)(c)?c.replace(/"/g,"""):c;u='"'.concat(p,'"')}n.push("".concat(l,"=").concat(u))}}var d=n.length?" ".concat(n.join(" ")):"",f=e.getInnerHTML(t),h="<".concat(r).concat(d).concat(o?"/":"",">").concat(f);return!o&&(h+="</".concat(r,">")),h},e.prototype.getInnerHTML=function(t){return this.__innerHTML(t)},e.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},e.prototype.getAttrToHTML=function(t){var e=this.getAttributes();return Dn(this.em)&&!0!==(null==t?void 0:t.keepInlineStyle)&&delete e.style,e},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=et.Model.prototype.toJSON.call(this,t);if(e.attributes=this.getAttributes(),delete e.attributes.class,delete e.toolbar,delete e.traits,delete e.status,delete e.open,delete e._undoexc,delete e.delegate,!t.fromUndo){var n=e[Fn],r=e[Hn];r&&(0,J.isArray)(r)&&(e[Hn]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),n&&!(0,J.isString)(n)&&(e[Fn]=n.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(e),e},e.prototype.getChangedProps=function(t){var e=t||et.Model.prototype.toJSON.apply(this),n=(0,J.result)(this,"defaults");return(0,J.forEach)(n,(function(t,n){-1===["type"].indexOf(n)&&e[n]===t&&delete e[n]})),(0,J.isEmpty)(e.type)&&delete e.type,(0,J.forEach)(["attributes","style"],(function(t){(0,J.isEmpty)(n[t])&&(0,J.isEmpty)(e[t])&&delete e[t]})),(0,J.forEach)(["classes","components"],(function(t){(!e[t]||(0,J.isEmpty)(n[t])&&!e[t].length)&&delete e[t]})),e},e.prototype.getId=function(){return(this.get("attributes")||{}).id||this.ccid||this.cid},e.prototype.setId=function(t,e){var n=Ln({},this.get("attributes"));return n.id=t,this.set("attributes",n,e),this},e.prototype.getEl=function(t){var e=this.getView(t);return e&&e.el},e.prototype.getView=function(t){var e=this,n=e.view,r=e.views,o=e.em,i=t||(null==o?void 0:o.getCurrentFrameModel());return i&&(n=r.filter((function(t){return t.frameView===i.view}))[0]),n},e.prototype.getCurrentView=function(){var t=this.em.getCurrentFrame(),e=null==t?void 0:t.model;return this.getView(e)},e.prototype.__getScriptProps=function(){var t=this.props();return(this.get("script-props")||[]).reduce((function(e,n){return e[n]=t[n],e}),{})},e.prototype.getScriptString=function(t){var e=this,n=t||this.get("script")||"";if(!n)return n;if(this.get("script-props"))n=n.toString().trim();else{if((0,J.isFunction)(n)){var r=n.toString().trim();n=(r=r.slice(r.indexOf("{")+1,r.lastIndexOf("}"))).trim()}var o=this.em.getConfig(),i=$n(o.tagVarStart||"{[ "),s=$n(o.tagVarEnd||" ]}"),a=new RegExp("".concat(i,"([\\w\\d-]*)").concat(s),"g");n=n.replace(a,(function(t,n){e.scriptUpdated();var r=e.attributes[n]||"";return(0,J.isArray)(r)||"object"==typeof r?JSON.stringify(r):r}))}return n},e.prototype.emitUpdate=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.em,i=Un+(t?":".concat(t):""),s=t&&this.get(t);t&&this.updated.apply(this,In([t,s,t&&this.previous(t)],n,!1)),this.trigger.apply(this,In([i],n,!1)),o&&o.trigger.apply(o,In([i,this],n,!1)),["components","classes"].indexOf(t)>=0&&this.__propSelfToParent({component:this,changed:(e={},e[t]=s,e),options:n[2]||n[1]||{}})},e.prototype.onAll=function(t){return(0,J.isFunction)(t)&&(t(this),this.components().forEach((function(e){return e.onAll(t)}))),this},e.prototype.forEachChild=function(t){(0,J.isFunction)(t)&&this.components().forEach((function(e){t(e),e.forEachChild(t)}))},e.prototype.remove=function(t){var e=this;void 0===t&&(t={});var n=this.em,r=this.collection,o=function(){r&&r.remove(e,Ln({action:oe.t.remove},t)),r||(e.components("",t),e.components().removeChildren(e,void 0,t))},i=Ln({},t);return[this,n].map((function(t){return t.trigger(oe.I.removeBefore,e,o,i)})),!i.abort&&o(),this},e.prototype.move=function(t,e){if(void 0===e&&(e={}),t){var n=e.at,r=this.index(),o=t===this.parent();if(!o||r!==n&&r!==n-1){o&&n&&n>r&&(e.at=n-1);var i=oe.t.move;this.remove({action:i,temporary:1}),t.append(this,Ln({action:i},e)),this.emitUpdate()}}return this},e.prototype.isInstanceOf=function(t){var e,n,r=null===(n=null===(e=this.em)||void 0===e?void 0:e.Components.getType(t))||void 0===n?void 0:n.model;if(!r)return!1;var o=this.constructor.typeExtends;return this instanceof r||o.has(t)},e.prototype.isChildOf=function(t){for(var e=(0,J.isString)(t),n=this.parent();n;){if(e){if(n.isInstanceOf(t))return!0}else if(n===t)return!0;n=n.parent()}return!1},e.prototype.resetId=function(t){void 0===t&&(t={});var n=this.em,r=this.getId();if(!r)return this;var o=e.createId(this);this.setId(o);var i=null==n?void 0:n.Css.getIdRule(r),s=null==i?void 0:i.get("selectors").at(0);return null==s||s.set("name",o),this},e.prototype._getStyleRule=function(t){var e=(void 0===t?{}:t).id,n=this.em,r=e||this.getId();return null==n?void 0:n.Css.getIdRule(r)},e.prototype._getStyleSelector=function(t){var e=this._getStyleRule(t);return null==e?void 0:e.get("selectors").at(0)},e.prototype._idUpdated=function(t,n,r){if(void 0===r&&(r={}),!r.idUpdate){var o=this.ccid,i=(this.get("attributes")||{}).id,s=(this.previous("attributes")||{}).id||o,a=e.getList(this);if(a[i]||!i&&s)return this.setId(s,{idUpdate:!0});delete a[s],a[i]=this,this.ccid=i;var l=this._getStyleSelector({id:s});l&&l.set({name:i,label:i})}},e.getDefaults=function(){return(0,J.result)(this.prototype,"defaults")},e.isComponent=function(t,e){return{tagName:(0,Z.toLowerCase)(t.tagName)}},e.ensureInList=function(t){var n=e.getList(t),r=t.getId(),o=n[r];if(o){if(o!==t){var i=e.getIncrementId(r,n);t.setId(i),n[i]=t}}else n[r]=t;t.components().forEach((function(t){return e.ensureInList(t)}))},e.createId=function(t,n){void 0===n&&(n={});var r,o=e.getList(t),i=n.idMap,s=void 0===i?{}:i,a=t.get("attributes").id;return a?(r=e.getIncrementId(a,o,n),t.setId(r),a!==r&&(s[a]=r)):r=e.getNewId(o),o[r]=t,r},e.getNewId=function(t){for(var n=Object.keys(t).length.toString().length+2,r=(Math.random()+1.1).toString(36).slice(-n),o="i".concat(r);t[o];)o=e.getNewId(t);return o},e.getIncrementId=function(t,e,n){void 0===n&&(n={});var r=n.keepIds,o=1,i=t;if((void 0===r?[]:r).indexOf(t)<0)for(;e[i];)o++,i="".concat(t,"-").concat(o);return i},e.getList=function(t){var e,n=t.em,r=null==n?void 0:n.Components;return null!==(e=null==r?void 0:r.componentsById)&&void 0!==e?e:{}},e.checkId=function(t,n,r,o){void 0===n&&(n=[]),void 0===r&&(r={}),void 0===o&&(o={});var i=(0,J.isArray)(t)?t:[t],s=o.keepIds,a=void 0===s?[]:s,l=o.idMap,c=void 0===l?{}:l;i.forEach((function(t){t.attributes;var i=t.attributes,s=void 0===i?{}:i,l=t.components,u=s.id;if(u&&r[u]&&a.indexOf(u)<0){var p=e.getIncrementId(u,r);c[u]=p,s.id=p,(0,J.isArray)(n)&&n.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(u)&&(e[n]="#".concat(p))}))}))}l&&e.checkId(l,n,r,o)}))},e.typeExtends=new Set,e}(Ie);const Wn=zn;var qn=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gn=function(){return Gn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Gn.apply(this,arguments)},Kn="head",Yn=["title","style","base","link","meta","script","noscript"],Xn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qn(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Gn(Gn({},t.prototype.defaults),{type:Kn,tagName:Kn,draggable:!1,highlightable:!1,droppable:function(t){var e=t.tagName;return!e||Yn.includes((0,Z.toLowerCase)(e))}})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,Z.toLowerCase)(t.tagName)===Kn},e}(Wn);const Jn=Xn;var Zn=function(){return Zn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Zn.apply(this,arguments)},Qn=function(){function t(t,e){var n=this;this.em=t,this.canvas=t.Canvas;var r=e||this.canvas.getFrames().map((function(t){return t.getComponent().getEl()})),o=Array.isArray(r)?r:[r];this.el=o[0],this.counter=0,(0,J.bindAll)(this,"handleDragEnter","handleDragOver","handleDrop","handleDragLeave"),o.forEach((function(t){return n.toggleEffects(t,!0)}))}return t.prototype.toggleEffects=function(t,e){var n={on:fe.on,off:fe.AU},r=e?"on":"off";n[r](t,"dragenter",this.handleDragEnter),n[r](t,"dragover",this.handleDragOver),n[r](t,"drop",this.handleDrop),n[r](t,"dragleave",this.handleDragLeave)},t.prototype.__customTglEff=function(t){var e,n=t?fe.on:fe.AU,r=this.el.ownerDocument,o=null===(e=r.defaultView)||void 0===e?void 0:e.frameElement;this.sortOpts=t?{onStart:function(t){var e=t.sorter;(0,fe.on)(o,"pointermove",e.onMove)},onEnd:function(t){var e=t.sorter;(0,fe.AU)(o,"pointermove",e.onMove)},customTarget:function(t){var e=t.event;return r.elementFromPoint(e.clientX,e.clientY)}}:null,n(o,"pointerenter",this.handleDragEnter),n(o,"pointermove",this.handleDragOver),n(document,"pointerup",this.handleDrop),n(o,"pointerout",this.handleDragLeave)},t.prototype.startCustom=function(){this.__customTglEff(!0)},t.prototype.endCustom=function(t){this.over?this.endDrop(t):this.__customTglEff(!1)},t.prototype.endDrop=function(t,e){var n=this.em,r=this.dragStop;this.counter=0,r&&r(t||!this.over),this.__customTglEff(!1),n.trigger("canvas:dragend",e)},t.prototype.handleDragLeave=function(t){this.updateCounter(-1,t)},t.prototype.updateCounter=function(t,e){this.counter+=t,0===this.counter&&this.endDrop(!0,e)},t.prototype.handleDragEnter=function(t){var e=this,n=this.em,r=this.canvas,o=t.dataTransfer,i=n.get("dragContent");if((i||r.getConfig().allowExternalDrop)&&(this.updateCounter(1,t),!this.over)){this.over=!0;var s,a,l=n.Utils,c=i||"<br>";if(n.stopDefault(),n.inAbsoluteMode()){var u=n.Components.getWrapper(),p=u.append({})[0],d=n.Commands.run("core:component-drag",{event:t,guidesInfo:1,center:1,target:p,onEnd:function(t,n,i){var s;if(!i.cancelled){s=u.append(c)[0];var a=r.getOffset(),l=p.getStyle(),d=l.top,f=l.left,h=l.position,g=(0,fe.Xy)(t.target),v=parseInt("".concat(parseFloat(f)+g.x-a.left),10),m=parseInt("".concat(parseFloat(d)+g.y-a.top),10);s.addStyle({left:v+"px",top:m+"px",position:h})}e.handleDragEnd(s,o),p.remove()}});s=function(e){return d.stop(t,{cancel:e})},a=function(t){return c=t}}else{var f=new l.Sorter(Zn({em:n,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:this.el,placer:r.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:"gjs-",onEndMove:function(t){return e.handleDragEnd(t,o)},document:this.el.ownerDocument},this.sortOpts||{}));f.setDropContent(c),f.startSort(),this.sorter=f,s=function(t){t&&(f.moved=!1),f.endMove()},a=function(t){return f.setDropContent(t)}}this.dragStop=s,this.dragContent=a,n.trigger("canvas:dragenter",o,c)}},t.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})},t.prototype.handleDragOver=function(t){t.preventDefault(),this.em.trigger("canvas:dragover",t)},t.prototype.handleDrop=function(t){t.preventDefault();var e=this.dragContent,n=t.dataTransfer,r=this.getContentByData(n).content;r&&e&&e(r),this.endDrop(!r,t)},t.prototype.getContentByData=function(t){var e=this.em,n=t&&t.types,r=t&&t.files||[],o=e.get("dragContent"),i=t&&t.getData("text");if(r.length){i=[];for(var s=0;s<r.length;s++){var a=r[s],l=a.type.split("/")[0];"image"==l&&i.push({type:l,file:a,attributes:{alt:a.name}})}}else if(o)i=o;else if((0,J.indexOf)(n,"text/html")>=0)i=t&&t.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if((0,J.indexOf)(n,"text/uri-list")>=0)i={type:"link",attributes:{href:i},content:i};else if((0,J.indexOf)(n,"text/json")>=0){var c=t&&t.getData("text/json");c&&(i=JSON.parse(c))}else 1===n.length&&"text/plain"===n[0]&&(i="<div>".concat(i,"</div>"));var u={content:i};return e.trigger("canvas:dragdata",t,u),u},t}();const tr=Qn;var er=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nr=function(){return nr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},nr.apply(this,arguments)},rr=function(t){function e(e,n){var r=t.call(this,{model:e})||this;r.dragging=!1,r.loaded=!1,r.lastMaxHeight=0,r.tools={},(0,J.bindAll)(r,"updateClientY","stopAutoscroll","autoscroll","_emitUpdate");var o=r.el;r.module._config=nr(nr({},r.config||{}),{frameView:r}),r.frameWrapView=n,r.showGlobalTools=(0,J.debounce)(r.showGlobalTools.bind(r),50);var i=r.getCanvasModel();return r.listenTo(e,"change:head",r.updateHead),r.listenTo(i,"change:styles",r.renderStyles),e.view=r,(0,Z.setViewEl)(o,r),r}return er(e,t),Object.defineProperty(e.prototype,"tagName",{get:function(){return"iframe"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){return{allowfullscreen:"allowfullscreen"}},enumerable:!1,configurable:!0}),e.prototype.getBoxRect=function(){var t=this.el,e=this.module,n=e.getCanvasView(),r=e.getCoords(),o=t.getBoundingClientRect(),i=n.getCanvasOffset(),s=n.getViewportDelta(),a=e.getZoomMultiplier();return{x:(o.x-i.left-s.x-r.x)*a,y:(o.y-i.top-s.y-r.y)*a,width:o.width*a,height:o.height*a}},e.prototype.updateHead=function(){var t=this.model,e=this.getHead(),n=[],r=[],o=t.head,i=t.previous("head"),s=function(t){return void 0===t&&(t={}),Object.keys(t).sort().map((function(e){return"[".concat(e,'="').concat(t[e],'"]')})).join("")},a=function(t,e,n){t.forEach((function(t){var r=t.tag,o=t.attributes,i=e.some((function(t){return t.tag===r&&s(t.attributes)===s(o)}));!i&&n.push(t)}))};a(o,i,r),a(i,o,n),n.forEach((function(t){var n,r=e.querySelector("".concat(t.tag).concat(s(t.attributes)));null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r)})),(0,fe.af)(e,r)},e.prototype.getEl=function(){return this.el},e.prototype.getCanvasModel=function(){var t;return null===(t=null==this?void 0:this.em.Canvas)||void 0===t?void 0:t.getModel()},e.prototype.getWindow=function(){return this.getEl().contentWindow},e.prototype.getDoc=function(){return this.getEl().contentDocument},e.prototype.getHead=function(){return this.getDoc().querySelector("head")},e.prototype.getBody=function(){return this.getDoc().querySelector("body")},e.prototype.getWrapper=function(){return this.getBody().querySelector("[data-gjs-type=wrapper]")},e.prototype.getJsContainer=function(){return this.jsContainer||(this.jsContainer=(0,fe.a_)("div",{class:"".concat(this.ppfx,"js-cont")})),this.jsContainer},e.prototype.getToolsEl=function(){var t;return null===(t=this.frameWrapView)||void 0===t?void 0:t.elTools},e.prototype.getGlobalToolsEl=function(){return this.em.Canvas.getGlobalToolsEl()},e.prototype.getHighlighter=function(){return this._getTool("[data-hl]")},e.prototype.getBadgeEl=function(){return this._getTool("[data-badge]")},e.prototype.getOffsetViewerEl=function(){return this._getTool("[data-offset]")},e.prototype.getRect=function(){return this.rect||(this.rect=this.el.getBoundingClientRect()),this.rect},e.prototype.getOffsetRect=function(){var t=this.el,e=this.getBody(),n=e.scrollTop,r=e.scrollLeft,o=t.offsetHeight,i=t.offsetWidth;return{top:t.offsetTop,left:t.offsetLeft,height:o,width:i,scrollTop:n,scrollLeft:r,scrollBottom:n+o,scrollRight:r+i}},e.prototype._getTool=function(t){var e=this.tools,n=this.getToolsEl();return e[t]||(e[t]=n.querySelector(t)),e[t]},e.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(),de.prototype.remove.apply(this,e),this},e.prototype.startAutoscroll=function(){var t=this;this.lastMaxHeight=this.getWrapper().offsetHeight-this.el.offsetHeight,setTimeout((function(){t._toggleAutoscrollFx(!0),requestAnimationFrame(t.autoscroll)}),0)},e.prototype.autoscroll=function(){if(this.dragging){var t=this.lastClientY,e=this.em.Canvas,n=this.getWindow(),r=n.pageYOffset,o=t||0,i=e.getConfig().autoscrollLimit,s=this.getRect().height-i,a=r;o<i&&(a-=i-o),o>s&&(a+=o-s),!(0,J.isUndefined)(t)&&a!==r&&a>0&&a<this.lastMaxHeight&&(this.getGlobalToolsEl().style.opacity="0",this.showGlobalTools(),n.scrollTo(0,a),e.spots.refreshDbn()),requestAnimationFrame(this.autoscroll)}},e.prototype.updateClientY=function(t){t.preventDefault(),this.lastClientY=(0,fe.G2)(t).clientY*this.em.getZoomDecimal()},e.prototype.showGlobalTools=function(){this.getGlobalToolsEl().style.opacity=""},e.prototype.stopAutoscroll=function(){this.dragging&&this._toggleAutoscrollFx(!1)},e.prototype._toggleAutoscrollFx=function(t){this.dragging=t;var e=this.getWindow(),n=t?"on":"off",r={on:fe.on,off:fe.AU};r[n](e,"mousemove dragover",this.updateClientY),r[n](e,"mouseup",this.stopAutoscroll)},e.prototype.render=function(){var t=this,e=t.$el,n=t.ppfx,r=t.em;return e.attr({class:"".concat(n,"frame")}),this.renderScripts(),r.trigger("frame:render",this),this},e.prototype.renderScripts=function(){var t=this,e=this,n=e.el,r=e.model,o=e.em,i="frame:load",s={el:n,model:r,view:this},a=this.getCanvasModel(),l=function(e){var r;if(e.length>0){var a=e.shift(),c=(0,fe.a_)("script",nr({type:"text/javascript"},(0,J.isString)(a)?{src:a}:a));null===(r=n.contentDocument)||void 0===r||r.head.appendChild(c),c.hasAttribute("nomodule")&&"noModule"in HTMLScriptElement.prototype?l(e):c.onerror=c.onload=l.bind(null,e)}else null==o||o.trigger(ce.frameLoadHead,s),t.renderBody(),null==o||o.trigger(ce.frameLoadBody,s),null==o||o.trigger(i,s)};n.onload=function(){var e=t.config.frameContent;if(e){var n=t.getDoc();n.open(),n.write(e),n.close()}s.window=t.getWindow(),null==o||o.trigger("".concat(i,":before"),s),null==o||o.trigger(ce.frameLoad,s),t.renderHead(),l(function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],a.get("scripts"),!0))}},e.prototype.renderStyles=function(t){void 0===t&&(t={});var e=this.getHead(),n=this.getCanvasModel(),r=function(t){return void 0===t&&(t=[]),t.map((function(t){return{tag:"link",attributes:nr({rel:"stylesheet"},(0,J.isString)(t)?{href:t}:t)}}))},o=r(t.prev||n.previous("styles")),i=r(null==n?void 0:n.get("styles")),s=[],a=[],l=function(t,e,n){t.forEach((function(t){var r=t.attributes.href,o=e.some((function(t){return t.attributes.href===r}));!o&&n.push(t)}))};l(i,o,a),l(o,i,s),s.forEach((function(t){var n,r=e.querySelector('link[href="'.concat(t.attributes.href,'"]'));null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r)})),(0,fe.af)(e,a)},e.prototype.renderHead=function(){var t,e=this.model,n=this.em,r=e.root,o=null===(t=null==n?void 0:n.Components)||void 0===t?void 0:t.getType(Kn).view;o&&(this.headView=new o({el:this.getHead(),model:r.head,config:nr(nr({},r.config),{frameView:this})}).render())},e.prototype.renderBody=function(){var t,e,n,r=this,o=this,i=o.config,s=o.em,a=o.model,l=o.ppfx,c=this.getDoc(),u=this.getBody(),p=this.getWindow(),d=a.hasAutoHeight(),f=s.config;p._isEditor=!0,this.renderStyles({prev:[]}),(0,fe.BC)(u,"<style>\n ".concat(f.baseCss||i.frameStyle||"","\n\n ").concat(d?"body { overflow: hidden }":"",'\n\n [data-gjs-type="wrapper"] {\n ').concat(d?"":"min-height: 100vh;","\n padding-top: 0.001em;\n }\n\n .").concat(l,"dashed *[data-gjs-highlightable] {\n outline: 1px dashed rgba(170,170,170,0.7);\n outline-offset: -2px;\n }\n\n .").concat(l,"selected {\n outline: 2px solid #3b97e3 !important;\n outline-offset: -2px;\n }\n\n .").concat(l,"selected-parent {\n outline: 2px solid ").concat("#ffca6f"," !important\n }\n\n .").concat(l,"no-select {\n user-select: none;\n -webkit-user-select:none;\n -moz-user-select: none;\n }\n\n .").concat(l,"freezed {\n opacity: 0.5;\n pointer-events: none;\n }\n\n .").concat(l,"no-pointer {\n pointer-events: none;\n }\n\n .").concat(l,"pointer-init {\n pointer-events: initial;\n }\n\n .").concat(l,"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(l,"grabbing {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n }\n\n .").concat(l,"is__grabbing {\n overflow-x: hidden;\n }\n\n .").concat(l,"is__grabbing,\n .").concat(l,"is__grabbing * {\n cursor: grabbing !important;\n }\n\n ").concat(f.canvasCss||"","\n ").concat(f.protectedCss||"","\n </style>"));var h=a.root,g=((null===(t=null==s?void 0:s.Components)||void 0===t?void 0:t.getType("wrapper"))||{}).view;g&&(this.wrapper=new g({model:h,config:nr(nr({},h.config),{em:s,frameView:this})}).render(),(0,fe.BC)(u,null===(e=this.wrapper)||void 0===e?void 0:e.el),(0,fe.BC)(u,new Se({collection:a.getStyles(),config:nr(nr({},s.Css.getConfig()),{frameView:this})}).render().el),(0,fe.BC)(u,this.getJsContainer()),(0,fe.on)(u,"click",(function(t){var e;return t&&"A"==(null===(e=t.target)||void 0===e?void 0:e.tagName)&&t.preventDefault()})),(0,fe.on)(u,"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){c.addEventListener(e,(function(e){return r.el.dispatchEvent((0,fe.yL)(e,t.class))}),t.opts)}))})),this._toggleEffects(!0),(0,Z.hasDnd)(s)&&(this.droppable=new tr(s,null===(n=this.wrapper)||void 0===n?void 0:n.el)),this.loaded=!0,a.trigger("loaded"))},e.prototype._toggleEffects=function(t){var e=t?fe.on:fe.AU,n=this.getWindow();n&&e(n,"".concat(fe.D8," resize"),this._emitUpdate)},e.prototype._emitUpdate=function(){this.model._emitUpdated()},e}(de);const or=rr;var ir=Y(14),sr=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ar=function(){return ar=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ar.apply(this,arguments)},lr=function(t){function e(e,n){var r=t.call(this,{model:e})||this;return(0,J.bindAll)(r,"onScroll","frameLoaded","updateOffset","remove","startDrag"),ar(ar({},e.config),{frameWrapView:r}),r.cv=n,r.frame=new or(e,r),r.classAnim="".concat(r.ppfx,"frame-wrapper--anim"),r.updateOffset=(0,J.debounce)(r.updateOffset.bind(r),0),r.updateSize=(0,J.debounce)(r.updateSize.bind(r),0),r.listenTo(e,"loaded",r.frameLoaded),r.listenTo(e,"change:x change:y",r.updatePos),r.listenTo(e,"change:width change:height",r.updateSize),r.listenTo(e,"destroy remove",r.remove),r.updatePos(),r.setupDragger(),r}return sr(e,t),e.prototype.events=function(){return{"click [data-action-remove]":"remove","mousedown [data-action-move]":"startDrag"}},e.prototype.setupDragger=function(){var t,e,n,r=this,o=this.module,i=this.model,s=function(t){o.toggleFramesEvents(t)};this.dragger=new ir.A({onStart:function(){var o=i.attributes,a=o.x,l=o.y;n=r.em.getZoomMultiplier(),t=a,e=l,s(!1)},onEnd:function(){return s(!0)},setPosition:function(r){i.set({x:t+r.x*n,y:e+r.y*n})}})},e.prototype.startDrag=function(t){var e;t&&(null===(e=this.dragger)||void 0===e||e.start(t))},e.prototype.__clear=function(t){var e=this.frame;e&&e.remove(t),(0,fe.YZ)(this.elTools)},e.prototype.remove=function(t){var e=this;return this.__clear(t),de.prototype.remove.apply(this,t),["frame","dragger","cv","elTools"].forEach((function(t){return e[t]=0})),this},e.prototype.updateOffset=function(){var t,e=this,n=e.em,r=e.$el,o=e.frame;n&&!n.destroyed&&(n.runDefault({preserveSelected:1}),r.removeClass(this.classAnim),null===(t=null==o?void 0:o.model)||void 0===t||t._emitUpdated())},e.prototype.updatePos=function(t){var e=this.model,n=this.el,r=e.attributes,o=r.x,i=r.y,s=n.style;this.frame.rect=void 0,s.left=isNaN(o)?o:"".concat(o,"px"),s.top=isNaN(i)?i:"".concat(i,"px"),t&&this.updateOffset()},e.prototype.updateSize=function(){this.updateDim()},e.prototype.updateDim=function(){var t=this,e=t.em,n=t.el,r=t.$el,o=t.model,i=t.classAnim,s=t.frame;if(s){s.rect=void 0,r.addClass(i);var a=this.__handleSize(),l=a.noChanges,c=a.width,u=a.height;((0,J.isNull)(c)||(0,J.isNull)(u))&&o.set(ar(ar({},c?{}:{width:n.offsetWidth}),u?{}:{height:n.offsetHeight}),{silent:1}),e.stopDefault({preserveSelected:1}),l?this.updateOffset():setTimeout(this.updateOffset,350)}},e.prototype.onScroll=function(){var t=this.frame;this.em.trigger("frame:scroll",{frame:t,body:t.getBody(),target:t.getWindow()})},e.prototype.frameLoaded=function(){var t=this.frame;this.config,t.getWindow().onscroll=this.onScroll,this.updateDim()},e.prototype.__handleSize=function(){var t,e,n=this.model,r=this.el.style,o=n.attributes,i=o.width,s=o.height,a=r.width||"",l=r.height||"",c=i||"",u=s||"",p=a==c&&l==u,d=(0,J.isNumber)(c)?"".concat(c).concat("px"):c,f=(0,J.isNumber)(u)?"".concat(u).concat("px"):u;if(r.width=d,n.hasAutoHeight()){var h=this.frame.el;if(h.contentDocument){var g=h.contentDocument,v=new ResizeObserver((function(){r.height="".concat(g.body.scrollHeight,"px")}));v.observe(g.body),null===(t=this.sizeObserver)||void 0===t||t.disconnect(),this.sizeObserver=v}}else r.height=f,null===(e=this.sizeObserver)||void 0===e||e.disconnect(),delete this.sizeObserver;return{noChanges:p,width:i,height:s,newW:c,newH:u}},e.prototype.render=function(){var t=this,e=t.frame,n=t.$el,r=t.ppfx,o=t.cv,i=t.model,s=t.el,a=i.attributes.onRender;this.__clear(),this.__handleSize(),e.render(),n.empty().attr({class:"".concat(r,"frame-wrapper")}).append('\n <div class="'.concat(r,'frame-wrapper__top gjs-two-color" data-frame-top>\n <div class="').concat(r,'frame-wrapper__name" data-action-move>\n ').concat(i.get("name")||"",'\n </div>\n <div class="').concat(r,'frame-wrapper__top-r">\n <div class="').concat(r,'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(r,'frame-wrapper__right" data-frame-right></div>\n <div class="').concat(r,'frame-wrapper__left" data-frame-left></div>\n <div class="').concat(r,'frame-wrapper__bottom" data-frame-bottom></div>\n ')).append(e.el);var l=(0,fe.a_)("div",{class:"".concat(r,"tools"),style:"pointer-events:none; display: none"},'\n <div class="'.concat(r,'highlighter" data-hl></div>\n <div class="').concat(r,'badge" data-badge></div>\n <div class="').concat(r,'placeholder">\n <div class="').concat(r,'placeholder-int"></div>\n </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" 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(r,'offset-fixed-v"></div>\n '));this.elTools=l;var c=null==o?void 0:o.toolsWrapper;return c&&c.appendChild(l),a&&a({el:s,elTop:s.querySelector("[data-frame-top]"),elRight:s.querySelector("[data-frame-right]"),elBottom:s.querySelector("[data-frame-bottom]"),elLeft:s.querySelector("[data-frame-left]"),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},e}(de);const cr=lr;var ur=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const pr=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,!0)||this;return r.listenTo(r.collection,"reset",r.render),r.canvasView=n.canvasView,r._module=n.module,r}return ur(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 cr(t,this.canvasView)},e}(ge);var dr=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fr=function(){return fr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},fr.apply(this,arguments)},hr=function(t){function e(e){var n=t.call(this,{model:e})||this;n.ready=!1,(0,J.bindAll)(n,"clearOff","onKeyPress","onWheel","onPointer");var r=n,o=r.em,i=r.pfx,s=r.ppfx,a=n.module.events;return n.className="".concat(i,"canvas ").concat(s,"no-touch-actions").concat(o.config.customUI?"":" ".concat(i,"canvas-bg")),n.clsUnscale="".concat(i,"unscale"),n._initFrames(),n.listenTo(o,a.refresh,n.clearOff),n.listenTo(o,"component:selected",n.checkSelected),n.listenTo(o,"".concat(a.coords," ").concat(a.zoom),n.updateFrames),n.listenTo(e,"change:frames",n._onFramesUpdate),n.toggleListeners(!0),n}return dr(e,t),e.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 ')},e.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},e.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,r=t.config,o=t.em,i=n.frames;o.set("readyCanvas",0),i.once("loaded:all",(function(){return o.set("readyCanvas",1)})),null==e||e.remove(),this.frames=new pr({collection:i},fr(fr({},r),{canvasView:this}))},e.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var r=e.scroll,o=this.em.getCurrentFrame();r&&(null===(n=t.views)||void 0===n||n.forEach((function(t){t.frameView===o&&t.scrollIntoView(r)})))},e.prototype.remove=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return null===(t=this.frames)||void 0===t||t.remove(),this.frames=void 0,de.prototype.remove.apply(this,e),this.toggleListeners(!1),this},e.prototype.preventDefault=function(t){var e;t&&(t.preventDefault(),null===(e=t._parentEvent)||void 0===e||e.preventDefault())},e.prototype.toggleListeners=function(t){var e=this.el,n=this.config,r=t?fe.on:fe.AU;r(document,"keypress",this.onKeyPress),r(window,"scroll resize",this.clearOff),r(e,"wheel",this.onWheel,{passive:!n.infiniteCanvas}),r(e,"pointermove",this.onPointer)},e.prototype.screenToWorld=function(t,e){var n=this.module,r=n.getCoords(),o=n.getZoomMultiplier(),i=this.getViewportDelta();return{x:(t-r.x-i.x)*o,y:(e-r.y-i.y)*o}},e.prototype.onPointer=function(t){if(this.config.infiniteCanvas){var e=this.getCanvasOffset(),n=(0,fe.Xy)(),r={x:t.clientX-e.left+n.x,y:t.clientY-e.top+n.y};if(t._parentEvent){var o=t.target.getBoundingClientRect(),i=this.module.getZoomDecimal();r.x=o.left-e.left+n.x+t.clientX*i,r.y=o.top-e.top+n.y+t.clientY*i}this.model.set({pointerScreen:r,pointer:this.screenToWorld(r.x,r.y)})}},e.prototype.onKeyPress=function(t){var e=this.em;" "!==(0,fe.Ch)(t)||1===e.getZoomDecimal()||e.Canvas.isInputFocused()||(this.preventDefault(t),e.Editor.runCommand("core:canvas-move"))},e.prototype.onWheel=function(t){var e=this.module;if(this.config.infiniteCanvas){this.preventDefault(t);var n=t.deltaX,r=t.deltaY,o=e.getZoomDecimal(),i=(0,fe.rp)(t),s=e.getCoords();if(i){var a=o-r*o*.01;e.setZoom(100*a);var l=this.model.getPointerCoords(ot.x2.Screen),c=this.getCanvasOffset(),u=l.x-c.width/2,p=l.y-c.height/2,d=a/o,f=u-(u-s.x)*d,h=p-(p-s.y)*d;e.setCoords(f,h)}else this.onPointer(t),e.setCoords(s.x-n,s.y-r)}},e.prototype.updateFrames=function(t){var e=this.em,n=this.toolsWrapper,r={preserveSelected:1};this.updateFramesArea(),this.clearOff(),n.style.display="none",e.trigger("canvas:update",t),this.timerZoom&&clearTimeout(this.timerZoom),this.timerZoom=setTimeout((function(){e.stopDefault(r),e.runDefault(r),n.style.display=""}),300)},e.prototype.updateFramesArea=function(){var t=this,e=t.framesArea,n=t.model,r=t.module,o=t.cvStyle,i=t.clsUnscale,s=r.getZoomMultiplier();if(e){var a=n.attributes,l=a.x,c=a.y,u=r.getZoomDecimal();e.style.transform="scale(".concat(u,") translate(").concat(l*s,"px, ").concat(c*s,"px)")}o&&(o.innerHTML="\n .".concat(i," { scale: ").concat(s," }\n "))},e.prototype.fitViewport=function(t){var e,n;void 0===t&&(t={});var r=this,o=r.em,i=r.module,s=r.model,a=this.getCanvasOffset(),l=t.el,c=l&&(null===(e=(0,Z.getComponentView)(l))||void 0===e?void 0:e.frameView),u=c?c.model:t.frame||o.getCurrentFrameModel()||s.frames.at(0),p=u.attributes,d=p.x,f=p.y,h={x:null!=d?d:0,y:null!=f?f:0,width:u.width,height:u.height};if(l){var g=this.getElBoxRect(l);h.x=h.x+g.x,h.y=h.y+g.y,h.width=g.width,h.height=g.height}var v=t.ignoreHeight,m=null!==(n=t.gap)&&void 0!==n?n:0,y=(0,J.isNumber)(m),b=y?m:m.x,w=y?m:m.y,_=h.width+2*b,x=h.height+2*w,C=a.width,S=a.height,T=C/_,O=S/x,A=v?T:Math.min(T,O),E=100*A;i.setZoom(E);var k={x:(-h.x+(u.width>=C?C/2-_/2:-b)+b)*A,y:(-h.y+S/2-x/2+w)*A};if(v){var P=i.getZoomMultiplier(),j=(S*P-S)/2;k.y=(-h.y+w)*A-j/P}i.setCoords(k.x,k.y)},e.prototype.isElInViewport=function(t){var e=(0,Z.getElement)(t),n=(0,fe.C8)(e),r=this.getFrameOffset(e),o=n.top,i=n.left;return o>=0&&i>=0&&o<=r.height&&i<=r.width},e.prototype.offset=function(t,e){void 0===e&&(e={});var n=e.noScroll,r=(0,fe.C8)(t),o=n?{x:0,y:0}:(0,fe.Xy)(t);return{top:r.top+o.y,left:r.left+o.x,width:r.width,height:r.height}},e.prototype.getRectToScreen=function(t){var e,n,r,o,i=this.module.getZoomDecimal(),s=this.module.getCoords(),a=this.getViewportDelta();return{x:(null!==(e=t.x)&&void 0!==e?e:0)*i+s.x+a.x||0,y:(null!==(n=t.y)&&void 0!==n?n:0)*i+s.y+a.y||0,width:(null!==(r=t.width)&&void 0!==r?r:0)*i,height:(null!==(o=t.height)&&void 0!==o?o:0)*i}},e.prototype.getElBoxRect=function(t,e){var n,r,o;void 0===e&&(e={});var i=this.module,s=(0,fe.C8)(t),a=s.width,l=s.height,c=s.left,u=s.top,p=null===(n=(0,Z.getComponentView)(t))||void 0===n?void 0:n.frameView,d=null==p?void 0:p.getBoxRect(),f=i.getZoomMultiplier(),h=null!==(r=null==d?void 0:d.x)&&void 0!==r?r:0,g=null!==(o=null==d?void 0:d.y)&&void 0!==o?o:0,v=this.el,m=(0,fe.Xy)(),y={x:c+h+(v.scrollLeft+m.x)*f,y:u+g+(v.scrollTop+m.y)*f,width:a,height:l};return e.local&&(y.x=c,y.y=u),e.toScreen?this.getRectToScreen(y):y},e.prototype.getViewportRect=function(t){void 0===t&&(t={});var e=this.getCanvasOffset(),n=e.top,r=e.left,o=e.width,i=e.height,s=this.module;if(t.toWorld){var a=s.getZoomMultiplier(),l=s.getCoords(),c=this.getViewportDelta();return{x:(-l.x-c.x||0)*a,y:(-l.y-c.y||0)*a,width:o*a,height:i*a}}return{x:r,y:n,width:o,height:i}},e.prototype.getViewportDelta=function(t){void 0===t&&(t={});var e=this.module.getZoomMultiplier(),n=this.getCanvasOffset(),r=n.width,o=n.height;return{x:(r*e-r)/2/e,y:(o*e-o)/2/e}},e.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},e.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,r=null==t?void 0:t.ownerDocument.defaultView,o=r?r.frameElement:n;this.frmOff=this.offset(o||n)}return this.frmOff},e.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},e.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.module.getZoomDecimal(),r=this.getFrameOffset(t),o=this.el,i=this.getCanvasOffset(),s=this.offset(t,e),a=e.avoidFrameOffset?0:r.top,l=e.avoidFrameOffset?0:r.left,c=e.avoidFrameZoom?s.top:s.top*n,u=e.avoidFrameZoom?s.left:s.left*n;return{top:e.avoidFrameOffset?c:c+a-i.top+o.scrollTop,left:e.avoidFrameOffset?u:u+l-i.left+o.scrollLeft,height:e.avoidFrameZoom?s.height:s.height*n,width:e.avoidFrameZoom?s.width:s.width*n,zoom:n,rect:s}},e.prototype.getElementOffsets=function(t){if(!t||(0,fe.ir)(t))return{};var e={},n=window.getComputedStyle(t),r=this.module.getZoomDecimal();return["marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"].forEach((function(t){e[t]=parseFloat(n[t])*r})),e},e.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 r=n.body,o=this.module.getZoomDecimal(),i=this.getFrameOffset(),s=this.getCanvasOffset(),a=t.noScroll;return{top:i.top+(a?0:r.scrollTop)*o-s.top,left:i.left+(a?0:r.scrollLeft)*o-s.left,width:s.width,height:s.height}},e.prototype.updateScript=function(t){var e=t.model,n=e.getId();if(!t.scriptContainer){t.scriptContainer=(0,fe.a_)("div",{"data-id":n});var r=this.getJsContainer();null==r||r.appendChild(t.scriptContainer)}t.el.id=n,t.scriptContainer.innerHTML="";var o=document.createElement("script"),i=e.getScriptString(),s=e.get("script-props")?i:"function(){\n".concat(i,"\n;}"),a=JSON.stringify(e.__getScriptProps());o.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n (").concat(s,".bind(item))(").concat(a,")\n }, 1);"),setTimeout((function(){var e=t.scriptContainer;null==e||e.appendChild(o)}),0)},e.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return null==e?void 0:e.getJsContainer()},e.prototype.getFrameView=function(t){return(null==t?void 0:t.frameView)||this.em.getCurrentFrame()},e.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,r=t.em,o=t.framesArea,i=e.frames;i.listenToLoad(),n.render();var s=i.at(0),a=null==s?void 0:s.view;r.setCurrentFrame(a),null==o||o.appendChild(n.el),this.frame=a,this.updateFramesArea()}},e.prototype.renderFrames=function(){this._renderFrames()},e.prototype.render=function(){var t=this,e=t.el,n=t.$el,r=t.ppfx,o=t.config,i=t.em;n.html(this.template());var s=n.find("[data-frames]");this.framesArea=s.get(0);var a=n.find("[data-tools]");return this.toolsWrapper=a.get(0),a.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(o.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=e.querySelector("#".concat(r,"tools")),this.hlEl=e.querySelector(".".concat(r,"highlighter")),this.badgeEl=e.querySelector(".".concat(r,"badge")),this.placerEl=e.querySelector(".".concat(r,"placeholder")),this.ghostEl=e.querySelector(".".concat(r,"ghost")),this.toolbarEl=e.querySelector(".".concat(r,"toolbar")),this.resizerEl=e.querySelector(".".concat(r,"resizer")),this.offsetEl=e.querySelector(".".concat(r,"offset-v")),this.fixedOffsetEl=e.querySelector(".".concat(r,"offset-fixed-v")),this.toolsGlobEl=e.querySelector(".".concat(r,"tools-gl")),this.spotsEl=e.querySelector("[data-spots]"),this.cvStyle=e.querySelector("[data-canvas-style]"),this.el.className=(0,Z.getUiClass)(i,this.className),this.ready=!0,this._renderFrames(),this},e}(de);const gr=hr;var vr=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mr=function(){return mr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},mr.apply(this,arguments)},yr=function(t){function e(e){var n=t.call(this,e,"Canvas",ht)||this;return n.events=le,n.framesById={},n.canvas=new ne(n),n.spots=new ae(n),n.model=n.canvas,n.startAutoscroll=n.startAutoscroll.bind(n),n.stopAutoscroll=n.stopAutoscroll.bind(n),n}return vr(e,t),e.prototype.getCanvasView=function(){return this.canvasView},e.prototype.postLoad=function(){this.model.init()},e.prototype.getModel=function(){return this.canvas},e.prototype.getElement=function(){return this.getCanvasView().el},e.prototype.getFrame=function(t){return this.getFrames()[t||0]},e.prototype.getFrameEl=function(){var t=(this.canvasView||{}).frame;return null==t?void 0:t.el},e.prototype.getFramesEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.framesArea},e.prototype.getWindow=function(){var t=(this.canvasView||{}).frame;return null==t?void 0:t.getWindow()},e.prototype.getDocument=function(){var t=this.getFrameEl();return null==t?void 0:t.contentDocument},e.prototype.getBody=function(){var t=this.getDocument();return null==t?void 0:t.body},e.prototype._getLocalEl=function(t,e,n){var r=t,o=null==e?void 0:e.frameView;return o?o[n]():r},e.prototype.getGlobalToolsEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.toolsGlobEl},e.prototype.getToolsEl=function(t){return this._getLocalEl(this.getCanvasView().toolsEl,t,"getToolsEl")},e.prototype.getHighlighter=function(t){return this._getLocalEl(this.getCanvasView().hlEl,t,"getHighlighter")},e.prototype.getBadgeEl=function(t){return this._getLocalEl(this.getCanvasView().badgeEl,t,"getBadgeEl")},e.prototype.getPlacerEl=function(){return this.getCanvasView().placerEl},e.prototype.getGhostEl=function(){return this.getCanvasView().ghostEl},e.prototype.getToolbarEl=function(){return this.getCanvasView().toolbarEl},e.prototype.getResizerEl=function(){return this.getCanvasView().resizerEl},e.prototype.getOffsetViewerEl=function(t){return this._getLocalEl(this.getCanvasView().offsetEl,t,"getOffsetViewerEl")},e.prototype.getFixedOffsetViewerEl=function(){return this.getCanvasView().fixedOffsetEl},e.prototype.getSpotsEl=function(){var t;return null===(t=this.canvasView)||void 0===t?void 0:t.spotsEl},e.prototype.render=function(){var t;return null===(t=this.canvasView)||void 0===t||t.remove(),this.canvasView=new gr(this.canvas),this.canvasView.render().el},e.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}},e.prototype.offset=function(t){return this.getCanvasView().offset(t)},e.prototype.setCustomBadgeLabel=function(t){this.config.customBadgeLabel=t},e.prototype.getElementPos=function(t,e){return this.getCanvasView().getElementPos(t,e)},e.prototype.getElementOffsets=function(t){return this.getCanvasView().getElementOffsets(t)},e.prototype.getRect=function(){var t,e=null!==(t=this.getCanvasView().getPosition())&&void 0!==t?t:{},n=e.top,r=void 0===n?0:n,o=e.left,i=void 0===o?0:o;return mr(mr({},this.getCanvasView().getCanvasOffset()),{topScroll:r,leftScroll:i})},e.prototype.getTargetToElementDim=function(t,e,n){void 0===n&&(n={});var r=n||{},o=this.getCanvasView().getPosition();if(o){var i=r.elPos||this.getCanvasView().getElementPos(e),s=n.toRight||0,a=r.targetHeight||t.offsetHeight,l=r.targetWidth||t.offsetWidth,c=r.event||null,u=i.top-a,p=i.left;p+=s?i.width:0;var d=(p=s?p-l:p)<o.left?o.left:p,f=u<o.top?o.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:o.top,canvasLeft:o.left,canvasWidth:o.width,canvasHeight:o.height};return c&&this.em&&this.em.trigger(c,h),h}},e.prototype.canvasRectOffset=function(t,e,n){var r=this;void 0===n&&(n={});var o=function(t,e,o){void 0===e&&(e=1);var i=r.em.getZoomDecimal(),s=e?"top":"left",a=t.ownerDocument,l=n.offset?function(t){var e=t.defaultView;return null==e?void 0:e.frameElement}(a):{},c=l.offsetTop,u=void 0===c?0:c,p=l.offsetLeft,d=void 0===p?0:p,f=a.body||{},h=f.scrollTop,g=void 0===h?0:h,v=f.scrollLeft,m=e?g:void 0===v?0:v,y=e?u:d;return o[s]-(m-y)*i};return{top:o(t,1,e),left:o(t,0,e)}},e.prototype.getTargetToElementFixed=function(t,e,n){void 0===n&&(n={});var r=n.pos||this.getElementPos(t,{noScroll:!0}),o=n.canvasOff||this.canvasRectOffset(t,r),i=e.offsetHeight||0,s=e.offsetWidth||0,a=r.left+r.width,l=this.getCanvasView(),c=l.getPosition(),u=l.getFrameOffset(t),p=n.event,d=-i,f=(0,J.isUndefined)(n.left)?r.width-s:n.left;if(f=r.left<-f?-r.left:f,f=a>c.width?f-(a-c.width):f,o.top<i){var h=r.height+i;h<u.height?d+=h:d=-o.top<r.height?-o.top:r.height}var g={top:d,left:f,canvasOffsetTop:o.top,canvasOffsetLeft:o.left,elRect:r,canvasOffset:o,canvasRect:c,targetWidth:s,targetHeight:i};return p&&this.em.trigger(p,g),g},e.prototype.getMouseRelativePos=function(t,e){void 0===e&&(e={});var n=e.subWinOffset,r=t.target.ownerDocument,o=r.defaultView||r.parentWindow,i=o.frameElement,s=n?o.pageYOffset:0,a=n?o.pageXOffset:0,l=this.getZoomMultiplier(),c=0,u=0;if(i){var p=i.getBoundingClientRect();c=p.top||0,u=p.left||0}return{y:(t.clientY+c-s)*l,x:(t.clientX+u-a)*l}},e.prototype.getMouseRelativeCanvas=function(t,e){var n,r=this.getZoomDecimal(),o=null!==(n=this.getCanvasView().getPosition(e))&&void 0!==n?n:{},i=o.top,s=void 0===i?0:i,a=o.left,l=void 0===a?0:a;return{y:t.clientY*r+s,x:t.clientX*r+l}},e.prototype.hasFocus=function(){return this.getDocument().hasFocus()},e.prototype.isInputFocused=function(){var t=this.getDocument(),e=this.getFrameEl(),n=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}(["body"],this.config.notTextable,!0),r=e&&document.activeElement===e?t&&t.activeElement:document.activeElement;return r&&!n.some((function(t){return r.matches(t)}))},e.prototype.scrollTo=function(t,e){void 0===e&&(e={});var n=(0,Z.getElement)(t),r=n&&(0,Z.getViewEl)(n);r&&r.scrollIntoView(e)},e.prototype.startAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.startAutoscroll()},e.prototype.stopAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.stopAutoscroll()},e.prototype.setZoom=function(t){return this.canvas.set("zoom","string"==typeof t?parseFloat(t):t),this},e.prototype.getZoom=function(){return parseFloat(this.canvas.get("zoom"))},e.prototype.setCoords=function(t,e,n){var r;void 0===n&&(n={});var o=t||0===t,i=e||0===e,s={x:this.canvas.get("x"),y:this.canvas.get("y")};if(o&&(s.x=parseFloat("".concat(t))),i&&(s.y=parseFloat("".concat(e))),n.toWorld){var a=null===(r=this.canvasView)||void 0===r?void 0:r.getViewportDelta();a&&(o&&(s.x=s.x-a.x),i&&(s.y=s.y-a.y))}return this.canvas.set(s),this},e.prototype.getCoords=function(){var t=this.canvas.attributes;return{x:t.x,y:t.y}},e.prototype.getPointer=function(t){var e=this.canvas.attributes,n=e.pointer,r=e.pointerScreen;return t?r:n},e.prototype.getZoomDecimal=function(){return this.getZoom()/100},e.prototype.getZoomMultiplier=function(){var t=this.getZoomDecimal();return t?1/t:1},e.prototype.fitViewport=function(t){var e;null===(e=this.canvasView)||void 0===e||e.fitViewport(t)},e.prototype.toggleFramesEvents=function(t){this.getFramesEl().style.pointerEvents=t?"":"none"},e.prototype.getFrames=function(){return this.canvas.frames.map((function(t){return t}))},e.prototype.addFrame=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.canvas.frames.add(new Xt(this,mr({},t)),e)},e.prototype.getLastDragResult=function(){return this.em.get("dragResult")},e.prototype.addSpot=function(t,e){var n;void 0===e&&(e={});var r=t,o=this.getSpots(r);if(o.length){var i=o[0];return i.set(r),i}var s=r.componentView||(null===(n=r.component)||void 0===n?void 0:n.view),a=new re.A(this,mr(mr({},r),{id:r.id||"cs_".concat(r.type,"_").concat(null==s?void 0:s.cid),type:r.type||""}));return this.spots.add(a,e),a},e.prototype.getSpots=function(t){return void 0===t&&(t={}),this.spots.where(t.id?{id:t.id}:t)},e.prototype.removeSpots=function(t){void 0===t&&(t={});var e=(0,J.isArray)(t)?t:this.getSpots(t);return this.spots.remove(e)},e.prototype.hasCustomSpot=function(t){var e=this.config.customSpots;return!!(!0===e||e&&t&&e[t])},e.prototype.getWorldRectToScreen=function(t){var e;return null===(e=this.canvasView)||void 0===e?void 0:e.getRectToScreen(t)},e.prototype.refresh=function(t){void 0===t&&(t={});var e=this,n=e.em,r=e.events,o=e.canvasView;null==o||o.clearOff(),(t.spots||t.all)&&(this.refreshSpots(),n.trigger("canvas:updateTools")),n.set("canvasOffset",this.getOffset()),n.trigger(r.refresh,t)},e.prototype.refreshSpots=function(){this.spots.refresh()},e.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]={}}))},e}(dt);const br=yr,wr={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 _r=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xr=function(){return xr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},xr.apply(this,arguments)},Cr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _r(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return xr(xr({},t.prototype.defaults),{tagName:"",droppable:!1,layerable:!1,selectable:!1,editable:!0})},enumerable:!1,configurable:!0}),e.prototype.toHTML=function(){var t=this.content,e=this.parent();return(null==e?void 0:e.is("script"))?t:this.__escapeContent(t)},e.prototype.__escapeContent=function(t){return(0,Z.escapeNodeContent)(t)},e.isComponent=function(t){var e;if(3===t.nodeType)return{type:"textnode",content:null!==(e=t.textContent)&&void 0!==e?e:""}},e}(Wn);const Sr=Cr;var Tr=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Or=function(){return Or=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Or.apply(this,arguments)},Ar=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Tr(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Or({},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}(Sr);const Er=Ar;var kr=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pr=function(){return Pr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Pr.apply(this,arguments)},jr="iframe",Mr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return kr(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Pr(Pr({},t.prototype.defaults),{type:jr,tagName:jr,droppable:!1,resizable:!0,traits:["id","title","src"],attributes:{frameborder:"0"}})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,Z.toLowerCase)(t.tagName)===jr},e}(Wn);const Nr=Mr;var Lr=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ir=function(){return Ir=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ir.apply(this,arguments)},$r='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)"',Dr=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,n)||this,o=r.get("attributes").src;return o&&(0,Z.buildBase64UrlFromSvg)((0,J.result)(r,"defaults").src)!==o&&r.set("src",o,{silent:!0}),r}return Lr(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Ir(Ir({},t.prototype.defaults),{type:"image",tagName:"img",void:!0,droppable:0,editable:1,highlightable:0,resizable:{ratioDefault:1},traits:["alt"],src:"<svg ".concat($r,'>\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($r,'>\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}),e.prototype.initToolbar=function(){t.prototype.initToolbar.call(this);var e=this.em;if(e){var n="image-editor";if(e.Commands.has(n)){for(var r=!1,o=this.get("toolbar"),i=0;i<o.length;i++)if("image-editor"===o[i].command){r=!0;break}r||(o.push({attributes:{class:"fa fa-pencil"},command:n}),this.set("toolbar",o))}}},e.prototype.getAttrToHTML=function(){var e=t.prototype.getAttrToHTML.call(this),n=this.getSrcResult();return n&&(e.src=n),e},e.prototype.getSrcResult=function(t){void 0===t&&(t={});var e=this.get(t.fallback?"fallback":"src")||"",n=e;return e&&"<svg"===e.substr(0,4)&&(n=(0,Z.buildBase64UrlFromSvg)(e)),n},e.prototype.isDefaultSrc=function(){var t=this.get("src"),e=(0,J.result)(this,"defaults").src;return t===e||t===(0,Z.buildBase64UrlFromSvg)(e)},e.prototype.toJSON=function(e){var n=t.prototype.toJSON.call(this,e),r=n.attributes;return r&&n.src===r.src&&delete n.src,n},e.prototype.parseUri=function(t){var e={};if((0,Z.hasWin)())(e=document.createElement("a")).href=t;else if("undefined"!=typeof URL)try{e=new URL(t)}catch(t){}return{hostname:e.hostname||"",pathname:e.pathname||"",protocol:e.protocol||"",search:e.search||"",hash:e.hash||"",port:e.port||"",query:function(t){void 0===t&&(t="");for(var e={},n=t.substring(1).split("&"),r=0;r<n.length;r++){var o=n[r].split("="),i=decodeURIComponent(o[0]);i&&(e[i]=decodeURIComponent(o[1]||""))}return e}(e.search)}},e.isComponent=function(t){return"img"===(0,Z.toLowerCase)(t.tagName)},e}(Wn);const Rr=Dr;var Hr=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fr=function(){return Fr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Fr.apply(this,arguments)};const Vr=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,n)||this;return r.__checkInnerChilds(),r}return Hr(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Fr(Fr({},t.prototype.defaults),{type:"text",droppable:!1,editable:!0})},enumerable:!1,configurable:!0}),e.prototype.__checkInnerChilds=function(){var t=this.em.Components.config.disableTextInnerChilds;if(t){var e=function(t){t.isInstanceOf("textnode")||t.set({locked:!0,layerable:!1})};(0,J.isFunction)(t)?this.forEachChild((function(n){t(n)&&e(n)})):this.forEachChild(e)}},e}(Wn);var Ur=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Br=function(){return Br=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Br.apply(this,arguments)},zr="label",Wr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ur(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Br(Br({},t.prototype.defaults),{type:zr,tagName:zr,traits:["id","title","for"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,Z.toLowerCase)(t.tagName)===zr},e}(Vr);const qr=Wr;var Gr=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kr=function(){return Kr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Kr.apply(this,arguments)},Yr="link",Xr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gr(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Kr(Kr({},t.prototype.defaults),{type:Yr,tagName:"a",traits:["title","href","target"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t,e){var n;if(void 0===e&&(e={}),"a"===(0,Z.toLowerCase)(t.tagName)){var r=e.textTags||[];n={type:Yr,editable:!1};var o=t.childNodes;o.length||delete n.editable,(0,J.forEach)(o,(function(t){var e=t.tagName;(3==t.nodeType&&""!==t.textContent.trim()||e&&r.indexOf((0,Z.toLowerCase)(e))>=0)&&delete n.editable}))}return n},e}(Vr);const Jr=Xr;var Zr=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qr=function(){return Qr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qr.apply(this,arguments)},to=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,n)||this;return r.get("src")?r.parseFromSrc():r.updateSrc(),r.listenTo(r,"change:address change:zoom change:mapType",r.updateSrc),r}return Zr(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){var e=t.prototype.defaults;return Qr(Qr({},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:20,changeProp:!0}]})},enumerable:!1,configurable:!0}),e.prototype.updateSrc=function(){this.set("src",this.getMapUrl())},e.prototype.getMapUrl=function(){var t=this.get("address"),e=this.get("zoom"),n=this.get("mapType");return t=t?"&q="+t:"",e=e?"&z="+e:"",n=n?"&t="+n:"",this.get("mapUrl")+"?"+t+e+n+"&output=embed"},e.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)},e.isComponent=function(t){if("iframe"==(0,Z.toLowerCase)(t.tagName)&&/maps\.google\.com/.test(t.src))return{type:"map",src:t.src}},e}(Rr);const eo=to;var no=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ro=function(){return ro=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ro.apply(this,arguments)},oo="script",io=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return no(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return ro(ro({},t.prototype.defaults),{type:oo,tagName:oo,droppable:!1,draggable:!1,layerable:!1,highlightable:!1})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,Z.toLowerCase)(t.tagName)===oo},e}(Wn);const so=io;var ao=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lo=function(){return lo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},lo.apply(this,arguments)},co="svg",uo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ao(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return lo(lo({},t.prototype.defaults),{type:co,tagName:co,highlightable:!1,resizable:{ratioDefault:!0}})},enumerable:!1,configurable:!0}),e.prototype.getName=function(){var t=this.get("tagName"),e=this.get("custom-name");return t=t.charAt(0).toUpperCase()+t.slice(1),e||t},e.isComponent=function(t){return(0,Z.toLowerCase)(t.tagName)===co},e}(Wn);const po=uo;var fo=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ho=function(){return ho=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ho.apply(this,arguments)};const go=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fo(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return ho(ho({},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}(po);var vo=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mo=function(){return mo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},mo.apply(this,arguments)},yo="table",bo=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,n)||this,o=r.get("components");return!o.length&&o.add({type:"tbody"}),r}return vo(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return mo(mo({},t.prototype.defaults),{type:yo,tagName:yo,droppable:["tbody","thead","tfoot"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,Z.toLowerCase)(t.tagName)===yo},e}(Wn);const wo=bo;var _o=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xo=function(){return xo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},xo.apply(this,arguments)},Co="tbody",So=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,n)||this,o=r.get("components"),i=r.get("columns"),s=r.get("rows");if(!o.length){for(var a=[];s--;){for(var l=[],c=i;c--;)l.push({type:"cell",classes:["cell"]});a.push({type:"row",classes:["row"],components:l})}o.add(a)}return r}return _o(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return xo(xo({},t.prototype.defaults),{type:Co,tagName:Co,draggable:["table"],droppable:["tr"],columns:1,rows:1})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,Z.toLowerCase)(t.tagName)===Co},e}(Wn);const To=So;var Oo=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ao=function(){return Ao=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ao.apply(this,arguments)},Eo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Ao(Ao({},t.prototype.defaults),{type:"cell",tagName:"td",draggable:["tr"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return["td","th"].indexOf((0,Z.toLowerCase)(t.tagName))>=0},e}(Wn);const ko=Eo;var Po=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jo=function(){return jo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},jo.apply(this,arguments)},Mo="tfoot",No=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Po(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return jo(jo({},t.prototype.defaults),{type:Mo,tagName:Mo})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,Z.toLowerCase)(t.tagName)===Mo},e}(To);const Lo=No;var Io=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$o=function(){return $o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},$o.apply(this,arguments)},Do="thead",Ro=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Io(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return $o($o({},t.prototype.defaults),{type:Do,tagName:Do})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return(0,Z.toLowerCase)(t.tagName)===Do},e}(To);const Ho=Ro;var Fo=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vo=function(){return Vo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Vo.apply(this,arguments)},Uo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fo(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Vo(Vo({},t.prototype.defaults),{tagName:"tr",draggable:["thead","tbody","tfoot"],droppable:["th","td"]})},enumerable:!1,configurable:!0}),e.isComponent=function(t){return"tr"===(0,Z.toLowerCase)(t.tagName)},e}(Wn);const Bo=Uo;var zo=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wo=function(){return Wo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Wo.apply(this,arguments)},qo="video",Go="yt",Ko="vi",Yo="ytnc",Xo=function(t){return t&&"0"!==t},Jo=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,n)||this;return r.get("src")&&r.parseFromSrc(),r.updatePropsFromAttr(),r.updateTraits(),r.on("change:provider",r.updateTraits),r.on("change:videoId change:provider",r.updateSrc),r}return zo(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return Wo(Wo({},t.prototype.defaults),{type:qo,tagName:qo,videoId:"",void:!1,provider:"so",ytUrl:"https://www.youtube.com/embed/",ytncUrl:"https://www.youtube-nocookie.com/embed/",viUrl:"https://player.vimeo.com/video/",loop:!1,poster:"",muted:0,autoplay:!1,controls:!0,color:"",list:"",src:"",rel:1,modestbranding:0,sources:[],attributes:{allowfullscreen:"allowfullscreen"}})},enumerable:!1,configurable:!0}),e.prototype.updatePropsFromAttr=function(){if("so"===this.get("provider")){var t=this.get("attributes"),e=t.controls,n=t.autoplay,r=t.loop,o={};(0,Z.isDef)(e)&&(o.controls=!!e),(0,Z.isDef)(n)&&(o.autoplay=!!n),(0,Z.isDef)(r)&&(o.loop=!!r),(0,Z.isEmptyObj)(o)||this.set(o)}},e.prototype.updateTraits=function(){var t,e=this.em,n="iframe";switch(this.get("provider")){case Go:case Yo:t=this.getYoutubeTraits();break;case Ko: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")},e.prototype.parseFromSrc=function(){var t=this.get("provider"),e=this.parseUri(this.get("src")),n=e.query;switch(t){case Go:case Yo:case Ko:this.set("videoId",e.pathname.split("/").pop()),n.list&&this.set("list",n.list),Xo(n.autoplay)&&this.set("autoplay",!0),Xo(n.loop)&&this.set("loop",!0),0===parseInt(n.controls)&&this.set("controls",!1),Xo(n.color)&&this.set("color",n.color),"0"===n.rel&&this.set("rel",0),"1"===n.modestbranding&&this.set("modestbranding",1)}},e.prototype.updateSrc=function(){var t="";switch(this.get("provider")){case Go:t=this.getYoutubeSrc();break;case Yo:t=this.getYoutubeNoCookieSrc();break;case Ko:t=this.getVimeoSrc()}this.set({src:t})},e.prototype.getAttrToHTML=function(){var e=t.prototype.getAttrToHTML.call(this);switch(this.get("provider")){case Go:case Yo:case Ko:break;default:e.loop=!!this.get("loop"),e.autoplay=!!this.get("autoplay"),e.controls=!!this.get("controls")}return e},e.prototype.getProviderTrait=function(){return{type:"select",label:"Provider",name:"provider",changeProp:!0,options:[{value:"so",name:"HTML5 Source"},{value:Go,name:"Youtube"},{value:Yo,name:"Youtube (no cookie)"},{value:Ko,name:"Vimeo"}]}},e.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()]},e.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}]},e.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()]},e.prototype.getAutoplayTrait=function(){return{type:"checkbox",label:"Autoplay",name:"autoplay",changeProp:!0}},e.prototype.getLoopTrait=function(){return{type:"checkbox",label:"Loop",name:"loop",changeProp:!0}},e.prototype.getControlsTrait=function(){return{type:"checkbox",label:"Controls",name:"controls",changeProp:!0}},e.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&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")+(this.get("modestbranding")?"&modestbranding=1":"")},e.prototype.getYoutubeNoCookieSrc=function(){var t=this.getYoutubeSrc();return t.replace(this.get("ytUrl"),this.get("ytncUrl"))},e.prototype.getVimeoSrc=function(){var t=this.get("viUrl");return t+=this.get("videoId")+"?",t+=this.get("autoplay")?"&autoplay=1&muted=1":"",t+=this.get("loop")?"&loop=1":"",(t+=this.get("controls")?"":"&title=0&portrait=0&badge=0")+(this.get("color")?"&color="+this.get("color"):"")},e.isComponent=function(t){var e=t.tagName,n=t.src,r=/youtube\.com\/embed/.test(n),o=/youtube-nocookie\.com\/embed/.test(n),i=/player\.vimeo\.com\/video/.test(n),s=r||o||i;if((0,Z.toLowerCase)(e)==qo||"iframe"==(0,Z.toLowerCase)(e)&&s){var a={type:"video"};return n&&(a.src=n),s&&(r?a.provider=Go:o?a.provider=Yo:i&&(a.provider=Ko)),a}},e}(Rr);const Zo=Jo;var Qo=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ti=function(){return ti=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ti.apply(this,arguments)},ei=function(t){function e(){for(var e,n,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=t.apply(this,r)||this,s=r[1],a=null===(e=null==s?void 0:s.em)||void 0===e?void 0:e.Components,l=null===(n=null==a?void 0:a.getType(Kn))||void 0===n?void 0:n.model,c=null==a?void 0:a.getType("default").model;return l&&i.set({head:new l({},s),docEl:new c({tagName:"html"},s)},{silent:!0}),i}return Qo(e,t),Object.defineProperty(e.prototype,"defaults",{get:function(){return ti(ti({},t.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}),Object.defineProperty(e.prototype,"head",{get:function(){return this.get("head")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"docEl",{get:function(){return this.get("docEl")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doctype",{get:function(){return this.attributes.doctype||""},enumerable:!1,configurable:!0}),e.prototype.toHTML=function(e){void 0===e&&(e={});var n=this.doctype,r=(0,J.isUndefined)(e.asDocument)?!!n:e.asDocument,o=this.head,i=this.docEl,s=t.prototype.toHTML.call(this,e),a=r&&(null==o?void 0:o.toHTML(e))||"",l=r&&(0,fe.kk)(null==i?void 0:i.getAttrToHTML())||"",c=l?" ".concat(l):"";return r?"".concat(n,"<html").concat(c,">").concat(a).concat(s,"</html>"):s},e.prototype.__postAdd=function(){var e,n=null===(e=this.em)||void 0===e?void 0:e.UndoManager;return!this.__hasUm&&(null==n||n.add(this)),t.prototype.__postAdd.call(this)},e.prototype.__postRemove=function(){var e,n=null===(e=this.em)||void 0===e?void 0:e.UndoManager;return null==n||n.remove(this),t.prototype.__postRemove.call(this)},e.isComponent=function(){return!1},e}(Wn);const ni=ei;var ri=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),oi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.compView=ci,e}return ri(e,t),e.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)},e.prototype.removeChildren=function(t,e,n){var r=this;void 0===n&&(n={}),t.views.forEach((function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),(0,fe.YZ)(n),t.remove.apply(t)}})),t.components().forEach((function(t){return r.removeChildren(t,e,n)}))},e.prototype.addTo=function(t){this.addToCollection(t,null,this.collection.indexOf(t))},e.prototype.addToCollection=function(t,e,n){for(var r=this,o=r.config,i=r.opts,s=r.em,a=o.frameView,l=(null==a?void 0:a.model)&&t.getView(a.model),c=i.componentTypes||(null==s?void 0:s.Components.getTypes()),u=t.get("type")||"default",p=this.compView,d=0;d<c.length;d++)if(c[d].id==u){p=c[d].view;break}var f,h=l||new p({model:t,config:o,componentTypes:c});try{f=h.render().el}catch(t){f=document.createTextNode(""),s.logError(t)}if(e)e.appendChild(f);else{var g=this.parentEl,v=g.childNodes;if((0,J.isUndefined)(n))g.appendChild(f);else{var m=v.length==n;m&&n--,m||!v.length?g.appendChild(f):g.insertBefore(f,v[n])}}return t.opt.temporary||null==s||s.trigger("component:mount",t),f},e.prototype.resetChildren=function(t,e){var n=this,r=(void 0===e?{}:e).previousModels,o=void 0===r?[]:r;this.parentEl.innerHTML="",o.forEach((function(t){return n.removeChildren(t,n.collection)})),t.each((function(t){return n.addToCollection(t)}))},e.prototype.render=function(t){var e=this,n=this.el,r=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each((function(t){return e.addToCollection(t,r)})),n.innerHTML="",n.appendChild(r),this},e}(ot.Ss);const ii=oi;var si=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ai=function(){return ai=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ai.apply(this,arguments)},li=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return si(e,t),e.prototype.className=function(){return this.getClasses()},e.prototype.tagName=function(){return this.model.get("tagName")},e.prototype.preinitialize=function(t){void 0===t&&(t={}),this.opts=t},e.prototype.initialize=function(t){void 0===t&&(t={});var e=this.model,n=t.config||{},r=n.em,o=e.opt||{},i=this.$el,s=this.el;this.opts=t,this.modelOpt=o,this.config=n,this.em=r,this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.attr=e.get("attributes"),this.classe=this.attr.class||[],this.listenTo(e,"change:style",this.updateStyle),this.listenTo(e,"change:attributes",this.renderAttributes),this.listenTo(e,"change:highlightable",this.updateHighlight),this.listenTo(e,"change:status change:locked",this.updateStatus),this.listenTo(e,"change:script rerender",this.reset),this.listenTo(e,"change:content",this.updateContent),this.listenTo(e,"change",this.handleChange),this.listenTo(e,"active",this.onActive),this.listenTo(e,"disable",this.onDisable),i.data("model",e),(0,Z.setViewEl)(s,this),e.view=this,this.frameView&&e.views.push(this),this.initClasses(),this.initComponents({avoidRender:!0}),this.events=ai(ai({},this.constructor.getEvents()),{dragstart:"handleDragStart"}),this.delegateEvents(),!o.temporary&&this.init(this._clbObj())},Object.defineProperty(e.prototype,"__cmpStyleOpts",{get:function(){return{state:"",mediaText:""}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frameView",{get:function(){return this.opts.config.frameView},enumerable:!1,configurable:!0}),Object.defineProperty(e.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}),e.prototype.__isDraggable=function(){var t=this.model,e=this.config,n=t.attributes.draggable;return e.draggableComponents&&n},e.prototype._clbObj=function(){var t=this,e=t.em,n=t.model,r=t.el;return{editor:null==e?void 0:e.getEditor(),model:n,el:r}},e.prototype.init=function(t){},e.prototype.removed=function(t){},e.prototype.onRender=function(t){},e.prototype.onActive=function(t){},e.prototype.onDisable=function(t){},e.prototype.remove=function(){var e;t.prototype.remove.call(this);var n=this.model,r=this.$el,o=n.views,i=this.frameView||{};return n.components().forEach((function(t){var e=t.getView(i.model);null==e||e.remove()})),null===(e=this.childrenView)||void 0===e||e.remove(),o.splice(o.indexOf(this),1),this.removed(this._clbObj()),r.data({model:"",collection:"",view:""}),this},e.prototype.handleDragStart=function(t){if(!this.__isDraggable())return!1;t.stopPropagation(),t.preventDefault(),this.em.Commands.run("tlb-move",{target:this.model,event:t})},e.prototype.initClasses=function(){var t=this.model,e=t.classes,n="change:classes";e instanceof dn&&(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())},e.prototype.initComponents=function(t){void 0===t&&(t={});var e=this,n=e.model,r=e.$el,o=e.childrenView,i=n.get("components"),s=[n,"change:components",this.initComponents];i instanceof on&&(r.data("collection",i),o&&o.remove(),this.stopListening.apply(this,s),!t.avoidRender&&this.renderChildren(),this.listenTo.apply(this,s))},e.prototype.handleChange=function(){var t=this.model,e=(0,J.keys)(t.changed);if(1!==e.length||"status"!==e[0])for(var n in t.emitUpdate(),t.changed)t.emitUpdate(n)},e.prototype.importClasses=function(){var t=this.em,e=this.model,n=t.Selectors;n&&e.classes.forEach((function(t){return n.add(t.getName())}))},e.prototype.updateStatus=function(t){void 0===t&&(t={});var e=this,n=e.em,r=e.el,o=e.ppfx,i=e.model,s=null==n?void 0:n.Canvas,a=null==s?void 0:s.config.extHl,l=i.get("status"),c="".concat(o,"selected"),u="".concat(c,"-parent"),p="".concat(o,"freezed"),d="".concat(o,"hovered"),f="".concat(o,"no-pointer"),h="".concat(o,"pointer-init"),g=[c,u,p,d,f],v=a&&!t.noExtHl?"":c;this.$el.removeClass(g.join(" "));var m=[r.getAttribute("class")||""],y=!(null==s?void 0:s.hasCustomSpot(re.F.Select)),b=!(null==s?void 0:s.hasCustomSpot(re.F.Target));switch(l){case"selected":y&&m.push(v);break;case"selected-parent":b&&m.push(u);break;case"freezed":m.push(p);break;case"freezed-selected":m.push(p),y&&m.push(v);break;case"hovered":!t.avoidHover&&m.push(d)}(0,J.isBoolean)(i.locked)&&m.push(i.locked?f:h);var w=m.filter(Boolean).join(" ");w&&r.setAttribute("class",w)},e.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||"")},e.prototype.updateStyle=function(t,e,n){void 0===n&&(n={});var r=this.model,o=this.em;if(Dn(o)&&!n.inline){var i=this.__cmpStyleOpts,s=r.getStyle(ai({inline:!0},i));!(0,J.isEmpty)(s)&&r.setStyle(s,i)}else this.setAttribute("style",r.styleToString(n))},e.prototype.updateClasses=function(){var t=this.model.classes.pluck("name").join(" ");this.setAttribute("class",t),this.updateStatus(),this.onAttrUpdate()},e.prototype.setAttribute=function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)},e.prototype.getClasses=function(){return this.model.getClasses().join(" ")},e.prototype.updateAttributes=function(){var t=[],e=this,n=e.model,r=e.$el,o=e.el,i=n.attributes,s=i.textable,a=i.type,l=ai(ai({id:n.getId(),"data-gjs-type":a||"default"},this.__isDraggable()&&{draggable:!0}),s&&{contenteditable:"false"});(0,J.each)(o.attributes,(function(e){return t.push(e.nodeName)})),t.forEach((function(t){return r.removeAttr(t)})),this.updateStyle(),this.updateHighlight();var c=ai(ai({},l),n.getAttributes());(0,J.keys)(c).forEach((function(t){return!1===c[t]&&delete c[t]})),r.attr(c)},e.prototype.updateContent=function(){var t=this.model.content,e=this.model.components().length;this.getChildrenContainer().innerHTML=e?"":t},e.prototype.prevDef=function(t){t.preventDefault()},e.prototype.updateScript=function(){var t=this.model,e=this.em;t.get("script")&&(null==e||e.Canvas.getCanvasView().updateScript(this))},e.prototype.getChildrenContainer=function(){var t=this.el;return"function"==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t},e.prototype.getOffsetRect=function(){var t={top:0,left:0,bottom:0,right:0},e=this.el,n=0,r=0,o=function(i){var s=i.offsetParent;s?(n+=s.offsetTop,r+=s.offsetLeft,o(s)):(t.top=e.offsetTop+n,t.left=e.offsetLeft+r,t.bottom=t.top+e.offsetHeight,t.right=t.left+e.offsetWidth)};return o(e),t},e.prototype.isInViewport=function(){var t=this,e=t.el,n=t.em,r=t.frameView,o=n.Canvas.getCanvasView().getElBoxRect(e,{local:!0}),i=r.el,s=i.clientHeight,a=i.clientWidth,l=o.y,c=o.x,u=l+o.height,p=c+o.width;return(l>=0&&l<s||u>0&&u<s)&&(p>=0&&p<a||c>0&&c<=a)},e.prototype.scrollIntoView=function(t){var e;if(void 0===t&&(t={}),!this.isInViewport()||t.force){var n=this.el;if("smooth"!==t.behavior){var r=this.getOffsetRect();null===(e=n.ownerDocument.defaultView)||void 0===e||e.scrollTo(0,r.top)}else n.scrollIntoView(ai({behavior:"smooth",block:"nearest"},t))}},e.prototype.reset=function(){var t=this.el;this.el="",this._ensureElement(),this._setData(),(0,fe.bG)(t,this.el),this.render()},e.prototype._setData=function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})},e.prototype._createElement=function(t){return this.createDoc.createElement(t)},e.prototype.renderChildren=function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new ii({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),r=0,o=n.length;r<o;r++)t.appendChild(n.shift())},e.prototype.renderAttributes=function(){this.updateAttributes(),this.updateClasses()},e.prototype.onAttrUpdate=function(){},e.prototype.render=function(){return this.renderAttributes(),this.modelOpt.temporary||(this.renderChildren(),this.updateScript(),(0,Z.setViewEl)(this.el,this),this.postRender()),this},e.prototype.postRender=function(){this.modelOpt.temporary||this.onRender(this._clbObj())},e.getEvents=function(){return(0,J.result)(this.prototype,"events")},e}(ot.Ss);const ci=li;var ui=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ui(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}(ci);const di=pi;var fi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const hi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fi(e,t),e.prototype._createElement=function(){return document.createComment(this.model.content)},e}(di);var gi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const vi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return gi(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,fe.I6)(this.el,"iframe")[0];t&&(0,fe.X6)(t,{src:this.__getSrc()})},e.prototype.render=function(){t.prototype.render.call(this);var e=(0,fe.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}(ci);var mi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return mi(e,t),e.prototype.tagName=function(){return"img"},e.prototype.events=function(){return{dblclick:"onActive",click:"initResize",error:"onError",load:"onLoad",dragstart:"noDrag"}},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),this.listenTo(this.model,"change:src",this.updateSrc),this.classEmpty="".concat(this.ppfx,"plh-image"),this.fetchFile()},e.prototype.fetchFile=function(){if(!this.modelOpt.temporary){var t=this.model,e=this.em,n=t.get("file");if(n&&e){var r=e.Assets.FileUploader();null==r||r.uploadFile({dataTransfer:{files:[n]}},(function(e){var n=e&&e.data&&e.data[0],r=n&&((0,J.isString)(n)?n:n.src);r&&t.set({src:r})})),t.set("file","")}}},e.prototype.updateSrc=function(){var t=this.model;t.addAttributes({src:t.getSrcResult()}),this.updateClasses()},e.prototype.updateClasses=function(){t.prototype.updateClasses.call(this);var e=this,n=e.el,r=e.classEmpty,o=e.model,i=o.getSrcResult()&&!o.isDefaultSrc()?"remove":"add";n.classList[i](r)},e.prototype.onActive=function(t){null==t||t.stopPropagation();var e=this.em,n=this.model,r=null==e?void 0:e.Assets;r&&n.get("editable")&&r.open({select:function(t,e){n.set({src:t.getSrc()}),e&&r.close()},target:n,types:["image"],accept:"image/*"})},e.prototype.onError=function(){var t=this.model.getSrcResult({fallback:!0});t&&(this.el.src=t)},e.prototype.onLoad=function(){this.em.Canvas.refresh({all:!0})},e.prototype.noDrag=function(t){return t.preventDefault(),!1},e.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},e}(ci);const bi=yi;var wi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_i=function(){return _i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},_i.apply(this,arguments)},xi=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},Ci=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},Si=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wi(e,t),e.prototype.events=function(){return{dblclick:"onActive",input:"onInput"}},e.prototype.initialize=function(e){t.prototype.initialize.call(this,e),(0,J.bindAll)(this,"disableEditing","onDisable");var n=this.model,r=this.em;this.listenTo(n,"focus",this.onActive),this.listenTo(n,"change:content",this.updateContentText),this.listenTo(n,"sync:content",this.syncContent),this.rte=null==r?void 0:r.RichTextEditor},e.prototype.updateContentText=function(t,e,n){void 0===n&&(n={}),!n.fromDisable&&this.disableEditing()},e.prototype.canActivate=function(){var t,e=this,n=e.model,r=e.rteEnabled,o=e.em,i=(null==o?void 0:o.getEditing())===n,s=!0,a=!1;if((r||!n.get("editable")||i||(a=n.isChildOf("text")))&&(s=!1,a&&!n.get("textable"))){for(var l=n.parent();l&&!l.isInstanceOf("text");)l=l.parent();l&&l.get("editable")?t=l:s=!0}return{result:s,delegate:t}},e.prototype.onActive=function(t){return xi(this,void 0,void 0,(function(){var e,n,r,o,i,s,a,l,c,u,p;return Ci(this,(function(d){switch(d.label){case 0:return n=(e=this).rte,r=e.em,o=this.canActivate(),i=o.result,s=o.delegate,i?(null===(p=null==t?void 0:t.stopPropagation)||void 0===p||p.call(t),a=this,[4,this.getContent()]):(s&&(null===(u=null==t?void 0:t.stopPropagation)||void 0===u||u.call(t),r.setSelected(s),s.trigger("active",t)),[2]);case 1:if(a.lastContent=d.sent(),!n)return[3,5];d.label=2;case 2:return d.trys.push([2,4,,5]),l=this,[4,n.enable(this,this.activeRte,{event:t})];case 3:return l.activeRte=d.sent(),[3,5];case 4:return c=d.sent(),r.logError(c),[3,5];case 5:return this.toggleEvents(!0),[2]}}))}))},e.prototype.onDisable=function(t){this.disableEditing(t)},e.prototype.disableEditing=function(){return xi(this,arguments,void 0,(function(t){var e,n,r,o,i,s,a,l;return void 0===t&&(t={}),Ci(this,(function(c){switch(c.label){case 0:if(n=(e=this).model,r=e.rte,o=e.activeRte,i=e.em,s=n&&n.get("editable"),!r)return[3,8];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r.disable(this,o,t)];case 2:return c.sent(),[3,4];case 3:return a=c.sent(),i.logError(a),[3,4];case 4:return(l=s)?[4,this.getContent()]:[3,6];case 5:l=c.sent()!==this.lastContent,c.label=6;case 6:return l?[4,this.syncContent(t)]:[3,8];case 7:c.sent(),this.lastContent="",c.label=8;case 8:return this.toggleEvents(),[2]}}))}))},e.prototype.getContent=function(){return xi(this,void 0,void 0,(function(){var t,e,n,r;return Ci(this,(function(o){switch(o.label){case 0:return e=(t=this).rte,n=t.activeRte,r="",e?[4,e.getContent(this,n)]:[3,2];case 1:r=o.sent(),o.label=2;case 2:return[2,r]}}))}))},e.prototype.syncContent=function(){return xi(this,arguments,void 0,(function(t){var e,n,r,o,i,s;return void 0===t&&(t={}),Ci(this,(function(a){switch(a.label){case 0:return n=(e=this).model,r=e.rte,e.rteEnabled||t.force?[4,this.getContent()]:[2];case 1:return o=a.sent(),i=n.components(),s=_i({fromDisable:1},t),n.set("content","",s),(null==r?void 0:r.customRte)&&!r.customRte.parseContent?(i.length&&i.reset(void 0,_i(_i({},t),{keepIds:en(i)})),n.set("content",o,s)):i.resetFromString(o,t),[2]}}))}))},e.prototype.insertComponent=function(t,e){var n;void 0===e&&(e={});var r=this.model,o=this.el.ownerDocument.getSelection();if(null==o?void 0:o.rangeCount){var i=o.getRangeAt(0),s=i.startContainer,a=i.startOffset,l=(0,Z.getComponentModel)(s),c=[];if(l&&(null===(n=l.is)||void 0===n?void 0:n.call(l,"textnode"))){var u=l.collection;u.forEach((function(n){if(n===l){var r="textnode",o=e.useDomContent?s.textContent||"":n.content;c.push({type:r,content:o.slice(0,a)}),c.push(t),c.push({type:r,content:o.slice(a)})}else c.push(n)}));var p=c.filter(Boolean),d=p.indexOf(t);return u.reset(p,e),u.at(d)}}return r.append(t,e)},e.prototype.onInput=function(){var t=this.em,e="component",n=["".concat(e,":update"),"".concat(e,":input")].join(" ");t&&t.trigger(n,this.model)},e.prototype.disablePropagation=function(t){t.stopPropagation()},e.prototype.toggleEvents=function(t){var e=this,n=e.em,r=e.model,o=e.$el,i={on:fe.on,off:fe.AU},s=t?"on":"off";n.setEditing(!!t&&this),this.rteEnabled=!!t;var a=[this.el.ownerDocument,document];if(i.off(a,"mousedown",this.onDisable),i[s](a,"mousedown",this.onDisable),n[s]("toolbar:run:before",this.onDisable),r&&(r[s]("removed",this.onDisable),r.trigger("rte:".concat(t?"enable":"disable"))),null==o||o.off("mousedown",this.disablePropagation),o&&o[s]("mousedown",this.disablePropagation),this.config.draggableComponents)for(var l=this.el;l;)l.draggable=!t,(l=l.parentNode)&&"BODY"==l.tagName&&(l=0)},e}(ci);const Ti=Si;var Oi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Ai=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oi(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.el.addEventListener("click",this.prevDef,!0),this},e}(Ti);var Ei=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ki=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ei(e,t),e}(Ai);var Pi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const ji=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Pi(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}(bi);var Mi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Ni=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Mi(e,t),e.prototype.tagName=function(){return"script"},e.prototype.events=function(){return{}},e}(ci);var Li=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Ii=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Li(e,t),e.prototype._createElement=function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},e}(ci);var $i=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Di=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $i(e,t),e}(ci);var Ri=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Hi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ri(e,t),e}(ci);var Fi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Vi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fi(e,t),e}(ci);var Ui=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Bi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ui(e,t),e}(ci);var zi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Wi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zi(e,t),e}(ci);var qi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Gi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qi(e,t),e.prototype.events=function(){return{}},e}(ci);var Ki=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ki(e,t),e.prototype.tagName=function(){return"div"},e.prototype.events=function(){return{}},e.prototype.initialize=function(){ci.prototype.initialize.apply(this,arguments);var t=this.model,e=["loop","autoplay","controls","color","rel","modestbranding","poster"].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"),r=t.get("src");switch(n){case"yt":r=t.getYoutubeSrc();break;case"ytnc":r=t.getYoutubeNoCookieSrc();break;case"vi":r=t.getVimeoSrc()}e.src=r}},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")}}},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(){ci.prototype.render.apply(this),this.updateClasses();var t=this.model.get("provider");return this.el.appendChild(this.renderByProvider(t)),this.updateVideo(),this},e}(bi);const Xi=Yi;var Ji=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Zi=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ji(e,t),e.prototype.tagName=function(){return"div"},e}(ci);var Qi=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ts=function(){return ts=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ts.apply(this,arguments)},es=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,e)||this;r.refreshDbn=(0,J.debounce)((function(){return r.refresh()}),0);var o=r.events;return r.on(o.update,r.onUpdate),r.on(o.updateInside,r.onUpdateDeep),r}return Qi(e,t),e.prototype.removeChildren=function(e,n,r){var o;void 0===r&&(r={}),t.prototype.removeChildren.call(this,e,n,r),null===(o=ze(e))||void 0===o||o.forEach((function(t){return Ke(t,{skipRefs:!0})})),this.__trgEvent(this.events.symbolMainRemove,{component:e})},e.prototype.onAdd=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.prototype.onAdd.apply(this,e);var r=e[0];this.__trgEvent(this.events.symbolMainAdd,{component:r})},e.prototype.onUpdate=function(t){this.__trgEvent(this.events.symbolMainUpdate,t)},e.prototype.onUpdateDeep=function(t){this.__trgEvent(this.events.symbolMainUpdateDeep,t)},e.prototype.refresh=function(){var t=this.em,e=this.events;t.trigger(e.symbol)},e.prototype.__trgEvent=function(t,e,n){void 0===n&&(n=!1);var r=this.em,o=this.events,i=n?o.symbolInstance:o.symbolMain;r.trigger(t,e),r.trigger(i,ts(ts({},e),{event:t})),this.refreshDbn()},e}(on);const ns=es;var rs,os=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),is=function(){return is=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},is.apply(this,arguments)};!function(t){t[t.InvalidSource=0]="InvalidSource",t[t.SourceReject=1]="SourceReject",t[t.TargetReject=2]="TargetReject"}(rs||(rs={}));var ss=function(t){function e(e){var n=t.call(this,e,"DomComponents",new on(void 0,{em:e}))||this;n.componentTypes=[{id:"cell",model:ko,view:Hi},{id:"row",model:Bo,view:Wi},{id:"table",model:wo,view:Gi},{id:"thead",model:Ho,view:Bi},{id:"tbody",model:To,view:Di},{id:"tfoot",model:Lo,view:Vi},{id:"map",model:eo,view:ji},{id:"link",model:Jr,view:Ai},{id:"label",model:qr,view:ki},{id:"video",model:Zo,view:Xi},{id:"image",model:Rr,view:bi},{id:"script",model:so,view:Ni},{id:"svg-in",model:go,view:Ii},{id:"svg",model:po,view:Ii},{id:"iframe",model:Nr,view:vi},{id:"comment",model:Er,view:hi},{id:"textnode",model:Sr,view:di},{id:Kn,model:Jn,view:ci},{id:"wrapper",model:ni,view:Zi},{id:"text",model:Vr,view:Ti},{id:"default",model:Wn,view:ci}],n.componentsById={},n.Component=Wn,n.Components=on,n.ComponentView=ci,n.ComponentsView=ii,n.storageKey="components",n.keySymbols="symbols",n.events=oe.I;var r=n.config;for(var o in n.symbols=new ns([],{em:e,config:r,domc:n}),e&&(n.config.components=e.config.components||n.config.components),wr)o in n.config||(n.config[o]=wr[o]);var i=n.config.pStylePrefix;if(i&&(n.config.stylePrefix=i+n.config.stylePrefix),e){e.get("Parser").compTypes=n.componentTypes,e.on("change:componentHovered",n.componentHovered,n);var s=e.get("selected");e.listenTo(s,"add",(function(t,e,r){return n.selectAdd(s.getComponent(t),r)})),e.listenTo(s,"remove",(function(t,e,r){return n.selectRemove(s.getComponent(t),r)}))}return n}return os(e,t),e.prototype.postLoad=function(){var t=this.em,e=this.symbols;t.UndoManager.add(e)},e.prototype.load=function(t){var e=this,n=this.loadProjectData(t,{onResult:function(t){var n=e.getWrapper();if(n||(e.em.Pages.add({},{select:!0}),n=e.getWrapper()),(0,J.isArray)(t))t.length&&n.components(t);else{var r=t.components,o=void 0===r?[]:r,i=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["components"]);n.set(i),n.components(o)}}});return this.symbols.reset(t[this.keySymbols]||[]),n},e.prototype.store=function(){var t;return(t={})[this.keySymbols]=this.symbols,t},e.prototype.getComponent=function(){var t=this.em.Pages.getSelected(),e=null==t?void 0:t.getMainFrame();return null==e?void 0:e.getComponent()},e.prototype.getWrapper=function(){return this.getComponent()},e.prototype.getComponents=function(){var t=this.getWrapper();return null==t?void 0:t.components()},e.prototype.addComponent=function(t,e){return void 0===e&&(e={}),this.getComponents().add(t,e)},e.prototype.render=function(){var t;return null===(t=this.componentView)||void 0===t?void 0:t.render().el},e.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},e.prototype.setComponents=function(t,e){void 0===e&&(e={}),this.clear(e).addComponent(t,e)},e.prototype.addType=function(t,e){var n=this.em,r=e.model,o=void 0===r?{}:r,i=e.view,s=void 0===i?{}:i,a=e.isComponent,l=e.extend,c=e.extendView,u=e.extendFn,p=void 0===u?[]:u,d=e.extendFnView,f=void 0===d?[]:d,h=e.block,g=this.getType(t),v=this.getType(l),m=this.getType(c),y=v||g||this.getType("default"),b=y.model,w=m?m.view:y.view,_=function(t,e,n){return t.reduce((function(t,r){var o=e[r],i=n.prototype[r];return o&&i&&(t[r]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.bind(this).apply(void 0,t),o.bind(this).apply(void 0,t)}),t}),{})};if("object"==typeof o){var x={defaults:o.defaults};delete o.defaults;var C=new Set(b.typeExtends);C.add(b.getDefaults().type),e.model=b.extend(is(is({},o),_(p,o,b)),{typeExtends:C,isComponent:!g||v||a?a||function(){return 0}:b.isComponent}),Object.defineProperty(e.model.prototype,"defaults",{get:function(){return is(is({},(0,J.result)(b.prototype,"defaults")||{}),(0,J.result)(x,"defaults")||{})}})}if("object"==typeof s&&(e.view=w.extend(is(is({},s),_(f,s,w)))),g?(g.model=e.model,g.view=e.view):(e.id=t,this.componentTypes.unshift(e)),h){var S={id:t,label:t,content:{type:t}},T=!0===h?S:is(is({},S),h);n.Blocks.add(T.id||t,T)}var O="component:type:".concat(g?"update":"add");return null==n||n.trigger(O,g||e),this},e.prototype.getType=function(t){for(var e=this.componentTypes,n=0;n<e.length;n++)if(e[n].id==t)return e[n]},e.prototype.removeType=function(t){var e=this.componentTypes,n=this.getType(t);if(n){var r=e.indexOf(n);return e.splice(r,1),n}},e.prototype.getTypes=function(){return this.componentTypes},e.prototype.selectAdd=function(t,e){var n=this;void 0===e&&(e={}),t&&(t.set({status:"selected"}),["component:selected","component:toggled"].forEach((function(r){return n.em.trigger(r,t,e)})))},e.prototype.selectRemove=function(t,e){var n=this;void 0===e&&(e={}),t&&(this.em,t.set({status:"",state:""}),["component:deselected","component:toggled"].forEach((function(r){return n.em.trigger(r,t,e)})))},e.prototype.componentHovered=function(){var t=this.em,e=t.get("componentHovered"),n=t.previous("componentHovered"),r="hovered";n&&n.get("status")==r&&n.set({status:"",state:""}),e&&(0,J.isEmpty)(e.get("status"))&&e.set("status",r)},e.prototype.getShallowWrapper=function(){var t=this.shallow,e=this.em;if(!t&&e){var n=e.shallow;if(!n)return;var r=n.Components;if(r.componentTypes=this.componentTypes,t=r.getWrapper()){var o=[Un,Bn].join(" ");t.on(o,(0,J.debounce)((function(){return null==t?void 0:t.components("")}),100))}this.shallow=t}return t},e.prototype.isComponent=function(t){return(0,Z.isComponent)(t)},e.prototype.addSymbol=function(t){if(!(0,J.isSymbol)(t)||Ve(t)){var e=t.clone({symbol:!0});return Re(e)&&this.symbols.add(e),this.em.trigger("component:toggled"),e}},e.prototype.getSymbols=function(){return function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],this.symbols.models,!0)},e.prototype.detachSymbol=function(t){He(t)&&Ke(t)},e.prototype.getSymbolInfo=function(t,e){void 0===e&&(e={});var n=Re(t),r=Be(t),o=!!r,i=ze(n?t:r)||[],s=r||(n?t:void 0),a=qe(t,{changed:e.withChanges}),l=n||o;return{isSymbol:l,isMain:n,isInstance:o,isRoot:l&&Ve(t),main:s,instances:i,relatives:a||[]}},e.prototype.canMove=function(t,e,n){var r={result:!1,reason:rs.InvalidSource,target:t,source:null};if(!e||!t)return r;var o=(0,Z.isComponent)(e)?e:null;if(!o){var i=this.getShallowWrapper();o=(null==i?void 0:i.append(e)[0])||null}if(r.source=o,!o)return r;var s=o.get("draggable");if((0,J.isFunction)(s))s=!!s(o,t,n);else{var a=t.getEl();s=(0,J.isArray)(s)?s.join(","):s,s=(0,J.isString)(s)?null==a?void 0:a.matches(s):s}if(!s)return is(is({},r),{reason:rs.SourceReject});var l=t.get("droppable");(0,J.isFunction)(l)?l=!!l(o,t,n):!1===l&&t.isInstanceOf("text")&&o.get("textable")?l=!0:(a=o.getEl(),l=(0,J.isArray)(l)?l.join(","):l,l=(0,J.isString)(l)?null==a?void 0:a.matches(l):l);var c=[t].concat(t.parents()).indexOf(o)>-1;return is(is({},r),!l||c?{reason:rs.TargetReject}:{result:!0})},e.prototype.allById=function(){return this.componentsById},e.prototype.getById=function(t){return this.componentsById[t]||null},e.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{}}))},e}(ft);const as=ss,ls={stylePrefix:"css-",rules:[]};var cs=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),us=Number.MAX_VALUE,ps=function(t){function e(){var e=t.call(this)||this;return(0,J.bindAll)(e,"sortRules"),e.compCls=[],e.ids=[],e}return cs(e,t),e.prototype.buildFromModel=function(t,e){var n=this;void 0===e&&(e={});var r="",o=this.em,i=o&&o.getConfig().avoidInlineStyle,s=t.styleToString(),a=t.classes;return this.ids.push("#".concat(t.getId())),a.forEach((function(t){return n.compCls.push(t.getFullName())})),!i&&s&&(r="#".concat(t.getId(),"{").concat(s,"}")),t.components().forEach((function(t){return r+=n.buildFromModel(t,e)})),r},e.prototype.build=function(t,e){var n=this;void 0===e&&(e={});var r=e.json,o=e.em,i=e.cssc||(null==o?void 0:o.Css);this.em=o,this.compCls=[],this.ids=[],this.model=t;var s=[],a=t?this.buildFromModel(t,e):"",l=(0,J.isUndefined)(e.clearStyles)&&o?o.getConfig().clearStyles:e.clearStyles;if(i){var c=e.rules||i.getAll(),u={},p=[];e.onlyMatched&&t&&(0,Z.hasWin)()&&(c=this.matchedRules(t,c)),c.forEach((function(t){var o=t.getAtRule();if(o){var i=u[o];i?i.push(t):u[o]=[t]}else{var l=n.buildFromRule(t,p,e);r?s.push(l):a+=l}})),this.sortMediaObject(u).forEach((function(t){var o="",i=t.key;t.value.forEach((function(t){var l=n.buildFromRule(t,p,e);t.get("singleAtRule")?a+="".concat(i,"{").concat(l,"}"):o+=l,r&&s.push(l)})),o&&(a+="".concat(i,"{").concat(o,"}"))})),o&&l&&c.remove&&c.remove(p)}return r?s.filter((function(t){return t})):a},e.prototype.buildFromRule=function(t,e,n){var r,o=this;void 0===n&&(n={});var i,s="",a=this.model,l=t.selectorsToString({skipAdd:1}),c=t.get("selectorsAdd"),u=t.get("singleAtRule");if(null===(r=t.get("selectors"))||void 0===r||r.forEach((function(t){var e=t.getFullName();(o.compCls.indexOf(e)>=0||o.ids.indexOf(e)>=0||n.keepUnusedStyles)&&(i=1)})),l&&i||c||u||!a){var p=t.getDeclaration({body:1});p&&(n.json?s=t:s+=p)}else e.push(t);return s},e.prototype.matchedRules=function(t,e){var n=this,r=t.getEl(),o=[];return e.forEach((function(t){try{t.selectorsToString().split(",").some((function(t){return null==r?void 0:r.matches(n.__cleanSelector(t))}))&&o.push(t)}catch(t){}})),t.components().forEach((function(t){o=o.concat(n.matchedRules(t,e))})),o=o.filter((function(t,e){return o.indexOf(t)===e})),o},e.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):us},e.prototype.sortMediaObject=function(t){var e=this;void 0===t&&(t={});var n=[];return(0,J.each)(t,(function(t,e){return n.push({key:e,value:t})})),n.sort((function(t,n){var r=[t.key,n.key].every((function(t){return-1!==t.indexOf("min-width")})),o=r?t.key:n.key,i=r?n.key:t.key;return e.getQueryLength(o)-e.getQueryLength(i)}))},e.prototype.sortRules=function(t,e){var n=function(t){return t.get("mediaText")||""},r=[n(t),n(e)].every((function(t){return-1!==t.indexOf("min-width")})),o=n(r?t:e),i=n(r?e:t);return this.getQueryLength(o)-this.getQueryLength(i)},e.prototype.__cleanSelector=function(t){return t.split(" ").map((function(t){return t.split(":")[0]})).join(" ")},e}(ot.Kx);const ds=ps;var fs=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hs=function(){return hs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},hs.apply(this,arguments)},gs=((0,Z.hasWin)()?window:{}).CSS,vs=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e)||this;return r.config=e||{},r.opt=n,r.em=n.em,r.ensureSelectors(null,null,{}),r.on("change",r.__onChange),r}return fs(e,t),e.prototype.defaults=function(){return{selectors:[],selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:!1,important:!1,group:"",shallow:!1,_undo:!0}},e.prototype.__onChange=function(t,e){var n=this.em,r=this.changedAttributes();r&&!(0,Z.isEmptyObj)(r)&&(null==n||n.changesUp(e))},e.prototype.clone=function(){var t=hs({},this.opt),e=hs({},this.attributes);return e.selectors=this.get("selectors").map((function(t){return t.clone()})),new this.constructor(e,t)},e.prototype.ensureSelectors=function(t,e,n){var r=this.em,o=null==r?void 0:r.Selectors,i=[this,"change:selectors",this.ensureSelectors],s=this.getSelectors();if(this.stopListening.apply(this,i),s.models&&(s=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],s.models,!0)),s=(0,J.isString)(s)?[s]:s,Array.isArray(s)){var a=s.filter((function(t){return t})).map((function(t){return o?o.add(t):t}));s=new dn(a)}this.set("selectors",s,n),this.listenTo.apply(this,i)},e.prototype.getAtRule=function(){var t=this.get("atRuleType"),e=this.get("mediaText"),n=t?"@".concat(t):e?"@media":"";return n+(e&&n?" ".concat(e):"")},e.prototype.selectorsToString=function(t){void 0===t&&(t={});var e=[],n=this.get("state"),r=this.get("selectorsAdd"),o={escape:function(t){return gs&&gs.escape?gs.escape(t):t}},i=this.getSelectors().getFullString(0,o),s=n&&!t.skipState?":".concat(n):"";return i&&e.push("".concat(i).concat(s)),r&&!t.skipAdd&&e.push(r),e.join(", ")},e.prototype.getDeclaration=function(t){void 0===t&&(t={});var e="",n=this.attributes.important,r=this.selectorsToString(t),o=this.styleToString(hs({important:n},t)),i=this.get("singleAtRule");return(r||i)&&(o||t.allowEmpty)&&(e=i?o:"".concat(r,"{").concat(o,"}")),e},e.prototype.getDevice=function(){var t=this.em,e=this.attributes,n=e.atRuleType,r=e.mediaText,o=(null==t?void 0:t.Devices.getDevices())||[],i=o.filter((function(t){return""===t.getWidthMedia()}))[0];return"media"===n&&r?o.filter((function(t){return t.getWidthMedia()===((e=/(-?\d*\.?\d+)\w{0,}/.exec(r))?e[0]:"");var e}))[0]||null:i||null},e.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},e.prototype.getComponent=function(){var t,e=this.getSelectors(),n=1==e.length&&e.at(0),r=n&&n.isId()&&n.get("name");return r&&(null===(t=this.em)||void 0===t?void 0:t.Components.getById(r))||null},e.prototype.toCSS=function(t){void 0===t&&(t={});var e="",n=this.getAtRule(),r=this.getDeclaration(t);return(r||t.allowEmpty)&&(e=r),n&&e&&(e="".concat(n,"{").concat(e,"}")),e},e.prototype.toJSON=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=ot.Kx.prototype.toJSON.apply(this,e);if(null===(t=this.em)||void 0===t?void 0:t.getConfig().avoidDefaults){var o=this.defaults();(0,J.forEach)(o,(function(t,e){r[e]===t&&delete r[e]})),delete r.style.__p,(0,J.isEmpty)(r.selectors)&&delete r.selectors,(0,J.isEmpty)(r.style)&&delete r.style}return r},e.prototype.compare=function(t,e,n,r){var o;void 0===r&&(r={});var i=e||"",s=n||"",a=r.selectorsAdd||"",l=r.atRuleType||"";s&&!l&&(l="media");var c=((0,J.isArray)(t)||t.models?t.models||t:[t]).map((function(t){return t.getFullName()})),u=null===(o=this.get("selectors"))||void 0===o?void 0:o.map((function(t){return t.getFullName()})),p=c.slice().sort(),d=u.slice().sort();return!(c.length!==u.length||!p.every((function(t,e){return t===d[e]})))&&this.get("state")===i&&this.get("mediaText")===s&&this.get("selectorsAdd")===a&&this.get("atRuleType")===l},e}(Ie);const ms=vs;var ys=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bs=function(t){function e(e,n){var r=t.call(this,e)||this;return r.editor=null==n?void 0:n.em,setTimeout((function(){r.on("remove",r.onRemove),r.on("add",r.onAdd)})),r}return ys(e,t),e.prototype.toJSON=function(t){return ot.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,ot.pM.prototype.add.apply(this,[t,e])},e}(ot.pM);const ws=bs;bs.prototype.model=ms;var _s=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xs=function(){return xs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},xs.apply(this,arguments)},Cs=function(t){function e(e){var n=t.call(this,e,"CssComposer",null,{},ls)||this;n.Selectors=dn,n.storageKey="styles";var r=n.config,o=r.pStylePrefix;return o&&(r.stylePrefix=o+r.stylePrefix),r.rules=n.em.config.style||r.rules||"",n.rules=new ws([],r),n}return _s(e,t),e.prototype.onLoad=function(){this.rules.add(this.config.rules,{silent:!0})},e.prototype.postLoad=function(){var t,e=null===(t=this.em)||void 0===t?void 0:t.get("UndoManager");e&&e.add(this.getAll())},e.prototype.store=function(){return this.getProjectData()},e.prototype.load=function(t){return this.loadProjectData(t,{all:this.rules})},e.prototype.add=function(t,e,n,r,o){void 0===r&&(r={}),void 0===o&&(o={});var i=e||"",s=n||"",a=xs({},r),l=this.get(t,i,s,a);return l&&l.config&&!l.config.singleAtRule||(a.state=i,a.mediaText=s,a.selectors=[],s&&!a.atRuleType&&(a.atRuleType="media"),(l=new ms(a,this.config)).get("selectors").add(t,o),this.rules.add(l,o)),l},e.prototype.get=function(t,e,n,r){var o=t;if((0,J.isString)(t)){var i=this.em.Selectors,s=t.split(",")[0].trim(),a=this.em.Parser.parserCss.checkNode({selectors:s})[0];o=i.get(a.selectors)}return this.rules.find((function(t){return t.compare(o,e,n,r)}))||null},e.prototype.getAll=function(){return this.rules},e.prototype.addCollection=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=this.em,o=[];(0,J.isString)(t)&&(t=r.Parser.parseCss(t));for(var i=t instanceof Array?t:[t],s=0,a=i.length;s<a;s++){var l=i[s]||{};if(l.selectors){var c=null==r?void 0:r.Selectors;c||console.warn("Selector Manager not found");for(var u=l.selectors,p=u instanceof Array?u:[u],d=[],f=0,h=p.length;f<h;f++){var g=c.add(p[f]);d.push(g)}var v=this.get(d,l.state,l.mediaText,l),m=this.add(d,l.state,l.mediaText,l,e),y=!v||!e.avoidUpdateStyle,b=l.style||{};if((0,Z.isObject)(n)&&m.set(n,e),y){var w=e.extend?xs(xs({},m.get("style")),b):b;m.set("style",w,e)}o.push(m)}}return o},e.prototype.addRules=function(t){return this.addCollection(t)},e.prototype.setRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=n.atRuleType,o=n.atRuleParams,i=this.em.Parser.parserCss.checkNode({selectors:t,style:e})[0],s=i.state,a=i.selectorsAdd,l=this.em.Selectors.add(i.selectors),c=this.add(l,s,o,{selectorsAdd:a,atRule:r});return n.addStyles?c.addStyle(e,n):c.setStyle(e,n),c},e.prototype.getRule=function(t,e){void 0===e&&(e={});var n=this.em,r=n.Selectors,o=n.Parser.parserCss.checkNode({selectors:t})[0],i=r.get(o.selectors),s=o.state,a=o.selectorsAdd,l=e.atRuleType,c=e.atRuleParams;return i?this.get(i,s,c,{selectorsAdd:a,atRuleType:l}):void 0},e.prototype.getRules=function(t){var e=this.getAll();if(!t)return function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],e.models,!0);var n={sort:!0},r=(0,J.isString)(t)?t.split(",").map((function(t){return t.trim()})):t,o=e.filter((function(t){return r.indexOf(t.getSelectors().getFullString(null,n))>=0}));return o},e.prototype.setIdRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=n.addOpts,o=void 0===r?{}:r,i=n.mediaText,s=n.state||"",a=(0,J.isUndefined)(i)?this.em.getCurrentMedia():i,l=this.em.Selectors.add({name:t,type:ln.TYPE_ID},o),c=this.add(l,s,a,{},o);return c.setStyle(e,xs(xs({},n),o)),c},e.prototype.getIdRule=function(t,e){void 0===e&&(e={});var n=e.mediaText,r=e.state||"",o=(0,J.isUndefined)(n)?this.em.getCurrentMedia():n,i=this.em.Selectors.get(t,ln.TYPE_ID);return i&&this.get(i,r,o)},e.prototype.setClassRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=n.state||"",o=n.mediaText||this.em.getCurrentMedia(),i=this.em.Selectors.add({name:t,type:ln.TYPE_CLASS}),s=this.add(i,r,o);return s.setStyle(e,n),s},e.prototype.getClassRule=function(t,e){void 0===e&&(e={});var n=e.state||"",r=e.mediaText||this.em.getCurrentMedia(),o=this.em.Selectors.get(t,ln.TYPE_CLASS);return o&&this.get(o,n,r)},e.prototype.remove=function(t,e){var n=(0,J.isString)(t)?this.getRules(t):t,r=this.getAll().remove(n,e);return(0,J.isArray)(r)?r:[r]},e.prototype.clear=function(t){return void 0===t&&(t={}),this.getAll().reset([],t),this},e.prototype.getComponentRules=function(t,e){void 0===e&&(e={});var n=e.state,r=e.mediaText;e.current&&(n=this.em.get("state")||"",r=this.em.getCurrentMedia());var o=t.getId(),i=this.getAll().filter((function(t){return!(!(0,J.isUndefined)(n)&&t.get("state")!==n||!(0,J.isUndefined)(r)&&t.get("mediaText")!==r||t.getSelectorsString()!=="#".concat(o))}));return i},e.prototype.render=function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new Se({collection:this.rules,config:this.config}),this.rulesView.render().el},e.prototype.checkId=function(t,e){void 0===e&&(e={});var n=e.idMap,r=void 0===n?{}:n,o=[];return Object.keys(r).length?((Array.isArray(t)?t:[t]).forEach((function(t){var e=t.selectors;if(e&&1==e.length){var n=e[0];if((0,J.isString)(n)){if("#"===n[0]){var i=n.substring(1),s=r[i];i&&s&&(e[0]="#".concat(s),o.push(t))}}else n.name&&n.type===ln.TYPE_ID&&(s=r[n.name])&&(n.name=s,o.push(t))}})),o):o},e.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove()},e}(ft);const Ss=Cs,Ts={appendTo:"",blocks:[],appendOnClick:!1,custom:!1};var Os=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const As=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Os(e,t),e.prototype.defaults=function(){return{label:"",content:"",media:"",category:"",activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{}}},Object.defineProperty(e.prototype,"category",{get:function(){var t=this.get("category");return t instanceof gn?t:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),e.prototype.getId=function(){return this.id},e.prototype.getLabel=function(){return this.get("label")},e.prototype.getMedia=function(){return this.get("media")},e.prototype.getContent=function(){return this.get("content")},e.prototype.getCategoryLabel=function(){var t=this.get("category");return(0,J.isFunction)(null==t?void 0:t.get)?t.get("label"):(null==t?void 0:t.label)?null==t?void 0:t.label:t},e}(ot.Kx);var Es=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ks=function(t){function e(e,n){var r=t.call(this,e)||this;return r.em=n.em,r.on("add",r.handleAdd),r}return Es(e,t),e.prototype.getCategories=function(){return this.em.Blocks.getCategories()},e.prototype.handleAdd=function(t){this.initCategory(t)},e}(bn);const Ps=ks;var js;ks.prototype.model=As,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"}(js||(js={}));var Ms=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ns=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e)||this,o=r.model;return r.em=n.em,r.config=n,r.endDrag=r.endDrag.bind(r),r.ppfx=n.pStylePrefix||"",r.listenTo(o,"destroy remove",r.remove),r.listenTo(o,"change",r.render),r}return Ms(e,t),e.prototype.events=function(){return{click:"handleClick",mousedown:"startDrag",dragstart:"handleDragStart",drag:"handleDrag",dragend:"handleDragEnd"}},e.prototype.__getModule=function(){return this.em.Blocks},e.prototype.handleClick=function(t){var e=this,n=e.config,r=e.model,o=e.em,i=r.get("onClick")||n.appendOnClick;if(o.trigger("block:click",r,t),i){if((0,J.isFunction)(i))return i(r,null==o?void 0:o.getEditor(),{event:t});var s,a,l=n.getSorter(),c=r.get("content"),u=o.getSelected();if(l.setDropContent(c),u)if(l.validTarget(u.getEl(),c).valid)s=u;else{var p=u.parent();p&&l.validTarget(p.getEl(),c).valid&&(s=p,a=p.components().indexOf(u)+1)}if(!s){var d=o.getWrapper();l.validTarget(d.getEl(),c).valid&&(s=d)}var f=s&&s.append(c,{at:a})[0];f&&o.setSelected(f,{scroll:1})}},e.prototype.startDrag=function(t){var e=this,n=e.config,r=e.em,o=e.model,i=o.get("disable");if(0===t.button&&n.getSorter&&!this.el.draggable&&!i){r.refreshCanvas();var s=n.getSorter();s.__currentBlock=o,s.setDragHelper(this.el,t),s.setDropContent(this.model.get("content")),s.startSort(this.el),(0,fe.on)(document,"mouseup",this.endDrag)}},e.prototype.handleDragStart=function(t){this.__getModule().__startDrag(this.model,t)},e.prototype.handleDrag=function(t){this.__getModule().__drag(t)},e.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},e.prototype.endDrag=function(){(0,fe.AU)(document,"mouseup",this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},e.prototype.render=function(){var t,e=this,n=e.em,r=e.el,o=e.$el,i=e.ppfx,s=e.model,a=s.get("disable"),l=s.get("attributes")||{},c=l.class||"",u="".concat(i,"block"),p=n&&n.t("blockManager.labels.".concat(s.id))||s.get("label"),d=s.get("render"),f=s.get("media"),h=a?"".concat(u,"--disable"):"".concat(i,"four-color-h");o.attr(l),r.className="".concat(c," ").concat(u," ").concat(i,"one-bg ").concat(h).trim(),r.innerHTML="\n ".concat(f?'<div class="'.concat(u,'__media">').concat(f,"</div>"):"",'\n <div class="').concat(u,'-label">').concat(p,"</div>\n "),r.title=l.title||(null===(t=r.textContent)||void 0===t?void 0:t.trim()),r.setAttribute("draggable","".concat(!(!(0,Z.hasDnd)(n)||a)));var g=d&&d({el:r,model:s,className:u,prefix:i});return g&&(r.innerHTML=g),this},e}(ot.Ss);const Ls=Ns;var Is=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$s=function(t){function e(e,n,r){var o=t.call(this,e)||this;o.config=n;var i=n.pStylePrefix||"";return o.em=n.em,o.catName=r,o.pfx=i,o.caretR="fa fa-caret-right",o.caretD="fa fa-caret-down",o.iconClass="".concat(i,"caret-icon"),o.activeClass="".concat(i,"open"),o.className="".concat(i).concat(r,"-category"),o.listenTo(o.model,"change:open",o.updateVisibility),o.model.view=o,o}return Is(e,t),e.prototype.events=function(){return{"click [data-title]":"toggle"}},e.prototype.template=function(t){var e,n,r=t.pfx,o=t.label,i=t.catName;return Q(Rs||(e=['\n <div class="','title" data-title>\n <i class="','caret-icon"></i>\n ','\n </div>\n <div class="',"",'s-c"></div>\n '],n=['\n <div class="','title" data-title>\n <i class="','caret-icon"></i>\n ','\n </div>\n <div class="',"",'s-c"></div>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,Rs=e),r,r,o,r,i)},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,r=t.$el,o=t.model,i=t.pfx,s=t.catName,a=e.t("".concat(s,"Manager.categories.").concat(o.id))||o.get("label");return n.innerHTML=this.template({pfx:i,label:a,catName:s}),r.addClass(this.className),r.css({order:o.get("order")}),this.updateVisibility(),this},e}(ot.Ss);const Ds=$s;var Rs,Hs=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fs=function(){return Fs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Fs.apply(this,arguments)},Vs=function(t){function e(e,n){var r=t.call(this,e)||this;r.renderedCategories=new Map,(0,J.bindAll)(r,"getSorter","onDrag","onDrop","onMove"),r.config=n||{},r.categories=e.categories||"";var o=r.config.pStylePrefix||"";r.ppfx=o,r.noCatClass="".concat(o,"blocks-no-cat"),r.blockContClass="".concat(o,"blocks-c"),r.catsClass="".concat(o,"block-categories");var i=r.collection;return r.listenTo(i,"add",r.addTo),r.listenTo(i,"reset",r.render),r.em=r.config.em,r.em&&(r.config.getSorter=r.getSorter),r}return Hs(e,t),e.prototype.__getModule=function(){return this.em.Blocks},e.prototype.updateConfig=function(t){void 0===t&&(t={}),this.config=Fs(Fs({},this.config),t)},e.prototype.getSorter=function(){var t=this.em;if(t){if(!this.sorter){var e=t.Utils,n=t.Canvas;this.sorter=new e.Sorter({container:n.getBody(),placer:n.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,onMove:this.onMove,document:n.getFrameEl().contentDocument,direction:"a",wmargin:1,nested:1,em:t,canvasRelative:1})}return this.sorter}},e.prototype.onDrag=function(t){this.em.stopDefault(),this.__getModule().__startDrag(this.sorter.__currentBlock,t)},e.prototype.onMove=function(t){this.__getModule().__drag(t)},e.prototype.onDrop=function(t){this.em.runDefault(),this.__getModule().__endDrag({component:t}),delete this.sorter.__currentBlock},e.prototype.addTo=function(t){this.add(t)},e.prototype.add=function(t,e){var n=this.config,r=this.renderedCategories,o=t.get("attributes"),i=new Ls({model:t,attributes:o},n).render().el,s=t.parent.initCategory(t);if(s&&this.categories&&!n.ignoreCategories){var a=s.getId(),l=this.getCategoriesEl(),c=r.get(a);return!c&&l&&(c=new Ds({model:s},n,"block").render(),r.set(a,c),l.appendChild(c.el)),void(null==c||c.append(i))}e?e.appendChild(i):this.append(i)},e.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector(".".concat(this.catsClass))),this.catsEl},e.prototype.getBlocksEl=function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.noCatClass," .").concat(this.blockContClass))),this.blocksEl},e.prototype.append=function(t){var e=this.getBlocksEl();e&&e.appendChild(t)},e.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 r="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(r),this.rendered=!0,this},e}(ot.Ss);const Us=Vs;var Bs=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zs=function(){return zs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},zs.apply(this,arguments)},Ws=function(t){function e(e){var n,r=t.call(this,e,"BlockManager",new Ps((null===(n=e.config.blockManager)||void 0===n?void 0:n.blocks)||[],{em:e}),js,Ts)||this;return r.events=js,r.Block=As,r.Blocks=Ps,r.Category=gn,r.Categories=xn,r.storageKey="",r.blocks=r.all,r.blocksVisible=new Ps(r.blocks.models,{em:e}),r.categories=new xn([],{em:e,events:{update:js.categoryUpdate}}),r.blocks.on("add",(function(t){return r.blocksVisible.add(t)})),r.blocks.on("remove",(function(t){return r.blocksVisible.remove(t)})),r.blocks.on("reset",(function(t){return r.blocksVisible.reset(t.models)})),r.__onAllEvent=(0,J.debounce)((function(){return r.__trgCustom()}),0),r}return Bs(e,t),e.prototype.__trgCustom=function(){this.em.trigger(this.events.custom,this.__customData())},e.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)}}},e.prototype.__startDrag=function(t,e){var n=this,r=n.em,o=n.events,i=n.blocks,s=t.getContent?t.getContent():t;this._dragBlock=t,r.set({dragResult:null,dragContent:s}),[r,i].map((function(n){return n.trigger(o.dragStart,t,e)}))},e.prototype.__drag=function(t){var e=this,n=e.em,r=e.events,o=e.blocks,i=this._dragBlock;[n,o].map((function(e){return e.trigger(r.drag,i,t)}))},e.prototype.__endDrag=function(t){void 0===t&&(t={});var e=this,n=e.em,r=e.events,o=e.blocks,i=this._dragBlock,s=t.component||n.get("dragResult");if(delete this._dragBlock,s&&i){var a="activeOnRender",l=s.get&&s.get(a),c=i.get("activate")||l,u=i.get("select"),p=(0,J.isArray)(s)?s[0]:s;(u||c&&!1!==u)&&n.setSelected(p),c&&(p.trigger("active"),l&&p.unset(a)),i.get("resetId")&&p.onAll((function(t){return t.resetId()}))}n.set({dragResult:null,dragContent:null}),i&&[n,o].map((function(t){return t.trigger(r.dragEnd,s,i)}))},e.prototype.__getFrameViews=function(){return this.em.Canvas.getFrames().map((function(t){return t.view})).filter(Boolean)},e.prototype.__behaviour=function(t){return void 0===t&&(t={}),this._bhv=zs(zs({},this._bhv||{}),t)},e.prototype.__getBehaviour=function(){return this._bhv||{}},e.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()}))},e.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()},e.prototype.postRender=function(){var t=this,e=t.categories,n=t.config,r=t.em,o=this.blocksVisible;this.blocksView=new Us({collection:o,categories:e},zs(zs({},n),{em:r})),this.__appendTo(o.models),this.__trgCustom()},e.prototype.add=function(t,e,n){void 0===n&&(n={});var r=e||{};return r.id=t,this.blocks.add(r,n)},e.prototype.get=function(t){return this.blocks.get(t)},e.prototype.getAll=function(){return this.blocks},e.prototype.getAllVisible=function(){return this.blocksVisible},e.prototype.remove=function(t,e){return void 0===e&&(e={}),this.__remove(t,e)},e.prototype.getCategories=function(){return this.categories},e.prototype.getContainer=function(){var t;return null===(t=this.blocksView)||void 0===t?void 0:t.el},e.prototype.getDragBlock=function(){return this._dragBlock},e.prototype.getBlocksByCategory=function(t){return vn(t||this.getAll().models)},e.prototype.render=function(t,e){void 0===e&&(e={});var n=this,r=n.categories,o=n.config,i=n.em,s=t||this.getAll().models;if(e.external){var a=new Ps(s,{em:i});return new Us({collection:a,categories:r},zs(zs({em:i},o),e)).render().el}return this.blocksView&&(this.blocksView.updateConfig(e),this.blocksView.collection.reset(s),this.blocksView.rendered||(this.blocksView.render(),this.blocksView.rendered=!0)),this.getContainer()},e.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()},e}(ft);const qs=Ws,Gs={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 Ks=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ys=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ks(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}(ot.Kx);const Xs=Ys;Ys.prototype.idAttribute="name";var Js=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zs="contentEditable",Qs=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.config||{};return n.config=r,n.module=e.module,n.coll=e.coll||null,n.pfx=r.stylePrefix||"",n.ppfx=r.pStylePrefix||"",n.em=r.em,n.listenTo(n.model,"change:active",n.updateStatus),n}return Js(e,t),e.prototype.template=function(){var t,e,n=this,r=n.pfx,o=n.model,i=n.config,s=o.get("label")||"";return Q(ea||(t=['\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=['\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 "],Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,ea=t),r,r,r,s,r,r,i.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[Zs]="true",e.focus(),null==t||t.setEditing(!0)},e.prototype.endEditTag=function(){var t=this.model,e=this.em,n=this.getInputEl(),r=n.textContent||"",o=null==e?void 0:e.Selectors;n[Zs]="false",null==e||e.setEditing(!1),o&&o.rename(t,r)!==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,r=t.config,o=r.iconTagOn,i=r.iconTagOff,s=n.find("[data-tag-status]");e.get("active")?(s.html(o),n.removeClass("opac50")):(s.html(i),n.addClass("opac50"))},e.prototype.render=function(){var t=this,e=t.pfx,n=t.ppfx,r=t.$el,o=t.model,i="".concat(e,"tag"),s=["".concat(i," ").concat(n,"three-bg")];return o.get("protected")&&s.push("".concat(i,"-protected")),r.html(this.template()),r.attr("class",s.join(" ")),this.updateStatus(),this},e}(ot.Ss);const ta=Qs;var ea,na=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ra=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},oa=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{},n.pfx=n.config.stylePrefix||"",n.ppfx=n.config.pStylePrefix||"",n.className=n.pfx+"tags",n.stateInputId=n.pfx+"states",n.stateInputC=n.pfx+"input-c",n.states=n.config.states||[];var r=n.config.em,o=n.collection;n.target=r;var i=r.Selectors;n.module=i,n.em=r,n.componentChanged=(0,J.debounce)(n.componentChanged.bind(n),0),n.checkSync=(0,J.debounce)(n.checkSync.bind(n),0);var s=oe.I.update,a="".concat(s,":classes"),l="component:toggled ".concat(a),c="".concat(a," ").concat(s,":attributes:id change:state");return n.listenTo(r,l,n.componentChanged),n.listenTo(r,"styleManager:update",n.componentChanged),n.listenTo(r,c,n.__handleStateChange),n.listenTo(r,"styleable:change change:device",n.checkSync),n.listenTo(o,"add",n.addNew),n.listenTo(o,"reset",n.renderClasses),n.listenTo(o,"remove",n.tagRemoved),n.listenTo(i.getAll(),i.events.state,(0,J.debounce)((function(){return n.renderStates()}),0)),n.delegateEvents(),n}return na(e,t),e.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,r=t.iconSync,o=t.iconAdd,i=t.pfx,s=t.ppfx;return Q(sa||(sa=ra([' <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>'])),i,i,i,i,n,i,i,i,s,s,s,i,s,s,i,s,i,i,i,i,i,o,i,i,r,i,i,e,i)},e.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"}},e.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),r=e.Css,o=this.getCommonSelectors({opts:{noDisabled:1}}),i=e.get("state"),s=e.getCurrentMedia(),a=[],l=r.get(o,i,s)||r.add(o,i,s);this.getTargets().forEach((function(e){var n=r.getIdRule(e.getId(),{state:i,mediaText:s});t=n.getStyle(),n.setStyle({}),a.push(n)})),t&&l.addStyle(t),e.trigger("component:toggled"),e.trigger("component:sync-style",{component:n,selectors:o,mediaText:s,rule:l,ruleComponents:a,state:i})},e.prototype.tagRemoved=function(t){this.updateStateVis()},e.prototype.addNew=function(t){this.addToClasses(t)},e.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()},e.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("")},e.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()},e.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},e.prototype.componentChanged=function(t){var e=(void 0===t?{}:t).targets;this.updateSelection(e)},e.prototype.updateSelection=function(t){var e=t||this.getTargets(),n=[];return(e=(0,J.isArray)(e)?e:[e])&&e.length&&(n=this.getCommonSelectors({targets:e}),this.checkSync({validSelectors:n})),this.collection.reset(n),this.updateStateVis(e),this.module.__trgCustom(),n},e.prototype.getCommonSelectors=function(t){var e=void 0===t?{}:t,n=e.targets,r=e.opts,o=void 0===r?{}:r,i=n||this.getTargets();return this.module.__getCommonSelectors(i,o)},e.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)},e.prototype.checkSync=function(){var t,e=this,n=e.$btnSyncEl,r=e.config,o=e.collection,i=this.getTarget();if(i&&r.componentFirst&&o.length){var s=i.getStyle();t=!(0,J.isEmpty)(s)}n&&n[t?"show":"hide"]()},e.prototype.getTarget=function(){return this.target.getSelected()},e.prototype.getTargets=function(){return this.target.getSelectedAll()},e.prototype.updateStateVis=function(t){var e=this.em,n=e&&e.getConfig().avoidInlineStyle,r=this.collection.length||n?"":"none";this.getStatesC().css("display",r),this.updateSelector(t)},e.prototype.__handleStateChange=function(){this.updateSelector(this.getTargets())},e.prototype.updateSelector=function(t){var e=this,n=this.el.querySelector("[data-selected]"),r=[],o=t||this.getTargets();(o=(0,J.isArray)(o)?o:[o]).forEach((function(t){return r.push(e.__getName(t))})),n&&(n.innerHTML=r.join(", ")),this.checkStates()},e.prototype.__getName=function(t){var e,n=this,r=n.pfx,o=n.config,i=n.em,s=o.selectedName,a=o.componentFirst;if((0,J.isString)(t))e=Q(aa||(aa=ra(['<span class="','sel-gen">',"</span>"],['<span class="','sel-gen">',"</span>"])),r,t);else{var l=null==t?void 0:t.getSelectors();if(!l)return"";var c=l.getStyleable(),u=i.get("state"),p=t.getId?Q(la||(la=ra(['<span class="','sel-cmp">','</span>\n <span class="','sel-id">#',"</span>"],['<span class="','sel-cmp">','</span>\n <span class="','sel-id">#',"</span>"])),r,t.getName(),r,t.getId()):"";e=(e=this.collection.getFullString(c))?Q(ca||(ca=ra(['<span class="','sel-rule">',"</span>"],['<span class="','sel-rule">',"</span>"])),r,e):t.get("selectorsAdd")||p,e=a&&p?p:e,e+=u?Q(ua||(ua=ra(['<span class="','sel-state">:',"</span>"],['<span class="','sel-state">:',"</span>"])),r,u):"",e=s?s({result:e,state:u,target:t}):e}return e&&'<span class="'.concat(r,'sel">').concat(e,"</span>")},e.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set("state",n)},e.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},e.prototype.addToClasses=function(t,e){var n=e,r=this.getClasses(),o=new ta({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(o):r.append(o),o},e.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)},e.prototype.getClasses=function(){return this.$el.find("[data-selectors]")},e.prototype.getStates=function(){if(!this.$states){var t=this.$el.find("[data-states]");this.$states=t[0]&&t}return this.$states},e.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},e.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t("selectorManager.emptyState"),r=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(""),o=this.getStates();o&&o.html('<option value="">'.concat(n,"</option>").concat(r)),this.checkStates()},e.prototype.render=function(){var t=this,e=t.em,n=t.pfx,r=t.ppfx,o=t.config,i=t.$el,s=t.el,a=o.render,l={iconSync:o.iconSync,iconAdd:o.iconAdd,labelHead:e.t("selectorManager.label"),labelInfo:e.t("selectorManager.selected"),ppfx:r,pfx:n,el:s};i.html(this.template(l));var c=a&&a(l);return c&&c!==s&&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(r,"one-bg ").concat(r,"two-color")),this},e}(ot.Ss);const ia=oa;var sa,aa,la,ca,ua,pa=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),da=function(){return da=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},da.apply(this,arguments)},fa=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},ha=function(t){return(0,J.isString)(t)&&"#"==t[0]},ga=function(t){return(0,J.isString)(t)&&"."==t[0]},va="selector",ma="".concat(va,":"),ya="".concat(ma,"add"),ba="".concat(ma,"update"),wa="".concat(ma,"remove"),_a="".concat(wa,":before"),xa="".concat(ma,"custom"),Ca="".concat(ma,"state"),Sa={all:va,update:ba,add:ya,remove:wa,removeBefore:_a,state:Ca,custom:xa},Ta=function(t){function e(e){var n=t.call(this,e,"SelectorManager",new dn([]),Sa,Gs,{skipListen:!0})||this;n.Selector=ln,n.Selectors=dn,n.storageKey="",(0,J.bindAll)(n,"__updateSelectedByComponents");var r=n.config,o=r.pStylePrefix;o&&(r.stylePrefix=o+r.stylePrefix),n.all=new dn(r.selectors),n.selected=new dn([],{em:e,config:r}),n.states=new ot.pM(r.states.map((function(t){return new Xs(t)})),{model:Xs}),n.model=new ot.Kx({cFirst:r.componentFirst,_undo:!0}),n.__update=(0,J.debounce)((function(){return n.__trgCustom()}),0),n.__initListen({collections:[n.states,n.selected],propagate:[{entity:n.states,event:n.events.state}]}),e.on("change:state",(function(t,n){return e.trigger(Ca,n)})),n.model.on("change:cFirst",(function(t,n){return e.trigger("selector:type",n)}));var i="".concat(oe.I.update,":classes");e.on("component:toggled ".concat(i),n.__updateSelectedByComponents);var s="component:toggled ".concat(i," change:device styleManager:update selector:state selector:type style:target");return n.model.listenTo(e,s,(function(){return n.__update()})),n}return pa(e,t),e.prototype.__trgCustom=function(t){this.em.trigger(this.events.custom,this.__customData(t))},e.prototype.getAll=function(t){return void 0===t&&(t={}),this.all?t.array?fa([],this.all.models,!0):this.all:[]},e.prototype.__customData=function(t){return void 0===t&&(t={}),this.__ctn=this.__ctn||t.container,{states:this.getStates(),selected:this.getSelected(),container:this.__ctn}},e.prototype.postRender=function(){this.__appendTo(),this.__trgCustom()},e.prototype.select=function(t,e){void 0===e&&(e={});var n=Array.isArray(t)?t:[t],r=this.em.Styles.select(n,e);this.selected.reset(this.__getCommonSelectors(r));var o=this.selectorTags,i=r.filter((function(t){return t})).map((function(t){return(0,Z.isComponent)(t)||(0,Z.isRule)(t)&&!t.get("selectorsAdd")?t:t.getSelectorsString()}));return o&&o.componentChanged({targets:i}),this},e.prototype.addSelector=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=da({},e);(0,J.isObject)(t)?r=t:r.name=t,ha(r.name)?(r.name=r.name.substr(1),r.type=ln.TYPE_ID):ga(r.name)&&(r.name=r.name.substr(1)),r.label&&!r.name&&(r.name=this.escapeName(r.label));var o=r.name,i=this.getConfig(),s=this.all,a=this.em,l=o?this.get(o,r.type):s.where(r)[0];if(!l){var c=r instanceof ln?r:new ln(r,da(da({},n),{config:i,em:a}));return s.add(c,n)}return l},e.prototype.getSelector=function(t,e){return void 0===e&&(e=ln.TYPE_CLASS),ha(t)?(t=t.substr(1),e=ln.TYPE_ID):ga(t)&&(t=t.substr(1)),this.all.where({name:t,type:e})[0]},e.prototype.add=function(t,e){var n=this;void 0===e&&(e={});var r=(0,J.isString)(t)?{}:e;return(0,J.isArray)(t)?t.map((function(t){return n.addSelector(t,e,r)})):this.addSelector(t,e,r)},e.prototype.addClass=function(t){var e=this,n=[];return(0,J.isString)(t)&&(t=t.trim().split(" ")),t.forEach((function(t){return n.push(e.addSelector(t))})),n},e.prototype.get=function(t,e){var n=this;if((0,J.isArray)(t)){var r=[];return t.map((function(t){return n.getSelector(t)})).filter(Boolean).forEach((function(t){return r.indexOf(t)<0&&r.push(t)})),r}return this.getSelector(t,e)},e.prototype.remove=function(t,e){return this.__remove(t,e)},e.prototype.rename=function(t,e,n){var r=this.escapeName(e);return this.get(r)||t.set({name:r,label:e},n)},e.prototype.setState=function(t){return this.em.setState(t),this},e.prototype.getState=function(){return this.em.getState()},e.prototype.getStates=function(){return fa([],this.states.models,!0)},e.prototype.setStates=function(t,e){return this.states.reset(t.map((function(t){return new Xs(t)})),e)},e.prototype.getSelected=function(){return this.__getCommon()},e.prototype.getSelectedAll=function(){return fa([],this.selected.models,!0)},e.prototype.addSelected=function(t){var e=this.add(t);this.em.getSelectedAll().forEach((function(t){t.getSelectors().add(e)}))},e.prototype.removeSelected=function(t){this.em.getSelectedAll().forEach((function(e){!t.get("protected")&&e&&e.getSelectors().remove(t)}))},e.prototype.duplicateSelected=function(t,e){var n=this;void 0===e&&(e={});var r=this.em,o=this.getSelected();if(!(o.indexOf(t)<0)){var i=this.getState(),s=r.getCurrentMedia(),a=r.Css.get(o,i,s),l=null==a?void 0:a.getStyle();r.getSelectedAll().forEach((function(r){var o=r.getSelectors();if(o.includes(t)){var i=e.suffix||" copy",s=t.getLabel(),a=n.addSelector("".concat(s).concat(i)),l=o.indexOf(t);o.remove(t),o.add(a,{at:l})}})),l&&r.Css.add(this.getSelected(),i,s).setStyle(l)}},e.prototype.getSelectedTargets=function(){return this.em.Styles.getSelectedAll()},e.prototype.setComponentFirst=function(t){this.getConfig().componentFirst=t,this.model.set({cFirst:t})},e.prototype.getComponentFirst=function(){return this.getConfig().componentFirst},e.prototype.escapeName=function(t){var e=this.getConfig().escapeName;return e?e(t):ln.escapeName(t)},e.prototype.render=function(t){var e=this.selectorTags,n=this.getConfig(),r=null==e?void 0:e.el;return this.selected.reset(t),this.selectorTags=new ia({el:r,collection:this.selected,module:this,config:n}),this.selectorTags.render().el},e.prototype.destroy=function(){var t=this.selectorTags;this.model.stopListening(),this.__update.cancel(),this.__destroy(),null==t||t.remove(),this.selectorTags=void 0},e.prototype.__getCommon=function(){return this.__getCommonSelectors(this.em.getSelectedAll())},e.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)},e.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]):[]},e.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},e}(ft);const Oa=Ta,Aa={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}};var Ea,ka=((Ea={})[4]="media",Ea[5]="font-face",Ea[6]="page",Ea[7]="keyframes",Ea[11]="counter-style",Ea[12]="supports",Ea[13]="document",Ea[14]="font-feature-values",Ea[15]="viewport",Ea),Pa=(0,J.keys)(ka),ja=[5,6,11,15],Ma=Pa.filter((function(t){return ja.indexOf(Number(t))<0})).map((function(t){return ka[t]})).concat(["container","layer"]),Na=ja.map((function(t){return ka[t]})),La=function(t){void 0===t&&(t="");for(var e=[],n=[],r=t.split(","),o=0,i=r.length;o<i;o++){var s=r[o].trim();if(/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(s)||/^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(s)){var a=s.split(".").filter(Boolean);n.push(a)}else e.push(s)}return{result:n,add:e}},Ia=function(t){for(var e=t.style,n={},r=0,o=e.length;r<o;r++){var i=e[r],s=e.getPropertyValue(i),a=e.getPropertyPriority(i);n[i]="".concat(s).concat(a?" !".concat(a):"")}return n},$a=function(t){return(t.conditionText||t.media&&t.media.mediaText||t.name||t.selectorText||"").trim()},Da=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r={},o=t.length,i=t[o-1],s=i?i.split(/:(.+)/):[],a=s[1],l=n.atRule,c=n.selectorsAdd,u=n.mediaText;return Na.indexOf(l)>=0&&(r.singleAtRule=!0),l&&(r.atRuleType=l),c&&(r.selectorsAdd=c),u&&(r.mediaText=u),a&&(t[o-1]=s[0],r.state=a,s.splice(s.length-1,1)),r.selectors=t,r.style=e,r},Ra=function(t){var e=t.cssText,n=void 0===e?"":e;return Ma.find((function(t){return 0===n.indexOf("@".concat(t))}))},Ha=function(t){for(var e=[],n=t.cssRules||[],r=0,o=n.length;r<o;r++){var i=n[r],s=i.type,a=!1,l="",c="",u=i.selectorText||i.keyText||"",p=ja.indexOf(s)>=0;if(p)a=!0,l=ka[s],c=$a(i);else if(Pa.indexOf("".concat(s))>=0||!s&&Ra(i)){var d=Ha(i),f=ka[s]||Ra(i);c=$a(i);for(var h=0,g=d.length;h<g;h++){var v=d[h];c&&(v.mediaText=c),v.atRuleType=f}e=e.concat(d)}if(u||p){for(var m=Ia(i),y=La(u),b=y.add,w=y.result,_=void 0,x=0,C=w.length;x<C;x++){var S=Da(w[x],m,{atRule:ka[s]});e.push(S),_=S}if(b.length){var T=b.join(", ");_?_.selectorsAdd=T:(S={selectors:[],selectorsAdd:T,style:m},a&&(S.singleAtRule=a),l&&(S.atRuleType=l),c&&(S.mediaText=c),e.push(S))}}}return e};var Fa=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Va=function(t){function e(e){var n=t.call(this,e,"Parser",Aa)||this,r=n.config;return n.parserCss=function(t,e){return void 0===e&&(e={}),{parse:function(n){var r=this,o=[],i=e.parserCss,s=null==t?void 0:t.Editor,a=i?i(n,s):function(t){var e=document.createElement("style");e.innerHTML=t,document.head.appendChild(e);var n=e.sheet;return document.head.removeChild(e),n?Ha(n):[]}(n);return a.forEach((function(t){return o=o.concat(r.checkNode(t))})),null==t||t.trigger("parse:css",{input:n,output:o,nodes:a}),o},checkNode:function(t){var e=t.selectors,n=t.style,r=[t];if((0,J.isString)(e)){var o=[],i=t,s=La(e),a=s.result,l=s.add.join(", "),c={atRule:i.atRule,mediaText:i.params};a.length?a.forEach((function(t){o.push(Da(t,n,c))})):o.push(Da([],n,c)),l&&(o[o.length-1].selectorsAdd=l),r=o}return r}}}(e,r),n.parserHtml=ke(e,r),n}return Fa(e,t),e.prototype.parseHtml=function(t,e){void 0===e&&(e={});var n=this.em,r=this.parserHtml;return r.compTypes=n.Components.getTypes()||[],r.parse(t,this.parserCss,e)},e.prototype.parseCss=function(t){return this.parserCss.parse(t)},e.prototype.destroy=function(){},e}(dt);const Ua=Va,Ba={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 za=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},Wa=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};const qa=function(){function t(){}return t.prototype.store=function(t){return za(this,arguments,void 0,(function(t,e){return void 0===e&&(e={}),Wa(this,(function(n){return this.hasLocal(e,!0)&&localStorage.setItem(e.key,JSON.stringify(t)),[2,t]}))}))},t.prototype.load=function(){return za(this,arguments,void 0,(function(t){var e;return void 0===t&&(t={}),Wa(this,(function(n){return e={},this.hasLocal(t,!0)&&(e=JSON.parse(localStorage.getItem(t.key)||"{}")),[2,e]}))}))},t.prototype.hasLocal=function(t,e){if(void 0===t&&(t={}),t.checkLocal&&(!(0,Z.hasWin)()||!localStorage)){if(e)throw new Error("localStorage not available");return!1}return!0},t}();function Ga(t){return Ga="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},Ga(t)}var Ka=setTimeout;function Ya(t){return Boolean(t&&void 0!==t.length)}function Xa(){}function Ja(t){if(!(this instanceof Ja))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=[],rl(t,this)}function Za(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,Ja._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void tl(e.promise,t)}Qa(e.promise,r)}else(1===t._state?Qa:tl)(e.promise,t._value)}))):t._deferreds.push(e)}function Qa(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===Ga(e)||"function"==typeof e)){var n=e.then;if(e instanceof Ja)return t._state=3,t._value=e,void el(t);if("function"==typeof n)return void rl((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,el(t)}catch(e){tl(t,e)}var r,o}function tl(t,e){t._state=2,t._value=e,el(t)}function el(t){2===t._state&&0===t._deferreds.length&&Ja._immediateFn((function(){t._handled||Ja._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)Za(t,t._deferreds[e]);t._deferreds=null}function nl(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function rl(t,e){var n=!1;try{t((function(t){n||(n=!0,Qa(e,t))}),(function(t){n||(n=!0,tl(e,t))}))}catch(t){if(n)return;n=!0,tl(e,t)}}Ja.prototype.catch=function(t){return this.then(null,t)},Ja.prototype.then=function(t,e){var n=new this.constructor(Xa);return Za(this,new nl(t,e,n)),n},Ja.prototype.finally=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)}))}))},Ja.all=function(t){return new Ja((function(e,n){if(!Ya(t))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,s){try{if(s&&("object"===Ga(s)||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,(function(e){i(t,e)}),n)}r[t]=s,0==--o&&e(r)}catch(t){n(t)}}for(var s=0;s<r.length;s++)i(s,r[s])}))},Ja.resolve=function(t){return t&&"object"===Ga(t)&&t.constructor===Ja?t:new Ja((function(e){e(t)}))},Ja.reject=function(t){return new Ja((function(e,n){n(t)}))},Ja.race=function(t){return new Ja((function(e,n){if(!Ya(t))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=t.length;r<o;r++)Ja.resolve(t[r]).then(e,n)}))},Ja._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){Ka(t,0)},Ja._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};const ol=Ja;(0,Z.hasWin)()&&(window.Promise=window.Promise||ol);const il="function"==typeof fetch?fetch.bind():function(t,e){return new ol((function(n,r){var o=new XMLHttpRequest;for(var i in o.open(e.method||"get",t),o.withCredentials="include"==e.credentials,e.headers||{})o.setRequestHeader(i,e.headers[i]);o.onload=function(t){return n({status:o.status,statusText:o.statusText,text:function(){return ol.resolve(o.responseText)}})},o.onerror=r,o.upload&&e.onProgress&&(o.upload.onprogress=e.onProgress),e.body?o.send(e.body):o.send()}))};var sl=function(){return sl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},sl.apply(this,arguments)},al=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},ll=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},cl=function(){function t(){}return t.prototype.store=function(t){return al(this,arguments,void 0,(function(t,e){return void 0===e&&(e={}),ll(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()]}}))}))},t.prototype.load=function(){return al(this,arguments,void 0,(function(t){return void 0===t&&(t={}),ll(this,(function(e){switch(e.label){case 0:return[4,this.request(t.urlLoad,this.__props(t),t)];case 1:return[2,e.sent()]}}))}))},t.prototype.request=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),il(t,e).then((function(t){var e=t.text();return 1==(t.status/200|0)?e:e.then(Promise.reject)})).then((function(t){var e=t&&(0,J.isString)(t);return n.contentTypeJson&&e?JSON.parse(t):t}))},t.prototype.__props=function(t,e){void 0===t&&(t={});var n,r=t.contentTypeJson,o=t.headers||{},i=t.fetchOptions||{},s="X-Requested-With",a="Content-Type";if((0,J.isUndefined)(o[s])&&(o[s]="XMLHttpRequest"),(0,J.isUndefined)(o[a])&&r&&(o[a]="application/json; charset=utf-8"),e)if(r)n=JSON.stringify(e);else for(var l in n=new FormData,e)n.append(l,e[l]);var c={method:n?"POST":"GET",credentials:t.credentials,headers:o,body:n};return sl(sl({},c),(0,J.isFunction)(i)?i(c):i)},t}();const ul=cl;var pl;!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"}(pl||(pl={}));const dl=pl;var fl=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hl=function(){return hl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},hl.apply(this,arguments)},gl=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},vl=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},ml="local",yl="remote",bl=function(t){function e(e){var n=t.call(this,e,"StorageManager",Ba)||this;n.storages={},n.events=dl;var r=n.config;return r._disable&&(r.type=void 0),n.storages={},n.add(ml,new qa),n.add(yl,new ul),n.setCurrent(r.type),n}return fl(e,t),e.prototype.isAutosave=function(){return!!this.config.autosave},e.prototype.setAutosave=function(t){return this.config.autosave=!!t,this},e.prototype.getStepsBeforeSave=function(){return this.config.stepsBeforeSave},e.prototype.setStepsBeforeSave=function(t){return this.config.stepsBeforeSave=t,this},e.prototype.add=function(t,e){return this.storages[t]=e,this},e.prototype.get=function(t){return this.storages[t]},e.prototype.getStorages=function(){return this.storages},e.prototype.getCurrent=function(){return this.config.currentStorage},e.prototype.setCurrent=function(t){return this.getConfig().currentStorage=t,this},e.prototype.getCurrentStorage=function(){return this.get(this.getCurrent())},e.prototype.getStorageOptions=function(t){return this.getCurrentOptions(t)},e.prototype.store=function(t){return gl(this,arguments,void 0,(function(t,e){var n,r,o,i,s;return void 0===e&&(e={}),vl(this,(function(a){switch(a.label){case 0:n=this.getCurrentStorage(),r=hl(hl({},this.getCurrentOptions()),e),o=this.getRecoveryStorage(),i=this.getCurrentOptions(ml),a.label=1;case 1:return a.trys.push([1,5,,9]),[4,this.__exec(n,r,t)];case 2:return a.sent(),o?[4,this.__exec(o,i,{})]:[3,4];case 3:a.sent(),a.label=4;case 4:return[3,9];case 5:return s=a.sent(),o?[4,this.__exec(o,i,t)]:[3,7];case 6:return a.sent(),[3,8];case 7:throw s;case 8:return[3,9];case 9:return[2,t]}}))}))},e.prototype.load=function(){return gl(this,arguments,void 0,(function(t){var e,n,r,o,i;return void 0===t&&(t={}),vl(this,(function(s){switch(s.label){case 0:return e=this.getCurrentStorage(),n=hl(hl({},this.getCurrentOptions()),t),(r=this.getRecoveryStorage())?[4,this.__exec(r,this.getCurrentOptions(ml))]:[3,5];case 1:if(i=s.sent(),(0,J.isEmpty)(i))return[3,5];s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.__askRecovery()];case 3:return s.sent(),o=i,[3,5];case 4:return s.sent(),[3,5];case 5:return o?[3,7]:[4,this.__exec(e,n)];case 6:o=s.sent(),s.label=7;case 7:return[2,o||{}]}}))}))},e.prototype.__askRecovery=function(){var t=this.em,e=this.getRecovery();return new Promise((function(n,r){(0,J.isFunction)(e)?e(n,r,null==t?void 0:t.getEditor()):confirm(null==t?void 0:t.t("storageManager.recover"))?n(null):r()}))},e.prototype.getRecovery=function(){return this.config.recovery},e.prototype.getRecoveryStorage=function(){return this.getRecovery()&&this.getCurrent()===yl&&this.get(ml)},e.prototype.__exec=function(t,e,n){return gl(this,void 0,void 0,(function(){var r,o,i,s,a,l,c,u,p,d,f,h,g,v;return vl(this,(function(m){switch(m.label){case 0:if(r=n?"store":"load",o=this.getConfig(),i=o.onStore,s=o.onLoad,!t)return[2,n||{}];this.onStart(r,n),m.label=1;case 1:return m.trys.push([1,14,,15]),l=null===(v=this.em)||void 0===v?void 0:v.getEditor(),c=void 0,n?(p=i)?[4,i(n,l)]:[3,3]:[3,7];case 2:p=m.sent(),m.label=3;case 3:return u=p||n,(d=e.onStore)?[4,e.onStore(u,l)]:[3,5];case 4:d=m.sent(),m.label=5;case 5:return u=d||u,[4,t.store(u,e)];case 6:return c=m.sent(),a=n,[3,13];case 7:return[4,t.load(e)];case 8:return c=m.sent(),a=this.__clearKeys(c),(f=e.onLoad)?[4,e.onLoad(a,l)]:[3,10];case 9:f=m.sent(),m.label=10;case 10:return a=f||a,(h=s)?[4,s(a,l)]:[3,12];case 11:h=m.sent(),m.label=12;case 12:a=h||a,m.label=13;case 13:return this.onAfter(r,a,c),this.onEnd(r,a,c),[3,15];case 14:throw g=m.sent(),this.onError(r,g),g;case 15:return[2,a]}}))}))},e.prototype.__clearKeys=function(t){void 0===t&&(t={});var e=this.getConfig(),n=new RegExp("^".concat(e.id)),r={};for(var o in t)r[o.replace(n,"")]=t[o];return r},e.prototype.getCurrentOptions=function(t){var e=this.getConfig(),n=t||this.getCurrent();return e.options[n]||{}},e.prototype.onStart=function(t,e){var n=this.em;if(n){var r="load"===t?dl.startLoad:dl.startStore;n.trigger(dl.start,t,e),n.trigger(r,e)}},e.prototype.onAfter=function(t,e,n){var r=this.em;if(r){var o="load"===t?dl.afterLoad:dl.afterStore;r.trigger(dl.after),r.trigger(o,e,n);var i="load"===t?dl.load:dl.store;r.trigger(i,e,n)}},e.prototype.onEnd=function(t,e,n){var r=this.em;if(r){var o="load"===t?dl.endLoad:dl.endStore;r.trigger(dl.end,t,e,n),r.trigger(o,e,n)}},e.prototype.onError=function(t,e){var n=this.em;if(n){var r="load"===t?dl.errorLoad:dl.errorStore;n.trigger(dl.error,e,t),n.trigger(r,e),this.onEnd(t,e)}},e.prototype.canAutoload=function(){return!!this.getCurrentStorage()&&!!this.config.autoload},e.prototype.destroy=function(){this.storages={}},e}(dt);const wl=bl,_l={stylePrefix:"trt-",appendTo:"",optionsTarget:[{value:!1},{value:"_blank"}],custom:!1};var xl=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cl=function(){return Cl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Cl.apply(this,arguments)},Sl=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.events={},n.appendInput=!0;var r=e.config,o=void 0===r?{}:r,i=n,s=i.model,a=i.eventCapture,l=s.target,c=s.attributes.type;return n.config=o,n.em=o.em,n.pfx=o.stylePrefix||"",n.ppfx=o.pStylePrefix||"",n.target=l,n.className=n.pfx+"trait",n.clsField="".concat(n.ppfx,"field ").concat(n.ppfx,"field-").concat(c),[["change:value",n.onValueChange],["remove",n.removeView]].forEach((function(t){var e=t[0],r=t[1];s.off(e,r),n.listenTo(s,e,r)})),s.view=n,n.listenTo(s,"change:label",n.render),n.listenTo(s,"change:placeholder",n.rerender),n.events={},a.forEach((function(t){return n.events[t]="onChange"})),n.delegateEvents(),n.init(),n}return xl(e,t),e.prototype.attributes=function(){return this.model.get("attributes")||{}},e.prototype.templateLabel=function(t){var e=this.ppfx,n=this.getLabel();return'<div class="'.concat(e,'label" title="').concat(n,'">').concat(n,"</div>")},e.prototype.templateInput=function(t){var e=this.clsField;return'<div class="'.concat(e,'" data-input></div>')},e.prototype.getClbOpts=function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},e.prototype.removeView=function(){this.remove(),this.removed()},e.prototype.init=function(){},e.prototype.removed=function(){},e.prototype.onRender=function(t){},e.prototype.onUpdate=function(t){},e.prototype.onEvent=function(t){},e.prototype.onChange=function(t){var e=this.getInputElem();e&&!(0,J.isUndefined)(e.value)&&this.model.set("value",e.value),this.onEvent(Cl(Cl({},this.getClbOpts()),{event:t}))},e.prototype.getValueForTarget=function(){return this.model.get("value")},e.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.value=t)},e.prototype.onValueChange=function(t,e,n){if(void 0===n&&(n={}),n.fromTarget)this.setInputValue(t.get("value")),this.postUpdate();else{var r=this.getValueForTarget();t.setTargetValue(r,n)}},e.prototype.renderLabel=function(){var t=this.$el,e=this.target,n=this.getLabel(),r=this.templateLabel(e);this.createLabel&&(r=this.createLabel({label:n,component:e,trait:this})||""),t.find("[data-label]").append(r)},e.prototype.getLabel=function(){var t=this.em,e=this.model.attributes,n=e.label,r=e.name;return t.t("traitManager.traits.labels.".concat(r))||(0,Z.capitalize)(n||r).replace(/-/g," ")},e.prototype.getComponent=function(){return this.target},e.prototype.getInputEl=function(){if(!this.$input){var t=this.em,e=this.model,n=e,r=e.attributes.name,o=n.get("placeholder")||n.get("default")||"",i=n.get("type")||"text",s=n.get("min"),a=n.get("max"),l=this.getModelValue(),c=(0,rt.default)('<input type="'.concat(i,'">')),u=t.t("traitManager.traits.attributes.".concat(r))||{};c.attr(Cl({placeholder:o},u)),(0,J.isUndefined)(l)||(n.set({value:l},{silent:!0}),c.prop("value",l)),s&&c.prop("min",s),a&&c.prop("max",a),this.$input=c}return this.$input.get(0)},e.prototype.getInputElem=function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()},e.prototype.getModelValue=function(){return this.model.getValue()},e.prototype.getElInput=function(){return this.elInput},e.prototype.renderField=function(){var t=this,e=t.$el,n=t.appendInput,r=t.model,o=e.find("[data-input]"),i=o[o.length-1],s=r.el;s||(s=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,J.isString)(s)?(i.innerHTML=s,this.elInput=i.firstChild):(n?i.appendChild(s):i.insertBefore(s,i.firstChild),this.elInput=s),r.el=this.elInput},e.prototype.hasLabel=function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t},e.prototype.rerender=function(){delete this.model.el,this.render()},e.prototype.postUpdate=function(){this.onUpdate(this.getClbOpts())},e.prototype.render=function(){var t=this,e=t.$el,n=t.pfx,r=t.ppfx,o=t.model.attributes,i=o.type,s=o.id,a=this.hasLabel&&this.hasLabel(),l="".concat(n,"trait");delete this.$input;var c='<div class="'.concat(l," ").concat(l,"--").concat(i,'">\n ').concat(a?'<div class="'.concat(r,'label-wrp" data-label></div>'):"",'\n <div class="').concat(r,"field-wrp ").concat(r,"field-wrp--").concat(i,'" data-input>\n ').concat(this.templateInput?(0,J.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:"","\n </div>\n </div>");return e.empty().append(c),a&&this.renderLabel(),this.renderField(),this.el.className="".concat(l,"__wrp ").concat(l,"__wrp-").concat(s),this.postUpdate(),this.onRender(this.getClbOpts()),this},e}(ot.Ss);const Tl=Sl;Sl.prototype.eventCapture=["change"];var Ol=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Al=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ol(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")&&Tl.prototype.renderLabel.apply(this)},e.prototype.getInputEl=function(){var t=this.model,e=this.ppfx,n=t.props(),r=n.labelButton,o=n.text,i=n.full,s=r||o,a="".concat(e,"btn");return'<button type="button" class="'.concat(a,"-prim").concat(i?" ".concat(a,"--full"):"",'">').concat(s,"</button>")},e}(Tl);const El=Al;Al.prototype.eventCapture=["click button"];var kl=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.appendInput=!1,e}return kl(e,t),e.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>')},e.prototype.onChange=function(){this.model.set("value",this.getInputElem().checked)},e.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.checked=!!t)},e.prototype.getInputEl=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!this.$input,r=Tl.prototype.getInputEl.apply(this,t);if(n){var o=void 0,i=void 0,s=this.model,a=this.target,l=s.attributes.valueFalse,c=s.getName();s.changeProp?i=o=a.get(c):o=!(!(i=a.get("attributes")[c])&&""!==i),(0,J.isUndefined)(l)||i!==l||(o=!1),r.checked=o}return r},e}(Tl);const jl=Pl;var Ml=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nl=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.ppfx||"";return n.opts=e,n.ppfx=r,n.em=e.target||{},!e.onChange&&n.listenTo(n.model,"change:value",n.handleModelChange),n}return Ml(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,r=t||n.get("defaults"),o=this.getInputEl();o&&(o.value=r)},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,rt.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}(ot.Ss);const Ll=Nl;Nl.prototype.events={change:"handleChange"};var Il=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$l=function(){return $l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},$l.apply(this,arguments)};rt.default&&function(t,e){if((0,Z.hasWin)()){var n={beforeShow:T,move:T,change:T,show:T,hide:T,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=[],o=!!/msie/i.exec(window.navigator.userAgent),i=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'>▼</div>","</div>"].join(""),a=function(){var t="";if(o)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("")}(),l="spectrum.id";t.fn.spectrum=function(c,u){if("string"==typeof c){var p=this,d=Array.prototype.slice.call(arguments,1);return this.each((function(){var e=r[t(this).data(l)];if(e){var n=e[c];if(!n)throw new Error("Spectrum: no such method: '"+c+"'");"get"==c?p=e.get():"container"==c?p=e.container:"option"==c?p=e.option.apply(e,d):"destroy"==c?(e.destroy(),t(this).removeData(l)):n.apply(e,d)}})),p}return this.spectrum("destroy").each((function(){var u=function(l,c){var u=function(e,r){var o=t.extend({},n,e);return o.callbacks={move:A(o.move,r),change:A(o.change,r),show:A(o.show,r),hide:A(o.hide,r),beforeShow:A(o.beforeShow,r)},o}(c,l),p=u.flat,d=u.showSelectionPalette,f=u.localStorageKey,h=u.theme,g=u.callbacks,v=function(t,e,n){var r;return function(){var o=this,i=arguments,s=function(){r=null,t.apply(o,i)};n&&clearTimeout(r),!n&&r||(r=setTimeout(s,e))}}(Vt,10),y=!1,b=!1,w=!0,_=0,x=0,C=0,T=0,P=0,j=0,M=0,N=0,L=0,I=0,$=1,D=[],R=[],H={},F=u.selectionPalette.slice(0),V=u.maxSelectionSize,U="sp-dragging",B=null,z=l.ownerDocument,W=(z.body,t(l)),q=!1,G=t(a,z).addClass(h),K=G.find(".sp-picker-container"),Y=G.find(".sp-color"),X=G.find(".sp-dragger"),J=G.find(".sp-hue"),Z=G.find(".sp-slider"),Q=G.find(".sp-alpha-inner"),tt=G.find(".sp-alpha"),et=G.find(".sp-alpha-handle"),nt=G.find(".sp-input"),rt=G.find(".sp-palette"),ot=G.find(".sp-initial"),it=G.find(".sp-cancel"),st=G.find(".sp-clear"),at=G.find(".sp-choose"),lt=G.find(".sp-palette-toggle"),ct=W.is("input"),ut=ct&&"color"===W.attr("type")&&k(),pt=ct&&!p,dt=pt?t(s).addClass(h).addClass(u.className).addClass(u.replacerClassName):t([]),ft=pt?dt:W,ht=dt.find(".sp-preview-inner"),gt=u.color||ct&&W.val(),vt=!1,mt=u.preferredFormat,yt=!u.showButtons||u.clickoutFiresChange,bt=!gt,wt=u.allowEmpty&&!ut;function _t(){if(u.showPaletteOnly&&(u.showPalette=!0),lt.text(u.showPaletteOnly?u.togglePaletteMoreText:u.togglePaletteLessText),u.palette){D=u.palette.slice(0),R=t.isArray(D[0])?D:[D],H={};for(var e=0;e<R.length;e++)for(var n=0;n<R[e].length;n++){var r=m(R[e][n]).toRgbString();H[r]=!0}}G.toggleClass("sp-flat",p),G.toggleClass("sp-input-disabled",!u.showInput),G.toggleClass("sp-alpha-enabled",u.showAlpha),G.toggleClass("sp-clear-enabled",wt),G.toggleClass("sp-buttons-disabled",!u.showButtons),G.toggleClass("sp-palette-buttons-disabled",!u.togglePaletteOnly),G.toggleClass("sp-palette-disabled",!u.showPalette),G.toggleClass("sp-palette-only",u.showPaletteOnly),G.toggleClass("sp-initial-disabled",!u.showInitial),G.addClass(u.className).addClass(u.containerClassName),Vt()}function xt(){if(f&&window.localStorage){try{var e=window.localStorage[f].split(",#");e.length>1&&(delete window.localStorage[f],t.each(e,(function(t,e){Ct(e)})))}catch(t){}try{F=window.localStorage[f].split(";")}catch(t){}}}function Ct(e){if(d){var n=m(e).toRgbString();if(!H[n]&&-1===t.inArray(n,F))for(F.push(n);F.length>V;)F.shift();if(f&&window.localStorage)try{window.localStorage[f]=F.join(";")}catch(t){}}}function St(){var e=$t(),n=t.map(R,(function(t,n){return S(t,e,"sp-palette-row sp-palette-row-"+n,u)}));xt(),F&&n.push(S(function(){var t=[];if(u.showPalette)for(var e=0;e<F.length;e++){var n=m(F[e]).toRgbString();H[n]||t.push(F[e])}return t.reverse().slice(0,u.maxSelectionSize)}(),e,"sp-palette-row sp-palette-row-selection",u)),rt.html(n.join(""))}function Tt(){if(u.showInitial){var t=vt,e=$t();ot.html(S([t,e],e,"sp-palette-row-initial",u))}}function Ot(){(x<=0||_<=0||T<=0)&&Vt(),b=!0,G.addClass(U),B=null,W.trigger("dragstart.spectrum",[$t()])}function At(){b=!1,G.removeClass(U),W.trigger("dragstop.spectrum",[$t()])}function Et(){var t=nt.val();if(null!==t&&""!==t||!wt){var e=m(t);e.isValid()?(It(e),Ft(!0)):nt.addClass("sp-validation-error")}else It(null),Ft(!0)}function kt(){y?Nt():Pt()}function Pt(){var e=t.Event("beforeShow.spectrum");if(y)Vt();else if(W.trigger("beforeShow.spectrum",[$t()]),!1!==g.beforeShow($t())&&!e.isDefaultPrevented()){!function(){for(var t=0;t<r.length;t++)r[t]&&r[t].hide()}(),y=!0;var n=t(z);n.bind("keydown.spectrum",jt),n.bind("click.spectrum",Mt),t(window).bind("resize.spectrum",v),dt.addClass("sp-active"),G.removeClass("sp-hidden"),Vt(),Rt(),vt=$t(),Tt(),g.show(vt),W.trigger("show.spectrum",[vt])}}function jt(t){27===t.keyCode&&Nt()}function Mt(t){2!=t.button&&(b||(yt?Ft(!0):Lt(),Nt()))}function Nt(){y&&!p&&(y=!1,t(z).unbind("keydown.spectrum",jt),t(z).unbind("click.spectrum",Mt),t(window).unbind("resize.spectrum",v),dt.removeClass("sp-active"),G.addClass("sp-hidden"),g.hide($t()),W.trigger("hide.spectrum",[$t()]))}function Lt(){It(vt,!0)}function It(t,e){var n,r;m.equals(t,$t())?Rt():(!t&&wt?bt=!0:(bt=!1,w=!t,r=(n=m(t)).toHsv(),N=r.h%360/360,L=r.s,I=r.v,$=r.a),Rt(),n&&n.isValid()&&!e&&(mt=u.preferredFormat||n.getFormat()))}function $t(t){return t=t||{},wt&&bt?null:m.fromRatio({h:N,s:L,v:I,a:Math.round(100*$)/100},{format:t.format||mt})}function Dt(){Rt(),g.move($t()),W.trigger("move.spectrum",[$t()])}function Rt(){nt.removeClass("sp-validation-error"),Ht();var t=m.fromRatio({h:N,s:1,v:1});Y.css("background-color",t.toHexString());var e=mt;$<1&&(0!==$||"name"!==e)&&("hex"!==e&&"hex3"!==e&&"hex6"!==e&&"name"!==e||(e="rgb"));var n=$t({format:e}),r="";if(ht.removeClass("sp-clear-display"),ht.css("background-color","transparent"),!n&&wt)ht.addClass("sp-clear-display");else{var s=n.toHexString(),a=n.toRgbString();if(i||1===n.alpha?ht.css("background-color",a):(ht.css("background-color","transparent"),ht.css("filter",n.toFilter())),u.showAlpha){var l=n.toRgb();l.a=0;var c=m(l).toRgbString(),p="linear-gradient(left, "+c+", "+s+")";o?Q.css("filter",m(c).toFilter({gradientType:1},s)):(Q.css("background","-webkit-"+p),Q.css("background","-moz-"+p),Q.css("background","-ms-"+p),Q.css("background","linear-gradient(to right, "+c+", "+s+")"))}r=n.toString(e)}u.showInput&&nt.val(r),u.showPalette&&St(),Tt()}function Ht(){var t=L,e=I;if(wt&&bt)et.hide(),Z.hide(),X.hide();else{et.show(),Z.show(),X.show();var n=t*_,r=x-e*x;n=Math.max(-C,Math.min(_-C,n-C)),r=Math.max(-C,Math.min(x-C,r-C)),X.css({top:r+"px",left:n+"px"});var o=$*P;et.css({left:o-j/2+"px"});var i=N*T;Z.css({top:i-M+"px"})}}function Ft(t){var e=$t(),n="",r=!!w||!m.equals(e,vt);e&&(n=e.toString(mt),!y&&Ct(e)),ct&&W.val(n),t&&r&&(g.change(e),W.trigger("change",[e]))}function Vt(){y&&(_=Y.width(),x=Y.height(),C=X.height(),J.width(),T=J.height(),M=Z.height(),P=tt.width(),j=et.width(),p||(G.css("position","absolute"),u.offset?G.offset(u.offset):G.offset(function(t,e){for(var n=e[0],r=t[0],o=r.parentElement,i=n.getBoundingClientRect(),s=r.offsetWidth,a=r.offsetHeight,l={top:0,left:0,width:n.offsetWidth,height:n.offsetHeight};n&&(l.top+=n.offsetTop-n.scrollTop,l.left+=n.offsetLeft-n.scrollLeft,n!==o&&o.contains(n.offsetParent));)n=n.offsetParent;return i.right+s>window.innerWidth-window.scrollX&&i.right-s>0&&(l.left-=s-l.width),i.bottom+a<window.innerHeight-window.scrollY?l.top+=l.height:l.top-=a,l}(G,ft))),Ht(),u.showPalette&&St(),W.trigger("reflow.spectrum"))}function Ut(){Nt(),q=!0,W.attr("disabled",!0),ft.addClass("sp-disabled")}!function(){if(o&&G.find("*:not(input)").attr("unselectable","on"),_t(),pt&&W.after(dt).hide(),wt||st.hide(),p)W.after(G).hide();else{var e="parent"===u.appendTo?W.parent():t(u.appendTo);1!==e.length&&(e=t("body")),e.append(G)}function n(e){return e.data&&e.data.ignore?(It(t(e.target).closest(".sp-thumb-el").data("color")),Dt()):(It(t(e.target).closest(".sp-thumb-el").data("color")),Dt(),u.hideAfterPaletteSelect&&(Ft(!0),Nt())),!1}xt(),ft.bind("click.spectrum touchstart.spectrum",(function(e){q||kt(),e.stopPropagation(),t(e.target).is("input")||e.preventDefault()})),(W.is(":disabled")||!0===u.disabled)&&Ut(),G.click(O),nt.change(Et),nt.bind("paste",(function(){setTimeout(Et,1)})),nt.keydown((function(t){13==t.keyCode&&Et()})),it.text(u.cancelText),it.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),Lt(),Nt()})),st.attr("title",u.clearText),st.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),bt=!0,Dt(),p&&Ft(!0)})),at.text(u.chooseText),at.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),o&&nt.is(":focus")&&nt.trigger("change"),nt.hasClass("sp-validation-error")||(Ft(!0),Nt())})),lt.text(u.showPaletteOnly?u.togglePaletteMoreText:u.togglePaletteLessText),lt.bind("click.spectrum",(function(t){t.stopPropagation(),t.preventDefault(),u.showPaletteOnly=!u.showPaletteOnly,u.showPaletteOnly||p||G.css("left","-="+(K.outerWidth(!0)+5)),_t()})),E(tt,(function(t,e,n){$=t/P,bt=!1,n.shiftKey&&($=Math.round(10*$)/10),Dt()}),Ot,At),E(J,(function(t,e){N=parseFloat(e/T),bt=!1,u.showAlpha||($=1),Dt()}),Ot,At),E(Y,(function(t,e,n){if(n.shiftKey){if(!B){var r=L*_,o=x-I*x,i=Math.abs(t-r)>Math.abs(e-o);B=i?"x":"y"}}else B=null;var s=!B||"y"===B;(!B||"x"===B)&&(L=parseFloat(t/_)),s&&(I=parseFloat((x-e)/x)),bt=!1,u.showAlpha||($=1),Dt()}),Ot,At),gt?(It(gt),Rt(),mt=u.preferredFormat||m(gt).getFormat(),Ct(gt)):Rt(),p&&Pt();var r=o?"mousedown.spectrum":"click.spectrum touchstart.spectrum";rt.delegate(".sp-thumb-el",r,n),ot.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},n)}();var Bt={show:Pt,hide:Nt,toggle:kt,reflow:Vt,option:function(n,r){return n===e?t.extend({},u):r===e?u[n]:(u[n]=r,"preferredFormat"===n&&(mt=u.preferredFormat),void _t())},enable:function(){q=!1,W.attr("disabled",!1),ft.removeClass("sp-disabled")},disable:Ut,offset:function(t){u.offset=t,Vt()},set:function(t){It(t),Ft()},get:$t,destroy:function(){W.show(),ft.unbind("click.spectrum touchstart.spectrum"),G.remove(),dt.remove(),r[Bt.id]=null},container:G};return Bt.id=r.push(Bt)-1,Bt}(this,t.extend({},c,t(this).data()));t(this).data(l,u.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=E,t.fn.spectrum.defaults=n,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&&!k()&&e.spectrum({preferredFormat:"hex6"})};var c=/^[\s,#]+/,u=/\s+$/,p=0,d=Math,f=d.round,h=d.min,g=d.max,v=d.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,r=!1,o=!1;return"string"==typeof t&&(t=function(t){t=t.replace(c,"").replace(u,"").toLowerCase();var e,n=!1;if(_[t])t=_[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=C.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=C.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=C.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=C.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=C.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=C.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=C.hex8.exec(t))?{a:et(e[1]),r:X(e[2]),g:X(e[3]),b:X(e[4]),format:n?"name":"hex8"}:(e=C.hex6.exec(t))?{r:X(e[1]),g:X(e[2]),b:X(e[3]),format:n?"name":"hex"}:!!(e=C.hex3.exec(t))&&{r:X(e[1]+""+e[1]),g:X(e[2]+""+e[2]),b:X(e[3]+""+e[3]),format:n?"name":"hex"}}(t)),"object"==typeof t&&(t.hasOwnProperty("r")&&t.hasOwnProperty("g")&&t.hasOwnProperty("b")?(e=function(t,e,n){return{r:255*K(t,255),g:255*K(e,255),b:255*K(n,255)}}(t.r,t.g,t.b),r=!0,o="%"===String(t.r).substr(-1)?"prgb":"rgb"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("v")?(t.s=Q(t.s),t.v=Q(t.v),e=function(t,e,n){t=6*K(t,360),e=K(e,100),n=K(n,100);var r=d.floor(t),o=t-r,i=n*(1-e),s=n*(1-o*e),a=n*(1-(1-o)*e),l=r%6;return{r:255*[n,s,i,i,a,n][l],g:255*[a,n,n,s,i,i][l],b:255*[i,i,a,n,n,s][l]}}(t.h,t.s,t.v),r=!0,o="hsv"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("l")&&(t.s=Q(t.s),t.l=Q(t.l),e=function(t,e,n){var r,o,i;function s(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=K(t,360),e=K(e,100),n=K(n,100),0===e)r=o=i=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;r=s(l,a,t+1/3),o=s(l,a,t),i=s(l,a,t-1/3)}return{r:255*r,g:255*o,b:255*i}}(t.h,t.s,t.l),r=!0,o="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=G(n),{ok:r,format:t.format||o,r:h(255,g(e.r,0)),g:h(255,g(e.g,0)),b:h(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=f(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=f(this._r)),this._g<1&&(this._g=f(this._g)),this._b<1&&(this._b=f(this._b)),this._ok=n.ok,this._tc_id=p++};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=G(t),this._roundA=f(100*this._a)/100,this},toHsv:function(){var t=j(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=j(this._r,this._g,this._b),e=f(360*t.h),n=f(100*t.s),r=f(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=P(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=P(this._r,this._g,this._b),e=f(360*t.h),n=f(100*t.s),r=f(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return M(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return N(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:f(this._r),g:f(this._g),b:f(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+f(this._r)+", "+f(this._g)+", "+f(this._b)+")":"rgba("+f(this._r)+", "+f(this._g)+", "+f(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:f(100*K(this._r,255))+"%",g:f(100*K(this._g,255))+"%",b:f(100*K(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+f(100*K(this._r,255))+"%, "+f(100*K(this._g,255))+"%, "+f(100*K(this._b,255))+"%)":"rgba("+f(100*K(this._r,255))+"%, "+f(100*K(this._g,255))+"%, "+f(100*K(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(x[M(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+N(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";return t&&(n=m(t).toHex8String()),"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"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(D,arguments)},brighten:function(){return this._applyModification(R,arguments)},darken:function(){return this._applyModification(H,arguments)},desaturate:function(){return this._applyModification(L,arguments)},saturate:function(){return this._applyModification(I,arguments)},greyscale:function(){return this._applyModification($,arguments)},spin:function(){return this._applyModification(F,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(W,arguments)},complement:function(){return this._applyCombination(V,arguments)},monochromatic:function(){return this._applyCombination(q,arguments)},splitcomplement:function(){return this._applyCombination(z,arguments)},triad:function(){return this._applyCombination(U,arguments)},tetrad:function(){return this._applyCombination(B,arguments)}},m.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:Q(t[r]));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:v(),g:v(),b:v()})},m.mix=function(t,e,n){n=0===n?0:n||50;var r,o=m(t).toRgb(),i=m(e).toRgb(),s=n/100,a=2*s-1,l=i.a-o.a,c=1-(r=((r=a*l==-1?a:(a+l)/(1+a*l))+1)/2),u={r:i.r*r+o.r*c,g:i.g*r+o.g*c,b:i.b*r+o.b*c,a:i.a*s+o.a*(1-s)};return m(u)},m.readability=function(t,e){var n=m(t),r=m(e),o=n.toRgb(),i=r.toRgb(),s=n.getBrightness(),a=r.getBrightness(),l=Math.max(o.r,i.r)-Math.min(o.r,i.r)+Math.max(o.g,i.g)-Math.min(o.g,i.g)+Math.max(o.b,i.b)-Math.min(o.b,i.b);return{brightness:Math.abs(s-a),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,r=0,o=!1,i=0;i<e.length;i++){var s=m.readability(t,e[i]),a=s.brightness>125&&s.color>500,l=s.brightness/125*3+s.color/500;(a&&!o||a&&o&&l>r||!a&&!o&&l>r)&&(o=a,r=l,n=m(e[i]))}return n};var y,b,w,_=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"},x=m.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(_),C=(b="[\\s|\\(]+("+(y="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+y+")[,|\\s]+("+y+")\\s*\\)?",w="[\\s|\\(]+("+y+")[,|\\s]+("+y+")[,|\\s]+("+y+")[,|\\s]+("+y+")\\s*\\)?",{rgb:new RegExp("rgb"+b),rgba:new RegExp("rgba"+w),hsl:new RegExp("hsl"+b),hsla:new RegExp("hsla"+w),hsv:new RegExp("hsv"+b),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 S(e,n,r,o){for(var s=[],a=0;a<e.length;a++){var l=e[a];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(o.preferredFormat||"rgb"),d=i?"background-color:"+c.toRgbString():"filter:"+c.toFilter();s.push('<span title="'+p+'" data-color="'+c.toRgbString()+'" class="'+u+'"><span class="sp-thumb-inner" style="'+d+';"></span></span>')}else s.push(t("<div />").append(t('<span data-color="" style="background-color:transparent;" class="sp-clear-display"></span>').attr("title",o.noColorSelectedText)).html())}return"<div class='sp-cf "+r+"'>"+s.join("")+"</div>"}function T(){}function O(t){t.stopPropagation()}function A(t,e){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}function E(e,n,r,i){n=n||function(){},r=r||function(){},i=i||function(){};var s=document,a=!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(a){if(o&&s.documentMode<9&&!t.button)return g();var r=t&&t.touches&&t.touches[0],i=r&&r.pageX||t.pageX,d=r&&r.pageY||t.pageY,h=Math.max(0,Math.min(i-l.left,u)),v=Math.max(0,Math.min(d-l.top,c));p&&f(t),n.apply(e,[h,v,t])}}function g(){a&&(t(s).unbind(d),t(s.body).removeClass("sp-dragging"),setTimeout((function(){i.apply(e,arguments)}),0)),a=!1}d.selectstart=f,d.dragstart=f,d["touchmove mousemove"]=h,d["touchend mouseup"]=g,t(e).bind("touchstart mousedown",(function(n){(n.which?3==n.which:2==n.button)||a||!1!==r.apply(e,arguments)&&(a=!0,c=t(e).height(),u=t(e).width(),l=t(e).offset(),t(s).bind(d),t(s.body).addClass("sp-dragging"),h(n),f(n))}))}function k(){return t.fn.spectrum.inputTypeColorSupport()}function P(t,e,n){t=K(t,255),e=K(e,255),n=K(n,255);var r,o,i=g(t,e,n),s=h(t,e,n),a=(i+s)/2;if(i==s)r=o=0;else{var l=i-s;switch(o=a>.5?l/(2-i-s):l/(i+s),i){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:o,l:a}}function j(t,e,n){t=K(t,255),e=K(e,255),n=K(n,255);var r,o,i=g(t,e,n),s=h(t,e,n),a=i,l=i-s;if(o=0===i?0:l/i,i==s)r=0;else{switch(i){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:o,v:a}}function M(t,e,n,r){var o=[J(f(t).toString(16)),J(f(e).toString(16)),J(f(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function N(t,e,n,r){return[J(tt(r)),J(f(t).toString(16)),J(f(e).toString(16)),J(f(n).toString(16))].join("")}function L(t,e){e=0===e?0:e||10;var n=m(t).toHsl();return n.s-=e/100,n.s=Y(n.s),m(n)}function I(t,e){e=0===e?0:e||10;var n=m(t).toHsl();return n.s+=e/100,n.s=Y(n.s),m(n)}function $(t){return m(t).desaturate(100)}function D(t,e){e=0===e?0:e||10;var n=m(t).toHsl();return n.l+=e/100,n.l=Y(n.l),m(n)}function R(t,e){e=0===e?0:e||10;var n=m(t).toRgb();return n.r=g(0,h(255,n.r-f(-e/100*255))),n.g=g(0,h(255,n.g-f(-e/100*255))),n.b=g(0,h(255,n.b-f(-e/100*255))),m(n)}function H(t,e){e=0===e?0:e||10;var n=m(t).toHsl();return n.l-=e/100,n.l=Y(n.l),m(n)}function F(t,e){var n=m(t).toHsl(),r=(f(n.h)+e)%360;return n.h=r<0?360+r:r,m(n)}function V(t){var e=m(t).toHsl();return e.h=(e.h+180)%360,m(e)}function U(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 B(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 z(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 W(t,e,n){e=e||6,n=n||30;var r=m(t).toHsl(),o=360/n,i=[m(t)];for(r.h=(r.h-(o*e>>1)+720)%360;--e;)r.h=(r.h+o)%360,i.push(m(r));return i}function q(t,e){e=e||6;for(var n=m(t).toHsv(),r=n.h,o=n.s,i=n.v,s=[],a=1/e;e--;)s.push(m({h:r,s:o,v:i})),i=(i+a)%1;return s}function G(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function K(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=h(e,g(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),d.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Y(t){return h(1,g(0,t))}function X(t){return parseInt(t,16)}function J(t){return 1==t.length?"0"+t:""+t}function Q(t){return t<=1&&(t=100*t+"%"),t}function tt(t){return Math.round(255*parseFloat(t)).toString(16)}function et(t){return X(t)/255}}(rt.default);var Dl=function(t){var e="name"===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,"")},Rl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Il(e,t),e.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 ')},e.prototype.inputClass=function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},e.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},e.prototype.remove=function(){return t.prototype.remove.call(this),this.colorEl.spectrum("destroy"),this},e.prototype.handleChange=function(t){t.stopPropagation();var e=t.target.value;(0,J.isUndefined)(e)||this.__onInputChange(e)},e.prototype.__onInputChange=function(t){var e=this.model,n=this.opts.onChange,r=t,o=this.getColorEl();if(o){o.spectrum("set",r);var i=o.spectrum("get"),s=r&&Dl(i);s&&(r=s)}n?n(r):e.set({value:r},{fromInput:1})},e.prototype.setValue=function(t,e){void 0===e&&(e={});var n=this.model,r=(0,J.isUndefined)(e.def)?n.get("defaults"):e.def,o=(0,J.isUndefined)(t)?(0,J.isUndefined)(r)?"":r:t,i=this.getInputEl(),s=this.getColorEl(),a="none"!=o?o:"";i.value=o,s.get(0).style.backgroundColor=a,(e.fromTarget||e.fromInput&&!e.avoidStore)&&(s.spectrum("set",a),this.noneColor="none"==o,this.movedColor=a)},e.prototype.getColorEl=function(){var t=this;if(!this.colorEl){var e=this,n=e.em,r=e.model,o=e.opts,i=this.ppfx,s=o.onChange,a=(0,rt.default)('<div class="'.concat(this.ppfx,'field-color-picker"></div>')),l=a.get(0).style,c=n&&n.getConfig&&n.getConfig().colorPicker||{};this.movedColor="";var u,p=!1;this.$el.find("[data-colorp-c]").append(a);var d=function(t,e){void 0===e&&(e=!0),s?s(t,!e):(e&&r.setValueFromInput(0,!1),r.setValueFromInput(t,e))};a.spectrum($l($l($l({color:r.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:[]},c),r.get("colorPicker")||{}),{move:function(e){var n=Dl(e);t.movedColor=n,l.backgroundColor=n,d(n,!1)},change:function(e){p=!0;var n=Dl(e);l.backgroundColor=n,d(n),t.noneColor=!1},show:function(e){p=!1,t.movedColor="",u=s?r.getValue({noDefault:!0}):Dl(e)},hide:function(){p||!u&&!s||(t.noneColor&&(u=""),l.backgroundColor=u,a.spectrum("set",u),d(u,!1))}})),n&&n.on&&this.listenTo(n,"component:selected",(function(){t.movedColor&&d(t.movedColor),p=!0,t.movedColor="",a.spectrum("hide")})),this.colorEl=a}return this.colorEl},e.prototype.render=function(){return Ll.prototype.render.call(this),this.getColorEl(),this},e}(Ll);const Hl=Rl;var Fl=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Vl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fl(e,t),e.prototype.templateInput=function(){return""},e.prototype.getInputEl=function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new Hl({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}(Tl);var Ul=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bl=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return(0,J.bindAll)(n,"moveIncrement","upIncrement"),n.doc=document,n.listenTo(n.model,"change:unit",n.handleModelChange),n}return Ul(e,t),e.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 ')},e.prototype.inputClass=function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")},e.prototype.setValue=function(t,e){var n=e||{},r=this.validateInputValue(t,{deepCheck:1}),o={value:r.value,unit:""};(r.unit||r.force)&&(o.unit=r.unit),this.model.set(o,n),n.silent&&this.handleModelChange()},e.prototype.handleChange=function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},e.prototype.handleUnitChange=function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set("unit",e),this.elementUpdated()},e.prototype.handleKeyDown=function(t){"ArrowUp"===t.key&&(t.preventDefault(),this.upArrowClick()),"ArrowDown"===t.key&&(t.preventDefault(),this.downArrowClick())},e.prototype.elementUpdated=function(){this.model.trigger("el:change")},e.prototype.handleModelChange=function(){var t=this.model;this.getInputEl().value=t.get("value");var e=this.getUnitEl();e&&(e.value=t.get("unit")||"")},e.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 r=e==t.get("unit")?"selected":"";n.push("<option ".concat(r,">").concat(e,"</option>"))}));var r=document.createElement("div");r.innerHTML='<select class="'.concat(this.ppfx,'input-unit">').concat(n.join(""),"</select>"),this.unitEl=r.firstChild}}return this.unitEl},e.prototype.upArrowClick=function(){var t=this.model.get("step"),e=parseFloat(this.getInputEl().value);this.setValue(this.normalizeValue(e+t)),this.elementUpdated()},e.prototype.downArrowClick=function(){var t=this.model.get("step"),e=parseFloat(this.getInputEl().value);this.setValue(this.normalizeValue(e-t)),this.elementUpdated()},e.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,fe.on)(this.doc,"mousemove",this.moveIncrement),(0,fe.on)(this.doc,"mouseup",this.upIncrement)},e.prototype.moveIncrement=function(t){this.moved=!0;var e=this.model,n=e.get("step"),r=this.current,o=this.normalizeValue(r.val+(r.y-t.pageY)*n),i=this.validateInputValue(o),s=i.value,a=i.unit;return this.prValue=s,e.set({value:s,unit:a},{avoidStore:1}),!1},e.prototype.upIncrement=function(){var t=this.model,e=t.get("step");if((0,fe.AU)(this.doc,"mouseup",this.upIncrement),(0,fe.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()}},e.prototype.normalizeValue=function(t,e){void 0===e&&(e=0);var n=this.model.get("step"),r=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var o=n.toString().split(".")[1];r=o?o.length:0}return r?parseFloat(t.toFixed(r)):t},e.prototype.validateInputValue=function(t,e){void 0===e&&(e={});var n=0,r=e||{},o=this.model,i=(0,J.isUndefined)(t)?"":t,s=e.units||o.get("units")||[],a=o.get("unit")||s.length&&s[0]||"",l=(0,J.isUndefined)(e.max)?o.get("max"):e.max,c=(0,J.isUndefined)(e.min)?o.get("min"):e.min,u=!!o.get("limitlessMax"),p=!!o.get("limitlessMin");if(r.deepCheck){var d=o.get("fixedValues")||[];if(""===i&&(a=""),i){var f=new RegExp("^"+d.join("|"),"g");if(d.length&&f.test(i))i=i.match(f)[0],a="",n=1;else{var h=i+"";i+="",i=parseFloat(i.replace(",",".")),i=isNaN(i)?"":i;var g=h.replace(i,"");(0,J.indexOf)(s,g)>=0&&(a=g)}}}return u||(0,J.isUndefined)(l)||""===l||(i=i>l?l:i),p||(0,J.isUndefined)(c)||""===c||(i=i<c?c:i),{force:n,value:i,unit:a}},e.prototype.render=function(){Ll.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},e}(Ll);const zl=Bl;Bl.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 Wl=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ql=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Wl(e,t),e.prototype.getValueForTarget=function(){var t=this.model,e=t.attributes,n=e.value,r=e.unit;return(0,J.isUndefined)(n)||""===n?t.get("default"):n+r},e.prototype.getInputEl=function(){if(!this.input){var t=this.ppfx,e=this.model,n=this.getModelValue(),r=new zl({contClass:"".concat(t,"field-int"),type:"number",model:e,ppfx:t});r.render(),this.$input=r.inputEl,this.$unit=r.unitEl,e.set("value",n,{fromTarget:!0}),this.$input.val(n),this.input=r.el}return this.input},e}(Tl);const Gl=ql;var Kl=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yl=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.listenTo(n.model,"change:options",n.rerender),n}return Kl(e,t),e.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>')},e.prototype.getInputEl=function(){if(!this.$input){var t=this.model,e=this.em,n=t.get("name"),r=t.get("options")||[],o=[],i="<select>";r.forEach((function(t){var r,s,a,l="";(0,J.isString)(t)?(r=t,s=t):(r=t.name||t.label||t.value,s="".concat((0,J.isUndefined)(t.value)?t.id:t.value).replace(/"/g,"""),l+=(a=t.style?t.style.replace(/"/g,"""):"")?' style="'.concat(a,'"'):"");var c=e.t("traitManager.traits.options.".concat(n,".").concat(s))||r;i+='<option value="'.concat(s,'"').concat(l,">").concat(c,"</option>"),o.push(s)})),i+="</select>",this.$input=(0,rt.default)(i);var s=t.getTargetValue(),a=o.indexOf(s)>=0?s:t.get("default");!(0,J.isUndefined)(a)&&this.$input.val(a)}return this.$input.get(0)},e}(Tl);const Xl=Yl;var Jl=Y(754),Zl=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ql="data-categories",tc="data-no-categories",ec=function(t){function e(e,n){var r=t.call(this,e)||this;r.reuseView=!0,r.renderedCategories=new Map,r.itemsView=n;var o=e.config||{};r.config=o;var i=e.editor;r.em=i;var s=o.pStylePrefix||"";return r.ppfx=s,r.pfx=s+o.stylePrefix||"",r.className="".concat(r.pfx,"traits"),r.traitContClass="".concat(s,"traits-c"),r.classNoCat="".concat(s,"traits-empty-c"),r.catsClass="".concat(s,"trait-categories"),r.collection=new Mn([],{em:i}),r.listenTo(i,"component:toggled",r.updatedCollection),r.updatedCollection(),r}return Zl(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 Mn([],{em:e}),this.render()},e.prototype.add=function(t,e){var n=this.config,r=this.renderedCategories,o=this.itemView,i=t.get(this.itemType);this.itemsView&&this.itemsView[i]&&(o=this.itemsView[i]);var s=new o({config:n,model:t,attributes:t.get("attributes")}).render().el,a=t.parent.initCategory(t);if(a){var l=a.getId(),c=this.getCategoriesEl(),u=r.get(l);return!u&&c&&(u=new Ds({model:a},n,"trait").render(),r.set(l,u),c.appendChild(u.el)),void(null==u||u.append(s))}e?e.appendChild(s):this.append(s)},e.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector("[".concat(Ql,"]"))),this.catsEl},e.prototype.getTraitsEl=function(){return this.traitsEl||(this.traitsEl=this.el.querySelector("[".concat(tc,"]"))),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,r=e.ppfx,o=e.catsClass,i=e.traitContClass,s=e.classNoCat,a=document.createDocumentFragment();delete this.catsEl,delete this.traitsEl,this.renderedCategories=new Map,n.innerHTML='\n <div class="'.concat(o,'" ').concat(Ql,'></div>\n <div class="').concat(s," ").concat(i,'" ').concat(tc,"></div>\n "),this.collection.forEach((function(e){return t.add(e,a)})),this.append(a);var l="".concat(i,"s ").concat(r,"one-bg ").concat(r,"two-color");return this.$el.addClass(l),this.rendered=!0,this},e}(Jl.A);const nc=ec;ec.prototype.itemView=Tl;var rc=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),oc=function(t){function e(e){var n=t.call(this,e,"TraitManager",_l)||this;n.TraitsView=nc,n.events=Cn,n.state=new ot.Kx({traits:[]}),n.types={text:Tl,number:Gl,select:Xl,checkbox:jl,color:Vl,button:El};var r=n,o=r.state,i=r.config,s=r.events,a=i.pStylePrefix;a&&(i.stylePrefix="".concat(a).concat(i.stylePrefix)),(0,J.bindAll)(n,"__onSelect");var l=(0,J.debounce)((function(){return n.__upSel()}),0),c=(0,J.debounce)((function(){return n.__onUp()}),0);return o.listenTo(e,"component:toggled",l),o.listenTo(e,s.value,c),o.on("change:traits",n.__onSelect),n.debounced=[l,c],n}return rc(e,t),e.prototype.select=function(t){var e=(null==t?void 0:t.getTraits())||[];this.state.set({component:t,traits:e}),this.__trgCustom()},e.prototype.getCategories=function(){var t,e=this.getComponent();return function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],(null===(t=null==e?void 0:e.traits.categories)||void 0===t?void 0:t.models)||[],!0)},e.prototype.getTraits=function(){return this.getCurrent()},e.prototype.getTraitsByCategory=function(t){return vn(t||this.getTraits())},e.prototype.getComponent=function(){return this.state.attributes.component},e.prototype.addType=function(t,e){var n=this.getType("text");this.types[t]=n.extend(e)},e.prototype.getType=function(t){return this.getTypes()[t]},e.prototype.getTypes=function(){return this.types},e.prototype.getTraitsViewer=function(){return this.view},e.prototype.getCurrent=function(){return this.state.get("traits")||[]},e.prototype.render=function(){var t=this.view,e=this.em;return t=new nc({el:null==t?void 0:t.el,collection:[],editor:e,config:this.getConfig()},this.getTypes()),this.view=t,t.el},e.prototype.postRender=function(){this.__appendTo()},e.prototype.__onSelect=function(){var t=this,e=t.em,n=t.events,r=t.state.attributes,o=r.component,i=r.traits;e.trigger(n.select,{component:o,traits:i})},e.prototype.__trgCustom=function(t){void 0===t&&(t={});var e=this,n=e.em,r=e.events,o=e.__ctn;this.__ctn=o||t.container,n.trigger(r.custom,this.__customData())},e.prototype.__customData=function(){return{container:this.__ctn}},e.prototype.__upSel=function(){this.select(this.em.getSelected())},e.prototype.__onUp=function(){this.select(this.getComponent())},e}(dt);const ic=oc,sc={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 ac=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lc=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.items=[],n.opt=e;var r=e.config||{};n.config=r,n.module=e.module,n.parentView=e.parentView;var o=r.stylePrefix||"",i=r.pStylePrefix||"",s=n.collection;n.listenTo(s,"add",n.addTo),n.listenTo(s,"reset resetNavigator",n.render),n.listenTo(s,"remove",n.removeChildren),n.className="".concat(o,"layers");var a=r.em;if(r.sortable&&!n.opt.sorter){var l=a.Utils;n.opt.sorter=new l.Sorter({container:r.sortContainer||n.el,containerSel:".".concat(n.className),itemSel:".".concat(o,"layer"),ignoreViewChildren:1,avoidSelectOnEnd:1,nested:1,ppfx:i,pfx:o,em:a})}return n.$el.data("collection",s),e.parent&&n.$el.data("model",e.parent),n}return ac(e,t),e.prototype.removeChildren=function(t){var e=t.viewLayer;e&&(e.remove(),delete t.viewLayer)},e.prototype.addTo=function(t){this.addToCollection(t,null,this.collection.indexOf(t))},e.prototype.addToCollection=function(t,e,n){var r=this,o=r.parentView,i=r.opt,s=r.config,a=r.el,l=i.ItemView,c=i.opened,u=i.module,p=i.level,d=i.sorter,f=t.viewLayer||new l({ItemView:l,level:p,model:t,parentView:o,config:s,sorter:d,opened:c,module:u}),h=f.render().el;if(e)e.appendChild(h);else{var g=a,v=g.childNodes;if((0,J.isUndefined)(n))g.appendChild(h);else{var m=v.length==n;m&&n--,m||!v.length?g.appendChild(h):g.insertBefore(h,v[n])}}return this.items.push(f),h},e.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ot.Ss.prototype.remove.apply(this,t),this.items.map((function(t){return t.remove()})),this},e.prototype.render=function(){var t=this,e=this.el,n=this.module,r=document.createDocumentFragment();return e.innerHTML="",this.collection.map((function(t){return n.__getLayerFromComponent(t)})).forEach((function(e){return t.addToCollection(e,r)})),e.appendChild(r),e.className=this.className,this},e}(ot.Ss);const cc=lc;var uc=Y(570);const pc={stylePrefix:"com-",defaults:{},strict:!0};var dc=Y(242),fc=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hc=function(){return hc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},hc.apply(this,arguments)},gc=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},vc=[["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"]],mc={preserveSelected:1},yc=function(t){return function(e){return t.trigger("".concat(Rn,":start"),e)}},bc=function(t){return function(e){return t.trigger(Rn,e)}},wc=function(t,e,n){return void 0===n&&(n={}),function(r,o,i){e.forEach((function(t){return t.set("status",t.get("selectable")?"selected":"")})),t.setSelected(e),e[0].emitUpdate(),t.trigger("".concat(Rn,":end"),i),setTimeout((function(){return t.runDefault(mc)})),(n.altMode||i.cancelled)&&t.set("_cmpDrag",1)}},_c=function(t){function e(e){var n=t.call(this,e,"Commands",pc)||this;n.CommandAbstract=uc.default,n.defaultCommands={},n.commands={},n.active={},n.events=dc.A;var r=n.config,o=r.pStylePrefix,i=n.defaultCommands;for(var s in o&&(r.stylePrefix=o+r.stylePrefix),Object.keys(r.defaults).forEach((function(t){var e=r.defaults[t];e.id&&n.add(e.id,e)})),i["tlb-delete"]={run:function(t){return t.runCommand("core:component-delete")}},i["tlb-clone"]={run:function(t){t.runCommand("core:copy"),t.runCommand("core:paste",{action:"clone-component"})}},i["tlb-move"]={run:function(t,e,n){var r;void 0===n&&(n={});var o=t.getModel(),i=n.event,s=n.target,a=(s?[s]:gc([],t.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),l=a[a.length-1],c="dragstart"===(null==i?void 0:i.type);if(!(null==l?void 0:l.get("draggable")))return o.logWarning("The element is not draggable");var u=l.get("dmode")||o.get("dmode"),p=function(){return o.stopDefault(mc)},d=(0,J.includes)(["absolute","translate"],u);a.forEach((function(t){return t.trigger("disable",{fromMove:!0})})),c?setTimeout(p,0):p();var f=yc(o),h=bc(o),g=wc(o,a,{altMode:d});if(d)t.runCommand("core:component-drag",{guidesInfo:1,mode:u,target:l,onStart:f,onDrag:h,onEnd:g,event:i});else{c&&i.dataTransfer.setDragImage(null===(r=l.view)||void 0===r?void 0:r.el,0,0);var v=t.Commands.get("move-comp");v.onStart=f,v.onDrag=h,v.onEndMoveFromModel=g,v.initSorterFromModels(a)}a.filter((function(t){return t.get("selectable")})).forEach((function(t){return t.set("status","freezed-selected")}))}},i["core:undo"]=function(t){return t.UndoManager.undo()},i["core:redo"]=function(t){return t.UndoManager.redo()},vc.forEach((function(t){var n=t[2],r=Y(585)("./".concat(t[1])).default,o="core:".concat(t[0]);i[o]=r,n&&(i[n]=r,["run","stop"].forEach((function(t){e.on("".concat(t,":").concat(n),(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.trigger.apply(e,gc(["".concat(t,":").concat(o)],n,!1))}))})))})),r.model=e.Canvas,i)n.add(s,i[s]);return n}return fc(e,t),e.prototype.add=function(t,e){var n=(0,J.isFunction)(e)?{run:e}:e;return n.stop||(n.noStop=!0),delete n.initialize,n.id=t,this.commands[t]=uc.default.extend(n),this},e.prototype.get=function(t){var e=this.commands[t];return(0,J.isFunction)(e)?(e=new e(this.config),this.commands[t]=e):e||this.em.logWarning("'".concat(t,"' command not found")),e},e.prototype.extend=function(t,e){void 0===e&&(e={});var n=this.get(t);if(n){var r=hc(hc({},n.constructor.prototype),e);this.add(t,r);var o=vc.filter((function(e){return"core:".concat(e[0])===t&&e[2]}))[0];o&&this.add(o[2],r)}return this},e.prototype.has=function(t){return!!this.commands[t]},e.prototype.getAll=function(){return this.commands},e.prototype.run=function(t,e){return void 0===e&&(e={}),this.runCommand(this.get(t),e)},e.prototype.stop=function(t,e){return void 0===e&&(e={}),this.stopCommand(this.get(t),e)},e.prototype.isActive=function(t){return this.getActive().hasOwnProperty(t)},e.prototype.getActive=function(){return this.active},e.prototype.runCommand=function(t,e){var n;if(void 0===e&&(e={}),t&&t.run){var r=this.em,o=this.config,i=t.id,s=r.Editor;this.isActive(i)&&!e.force&&o.strict||(n=s&&t.callRun(s,e),i&&t.stop&&!t.noStop&&!e.abort&&(this.active[i]=n))}return n},e.prototype.stopCommand=function(t,e){var n;if(void 0===e&&(e={}),t&&t.run){var r=this.em,o=this.config,i=t.id,s=r.Editor;(this.isActive(i)||e.force||!o.strict)&&(i&&delete this.active[i],n=t.callStop(s,e))}return n},e.prototype.create=function(t){return t.stop||(t.noStop=!0),new(uc.default.extend(t))(this.config)},e.prototype.__onRun=function(t,e){var n=this.em,r=this.events;n.on("".concat(r.runCommand).concat(t),e)},e.prototype.__onStop=function(t,e){var n=this.em,r=this.events;n.on("".concat(r.stopCommand).concat(t),e)},e.prototype.destroy=function(){this.defaultCommands={},this.commands={},this.active={}},e}(dt);const xc=_c;var Cc=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sc="contentEditable",Tc="data-toggle-move",Oc=function(t){function e(e){var n=t.call(this,e)||this;(0,J.bindAll)(n,"__render"),n.opt=e,n.module=e.module,n.config=e.config||{},n.sorter=e.sorter||"",n.parentView=e.parentView;var r=n,o=r.model,i=r.pfx,s=r.ppfx,a=o.get("type")||"default";return n.className="".concat(i,"layer ").concat(i,"layer__t-").concat(a," no-select ").concat(s,"two-color"),n.inputNameCls="".concat(s,"layer-name"),n.clsTitleC="".concat(i,"layer-title-c"),n.clsTitle="".concat(i,"layer-title"),n.clsCaret="".concat(i,"layer-caret"),n.clsCount="".concat(i,"layer-count"),n.clsMove="".concat(i,"layer-move"),n.clsChildren="".concat(i,"layer-children"),n.clsNoChild="".concat(i,"layer-no-chld"),n.clsEdit="".concat(n.inputNameCls,"--edit"),n.clsNoEdit="".concat(n.inputNameCls,"--no-edit"),n.initComponent(),n}return Cc(e,t),e.prototype.events=function(){var t;return(t={})["mousedown [".concat(Tc,"]")]="startSort",t["touchstart [".concat(Tc,"]")]="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},e.prototype.template=function(t){var e=this,n=e.pfx,r=e.ppfx,o=e.config,i=e.clsNoEdit,s=e.module,a=e.opt,l=e.em,c=o.hidable,u=s.getComponents(t).length,p=u?"":this.clsNoChild,d="".concat(this.clsTitle," ").concat(p),f="".concat(this.clsTitleC),h="".concat(this.inputNameCls," ").concat(i," ").concat(r,"no-app"),g=a.level||0,v="".concat(10*g,"px"),m=t.getName(),y=t.getIcon(),b="".concat(n,"layer"),w=(null==l?void 0:l.getConfig()).icons,_=w.move,x=w.eye,C=w.eyeOff,S=w.chevron;return'\n <div class="'.concat(n,"layer-item ").concat(r,'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(v,'">\n <div class="').concat(n,'layer-title-inn" title="').concat(m,'">\n <i class="').concat(this.clsCaret,'" data-toggle-open>').concat(S,"</i>\n ").concat(y?'<span class="'.concat(b,'__icon">').concat(y,"</span>"):"",'\n <span class="').concat(h,'" data-name>').concat(m,'</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(Tc,">").concat(_||"",'</div>\n </div>\n </div>\n <div class="').concat(this.clsChildren,'"></div>\n ')},Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),e.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,r=e.components();this.listenTo(r,"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",r),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},e.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},e.prototype.getVisibilityEl=function(){return this.getItemContainer().find("[data-toggle-visible]")},e.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,r=t.module,o="".concat(e,"layer-hidden"),i=r.isVisible(n)?"removeClass":"addClass";this.$el[i](o),this.getVisibilityEl()[i]("".concat(e,"layer-off"))},e.prototype.updateMove=function(){var t=this.model,e=this.config,n=this.getItemContainer().find("[".concat(Tc,"]"))[0];if(n){var r=t.get("draggable")&&e.sortable;n.style.display=r?"":"none"}},e.prototype.toggleVisibility=function(t){null==t||t.stopImmediatePropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},e.prototype.handleEdit=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,o=e.clsNoEdit,i=e.clsEdit,s=this.getInputName();s[Sc]="true",s.focus(),document.execCommand("selectAll",!1),n.setEditing(!0),r.find(".".concat(this.inputNameCls)).removeClass(o).addClass(i)},e.prototype.handleEditKey=function(t){t.stopPropagation(),((0,fe.v$)(t)||(0,fe.Ci)(t))&&this.handleEditEnd(t)},e.prototype.handleEditEnd=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,o=e.clsNoEdit,i=e.clsEdit,s=e.model,a=this.getInputName(),l=a.textContent;a.scrollLeft=0,a[Sc]="false",s.setName(l),n.setEditing(!1),r.find(".".concat(this.inputNameCls)).addClass(o).removeClass(i),this.updateName()},e.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},e.prototype.updateOpening=function(){var t=this,e=t.$el,n=t.model,r=t.pfx,o="open",i="".concat(r,"layer-open"),s=this.getCaret();this.module.isOpen(n)?(e.addClass(o),s.addClass(i)):(e.removeClass(o),s.removeClass(i))},e.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))},e.prototype.handleSelect=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},e.prototype.handleHover=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},e.prototype.handleHoverOut=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},e.prototype.startSort=function(t){var e,n,r;t.stopPropagation();var o=this,i=o.em,s=o.sorter,a=o.model;if((!t.button||0===t.button)&&s){var l=(null===(n=null===(e=a.delegate)||void 0===e?void 0:e.move)||void 0===n?void 0:n.call(e,a))||a;s.onStart=yc(i),s.onMoveClb=bc(i),s.onEndMove=wc(i,[l]);var c=(null===(r=l.viewLayer)||void 0===r?void 0:r.el)||t.target;s.startSort(c)}},e.prototype.updateStatus=function(){ci.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:!0}])},e.prototype.getItemContainer=function(){return this.$el.children("[data-toggle-select]")},e.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,r=t.module,o=r.getComponents(e).length,i=this.getItemContainer(),s=i.find(".".concat(this.clsTitle)),a=i.find("[data-count]");s[o?"removeClass":"addClass"](n),a.html("".concat(o||"")),!o&&r.setOpen(e,!1)},e.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.getItemContainer().find(".".concat(this.clsCaret))),this.caret},e.prototype.setRoot=function(t){var e,n=(0,J.isString)(t)?null===(e=this.em.getWrapper())||void 0===e?void 0:e.find(t)[0]:t;n&&(this.stopListening(),this.model=n,this.initComponent(),this._rendered&&this.render())},e.prototype.updateLayerable=function(){(this.parentView||this).render()},e.prototype.__clearItems=function(){var t;null===(t=this.items)||void 0===t||t.remove()},e.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ot.Ss.prototype.remove.apply(this,t),delete this.model.viewLayer,this.__clearItems(),this},e.prototype.render=function(){var t=this,e=t.model,n=t.config,r=t.pfx,o=t.ppfx,i=t.opt,s=t.sorter;this.__clearItems();var a=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 cc({ItemView:c,collection:e.get("components"),config:n,sorter:s,opened:a,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(r,"hide")),u&&(this.className+=" ".concat(o,"hidden")),p.attr("class",this.className),this.updateStatus(),this.updateOpening(),this.updateVisibility(),this.updateMove(),this.__render(),this._rendered=!0,this},e.prototype.__render=function(){var t=this,e=t.model,n=t.config,r={component:e,el:t.el};n.onRender.bind(this)(r),this.em.trigger("layer:render",r)},e}(ot.Ss);const Ac=Oc;var Ec=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kc=function(){return kc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},kc.apply(this,arguments)},Pc="layer",jc="".concat(Pc,":"),Mc="".concat(jc,"root"),Nc="".concat(jc,"component"),Lc="".concat(jc,"custom"),Ic={all:Pc,root:Mc,component:Nc,custom:Lc},$c={mediaText:""},Dc=["open","status","locked","custom-name","components","classes"].map((function(t){return"".concat(oe.I.update,":").concat(t)})).join(" "),Rc=function(t){function e(e){var n=t.call(this,e,"LayerManager",sc)||this;return n.events=Ic,(0,J.bindAll)(n,"componentChanged","__onRootChange","__onComponent"),n.model=new gt.A(n,{opened:{}}),n.config.stylePrefix=n.config.pStylePrefix,n}return Ec(e,t),e.prototype.onLoad=function(){var t=this,e=this,n=e.em,r=e.config,o=e.model;o.listenTo(n,"component:selected",this.componentChanged),o.on("change:root",this.__onRootChange),o.listenTo(n,Dc,this.__onComponent),this.componentChanged(),o.listenToOnce(n,"load",(function(){t.setRoot(r.root),t.__appendTo()}))},e.prototype.setRoot=function(t){var e=this.em.getWrapper(),n=(0,Z.isComponent)(t)?t:e;t&&(0,J.isString)(t)&&(0,Z.hasWin)()&&(n=e.find(t)[0]||e);var r=this.__getLayerFromComponent(n);return this.model.set("root",r),r},e.prototype.getRoot=function(){return this.model.get("root")},e.prototype.getComponents=function(t){var e=this;return t.components().map((function(t){return e.__getLayerFromComponent(t)})).filter((function(t){return e.__isLayerable(t)}))},e.prototype.setOpen=function(t,e){t.set("open",e)},e.prototype.isOpen=function(t){return!!t.get("open")},e.prototype.setVisible=function(t,e){var n="__prev-display",r=t.getStyle($c),o=r.display;if(e){var i=t.get(n);delete r.display,i&&(r.display=i,t.unset(n))}else o&&t.set(n,o),r.display="none";t.setStyle(r,$c),this.updateLayer(t),this.em.trigger("component:toggled")},e.prototype.isVisible=function(t){return void 0===(e=t.getStyle($c))&&(e={}),!(0===(e.display||"").trim().indexOf("none"));var e},e.prototype.setLocked=function(t,e){t.set("locked",e)},e.prototype.isLocked=function(t){return!!t.get("locked")},e.prototype.setName=function(t,e){t.set("custom-name",e)},e.prototype.getName=function(t){return t.getName()},e.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)}},e.prototype.setLayerData=function(t,e,n){var r;void 0===n&&(n={});var o=this.em,i=this.config,s=e.open,a=e.selected,l=e.hovered,c=e.visible,u=e.locked,p=e.name,d=kc({fromLayers:!0},n);if((0,Z.isDef)(s)&&this.setOpen(t,s),(0,Z.isDef)(a))if(a){o.setSelected(t,d);var f=i.scrollCanvas;f&&(null===(r=t.views)||void 0===r||r.forEach((function(t){return t.scrollIntoView(f)})))}else o.removeSelected(t,d);(0,Z.isDef)(l)&&i.showHover&&(l?o.setHovered(t,d):o.setHovered(null,d)),(0,Z.isDef)(c)&&c!==this.isVisible(t)&&this.setVisible(t,c),(0,Z.isDef)(u)&&this.setLocked(t,u),(0,Z.isDef)(p)&&this.setName(t,p)},e.prototype.componentChanged=function(t,e){var n;if(void 0===e&&(e={}),!e.fromLayers){var r=this.em,o=this.config.scrollLayers,i=this.model.get("opened"),s=r.getSelected(),a=null==s?void 0:s.parent();for(var l in i)i[l].set("open",!1),delete i[l];for(;a;)a.set("open",!0),i[a.cid]=a,a=a.parent();if(s&&o){var c=null===(n=s.viewLayer)||void 0===n?void 0:n.el;null==c||c.scrollIntoView(o)}}},e.prototype.getAll=function(){return this.view},e.prototype.render=function(){var t,e,n=this.config,r=this.model,o=Ac.extend(n.extend);return this.view=new o({el:null===(t=this.view)||void 0===t?void 0:t.el,ItemView:o,level:0,config:n,opened:r.get("opened"),model:this.getRoot(),module:this}),null===(e=this.view)||void 0===e?void 0:e.render().el},e.prototype.destroy=function(){var t;null===(t=this.view)||void 0===t||t.remove()},e.prototype.__onRootChange=function(){var t,e=this.getRoot();null===(t=this.view)||void 0===t||t.setRoot(e),this.em.trigger(Mc,e),this.__trgCustom()},e.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},e.prototype.__onComponent=function(t){this.updateLayer(t)},e.prototype.__isLayerable=function(t){var e=t.tagName;return(!this.config.hideTextnode||!t.isInstanceOf("textnode")&&"br"!==e)&&t.get("layerable")},e.prototype.__trgCustom=function(t){var e=this,n=e.__ctn,r=e.em,o=e.events;this.__ctn=n||(null==t?void 0:t.container),r.trigger(o.custom,{container:this.__ctn,root:this.getRoot()})},e.prototype.updateLayer=function(t,e){this.em.trigger(Nc,t,e)},e}(dt);const Hc=Rc,Fc={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 Vc=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Vc(e,t),e.getDefaults=function(){return(0,J.result)(this.prototype,"defaults")},e.prototype.defaults=function(){return{type:"",src:""}},e.prototype.getType=function(){return this.get("type")},e.prototype.getSrc=function(){return this.get("src")},e.prototype.getFilename=function(){return this.get("src").split("/").pop().split("?").shift()},e.prototype.getExtension=function(){return this.getFilename().split(".").pop()},e}(ot.Kx);const Bc=Uc;Uc.prototype.idAttribute="src";var zc=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wc=function(){return Wc=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Wc.apply(this,arguments)};const qc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zc(e,t),e.prototype.defaults=function(){return Wc(Wc({},Bc.getDefaults()),{type:"image",unitDim:"px",height:0,width:0})},e}(Bc);var Gc=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kc=function(t){function e(e){var n=t.call(this,e)||this;n.options=e,n.collection=e.collection;var r=e.config||{};n.config=r,n.pfx=r.stylePrefix||"",n.ppfx=r.pStylePrefix||"",n.em=r.em,n.className=n.pfx+"asset",n.listenTo(n.model,"destroy remove",n.remove),n.model.view=n;var o=n.init&&n.init.bind(n);return o&&o(e),n}return Gc(e,t),e.prototype.__getBhv=function(){var t=this.em,e=null==t?void 0:t.Assets;return(null==e?void 0:e.__getBehaviour())||{}},e.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 ⨯\n </div>\n ')},e.prototype.updateTarget=function(t){t&&t.set&&(t.set("attributes",(0,J.clone)(t.get("attributes"))),t.set("src",this.model.get("src")))},e.prototype.getPreview=function(){return""},e.prototype.getInfo=function(){return""},e.prototype.render=function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this},e}(ot.Ss);const Yc=Kc;var Xc=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jc=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Zc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Xc(e,t),e.prototype.getPreview=function(){var t=this,e=t.pfx,n=t.ppfx,r=t.model.get("src");return Q(tu||(tu=Jc(['\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,r,e,n)},e.prototype.getInfo=function(){var t=this.pfx,e=this.model,n=e.get("name"),r=e.get("width"),o=e.get("height"),i=e.get("unitDim"),s=r&&o?"".concat(r,"x").concat(o).concat(i):"";return n=n||e.getFilename(),Q(eu||(eu=Jc(['\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)},e.prototype.init=function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},e.prototype.onClick=function(){var t=this.model,e=this.pfx,n=this.__getBhv().select,r=this.config.onClick,o=this.collection;o.trigger("deselectAll"),this.$el.addClass(e+"highlight"),(0,J.isFunction)(n)?n(t,!1):(0,J.isFunction)(r)?r(t):this.updateTarget(o.target)},e.prototype.onDblClick=function(){var t=this.em,e=this.model,n=this.__getBhv().select,r=this.config.onDblClick,o=this.collection,i=o.target,s=o.onSelect;(0,J.isFunction)(n)?n(e,!0):(0,J.isFunction)(r)?r(e):(this.updateTarget(i),null==t||t.Modal.close()),(0,J.isFunction)(s)&&s(e)},e.prototype.onRemove=function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)},e}(Yc);const Qc=Zc;var tu,eu;Zc.prototype.events={"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"};var nu=function(){return nu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},nu.apply(this,arguments)},ru={types:[],initialize:function(t,e){var n=this;void 0===e&&(e={});var r=e.em;this.em=r,this.opts=e,this.model=function(t,e){var o,i,s;if(void 0===t&&(t={}),void 0===e&&(e={}),t&&t.type){var a=n.getBaseType();o=(s=n.getType(t.type))?s.model:a.model,i=s?s.view:a.view}else{var l=n.recognizeType(t);o=(s=l.type).model,i=s.view,t=l.attributes}var c=new o(t,nu(nu({},e),{em:r}));return c.typeView=i,n.model.prototype=o.prototype,c};var o=this.init&&this.init.bind(this);o&&o()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var r=e[n],o=r.isType(t);if(o="boolean"==typeof o&&o?{type:r.id}:o)return{type:r,attributes:o}}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 r=e[n];if(r.id===t)return r}},addType:function(t,e){var n=this.getType(t),r=this.getBaseType(),o=n?n.model:r.model,i=n?n.view:r.view,s=e.model,a=e.view,l=e.isType;s=s instanceof ot.Kx||(0,J.isFunction)(s)?s:o.extend(s||{}),a=a instanceof ot.Ss||(0,J.isFunction)(a)?a:i.extend(a||{}),!this.extendViewApi||e.model||e.view||(a=a.extend(e)),n?(n.model=s,n.view=a,n.isType=l||n.isType):(e.id=t,e.model=s,e.view=a,e.isType=l||function(e){if(e&&e.type==t)return!0},this.getTypes().unshift(e))}};const ou=ru;var iu=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),su=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iu(e,t),e}(ot.pM.extend(ou));const au=su;var lu;su.prototype.types=[{id:"image",model:qc,view:Qc,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"}(lu||(lu={}));const cu=lu;var uu=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pu=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 r=n.collection;return n.listenTo(r,"reset",n.renderAssets),n.listenTo(r,"add",n.addToAsset),n.listenTo(r,"remove",n.removedAsset),n.listenTo(r,"deselectAll",n.deselectAll),n}return uu(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.ppfx,r=t.em,o="";return this.config.showUrlInput&&(o='\n <form class="'.concat(e,'add-asset">\n <div class="').concat(n,"field ").concat(e,'add-field">\n <input placeholder="').concat(null==r?void 0:r.t("assetManager.inputPlh"),'"/>\n </div>\n <button class="').concat(n,'btn-prim">').concat(null==r?void 0:r.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(o,'\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(),r=this.config.handleAdd;if(n){e.value="";var o=this.getAssetsEl();o&&(o.scrollTop=0),r?r.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,r=this.collection,o=this.config,i=new t.typeView({model:t,collection:r,config:o}).render().el;if(n)n.appendChild(i);else{var s=this.getAssetsEl();s&&s.insertBefore(i,s.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}(ot.Ss);const du=pu;pu.prototype.events={submit:"handleSubmit"};var fu=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hu=function(t){function e(n){void 0===n&&(n={});var r=t.call(this,n)||this;r.options=n;var o=n.config||{};r.module=n.module,r.config=o,r.em=r.config.em,r.pfx=o.stylePrefix||"",r.ppfx=o.pStylePrefix||"",r.target=r.options.globalCollection||{},r.uploadId=r.pfx+"uploadFile",r.disabled=void 0!==o.disableUpload?o.disableUpload:!o.upload&&!o.embedAsBase64,r.multiUpload=void 0===o.multiUpload||o.multiUpload;var i=o.uploadFile;return i?r.uploadFile=i.bind(r):!o.upload&&o.embedAsBase64&&(r.uploadFile=e.embedAsBase64),r.delegateEvents(),r}return fu(e,t),e.prototype.template=function(t){var e,n,r=t.pfx,o=t.title,i=t.uploadId,s=t.disabled,a=t.multiUpload;return Q(vu||(e=['\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=['\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 '],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,vu=e),r,o,i,s?"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 r=e.find("input");r&&r.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,r=this,o=r.module,i=r.config,s=r.target;try{n="string"==typeof t?JSON.parse(t):t}catch(e){n=t}null==o||o.__propEv(o.events.uploadResponse,n),i.autoAdd&&s&&s.add(n.data,{at:0}),this.onUploadEnd(t),null==e||e(n)},e.prototype.uploadFile=function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,o=this.config,i=o.beforeUpload;if(!1!==(i&&i(r))){var s=new FormData,a=o.params,l=o.customFetch,c=o.fetchOptions;for(var u in a)s.append(u,a[u]);if(this.multiUpload)for(var p=0;p<r.length;p++)s.append("".concat(o.uploadName).concat(o.multiUploadSuffix),r[p]);else r.length&&s.append(o.uploadName,r[0]);var d=o.upload,f=o.headers,h="X-Requested-With";if(void 0===f[h]&&(f[h]="XMLHttpRequest"),d){this.onUploadStart();var g={method:"post",credentials:o.credentials||"include",headers:f,body:s},v=(null==c?void 0:c(g))||g;return(l?l(d,v):il(d,v).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,r=this.config,o=t.model,i=t.el,s=o.Editor,a=o.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),r.openAssetsOnDrop&&s){var n=s.getSelected();s.runCommand("open-assets",{target:n,onSelect:function(){s.Modal.close(),s.AssetManager.setTarget(null)}})}return!1};t.$el.append('<div class="'.concat(u,'">').concat(r.dropzoneContent,"</div>")),p(),"draggable"in i&&[i,a].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,r=t.em;return e.html(this.template({title:r&&r.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,r=t.dataTransfer?t.dataTransfer.files:t.target.files,o={data:[]};if(FileReader){for(var i=[],s=/^(.+)\/(.+)$/,a=function(t){var e=new Promise((function(e,n){var r=new FileReader;r.addEventListener("load",(function(o){var i,a=t.name,l=s.exec(t.type);if("image"===(i=l?l[1]:t.type)){var c={src:r.result,name:a,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:r.result,name:a,type:i}:r.result)})),r.addEventListener("error",(function(t){n(t)})),r.addEventListener("abort",(function(t){n("Aborted")})),r.readAsDataURL(t)}));i.push(e)},l=0,c=r;l<c.length;l++)a(c[l]);return Promise.all(i).then((function(t){o.data=t,n.onUploadResponse(o,e)}),(function(t){n.onUploadError(t)}))}this.onUploadError(new Error("Unsupported platform, FileReader is not defined"))},e}(ot.Ss);const gu=hu;var vu,mu=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yu=function(){return yu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},yu.apply(this,arguments)},bu=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},wu="open-assets",_u=function(t){function e(e){var n=t.call(this,e,"AssetManager",new au([],e),cu,Fc)||this;n.storageKey="assets",n.Asset=Bc,n.Assets=au,n.events=cu;var r=n,o=r.all,i=r.config;n.assetsVis=new au([]);var s=i.pStylePrefix;return s&&(i.stylePrefix="".concat(s).concat(i.stylePrefix)),o.on("add",(function(t){return n.getAllVisible().add(t)})),o.on("remove",(function(t){return n.getAllVisible().remove(t)})),n.__onAllEvent=(0,J.debounce)((function(){return n.__trgCustom()}),0),n}return mu(e,t),e.prototype.open=function(t){void 0===t&&(t={}),this.em.Commands.run(wu,yu({types:["image"],select:function(){}},t))},e.prototype.close=function(){this.em.Commands.stop(wu)},e.prototype.isOpen=function(){var t=this.em.Commands;return!!(null==t?void 0:t.isActive(wu))},e.prototype.add=function(t,e){return void 0===e&&(e={}),void 0===e.at&&(e.at=0),this.all.add(t,e)},e.prototype.get=function(t){return this.all.where({src:t})[0]||null},e.prototype.getAll=function(){return this.all},e.prototype.getAllVisible=function(){return this.assetsVis},e.prototype.remove=function(t,e){return this.__remove(t,e)},e.prototype.store=function(){return this.getProjectData()},e.prototype.load=function(t){return this.loadProjectData(t)},e.prototype.getContainer=function(){var t;return this.__getBehaviour().container||(null===(t=this.am)||void 0===t?void 0:t.el)},e.prototype.getAssetsEl=function(){var t;return null===(t=this.am)||void 0===t?void 0:t.el.querySelector("[data-el=assets]")},e.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 du(yu({},n)),this.am.render()}return this.assetsVis.reset(e),this.getContainer()}},e.prototype.__viewParams=function(){return{collection:this.assetsVis,globalCollection:this.all,config:this.config,module:this,fu:void 0}},e.prototype.addType=function(t,e){this.getAll().addType(t,e)},e.prototype.getType=function(t){return this.getAll().getType(t)},e.prototype.getTypes=function(){return this.getAll().getTypes()},e.prototype.AssetsView=function(){return this.am},e.prototype.FileUploader=function(){return this.fu||(this.fu=new gu(this.__viewParams())),this.fu},e.prototype.onLoad=function(){var t=this;this.getAll().reset(this.config.assets);var e=this.em,n=this.events;e.Commands.__onRun(wu,(function(){return t.__propEv(n.open)})),e.Commands.__onStop(wu,(function(){return t.__propEv(n.close)}))},e.prototype.postRender=function(t){var e;this.config.dropzone&&(null===(e=this.fu)||void 0===e||e.initDropzone(t))},e.prototype.setTarget=function(t){this.assetsVis.target=t},e.prototype.onSelect=function(t){this.assetsVis.onSelect=t},e.prototype.onClick=function(t){this.config.onClick=t},e.prototype.onDblClick=function(t){this.config.onDblClick=t},e.prototype.__propEv=function(t){for(var e,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];(e=this.em).trigger.apply(e,bu([t],r,!1)),(n=this.getAll()).trigger.apply(n,bu([t],r,!1))},e.prototype.__trgCustom=function(){var t=this.__getBehaviour(),e=this.getConfig().custom;(t.container||e.open)&&this.em.trigger(this.events.custom,this.__customData())},e.prototype.__customData=function(){var t=this,e=this.__getBehaviour();return{am:this,open:this.isOpen(),assets:this.getAll().models,types:e.types||[],container:e.container,close:function(){return t.close()},remove:function(e,n){return t.remove(e,n)},select:function(n,r){var o=t.add(n);(0,J.isFunction)(e.select)&&e.select(o,r)},options:e.options||{}}},e.prototype.__behaviour=function(t){return void 0===t&&(t={}),this._bhv=yu(yu({},this._bhv||{}),t)},e.prototype.__getBehaviour=function(t){return void 0===t&&(t={}),this._bhv||{}},e.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={}},e}(ft);const xu=_u;var Cu=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Su=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e,n)||this,o=n.em,i={};r.em=o,e.frames||(i.component=e.component,i.styles=e.styles,["component","styles"].map((function(t){return r.unset(t)})));var s=e.frames||[i],a=new Qt(o.Canvas,s);return a.page=r,r.set("frames",a),!r.getId()&&r.set("id",null==o?void 0:o.Pages._createId()),null==o||o.UndoManager.add(a),r}return Cu(e,t),e.prototype.defaults=function(){return{name:"",frames:[],_undo:!0}},e.prototype.onRemove=function(){this.getFrames().reset()},e.prototype.getFrames=function(){return this.get("frames")},e.prototype.getId=function(){return this.id},e.prototype.getName=function(){return this.get("name")},e.prototype.setName=function(t){return this.set({name:t})},e.prototype.getAllFrames=function(){return this.getFrames().models||[]},e.prototype.getMainFrame=function(){return this.getFrames().at(0)},e.prototype.getMainComponent=function(){var t=this.getMainFrame();return null==t?void 0:t.getComponent()},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=ot.Kx.prototype.toJSON.call(this,t),n=(0,J.result)(this,"defaults");return(0,J.forEach)(e,(function(t,n){0===n.indexOf("_")&&delete e[n]})),(0,J.forEach)(n,(function(t,n){e[n]===t&&delete e[n]})),e},e}(ot.Kx);const Tu=Su;var Ou=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Au=function(){return Au=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Au.apply(this,arguments)},Eu=function(t){function e(e,n){var r=t.call(this,e)||this;return r.on("reset",r.onReset),r.on("remove",r.onRemove),r.model=function(t,e){return void 0===e&&(e={}),new Tu(t,Au(Au({},e),{em:n}))},r}return Ou(e,t),e.prototype.onReset=function(t,e){var n,r=this;null===(n=null==e?void 0:e.previousModels)||void 0===n||n.map((function(t){return r.onRemove(t)}))},e.prototype.onRemove=function(t){null==t||t.onRemove()},e}(ot.pM);const ku=Eu;var Pu=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ju="change:selected",Mu="main",Nu=function(t){function e(e){var n=t.call(this,e,"PageManager",new ku([],e),Ht)||this;n.events=Ht,n.storageKey="pages",(0,J.bindAll)(n,"_onPageChange");var r=new gt.A({_undo:!0});return n.model=r,n.pages.on("reset",(function(t){return t.at(0)&&n.select(t.at(0))})),n.pages.on("all",n.__onChange,n),r.on(ju,n._onPageChange),n}return Pu(e,t),Object.defineProperty(e.prototype,"pages",{get:function(){return this.all},enumerable:!1,configurable:!0}),e.prototype.getAll=function(){return function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],this.all.models,!0)},e.prototype.__onChange=function(t,e,n,r){var o=this.em,i=this.events,s=r||n;o.trigger(i.all,{event:t,page:e,options:s})},e.prototype.onLoad=function(){var t,e=this,n=e.pages,r=e.config,o=e.em,i={silent:!0},s=(null===(t=r.pages)||void 0===t?void 0:t.map((function(t){return new Tu(t,{em:o,config:r})})))||[];n.add(s,i);var a=n.length?this._initPage():this.add({type:Mu},i);a&&this.select(a,i)},e.prototype._onPageChange=function(t,e,n){var r=this.em,o=this.events,i=r.Layers,s=e.getMainComponent();i&&s&&i.setRoot(s),r.trigger(o.select,e,t.previous("selected")),this.__onChange(ju,e,n)},e.prototype.postLoad=function(){var t=this,e=t.em,n=t.model,r=t.pages,o=e.UndoManager;o.add(n),o.add(r),r.on("add remove reset change",(function(t,n,r){return e.changesUp(r||n)}))},e.prototype.add=function(t,e){var n=this;void 0===e&&(e={});var r=this.em,o=this.events;t.id=t.id||this._createId();var i=function(){var r=n.pages.add(new Tu(t,{em:n.em,config:n.config}),e);return e.select&&n.select(r),r};return!e.silent&&r.trigger(o.addBefore,t,i,e),e.abort?void 0:i()},e.prototype.remove=function(t,e){var n=this;void 0===e&&(e={});var r=this.em,o=this.events,i=(0,J.isString)(t)?this.get(t):t,s=function(){return i&&n.pages.remove(i,e),i};return!e.silent&&r.trigger(o.removeBefore,i,s,e),!e.abort&&s()},e.prototype.get=function(t){return this.pages.filter((function(e){return e.get(e.idAttribute)===t}))[0]},e.prototype.getMain=function(){var t=this.pages;return t.filter((function(t){return t.get("type")===Mu}))[0]||t.at(0)},e.prototype.getAllWrappers=function(){var t=this.getAll();return(0,J.unique)((0,J.flatten)(t.map((function(t){return t.getAllFrames().map((function(t){return t.getComponent()}))}))))},e.prototype.select=function(t,e){void 0===e&&(e={});var n=this,r=n.em,o=n.model,i=n.events,s=(0,J.isString)(t)?this.get(t):t;return s&&(r.trigger(i.selectBefore,s,e),o.set("selected",s,e)),this},e.prototype.getSelected=function(){return this.model.get("selected")},e.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}))},e.prototype.store=function(){return this.getProjectData()},e.prototype.load=function(t){var e=this.loadProjectData(t,{all:this.pages,reset:!0});return this.pages.forEach((function(t){return t.getFrames().initRefs()})),e},e.prototype._initPage=function(){return this.get(this.config.selected)||this.getMain()},e.prototype._createId=function(){var t,e=this.getAll().length+16,n=this.getAllMap();do{t=(0,Z.createId)(e)}while(n[t]);return t},e}(ft);const Lu=Nu;var Iu={placeholder:"eg. Text here"};const $u={locale:"en",localeFallback:"en",detectLocale:!0,debug:!1,messages:{en:{assetManager:{addButton:"Add image",inputPlh:"http://path/to/the/image.jpg",modalTitle:"Select Image",uploadTitle:"Drop files here or click to upload"},blockManager:{labels:{},categories:{}},domComponents:{names:{"":"Box",wrapper:"Body",text:"Text",comment:"Comment",image:"Image",video:"Video",label:"Label",link:"Link",map:"Map",tfoot:"Table foot",tbody:"Table body",thead:"Table head",table:"Table",row:"Table row",cell:"Table cell"}},deviceManager:{device:"Device",devices:{desktop:"Desktop",tablet:"Tablet",mobileLandscape:"Mobile Landscape",mobilePortrait:"Mobile Portrait"}},panels:{buttons:{titles:{preview:"Preview",fullscreen:"Fullscreen","sw-visibility":"View components","export-template":"View code","open-sm":"Open Style Manager","open-tm":"Settings","open-layers":"Open Layer Manager","open-blocks":"Open Blocks"}}},selectorManager:{label:"Classes",selected:"Selected",emptyState:"- State -",states:{hover:"Hover",active:"Click","nth-of-type(2n)":"Even/Odd"}},styleManager:{empty:"Select an element before using Style Manager",layer:"Layer",fileButton:"Images",sectors:{general:"General",layout:"Layout",typography:"Typography",decorations:"Decorations",extra:"Extra",flex:"Flex",dimension:"Dimension"},properties:{"text-shadow-h":"X","text-shadow-v":"Y","text-shadow-blur":"Blur","text-shadow-color":"Color","box-shadow-h":"X","box-shadow-v":"Y","box-shadow-blur":"Blur","box-shadow-spread":"Spread","box-shadow-color":"Color","box-shadow-type":"Type","margin-top-sub":"Top","margin-right-sub":"Right","margin-bottom-sub":"Bottom","margin-left-sub":"Left","padding-top-sub":"Top","padding-right-sub":"Right","padding-bottom-sub":"Bottom","padding-left-sub":"Left","border-width-sub":"Width","border-style-sub":"Style","border-color-sub":"Color","border-top-left-radius-sub":"Top Left","border-top-right-radius-sub":"Top Right","border-bottom-right-radius-sub":"Bottom Right","border-bottom-left-radius-sub":"Bottom Left","transform-rotate-x":"Rotate X","transform-rotate-y":"Rotate Y","transform-rotate-z":"Rotate Z","transform-scale-x":"Scale X","transform-scale-y":"Scale Y","transform-scale-z":"Scale Z","transition-property-sub":"Property","transition-duration-sub":"Duration","transition-timing-function-sub":"Timing","background-image-sub":"Image","background-repeat-sub":"Repeat","background-position-sub":"Position","background-attachment-sub":"Attachment","background-size-sub":"Size"}},traitManager:{empty:"Select an element before using Trait Manager",label:"Component settings",categories:{},traits:{labels:{},attributes:{id:Iu,alt:Iu,title:Iu,href:{placeholder:"eg. https://google.com"}},options:{target:{false:"This window",_blank:"New window"}}}},storageManager:{recover:"Do you want to recover unsaved changes?"}}},messagesAdd:void 0};var Du;!function(t){t.add="i18n:add",t.update="i18n:update",t.locale="i18n:locale"}(Du||(Du={}));const Ru=Du;var Hu=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fu=function(t){function e(e){var n=t.call(this,e,"I18n",$u)||this;n.events=Ru;var r=n.config.messagesAdd;return r&&n.addMessages(r),n.config.detectLocale&&(n.config.locale=n._localLang()),n}return Hu(e,t),e.prototype.setLocale=function(t){var e=this,n=e.em,r=e.config,o=e.events;return n.trigger(o.locale,{value:t,valuePrev:r.locale}),r.locale=t,this},e.prototype.getLocale=function(){return this.config.locale},e.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},e.prototype.setMessages=function(t){var e=this,n=e.em,r=e.config,o=e.events;return r.messages=t,n.trigger(o.update,t),this},e.prototype.addMessages=function(t){var e=this,n=e.em,r=e.events,o=e.config.messages;return n.trigger(r.add,t),this.setMessages((0,Z.deepMerge)(o,t)),this},e.prototype.t=function(t,e){void 0===e&&(e={});var n=this.config,r=e.params||{},o=e.l||this.getLocale(),i=e.lFlb||n.localeFallback,s=this._getMsg(t,o,e);return s||(s=this._getMsg(t,i,e)),!s&&this._debug("'".concat(t,"' i18n key not found in '").concat(o,"' lang"),e),s&&(0,J.isString)(s)?this._addParams(s,r):s},e.prototype._localLang=function(){var t=(0,Z.hasWin)()&&window.navigator||{},e=t.language||t.userLanguage;return e?e.split("-")[0]:"en"},e.prototype._addParams=function(t,e){var n=new RegExp("{([\\w\\d-]*)}","g");return t.replace(n,(function(t,n){return e[n]||""})).trim()},e.prototype._getMsg=function(t,e,n){void 0===n&&(n={});var r=this.getMessages(e,n);if(r){var o=r[t];return!o&&t.indexOf(".")>0&&(o=t.split(".").reduce((function(t,e){if(!(0,J.isUndefined)(t))return t[e]}),r)),o}},e.prototype._debug=function(t,e){void 0===e&&(e={});var n=this.em,r=this.config;(e.debug||r.debug)&&n&&n.logWarning(t)},e.prototype.destroy=function(){},e}(dt);const Vu=Fu;var Uu=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bu=function(){return Bu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Bu.apply(this,arguments)},zu=function(){},Wu={id:"sorter-target",type:re.F.Target},qu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Uu(e,t),e.prototype.initialize=function(t){void 0===t&&(t={}),this.opt=t||{},(0,J.bindAll)(this,"startSort","onMove","endMove","rollback","updateOffset","moveDragHelper");var e=t||{};this.elT=0,this.elL=0,this.borderOffset=e.borderOffset||10;var n=e.container;this.el="string"==typeof n?document.querySelector(n):n,this.$el=(0,rt.default)(this.el),this.containerSel=e.containerSel||"div",this.itemSel=e.itemSel||"div",this.draggable=e.draggable||!0,this.nested=!!e.nested,this.pfx=e.pfx||"",this.ppfx=e.ppfx||"",this.freezeClass=e.freezeClass||this.pfx+"freezed",this.onStart=e.onStart||zu,this.onEndMove=e.onEndMove,this.customTarget=e.customTarget,this.onEnd=e.onEnd,this.direction=e.direction||"v",this.onMoveClb=e.onMove,this.relative=e.relative||!1,this.ignoreViewChildren=!!e.ignoreViewChildren,this.plh=e.placer,this.wmargin=e.wmargin||0,this.offTop=e.offsetTop||0,this.offLeft=e.offsetLeft||0,this.document=e.document||document,this.em=e.em,this.canvasRelative=!!e.canvasRelative,this.selectOnEnd=!e.avoidSelectOnEnd,this.scale=e.scale;var r=this.em;(null==r?void 0:r.on)&&(r.on(r.Canvas.events.refresh,this.updateOffset),this.updateOffset())},e.prototype.getScale=function(){return(0,J.result)(this,"scale")||1},e.prototype.getContainerEl=function(t){if(t&&(this.el=t),!this.el){var e=this.opt.container;this.el="string"==typeof e?document.querySelector(e):e,this.$el=(0,rt.default)(this.el)}return this.el},e.prototype.getDocuments=function(t){var e=this.em,n=t?t.ownerDocument:null==e?void 0:e.Canvas.getBody().ownerDocument,r=[document];return n&&r.push(n),r},e.prototype.updateOffset=function(){var t,e=(null===(t=this.em)||void 0===t?void 0:t.get("canvasOffset"))||{};this.offTop=e.top,this.offLeft=e.left},e.prototype.setDropContent=function(t){delete this.dropModel,this.dropContent=t},e.prototype.updateTextViewCursorPosition=function(t){var e=this.em;if(e){var n=e.Canvas,r=n.getDocument(),o=null;if(r.caretRangeFromPoint){var i=(0,fe.G2)(t);o=r.caretRangeFromPoint(i.clientX,i.clientY)}else t.rangeParent&&(o=r.createRange()).setStart(t.rangeParent,t.rangeOffset);var s=n.getWindow().getSelection();n.getFrameEl().focus(),null==s||s.removeAllRanges(),o&&(null==s||s.addRange(o)),this.setContentEditable(this.activeTextModel,!0)}},e.prototype.setContentEditable=function(t,e){if(t){var n=t.getEl();n.contentEditable!=e&&(n.contentEditable=e)}},e.prototype.toggleSortCursor=function(t){var e=this.em,n=null==e?void 0:e.Canvas;n&&(t?n.startAutoscroll():n.stopAutoscroll())},e.prototype.setDragHelper=function(t,e){for(var n=e||"",r=t.cloneNode(!0),o=t.getBoundingClientRect(),i=getComputedStyle(t),s="",a=0;a<i.length;a++){var l=i[a];s+="".concat(l,":").concat(i.getPropertyValue(l),";")}document.body.appendChild(r),r.className+=" ".concat(this.pfx,"bdrag"),r.setAttribute("style",s),this.dragHelper=r,r.style.width="".concat(o.width,"px"),r.style.height="".concat(o.height,"px"),n&&this.moveDragHelper(n),this.em&&(0,rt.default)(this.em.Canvas.getBody().ownerDocument).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper),(0,rt.default)(document).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper)},e.prototype.moveDragHelper=function(t){var e=t.target.ownerDocument;if(this.dragHelper&&e){var n=t.pageY,r=t.pageX,o=0,i=0,s=(e.defaultView||e.parentWindow).frameElement,a=this.dragHelper.style;if(s){var l=s.getBoundingClientRect();o=l.top+document.documentElement.scrollTop,i=l.left+document.documentElement.scrollLeft,n=t.clientY,r=t.clientX}a.top=n+o+"px",a.left=r+i+"px"}},e.prototype.matches=function(t,e){return Z.matches.call(t,e)},e.prototype.closest=function(t,e){if(t)for(var n=t.parentNode;n&&1===n.nodeType;){if(this.matches(n,e))return n;n=n.parentNode}},e.prototype.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},e.prototype.createPlaceholder=function(){var t=this.pfx,e=document.createElement("div"),n=document.createElement("div");return e.className=t+"placeholder",e.style.display="none",e.style.pointerEvents="none",n.className=t+"placeholder-int",e.appendChild(n),e},e.prototype.startSort=function(t,e){var n,r;void 0===e&&(e={});var o,i=this,s=i.em,a=i.itemSel,l=i.containerSel,c=i.plh,u=this.getContainerEl(e.container),p=this.getDocuments(t);delete this.dropModel,delete this.target,delete this.prevTarget,this.moved=!1,t&&!this.matches(t,"".concat(a,", ").concat(l))&&(t=this.closest(t,a)),this.sourceEl=t,c||(this.plh=this.createPlaceholder(),u.appendChild(this.plh)),t&&((null==(o=this.getSourceModel(t))?void 0:o.set)&&o.set("status","freezed"),this.srcModel=o),(0,fe.on)(u,"mousemove dragover",this.onMove),(0,fe.on)(p,"mouseup dragend touchend",this.endMove),(0,fe.on)(p,"keydown",this.rollback),this.onStart({sorter:this,target:o,parent:o&&(null===(n=o.parent)||void 0===n?void 0:n.call(o)),index:o&&(null===(r=o.index)||void 0===r?void 0:r.call(o))}),null==s||s.clearSelection(),this.toggleSortCursor(!0),null==s||s.trigger("sorter:drag:start",t,o)},e.prototype.getTargetModel=function(t){var e=t||this.target;return(0,rt.default)(e).data("model")},e.prototype.getSourceModel=function(t,e){var n=this,r=void 0===e?{}:e,o=r.target,i=r.avoidChildren,s=void 0===i?1:i,a=this.em,l=this.sourceEl,c=t||l,u=this.dropModel,p=this.dropContent,d=function(t){return t&&o&&t.opt&&t.opt.avoidChildren&&n.isTextableActive(t,o)};if(p&&a){if(d(u)&&(u=void 0),!u){var f=a.Components.getComponents(),h={avoidChildren:s,avoidStore:1,avoidUpdateStyle:1},g=f.add(p,Bu(Bu({},h),{temporary:!0}));if(u=(u=f.remove(g,h))instanceof Array?u[0]:u,this.dropModel=u,d(u))return this.getSourceModel(c,{target:o,avoidChildren:0})}return u}return c&&(0,rt.default)(c).data("model")},e.prototype.selectTargetModel=function(t,e){if(!(t instanceof ot.pM||e&&e===t)){var n=this.targetModel;if(n&&n!==this.srcModel&&n.set("status",""),null==t?void 0:t.set){var r=this.em.Canvas;[re.F.Select,re.F.Hover,re.F.Spacing].forEach((function(t){return r.removeSpots({type:t})})),r.addSpot(Bu(Bu({},Wu),{component:t})),t.set("status","selected-parent"),this.targetModel=t}}},e.prototype.onMove=function(t){var e=t,n=this,r=n.em,o=n.onMoveClb,i=n.plh,s=n.customTarget;this.moved=!0;var a=i.style.display;a&&"none"!==a||(i.style.display="block");var l=this.offset(this.el);this.elT=this.wmargin?Math.abs(l.top):l.top,this.elL=this.wmargin?Math.abs(l.left):l.left;var c=t.pageY-this.elT+this.el.scrollTop,u=t.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&r){var p=r.Canvas.getMouseRelativeCanvas(t,{noScroll:1});u=p.x,c=p.y}this.rX=u,this.rY=c,this.eventMove=t;var d=this.getSourceModel(),f=s?s({sorter:this,event:t}):t.target,h=this.dimsFromTarget(f,u,c),g=this.target,v=g&&this.getTargetModel(g);if(this.selectTargetModel(v,d),v||(i.style.display="none"),g){this.lastDims=h;var m=this.findPosition(h,u,c);this.isTextableActive(d,v)?(this.activeTextModel=v,i.style.display="none",this.lastPos=m,this.updateTextViewCursorPosition(e)):(this.disableTextable(),delete this.activeTextModel,this.lastPos&&this.lastPos.index==m.index&&this.lastPos.method==m.method||(this.movePlaceholder(this.plh,h,m,this.prevTargetDim),this.$plh||(this.$plh=(0,rt.default)(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css("top","+="+this.offTop+"px"),this.offLeft&&this.$plh.css("left","+="+this.offLeft+"px")),this.lastPos=m)),(0,J.isFunction)(o)&&o({event:t,target:d,parent:v,index:m.index+("after"==m.method?1:0)}),r&&r.trigger("sorter:drag",{target:g,targetModel:v,sourceModel:d,dims:h,pos:m,x:u,y:c})}},e.prototype.isTextableActive=function(t,e){var n;return(null===(n=null==t?void 0:t.get)||void 0===n?void 0:n.call(t,"textable"))&&(null==e?void 0:e.isInstanceOf("text"))},e.prototype.disableTextable=function(){var t=this.activeTextModel;null==t||t.getView().disableEditing(),this.setContentEditable(t,!1)},e.prototype.isInFlow=function(t,e){if(!t)return!1;e=e||document.body;var n=t;return n.offsetHeight,!!this.styleInFlow(n,e)},e.prototype.styleInFlow=function(t,e){if(!(0,fe.ir)(t)){var n=t.style||{},r=(0,rt.default)(t),o=e&&(0,rt.default)(e);if(!n.overflow||"visible"===n.overflow){var i=r.css("float");if(!(i&&"none"!==i||o&&"flex"==o.css("display")&&"column"!==o.css("flex-direction"))){switch(n.position){case"static":case"relative":case"":break;default:return}switch(t.tagName){case"TR":case"TBODY":case"THEAD":case"TFOOT":return!0}switch(r.css("display")){case"block":case"list-item":case"table":case"flex":case"grid":return!0}}}}},e.prototype.validTarget=function(t,e){var n,r,o=this.lastPos,i=this.getTargetModel(t),s=this.getSourceModel(e,{target:i}),a={valid:!0,src:e=null===(n=null==s?void 0:s.view)||void 0===n?void 0:n.el,srcModel:s,trg:t=null===(r=null==i?void 0:i.view)||void 0===r?void 0:r.el,trgModel:i,draggable:!1,droppable:!1,dragInfo:"",dropInfo:""};if(!e||!t)return a.valid=!1,a;var l=o?"after"===o.method?o.indexEl+1:o.indexEl:i.components().length,c=s.get("draggable");if((0,J.isFunction)(c)){var u=c(s,i,l);a.dragInfo=u,a.draggable=u,c=u}else c=c instanceof Array?c.join(", "):c,a.dragInfo=c,c=(0,J.isString)(c)?this.matches(t,c):c,a.draggable=c;var p=i.get("droppable");return(0,J.isFunction)(p)?(u=p(s,i,l),a.droppable=u,a.dropInfo=u,p=u):(p=(p=p instanceof ot.pM?1:p)instanceof Array?p.join(", "):p,a.dropInfo=p,p=(0,J.isString)(p)?this.matches(e,p):p,p=c&&this.isTextableActive(s,i)?1:p,a.droppable=p),p&&c||(a.valid=!1),a},e.prototype.dimsFromTarget=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0);var r=this.em,o=[];if(!t)return o;if(this.matches(t,"".concat(this.itemSel,", ").concat(this.containerSel))||(t=this.closest(t,this.itemSel)),this.draggable instanceof Array&&(t=this.closest(t,this.draggable.join(","))),!t)return o;if(this.prevTarget&&this.prevTarget!=t&&delete this.prevTarget,!this.prevTarget){this.targetP=this.closest(t,this.containerSel);var i=this.validTarget(t);if(r&&r.trigger("sorter:drag:validation",i),!i.valid&&this.targetP)return this.dimsFromTarget(this.targetP,e,n);this.prevTarget=t,this.prevTargetDim=this.getDim(t),this.cacheDimsP=this.getChildrenDim(this.targetP),this.cacheDims=this.getChildrenDim(t)}if(this.prevTarget==t&&(o=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,e,n)||!this.nested&&!this.cacheDims.length){var s=this.targetP;s&&this.validTarget(s).valid&&(o=this.cacheDimsP,this.target=s)}return delete this.lastPos,o},e.prototype.getTargetFromEl=function(t){var e,n=t,r=this.targetPrev,o=this.em,i=this.containerSel,s=this.itemSel;if(this.matches(n,"".concat(s,", ").concat(i))||(n=this.closest(n,s)),this.draggable instanceof Array&&(n=this.closest(n,this.draggable.join(","))),r&&r!=n&&delete this.targetPrev,!this.targetPrev){e=this.closest(n,i);var a=this.validTarget(n);if(o&&o.trigger("sorter:drag:validation",a),!a.valid&&e)return this.getTargetFromEl(e);this.targetPrev=n}return this.nearElBorders(n)&&(e=this.closest(n,i))&&this.validTarget(e).valid&&(n=e),n},e.prototype.nearElBorders=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument.body,r=this.getCurrentPos(),o=r.x,i=r.y,s=e.top+n.scrollTop,a=e.left+n.scrollLeft,l=e.width,c=e.height;if(i<s+10||i>s+c-10||o<a+10||o>a+l-10)return 1},e.prototype.getCurrentPos=function(){var t=this.eventMove;return{x:(null==t?void 0:t.pageX)||0,y:(null==t?void 0:t.pageY)||0}},e.prototype.getDim=function(t){var e,n,r,o,i=this.em,s=this.canvasRelative,a=null==i?void 0:i.Canvas,l=a?a.getElementOffsets(t):{};if(s&&i){var c=a.getElementPos(t,{noScroll:1});e=c.top,n=c.left,r=c.height,o=c.width}else{var u=this.offset(t);e=this.relative?t.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,r=t.offsetHeight,o=t.offsetWidth}return{top:e,left:n,height:r,width:o,offsets:l}},e.prototype.getChildrenDim=function(t){var e=this,n=[];if(!t)return n;var r=this.getTargetModel(t);if(r&&r.view&&!this.ignoreViewChildren){var o=r.getCurrentView?r.getCurrentView():r.view;t=o.getChildrenContainer()}return(0,J.each)(t.children,(function(r,o){var i=r,s=(0,Z.getModel)(i,rt.default),a=s&&s.index?s.index():o;if((0,fe.ir)(i)||e.matches(i,e.itemSel)){var l,c=e.getDim(i),u=e.direction;l="v"==u||"h"!=u&&e.isInFlow(i,t),c.dir=l,c.el=i,c.indexEl=a,n.push(c)}})),n},e.prototype.nearBorders=function(t,e,n){var r=!1,o=this.borderOffset,i=e||0,s=n||0,a=t.top,l=t.left,c=t.height,u=t.width;return(a+o>s||s>a+c-o||l+o>i||i>l+u-o)&&(r=!0),r},e.prototype.findPosition=function(t,e,n){for(var r,o={index:0,indexEl:0,method:"before"},i=0,s=0,a=0,l=0,c=0,u=0,p=0,d=t.length;p<d;p++){var f=(r=t[p]).top,h=r.left,g=r.height,v=r.width;if(u=f+g,l=h+v/2,c=f+g/2,!(s&&h>s||a&&c>=a||i&&h+v<i))if(o.index=p,o.indexEl=r.indexEl,r.dir){if(n<c){o.method="before";break}o.method="after"}else n<u&&(a=u),e<l?(s=l,o.method="before"):(i=l,o.method="after")}return o},e.prototype.movePlaceholder=function(t,e,n,r){var o=0,i=0,s="",a="",l="px",c=n.method,u=e[n.index];if(t.classList.remove("vertical"),t.classList.add("horizontal"),u){var p=u.top,d=u.left,f=u.height,h=u.width;u.dir?(s=h+l,a="auto",o="before"==c?p-0:p+f-0,i=d):(s="auto",a=f-0+l,o=p+0,i="before"==c?d-0:d+h-0,t.classList.remove("horizontal"),t.classList.add("vertical"))}else{if(!this.nested)return void(t.style.display="none");if(r){var g=r.offsets||{},v=g.paddingTop||5,m=g.paddingLeft||5,y=g.borderTopWidth||0,b=g.borderLeftWidth||0,w=b+(g.borderRightWidth||0);o=r.top+v+y,i=r.left+m+b,s=parseInt("".concat(r.width))-2*m-w+l,a="auto"}}t.style.top=o+l,t.style.left=i+l,s&&(t.style.width=s),a&&(t.style.height=a)},e.prototype.parents=function(t){return t?[t].concat(this.parents(t.parent())):[]},e.prototype.sort=function(t,e){var n=t.parents.filter((function(t){return e.parents.includes(t)})),r=n[0];if(!r)return e.model.index()-t.model.index();var o=t.parents[t.parents.indexOf(r)-1];return e.parents[e.parents.indexOf(r)-1].index()-o.index()},e.prototype.endMove=function(){var t,e,n=this,r=this.sourceEl,o=[],i=this.getDocuments(),s=this.getContainerEl(),a=this.onEndMove,l=this.onEnd,c=this.target,u=this.lastPos;if((0,fe.AU)(s,"mousemove dragover",this.onMove),(0,fe.AU)(i,"mouseup dragend touchend",this.endMove),(0,fe.AU)(i,"keydown",this.rollback),this.plh.style.display="none",r&&(e=this.getSourceModel()),this.moved&&c){var p=this.toMove,d=(0,J.isArray)(p)?p:p?[p]:[r],f=0;1===d.length?o.push(this.move(c,d[0],u)):d.map((function(t){return{model:t,parents:n.parents(t)}})).sort(this.sort).forEach((function(t){var e=t.model,r=e.index(),i=e.parent().getEl();o.push(n.move(c,e,Bu(Bu({},u),{indexEl:u.indexEl-f,index:u.index-f}))),i===c&&r<=u.index&&f++}))}this.plh&&(this.plh.style.display="none");var h=this.dragHelper;if(h&&(h.parentNode.removeChild(h),delete this.dragHelper),this.disableTextable(),this.selectTargetModel(),this.toggleSortCursor(),null===(t=this.em)||void 0===t||t.Canvas.removeSpots(Wu),delete this.toMove,delete this.eventMove,delete this.dropModel,(0,J.isFunction)(a)){var g={target:e,parent:e&&e.parent(),index:e&&e.index()};o.length?o.forEach((function(t){return a(t,n,g)})):a(null,this,Bu(Bu({},g),{cancelled:1}))}(0,J.isFunction)(l)&&l({sorter:this})},e.prototype.move=function(t,e,n){var r,o,i=this.em,s=this.dropContent,a=(0,Z.getElement)(e),l=[],c="after"===n.method?n.indexEl+1:n.indexEl,u=this.validTarget(t,a),p=(0,rt.default)(t).data("collection"),d=u.trgModel,f=u.srcModel,h=u.draggable,g=d instanceof ot.pM?1:u.droppable;if(p&&g&&h){var v={at:c,action:"move-component"},m=this.isTextableActive(f,d);if(s)r=(0,J.isFunction)(s)?s():s,v.avoidUpdateStyle=!0,v.action="add-component";else{var y=f.collection.indexOf(f),b=p===f.collection;(!b||y!==c&&y!==c-1||m)&&(r=f.collection.remove(f,{temporary:!0}),b&&c>y&&(v.at=c-1))}r&&(m?(delete v.at,o=d.getView().insertComponent(r,v)):o=p.add(r,v)),delete this.dropContent,delete this.prevTarget}else if(i){var w=u.dropInfo||(null==d?void 0:d.get("droppable")),_=u.dragInfo||(null==f?void 0:f.get("draggable"));!p&&l.push("Target collection not found"),!g&&w&&l.push("Target is not droppable, accepts [".concat(w,"]")),!h&&_&&l.push("Component not draggable, acceptable by [".concat(_,"]")),i.logWarning("Invalid target position",{errors:l,model:f,context:"sorter",target:d})}return null==i||i.trigger("sorter:drag:end",{targetCollection:p,modelToDrop:r,warns:l,validResult:u,dst:t,srcEl:a}),o},e.prototype.rollback=function(t){(0,fe.AU)(this.getDocuments(),"keydown",this.rollback),27==(t.which||t.keyCode)&&(this.moved=!1,this.endMove())},e}(ot.Ss);const Gu=qu;var Ku=function(){return Ku=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ku.apply(this,arguments)},Yu=function(){function t(t){void 0===t&&(t={}),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=Ku({},this.defOpts),this.setOptions(t),(0,J.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop")}return t.prototype.getConfig=function(){return this.opts},t.prototype.setOptions=function(t,e){void 0===t&&(t={}),this.opts=Ku(Ku({},e?this.defOpts:this.opts),t),this.setup()},t.prototype.setup=function(){var t=this.opts,e=t.prefix||"",n=t.appendTo||document.body,r=this.container;for(r||((r=document.createElement("div")).className="".concat(e,"resizer-c"),n.appendChild(r),this.container=r);r.firstChild;)r.removeChild(r.firstChild);var o={};for(var i in["tl","tc","tr","cl","cr","bl","bc","br"].forEach((function(e){return o[e]=t[e]?function(t,e){void 0===e&&(e={});var n=e.prefix||"",r=document.createElement("i");return r.className=n+"resizer-h "+n+"resizer-h-"+t,r.setAttribute("data-"+n+"handler",t),r}(e,t):null})),o){var s=o[i];s&&r.appendChild(s)}this.handlers=o,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},t.prototype.toggleFrames=function(t){if(this.opts.silentFrames){var e=document.querySelectorAll("iframe");(0,J.each)(e,(function(e){return e.style.pointerEvents=t?"none":""}))}},t.prototype.isHandler=function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1},t.prototype.getFocusedEl=function(){return this.el},t.prototype.getParentEl=function(){var t;return null===(t=this.el)||void 0===t?void 0:t.parentElement},t.prototype.getDocumentEl=function(){return[this.el.ownerDocument,document]},t.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.posFetcher;return n?n(t,e):function(t){var e=window,n=t.getBoundingClientRect();return{left:n.left+e.pageXOffset,top:n.top+e.pageYOffset,width:n.width,height:n.height}}(t)},t.prototype.focus=function(t){t&&t===this.el||(this.el=t,this.updateContainer({forceShow:!0}),(0,fe.on)(this.getDocumentEl(),"pointerdown",this.handleMouseDown))},t.prototype.blur=function(){this.container.style.display="none",this.el&&((0,fe.AU)(this.getDocumentEl(),"pointerdown",this.handleMouseDown),delete this.el)},t.prototype.start=function(t){var e=t;if(0===e.button){e.preventDefault(),e.stopPropagation();var n=this.el,r=this.getParentEl(),o=this.opts||{},i=this.mousePosFetcher,s="data-"+o.prefix+"handler",a=this.getElementPos(n,{avoidFrameZoom:!0,avoidFrameOffset:!0}),l=this.getElementPos(r),c=e.target;this.handlerAttr=c.getAttribute(s),this.clickedHandler=c,this.startDim={t:a.top,l:a.left,w:a.width,h:a.height},this.rectDim={t:a.top,l:a.left,w:a.width,h:a.height},this.startPos=i?i(e):{x:e.clientX,y:e.clientY},this.parentDim={t:l.top,l:l.left,w:l.width,h:l.height};var u=this.getDocumentEl();this.docs=u,(0,fe.on)(u,"pointermove",this.move),(0,fe.on)(u,"keydown",this.handleKeyDown),(0,fe.on)(u,"pointerup",this.stop),(0,J.isFunction)(this.onStart)&&this.onStart(e,{docs:u,config:o,el:n,resizer:this}),this.toggleFrames(!0),this.move(e)}},t.prototype.move=function(t){var e=t,n=this.onMove,r=this.mousePosFetcher,o=r?r(e):{x:e.clientX,y:e.clientY};this.currentPos=o,this.delta={x:o.x-this.startPos.x,y:o.y-this.startPos.y},this.keys={shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey},this.rectDim=this.calc(this),this.updateRect(!1),n&&n(e)},t.prototype.stop=function(t){var e=this.el,n=this.opts,r=this.docs||this.getDocumentEl();(0,fe.AU)(r,"pointermove",this.move),(0,fe.AU)(r,"keydown",this.handleKeyDown),(0,fe.AU)(r,"pointerup",this.stop),this.updateRect(!0),this.toggleFrames(),(0,J.isFunction)(this.onEnd)&&this.onEnd(t,{docs:r,config:n,el:e,resizer:this}),delete this.docs},t.prototype.updateRect=function(t){var e=this.el,n=this.opts,r=this.rectDim,o=this.updateTarget,i=this.getSelectedHandler(),s=n.unitHeight,a=n.unitWidth,l=n.keyWidth,c=n.keyHeight;if((0,J.isFunction)(o))o(e,r,{store:t,selectedHandler:i,resizer:this,config:n});else{var u=e.style;u[l]=r.w+a,u[c]=r.h+s}this.updateContainer()},t.prototype.updateContainer=function(t){var e;void 0===t&&(t={});var n=this,r=n.opts,o=n.container,i=n.el,s=o.style;!r.avoidContainerUpdate&&i&&t.forceShow&&(s.display="block"),null===(e=this.onUpdateContainer)||void 0===e||e.call(this,{el:o,resizer:this,opts:Ku(Ku({},r),t)})},t.prototype.getSelectedHandler=function(){var t=this.handlers;if(this.selectedHandler)for(var e in t)if(t[e]===this.selectedHandler)return e},t.prototype.handleKeyDown=function(t){27===t.keyCode&&(this.rectDim=this.startDim,this.stop(t))},t.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())},t.prototype.calc=function(t){var e,n=this.opts||{},r=n.step,o=this.startDim,i=n.minDim,s=n.maxDim,a=t.delta.x,l=t.delta.y,c=this.parentDim.w,u=this.parentDim.h,p=this.opts.unitWidth,d=this.opts.unitHeight,f="%"===p?o.w/100*c:o.w,h="%"===d?o.h/100*u:o.h,g={t:o.t,l:o.l,w:f,h};if(t){var v=t.handlerAttr;~v.indexOf("r")&&(e="%"===p?(0,Z.normalizeFloat)((f+a*r)/c*100,.01):(0,Z.normalizeFloat)(f+a*r,r),e=Math.max(i,e),s&&(e=Math.min(s,e)),g.w=e),~v.indexOf("b")&&(e="%"===d?(0,Z.normalizeFloat)((h+l*r)/u*100,.01):(0,Z.normalizeFloat)(h+l*r,r),e=Math.max(i,e),s&&(e=Math.min(s,e)),g.h=e),~v.indexOf("l")&&(e="%"===p?(0,Z.normalizeFloat)((f-a*r)/c*100,.01):(0,Z.normalizeFloat)(f-a*r,r),e=Math.max(i,e),s&&(e=Math.min(s,e)),g.w=e),~v.indexOf("t")&&(e="%"===d?(0,Z.normalizeFloat)((h-l*r)/u*100,.01):(0,Z.normalizeFloat)(h-l*r,r),e=Math.max(i,e),s&&(e=Math.min(s,e)),g.h=e);var m=n.ratioDefault?!t.keys.shift:t.keys.shift;if(v.indexOf("c")<0&&m){var y=o.w/o.h;g.w/g.h>y?g.h=Math.round(g.w/y):g.w=Math.round(g.h*y)}for(var b in~v.indexOf("l")&&(g.l+=o.w-g.w),~v.indexOf("t")&&(g.t+=o.h-g.h),g){var w=b;g[w]=parseInt("".concat(g[w]),10)}return g}},t}();const Xu=Yu;var Ju=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zu=function(){return Zu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Zu.apply(this,arguments)};const Qu=function(t){function e(e){var n=t.call(this,e,"Utils")||this;return n.Sorter=Gu,n.Resizer=Xu,n.Dragger=ir.A,n.helpers=Zu({},Z),n}return Ju(e,t),e.prototype.destroy=function(){},e}(dt);var tp,ep={},np={16:!1,18:!1,17:!1,91:!1},rp="all",op={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},ip={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},sp=function(t){return ip[t]||t.toUpperCase().charCodeAt(0)},ap=[];for(tp=1;tp<20;tp++)ip["f"+tp]=111+tp;function lp(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function cp(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 up={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};function pp(t){for(tp in np)np[tp]=t[up[tp]]}function dp(t){var e,n=t.keyCode,r=lp(ap,n);if(r>=0&&ap.splice(r,1),93!=n&&224!=n||(n=91),n in np)for(e in np[n]=!1,op)op[e]==n&&(hp[e]=!1)}function fp(){for(tp in np)np[tp]=!1;for(tp in op)hp[tp]=!1}function hp(t,e,n){var r,o;r=vp(t),void 0===n&&(n=e,e="all");for(var i=0;i<r.length;i++)o=[],(t=r[i].split("+")).length>1&&(o=mp(t),t=[t[t.length-1]]),t=t[0],(t=sp(t))in ep||(ep[t]=[]),ep[t].push({shortcut:r[i],scope:e,method:n,key:r[i],mods:o})}for(tp in op)hp[tp]=!1;function gp(){return rp||"all"}function vp(t){var e;return""==(e=(t=t.replace(/\s/g,"")).split(","))[e.length-1]&&(e[e.length-2]+=","),e}function mp(t){for(var e=t.slice(0,t.length-1),n=0;n<e.length;n++)e[n]=op[e[n]];return e}function yp(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,(function(){n(window.event)}))}hp.setScope=function(t){rp=t||"all"},hp.getScope=gp,hp.deleteScope=function(t){var e,n,r;for(e in ep)for(n=ep[e],r=0;r<n.length;)n[r].scope===t?n.splice(r,1):r++},hp.filter=function(t){var e=(t.target||t.srcElement).tagName;return!("INPUT"==e||"SELECT"==e||"TEXTAREA"==e)},hp.isPressed=function(t){return"string"==typeof t&&(t=sp(t)),-1!=lp(ap,t)},hp.getPressedKeyCodes=function(){return ap.slice(0)},hp.unbind=function(t,e){var n,r,o,i,s,a=[];for(n=vp(t),i=0;i<n.length;i++){if((r=n[i].split("+")).length>1&&(a=mp(r)),t=r[r.length-1],t=sp(t),void 0===e&&(e=gp()),!ep[t])return;for(o=0;o<ep[t].length;o++)(s=ep[t][o]).scope===e&&cp(s.mods,a)&&(ep[t][o]={})}},hp.handlers=ep,hp.init=function(t){yp(t.document,"keydown",(function(t){!function(t){var e,n,r,o,i,s;if(e=t.keyCode,-1==lp(ap,e)&&ap.push(e),93!=e&&224!=e||(e=91),e in np)for(r in np[e]=!0,op)op[r]==e&&(hp[r]=!0);else if(pp(t),hp.filter.call(this,t)&&e in ep)for(s=gp(),o=0;o<ep[e].length;o++)if((n=ep[e][o]).scope==s||"all"==n.scope){for(r in i=n.mods.length>0,np)(!np[r]&&lp(n.mods,+r)>-1||np[r]&&-1==lp(n.mods,+r))&&(i=!1);(0!=n.mods.length||np[16]||np[18]||np[17]||np[91])&&!i||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)})),yp(t.document,"keyup",dp),yp(t,"focus",fp)};const bp=hp,wp={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 _p=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xp=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};(0,Z.hasWin)()&&bp.init(window);var Cp=function(t){function e(e){var n=t.call(this,e,"Keymaps",wp)||this;return n.keymaster=bp,n.keymaps={},n}return _p(e,t),e.prototype.onLoad=function(){var t=this.config.defaults;for(var e in t){var n=t[e];this.add(e,n.keys,n.handler,n.opts||{})}},e.prototype.add=function(t,e,n,r){void 0===r&&(r={});var o=this.em,i=o.Commands,s=o.getEditor(),a=o.Canvas,l={id:t,keys:e,handler:n};return this.keymaps[t]&&this.remove(t),this.keymaps[t]=l,bp(e,(function(e,l){var c={event:e,h:l},u=(0,J.isString)(n)?i.get(n):n;if(!o.isEditing()&&!s.Canvas.isInputFocused()||r.force){r.prevent&&a.getCanvasView().preventDefault(e),(0,J.isFunction)(u)?u(s,0,c):i.runCommand(u,c);var p=[t,l.shortcut,e];o.trigger.apply(o,xp(["keymap:emit"],p,!1)),o.trigger.apply(o,xp(["keymap:emit:".concat(t)],p,!1))}}),void 0),o.trigger("keymap:add",l),l},e.prototype.get=function(t){return this.keymaps[t]},e.prototype.getAll=function(){return this.keymaps},e.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){bp.unbind(t.trim())})),null==e||e.trigger("keymap:remove",n),n},e.prototype.removeAll=function(){var t=this;return Object.keys(this.keymaps).forEach((function(e){return t.remove(e)})),bp.handlers={},this},e.prototype.destroy=function(){this.removeAll(),this.keymaps={}},e}(dt);const Sp=Cp,Tp={stylePrefix:"mdl-",title:"",content:"",backdrop:!0,custom:!1,extend:{}};var Op=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const Ap=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Op(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}(gt.A);var Ep=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kp=function(){return kp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},kp.apply(this,arguments)},Pp=function(t){function e(e){var n=t.call(this,e)||this,r=n.model;return n.listenTo(r,"change:open",n.updateOpen),n.listenTo(r,"change:title",n.updateTitle),n.listenTo(r,"change:content",n.updateContent),n}return Ep(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.ppfx,r=t.content,o=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(o,'</div>\n <div class="').concat(e,'btn-close" data-close-modal>⨯</div>\n </div>\n <div class="').concat(e,'content">\n <div id="').concat(e,'c">').concat(r,'</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(),r=this.model.get("content");e.length&&n.append(e),t.empty().append(r)},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,r=e.$el,o=e.el,i=[].slice.call(o.attributes).map((function(t){return t.name}));r.removeAttr(i.join(" ")),r.attr(kp(kp({},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}(de);const jp=Pp;var Mp=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Np=function(t){function e(e){var n=t.call(this,e,"Modal",Tp)||this;return n.model=new Ap(n),n.model.on("change:open",(function(t,n){e.trigger("modal:".concat(n?"open":"close"))})),n.model.on("change",(0,J.debounce)((function(){var t=n._evData(),r=n.config.custom;(0,J.isFunction)(r)&&r(t),e.trigger("modal",t)}),0)),n}return Mp(e,t),e.prototype._evData=function(){var t=this,e=this.getTitle(),n=this.getContent(),r=this.model.attributes;return{open:r.open,attributes:r.attributes,title:(0,J.isString)(e)?(0,fe.GZ)(e):e,content:(0,J.isString)(n)?(0,fe.GZ)(n):n.get?n.get(0):n,close:function(){t.close()}}},e.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(null==e||e.appendChild(n))},e.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},e.prototype.close=function(){return this.model.close(),this},e.prototype.onceClose=function(t){return this.em.once("modal:close",t),this},e.prototype.onceOpen=function(t){return this.em.once("modal:open",t),this},e.prototype.isOpen=function(){return!!this.model.get("open")},e.prototype.setTitle=function(t){return this.model.set("title",t),this},e.prototype.getTitle=function(){return this.model.get("title")},e.prototype.setContent=function(t){return this.model.set("content"," "),this.model.set("content",t),this},e.prototype.getContent=function(){return this.model.get("content")},e.prototype.getContentEl=function(){var t;return null===(t=this.modal)||void 0===t?void 0:t.getContent().get(0)},e.prototype.getModel=function(){return this.model},e.prototype.render=function(){var t;if(!this.config.custom){var e=jp.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}},e.prototype.destroy=function(){var t;null===(t=this.modal)||void 0===t||t.remove()},e}(dt);const Lp=Np;var Ip="sw-visibility",$p="export-template",Dp="open-sm",Rp="open-tm",Hp="open-layers",Fp="open-blocks",Vp="fullscreen",Up="preview";const Bp={stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:Ip,className:"fa fa-square-o",command:"core:component-outline",context:Ip,attributes:{title:"View components"}},{id:Up,className:"fa fa-eye",command:Up,context:Up,attributes:{title:"Preview"}},{id:Vp,className:"fa fa-arrows-alt",command:Vp,context:Vp,attributes:{title:"Fullscreen"}},{id:$p,className:"fa fa-code",command:$p,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:Dp,className:"fa fa-paint-brush",command:Dp,active:!0,togglable:!1,attributes:{title:"Open Style Manager"}},{id:Rp,className:"fa fa-cog",command:Rp,togglable:!1,attributes:{title:"Settings"}},{id:Hp,className:"fa fa-bars",command:Hp,togglable:!1,attributes:{title:"Open Layer Manager"}},{id:Fp,className:"fa fa-th-large",command:Fp,togglable:!1,attributes:{title:"Open Blocks"}}]}]};var zp=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wp=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.get("buttons").length&&r.set("buttons",new Yp(r.module,r.get("buttons"))),r}return zp(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}(gt.A);const qp=Wp;var Gp=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kp=function(t){function e(e,n){return t.call(this,e,n,qp)||this}return Gp(e,t),e.prototype.deactivateAllExceptOne=function(t,e){this.forEach((function(n,r){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,r){n!==t&&(n.set("disable",!0),e&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(t,e))}))},e}(Ut);const Yp=Kp;Kp.prototype.model=qp;var Xp=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jp=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=r.get("buttons")||[];return r.buttons=new Yp(e,o),r}return Xp(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}(gt.A);const Zp=Jp;var Qp=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),td=function(t){function e(e,n){return t.call(this,e,n,Zp)||this}return Qp(e,t),e}(Ut);const ed=td;td.prototype.model=Zp;var nd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rd=function(){return rd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},rd.apply(this,arguments)},od=function(t){function e(e){var n=t.call(this,e)||this,r=n,o=r.model,i=r.em,s=r.pfx,a=r.ppfx,l=o.className,c=o.attributes,u=c.command,p=c.listen;if(n.id=s+o.get("id"),n.activeCls="".concat(s,"active ").concat(a,"four-color"),n.disableCls="".concat(a,"disabled"),n.btnsVisCls="".concat(s,"visible"),n.className=s+"btn"+(l?" "+l:""),n.listenTo(o,"change",n.render),n.listenTo(o,"change:active updateActive",n.updateActive),n.listenTo(o,"checkActive",n.checkActive),n.listenTo(o,"change:bntsVis",n.updateBtnsVis),n.listenTo(o,"change:attributes",n.updateAttributes),n.listenTo(o,"change:className",n.updateClassName),n.listenTo(o,"change:disable",n.updateDisable),i&&(0,J.isString)(u)&&p){var d={fromListen:!0};n.listenTo(i,"run:".concat(u),(function(){return o.set("active",!0,d)})),n.listenTo(i,"stop:".concat(u),(function(){return o.set("active",!1,d)}))}return i&&i.get&&(n.commands=i.get("Commands")),n}return nd(e,t),e.prototype.tagName=function(){return this.model.get("tagName")},e.prototype.events=function(){return{click:"clicked"}},e.prototype.updateClassName=function(){var t=this.model,e=this.pfx,n=t.className,r=t.get("attributes").class,o="".concat(r||""," ").concat(e,"btn ").concat(n||"");this.$el.attr("class",o.trim())},e.prototype.updateAttributes=function(){var t=this,e=t.em,n=t.model,r=t.$el,o=n.get("attributes")||{},i=e&&e.t&&e.t("panels.buttons.titles.".concat(n.id));r.attr(o),i&&r.attr({title:i}),this.updateClassName()},e.prototype.updateBtnsVis=function(){this.$buttons&&(this.model.get("bntsVis")?this.$buttons.addClass(this.btnsVisCls):this.$buttons.removeClass(this.btnsVisCls))},e.prototype.updateActive=function(t,e,n){var r;void 0===n&&(n={});var o=this,i=o.model,s=o.commands,a=o.$el,l=o.activeCls,c=n.fromCollection,u=n.fromListen,p=i.get("context"),d=i.get("options"),f=i.command,h={};f&&(s&&(0,J.isString)(f)?h=s.get(f)||{}:(0,J.isFunction)(f)?h=s.create({run:f}):null!==f&&(0,J.isObject)(f)&&(h=s.create(f)),i.active?(!c&&(null===(r=i.collection)||void 0===r||r.deactivateAll(p,i)),i.set("active",!0,{silent:!0}).trigger("checkActive"),!u&&s.runCommand(h,rd(rd({},d),{sender:i})),h.noStop&&i.set("active",!1)):(a.removeClass(l),!u&&s.stopCommand(h,rd(rd({},d),{sender:i,force:1}))))},e.prototype.updateDisable=function(){var t=this.disableCls,e=this.model.disable;this.$el[e?"addClass":"removeClass"](t)},e.prototype.checkActive=function(){var t=this,e=t.model,n=t.$el,r=t.activeCls;e.active?n.addClass(r):n.removeClass(r)},e.prototype.clicked=function(){var t=this.model;t.get("bntsVis")||t.disable||!t.command||this.toggleActive()},e.prototype.toggleActive=function(){var t=this.model,e=this.em,n=t.active,r=t.togglable;n&&!r||(t.active=!n,n?t.runDefaultCommand&&e.runDefault():t.stopDefaultCommand&&e.stopDefault())},e.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},e}(de);const id=od;var sd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ad=function(t){function e(e){var n=t.call(this,{collection:e})||this;return n.listenTo(n.collection,"add",n.addTo),n.listenTo(n.collection,"reset remove",n.render),n.className=n.pfx+"buttons",n}return sd(e,t),e.prototype.addTo=function(t){this.addToCollection(t)},e.prototype.addToCollection=function(t,e){var n=e||null,r=t.get("el"),o=new id({el:r,model:t}).render().el;return n?n.appendChild(o):this.$el.append(o),o},e.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.$el.empty(),this.collection.each((function(n){return t.addToCollection(n,e)})),this.$el.append(e),this.$el.attr("class",(0,J.result)(this,"className")),this},e}(de);const ld=ad;var cd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ud=function(){return ud=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ud.apply(this,arguments)},pd=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 cd(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 r=!0===n?[!0,!0,!0,!0]:n,o=r.length,i=void 0,s=void 0,a=void 0,l=!1;if(2==o)i=(c=r)[0],a=c[0],s=c[1],l=c[1];else if(4==o){var c;i=(c=r)[0],s=c[1],a=c[2],l=c[3]}var u=new e.Utils.Resizer(ud({tc:i,cr:s,bc:a,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,r=t.style,o=u.getConfig(),i=o.keyWidth,s=o.keyHeight,a=t.getBoundingClientRect(),l="container"==n,c=r[i],p=r[s];return{left:0,top:0,width:c&&!l?parseFloat(c):a.width,height:p&&!l?parseFloat(p):a.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,r="".concat(this.className," ").concat(this.id," ").concat(n,"one-bg ").concat(n,"two-color");if(e.addClass(r),this.toggleVisible(),t.length){var o=new ld(t);e.append(o.render().el)}return e.append(this.model.get("content")),this},e}(de);const dd=pd;var fd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hd=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 fd(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,r=t.get("el"),o=new dd(t),i=o.render().el,s=t.get("appendTo");if(r);else if(s){var a=document.querySelector(s);null==a||a.appendChild(i)}else n?n.appendChild(i):this.$el.append(i);return o.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}(de);const gd=hd;var vd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),md=function(t){function e(e){var n=t.call(this,e,"Panels",Bp)||this;for(var r in n.panels=new ed(n,n.config.defaults),Bp)r in n.config||(n.config[r]=Bp[r]);return n}return vd(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 r=n.buttons.where({id:e});return r.length?r[0]:null}return null},e.prototype.render=function(){var t;return null===(t=this.PanelsViewObj)||void 0===t||t.remove(),this.PanelsViewObj=new gd(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}(dt);const yd=md,bd={stylePrefix:"cm-",optsCodeViewer:{}};var wd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const _d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wd(e,t),e.prototype.build=function(t,e){void 0===e&&(e={});var n=e.em,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["em"]);if(e.cleanId&&n){var o=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);r.attributes||(r.attributes=function(t,e){var n=e.id;return n&&"i"===n[0]&&!t.get("script")&&!t.get("attributes").id&&o.indexOf(n)<0&&delete e.id,e})}return t.toHTML(r)},e}(ot.Kx);var xd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xd(e,t),e.prototype.build=function(t){var e=this,n=t.toJSON();return this.beforeEach(n),(0,J.each)(n,(function(t,r){var o=n[r];if(o instanceof ot.Kx)n[r]=e.build(o);else if(o instanceof ot.pM){var i=o;n[r]=[],i.length&&i.forEach((function(t,o){n[r][o]=e.build(t)}))}})),n},e.prototype.beforeEach=function(t){delete t.status},e}(ot.Kx);const Sd=Cd;var Td=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Od(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 Ad=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Td(e,t),e.prototype.mapModel=function(t){var e,n=this,r="",o=t.get("script-export")||t.get("script"),i=t.get("type"),s=t.get("components"),a=t.getId();if(o){var l=t.get("attributes");l=(0,J.extend)({},l,{id:a}),t.set("attributes",l,{silent:!0});var c=t.getScriptString(o),u=t.get("script-props");if(t.get("scriptUpdated")&&!u)this.mapJs[i+"-"+a]={ids:[a],code:c};else{var p=void 0,d=this.mapJs[i];if(u&&(p=t.__getScriptProps()),d)d.ids.push(a),p&&(d.props[a]=p);else{var f={ids:[a],code:c};p&&(f.props=((e={})[a]=p,e)),this.mapJs[i]=f}}}return s.forEach((function(t){r+=n.mapModel(t)})),r},e.prototype.build=function(t){this.mapJs={},this.mapModel(t);var e="";for(var n in this.mapJs){var r=this.mapJs[n];if(r.code)if(r.props){if(Od(r.code))continue;e+="\n var props = ".concat(JSON.stringify(r.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(r.code,".bind(el))(props[el.id]);\n }")}else{var o="#"+r.ids.join(", #");e+="\n var items = document.querySelectorAll('".concat(o,"');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){\n").concat(r.code,"\n}.bind(items[i]))();\n }")}}return e},e}(ot.Kx);const Ed=Ad;var kd,Pd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jd=function(){return jd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},jd.apply(this,arguments)};(0,Z.hasWin)()&&(kd=Y(237),Y(520),Y(656),Y(862));var Md=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Pd(e,t),e.prototype.defaults=function(){return{input:"",label:"",codeName:"",theme:"hopscotch",readOnly:!0,lineNumbers:!0,autoFormat:!0}},e.prototype.init=function(t){return(0,J.bindAll)(this,"onChange"),this.editor=kd.fromTextArea(t,jd({dragDrop:!1,lineWrapping:!0,mode:this.get("codeName")},this.attributes)),this.element=t,this.editor.on("change",this.onChange),this},e.prototype.onChange=function(){this.trigger("update",this)},e.prototype.getEditor=function(){return this.editor},e.prototype.getElement=function(){return this.element},e.prototype.setElement=function(t){return this.element=t,this},e.prototype.refresh=function(){return this.getEditor().refresh(),this},e.prototype.focus=function(){return this.getEditor().focus(),this},e.prototype.getContent=function(){var t=this.getEditor();return t&&t.getValue()},e.prototype.setContent=function(t,e){var n=this;void 0===e&&(e={});var r=this.editor;if(r){r.setValue(t);var o=this.get("autoFormat");r.autoFormatRange&&(!0===o||Array.isArray(o)&&o.includes(this.get("codeName")))&&(kd.commands.selectAll(r),r.autoFormatRange(r.getCursor(!0),r.getCursor(!1)),kd.commands.goDocStart(r)),!e.noRefresh&&setTimeout((function(){return n.refresh()}))}},e}(ot.Kx);const Nd=Md;Md.prototype.CodeMirror=kd;var Ld=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Id=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ld(e,t),e.prototype.template=function(t){var e,n,r=t.pfx,o=t.codeName,i=t.label;return Q(Dd||(e=['\n <div class="','editor" id="',"",'">\n <div id="','title">','</div>\n <div id="','code"></div>\n </div>\n '],n=['\n <div class="','editor" id="',"",'">\n <div id="','title">','</div>\n <div id="','code"></div>\n </div>\n '],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,Dd=e),r,r,o,r,i,r)},e.prototype.initialize=function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},e.prototype.render=function(){var t,e,n=this,r=n.model,o=n.pfx,i=n.$el,s=r.toJSON(),a=r.get("input")||(null===(e=(t=r).getElement)||void 0===e?void 0:e.call(t));return s.pfx=o,i.html(this.template(s)),i.attr("class","".concat(o,"editor-c")),i.find("#".concat(o,"code")).append(a),this},e}(ot.Ss);const $d=Id;var Dd,Rd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hd=function(){return Hd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Hd.apply(this,arguments)},Fd=function(t){function e(e){var n=t.call(this,e,"CodeManager",bd)||this;n.EditorView=$d;var r=n.config,o=r.pStylePrefix;return o&&(r.stylePrefix=o+r.stylePrefix),n.generators={},n.viewers={},n.defGenerators={html:new _d,css:new ds,json:new Sd,js:new Ed},n.defViewers={CodeMirror:new Nd},n.loadDefaultGenerators().loadDefaultViewers(),n}return Rd(e,t),e.prototype.addGenerator=function(t,e){return this.generators[t]=e,this},e.prototype.getGenerator=function(t){return this.generators[t]},e.prototype.getGenerators=function(){return this.generators},e.prototype.addViewer=function(t,e){return this.viewers[t]=e,this},e.prototype.getViewer=function(t){return this.viewers[t]},e.prototype.getViewers=function(){return this.viewers},e.prototype.createViewer=function(t){void 0===t&&(t={});var e=(0,J.isUndefined)(t.type)?"CodeMirror":t.type,n=this.getViewer(e)&&this.getViewer(e).clone(),r=document.createElement("div"),o=document.createElement("textarea");return r.appendChild(o),n.set(Hd(Hd({},this.config.optsCodeViewer),t)),n.init(o),n.setElement(r),n},e.prototype.updateViewer=function(t,e){t.setContent(e)},e.prototype.getCode=function(t,e,n){void 0===n&&(n={}),n.em=this.em;var r=this.getGenerator(e);return r?r.build(t,n):""},e.prototype.loadDefaultGenerators=function(){for(var t in this.defGenerators)this.addGenerator(t,this.defGenerators[t]);return this},e.prototype.loadDefaultViewers=function(){for(var t in this.defViewers)this.addViewer(t,this.defViewers[t]);return this},e.prototype.destroy=function(){},e}(dt);const Vd=Fd;var Ud=Y(982),Bd=Y.n(Ud);const zd={maximumStackLength:500,trackSelection:!0};var Wd=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qd=function(){return qd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},qd.apply(this,arguments)},Gd=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Kd=function(t){return t.avoidStore||t.noUndo},Yd=function(t){return Object.keys(t.changedAttributes())},Xd=function(t){function e(e){var n=t.call(this,e,"UndoManager",zd)||this;n.config._disable&&(n.config.maximumStackLength=0);var r=!0;return n.um=new(Bd())(qd({track:!0,register:[]},n.config)),n.um.changeUndoType("change",{condition:function(t){var e=t.get("_undo");if(e){var n=t.get("_undoexc");if((0,J.isArray)(n)&&Yd(t).some((function(t){return n.indexOf(t)>=0})))return!1;if((0,J.isBoolean)(e))return!0;if((0,J.isArray)(e)&&Yd(t).some((function(t){return e.indexOf(t)>=0})))return!0}return!1},on:function(t,e,n){var o=this;!this.beforeCache&&(this.beforeCache=t.previousAttributes());var i=n||e||{};if(i.noUndo&&setTimeout((function(){o.beforeCache=null})),!Kd(i)){var s=t.toJSON({fromUndo:r}),a={object:t,before:this.beforeCache,after:s};if(this.beforeCache=null,!(0,J.isEmpty)(s))return a}}}),n.um.changeUndoType("add",{on:function(t,e,o){if(void 0===o&&(o={}),!Kd(o)&&n.isRegistered(e))return{object:e,before:void 0,after:t,options:qd(qd({},o),{fromUndo:r})}}}),n.um.changeUndoType("remove",{on:function(t,e,o){if(void 0===o&&(o={}),!Kd(o)&&n.isRegistered(e))return{object:e,before:t,after:void 0,options:qd(qd({},o),{fromUndo:r})}}}),n.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={}),!Kd(e)&&n.isRegistered(t))return{object:t,before:e.previousModels,after:Gd([],t.models,!0),options:qd(qd({},e),{fromUndo:r})}}}),n.um.on("undo redo",(function(){e.getSelectedAll().map((function(t){return t.trigger("rerender:layer")}))})),["undo","redo"].forEach((function(t){return n.um.on(t,(function(){return e.trigger(t)}))})),n}return Wd(e,t),e.prototype.postLoad=function(){var t=this.config,e=this.em;t.trackSelection&&e&&this.add(e.get("selected"))},e.prototype.add=function(t){return this.um.register(t),this},e.prototype.remove=function(t){return this.um.unregister(t),this},e.prototype.removeAll=function(){return this.um.unregisterAll(),this},e.prototype.start=function(){return this.um.startTracking(),this},e.prototype.stop=function(){return this.um.stopTracking(),this},e.prototype.undo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.undo(t),this},e.prototype.undoAll=function(){return this.um.undoAll(),this},e.prototype.redo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.redo(t),this},e.prototype.redoAll=function(){return this.um.redoAll(),this},e.prototype.hasUndo=function(){return!!this.um.isAvailable("undo")},e.prototype.hasRedo=function(){return!!this.um.isAvailable("redo")},e.prototype.isRegistered=function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},e.prototype.getStack=function(){return this.um.stack},e.prototype.getStackGroup=function(){var t=[],e=[];return this.getStack().forEach((function(n){var r=n.get("magicFusionIndex");e.indexOf(r)<0&&(e.push(r),t.push(n))})),t},e.prototype.skip=function(t){var e=!!this.um.isTracking();e&&this.stop(),t(),e&&this.start()},e.prototype.getGroupedStack=function(){var t={};return this.getStack().forEach((function(e,n){var r=e.get("magicFusionIndex"),o=function(t,e){var n=t.attributes,r=n.type,o=n.after,i=n.before,s=n.object,a=n.options;return{index:e,type:r,after:o,before:i,object:s,options:void 0===a?{}:a}}(e,n);t[r]?t[r].push(o):t[r]=[o]})),Object.keys(t).map((function(e){var n=t[e];return{index:n[n.length-1].index,actions:n,labels:(0,J.unique)(n.reduce((function(t,e){var n,r=null===(n=e.options)||void 0===n?void 0:n.action;return r&&t.push(r),t}),[]))}}))},e.prototype.goToGroup=function(t){var e=this;if(t){var n=this.getPointer(),r=t.index-n;(0,J.times)(Math.abs(r),(function(){e[r<0?"undo":"redo"](!1)}))}},e.prototype.getPointer=function(){return this.getStack().pointer},e.prototype.clear=function(){return this.um.clear(),this},e.prototype.getInstance=function(){return this.um},e.prototype.destroy=function(){this.clear().removeAll()},e}(dt);const Jd=Xd,Zd={stylePrefix:"rte-",adjustToolbar:!0,actions:["bold","italic","underline","strikethrough","link","wrap"],custom:!1};var Qd,tf=function(){return tf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},tf.apply(this,arguments)};!function(t){t[t.ACTIVE=1]="ACTIVE",t[t.INACTIVE=0]="INACTIVE",t[t.DISABLED=-1]="DISABLED"}(Qd||(Qd={}));var ef="_rte",nf=function(t,e){void 0===e&&(e="A");var n=t.selection()||{},r=n.anchorNode,o=n.focusNode,i=null==r?void 0:r.parentNode,s=null==o?void 0:o.parentNode;return(null==i?void 0:i.nodeName)==e||(null==s?void 0:s.nodeName)==e},rf="data-selectme",of={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()&&nf(t)?1:0},result:function(t){nf(t)?t.exec("unlink"):t.insertHTML('<a href="" '.concat(rf,">").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())&&nf(t,"SPAN")?-1:0},result:function(t){!nf(t,"SPAN")&&t.insertHTML("<span ".concat(rf,">").concat(t.selection(),"</span>"),{select:!0})}}},sf=function(){function t(t,e,n){void 0===n&&(n={});var r=this;if(this.em=t,this.settings=n,e[ef])return e[ef];e[ef]=this,this.setEl(e),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var o=(n.actions||[]).map((function(t){var e=t;return(0,J.isString)(t)?e=tf({},of[t]):of[t.name]&&(e=tf(tf({},of[t.name]),t)),e})),i=o.length?o:Object.keys(of).map((function(t){return of[t]}));n.classes=tf({actionbar:"actionbar",button:"action",active:"active",disabled:"disabled",inactive:"inactive"},n.classes);var s=n.classes,a=n.actionbar;if(this.actionbar=a,this.classes=s,this.actions=i,!a){if(!this.isCustom(n.module)){var l=n.actionbarContainer;(a=document.createElement("div")).className=s.actionbar,null==l||l.appendChild(a),this.actionbar=a}i.forEach((function(t){return r.addAction(t)}))}return n.styleWithCSS&&this.exec("styleWithCSS"),this}return t.prototype.isCustom=function(t){var e=t||this.em.RichTextEditor;return!(!(null==e?void 0:e.config.custom)&&!(null==e?void 0:e.customRte))},t.prototype.destroy=function(){},t.prototype.setEl=function(t){this.el=t,this.doc=t.ownerDocument},t.prototype.updateActiveActions=function(){var t=this,e=this.getActions();e.forEach((function(e){var n=e.update,r=e.btn,o=t.classes,i=o.active,s=o.inactive,a=o.disabled,l=e.state,c=e.name,u=t.doc,p=Qd.INACTIVE;if(r&&(r.className=r.className.replace(i,"").trim(),r.className=r.className.replace(s,"").trim(),r.className=r.className.replace(a,"").trim()),l){var d=l(t,u);if(p=d,r)switch(d){case 1:r.className+=" ".concat(i);break;case 0:r.className+=" ".concat(s);break;case-1:r.className+=" ".concat(a)}}else u.queryCommandSupported(c)&&u.queryCommandState(c)&&(r&&(r.className+=" ".concat(i)),p=Qd.ACTIVE);e.currentState=p,null==n||n(t,e)})),e.length&&this.em.RichTextEditor.__dbdTrgCustom()},t.prototype.enable=function(t){return this.enabled?this:this.__toggleEffects(!0,t)},t.prototype.disable=function(){return this.__toggleEffects(!1)},t.prototype.__toggleEffects=function(t,e){void 0===t&&(t=!1),void 0===e&&(e={});var n=t?fe.on:fe.AU,r=this.el,o=this.doc,i=this.actionbarEl();if(i&&(i.style.display=t?"":"none"),r.contentEditable="".concat(!!t),n(r,"mouseup keyup",this.updateActiveActions),n(o,"keydown",this.__onKeydown),n(o,"paste",this.__onPaste),this.enabled=t,t){var s=e.event;if(this.syncActions(),this.updateActiveActions(),s){var a=null;if(o.caretRangeFromPoint){var l=(0,fe.G2)(s);a=o.caretRangeFromPoint(l.clientX,l.clientY)}else s.rangeParent&&(a=o.createRange()).setStart(s.rangeParent,s.rangeOffset);var c=o.getSelection();null==c||c.removeAllRanges(),a&&(null==c||c.addRange(a))}r.focus()}return this},t.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 r=this.doc;"Enter"!==t.key||["insertOrderedList","insertUnorderedList"].some((function(t){return r.queryCommandState(t)}))||(r.execCommand("insertLineBreak"),t.preventDefault())},t.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 r=t.clipboardData,o=r.getData("text"),i=r.getData("text/html");if(o&&!i){t.preventDefault();var s=o.replace(/(?:\r\n|\r|\n)/g,"<br/>");this.doc.execCommand("insertHTML",!1,s)}},t.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",r=e.btn;r&&(r["on".concat(n)]=function(){e.result(t,e),t.updateActiveActions()})}}))},t.prototype.addAction=function(t,e){void 0===e&&(e={});var n=e.sync,r=this.actionbarEl();if(r){var o=t.icon,i=t.attributes,s=void 0===i?{}:i,a=document.createElement("span");for(var l in a.className=this.classes.button,t.btn=a,s)a.setAttribute(l,s[l]);"string"==typeof o?a.innerHTML=o:a.appendChild(o),r.appendChild(a)}n&&(this.actions.push(t),this.syncActions())},t.prototype.getActions=function(){return this.actions},t.prototype.selection=function(){return this.doc.getSelection()},t.prototype.exec=function(t,e){this.doc.execCommand(t,!1,e)},t.prototype.actionbarEl=function(){return this.actionbar},t.prototype.insertHTML=function(t,e){var n=(void 0===e?{}:e).select,r=this,o=r.em,i=r.doc,s=r.el,a=i.getSelection();if(a&&a.rangeCount){var l=(0,Z.getComponentModel)(s)||o.getSelected(),c=i.createElement("div"),u=a.getRangeAt(0);u.deleteContents(),(0,J.isString)(t)?c.innerHTML=t:t&&c.appendChild(t),Array.prototype.slice.call(c.childNodes).forEach((function(t){u.insertNode(t)})),a.removeAllRanges(),a.addRange(u),s.focus(),n&&l&&(l.once("rte:disable",(function(){var t=l.find("[".concat(rf,"]"))[0];t&&(o.setSelected(t),t.removeAttributes(rf))})),l.trigger("disable"))}},t}();const af=sf;var lf=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cf=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},uf=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},pf="".concat(ce.refresh," frame:scroll ").concat(oe.I.update),df={enable:"rte:enable",disable:"rte:disable",custom:"rte:custom"},ff=function(t){function e(e){var n=t.call(this,e,"RichTextEditor",Zd)||this;n.events=df;var r=n.config,o=r.pStylePrefix;o&&(r.stylePrefix=o+r.stylePrefix),n.pfx=r.stylePrefix,n.actions=r.actions||[];var i=new ot.Kx;return n.model=i,i.on("change:currentView",n.__trgCustom,n),n.__dbdTrgCustom=(0,J.debounce)((function(){return n.__trgCustom()}),0),n}return lf(e,t),e.prototype.onLoad=function(){if((0,Z.hasWin)()){var t=this.config,e=t.pStylePrefix,n=t.custom,r=(0,fe.a_)("div",{class:(0,fe.cx)("".concat(e,"rte-toolbar"),!n&&"".concat(e,"one-bg ").concat(e,"rte-toolbar-ui"))});this.toolbar=r,this.initRte((0,fe.a_)("div")),(0,fe.on)(r,"mousedown",(function(t){return t.stopPropagation()}))}},e.prototype.__trgCustom=function(){var t=this,e=t.model,n=t.em,r=t.events;n.trigger(r.custom,{enabled:!!e.get("currentView"),container:this.getToolbarEl(),actions:this.getAll()})},e.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,fe.YZ)(this.toolbar)},e.prototype.postRender=function(t){var e=t.model.get("Canvas");this.toolbar.style.pointerEvents="all",this.hideToolbar(),e.getToolsEl().appendChild(this.toolbar)},e.prototype.initRte=function(t){var e=this.globalRte,n=this,r=n.em,o=n.pfx,i=n.actionbar,s=n.config,a=this.actions||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],s.actions,!0),l={actionbar:"".concat(o,"actionbar"),button:"".concat(o,"action"),active:"".concat(o,"active"),inactive:"".concat(o,"inactive"),disabled:"".concat(o,"disabled")};return e?(e.em=r,e.setEl(t)):(e=new af(r,t,{classes:l,actions:a,actionbar:i,actionbarContainer:this.toolbar,module:this}),this.globalRte=e),e.actionbar&&(this.actionbar=e.actionbar),e.actions&&(this.actions=e.actions),e},e.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})},e.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},e.prototype.getAll=function(){var t;return(null===(t=this.globalRte)||void 0===t?void 0:t.getActions())||[]},e.prototype.remove=function(t){var e,n=this.getAll(),r=this.get(t);if(r){var o=r.btn,i=n.indexOf(r);null===(e=null==o?void 0:o.parentNode)||void 0===e||e.removeChild(o),n.splice(i,1)}return r},e.prototype.run=function(t){var e=this.globalRte,n=(0,J.isString)(t)?this.get(t):t;e&&n&&(n.result(e,n),e.updateActiveActions())},e.prototype.getToolbarEl=function(){return this.toolbar},e.prototype.updatePosition=function(){var t=this.em,e=this.toolbar,n=t.Canvas,r=e.style,o=n.getTargetToElementFixed(this.lastEl,e,{event:"rteToolbarPosUpdate",left:0});["top","left","bottom","right"].forEach((function(t){var e=o[t];(0,Z.isDef)(e)&&(r[t]=(0,J.isString)(e)?e:(e||0)+"px")}))},e.prototype.enable=function(t,e){return cf(this,arguments,void 0,(function(t,e,n){var r,o,i,s,a;return void 0===n&&(n={}),uf(this,(function(l){switch(l.label){case 0:return this.lastEl=t.el,o=(r=this).customRte,i=r.em,s=t.getChildrenContainer(),this.toolbar.style.display="",[4,o?o.enable(s,e):this.initRte(s).enable(n)];case 1:return a=l.sent(),i&&(setTimeout(this.updatePosition.bind(this),0),i.off(pf,this.updatePosition,this),i.on(pf,this.updatePosition,this),i.trigger("rte:enable",t,a)),this.model.set({currentView:t}),[2,a]}}))}))},e.prototype.getContent=function(t,e){return cf(this,void 0,void 0,(function(){var n;return uf(this,(function(r){switch(r.label){case 0:return(n=this.customRte)&&e&&(0,J.isFunction)(n.getContent)?[4,n.getContent(t.el,e)]:[3,2];case 1:return[2,r.sent()];case 2:return[2,t.getChildrenContainer().innerHTML]}}))}))},e.prototype.hideToolbar=function(){var t=this.toolbar.style,e="-1000px";t.top=e,t.left=e,t.display="none"},e.prototype.disable=function(t,e,n){void 0===n&&(n={});var r=this.em,o=this.customRte,i=t.getChildrenContainer();o?o.disable(i,e):e&&e.disable(),this.hideToolbar(),r&&(r.off(pf,this.updatePosition,this),!n.fromMove&&r.trigger("rte:disable",t,e)),this.model.unset("currentView")},e}(dt);const hf=ff,gf={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 vf=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mf=function(){return mf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},mf.apply(this,arguments)},yf=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},bf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vf(e,t),e.getDefaults=function(){return(0,J.result)(this.prototype,"defaults")},e.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}},e.prototype.initialize=function(t,n){void 0===t&&(t={}),void 0===n&&(n={}),this.em=n.em;var r=this.getId()||"",o=this.get("name")||this.get("label")||"";!this.get("property")&&this.set("property",(o||r).replace(/ /g,"-"));var i=this.get("property");!this.get("id")&&this.set("id",i),!o&&this.set("name",(0,Z.capitalize)(i).replace(/-/g," ")),this.on("change",this.__upTargets),e.callInit(this,t,n)},e.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},e.prototype.__upTargets=function(t,e){var n,r=this;void 0===e&&(e={});var o=this.em.Styles,i=this.getName(),s=e.__clear,a=s?"":this.__getFullValue(e),l=this.__getParentProp(),c=this.changedAttributes(),u=(0,J.keys)(c).reduce((function(t,e){return t[e]=r.previous(e),t}),{}),p=yf(yf([],(0,J.keys)(this.__getClearProps()),!0),["__p"],!1),d=(0,J.keys)(c),f=!e.__up&&!l&&(s||p.some((function(t){return d.indexOf(t)>=0}))),h=this.get("onChange"),g={property:this,from:u,to:c,value:a,opts:e};o.__trgEv(o.events.propertyUpdate,g),h&&h(g),f&&this.__upTargetsStyle(((n={})[i]=a,n),e)},e.prototype.__upTargetsStyle=function(t,e){var n,r=null===(n=this.em)||void 0===n?void 0:n.get("StyleManager");null==r||r.addStyleTargets(mf(mf({},t),{__p:!!e.avoidStore}),e)},e.prototype._up=function(t,e){void 0===e&&(e={}),e.noTarget&&(e.__up=!0);var n=e.partial,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["partial"]);return t.__p=!(!r.avoidStore&&!n),this.set(t,mf(mf({},r),{avoidStore:t.__p}))},e.prototype.up=function(t,e){void 0===e&&(e={}),this.set(t,mf(mf({},e),{__up:!0}))},e.prototype.init=function(){},e.prototype.getId=function(){return this.get("id")},e.prototype.getType=function(){return this.get("type")},e.prototype.getName=function(){return this.get("property")},e.prototype.getLabel=function(t){var e;void 0===t&&(t={});var n=t.locale,r=void 0===n||n,o=this.getId(),i=this.get("name")||this.get("label");return r&&(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.properties.".concat(o)))||i},e.prototype.getValue=function(t){void 0===t&&(t={});var e=t.noDefault,n=this.get("value");return this.hasValue()||e?n:this.getDefaultValue()},e.prototype.hasValue=function(t){void 0===t&&(t={});var e=t.noParent&&this.getParentTarget(),n=this.get("value");return!(0,J.isUndefined)(n)&&""!==n&&!e},e.prototype.hasValueParent=function(){return this.hasValue()&&!this.hasValue({noParent:!0})},e.prototype.getStyle=function(t){var e;void 0===t&&(t={});var n=this.getName();return(e={})[t.camelCase?(0,Z.camelCase)(n):n]=this.__getFullValue(t),e},e.prototype.getDefaultValue=function(){var t=this.get("default");return"".concat((0,J.isUndefined)(t)?this.get("defaults"):t)},e.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)},e.prototype.isVisible=function(){return!!this.get("visible")},e.prototype.clear=function(t){return void 0===t&&(t={}),this._up(this.__getClearProps(),mf(mf({},t),{__clear:!0})),this},e.prototype.canClear=function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})},e.prototype.getParent=function(){return this.__getParentProp()},e.prototype.isFull=function(){return!!this.get("full")},e.prototype.__parseValue=function(t,e){return this.parseValue(t,e)},e.prototype.__getClearProps=function(){return{value:""}},e.prototype.setValue=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n={});var r=this.parseValue(t),o=!e;!o&&this.set({value:void 0},{avoidStore:o,silent:!0}),this.set(r,mf({avoidStore:o},n))},e.prototype.setValueFromInput=function(t,e,n){void 0===n&&(n={}),this.setValue(t,e,mf(mf({},n),{fromInput:1}))},e.prototype.parseValue=function(t,e){void 0===e&&(e={});var n={value:t},r="!important",o=this.get("functionName")||"";if((0,J.isString)(t)&&-1!==t.indexOf(r)&&(n.value=t.replace(r,"").trim(),n.important=!0),!o&&!e.complete)return n;var i=[],s="".concat(n.value).trim(),a=s.indexOf("(")+1,l=o||s.substring(0,a-1);if(l&&(n.functionName=l),!o||0===s.indexOf("".concat(o,"("))){var c=s.lastIndexOf(")");i.push(a),c>=0&&i.push(c),n.value=String.prototype.substring.apply(s,i)}if(e.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,""),n.value=u}return n},e.prototype.__getFullValue=function(t){var e=(void 0===t?{}:t).withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()},e.prototype.getFullValue=function(t,e){void 0===e&&(e={});var n=this.get("functionName"),r=this.getDefaultValue(),o=(0,J.isUndefined)(t)?this.get("value"):t,i=!(0,J.isUndefined)(o)&&""!==o;if(o&&r&&o===r)return r;if(n&&i){var s="url"===n?"'".concat(o.replace(/'|"/g,""),"'"):o;o="".concat(n,"(").concat(s,")")}return i&&this.get("important")&&!e.skipImportant&&(o="".concat(o," !important")),o||""},e.prototype.__setParentTarget=function(t){this.up({parentTarget:t})},e.prototype.getParentTarget=function(){return this.get("parentTarget")||null},e.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()}},e.prototype.__checkVisibility=function(t){var e=t.target,n=t.component,r=t.sectors,o=n||e;if(!o)return!1;var i=this.getId(),s=this.getName(),a=this.get("toRequire"),l=this.get("requires"),c=this.get("requiresParent"),u=o.get("unstylable"),p=o.get("stylable-require"),d=o.get("stylable");if((0,J.isArray)(d)&&(d=d.indexOf(s)>=0),(0,J.isArray)(u)&&(d=u.indexOf(s)<0),a&&(d=!e||p&&(p.indexOf(i)>=0||p.indexOf(s)>=0)),r&&l){var f=(0,J.keys)(l);r.forEach((function(t){t.getProperties().forEach((function(t){if((0,J.includes)(f,t.id)){var e=l[t.id];d=d&&(0,J.includes)(e,t.get("value"))}}))}))}if(c){var h=n&&n.parent(),g=h&&h.getEl();if(g){var v=(0,Z.hasWin)()?window.getComputedStyle(g):{};(0,J.each)(c,(function(t,e){d=d&&v[e]&&(0,J.includes)(t,v[e])}))}else d=!1}return!!d},e}(ot.Kx);const wf=bf;bf.callParentInit=function(t,e,n,r){void 0===r&&(r={}),t.prototype.initialize.apply(e,[n,mf(mf({},r),{skipInit:1})])},bf.callInit=function(t,e,n){void 0===n&&(n={}),!n.skipInit&&t.init(e,n)};var _f=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xf=function(){return xf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},xf.apply(this,arguments)},Cf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _f(e,t),e.prototype.defaults=function(){return{values:{}}},e.prototype.initialize=function(){var t=this.collection;this.prop=null==t?void 0:t.prop},e.prototype.getId=function(){return this.cid},e.prototype.getIndex=function(){var t=this.collection;return t?t.indexOf(this):-1},e.prototype.getValues=function(t){void 0===t&&(t={});var e=this.get("values");return t.camelCase?Object.keys(e).reduce((function(t,n){return t[(0,Z.camelCase)(n)]=e[n],t}),{}):e},e.prototype.getLabel=function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.getLayerLabel(this)},e.prototype.isSelected=function(){var t;return(null===(t=this.prop)||void 0===t?void 0:t.getSelectedLayer())===this},e.prototype.select=function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.selectLayer(this)},e.prototype.remove=function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.removeLayer(this)},e.prototype.move=function(t){var e;return null===(e=this.prop)||void 0===e?void 0:e.moveLayer(this,t)},e.prototype.getStylePreview=function(t){var e;return void 0===t&&(t={}),null===(e=this.prop)||void 0===e?void 0:e.getStylePreview(this,t)},e.prototype.hasPreview=function(){var t;return!!(null===(t=this.prop)||void 0===t?void 0:t.get("preview"))},e.prototype.upValues=function(t){return void 0===t&&(t={}),this.set("values",xf(xf({},this.getValues()),t))},e}(ot.Kx);const Sf=Cf;var Tf=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Of=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Tf(e,t),e.prototype.initialize=function(t,e){void 0===e&&(e={}),this.prop=e.prop},e}(ot.pM);const Af=Of;Of.prototype.model=Sf;var Ef=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kf=function(){return kf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},kf.apply(this,arguments)},Pf=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},jf=function(t){return"integer"===t||"number"===t},Mf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ef(e,t),e.prototype.defaults=function(){return kf(kf({},wf.getDefaults()),{detached:!1,properties:[],separator:" ",join:null,fromStyle:null,toStyle:null,full:!0})},e.prototype.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),wf.callParentInit(wf,this,t,e);var n=this.em,r=new Uh(this.get("properties")||[],{em:n,parentProp:this});this.set("properties",r,{silent:!0}),this.listenTo(r,"change",this.__upProperties),wf.callInit(this,t,e)},Object.defineProperty(e.prototype,"properties",{get:function(){return this.get("properties")||[]},enumerable:!1,configurable:!0}),e.prototype.getProperties=function(){return Pf([],this.get("properties").models,!0)},e.prototype.getProperty=function(t){return this.properties.filter((function(e){return e.getId()===t||e.getName()===t}))[0]},e.prototype.getPropertyAt=function(t){return this.get("properties").at(t)},e.prototype.isDetached=function(){return!!this.get("detached")},e.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}),{})},e.prototype.getSeparator=function(){return this.getSplitSeparator()},e.prototype.getJoin=function(){return this.__getJoin()},e.prototype.getStyleFromProps=function(t){var e;void 0===t&&(t={});var n=this.getName(),r=this.__getJoin(),o=this.get("toStyle"),i=this.getValues(),s={};if(o)s=o(i,{join:r,name:n,property:this});else if(i=this.getValues({byName:!0}),this.isDetached())s=i;else{var a=this.getProperties().map((function(t){return t.__getFullValue({withDefault:1})})).filter(Boolean).join(r);(e={})[n]=a,s=e}return this.isDetached()?s[n]="":(s[n]=s[n]||"",s=kf(kf({},s),this.getProperties().reduce((function(t,e){return t[e.getName()]="",t}),{}))),t.camelCase?Object.keys(s).reduce((function(t,e){return t[(0,Z.camelCase)(e)]=s[e],t}),{}):s},e.prototype.getSplitSeparator=function(){return new RegExp("".concat(this.get("separator"),"(?![^\\(]*\\))"))},e.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)}},e.prototype.__upTargetsStyleProps=function(t,e){var n;void 0===t&&(t={});var r=this.getStyleFromProps();if(this.isDetached()&&e){var o=e.getName();(n={})[o]=r[o],r=n}this.__upTargetsStyle(r,t)},e.prototype._up=function(t,e){return void 0===e&&(e={}),this.__setProperties(this.__getSplitValue(t.value),e),wf.prototype._up.call(this,t,e),this},e.prototype.getStyle=function(t){return this.getStyleFromProps(t)},e.prototype.__getFullValue=function(t){if(void 0===t&&(t={}),this.isDetached()||t.__clear)return"";var e=this.getStyleFromProps()[this.getName()]||"";return Ne(e)},e.prototype.__getJoin=function(){var t=this.get("join");return(0,J.isString)(t)?t:this.get("separator")},e.prototype.__styleHasProps=function(t){void 0===t&&(t={});var e=this.getName(),n=this.getProperties().map((function(t){return t.getName()}));return Pf([e],n,!0).some((function(e){return!(0,J.isUndefined)(t[e])&&""!==t[e]}))},e.prototype.__splitValue=function(t,e){return Ne(t).split(e).map((function(t){return t.trim()})).filter(Boolean)},e.prototype.__splitStyleName=function(t,e,n){return this.__splitValue(t[e]||"",n)},e.prototype.__getSplitValue=function(t,e){void 0===t&&(t="");var n=(void 0===e?{}:e).byName,r=this.getProperties(),o=4===r.length&&r.every((function(t){return jf(t.getType())})),i=this.__splitValue(t,this.getSplitSeparator()),s={};return r.forEach((function(t,e){var r=i[e],a=(0,J.isUndefined)(r)?"":r;if(o){var l=i.length;a=i[e]||i[e%l+(1!=l&&l%2?1:0)]||a}var c=n?t.getName():t.getId();s[c]=a||""})),s},e.prototype.__getPropsFromStyle=function(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!this.__styleHasProps(t))return null;var n=e.byName,r=this.getName(),o=this.getProperties(),i=this.getSplitSeparator(),s=this.get("fromStyle"),a=s?s(t,{property:this,name:r,separator:i}):{};return s||(a=this.__getSplitValue(t[r]||"",{byName:n}),o.forEach((function(e){var r=t[e.getName()],o=n?e.getName():e.getId();(0,J.isUndefined)(r)||""===r||(a[o]=r)}))),a},e.prototype.__setProperties=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.getProperties().forEach((function(n){var r=t[n.getId()];n.__getFullValue()!==r&&n.upValue(r,e)}));var n=(0,J.keys)(t).map((function(e){return t[e]})).join(" ");this.set("value",n,{silent:!0})},e.prototype.clear=function(){var t=this;return this.getProperties().map((function(e){return e.clear({__clearIn:!t.isDetached()})})),wf.prototype.clear.call(this),this},e.prototype.hasValue=function(t){return this.getProperties().some((function(e){return e.hasValue(t)}))},e.prototype.getFullValue=function(){return this.__getFullValue()},e.prototype.__canClearProp=function(t){return this.isDetached()&&t.hasValue({noParent:!0})},e}(wf);const Nf=Mf;var Lf=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),If=function(){return If=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},If.apply(this,arguments)},$f=/,(?![^\(]*\))/,Df=/\s(?![^(]*\))/,Rf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Lf(e,t),e.prototype.defaults=function(){return If(If({},Nf.getDefaults()),{layers:[],emptyValue:"unset",layerSeparator:", ",layerJoin:"",prepend:0,preview:!1,layerLabel:null,selectedLayer:null})},e.prototype.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Nf.callParentInit(Nf,this,t,e);var n=this.get("layers"),r=new Af(n,{prop:this});r.property=this,r.properties=this.get("properties"),this.set("layers",r,{silent:!0}),this.on("change:selectedLayer",this.__upSelected),this.listenTo(r,"add remove",this.__upLayers),Nf.callInit(this,t,e)},Object.defineProperty(e.prototype,"layers",{get:function(){return this.get("layers")},enumerable:!1,configurable:!0}),e.prototype.getLayers=function(){return this.layers.models},e.prototype.hasLayers=function(){return this.getLayers().length>0},e.prototype.getLayer=function(t){return void 0===t&&(t=0),this.layers.at(t)||void 0},e.prototype.getSelectedLayer=function(){var t=this.get("selectedLayer");return t&&t.getIndex()>=0?t:void 0},e.prototype.selectLayer=function(t){return this.set("selectedLayer",t,{__select:!0})},e.prototype.selectLayerAt=function(t){void 0===t&&(t=0);var e=this.getLayer(t);return e&&this.selectLayer(e)},e.prototype.moveLayer=function(t,e){void 0===e&&(e=0);var n=this.layers,r=t?t.getIndex():-1;r>=0&&(0,J.isNumber)(e)&&e>=0&&e<n.length&&r!==e&&(this.removeLayer(t),n.add(t,{at:e}))},e.prototype.addLayer=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={};return this.getProperties().forEach((function(e){var r=e.getId(),o=t[r];n[r]=(0,J.isUndefined)(o)?e.getDefaultValue():o})),this.layers.push({values:n},e)},e.prototype.removeLayer=function(t){return this.layers.remove(t)},e.prototype.removeLayerAt=function(t){void 0===t&&(t=0);var e=this.getLayer(t);return e?this.removeLayer(e):null},e.prototype.getLayerLabel=function(t){var e="";if(t){var n=this.get("layerLabel"),r=t.getValues(),o=t.getIndex();if(n)e=n(t,{index:o,values:r,property:this});else{var i=[];this.getProperties().map((function(t){i.push(r[t.getId()])})),e=i.filter(Boolean).join(" ")}}return e},e.prototype.getStyleFromLayer=function(t,e){var n;void 0===e&&(e={});var r,o=this.__getJoin(),i=this.__getJoinLayers(),s=this.get("toStyle"),a=this.getName(),l=t.getValues();if(s)r=s(l,{join:o,joinLayers:i,name:a,layer:t,property:this});else{var c=this.getProperties().map((function(t){var n=t.getName(),r=l[t.getId()],o=(0,J.isUndefined)(r)?t.getDefaultValue():r;if(e.number&&jf(t.getType())){var i=t.parseValue(r,e.number);o="".concat(i.value).concat(i.unit)}return{name:n,value:o}}));r=this.isDetached()?c.reduce((function(t,e){return t[e.name]=e.value,t}),{}):((n={})[this.getName()]=c.map((function(t){return t.value})).join(o),n)}return e.camelCase?Object.keys(r).reduce((function(t,e){return t[(0,Z.camelCase)(e)]=r[e],t}),{}):r},e.prototype.getStylePreview=function(t,e){void 0===e&&(e={});var n={};return this.get("preview")&&(n=this.getStyleFromLayer(t,e)),n},e.prototype.getLayerSeparator=function(){var t=this.get("layerSeparator");return(0,J.isString)(t)?new RegExp("".concat(t,"(?![^\\(]*\\))")):t},e.prototype.hasEmptyValue=function(){return!this.hasLayers()&&!!this.attributes.isEmptyValue},e.prototype.__upProperties=function(t,e){var n;void 0===e&&(e={});var r=this.getSelectedLayer();r&&(r.upValues(((n={})[t.getId()]=t.__getFullValue(),n)),e.__up||this.__upTargetsStyleProps(e))},e.prototype.__upLayers=function(t,e,n){this.__upTargetsStyleProps(n||e)},e.prototype.__upTargets=function(t,e){if(void 0===e&&(e={}),!e.__select)return wf.prototype.__upTargets.call(this,t,e)},e.prototype.__upTargetsStyleProps=function(t){void 0===t&&(t={}),this.__upTargetsStyle(this.getStyleFromLayers(t),t)},e.prototype.__upTargetsStyle=function(t,e){return wf.prototype.__upTargetsStyle.call(this,t,e)},e.prototype.__upSelected=function(t,e){var n=(void 0===t?{}:t).noEvent;void 0===e&&(e={});var r=this.em.Styles,o=this.getSelectedLayer(),i=null==o?void 0:o.getValues();i&&this.getProperties().forEach((function(t){var n,r=null!==(n=i[t.getId()])&&void 0!==n?n:"";t.__getFullValue()!==r&&t.upValue(r,If(If({},e),{__up:!0}))})),!n&&r.__trgEv(r.events.layerSelect,{property:this})},e.prototype._up=function(t,e){void 0===e&&(e={});var n=t.__layers,r=void 0===n?[]:n,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["__layers"]);return!this.isDetached()&&this.__setLayers(r),this.__upSelected({noEvent:!0},e),wf.prototype._up.call(this,o,e),this},e.prototype.__setLayers=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={});var n=this.layers,r=t.map((function(t){return{values:t}}));n.length===r.length?r.map((function(t,e){var r;return null===(r=n.at(e))||void 0===r?void 0:r.upValues(t.values)})):n.reset(r),this.set({isEmptyValue:!!e.isEmptyValue}),this.__upSelected({noEvent:!0})},e.prototype.__parseValue=function(t){var e=this,n=this.parseValue(t);return n.__layers=t.split($f).map((function(t){return t.trim()})).map((function(t){return e.__parseLayer(t)})).filter(Boolean),n},e.prototype.__parseLayer=function(t){var e=this.get("parseLayer"),n=t.split(Df),r=this.getProperties();return e?e({value:t,values:n}):r.reduce((function(t,e,r){var o=n[r];return t[e.getId()]=(0,J.isUndefined)(o)?e.getDefaultValue():o,t}),{})},e.prototype.__getLayersFromStyle=function(t){var e=this;if(void 0===t&&(t={}),!this.__styleHasProps(t))return null;if(this.isEmptyValueStyle(t))return[];var n=this.getName(),r=this.getProperties(),o=this.getLayerSeparator(),i=this.attributes.fromStyle,s=i?i(t,{property:this,name:n,separatorLayers:o}):[];if(!i){var a=this.__splitStyleName(t,n,o).map((function(t){return t.split(e.getSplitSeparator())})).map((function(t){var e={};return r.forEach((function(n,r){var o=t[r];e[n.getId()]=(0,J.isUndefined)(o)?n.getDefaultValue():o})),e}));r.forEach((function(n){var r=n.getId();e.__splitStyleName(t,n.getName(),o).map((function(t){var e;return(e={})[r]=t||n.getDefaultValue(),e})).forEach((function(t,e){a[e]=a[e]?If(If({},a[e]),t):t}))})),s=a}return(0,J.isArray)(s)?s:[s]},e.prototype.getStyle=function(t){return void 0===t&&(t={}),this.getStyleFromLayers(t)},e.prototype.getStyleFromLayers=function(t){var e=this;void 0===t&&(t={});var n={},r=this.getName(),o=this.getLayers(),i=this.getProperties(),s=o.map((function(n){return e.getStyleFromLayer(n,t)}));if(s.forEach((function(t){(0,J.keys)(t).map((function(e){n[e]||(n[e]=[]),n[e].push(t[e])}))})),(0,J.keys)(n).map((function(t){n[t]=n[t].join(e.__getJoinLayers())})),this.isDetached())n[r]="",!o.length&&i.map((function(t){n[t.getName()]=""}));else{var a=i.reduce((function(t,e){return t[e.getName()]="",t}),{});n[r]=n[r]||"",n=If(If({},n),a)}return If(If({},n),t.__clear?{}:this.getEmptyValueStyle())},e.prototype.isEmptyValueStyle=function(t){void 0===t&&(t={});var e=this.getEmptyValueStyle({force:!0}),n=(0,J.keys)(e);return!!n.length&&n.every((function(n){return e[n]===t[n]}))},e.prototype.getEmptyValueStyle=function(t){void 0===t&&(t={});var e=this.attributes.emptyValue;if(!e||this.hasLayers()&&!t.force)return{};var n=this.getName(),r=this.getProperties(),o=(0,J.isString)(e)?e:e({property:this});if((0,J.isString)(o)){var i={};return this.isDetached()?r.map((function(t){i[t.getName()]=o})):i[n]=o,i}return o},e.prototype.__getJoinLayers=function(){var t=this.get("layerJoin"),e=this.get("layerSeparator");return t||((0,J.isString)(e)?e:t)},e.prototype.__getFullValue=function(){if(this.get("detached"))return"";var t=this.getStyleFromLayers();return Ne(t[this.getName()])},e.prototype.hasValue=function(t){void 0===t&&(t={});var e=t.noParent&&this.getParentTarget();return(this.hasLayers()||this.hasEmptyValue())&&!e},e.prototype.clear=function(t){return void 0===t&&(t={}),this.layers.reset(),this.__upTargetsStyleProps(If(If({},t),{__clear:!0})),wf.prototype.clear.call(this),this},e.prototype.__canClearProp=function(){return!1},e.prototype.__getLayers=function(){return this.layers},e}(Nf);const Hf=Rf;var Ff=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vf=function(){return Vf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Vf.apply(this,arguments)},Uf="data-clear-style",Bf=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;(0,J.bindAll)(n,"__change","__updateStyle");var r=e.config||{},o=r.em;n.config=r,n.em=o,n.pfx=r.stylePrefix||"",n.ppfx=r.pStylePrefix||"",n.__destroyFn=n.destroy?n.destroy.bind(n):function(){};var i=n.model;i.view=n,n.onValueChange=(0,J.debounce)(n.onValueChange.bind(n),10),n.updateStatus=(0,J.debounce)(n.updateStatus.bind(n),0),n.listenTo(i,"destroy remove",n.remove),n.listenTo(i,"change:visible",n.updateVisibility),n.listenTo(i,"change:name change:className change:full",n.render),n.listenTo(i,"change:value",n.onValueChange),n.listenTo(i,"change:parentTarget",n.updateStatus),n.listenTo(o,"change:device",n.onValueChange);var s=n.init&&n.init.bind(n);return s&&s(),n}return Ff(e,t),e.prototype.events=function(){var t;return(t={change:"inputValueChanged"})["click [".concat(Uf,"]")]="clear",t},e.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 ')},e.prototype.templateLabel=function(t){var e=this.pfx,n=this.em,r=t.parent,o=t.attributes,i=o.icon,s=void 0===i?"":i,a=o.info,l=void 0===a?"":a,c=null==n?void 0:n.getConfig().icons,u=(null==c?void 0:c.close)||"";return'\n <span class="'.concat(e,"icon ").concat(s,'" title="').concat(l,'">\n ').concat(t.getLabel(),"\n </span>\n ").concat(r?"":'<div class="'.concat(e,'clear" style="display: none" ').concat(Uf,">").concat(u,"</div>"),"\n ")},e.prototype.templateInput=function(t){return'\n <div class="'.concat(this.ppfx,'field">\n <input placeholder="').concat(t.getDefaultValue(),'"/>\n </div>\n ')},e.prototype.remove=function(){var t=this;return ot.Ss.prototype.remove.apply(this,arguments),["em","input","$input","view"].forEach((function(e){return t[e]=null})),this.__destroyFn(this._getClbOpts()),this},e.prototype.updateStatus=function(){var t,e=this,n=e.model,r=e.pfx,o=e.ppfx,i=e.config,s="".concat(o,"four-color"),a="".concat(o,"color-warn"),l=this.$el.children(".".concat(r,"label")),c=this.getClearEl(),u=c?c.style:{};l.removeClass("".concat(s," ").concat(a)),u.display="none",n.hasValue({noParent:!0})&&i.highlightChanged?(l.addClass(s),i.clearProperties&&(u.display="")):n.hasValue()&&i.highlightComputed&&l.addClass(a),null===(t=this.parent)||void 0===t||t.updateStatus()},e.prototype.clear=function(t){t&&t.stopPropagation(),this.model.clear()},e.prototype.getClearEl=function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(Uf,"]"))),this.clearEl},e.prototype.inputValueChanged=function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)},e.prototype.onValueChange=function(t,e,n){void 0===n&&(n={}),this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},e.prototype.setValue=function(t){var e=this.model,n=(0,J.isUndefined)(t)||""===t?e.getDefaultValue():t;if(this.update)return this.__update(n);this.__setValueInput(n)},e.prototype.__setValueInput=function(t){var e=this.getInputEl();e&&(e.value=t)},e.prototype.getInputEl=function(){return this.input||(this.input=this.el.querySelector("input")),this.input},e.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},e.prototype.clearCached=function(){delete this.clearEl,delete this.input,delete this.$input},e.prototype.__unset=function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())},e.prototype.__update=function(t){var e=this.update&&this.update.bind(this);e&&e(Vf(Vf({},this._getClbOpts()),{value:t}))},e.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,function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([this._getClbOpts()],t,!1))},e.prototype.__updateStyle=function(t,e){void 0===e&&(e={});var n=e.complete,r=e.partial,o=(function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}}(e,["complete","partial"]),this.model),i=!1!==n&&!0!==r;(0,Z.isObject)(t)?o.__upTargetsStyle(t,{avoidStore:!i}):o.upValue(t,{partial:!i})},e.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}},e.prototype.render=function(){this.clearCached();var t=this,e=t.pfx,n=t.model,r=t.el,o=t.$el,i=n.getName(),s=n.getType(),a=n.get("className")||"",l="".concat(e,"property"),c="number"===s?"".concat(e).concat(s," ").concat(e,"integer"):"".concat(e).concat(s);this.createdEl&&this.__destroyFn(this._getClbOpts()),o.empty().append(this.template(n)),o.find("[data-sm-label]").append(this.templateLabel(n));var u=this.create&&this.create.bind(this);this.createdEl=u&&u(this._getClbOpts()),o.find("[data-sm-fields]").append(this.createdEl||this.templateInput(n)),r.className="".concat(l," ").concat(c," ").concat(l,"__").concat(i," ").concat(a).trim(),r.className+=n.isFull()?" ".concat(l,"--full"):"";var p=this.onRender&&this.onRender.bind(this);return p&&p(),this.setValue(n.getValue()),this},e.prototype.onRender=function(){},e}(ot.Ss);const zf=Bf;var Wf=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qf=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 r=n.collection;return n.listenTo(r,"add",n.addTo),n.listenTo(r,"reset",n.render),n}return Wf(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 r=this.parent,o=this.config,i=e||this.el,s=new t.typeView({model:t,config:o});r&&(s.parent=r),s.render();var a=s.el;this.properties.push(s),(0,fe.Sc)(i,a,n.at)},e.prototype.remove=function(){return ot.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 r=document.createDocumentFragment();return this.collection.forEach((function(e){return t.add(e,r)})),e.empty(),e.append(r),e.attr("class","".concat(n,"properties")),this},e}(ot.Ss);const Gf=qf;var Kf=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yf=function(){return Yf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Yf.apply(this,arguments)},Xf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Kf(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(),zf.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 r=e.isDetached(),o=new Gf({config:Yf(Yf({},this.config),{highlightComputed:r,highlightChanged:r}),collection:n,parent:this});o.render(),this.$el.find("#".concat(t,"input-holder")).append(o.el),this.props=o}},e.prototype.clearCached=function(){zf.prototype.clearCached.apply(this,arguments),delete this.props},e}(zf);const Jf=Xf;var Zf=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Zf(e,t),e.prototype.events=function(){return{click:"select","click [data-close-layer]":"removeItem","mousedown [data-move-layer]":"initSorter","touchstart [data-move-layer]":"initSorter"}},e.prototype.template=function(){var t=this,e=t.pfx,n=t.ppfx,r=t.em,o=null==r?void 0:r.getConfig().icons,i=(null==o?void 0:o.close)||"",s=(null==o?void 0:o.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(s,'\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 ')},e.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 r=this.propertyView.model;this.listenTo(e,"destroy remove",this.remove),this.listenTo(e,"change:values",this.updateLabel),this.listenTo(r,"change:selectedLayer",this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data("model",e)},e.prototype.initSorter=function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)},e.prototype.removeItem=function(t){t&&t.stopPropagation(),this.model.remove()},e.prototype.select=function(){this.model.select()},e.prototype.getPropertiesWrapper=function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector("[data-properties]")),this.propsWrapEl},e.prototype.getPreviewEl=function(){return this.previewEl||(this.previewEl=this.el.querySelector("[data-preview]")),this.previewEl},e.prototype.getLabelEl=function(){return this.labelEl||(this.labelEl=this.el.querySelector("[data-label]")),this.labelEl},e.prototype.updateLabel=function(){var t=this.model,e=t.getLabel();if(this.getLabelEl().innerHTML=e,t.hasPreview()){var n=this.getPreviewEl(),r=t.getStylePreview({number:{min:-3,max:3}}),o=(0,J.keys)(r).map((function(t){return"".concat(t,":").concat(r[t])})).join(";");n.setAttribute("style",o)}},e.prototype.updateVisibility=function(){var t,e=this,n=e.pfx,r=e.model,o=e.propertyView,i=this.getPropertiesWrapper(),s=r.isSelected();i.style.display=s?"":"none",this.$el[s?"addClass":"removeClass"]("".concat(n,"active")),s&&i.appendChild(null===(t=o.props)||void 0===t?void 0:t.el)},e.prototype.render=function(){var t=this,e=t.el,n=t.pfx,r=t.model;return e.innerHTML=this.template(),e.className="".concat(n,"layer"),r.hasPreview()&&(e.querySelector("[data-preview-box]").style.display=""),this.updateLabel(),this.updateVisibility(),this},e}(ot.Ss);const th=Qf;var eh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nh=function(t){function e(e){var n=t.call(this,e)||this,r=n.collection,o=e.config||{},i=o.em,s=o.stylePrefix||"",a=o.pStylePrefix||"";n.config=o,n.pfx=s,n.ppfx=a,n.propertyView=e.propertyView,n.className="".concat(s,"layers ").concat(a,"field"),n.listenTo(r,"add",n.addTo),n.listenTo(r,"reset",n.reset),n.items=[];var l=null==i?void 0:i.Utils;return n.sorter=l?new l.Sorter({container:n.el,ignoreViewChildren:1,containerSel:".".concat(s,"layers"),itemSel:".".concat(s,"layer"),pfx:o.pStylePrefix,em:i}):"",r.view=n,n.$el.data("model",r),n.$el.data("collection",r),n}return eh(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 r=e||null,o=this,i=o.propertyView,s=o.config,a=o.sorter,l=o.$el,c=new th({model:t,config:s,sorter:a,propertyView:i}),u=c.render().el;if(this.items.push(c),r)r.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(),ot.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=this.sorter,r=document.createDocumentFragment();return e.empty(),this.collection.forEach((function(e){return t.addToCollection(e,r)})),e.append(r),e.attr("class",this.className),n&&(n.plh=null),this},e}(ot.Ss);const rh=nh;var oh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ih=function(){return ih=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ih.apply(this,arguments)},sh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oh(e,t),e.prototype.events=function(){return ih(ih({},Jf.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,r=(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(r,"\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(),Jf.prototype.remove.apply(this,arguments),this},e.prototype.clearCached=function(){Jf.prototype.clearCached.apply(this,arguments),delete this.layersView},e.prototype.onRender=function(){var t=this,e=t.model,n=t.el,r=t.config,o=e.get("properties");if(o.length&&!this.props){var i=new Gf({config:ih(ih({},r),{highlightComputed:!1,highlightChanged:!1}),collection:o,parent:this});i.render();var s=new rh({collection:e.layers,config:r,propertyView:this});s.render(),n.querySelector("[data-layers-wrapper]").appendChild(s.el),this.props=i,this.layersView=s}},e}(Jf);const ah=sh;var lh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ch=function(){return ch=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ch.apply(this,arguments)},uh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return lh(e,t),e.prototype.events=function(){return ch(ch({},zf.prototype.events()),{"click [data-clear-asset]":"clear","click [data-open-assets]":"openAssetManager"})},e.prototype.templateInput=function(){var t,e=this.pfx,n=this.em,r=null===(t=this.em)||void 0===t?void 0:t.getConfig().icons,o=null==r?void 0:r.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(o,"</div>\n </div>\n </div>\n ")},e.prototype.__setValueInput=function(t){var e=this.model,n=this.el,r=e.getDefaultValue(),o=n.querySelector("[data-preview-box]"),i=n.querySelector("[data-preview]");o.style.display=t&&t!==r?"":"none",i.style.backgroundImage=t||e.getDefaultValue()},e.prototype.openAssetManager=function(){var t,e=this,n=null===(t=this.em)||void 0===t?void 0:t.Assets;null==n||n.open({select:function(t,r){var o=(0,J.isString)(t)?t:t.get("src");e.model.upValue(o,{partial:!r}),r&&n.close()},types:["image"],accept:"image/*"})},e}(zf);const ph=uh;var dh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return dh(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,r=t.el;if(!this.inputInst){var o=n.input;o.ppfx=e,o.render(),r.querySelector(".".concat(e,"fields")).appendChild(o.el),this.input=o.inputEl.get(0),this.inputInst=o}},e.prototype.clearCached=function(){zf.prototype.clearCached.apply(this,arguments),this.inputInst=null},e}(zf);const hh=fh;var gh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return gh(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;hh.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,r=e.model,o=e.em,i=e.el,s=new Hl({target:o,model:r,ppfx:n,onChange:this.__handleChange}).render();i.querySelector(".".concat(n,"fields")).appendChild(s.el),this.input=null===(t=s.inputEl)||void 0===t?void 0:t.get(0),this.inputInst=s}},e}(hh);const mh=vh;var yh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bh=function(){return bh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},bh.apply(this,arguments)},wh=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},_h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return yh(e,t),e.prototype.defaults=function(){return bh(bh({},wf.getDefaults()),{options:[],full:0})},e.prototype.getOptions=function(){var t=this.attributes,e=t.options,n=t.list;return(e&&e.length?e:n)||[]},e.prototype.getOption=function(t){var e=this,n=(0,Z.isDef)(t)?t:this.getValue();return this.getOptions().filter((function(t){return e.getOptionId(t)===n}))[0]||null},e.prototype.setOptions=function(t){return void 0===t&&(t=[]),this.set("options",t),this},e.prototype.addOption=function(t){if(t){var e=this.getOptions();this.setOptions(wh(wh([],e,!0),[t],!1))}return this},e.prototype.getOptionId=function(t){return(0,Z.isDef)(t.id)?t.id:t.value},e.prototype.getOptionLabel=function(t,e){var n;void 0===e&&(e={});var r=e.locale,o=void 0===r||r,i=((0,J.isString)(t)?this.getOption(t):t)||{},s=this.getOptionId(i),a=i.label||i.name||s,l=e.property||this.getId();return o&&(null===(n=this.em)||void 0===n?void 0:n.t("styleManager.options.".concat(l,".").concat(s)))||a},e.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];wf.prototype.initialize.apply(this,t),this.listenTo(this,"change:options",this.__onOptionChange)},e.prototype.__onOptionChange=function(){this.set("list",this.get("options"))},e}(wf);const xh=_h;var Ch=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sh=function(t){function e(e){var n=t.call(this,e)||this;return n.listenTo(n.model,"change:options",n.updateOptions),n}return Ch(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 r=[];n.forEach((function(t){var n=e.getOptionId(t),o=e.getOptionLabel(n),i=t.style?t.style.replace(/"/g,"""):"",s=i?'style="'.concat(i,'"'):"",a=n.replace(/"/g,""");r.push('<option value="'.concat(a,'" ').concat(s,">").concat(o,"</option>"))}));var o=this.el.querySelector("#".concat(t,"input-holder"));o.innerHTML="<select>".concat(r.join(""),"</select>"),this.input=o.firstChild}},e.prototype.__setValueInput=function(t){var e=this.model,n=this.getInputEl(),r=e.getOptions()[0],o=r?e.getOptionId(r):"";n&&(n.value=t||o)},e}(zf);const Th=Sh;var Oh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ah=function(){return Ah=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ah.apply(this,arguments)};const Eh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oh(e,t),e.prototype.defaults=function(){return Ah(Ah({},xh.getDefaults()),{full:1})},e}(xh);var kh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ph=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return kh(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,r="".concat(e,"radio-item-label"),o=n.getName(),i=n.getOptions(),s="".concat(t,"radio ").concat(t,"radio-").concat(o),a=n.cid;if(!this.input){var l=[];i.forEach((function(i){var c=i.className?"".concat(i.className," ").concat(t,"icon ").concat(r):"",u=n.getOptionId(i),p="".concat(o,"-").concat(u,"-").concat(a),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(s,'" id="').concat(p,'" name="').concat(o,"-").concat(a,'" value="').concat(u,'" ').concat(h,'/>\n <label class="').concat(c||r,'" ').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,r=t||n.getDefaultValue(),o=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector('[value="'.concat(r,'"]'));o&&(o.checked=!0)},e}(Th);const jh=Ph;var Mh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nh=function(){return Nh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Nh.apply(this,arguments)},Lh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Mh(e,t),e.prototype.defaults=function(){return Nh(Nh({},wf.getDefaults()),{units:[],unit:"",min:"",max:"",step:1})},e.prototype.getUnits=function(){return this.get("units")||[]},e.prototype.getUnit=function(){return this.get("unit")},e.prototype.getMin=function(){return this.get("min")},e.prototype.getMax=function(){return this.get("max")},e.prototype.getStep=function(){return this.get("step")},e.prototype.upUnit=function(t,e){return void 0===e&&(e={}),this._up({unit:t},e)},e.prototype.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),wf.callParentInit(wf,this,t,e);var n=this.get("unit"),r=this.getUnits();this.input=(0,Z.hasWin)()?new zl({model:this}):void 0,r.length&&!n&&this.set("unit",r[0],{silent:!0}),wf.callInit(this,t,e)},e.prototype.__getClearProps=function(){return Nh(Nh({},wf.prototype.__getClearProps()),{unit:""})},e.prototype.parseValue=function(t,e){void 0===e&&(e={});var n=wf.prototype.parseValue.apply(this,arguments),r=this.input.validateInputValue(n.value,Nh({deepCheck:1},e)),o=r.value,i=r.unit;return n.value=o,n.unit=i,n},e.prototype.getFullValue=function(){var t=this.get("value"),e=this.get("unit"),n=(0,J.isUndefined)(t)?"":"".concat(t),r=!(0,J.isUndefined)(e)&&n?e:"",o="".concat(n).concat(r);return wf.prototype.getFullValue.apply(this,[o])},e}(wf);const Ih=Lh;var $h=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dh=function(){return Dh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Dh.apply(this,arguments)};const Rh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $h(e,t),e.prototype.defaults=function(){return Dh(Dh({},Ih.getDefaults()),{showInput:1})},e}(Ih);var Hh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fh=function(){return Fh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Fh.apply(this,arguments)};const Vh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Hh(e,t),e.prototype.events=function(){return Fh(Fh({},hh.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),hh.prototype.setValue.apply(this,arguments)},e.prototype.onRender=function(){hh.prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},e.prototype.clearCached=function(){hh.prototype.clearCached.apply(this,arguments),delete this.slider},e}(hh),Uh=ot.pM.extend(ou).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:Hf,view:ah,isType:function(t){if(t&&"stack"==t.type)return t}},{id:"composite",model:Nf,view:Jf,isType:function(t){if(t&&"composite"==t.type)return t}},{id:"file",model:wf,view:ph,isType:function(t){if(t&&"file"==t.type)return t}},{id:"color",model:wf,view:mh,isType:function(t){if(t&&"color"==t.type)return t}},{id:"select",model:xh,view:Th,isType:function(t){if(t&&"select"==t.type)return t}},{id:"radio",model:Eh,view:jh,isType:function(t){if(t&&"radio"==t.type)return t}},{id:"slider",model:Rh,view:Vh,isType:function(t){if(t&&"slider"==t.type)return t}},{id:"integer",model:Ih,view:hh,isType:function(t){if(t&&"integer"==t.type)return t}},{id:"number",model:Ih,view:hh,isType:function(t){if(t&&"number"==t.type)return t}},{id:"base",model:wf,view:zf,isType:function(t){return t.type="base",t}}]});var Bh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zh=function(){return zh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},zh.apply(this,arguments)},Wh=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e)||this,o=n.em;r.em=o;var i=e||{},s=r.buildProperties(i.buildProps),a=r.get("name")||"",l=[];!r.get("id")&&r.set("id",a.replace(/ /g,"_").toLowerCase()),l=(l=s?r.extendProperties(s):r.get("properties").map((function(t){return(0,J.isString)(t)?r.buildProperties(t)[0]:t})).filter(Boolean)).map((function(t){return r.checkExtend(t)}));var c=new Uh(l,{em:o});return c.sector=r,r.set("properties",c),r}return Bh(e,t),e.prototype.defaults=function(){return{id:"",name:"",open:!0,visible:!0,extendBuilded:!0,properties:[]}},Object.defineProperty(e.prototype,"properties",{get:function(){return this.get("properties")},enumerable:!1,configurable:!0}),e.prototype.getId=function(){return this.get("id")},e.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")},e.prototype.setName=function(t){return this.set("name",t)},e.prototype.isOpen=function(){return!!this.get("open")},e.prototype.setOpen=function(t){return this.set("open",t)},e.prototype.isVisible=function(){return!!this.get("visible")},e.prototype.getProperties=function(t){void 0===t&&(t={});var e=this.properties;return(e.models?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([],e.models,!0):e).filter((function(e){var n=!0;return t.withValue&&(n=e.hasValue({noParent:!0})),t.withParentValue&&(n=!e.hasValue({noParent:!0})&&e.hasValue()),n}))},e.prototype.getProperty=function(t){return this.getProperties().filter((function(e){return e.get("id")===t}))[0]||void 0},e.prototype.addProperty=function(t,e){return this.properties.add(this.checkExtend(t),e)},e.prototype.extendProperties=function(t,e,n){void 0===n&&(n=!1);for(var r=t.length,o=e||this.get("properties"),i=this.get("extendBuilded"),s=[],a=0,l=o.length;a<l;a++){for(var c=o[a],u=0,p=0;p<r;p++){var d=t[p];if(c.property!=d.property&&c.id!=d.property);else{var f=c.properties;f&&f.length&&(c.properties=this.extendProperties(d.properties||[],f,1)),t[p]=i?(0,J.extend)(d,c):c,s[p]=t[p],u=1}}u||(t.push(c),s.push(c))}return n?s.filter((function(t){return t})):t},e.prototype.checkExtend=function(t){var e=((0,J.isString)(t)?{extend:t}:t)||{},n=e.extend,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["extend"]);return n?zh(zh({},this.buildProperties([n])[0]||{}),r):t},e.prototype.buildProperties=function(t){var e,n=t||[];if(!n.length)return[];var r=null===(e=this.em)||void 0===e?void 0:e.Styles.builtIn;return null==r?void 0:r.build(n)},e}(ot.Kx);const qh=Wh;var Gh=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kh=function(){return Kh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Kh.apply(this,arguments)};const Yh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gh(e,t),e.prototype.initialize=function(t,e){void 0===e&&(e={});var n=e.module,r=e.em;this.em=r,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 qh(t,Kh(Kh({},e),{em:n}))},e.prototype.onReset=function(t,e){void 0===e&&(e={}),(e.previousModels||[]).forEach((function(t){return t.get("properties").reset()}))},e}(ot.pM);var Xh=function(){return Xh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Xh.apply(this,arguments)},Jh=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Zh=function(t){return t.map((function(t){return{id:t}}))},Qh=function(){function t(){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=Jh(Jh([],e,!0),["baseline","stretch"],!1);this.optsBgSize=Zh(["auto","cover","contain"]),this.optsBgAttach=Zh(["scroll","fixed","local"]),this.optsBgRepeat=Zh(["repeat","repeat-x","repeat-y","no-repeat"]),this.optsWrap=Zh(["nowrap","wrap","wrap-reverse"]),this.optsOverflow=Zh(["visible","hidden","scroll","auto"]),this.optsDir=Zh(["row","row-reverse","column","column-reverse"]),this.opstDisplay=Zh(["block","inline","inline-block","flex","none"]),this.optsTransitFn=Zh(["linear","ease","ease-in","ease-out","ease-in-out"]),this.optsCursor=Zh(["auto","pointer","copy","crosshair","grab","grabbing","help","move","text"]),this.optsFloat=Zh(["none","left","right"]),this.optsPos=Zh(["static","relative","absolute","fixed"]),this.optsTextAlign=Zh(["left","center","right","justify"]),this.optsFlexAlign=Zh(n),this.optsJustCont=Zh(Jh(Jh([],e,!0),["space-between","space-around","space-evenly"],!1)),this.optsAlignCont=Zh(Jh(Jh([],e,!0),["space-between","space-around","stretch"],!1)),this.optsAlignSelf=Zh(Jh(["auto"],n,!0)),this.optsTransitProp=Zh(["all","width","height","background-color","transform","box-shadow","opacity"]),this.optsBorderStyle=Zh(["none","solid","dotted","dashed","double","groove","ridge","inset","outset"]),this.optsBgPos=Zh(["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 t.prototype.__sub=function(t){var e=this;return function(){return t.map((function(t){if((0,J.isString)(t))return e.get(t);var n=t.extend,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["extend"]);return Xh(Xh({},e.get(n)),r)}))}},t.prototype.init=function(){var t=this,e=this,n=e.fixedValues,r=e.requireFlex,o=e.typeNumber;this.props={};var i=[["text-shadow-h",{type:o,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:r},"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:o,default:"0",requiresParent:r}],["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:r},"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:r},"display"],["font-family",{default:"Arial, Helvetica, sans-serif",options:this.optsFonts},"display"],["font-weight",{default:"400",options:this.optsWeight},"display"],["border-style",{default:"solid",options:this.optsBorderStyle},"display"],["box-shadow-type",{default:"",options:this.optsShadowType},"display"],["background-repeat",{default:"repeat",options:this.optsBgRepeat},"display"],["background-position",{default:"left top",options:this.optsBgPos},"display"],["background-attachment",{default:"scroll",options:this.optsBgAttach},"display"],["background-size",{default:"auto",options:this.optsBgSize},"display"],["transition-property",{default:"width",options:this.optsTransitProp},"display"],["transition-timing-function",{default:"ease",options:this.optsTransitFn},"display"],["cursor",{default:"auto",options:this.optsCursor},"display"],["overflow",{default:"visible",options:this.optsOverflow},"display"],["overflow-x",{},"overflow"],["overflow-y",{},"overflow"],["margin",{type:this.typeComposite,properties:this.__sub([{extend:"margin-top",id:"margin-top-sub"},{extend:"margin-right",id:"margin-right-sub"},{extend:"margin-bottom",id:"margin-bottom-sub"},{extend:"margin-left",id:"margin-left-sub"}])}],["padding",{properties:this.__sub([{extend:"padding-top",id:"padding-top-sub"},{extend:"padding-right",id:"padding-right-sub"},{extend:"padding-bottom",id:"padding-bottom-sub"},{extend:"padding-left",id:"padding-left-sub"}])},"margin"],["border",{properties:this.__sub([{extend:"border-width",id:"border-width-sub"},{extend:"border-style",id:"border-style-sub"},{extend:"border-color",id:"border-color-sub"}])},"margin"],["border-radius",{properties:this.__sub([{extend:"border-top-left-radius",id:"border-top-left-radius-sub"},{extend:"border-top-right-radius",id:"border-top-right-radius-sub"},{extend:"border-bottom-right-radius",id:"border-bottom-right-radius-sub"},{extend:"border-bottom-left-radius",id:"border-bottom-left-radius-sub"}])},"margin"],["transition",{type:this.typeStack,properties:this.__sub([{extend:"transition-property",id:"transition-property-sub"},{extend:"transition-duration",id:"transition-duration-sub"},{extend:"transition-timing-function",id:"transition-timing-function-sub"}])}],["box-shadow",{preview:!0,layerLabel:function(t,e){var n=e.values,r=n["box-shadow-h"],o=n["box-shadow-v"],i=n["box-shadow-blur"],s=n["box-shadow-spread"];return"".concat(r," ").concat(o," ").concat(i," ").concat(s)},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,r=n["text-shadow-h"],o=n["text-shadow-v"],i=n["text-shadow-blur"];return"".concat(r," ").concat(o," ").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,r=t[e.name]||"",o=n.getLayerSeparator();return r?r.split(o).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(),r=Xh({},n.propValue||{}),o=e.getParent().getProperty("transform-value"),i=o.getUnit();(!i||(null==r?void 0:r.units.indexOf(i))<0)&&(r.unit=(null==r?void 0:r.units[0])||""),o.up(r)}}},{property:"transform-value",type:this.typeNumber,default:"0",full:!0}]}]];return i.forEach((function(e){var n=e[0],r=e[1],o=e[2];t.add(n,r||{},{from:o})})),this},t.prototype.add=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=n.from||"",o=this.props[r||t]||{},i=Xh(Xh(Xh({},o),{property:t}),e);return i.properties&&(0,J.isFunction)(i.properties)&&(i.properties=i.properties()),this.props[t]=i,i},t.prototype.get=function(t){return this.props[t]},t.prototype.build=function(t){var e=this,n=[];return((0,J.isString)(t)?[t]:t).forEach((function(t){n.push(e.get(t)||{property:t})})),n},t}();const tg=Qh;var eg=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ng=function(t){function e(e){var n=t.call(this,e)||this,r=e.config||{},o=n.model,i=r.em;return n.config=r,n.em=i,n.pfx=r.stylePrefix||"",n.listenTo(o,"destroy remove",n.remove),n.listenTo(o,"change:open",n.updateOpen),n.listenTo(o,"change:visible",n.updateVisibility),n}return eg(e,t),e.prototype.template=function(t){var e,n,r,o=t.pfx,i=t.label,s=null===(e=this.em)||void 0===e?void 0:e.getConfig().icons,a=(null==s?void 0:s.caret)||"",l="".concat(o,"sector-");return Q(og||(n=['\n <div class="','title" data-sector-title>\n <div class="','caret">$','</div>\n <div class="','label">',"</div>\n </div>\n "],r=['\n <div class="','title" data-sector-title>\n <div class="','caret">$','</div>\n <div class="','label">',"</div>\n </div>\n "],Object.defineProperty?Object.defineProperty(n,"raw",{value:r}):n.raw=r,og=n),l,l,a,l,i)},e.prototype.events=function(){return{"click [data-sector-title]":"toggle"}},e.prototype.updateOpen=function(){var t=this,e=t.$el,n=t.model,r=t.pfx,o=n.isOpen();e[o?"addClass":"removeClass"]("".concat(r,"open")),this.getPropertiesEl().style.display=o?"":"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 r=new Gf({collection:n,config:e});this.$el.append(r.render().el)}},e.prototype.render=function(){var t=this,e=t.pfx,n=t.model,r=t.$el,o=n.getId(),i=n.getName();return r.html(this.template({pfx:e,label:i})),this.renderProperties(),r.attr("class","".concat(e,"sector ").concat(e,"sector__").concat(o," no-select")),this.updateOpen(),this},e}(ot.Ss);const rg=ng;var og,ig=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sg=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.module,o=e.config,i=n.collection;return n.pfx=(null==o?void 0:o.stylePrefix)||"",n.ppfx=(null==o?void 0:o.pStylePrefix)||"",n.config=o,n.module=r,n.listenTo(i,"add",n.addTo),n.listenTo(i,"reset",n.render),n}return ig(e,t),e.prototype.remove=function(){var t=this;return ot.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 r=this.config,o=this.el,i=e||o,s=new rg({model:t,config:r}).render().el;return(0,fe.Sc)(i,s,n.at),s},e.prototype.render=function(){var t=this,e=this,n=e.$el,r=e.pfx,o=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(r,"sectors ").concat(o,"one-bg ").concat(o,"two-color")),this},e}(ot.Ss);const ag=sg;var lg=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cg=function(){return cg=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},cg.apply(this,arguments)},ug=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},pg="style",dg="".concat(pg,":"),fg="".concat(dg,"sector"),hg="".concat(fg,":add"),gg="".concat(fg,":remove"),vg="".concat(fg,":update"),mg="".concat(dg,"property"),yg="".concat(mg,":add"),bg="".concat(mg,":remove"),wg="".concat(mg,":update"),_g="".concat(dg,"layer:select"),xg="".concat(dg,"target"),Cg="".concat(dg,"custom"),Sg=function(t){return t||0===t},Tg={all:pg,sectorAdd:hg,sectorRemove:gg,sectorUpdate:vg,propertyAdd:yg,propertyRemove:bg,propertyUpdate:wg,layerSelect:_g,target:xg,custom:Cg},Og=function(t){function e(e){var n=t.call(this,e,"StyleManager",new Yh([],{em:e}),Tg,gf)||this;n.Sector=qh,n.storageKey="",(0,J.bindAll)(n,"__clearStateTarget");var r=n.config,o=r.pStylePrefix;o&&(r.stylePrefix=o+r.stylePrefix),n.builtIn=new tg,n.properties=new Uh([],{em:e,module:n}),n.sectors=n.all;var i=new ot.Kx({targets:[]});n.model=i;var s=oe.I.update,a="component:toggled ".concat(s,":classes change:state change:device frame:resized selector:type");n.upAll=(0,J.debounce)((function(){return n.__upSel()}),0),i.listenTo(e,a,n.upAll),i.listenTo(e,"component:toggled",n.__clearStateTarget);var l=(0,J.debounce)((function(){n.__upProps(),n.__trgCustom()}),0);i.listenTo(e,"styleable:change undo redo",l);var c=(0,J.debounce)((function(){return n.__trgCustom()}),0);return i.listenTo(e,"".concat(_g," ").concat(xg),c),i.on("change:lastTarget",(function(){return e.trigger(xg,n.getSelected())})),n}return lg(e,t),e.prototype.__upSel=function(){this.select(this.em.getSelectedAll())},e.prototype.__trgCustom=function(t){void 0===t&&(t={}),this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},e.prototype.__trgEv=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(e=this.em).trigger.apply(e,ug([t],n,!1))},e.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})})))},e.prototype.onLoad=function(){this.sectors.add(this.config.sectors,{silent:!0})},e.prototype.postRender=function(){this.__appendTo()},e.prototype.addSector=function(t,e,n){void 0===n&&(n={});var r=this.getSector(t);return r||(e.id=t,r=this.sectors.add(e,n)),r},e.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},e.prototype.getSectors=function(t){void 0===t&&(t={});var e=this.sectors,n=e&&e.models?t.array?ug([],e.models,!0):e:[];return t.visible?n.filter((function(t){return t.isVisible()})):n},e.prototype.removeSector=function(t){return this.getSectors().remove(this.getSector(t,{warn:!0}))},e.prototype.addProperty=function(t,e,n){void 0===n&&(n={});var r,o=this.getSector(t,{warn:!0});return o&&(r=o.addProperty(e,n)),r},e.prototype.getProperty=function(t,e){var n,r=this.getSector(t,{warn:!0});return r&&(n=r.properties.filter((function(t){return t.get("property")===e||t.get("id")===e}))[0]),n},e.prototype.getProperties=function(t){var e,n=this.getSector(t,{warn:!0});return n&&(e=n.properties),e},e.prototype.removeProperty=function(t,e){var n=this.getProperties(t);return n?n.remove(this.getProperty(t,e)):null},e.prototype.select=function(t,e){var n=this;void 0===e&&(e={});var r=this.em,o=(0,J.isArray)(t)?t:[t],i=e.stylable,s=r.Css,a=[];o.filter(Boolean).forEach((function(t){var e=t;if((0,J.isString)(t)){var n=s.getRule(t)||s.setRule(t);!(0,J.isUndefined)(i)&&n.set({stylable:i}),e=n}a.push(e)}));var l=e.component||a.filter((function(t){return(0,Z.isComponent)(t)})).reverse()[0];a=a.map((function(t){return n.getModelToStyle(t)}));var c=r.getState(),u=a.slice().reverse()[0],p=this.getParentRules(u,{state:c,component:l}),d=this.__getStateTarget();return r.skip((function(){var t;if(c&&(null===(t=null==u?void 0:u.getState)||void 0===t?void 0:t.call(u))){var e=u.getStyle();d?d.setStyle(e):d=s.getAll().add({selectors:"gjs-selected",style:e,shallow:!0,important:!0})}else d&&(s.remove(d),d=void 0)})),this.model.set({targets:a,lastTarget:u,lastTargetParents:p,stateTarget:d,component:l}),this.__upProps(e),a},e.prototype.getSelected=function(){return this.model.get("lastTarget")},e.prototype.getSelectedAll=function(){return this.model.get("targets")},e.prototype.getSelectedParents=function(){return this.model.get("lastTargetParents")||[]},e.prototype.__getStateTarget=function(){return this.model.get("stateTarget")},e.prototype.addStyleTargets=function(t,e){this.getSelectedAll().map((function(n){return n.addStyle(t,e)}));var n=this.getSelected();n&&this.__emitCmpStyleUpdate(t);var r=this.__getStateTarget();n&&(null==r||r.setStyle(n.getStyle(),e))},e.prototype.getBuiltIn=function(t){return this.builtIn.get(t)},e.prototype.getBuiltInAll=function(){return this.builtIn.props},e.prototype.addBuiltIn=function(t,e){return this.builtIn.add(t,e)},e.prototype.getModelToStyle=function(t,e){void 0===e&&(e={});var n=this.em,r=e.skipAdd;if(n&&(null==t?void 0:t.toHTML)){var o=n.getConfig(),i=n.UndoManager,s=n.Css,a=n.Selectors,l=a?a.getConfig():{},c=o.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=s.get(u,c,i))||r||(e=s.add(u,c,i,{},f))}else if(o.avoidInlineStyle){var a=t.getId();!(e=s.getIdRule(a,h))&&!r&&(e=s.setIdRule(a,{},h)),t.is("wrapper")&&e.set("wrapper",1,f)}e&&(t=e)}))}return t},e.prototype.getParentRules=function(t,e){var n=void 0===e?{}:e,r=n.state,o=n.component,i=this.em,s=[];if(i&&t){var a=o,l=i.Css,c=i.CodeManager.getGenerator("css"),u=t.toHTML?t:t.getComponent(),p={array:!0},d=[],f=[],h=[],g=[],v=function(t){return t.length?l.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?l.getRules().filter((function(e){return e.selectorsToString()===t})):[]};u?(d=l.getRules("#".concat(u.getId())),f=m(u.get("tagName")),g=(a?v(a.getSelectors().getFullName(p)):[]).concat(f).concat(d)):(d=a?l.getRules("#".concat(a.getId())):[],f=m((null==a?void 0:a.get("tagName"))||""),h=v(((null==a?void 0:a.getSelectors().getFullName(p))||[]).filter((function(e){return-1===t.getSelectors().getFullName(p).findIndex((function(t){return t===e}))})).concat(t.getSelectors().getFullName(p))),g=f.concat(d).concat(h));var y=g.filter((function(t){return(0,J.isUndefined)(r)?1:t.get("state")===r})).sort(c.sortRules).reverse();s=y.slice(y.indexOf(t)+1)}return s},e.prototype.addType=function(t,e){this.properties.addType(t,e)},e.prototype.getType=function(t){return this.properties.getType(t)},e.prototype.getTypes=function(){return this.properties.getTypes()},e.prototype.createType=function(t,e){var n=void 0===e?{}:e,r=n.model,o=void 0===r?{}:r,i=n.view,s=void 0===i?{}:i,a=this.config,l=this.getType(t);if(l)return new l.view(cg({model:new l.model(o),config:a},s))},e.prototype.render=function(){var t=this,e=t.config,n=t.em,r=t.SectView,o=r&&r.el;return this.SectView=new ag({el:o,em:n,config:e,module:this,collection:this.sectors}),this.SectView.render().el},e.prototype._logNoSector=function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},e.prototype.__emitCmpStyleUpdate=function(t,e){void 0===e&&(e={});var n=this.em;if(!t.__p){var r=this.getSelectedAll(),o=e.components||n.getSelectedAll(),i=Array.isArray(o)?o:[o],s=cg({},t);delete s.__p,i.forEach((function(t){return!r.includes(t)&&t.__onStyleChange(s)}))}},e.prototype.__upProps=function(t){var e=this;void 0===t&&(t={});var n=this.getSelected();if(n){var r=this.sectors,o=this.model.get("component"),i=this.getSelectedParents(),s=n.getStyle(),a=i.map((function(t){return{target:t,style:t.getStyle()}}));r.map((function(n){n.getProperties().map((function(n){e.__upProp(n,s,a,t)}))})),r.forEach((function(t){var e=t.getProperties();e.forEach((function(t){var e=t.__checkVisibility({target:n,component:o,sectors:r});t.set("visible",e)}));var i=e.some((function(t){return t.isVisible()}));t.set("visible",i)}))}},e.prototype.__upProp=function(t,e,n,r){var o=this,i=t.getName(),s=e[i],a=Sg(s),l="stack"===t.getType(),c="composite"===t.getType(),u=cg(cg({},r),{__up:!0}),p=!c&&!l,d=t,f=t,h=l?d.__getLayersFromStyle(e):[],g=c?f.__getPropsFromStyle(e):{},v=a?s:null,m=null;if(l&&null===h||c&&null===g){var y=l?"__getLayersFromStyle":"__getPropsFromStyle",b=n.filter((function(t){return null!==d[y](t.style)}))[0];if(b){v=b.style[i],m=b.target;var w=d[y](b.style);l?h=w:g=w}}else a||(v=null,b=n.filter((function(t){return Sg(t.style[i])}))[0],b&&(v=b.style[i],m=b.target));if(t.__setParentTarget(m),p&&t.__getFullValue()!==v&&t.upValue(v,u),l&&d.__setLayers(h||[],{isEmptyValue:d.isEmptyValueStyle(e)}),c){var _=f.getProperties();if(f.isDetached()){var x=f.__getPropsFromStyle(e,{byName:!0})||{},C=n.map((function(t){return cg(cg({},t),{style:f.__getPropsFromStyle(t.style,{byName:!0})||{}})}));_.map((function(t){return o.__upProp(t,x,C,r)}))}else f.__setProperties(g||{},u),f.getProperties().map((function(t){return t.__setParentTarget(m)}))}},e.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()},e}(ft);const Ag=Og;var Eg=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kg=function(){return kg=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},kg.apply(this,arguments)},Pg=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},jg=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};nt().$=rt.default;var Mg=[Qu,Vu,Sp,Jd,wl,Dt,Ua,Ag,Oa,Lp,Vd,yd,hf,ic,Hc,br,xc,qs],Ng=[xu,Ss,Lu,as];!function(t){var e=t.$;if(e&&e.prototype&&"jQuery"!==e.prototype.constructor.name){var n=e.fn;n.hide=function(){return this.css("display","none")},n.show=function(){return this.css("display","block")},n.focus=function(){var t=this.get(0);return t&&t.focus(),this},n.bind=function(t,e){return this.on(t,e)},n.unbind=function(t,e){if((0,J.isObject)(t)){for(var n in t)t.hasOwnProperty(n)&&this.off(n,t[n]);return this}return this.off(t,e)},n.click=function(t){return t?this.on("click",t):this.trigger("click")},n.change=function(t){return t?this.on("change",t):this.trigger("change")},n.keydown=function(t){return t?this.on("keydown",t):this.trigger("keydown")},n.delegate=function(t,e,n,r){return r||(r=n),this.on(e,t,(function(t){t.data=n,r(t)}))},n.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},n.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=e.prototype.offset;n.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)},e.map=function(t,e){for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n};var o=Array.prototype.indexOf;e.inArray=function(t,e,n){return null==e?-1:o.call(e,t,n)},e.Event=function(t,n){if(!(this instanceof e.Event))return new e.Event(t,n);this.type=t,this.isDefaultPrevented=function(){return!1}}}}({$:rt.default});var Lg={debug:console.log,info:console.info,warning:console.warn,error:console.error},Ig=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;n.__skip=!1,n.defaultRunning=!1,n.destroyed=!1,n._config=e;var r=n.config;n.set("Config",e),n.set("modules",[]),n.set("toLoad",[]),n.set("storables",[]),n.set("selected",new lt),n.set("dmode",r.dragMode);var o=r.el,i=r.log,s=!0===i?(0,J.keys)(Lg):(0,J.isArray)(i)?i:[];return(0,J.bindAll)(n,"initBaseColorPicker"),o&&r.fromElement&&(r.components=o.innerHTML),n.attrsOrig=o?(0,J.toArray)(o.attributes).reduce((function(t,e){return t[e.nodeName]=e.nodeValue,t}),{}):"",r.components&&!r.pageManager&&(r.pageManager={pages:[{component:r.components}]}),Mg.forEach((function(t){return n.loadModule(t)})),Ng.forEach((function(t){return n.loadStorableModule(t)})),n.on("change:componentHovered",n.componentHovered,n),n.on("change:changesCount",n.updateChanges,n),n.on("change:readyLoad change:readyCanvas",n._checkReady,n),s.forEach((function(t){return n.listenLog(t)})),[{from:"change:selectedComponent",to:"component:toggled"}].forEach((function(t){var e=t.from,r=t.to;n.listenTo(n,e,(function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];n.trigger.apply(n,function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([r],t,!1)),n.logWarning("The event '".concat(e,"' is deprecated, replace it with '").concat(r,"'"))}))})),n}return Eg(e,t),e.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(e.prototype,"storables",{get:function(){return this.get("storables")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modules",{get:function(){return this.get("modules")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toLoad",{get:function(){return this.get("toLoad")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this.get("selected")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shallow",{get:function(){return this.get("shallow")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"I18n",{get:function(){return this.get("I18n")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Utils",{get:function(){return this.get("Utils")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Commands",{get:function(){return this.get("Commands")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Keymaps",{get:function(){return this.get("Keymaps")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Modal",{get:function(){return this.get("Modal")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Panels",{get:function(){return this.get("Panels")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CodeManager",{get:function(){return this.get("CodeManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"UndoManager",{get:function(){return this.get("UndoManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RichTextEditor",{get:function(){return this.get("RichTextEditor")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Canvas",{get:function(){return this.get("Canvas")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Editor",{get:function(){return this.get("Editor")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Components",{get:function(){return this.get("DomComponents")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Css",{get:function(){return this.get("CssComposer")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Blocks",{get:function(){return this.get("BlockManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Selectors",{get:function(){return this.get("SelectorManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Storage",{get:function(){return this.get("StorageManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Traits",{get:function(){return this.get("TraitManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Parser",{get:function(){return this.get("Parser")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Layers",{get:function(){return this.get("LayerManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Assets",{get:function(){return this.get("AssetManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Devices",{get:function(){return this.get("DeviceManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Pages",{get:function(){return this.get("PageManager")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Styles",{get:function(){return this.get("StyleManager")},enumerable:!1,configurable:!0}),e.prototype._checkReady=function(){this.get("readyLoad")&&this.get("readyCanvas")&&!this.get("ready")&&this.set("ready",!0)},e.prototype.getContainer=function(){return this.config.el},e.prototype.listenLog=function(t){this.listenTo(this,"log:".concat(t),Lg[t])},Object.defineProperty(e.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),e.prototype.getConfig=function(t){var e=this.config;return(0,J.isUndefined)(t)?e:e[t]},e.prototype.loadOnStart=function(){var t=this,n=this.config,r=n.projectData,o=n.headless,i=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)};o?(r&&this.loadData(r),s()):this._storageTimeout=setTimeout((function(){return Pg(t,void 0,void 0,(function(){var t;return jg(this,(function(e){switch(e.label){case 0:return r?(this.loadData(r),[3,5]):[3,1];case 1:if(!(null==i?void 0:i.canAutoload()))return[3,5];e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this.load()];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.logError(t),[3,5];case 5:return s(),[2]}}))}))}));var a=new e({noticeOnUnload:!1,storageManager:!1,undoManager:!1});a.Pages.onLoad(),a.Canvas.postLoad(),this.set("shallow",a)},e.prototype.updateChanges=function(t,e,n){var r=this,o=this.Storage,i=this.getDirtyCount();n.isClear||(this.updateItr&&clearTimeout(this.updateItr),this.updateItr=setTimeout((function(){return r.trigger("update")}))),this.config.noticeOnUnload&&(window.onbeforeunload=i?function(){return!0}:null),o.isAutosave()&&i>=o.getStepsBeforeSave()&&this.store().catch((function(t){return r.logError(t)}))},e.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},e.prototype.loadStorableModule=function(t){var e=this.loadModule(t);return this.storables.push(e),e},e.prototype.init=function(t,e){void 0===e&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set("Editor",t)},e.prototype.getEditor=function(){return this.get("Editor")},e.prototype.handleUpdates=function(t,e,n){var r=this;void 0===n&&(n={}),this.__skip||n.temporary||n.noCount||n.avoidStore||!this.get("ready")||(this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout((function(){var t=r.getDirtyCount()||0,e=(n.unset,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(n,["unset"]));r.set("changesCount",t+1,e)}),0))},e.prototype.changesUp=function(t){this.handleUpdates(0,0,t)},e.prototype.componentHovered=function(t,e,n){var r=this.previous("componentHovered");r&&this.trigger("component:unhovered",r,n),e&&this.trigger("component:hovered",e,n)},e.prototype.getSelected=function(){return this.selected.lastComponent()},e.prototype.getSelectedAll=function(){return this.selected.allComponents()},e.prototype.setSelected=function(t,e){var n=this;void 0===e&&(e={});var r=e.event,o=r&&(r.ctrlKey||r.metaKey),i=(r||{}).shiftKey,s=((0,J.isArray)(t)?t:[t]).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),a=this.getSelectedAll(),l=this.getConfig().multipleSelection,c=(0,J.isArray)(t);!c&&t||this.removeSelected(a.filter((function(t){return!(0,J.contains)(s,t)}))),s.forEach((function(t){if(t&&(n.trigger("component:select:before",t,e),!t.get("selectable")||e.abort)){if(!e.useValid)return;for(var r=t.parent();r&&!r.get("selectable");)r=r.parent();t=r}if(o&&l)return n.toggleSelected(t);if(i&&l){n.clearSelection(n.Canvas.getWindow());var s,u,p=t.collection,d=t.index();if(n.getSelectedAll().forEach((function(t){var e=t.collection,n=t.index();e===p&&(n<d?s=(0,J.isUndefined)(s)?n:Math.max(s,n):n>d&&(u=(0,J.isUndefined)(u)?n:Math.min(u,n)))})),!(0,J.isUndefined)(s))for(;s!==d;)n.addSelected(p.at(s)),s++;if(!(0,J.isUndefined)(u))for(;u!==d;)n.addSelected(p.at(u)),u--;return n.addSelected(t)}!c&&n.removeSelected(a.filter((function(e){return e!==t}))),n.addSelected(t,e)}))},e.prototype.addSelected=function(t,e){var n=this;void 0===e&&(e={}),((0,J.isArray)(t)?t:[t]).forEach((function(t){var r=n.selected;t&&t.get("selectable")&&!t.parents().some((function(t){return r.hasComponent(t)}))&&(e.forceChange&&n.removeSelected(t,e),r.allComponents().filter((function(e){return(0,J.contains)(e.parents(),t)})).forEach((function(t){return n.removeSelected(t,e)})),r.addComponent(t,e),n.trigger("component:select",t,e),n.Canvas.addSpot({type:re.F.Select,component:t}))}))},e.prototype.removeSelected=function(t,e){var n=this;void 0===e&&(e={}),this.selected.removeComponent(t,e),((0,J.isArray)(t)?t:[t]).forEach((function(t){return n.Canvas.removeSpots({type:re.F.Select,component:t})}))},e.prototype.toggleSelected=function(t,e){var n=this;void 0===e&&(e={}),((0,J.isArray)(t)?t:[t]).forEach((function(t){n.selected.hasComponent(t)?n.removeSelected(t,e):n.addSelected(t,e)}))},e.prototype.setHovered=function(t,e){var n=this;void 0===e&&(e={});var r=function(t,e){var r=n,o=r.config,i=r.Canvas,s=n.getHovered(),a=n.getSelectedAll(),l=re.F.Hover,c=re.F.Spacing;n.set("componentHovered",t||null,e),s&&(i.removeSpots({type:l,component:s}),i.removeSpots({type:c,component:s})),t&&(i.addSpot({type:l,component:t}),a.includes(t)&&!o.showOffsetsSelected||i.addSpot({type:c,component:t}))};if(!t)return r();var o="component:hover";if(e.forceChange&&r(),this.trigger("".concat(o,":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||(r(t,e),this.trigger(o,t,e))},e.prototype.getHovered=function(){return this.get("componentHovered")},e.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.Components.setComponents(t,e)},e.prototype.getComponents=function(){var t=this.Components,e=this.CodeManager;if(t&&e){var n=t.getComponents();return e.getCode(n,"json")}},e.prototype.setStyle=function(t,e){void 0===e&&(e={});var n=this.Css;return n.clear(e),n.getAll().add(t,e),this},e.prototype.addStyle=function(t,e){void 0===e&&(e={});var n=this.getStyle().add(t,e);return(0,J.isArray)(n)?n:[n]},e.prototype.getStyle=function(){return this.Css.getAll()},e.prototype.setState=function(t){return this.set("state",t),this},e.prototype.getState=function(){return this.get("state")||""},e.prototype.getHtml=function(t){void 0===t&&(t={});var e=this.config,n=e.optsHtml,r=e.jsInHtml?this.getJs(t):"",o=t.component||this.Components.getComponent();return(o?this.CodeManager.getCode(o,"html",kg(kg({},n),t)):"")+(r?"<script>".concat(r,"<\/script>"):"")},e.prototype.getCss=function(t){void 0===t&&(t={});var e=this.config,n=e.optsCss,r=t.avoidProtected,o=(0,J.isUndefined)(t.keepUnusedStyles)?e.keepUnusedStyles:t.keepUnusedStyles,i=this.Css,s=t.component||this.Components.getComponent(),a=r?"":e.protectedCss,l=s&&this.CodeManager.getCode(s,"css",kg(kg({cssc:i,keepUnusedStyles:o},n),t));return s?t.json?l:a+l:""},e.prototype.getJs=function(t){void 0===t&&(t={});var e=t.component||this.Components.getWrapper();return e?this.CodeManager.getCode(e,"js").trim():""},e.prototype.store=function(t){return Pg(this,void 0,void 0,(function(){var e;return jg(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]}}))}))},e.prototype.load=function(t){return Pg(this,arguments,void 0,(function(t,e){var n;return void 0===e&&(e={}),jg(this,(function(r){switch(r.label){case 0:return[4,this.Storage.load(t)];case 1:return n=r.sent(),this.loadData(n),[4,(0,Z.wait)()];case 2:return r.sent(),e.clear&&(this.UndoManager.clear(),this.clearDirtyCount()),[2,n]}}))}))},e.prototype.storeData=function(){var t={},e=this.getEditing();return e&&e.trigger("sync:content",{noCount:!0}),this.storables.forEach((function(e){t=kg(kg({},t),e.store(1))})),JSON.parse(JSON.stringify(t))},e.prototype.loadData=function(t){return void 0===t&&(t={}),(0,Z.isEmptyObj)(t)||(this.storables.forEach((function(t){return t.clear()})),this.storables.forEach((function(e){return e.load(t)}))),t},e.prototype.getDeviceModel=function(){var t=this.get("device");return this.Devices.get(t)},e.prototype.runDefault=function(t){void 0===t&&(t={});var e=this.get("Commands").get(this.config.defaultCommand);e&&!this.defaultRunning&&(e.stop(this,this,t),e.run(this,this,t),this.defaultRunning=!0)},e.prototype.stopDefault=function(t){void 0===t&&(t={});var e=this.get("Commands");if(e){var n=e.get(this.config.defaultCommand);n&&this.defaultRunning&&(n.stop(this,this,t),this.defaultRunning=!1)}},e.prototype.refreshCanvas=function(t){void 0===t&&(t={}),this.Canvas.refresh({spots:t.tools})},e.prototype.clearSelection=function(t){var e;null===(e=(t||window).getSelection())||void 0===e||e.removeAllRanges()},e.prototype.getCurrentMedia=function(){var t=this.config,e=this.getDeviceModel(),n=t.mediaCondition,r=t.devicePreviewMode,o=e&&e.get("widthMedia");return e&&o&&!r?"(".concat(n,": ").concat(o,")"):""},e.prototype.getWrapper=function(){return this.Components.getWrapper()},e.prototype.setCurrentFrame=function(t){return this.set("currentFrame",t)},e.prototype.getCurrentFrame=function(){return this.get("currentFrame")},e.prototype.getCurrentFrameModel=function(){var t;return null===(t=this.getCurrentFrame()||{})||void 0===t?void 0:t.model},e.prototype.getIcon=function(t){return(this.config.icons||{})[t]||""},e.prototype.getDirtyCount=function(){return this.get("changesCount")},e.prototype.clearDirtyCount=function(){return this.set({changesCount:0},{isClear:!0})},e.prototype.getZoomDecimal=function(){return this.Canvas.getZoomDecimal()},e.prototype.getZoomMultiplier=function(){return this.Canvas.getZoomMultiplier()},e.prototype.setDragMode=function(t){return this.set("dmode",t)},e.prototype.getDragMode=function(t){return(null==t?void 0:t.getDragMode())||this.get("dmode")||""},e.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)},e.prototype.inAbsoluteMode=function(t){return"absolute"===this.getDragMode(t)},e.prototype.destroyAll=function(){var t=this,e=this.config,n=this.view,r=this.getEditor(),o=(e.grapesjs||{}).editors,i=void 0===o?[]:o,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==n?void 0:n.remove)&&n.remove(),this.clear({silent:!0}),this.destroyed=!0,["_config","view","_previousAttributes","_events","_listeners"].forEach((function(e){return t[e]={}})),i.splice(i.indexOf(r),1),(0,Z.hasWin)()&&(0,rt.default)(e.el).empty().attr(this.attrsOrig)},e.prototype.getEditing=function(){var t=this.get("editing");return t&&t.model||void 0},e.prototype.setEditing=function(t){return this.set("editing",t),this},e.prototype.isEditing=function(){return!!this.get("editing")},e.prototype.log=function(t,e){void 0===e&&(e={});var n=e.ns,r=e.level,o=void 0===r?"debug":r;if(this.trigger("log",t,e),o&&this.trigger("log:".concat(o),t,e),n){var i="log-".concat(n);this.trigger(i,t,e),o&&this.trigger("".concat(i,":").concat(o),t,e)}},e.prototype.logInfo=function(t,e){this.log(t,kg(kg({},e),{level:"info"}))},e.prototype.logWarning=function(t,e){this.log(t,kg(kg({},e),{level:"warning"}))},e.prototype.logError=function(t,e){this.log(t,kg(kg({},e),{level:"error"}))},e.prototype.initBaseColorPicker=function(t,e){void 0===e&&(e={});var n=this.config,r=n.colorPicker,o=void 0===r?{}:r,i=n.el,s=n.stylePrefix;return(0,rt.default)(t).spectrum(kg(kg({containerClassName:"".concat(s,"one-bg ").concat(s,"two-color"),appendTo:i||"body",maxSelectionSize:8,showPalette:!0,palette:[],showAlpha:!0,chooseText:"Ok",cancelText:"⨯"},e),o))},e.prototype.skip=function(t){this.__skip=!0;var e=this.UndoManager;e?e.skip(t):t(),this.__skip=!1},e.prototype.data=function(t,e,n){var r="_gjs-data";if(t[r]||(t[r]={}),(0,J.isUndefined)(n))return t[r][e];t[r][e]=n},e}(ot.Kx);const $g=Ig;var Dg=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rg=function(t){function e(e){var n=t.call(this,{model:e})||this,r=e.Panels,o=e.UndoManager;return e.view=n,e.once("change:ready",(function(){r.active(),r.disableButtons(),o.clear(),setTimeout((function(){e.trigger("load",e.Editor),e.clearDirtyCount()}))})),n}return Dg(e,t),e.prototype.render=function(){var t=this,e=this.$el,n=this.model,r=n.Panels,o=n.Canvas,i=n.config,s=n.modules,a=i.stylePrefix,l=["".concat(a,"editor")];!i.customUI&&l.push("".concat(a,"one-bg ").concat(a,"two-color"));var c=(0,rt.default)(i.el||"body ".concat(i.container));i.cssIcons&&(0,Z.appendStyles)(i.cssIcons,{unique:!0,prepand:!0}),e.empty(),i.width&&c.css("width",i.width),i.height&&c.css("height",i.height),e.append(o.render()),e.append(r.render());var u=n.shallow.Canvas.render();return u.style.display="none",e.append(u),e.attr("class",l.join(" ")),c.addClass("".concat(a,"editor-cont")).empty().append(e),s.forEach((function(e){var n;return null===(n=e.postRender)||void 0===n?void 0:n.call(e,t)})),this},e}(ot.Ss);const Hg=Rg;var Fg=function(){return Fg=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Fg.apply(this,arguments)},Vg=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},Ug=function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},Bg=function(){function t(t,e){var n;void 0===t&&(t={}),void 0===e&&(e={}),this.html=Q,this.config=Fg(Fg(Fg({},tt),t),{pStylePrefix:null!==(n=t.stylePrefix)&&void 0!==n?n:tt.stylePrefix}),this.em=new $g(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,"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){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 Vg(this,void 0,void 0,(function(){return Ug(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 Vg(this,arguments,void 0,(function(t,e){return void 0===e&&(e={}),Ug(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,function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([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 Hg(this.em),this.editorView.render().el},t.prototype.onReady=function(t){this.em.get("ready")?t(this):this.em.on("load",t)},t}();const zg=Bg;var Wg=function(t,e){return(0,J.isString)(t)?function(t,e){var n=e.get(t);if(!n){var r=(0,Z.getGlobal)()[t];n=(null==r?void 0:r.default)||r}return n}(t,e):(null==t?void 0:t.default)||t},qg=function(t,e){t.getModel().logWarning("Plugin ".concat(e," not found"),{context:"plugins",plugin:e})};const Gg=function(){function t(){this.plugins={}}return t.prototype.add=function(t,e){return this.get(t)||(this.plugins[t]=e,e)},t.prototype.get=function(t){return this.plugins[t]},t.prototype.getAll=function(){return this.plugins},t}();var Kg=function(){return Kg=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Kg.apply(this,arguments)};!function(){if((0,Z.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$/]],r=0;r<n.length&&!(t=n[r][1].exec(e));r++);return!!t}()){var t=DOMImplementation.prototype.createHTMLDocument;DOMImplementation.prototype.createHTMLDocument=function(e){return e||(e=""),t.apply(document.implementation,[e])}}}();var Yg=new Gg,Xg=[],Jg=function(t,e){var n=Wg(t,Yg);return function(r){n?n(r,e||{}):qg(r,t)}},Zg={$:rt.default,editors:Xg,plugins:Yg,usePlugin:Jg,version:"0.21.13",init:function(t){void 0===t&&(t={});var e=t.headless,n=t.container;if(!n&&!e)throw new Error("'container' is required");var r=Kg(Kg({autorender:!0,plugins:[],pluginsOpts:{}},t),{grapesjs:this,el:e?void 0:(0,J.isElement)(n)?n:document.querySelector(n)}),o=new zg(r,{$:rt.default}),i=o.getModel();return r.plugins.forEach((function(t){var e=Wg(t,Yg),n=r.pluginsOpts[t]||{};e?e(o,n):qg(o,t)})),i.loadOnStart(),r.autorender&&!e&&o.render(),Xg.push(o),o}};const Qg=Zg;var tv=X.Ay,ev=n(109),nv=n.n(ev),rv=n(600),ov=n.n(rv),iv=n(753),sv=n.n(iv),av=n(325),lv=n.n(av),cv=n(858),uv=n.n(cv),pv=n(69),dv=n.n(pv),fv=n(391),hv=n.n(fv),gv=n(523),vv=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mv=function(){return mv=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},mv.apply(this,arguments)},yv="symbolId",bv="symbolChildId",wv="symbolSync",_v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vv(e,t),e.prototype.initialize=function(){if(!this.has("model"))throw new Error("Could not create Symbol: model is required");if(this.has("instances")||this.set("instances",new Map),this.collection){var t=this.collection.editor,e=this.get("model");if(!e.cid){var n=t.addComponents([e])[0];this.set("model",n)}t.UndoManager.add(this)}},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=hv().Model.prototype.toJSON.call(this,t);return delete e.instances,e},e.prototype.getAll=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var n=Array.from(this.get("instances").values());return(t?[t]:[]).concat(e?n.filter((function(t){return t.cid!=e.cid})):n)},e.prototype.browseInstancesAndModel=function(t,e,n){this.getAll(this.get("model"),t).forEach((function(t){var r=e.map((function(e){return e.has(yv)?t:kv(t,e.get(bv))}));n(r,t)}))},e.prototype.applyClasses=function(t,e){var n=this;!1!==t.get(wv)&&this.browseInstancesAndModel(t,[e],(function(t,r){var o=t[0];!1!==r.get(wv)&&(o?o.setClass(e.getClasses()):console.error("Could not sync classes for symbol ".concat(n.cid,": ").concat(e.get(bv)," not found in ").concat(r.cid)))}))},e.prototype.getIndex=function(t,e){return t.components().toArray().findIndex((function(t){return t.get(bv)===e}))},e.prototype.applyChildren=function(t,e,n){var r=this;if(!1!==t.get(wv)){if(!e)throw new Error("Could not sync children for symbol ".concat(this.cid,": ").concat(n.cid," has no parent"));var o=Ev(t).filter((function(t){return!1!==t.get(wv)}));if(o.includes(n)){var i=n.get(bv),s=!!i&&o.filter((function(t){return t.get(bv)===i&&t.parent()===e})).length>1;i&&!s?this.browseInstancesAndModel(t,[n,e],(function(t,e){var o=t[0],i=t[1];o&&i?i.append(o,{at:n.index()}):console.error("Could not sync child for symbol ".concat(r.cid,": ").concat(n.get(bv)," not found in ").concat(e.cid),{dstChild:o,dstParent:i})})):(Ev(n).forEach((function(t){return Cv(t,!0)})),this.browseInstancesAndModel(t,[e],(function(t,e){var o=t[0];if(o){var i=n.clone();o.append(i,{at:n.index()})}else console.error("Could not sync attributes for symbol ".concat(r.cid,": ").concat(n.get(bv)," not found in ").concat(e.cid))})))}else this.browseInstancesAndModel(t,[n],(function(t,e){var o=t[0];o?o.remove():console.error("Could not sync attributes for symbol ".concat(r.cid,": ").concat(n.get(bv)," not found in ").concat(e.cid))})),n.set(bv)}},e.prototype.applyAttributes=function(t,e){var n=this;!1!==t.get(wv)&&this.browseInstancesAndModel(t,[e],(function(t,r){var o=t[0];!1!==r.get(wv)&&(o?o.attributes=e.attributes:console.error("Could not sync attributes for symbol ".concat(n.cid,": ").concat(e.get(bv)," not found in ").concat(r.cid)))}))},e.prototype.applyContent=function(t,e){var n=this;if(!1!==t.get(wv)){var r=e.getCurrentView().el,o=function(t){var e,n,r=t.ownerDocument.defaultView.getSelection(),o=r.rangeCount?r.getRangeAt(0):null,i=null!==(e=null==o?void 0:o.startOffset)&&void 0!==e?e:0;return{path:function(t,e){for(var n=[],r=e;r&&r!==t;){var o=r.parentNode,i=Array.from(o.childNodes).indexOf(r);n.push(i),r=o}return n}(t,null!==(n=null==o?void 0:o.commonAncestorContainer)&&void 0!==n?n:t),pos:i}}(r);this.browseInstancesAndModel(t,[e],(function(t,r){var o=t[0];!1!==r.get(wv)&&(o?"text"===o.get("type")?o.components(e.getCurrentView().el.innerHTML):console.error("applyContent, NOT A TEXT",o,o.get("type")):console.error("Could not sync content for symbol ".concat(n.cid,": ").concat(e.get(bv)," not found in ").concat(r.cid)))})),setTimeout((function(){!function(t,e){var n=e.path,r=e.pos,o=function(t,e){for(var n=Tv([],e,!0),r=t;r&&n.length;)r=r.childNodes[n.pop()];return r}(t,n);if(o){var i=t.ownerDocument.defaultView.getSelection();i.removeAllRanges();var s=document.createRange();s.selectNodeContents(o),s.collapse(!1),s.setStart(o,r),s.setEnd(o,r),i.addRange(s)}else console.error("Could not keep the caret position",{el:t,path:n})}(r,o)}))}},e.prototype.applyStyle=function(t,e,n,r){var o=this;!1!==t.get(wv)&&this.browseInstancesAndModel(t,[e],(function(t,i){var s=t[0];!1!==i.get(wv)&&(s?(s.setStyle(mv(mv({},s.getStyle()),n)),r.forEach((function(t){return s.removeStyle(t)}))):console.error("Could not sync content for symbol ".concat(o.cid,": ").concat(e.get(bv)," not found in ").concat(i.cid)))}))},e.prototype.addInstance=function(t){this.get("instances").set(t.cid,t)},e.prototype.createInstance=function(){var t=this.get("model").clone();return this.addInstance(t),t},e.prototype.isInstance=function(t){return!!t.get(yv)&&this.get("instances").has(t.cid)},e.prototype.unlinkAll=function(){var t=this;this.get("instances").forEach((function(e){return t.unlink(e)}))},e.prototype.unlink=function(t){t.set(yv),this.get("instances").delete(t.cid),Av(t).forEach((function(t){return t.set(bv)}))},e}(hv().Model);function xv(t){return t.get(yv)}function Cv(t,e){void 0===e&&(e=!1),!e&&t.has(bv)||t.set(bv,t.cid)}const Sv=_v;var Tv=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};function Ov(t){try{var e=t.getDirtyCount()||0;t.getModel().set("changesCount",e+1)}catch(t){}}function Av(t){return t.components().toArray().flatMap((function(t){return Ev(t)}))}function Ev(t){var e=t.components().toArray();return[t].concat(e.flatMap((function(t){return jv(t)?[t]:Ev(t)})))}function kv(t,e){if(t.get("symbolChildId")===e)return t;var n=null;return t.components().forEach((function(t){n||(n=kv(t,e))})),n}function Pv(t){for(var e=t;e&&!jv(e);)e=e.parent();return e}function jv(t){return!!t.get("symbolId")}function Mv(){return function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))}(this,arguments,void 0,(function(t){return void 0===t&&(t=0),function(t,e){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(e){return[2,new Promise((function(e){return setTimeout(e,t)}))]}))}))}function Nv(t,e){var n=t.components().toArray();return e&&jv(t)&&[].push(t),[t].concat(n.flatMap((function(t){return Nv(t,!0)})))}function Lv(t){var e=t.target,n=function(t){for(var e=[],n=t;n;)jv(n)&&e.push(n),n=n.parent();return e}(t.parent),r=Nv(e,!1);return!n.find((function(t){return r.find((function(e){return xv(e)===xv(t)}))}))}var Iv=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$v=function(){return $v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},$v.apply(this,arguments)},Dv=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))},Rv=function(t,e){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Sv&&(s[Sv.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},Hv=function(t){function e(e,n){var r=this,o=n.editor,i=n.options,s=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(n,["editor","options"]);return(r=t.call(this,e,s)||this).updating=!1,r.editor=o,r.options=i,i.headless||r.initEvents(),r.editor.UndoManager.add(r),r}return Iv(e,t),e.prototype.disableUndo=function(t){t?this.editor.UndoManager.stop():this.editor.UndoManager.start()},e.prototype.preventUndo=function(t){return Dv(this,void 0,void 0,(function(){return Rv(this,(function(e){switch(e.label){case 0:return this.editor.UndoManager.stop(),[4,t()];case 1:return e.sent(),this.editor.UndoManager.start(),[2]}}))}))},e.prototype.initEvents=function(){var t=this;this.editor.on("component:create",(function(e){return t.onAdd(e)})),this.editor.on("component:update:components",(function(e,n){return t.onUpdateChildren(e,n)})),this.editor.on("component:update:attributes",(function(e){return t.onUpdateAttributes(e)})),this.editor.on("component:update:classes",(function(e){return t.onUpdateClasses(e)})),this.editor.on("component:input",(function(e){return t.onUpdateContent(e)})),this.editor.on("styleable:change",(function(e){e.getComponent&&e.changed&&t.onStyleChanged(e)})),this.editor.on("component:drag",(function(e){var n=e.target,r=e.parent;return t.onDrag({target:n,parent:r})}))},e.prototype.updateComponents=function(t){var e=this;t.forEach((function(t){return e.onAdd(t)}))},e.prototype.onDrag=function(t){var e=t.target,n=t.parent;(null==n?void 0:n.get("droppable"))&&!Lv({target:e,parent:n})&&(n.set("droppable",!1),this.editor.once("component:drag:end",(function(){n.set("droppable",!0)})))},e.prototype.onAdd=function(t){var e=this,n=xv(t);if(n){var r=this.get(n);r?r.isInstance(t)?console.warn("Could not add instance",t,"It is already an instance of symbol with id ".concat(n)):r.addInstance(t):setTimeout((function(){e.get(n)||(console.error("Could not make component with id `".concat(t.getId(),"` an instance of symbol with id `").concat(n,"`: symbol not found")),e.editor.runCommand("notifications:add",{type:"error",group:"Symbols errors",message:"There is a problem with this component: it is supposed to be an instance of a symbol, but the symbol is not found. Symbol id: ".concat(n),componentId:t.getId()}))}))}},e.prototype.onUpdateChildren=function(t,e){return Dv(this,void 0,void 0,(function(){var n,r,o,i=this;return Rv(this,(function(s){switch(s.label){case 0:return this.updating?[2]:(n=Pv(t))?(r=xv(n),(o=this.get(r))?[4,Mv()]:[3,3]):[3,4];case 1:return s.sent(),this.updating=!0,[4,this.preventUndo((function(){return Dv(i,void 0,void 0,(function(){return Rv(this,(function(r){return o.applyChildren(n,t,e),[2]}))}))}))];case 2:return s.sent(),this.updating=!1,[3,4];case 3:console.warn("Could not update instance",e,": could not find the symbol with id",r),s.label=4;case 4:return[2]}}))}))},e.prototype.onUpdateAttributes=function(t){if(!this.updating){var e=Pv(t);if(e){var n=xv(e),r=this.get(n);r?(this.updating=!0,r.applyAttributes(e,t),this.updating=!1):console.warn("Could not update instance",t,": could not find the symbol with id",n)}}},e.prototype.onUpdateClasses=function(t){return Dv(this,void 0,void 0,(function(){var e,n,r;return Rv(this,(function(o){switch(o.label){case 0:return this.updating?[2]:(e=Pv(t))?(n=xv(e),(r=this.get(n))?[4,Mv()]:[3,2]):[3,3];case 1:return o.sent(),this.updating=!0,this.preventUndo((function(){r.applyClasses(e,t)})),this.updating=!1,[3,3];case 2:console.warn("Could not update instance",t,": could not find the symbol with id",n),o.label=3;case 3:return[2]}}))}))},e.prototype.onUpdateContent=function(t){if(!this.updating){var e=Pv(t);if(e){var n=xv(e),r=this.get(n);r?(this.updating=!0,this.preventUndo((function(){r.applyContent(e,t)})),this.updating=!1):console.warn("Could not update instance",t,": could not find the symbol with id",n)}}},e.prototype.onStyleChanged=function(t){if(!this.updating){var e=t.getComponent(),n=t.changed.style;if(e&&n){var r=Pv(e);if(r){var o=xv(r),i=this.get(o);if(i){var s=Object.entries(n).filter((function(e){var n=e[0],r=e[1];return t.previousAttributes().style[n]!==r||!t.previousAttributes().style[n]})).reduce((function(t,e){var n,r=e[0],o=e[1];return $v($v({},t),((n={})[r]=o,n))}),{}),a=Object.keys(t.previousAttributes().style).filter((function(t){return!n[t]}));(Object.values(s).length>0||a.length>0)&&(this.updating=!0,i.applyStyle(r,e,s,a),this.updating=!1)}else console.warn("Could not update instance",e,": could not find the symbol with id",o)}}}},e}(hv().Collection);Hv.prototype.model=Sv;const Fv=globalThis,Vv=Fv.trustedTypes,Uv=Vv?Vv.createPolicy("lit-html",{createHTML:t=>t}):void 0,Bv="$lit$",zv=`lit$${Math.random().toFixed(9).slice(2)}$`,Wv="?"+zv,qv=`<${Wv}>`,Gv=document,Kv=()=>Gv.createComment(""),Yv=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Xv=Array.isArray,Jv=t=>Xv(t)||"function"==typeof t?.[Symbol.iterator],Zv="[ \t\n\f\r]",Qv=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tm=/-->/g,em=/>/g,nm=RegExp(`>|${Zv}(?:([^\\s"'>=/]+)(${Zv}*=${Zv}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),rm=/'/g,om=/"/g,im=/^(?:script|style|textarea|title)$/i,sm=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),am=sm(1),lm=(sm(2),sm(3),Symbol.for("lit-noChange")),cm=Symbol.for("lit-nothing"),um=new WeakMap,pm=Gv.createTreeWalker(Gv,129);function dm(t,e){if(!Xv(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Uv?Uv.createHTML(e):e}const fm=(t,e)=>{const n=t.length-1,r=[];let o,i=2===e?"<svg>":3===e?"<math>":"",s=Qv;for(let e=0;e<n;e++){const n=t[e];let a,l,c=-1,u=0;for(;u<n.length&&(s.lastIndex=u,l=s.exec(n),null!==l);)u=s.lastIndex,s===Qv?"!--"===l[1]?s=tm:void 0!==l[1]?s=em:void 0!==l[2]?(im.test(l[2])&&(o=RegExp("</"+l[2],"g")),s=nm):void 0!==l[3]&&(s=nm):s===nm?">"===l[0]?(s=o??Qv,c=-1):void 0===l[1]?c=-2:(c=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?nm:'"'===l[3]?om:rm):s===om||s===rm?s=nm:s===tm||s===em?s=Qv:(s=nm,o=void 0);const p=s===nm&&t[e+1].startsWith("/>")?" ":"";i+=s===Qv?n+qv:c>=0?(r.push(a),n.slice(0,c)+Bv+n.slice(c)+zv+p):n+zv+(-2===c?e:p)}return[dm(t,i+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]};class hm{constructor({strings:t,_$litType$:e},n){let r;this.parts=[];let o=0,i=0;const s=t.length-1,a=this.parts,[l,c]=fm(t,e);if(this.el=hm.createElement(l,n),pm.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=pm.nextNode())&&a.length<s;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(Bv)){const e=c[i++],n=r.getAttribute(t).split(zv),s=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:s[2],strings:n,ctor:"."===s[1]?bm:"?"===s[1]?wm:"@"===s[1]?_m:ym}),r.removeAttribute(t)}else t.startsWith(zv)&&(a.push({type:6,index:o}),r.removeAttribute(t));if(im.test(r.tagName)){const t=r.textContent.split(zv),e=t.length-1;if(e>0){r.textContent=Vv?Vv.emptyScript:"";for(let n=0;n<e;n++)r.append(t[n],Kv()),pm.nextNode(),a.push({type:2,index:++o});r.append(t[e],Kv())}}}else if(8===r.nodeType)if(r.data===Wv)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(zv,t+1));)a.push({type:7,index:o}),t+=zv.length-1}o++}}static createElement(t,e){const n=Gv.createElement("template");return n.innerHTML=t,n}}function gm(t,e,n=t,r){if(e===lm)return e;let o=void 0!==r?n._$Co?.[r]:n._$Cl;const i=Yv(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),void 0===i?o=void 0:(o=new i(t),o._$AT(t,n,r)),void 0!==r?(n._$Co??=[])[r]=o:n._$Cl=o),void 0!==o&&(e=gm(t,o._$AS(t,e.values),o,r)),e}class vm{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,r=(t?.creationScope??Gv).importNode(e,!0);pm.currentNode=r;let o=pm.nextNode(),i=0,s=0,a=n[0];for(;void 0!==a;){if(i===a.index){let e;2===a.type?e=new mm(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new xm(o,this,t)),this._$AV.push(e),a=n[++s]}i!==a?.index&&(o=pm.nextNode(),i++)}return pm.currentNode=Gv,r}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class mm{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,r){this.type=2,this._$AH=cm,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=gm(this,t,e),Yv(t)?t===cm||null==t||""===t?(this._$AH!==cm&&this._$AR(),this._$AH=cm):t!==this._$AH&&t!==lm&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):Jv(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==cm&&Yv(this._$AH)?this._$AA.nextSibling.data=t:this.T(Gv.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=hm.createElement(dm(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new vm(r,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=um.get(t.strings);return void 0===e&&um.set(t.strings,e=new hm(t)),e}k(t){Xv(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,r=0;for(const o of t)r===e.length?e.push(n=new mm(this.O(Kv()),this.O(Kv()),this,this.options)):n=e[r],n._$AI(o),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class ym{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,r,o){this.type=1,this._$AH=cm,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=cm}_$AI(t,e=this,n,r){const o=this.strings;let i=!1;if(void 0===o)t=gm(this,t,e,0),i=!Yv(t)||t!==this._$AH&&t!==lm,i&&(this._$AH=t);else{const r=t;let s,a;for(t=o[0],s=0;s<o.length-1;s++)a=gm(this,r[n+s],e,s),a===lm&&(a=this._$AH[s]),i||=!Yv(a)||a!==this._$AH[s],a===cm?t=cm:t!==cm&&(t+=(a??"")+o[s+1]),this._$AH[s]=a}i&&!r&&this.j(t)}j(t){t===cm?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class bm extends ym{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===cm?void 0:t}}class wm extends ym{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==cm)}}class _m extends ym{constructor(t,e,n,r,o){super(t,e,n,r,o),this.type=5}_$AI(t,e=this){if((t=gm(this,t,e,0)??cm)===lm)return;const n=this._$AH,r=t===cm&&n!==cm||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==cm&&(n===cm||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class xm{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){gm(this,t)}}const Cm={M:Bv,P:zv,A:Wv,C:1,L:fm,R:vm,D:Jv,V:gm,I:mm,H:ym,N:wm,U:_m,B:bm,F:xm},Sm=Fv.litHtmlPolyfillSupport;Sm?.(hm,mm),(Fv.litHtmlVersions??=[]).push("3.2.1");const Tm=(t,e,n)=>{const r=n?.renderBefore??e;let o=r._$litPart$;if(void 0===o){const t=n?.renderBefore??null;r._$litPart$=o=new mm(e.insertBefore(Kv(),t),t,void 0,n??{})}return o._$AI(t),o},Om=t=>(...e)=>({_$litDirective$:t,values:e});class Am{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}class Em extends Am{constructor(t){if(super(t),this.it=cm,2!==t.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===cm||null==t)return this._t=void 0,this.it=t;if(t===lm)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Em.directiveName="unsafeHTML",Em.resultType=1;const km=Om(Em);var Pm=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},jm=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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Mm(t){var e=t.editor,n=t.content,r=t.title,o=t.primaryLabel,i=t.secondaryLabel,s=void 0===i?"Cancel":i,a=t.cbk,l=t.lsKey;if("on"===localStorage.getItem(l))a();else{var c=document.createElement("div");e.Modal.open({title:r,content:c});var u="off";Tm(am(Im||(Im=Pm(["<main>\n ",'\n </main><footer style="\n display: flex;\n justify-content: space-between;\n margin-top: 30px;\n ">\n <div>\n <label class="gjs-field gjs-field-checkbox" style="\n float: left;\n margin-right: 10px;\n ">\n <input type="checkbox" id="remember" @click=','>\n <i class="gjs-chk-icon"></i>\n </label>\n <label for="remember">Don\'t ask me again</label>\n </div>\n <div>\n <button\n class="gjs-btn-prim"\n @click=','\n style="\n margin-left: auto;\n background: transparent;\n margin-right: 10px;\n ">','</button>\n <button class="gjs-btn-prim" @click=',">","</button>\n </div>\n </footer>"],["<main>\n ",'\n </main><footer style="\n display: flex;\n justify-content: space-between;\n margin-top: 30px;\n ">\n <div>\n <label class="gjs-field gjs-field-checkbox" style="\n float: left;\n margin-right: 10px;\n ">\n <input type="checkbox" id="remember" @click=','>\n <i class="gjs-chk-icon"></i>\n </label>\n <label for="remember">Don\'t ask me again</label>\n </div>\n <div>\n <button\n class="gjs-btn-prim"\n @click=','\n style="\n margin-left: auto;\n background: transparent;\n margin-right: 10px;\n ">','</button>\n <button class="gjs-btn-prim" @click=',">","</button>\n </div>\n </footer>"])),km(n),(function(t){var e=t.target;return u=e.value}),(function(){return e.Modal.close()}),s,(function(){a(),localStorage.setItem(l,u),e.Modal.close()}),o),c)}}var Nm=function(t){function e(e){var n=t.call(this,e)||this;if(n.options=e,n.lastPos=null,n.lastTarget=null,!e.model)throw new Error("Could not create Symbol: model is required");return e.model.on("add update remove",(function(){return n.render()})),e.editor.on("component:selected",(function(){return n.render()})),e.editor.on("sorter:drag",(function(t){n.lastPos=t.pos,n.lastTarget=t.target})),n.el=document.createElement("div"),n.el.classList.add("symbols__wrapper"),document.querySelector(e.appendTo).appendChild(n.el),n.render(),n}return jm(e,t),e.prototype.render=function(){var t=this,e=this.model,n=this.options.editor.getSelected();return Tm(am(Rm||(Rm=Pm(["\n <style>\n .symbols__symbol-selected {\n border: 1px solid ",';\n }\n .symbols__symbol {\n position: relative;\n }\n .symbols__num {\n font-size: xx-small;\n }\n .symbols__empty {\n padding: 10px;\n text-align: center;\n width: 100%;\n }\n .symbols__remove {\n position: absolute;\n top: 0; right: 0;\n width: 20px;\n line-height: 1;\n cursor: pointer;\n }\n </style>\n <main class="symbols__list" @dragend=','>\n <div class="gjs-blocks-c">\n ',"\n ","\n </div>\n </main>\n "],["\n <style>\n .symbols__symbol-selected {\n border: 1px solid ",';\n }\n .symbols__symbol {\n position: relative;\n }\n .symbols__num {\n font-size: xx-small;\n }\n .symbols__empty {\n padding: 10px;\n text-align: center;\n width: 100%;\n }\n .symbols__remove {\n position: absolute;\n top: 0; right: 0;\n width: 20px;\n line-height: 1;\n cursor: pointer;\n }\n </style>\n <main class="symbols__list" @dragend=','>\n <div class="gjs-blocks-c">\n ',"\n ","\n </div>\n </main>\n "])),this.options.highlightColor,(function(e){return t.onDrop(e)}),e.map((function(e){return am($m||($m=Pm(['\n <div\n class="gjs-block gjs-one-bg gjs-four-color-h symbols__symbol\n ',"\n fa ",'\n "\n title="" draggable="true"\n symbol-id=','>\n <div title="Unlink all instances and delete Symbol" class="symbols__remove" @click=','>\n <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>\n </div>\n <div class="gjs-block-label">\n ','\n <div class="symbols__num">\n '," instances\n </div>\n </div>\n </div>\n "],['\n <div\n class="gjs-block gjs-one-bg gjs-four-color-h symbols__symbol\n ',"\n fa ",'\n "\n title="" draggable="true"\n symbol-id=','>\n <div title="Unlink all instances and delete Symbol" class="symbols__remove" @click=','>\n <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>\n </div>\n <div class="gjs-block-label">\n ','\n <div class="symbols__num">\n '," instances\n </div>\n </div>\n </div>\n "])),n&&e.get("instances").has(n.cid)?"symbols__symbol-selected":"",e.attributes.icon,e.cid,(function(e){return t.onRemove(e)}),e.attributes.label,e.get("instances").size)})),e.length?"":am(Dm||(Dm=Pm(['<div class="symbols__empty">\n ',"\n </div>"],['<div class="symbols__empty">\n ',"\n </div>"])),this.options.emptyText)),this.el),this},e.prototype.onDrop=function(t){var e=t.target.getAttribute("symbol-id");if(e){var n=this.options.editor.Symbols.get(e);n?this.options.editor.runCommand("symbols:create",{symbol:n,pos:this.lastPos,target:this.lastTarget}):console.error("Could not create an instance of symbol ".concat(e,": symbol not found"))}},e.prototype.onRemove=function(t){var e=this,n=t.target;Mm({editor:this.options.editor,title:"Delete Symbol",content:"\n <p>Are you sure you want to delete this symbol?</p>\n <p>Deleting this symbol <em>will not</em> delete its instances, just disconnects them. Confirm to proceed or cancel to maintain the current link.</p>\n ",primaryLabel:"Delete",cbk:function(){e.onRemoveConfirm(n)},lsKey:"delete-symbol"})},e.prototype.onRemoveConfirm=function(t){var e,n=null===(e=function(t){for(var e=t;e&&!e.getAttribute("symbol-id");)e=e.parentElement;return e}(t))||void 0===e?void 0:e.getAttribute("symbol-id");n?this.options.editor.runCommand("symbols:remove",{symbolId:n}):console.error("not a symbol",n)},e}(hv().View);const Lm=Nm;var Im,$m,Dm,Rm,Hm;!function(t){t.CREATE="symbols:create",t.REMOVE="symbols:remove",t.LINK="symbols:link",t.UNLINK="symbols:unlink",t.CREATE_INSTANCE="symbols:create:instance",t.DELETE_INSTANCE="symbols:delete:instance"}(Hm||(Hm={}));var Fm,Vm="symbols:add",Um="symbols:unlink";function Bm(t,e,n){var r=n.label,o=n.icon,i=n.component,s=void 0===i?t.getSelected():i;if(s&&r&&o){var a=t.Symbols.add(function(t,e,n){var r,o=null!==(r=n.symbolId)&&void 0!==r?r:"s_".concat((0,gv.uniqueId)(),"_").concat((new Date).getTime()),i=Pv(e);!function(t,e){var n=e.icon,r=e.label,o=e.symbolId;if(t.has(yv))throw new Error("Could not init Symbol model: the model has already been init");t.set(yv,o),t.set("icon",'<span class="fa '.concat(n,'"></span>'));var i=t.get("toolbar");i.find((function(t){return!!t.isSymbol}))||i.push({attributes:{class:"fa fa-ban on fa-diamond",title:r},command:"do:nothing",isSymbol:!0}),Av(t).forEach((function(t){return Cv(t)}))}(e,mv(mv({},n),{symbolId:o}));var s=new _v(mv(mv({},n),{id:o,model:e.clone()}));if(s.addInstance(e),i){var a=xv(i),l=t.Symbols.get(a);Ev(e).forEach((function(t){l.getAll(null,i).forEach((function(n){var r,i=kv(n,t.get(bv));console.log("otherChild",null===(r=null==i?void 0:i.view)||void 0===r?void 0:r.el,null==i?void 0:i.get(yv),null==i?void 0:i.get(bv)),null==i||i.set(yv,o),null==i||i.set(bv,t.get(bv)),t===e&&s.addInstance(i)}))}))}return s}(t,s,{label:r,icon:o}));return Ov(t),t.trigger(Hm.CREATE,{symbol:a}),a}throw console.error("Can not create the symbol: missing required param",{label:r,icon:o,component:s}),new Error("Can not create the symbol: missing required param")}function zm(t,e,n){var r=n.symbolId;if(r){if(t.Symbols.has(r)){var o=t.Symbols.remove(r),i=o.get("instances");return o.unlinkAll(),Ov(t),i.forEach((function(e){return t.trigger(Hm.UNLINK,{symbol:o,component:e})})),t.trigger(Hm.REMOVE,{symbol:o}),o}throw new Error("Could not remove symbol: symbol not found")}throw new Error("Could not remove symbol: missing param symbolId")}function Wm(t,e,n){var r=n.component;if(!r)throw new Error("Can not unlink the component: missing param component");var o=t.Symbols.get(xv(r));o?(o.unlink(r),Ov(t),t.trigger(Hm.UNLINK,{symbol:o,component:r})):console.warn("Can not unlink component",r,"Symbol not found")}function qm(t,e,n){var r=n.symbol,o=n.pos,i=n.target;if(o=o||{},r&&o&&i){var s=i?i.getAttribute("id"):void 0;if(!s)throw new Error("Can not create the symbol: missing param id");var a=i?t.Components.allById()[s]:void 0;if(a){if(Lv({target:r.get("model"),parent:a})){var l=(a?a.append([r.createInstance()],{at:o.index}):[])[0];return t.trigger(Hm.LINK,{symbol:r,component:l}),t.trigger(Hm.CREATE_INSTANCE,{symbol:r,component:l}),l}return function(t){var e,n,r=document.createElement("div");t.Modal.open({title:"Error: can not create the symbol",content:r}),Tm(am(Fm||(e=["<main>\n <p>",'</p>\n </main><footer style="\n display: flex;\n justify-content: space-between;\n margin-top: 30px;\n ">\n <div></div>\n <button class="gjs-btn-prim" @click=',">Close</button>\n </footer>"],n=["<main>\n <p>",'</p>\n </main><footer style="\n display: flex;\n justify-content: space-between;\n margin-top: 30px;\n ">\n <div></div>\n <button class="gjs-btn-prim" @click=',">Close</button>\n </footer>"],Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,Fm=e),km("<p>One of the parent is in the symbol.</p><p>Please remove the parent from the symbol and try again.</p>"),(function(){return t.Modal.close()})),r)}(t),null}return console.error("Can not create the symbol: parent not found"),null}throw new Error("Can not create the symbol: missing param symbol or pos or target")}var Gm;function Km(t,e){function n(t,e,n){e.set(wv,n),r(t,e)}function r(r,o){var i,s,a,l=o&&xv(o);if(l){var c=!1!==o.get(wv);r.style.display="initial",Tm(am(Gm||(s=['<fieldset class="gjs-trt-trait__wrp gjs-trt-trait__wrp-title" style="\n border-color: ',';\n padding: 10px;\n ">\n <legend class="fa fa-ban on fa-diamond"> <em>','</em></legend>\n <div class="gjs-field">\n <button\n class="gjs-btn-prim gjs-btn--full"\n style="\n margin: 10px 0;\n border: 1px solid ',';\n "\n @click=','>Unlink</button>\n <div class="gjs-radio-items">\n <label class="gjs-radio-item">\n <input type="radio" name="sync" value="on" @click='," ?checked=",'/>\n <span class="gjs-radio-item-label" style="color: ','">ON</span>\n </label>\n <label class="gjs-radio-item">\n <input type="radio" name="sync" value="off" @click='," ?checked=",'/>\n <span class="gjs-radio-item-label" style="color: ','">OFF</span>\n </label>\n </div>\n </fieldset>'],a=['<fieldset class="gjs-trt-trait__wrp gjs-trt-trait__wrp-title" style="\n border-color: ',';\n padding: 10px;\n ">\n <legend class="fa fa-ban on fa-diamond"> <em>','</em></legend>\n <div class="gjs-field">\n <button\n class="gjs-btn-prim gjs-btn--full"\n style="\n margin: 10px 0;\n border: 1px solid ',';\n "\n @click=','>Unlink</button>\n <div class="gjs-radio-items">\n <label class="gjs-radio-item">\n <input type="radio" name="sync" value="on" @click='," ?checked=",'/>\n <span class="gjs-radio-item-label" style="color: ','">ON</span>\n </label>\n <label class="gjs-radio-item">\n <input type="radio" name="sync" value="off" @click='," ?checked=",'/>\n <span class="gjs-radio-item-label" style="color: ','">OFF</span>\n </label>\n </div>\n </fieldset>'],Object.defineProperty?Object.defineProperty(s,"raw",{value:a}):s.raw=a,Gm=s),e.primaryColor,null===(i=t.Symbols.get(l))||void 0===i?void 0:i.get("label"),e.primaryColor,(function(){return function(e){Mm({editor:t,title:"Unlink from symbol",content:"\n <p>Are you sure you want to unlink this component from the symbol? This is a <em>definitive action<em></p>\n <p>Unlinking this component <em>will not</em> delete the symbol, just disconnects it. Confirm to proceed or cancel to maintain the current link.</p>\n ",primaryLabel:"Unlink",cbk:function(){t.runCommand(Um,{component:e})},lsKey:"unlink-symbol"})}(o)}),(function(){return n(r,o,!0)}),c,c?e.highlightColor:e.primaryColor,(function(){return n(r,o,!1)}),!c,c?e.primaryColor:e.highlightColor),r)}else r.style.display="none"}t.TraitManager.addType("symbol-trait",{noLabel:!0,createInput:function(e){e.trait;var n=document.createElement("div");return Object.values(Hm).forEach((function(e){return t.on(e,(function(){return r(n)}))})),r(n),n},onUpdate:function(t){r(t.elInput,t.component)}}),t.on("component:selected",(function(t){t&&xv(t)&&t.addTrait({type:"symbol-trait",name:"Symbol"})}))}var Ym=function(){return Ym=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ym.apply(this,arguments)},Xm=Vm;const Jm=function(t,e){void 0===e&&(e={});var n=Ym({appendTo:"#symbols",emptyText:"No symbol yet.",primaryColor:"#b9a5a6",secondaryColor:"#463a3c",highlightColor:"#d97aa6"},e);!function(t){t.on("storage:start:store",(function(e){e.symbols=t.Symbols.toJSON()})),t.on("storage:end:load",(function(e){e.symbols&&(t.Symbols.reset(),t.Symbols.set(e.symbols),t.Symbols.updateComponents(function(t){var e=[];return t.Pages.getAll().forEach((function(t){t.getMainComponent().onAll((function(t){return e.push(t)}))})),e}(t)))}))}(t),t.Symbols=new Hv([],{options:n,editor:t}),t.on("load",(function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];new Lm(Ym(Ym({},n),{editor:t,model:t.Symbols})),function(t,e){void 0===e&&(e={}),t.Commands.add(Vm,Bm),t.Commands.add("symbols:remove",zm),t.Commands.add(Um,Wm),t.Commands.add("symbols:create",qm)}(t,n),Km(t,n)}))};var Zm=n(924),Qm=n.n(Zm),ty=n(190),ey=n.n(ty);const ny="symbol-prompt-add";class ry extends Error{httpStatusCode;constructor(t,e){super(t),this.httpStatusCode=e,console.info("API error",e,t)}}const oy={};var iy,sy,ay,ly,cy,uy;!function(t){t.PX="px"}(iy||(iy={})),function(t){t.HTML="html",t.ASSET="asset",t.CSS="css",t.OTHER="other"}(sy||(sy={})),function(t){t.HTML="html",t.CSS="css"}(ay||(ay={})),function(t){t.STORAGE="STORAGE",t.HOSTING="HOSTING"}(ly||(ly={})),function(t){t.IN_PROGRESS="IN_PROGRESS",t.SUCCESS="SUCCESS",t.ERROR="ERROR"}(cy||(cy={})),function(t){t.PUBLICATION_PUBLISH="/api/publication/",t.PUBLICATION_STATUS="/api/publication/publication/status",t.CONNECTOR_USER="/api/connector/user",t.CONNECTOR_LOGOUT="/api/connector/logout",t.CONNECTOR_LIST="/api/connector/",t.WEBSITE_READ="/api/website/",t.WEBSITE_WRITE="/api/website/",t.WEBSITE_DELETE="/api/website/",t.WEBSITE_DUPLICATE="/api/website/duplicate",t.WEBSITE_CREATE="/api/website/",t.WEBSITE_LIST="/api/website/",t.WEBSITE_ASSETS_READ="/api/website/assets",t.WEBSITE_ASSETS_WRITE="/api/website/assets",t.WEBSITE_META_READ="/api/website/meta",t.WEBSITE_META_WRITE="/api/website/meta"}(uy||(uy={}));let py=window.location.origin+window.location.pathname.replace(/\/$/,"");function dy(t){py=t}function fy(){return py}async function hy({type:t,connectorId:e}){return ky(uy.CONNECTOR_USER,"GET",{type:t,connectorId:e})}async function gy({type:t,connectorId:e}){return ky(uy.CONNECTOR_LOGOUT,"POST",{connectorId:e,type:t})}async function vy({websiteId:t,hostingId:e,storageId:n,data:r,options:o}){const{url:i,job:s}=await ky(uy.PUBLICATION_PUBLISH,"POST",{websiteId:t,hostingId:e,storageId:n,options:o},r);return[i,s]}async function my({jobId:t}){return ky(uy.PUBLICATION_STATUS,"GET",{jobId:t})}async function yy({type:t}){return await ky(uy.CONNECTOR_LIST,"GET",{type:t})}async function by({connectorId:t}){return ky(uy.WEBSITE_LIST,"GET",{connectorId:t})}async function wy({websiteId:t,connectorId:e}){return ky(uy.WEBSITE_READ,"GET",{websiteId:t,connectorId:e})}async function _y({websiteId:t,data:e,connectorId:n}){const{message:r}=await ky(uy.WEBSITE_WRITE,"POST",{websiteId:t,connectorId:n},e)}async function xy({websiteId:t,connectorId:e}){await ky(uy.WEBSITE_DELETE,"DELETE",{websiteId:t,connectorId:e})}async function Cy({websiteId:t,connectorId:e}){await ky(uy.WEBSITE_DUPLICATE,"POST",{websiteId:t,connectorId:e})}async function Sy({websiteId:t,data:e,connectorId:n}){await ky(uy.WEBSITE_CREATE,"PUT",{connectorId:n},e)}async function Ty({websiteId:t,data:e,connectorId:n}){await ky(uy.WEBSITE_META_WRITE,"POST",{websiteId:t,connectorId:n},e)}async function Oy({websiteId:t,connectorId:e}){return ky(uy.WEBSITE_META_WRITE,"GET",{websiteId:t,connectorId:e})}async function Ay({path:t,websiteId:e,connectorId:n}){return ky(`${uy.WEBSITE_ASSETS_READ}/${t}`,"GET",{websiteId:e,connectorId:n})}async function Ey({websiteId:t,connectorId:e,files:n}){const{data:r}=await ky(uy.WEBSITE_ASSETS_WRITE,"POST",{websiteId:t,connectorId:e},n);return r}async function ky(t,e,n,r){const o=`${py}${t.toString()}?${new URLSearchParams(Object.entries(n).filter((([t,e])=>!!e)).map((([t,e])=>[t,"string"==typeof e?e:JSON.stringify(e)]))).toString()}`,i=await fetch(o,{method:e,headers:{"Content-Type":"application/json"},body:r&&JSON.stringify(r),credentials:"include"});if(!i.ok){let t;try{t=await i.json()}catch(t){throw new ry(i.statusText,i.status)}throw new ry(t.message,i.status)}return i.json()}const Py="silex:auth:login",jy="silex:auth:logout",My="silex:auth:logging-in",Ny="silex:auth:logged-in",Ly="silex:auth:login-failed",Iy="silex:auth:logged-out";async function $y(t){return t.getModel().get("user")}async function Dy(t,e,n){const r=await hy({type:e,connectorId:n});return t.getModel().set("user",r),r}const Ry=window.location.origin+window.location.pathname.replace(/\/$/,"");let Hy=!1,Fy=null;function Vy(t,e){function n(){Hy&&(t.Modal.close(),Hy=!1)}async function r(){if(t.trigger(My),Hy=!0,t.Modal.open({title:"Login",content:'<div id="LoginDialog__content"></div>'},{closeOnConfirm:!1,closeOnEscape:!1,closeOnOverlayClick:!1}),Fy=document.querySelector("#LoginDialog__content"),!Fy)throw new Error("Dialog creation failed");return Tm(am`Logging in...`,Fy),i((async t=>o(t)))}async function o(e){const s=e.find((t=>t.isLoggedIn));if(s)try{const e=await Dy(t,s.type,s.connectorId);return t.trigger(Ny,e),n()}catch(t){console.error("Error with updating login status",t),Tm(am`
|
|
76
|
-
<main>
|
|
77
|
-
<p>There was an error with updating the login status. ${t.message}</p>
|
|
78
|
-
</main>
|
|
79
|
-
<footer>
|
|
80
|
-
<button class="silex-button silex-button--primary" @click=${()=>i((async t=>o(t)))}>Retry</button>
|
|
81
|
-
<button class="silex-button" @click=${async()=>{await gy({type:s.type,connectorId:s.connectorId}),r()}}>Login with another connector</button>
|
|
82
|
-
</footer>
|
|
83
|
-
`,Fy)}else Tm(am`
|
|
84
|
-
<main>
|
|
85
|
-
<p>Login and give Silex access to a file storage.</p>
|
|
86
|
-
${e.map((e=>am`
|
|
87
|
-
<button
|
|
88
|
-
class="silex-button silex-button--primary"
|
|
89
|
-
id="publish-button--primary"
|
|
90
|
-
@click=${()=>async function(e){const o=`${Ry}${f}${h}${y}?connectorId=${e.connectorId}&type=${e.type}`;return window.open(e.oauthUrl??o,"_blank"),new Promise((o=>{Tm(am`
|
|
91
|
-
<main>
|
|
92
|
-
<p>Waiting for your authorization in popup window...</p>
|
|
93
|
-
</main>
|
|
94
|
-
<footer>
|
|
95
|
-
<button type="button" class="gjs-btn-prim" @click=${()=>r()}>Cancel</button>
|
|
96
|
-
</footer>
|
|
97
|
-
`,Fy);const i=async o=>{const s=o.data;if("login"===s?.type){window.removeEventListener("message",i);const{connectorId:o,error:a,message:l}=s;if(a)console.error("login error",l),Tm(am`
|
|
98
|
-
<main>
|
|
99
|
-
<p>Login failed with error: ${l}</p>
|
|
100
|
-
<footer>
|
|
101
|
-
<button type="button" class="gjs-btn-prim" @click=${()=>r()}>Retry</button>
|
|
102
|
-
${o?am`<button class="silex-button" @click=${async()=>{await gy({type:e.type,connectorId:o}),r()}}>Login with another connector</button>`:""}
|
|
103
|
-
|
|
104
|
-
</footer>
|
|
105
|
-
`,Fy),t.trigger(Ly);else try{Tm(am`
|
|
106
|
-
<main>
|
|
107
|
-
<p>Loging in...</p>
|
|
108
|
-
</main>
|
|
109
|
-
<footer>
|
|
110
|
-
</footer>
|
|
111
|
-
`,Fy);const r=await Dy(t,e.type,o);t.trigger(Ny,r),n()}catch(t){console.error("Error with loading login status",t),Tm(am`
|
|
112
|
-
<main>
|
|
113
|
-
An error occured, could not get your data.
|
|
114
|
-
${t.message}
|
|
115
|
-
</main>
|
|
116
|
-
<footer>
|
|
117
|
-
<button type="button" class="gjs-btn-prim" @click=${()=>r()}>Retry</button>
|
|
118
|
-
<button class="silex-button" @click=${async()=>{await gy({type:e.type,connectorId:o}),r()}}>Login with another connector</button>
|
|
119
|
-
</footer>
|
|
120
|
-
`,Fy)}}};window.addEventListener("message",i,!1)}))}(e)}
|
|
121
|
-
>Login with ${e.displayName}</button>
|
|
122
|
-
`))}
|
|
123
|
-
</main>
|
|
124
|
-
<footer>
|
|
125
|
-
</footer>
|
|
126
|
-
`,Fy)}async function i(t){try{const e=await yy({type:ly.STORAGE});await t(e)}catch(e){console.error("Error with loading storage connectors",e),Tm(am`
|
|
127
|
-
<main>
|
|
128
|
-
An error occured while loading the storage connectors: ${e.message}
|
|
129
|
-
</main>
|
|
130
|
-
<footer>
|
|
131
|
-
<button type="button" class="gjs-btn-prim" @click=${()=>i(t)}>Retry</button>
|
|
132
|
-
</footer>
|
|
133
|
-
`,Fy)}}t.Commands.add(Py,{async run(t){await r()},stop(t){n()}}),t.Commands.add(jy,{async run(t){await gy({type:ly.STORAGE}),t.getModel().set("user",null),t.trigger(Iy)}}),t.on(Iy,(async()=>r()))}let Uy,By=[];const zy=(t,e)=>{e={labelSrc:"Image URL",placeholderSrc:"https://example.com/image.jpg",replacedElements:["img"],...e},t.TraitManager.addType("src",{events:{change:"onChange"},templateInput:()=>`\n <div class="gjs-field gjs-field-trad">\n <label class="gjs-label">${e.labelSrc}</label>\n <input type="text" class="gjs-field" placeholder="${e.placeholderSrc}" />\n </div>\n `,getInputEl(){return this.inputEl||(this.inputEl=this.templateInput()),this.inputEl},onValueChange(){this.setValue(this.getInputEl().value)},setValue(t){this.getInputEl().value=t},getValue(){return this.getInputEl().value}}),t.DomComponents.addType("image",{model:{defaults:{...t.DomComponents.getType("image").model.prototype.defaults,traits:[...t.DomComponents.getType("image").model.prototype.defaults.traits.filter((t=>!["href","tag-name","src"].includes(t.name))),"src"]}}}),t.on("load",(()=>{const n=t.StyleManager.addSector("object",{name:"Object",open:!1,properties:[{label:"object-fit",property:"object-fit",type:"select",default:"",options:[{id:"",label:""},{id:"fill",label:"fill"},{id:"contain",label:"contain"},{id:"cover",label:"cover"},{id:"none",label:"none"},{id:"scale-down",label:"scale-down"},{id:"initial",label:"initial"},{id:"inherit",label:"inherit"},{id:"auto",label:"auto"}]},{label:"object-position",property:"object-position",type:"select",default:"",options:[{id:"",label:""},{id:"left top",label:"left top"},{id:"left center",label:"left center"},{id:"left bottom",label:"left bottom"},{id:"right top",label:"right top"},{id:"right center",label:"right center"},{id:"right bottom",label:"right bottom"},{id:"center top",label:"center top"},{id:"center center",label:"center center"},{id:"center bottom",label:"center bottom"},{id:"initial",label:"initial"},{id:"inherit",label:"inherit"},{id:"unset",label:"unset"}]}]},{at:1});let r=!1;t.on("component:selected",(t=>{t&&e.replacedElements.includes(t.get("tagName")?.toLowerCase())?r=!0:(r=!1,n.set("visible",!1))})),n.on("change:visible",((t,e)=>{n.get("visible")!==r&&n.set("visible",r)}))}))},Wy=(t,e={})=>{const n={time:1e3,...e},r=t.StorageManager.getCurrentStorage(),o=t.StorageManager.getCurrentOptions();t.StorageManager.setCurrent("rate-limit");let i=!1,s=!1,a=null;window.addEventListener("beforeunload",(t=>{s&&(t.preventDefault(),t.returnValue="")}));const l=async(e,n)=>{c();try{n&&(t.trigger("storage:start",e),t.trigger("storage:start:store",e)),await r.store(e,o),n&&(t.trigger("storage:end"),t.trigger("storage:end:store",e),t.trigger("storage:store",e))}catch(e){if(!n)throw e;t.trigger("storage:error",e),t.trigger("storage:error:store",e),t.trigger("storage:end")}},c=()=>{i=!0,setTimeout((async()=>{if(s){s=!1;const t=a;a=null,await l(t,!0)}else i=!1}),n.time)};t.Storage.add("rate-limit",{async store(t){i?(s=!0,a=t):await l(t,!1)},load:async t=>r.load(o)})};var qy=n(912),Gy=n.n(qy),Ky=n(215),Yy=n.n(Ky),Xy=n(756),Jy=n.n(Xy),Zy=n(175),Qy=n.n(Zy);const{I:tb}=Cm,eb=t=>void 0===t.strings,nb={},rb=(t,e)=>{const n=t._$AN;if(void 0===n)return!1;for(const t of n)t._$AO?.(e,!1),rb(t,e);return!0},ob=t=>{let e,n;do{if(void 0===(e=t._$AM))break;n=e._$AN,n.delete(t),t=e}while(0===n?.size)},ib=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(void 0===n)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),lb(e)}};function sb(t){void 0!==this._$AN?(ob(this),this._$AM=t,ib(this)):this._$AM=t}function ab(t,e=!1,n=0){const r=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(r))for(let t=n;t<r.length;t++)rb(r[t],!1),ob(r[t]);else null!=r&&(rb(r,!1),ob(r));else rb(this,t)}const lb=t=>{2==t.type&&(t._$AP??=ab,t._$AQ??=sb)};class cb extends Am{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),ib(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(rb(this,t),ob(this))}setValue(t){if(eb(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const ub=()=>new pb;class pb{}const db=new WeakMap,fb=Om(class extends cb{render(t){return cm}update(t,[e]){const n=e!==this.Y;return n&&void 0!==this.Y&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),cm}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.Y){const e=this.ht??globalThis;let n=db.get(e);void 0===n&&(n=new WeakMap,db.set(e,n)),void 0!==n.get(this.Y)&&this.Y.call(this.ht,void 0),n.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){return"function"==typeof this.Y?db.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});let hb;const gb="pages:open-panel",vb="pages:add";function mb(t,e){t.Pages.select(e)}function yb(t,e){const n=t.Pages.getAll();let r=1;const o=(e.getName()||"main")+" copy";let i=o;for(;n.find((t=>t.getName()===i));)i=`${o} ${r++}`;const s=e.getMainComponent().clone(),a=t.Pages.add({name:i,component:s});t.Pages.select(a)}function bb(t,e){if(1===t.Pages.getAll().length)console.error("can not delete the only page");else{const n="main"===e.get("type"),r=t.Pages.getSelected()===e;t.Pages.remove(e.id);const o=t.Pages.getAll()[0];n&&o.set("type","main"),r&&mb(t,o)}}const wb=(t,e)=>{const n=document.createElement("div");n.classList.add("pages__wrapper");const r=()=>Tm(function(t,e){const n=t.Pages.getAll(),r=t.Pages.getSelected(),o=e=>{const n=e.target.hasAttribute("data-page-id")?e.target:e.target.parentNode;return e.stopPropagation(),t.Pages.get(n.getAttribute("data-page-id"))};return am`<section class="pages">
|
|
134
|
-
<main class="pages__main ${1===n.length?"pages__single-page":""}">
|
|
135
|
-
<div class="pages__list">
|
|
136
|
-
${n.map((n=>{const i=n.getName()||n.attributes.type;return am`
|
|
137
|
-
<div class="pages__page ${r===n?"pages__page-selected":""}" data-page-id=${n.id} @click=${e=>mb(t,o(e))}>
|
|
138
|
-
<div class="pages__page-name">
|
|
139
|
-
${i}
|
|
140
|
-
</div>
|
|
141
|
-
<i class="pages__icon pages__remove-btn fa fa-trash" @click=${e=>bb(t,o(e))}></i>
|
|
142
|
-
<i class="pages__icon pages__clone-btn fa fa-clone" @click=${e=>yb(t,o(e))}></i>
|
|
143
|
-
<i class="pages__icon fa fa-cog" @click=${n=>function(t,e,n){t.runCommand(e.cmdOpenSettings,{page:n})}(t,e,o(n))}></i>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
`}))}
|
|
147
|
-
</div>
|
|
148
|
-
${n.length?"":am`<div class="flex-row">
|
|
149
|
-
No page yet.
|
|
150
|
-
</div>
|
|
151
|
-
`}
|
|
152
|
-
</main></section>`}(t,e),n);t.on("page",(()=>{r()})),t.on("load",(()=>{hb=!1,document.querySelector(e.appendTo).appendChild(n),r(),t.Commands.add(vb,(()=>function(t,e){const n=t.Pages.getAll();let r=1;const o=e.newPageName||"New page";let i=o;for(;n.find((t=>t.getName()===i));)i=`${o} ${r++}`;const s=t.Pages.add({name:i});t.Pages.select(s),t.runCommand(e.cmdOpenNewPageDialog,{page:s})}(t,e))),t.Commands.add("pages:remove",(()=>function(t,e){const n=document.createElement("div"),r=t.Modal.open({title:"Are you sure?",content:n});Tm(am`
|
|
153
|
-
<p>Do you really want to remove this page?</p>
|
|
154
|
-
<footer>
|
|
155
|
-
<button
|
|
156
|
-
${fb((t=>{console.log("focus",t),setTimeout((()=>t.focus()))}))}
|
|
157
|
-
@click=${()=>{bb(t,e),r.close()}}
|
|
158
|
-
class="silex-button silex-button--primary">Delete page</button>
|
|
159
|
-
<button
|
|
160
|
-
@click=${()=>r.close()}
|
|
161
|
-
class="silex-button silex-button--secondary">Cancel</button
|
|
162
|
-
</footer>
|
|
163
|
-
`,n)}(t,t.Pages.getSelected()))),t.Commands.add("pages:clone",(()=>yb(t,t.Pages.getSelected()))),t.Commands.add("pages:select-next",(()=>function(t){const e=t.Pages.getAll(),n=t.Pages.getSelected(),r=e.indexOf(n);r<e.length-1?mb(t,e[r+1]):mb(t,e[0])}(t))),t.Commands.add("pages:select-prev",(()=>function(t){const e=t.Pages.getAll(),n=t.Pages.getSelected(),r=e.indexOf(n);mb(t,r>0?e[r-1]:e[e.length-1])}(t))),t.Commands.add("pages:select-first",(()=>mb(t,t.Pages.getAll()[0])))}))},_b=Om(class extends Am{constructor(t){if(super(t),3!==t.type&&1!==t.type&&4!==t.type)throw Error("The `live` directive is not allowed on child or event bindings");if(!eb(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===lm||e===cm)return e;const n=t.element,r=t.name;if(3===t.type){if(e===n[r])return lm}else if(4===t.type){if(!!e===n.hasAttribute(r))return lm}else if(1===t.type&&n.getAttribute(r)===e+"")return lm;return((t,e=nb)=>{t._$AH=e})(t),e}}),xb=document.createElement("div");let Cb;const Sb="new-page-dialog",Tb="project-bar-panel",Ob="project-bar-container",Ab=(t,e)=>{const n=t.Panels.addPanel({id:Ob,visible:!1,buttons:[{id:"resizeBlocks",className:"viewsOptionsProjectPanel__size-btn",command:"resize-ProjectPanel",attributes:{title:"Resize Project Panel"}}]});t.Commands.add("resize-ProjectPanel",{run:(t,e)=>{document.documentElement.style.setProperty("--viewsProjectPanelWidth","26%")},stop:(t,e)=>{document.documentElement.style.setProperty("--viewsProjectPanelWidth","13%")}}),t.Panels.addPanel({id:Tb,buttons:e.panels,visible:!0}),e.panels.map((e=>function(t,e){const n=t.Panels.getPanel(Ob),r=document.createElement("div");if(e.attributes.containerClassName){r.classList.add("project-bar__panel",e.attributes.containerClassName,"gjs-hidden");const o=e.name??e.attributes.title;o&&Tm(am`
|
|
164
|
-
<header class="project-bar__panel-header">
|
|
165
|
-
<h3 class="project-bar__panel-header-title">${o}</h3>
|
|
166
|
-
${e.buttons?.map((e=>am`
|
|
167
|
-
<div
|
|
168
|
-
class="project-bar__panel-header-button ${e.className}"
|
|
169
|
-
@click=${n=>t.runCommand(e.command)}
|
|
170
|
-
><span>${e.text}</span></div>
|
|
171
|
-
`))}
|
|
172
|
-
</header>
|
|
173
|
-
`,r),document.body.appendChild(r),t.on("load",(()=>{n.view.el.appendChild(r)}))}"string"==typeof e.command&&t.Commands.add(e.command,{run(){e.attributes.containerClassName&&(n.set("visible",!0),r.classList.remove("gjs-hidden"),document.body.classList.add("silex-squeeze-left"),t.refresh()),e.onClick&&e.onClick(t),r.classList.remove("project-bar__dirty")},stop(){e.attributes.containerClassName&&(n.set("visible",!1),r.classList.add("gjs-hidden"),document.body.classList.remove("silex-squeeze-left"),t.refresh()),e.onClick&&e.onClick(t),r.classList.remove("project-bar__dirty")}})}(t,e))),t.on("stop:preview",(()=>{n.set("visible",!1),Eb(t)})),t.on("load device:select page",(()=>{Eb(t)}))};function Eb(t){t.Panels.getPanel(Ob).get("visible")?document.body.classList.add("silex-squeeze-left"):document.body.classList.remove("silex-squeeze-left"),t.refresh()}const kb="settings-head-wrapper";function Pb(t){return!!t.getHtml}const jb=[{id:"general",label:"General",render:(t,e)=>am`
|
|
174
|
-
<div id="settings-general" class="silex-hideable">
|
|
175
|
-
<div class="gjs-sm-sector-title">General</div>
|
|
176
|
-
<div class="silex-form__group col2">
|
|
177
|
-
<label class="silex-form__element">
|
|
178
|
-
<h3>${Pb(e)?"Site name":"Page name"}</h3>
|
|
179
|
-
<p class="silex-help">${Pb(e)?"The project name in the editor, for you to remember what it is about.":"Label of the page in the editor, and file name of the published HTML page."}</p>
|
|
180
|
-
<input type="text" name="name" .value=${_b(e.get("name")||"")}/>
|
|
181
|
-
</label>
|
|
182
|
-
<label class="silex-form__element">
|
|
183
|
-
<h3>Website language</h3>
|
|
184
|
-
<p class="silex-help">This is the default language code for this website. Example: en, fr, es...</p>
|
|
185
|
-
<input type="text" name="lang" .value=${_b(t.lang||"")}/>
|
|
186
|
-
</label>
|
|
187
|
-
</div>
|
|
188
|
-
</div>
|
|
189
|
-
`},{id:"seo",label:"SEO",render:(t,e)=>am`
|
|
190
|
-
<div id="settings-seo" class="silex-hideable silex-hidden">
|
|
191
|
-
<div class="gjs-sm-sector-title">SEO</div>
|
|
192
|
-
<div class="silex-form__group col2">
|
|
193
|
-
<label class="silex-form__element">
|
|
194
|
-
<h3>Title</h3>
|
|
195
|
-
<p class="silex-help">Title of the browser window, and title in the search engines results. It is used by search engines to find out what your site is talking about. The title should be a maximum of 70 characters long, including spaces.</p>
|
|
196
|
-
<input type="text" name="title" .value=${_b(t.title||"")}/>
|
|
197
|
-
</label>
|
|
198
|
-
<label class="silex-form__element">
|
|
199
|
-
<h3>Description</h3>
|
|
200
|
-
<p class="silex-help">Description displayed by the search engines in search results. It is used by search engines to find out what your site is talking about. It is best to keep meta descriptions between 150 and 160 characters.</p>
|
|
201
|
-
<input type="text" name="description" .value=${_b(t.description||"")}/>
|
|
202
|
-
</label>
|
|
203
|
-
<label class="silex-form__element">
|
|
204
|
-
<h3>Favicon</h3>
|
|
205
|
-
<p class="silex-help">Small image displayed in the browser's address bar and in tabs. The recommended size is 16×16 or 32×32 pixels. This can be a URL or a relative path.</p>
|
|
206
|
-
<input type="text" name="favicon" .value=${_b(t.favicon||"")}/>
|
|
207
|
-
</label>
|
|
208
|
-
</div>
|
|
209
|
-
</div>
|
|
210
|
-
`},{id:"social",label:"Social",render:(t,e)=>am`
|
|
211
|
-
<div id="settings-social" class="silex-hideable silex-hidden">
|
|
212
|
-
<div class="gjs-sm-sector-title">Social</div>
|
|
213
|
-
<div class="silex-help">
|
|
214
|
-
<p>Once your website is live, you can use these tools to test sharing: <a target="_blank" href="https://developers.facebook.com/tools/debug/">Facebook</a>,
|
|
215
|
-
<a target="_blank" href="https://cards-dev.twitter.com/validator">Twitter</a>,
|
|
216
|
-
<a target="_blank" href="https://www.linkedin.com/post-inspector/inspect/">Linkedin</a></p>
|
|
217
|
-
</div>
|
|
218
|
-
<div class="silex-form__group col2">
|
|
219
|
-
<label class="silex-form__element">
|
|
220
|
-
<h3>Title</h3>
|
|
221
|
-
<p class="silex-help">The title of your website displayed when a user shares your website on a social network.
|
|
222
|
-
Do not include any branding in this title, just eye-catching phrase, e.g. "Learn everything about fishing".
|
|
223
|
-
Title should be between 60 and 90 characters long.</p>
|
|
224
|
-
<input type="text" name="og:title" .value=${_b(t["og:title"]||"")}/>
|
|
225
|
-
</label>
|
|
226
|
-
<label class="silex-form__element">
|
|
227
|
-
<h3>Description</h3>
|
|
228
|
-
<p class="silex-help">Description displayed when a user shares your website on a social network. Make it catchy, and invite readers to visit your website too, e.g. "Sam's website about fishing, check it out!" Title should be between 60 and 90 characters long.</p>
|
|
229
|
-
<input type="text" name="og:description" .value=${_b(t["og:description"]||"")}/>
|
|
230
|
-
</label>
|
|
231
|
-
<label class="silex-form__element">
|
|
232
|
-
<h3>Image</h3>
|
|
233
|
-
<div class="silex-help">
|
|
234
|
-
<p>Thumbnail image which is displayed when your website is shared on a social network. The optimal size is 1200×627 pixels. At this size, your thumbnail will be big and stand out from the crowd. But do not exceed the 5MB size limit. If you use an image that is smaller than 400 pixels x 209 pixels, it will render as a much smaller thumbnail.</p>
|
|
235
|
-
<p>Please enter the full URL here, e.g. "http://mysite.com/path/to/image.jpg"</p>
|
|
236
|
-
</div>
|
|
237
|
-
<input type="text" name="og:image" .value=${_b(t["og:image"]||"")}/>
|
|
238
|
-
</label>
|
|
239
|
-
</div>
|
|
240
|
-
</div>
|
|
241
|
-
`},{id:"code",label:"Code",render:(t,e)=>am`
|
|
242
|
-
<div id="settings-code" class="silex-hideable silex-hidden">
|
|
243
|
-
<div class="gjs-sm-sector-title">Code</div>
|
|
244
|
-
<div class="silex-form__group">
|
|
245
|
-
<label class="silex-form__element" id="${kb}">
|
|
246
|
-
<h3>HTML head</h3>
|
|
247
|
-
<p class="silex-help">HTML code which will be inserted in the HEAD tag.</p>
|
|
248
|
-
</label>
|
|
249
|
-
</div>
|
|
250
|
-
</div>
|
|
251
|
-
`}];var Mb;!function(t){t.STARTUP_START="silex:startup:start",t.STARTUP_END="silex:startup:end",t.GRAPESJS_START="silex:grapesjs:start",t.GRAPESJS_END="silex:grapesjs:end",t.PUBLICATION_UI_OPEN="silex:publication-ui:open",t.PUBLICATION_UI_CLOSE="silex:publication-ui:close",t.PUBLISH_BEFORE="silex:publish:before",t.PUBLISH_START="silex:publish:start",t.PUBLISH_PAGE="silex:publish:page",t.PUBLISH_DATA="silex:publish:data",t.PUBLISH_END="silex:publish:end",t.PUBLISH_ERROR="silex:publish:error",t.PUBLISH_LOGIN_START="silex:publish:login:start",t.PUBLISH_LOGIN_END="silex:publish:login:end",t.ASSET_WRITE_END="silex:asset:write:end",t.WRITE_END="silex:write:end",t.SETTINGS_OPEN="silex:settings:open",t.SETTINGS_CLOSE="silex:settings:close",t.SETTINGS_SAVE_START="silex:settings:save:start",t.SETTINGS_SAVE_END="silex:settings:save:end",t.SETTINGS_SECTION_CHANGE="silex:settings:section-change"}(Mb||(Mb={}));const Nb=[...jb],Lb=[...jb],Ib=document.createElement("div");let $b;const Db="open-settings";let Rb,Hb=null;function Fb(t){const e=Ib.querySelector("aside.silex-bar").querySelector("ul.silex-list--menu"),n=e.querySelector("li#settings-sidebar-"+t.id);if(Rb=t,!n)return console.warn("Cannot find section",t.id,"in the side bar, fallback to the first section"),jb[0]&&jb[0].id!==t.id?void Fb(jb[0]):void console.error("Cannot find the default section in the side bar");Array.from(e.querySelectorAll(".active")).forEach((t=>t.classList.remove("active"))),n.classList.add("active");const r=Ib.querySelector("main#settings__main"),o=r.querySelector(`#settings-${t.id}`);if(!o)return console.warn("Cannot find section",t.id,"in the settings dialog, fallback to the first section"),jb[0]&&jb[0].id!==t.id?void Fb(jb[0]):void console.error("Cannot find the default section in the settings dialog");Array.from(r.querySelectorAll(".silex-hideable")).forEach((t=>t.classList.add("silex-hidden"))),o.classList.remove("silex-hidden"),Hb.refresh()}function Vb(t,e){const n=t.head.querySelector(`.${e}`);if(n)return n;const r=t.createElement("div");return r.classList.add(e),t.head.appendChild(r),r}function Ub(t){const e=t.Canvas.getDocument(),n=t.getModel().get("settings"),r=t.Pages.getSelected().get("settings");e&&n&&setTimeout((()=>{Vb(e,"site-head").innerHTML=n.head||"",Vb(e,"page-head").innerHTML=r?.head||""}))}function*Bb(t,e){if(void 0!==t){let n=0;for(const r of t)yield e(r,n++)}}const zb=["DIV","P","H1","H2","H3","H4","H5","H6","SPAN","MAIN","ASIDE","SECTION","ADDRESS","ARTICLE","BUTTON","NAV","HEADER","FOOTER","DETAILS","SUMMARY","PRE","BLOCKQUOTE"],Wb={name:"orderedList",icon:"1.",attributes:{title:"Ordered List"},result:t=>t.exec("insertOrderedList")},qb={name:"unorderedList",icon:"•",attributes:{title:"Unordered List"},result:t=>t.exec("insertUnorderedList")};function Gb(t){return(t||"index").toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}function Kb(t){return`./${Gb(t)}.html`}const Yb=[{id:"",name:"-"},{id:"url",name:"URL"},{id:"email",name:"Email"},{id:"page",name:"Page"}],Xb=(t,e)=>{function n(e){t.Pages.getAll().forEach((t=>{t.getMainComponent().onAll(e)}))}function r(t){switch(t){case"email":return"mailto:";case"page":return Kb(null);case"url":return"https://"}}function o(e,n=""){const i=function(t){return 0===t.indexOf("mailto:")?"email":0===t.indexOf("./")?"page":t?"url":""}(n),s=function(e,n){switch(e){case"email":const e=n.replace("mailto:","").split("?"),r=e[0],o=(e[1]||"").split("&").reduce(((t,e)=>{const n=e.split("=");return t[n[0]]=n[1],t}),{});return am`<div class="href-next__email-inputs">
|
|
252
|
-
<label for="href-next__email" class="gjs-one-bg silex-label">Email address</label>
|
|
253
|
-
<input class="href-next__email" placeholder="Insert email" type="email" value=${r||""}/>
|
|
254
|
-
<label for="href-next__email-subject" class="gjs-one-bg silex-label">Subject</label>
|
|
255
|
-
<input class="href-next__email-subject" placeholder="Insert subject" value=${o.subject||""}/>
|
|
256
|
-
</div>`;case"page":return am`<div class="href-next__page-inputs">
|
|
257
|
-
<label for="href-next__page" class="gjs-one-bg silex-label">Page name</label>
|
|
258
|
-
<select id="href-next__page" class="href-next__page">
|
|
259
|
-
${Bb(t.Pages.getAll(),(t=>am`<option
|
|
260
|
-
?selected=${Kb(t.getName())===n}
|
|
261
|
-
value=${Kb(t.getName())}>
|
|
262
|
-
${t.getName()||"Main"}
|
|
263
|
-
</option>`))}
|
|
264
|
-
</select>
|
|
265
|
-
</div>`;case"url":return am`<div class="href-next__url-inputs">
|
|
266
|
-
<label for="href-next__url" class="gjs-one-bg silex-label">URL</label>
|
|
267
|
-
<input class="href-next__url" placeholder="Insert URL" type="url" value=${n}/>
|
|
268
|
-
</div>`;default:return""}}(i,n);Tm(am`
|
|
269
|
-
<label for="href-next__type" class="gjs-one-bg silex-label">Type</label>
|
|
270
|
-
<select id="href-next__type" class="href-next__type" @change=${t=>o(e,r(t.target.value))}>
|
|
271
|
-
${Bb(Yb,(t=>am`
|
|
272
|
-
<option value="${t.id}" ?selected=${i===t.id}>${t.name}</option>
|
|
273
|
-
`))}
|
|
274
|
-
</select>
|
|
275
|
-
${s}
|
|
276
|
-
`,e)}function i(e){o(e,t.getSelected()?.getAttributes().href||"")}t.on("page",(({event:e,page:r})=>{if(r)switch(e){case"change:name":n((t=>{t.getAttributes().href===Kb(r.previous("name"))&&t.setAttributes({href:Kb(r.get("name"))})}));break;case"remove":const e=[];n((t=>{t.getAttributes().href===Kb(r.previous("name"))&&e.push(t)})),e.length&&e.forEach((e=>{t.runCommand("notifications:add",{type:"error",message:`Page ${r.previous("name")} was removed, please fix the following links:`,componentId:e.getId(),group:"Broken internal links"})}))}})),t.DomComponents.getTypes().map((e=>{t.DomComponents.addType(e.id,{model:{defaults:{traits:[...t.DomComponents.getType(e.id).model.prototype.defaults.traits.filter((t=>t.name?"href"!==t.name:"href"!==t)),{label:"Link",type:"href-next",name:"href"}]}}})})),t.TraitManager.addType("href-next",{createInput({trait:e}){const n=document.createElement("div");return t.on("page",(()=>i(n))),i(n),n},onEvent({elInput:t,component:e,event:n}){let o="";switch(t.querySelector(".href-next__type").value){case"page":const e=t.querySelector(".href-next__page")?.value;o=e||r("page");break;case"url":const n=t.querySelector(".href-next__url")?.value;o=n||r("url");break;case"email":const i=t.querySelector(".href-next__email")?.value,s=t.querySelector(".href-next__email-subject")?.value;o=i?`mailto:${i}${s?`?subject=${s}`:""}`:r("email");break;default:o=""}if(e.addAttributes({href:o}),""===o){if("A"===e.get("tagName").toUpperCase()){const t=e.get("originalTagName")??"DIV",n="A"===t.toUpperCase()?"SPAN":t;e.set("tagName",n)}}else"A"!==e.get("tagName").toUpperCase()&&(e.set("originalTagName",e.get("tagName")),e.set("tagName","A"))},onUpdate({elInput:t,component:e}){o(t,e.getAttributes().href||"")}})};function Jb(t,e){t.Pages.getAll().forEach((t=>{t.getMainComponent().onAll((t=>e(t)))}))}async function Zb(t){if(null!=crypto.subtle){const e=(new TextEncoder).encode(t),n=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(n)).map((t=>t.toString(16).padStart(2,"0"))).join("")}return"local"}function Qb(t){t.select(t.DomComponents.getWrapper())}function tw(t){if("submit"===t.getAttribute("type"))return!1;const e="INPUT"===t.tagName,n=["TEXTAREA","OPTION","OPTGROUP","SELECT","BUTTON"].includes(t.tagName);return e||n}function ew(t,e=" "){return t.split(e).map((t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())).join(e)}function nw(t,e,n,r){const o=t.Panels.getButton(e,n);o.set("active",r??!o.get("active"))}function rw(t){const e=t.PublicationManager.dialog,n=t.Panels.getPanel("project-bar-panel");t.Modal.isOpen()?t.Modal.close():e&&e.isOpen?e.closeDialog():n.buttons.some((t=>t.get("active")))?function(t){t.Panels.getPanels().get("project-bar-panel").buttons.forEach((t=>t.set("active",!1)))}(t):Qb(t)}const ow="select-body";let iw="shift";const sw={kmOpenSettings:{id:"general:open-settings",keys:"alt+s",handler:t=>nw(t,"project-bar-panel","settings-dialog-btn")},kmOpenPublish:{id:"general:open-publish",keys:"alt+p",handler:t=>nw(t,"options","publish-button")},kmOpenFonts:{id:"general:open-fonts",keys:"alt+f",handler:t=>nw(t,"project-bar-panel","font-dialog-btn")},kmPreviewMode:{id:"general:preview-mode",keys:"tab",handler:t=>function(t,e){if(t.getEditing())return;if(t.Modal.isOpen())return;const n=document.activeElement;n&&"INPUT"===n.tagName&&"submit"===n.getAttribute("type")||n&&tw(n)||e()}(t,(()=>nw(t,"options","preview")))},kmLayers:{id:"panels:layers",keys:iw+"+l",handler:t=>nw(t,"project-bar-panel","layer-manager-btn")},kmBlocks:{id:"panels:blocks",keys:iw+"+a",handler:t=>nw(t,"project-bar-panel","block-manager-btn")},kmNotifications:{id:"panels:notifications",keys:iw+"+n",handler:t=>nw(t,"project-bar-panel","notifications-btn")},kmPages:{id:"panels:pages",keys:iw+"+p",handler:t=>nw(t,"project-bar-panel","page-panel-btn")},kmSymbols:{id:"panels:symbols",keys:iw+"+s",handler:t=>nw(t,"project-bar-panel","symbols-btn")},kmStyleManager:{id:"panels:style-manager",keys:"r",handler:t=>nw(t,"views","open-sm",!0)},kmTraitsManager:{id:"panels:traits",keys:"t",handler:t=>nw(t,"views","open-tm",!0)},kmClosePanel:{id:"panels:close-panel",keys:"escape",handler:rw},kmSelectBody:{id:"workflow:select-body",keys:iw+"+b",handler:ow},kmDuplicateSelection:{id:"workflow:duplicate-selection",keys:"ctrl+d",handler:"tlb-clone"},kmPublish:{id:"workflow:publish",keys:"ctrl+alt+p",handler:function(t){nw(t,"options","publish-button",!0),t.runCommand("publish")}},kmAddPage:{id:"pages:add-page",keys:"ctrl+alt+n",handler:"pages:add"},kmRemovePage:{id:"pages:remove-page",keys:"ctrl+alt+backspace",handler:"pages:remove"},kmClonePage:{id:"pages:clone-page",keys:"ctrl+alt+d",handler:"pages:clone"},kmSelectNextPage:{id:"pages:select-next",keys:"ctrl+alt+j",handler:"pages:select-next"},kmSelectPrevPage:{id:"pages:select-previous",keys:"ctrl+alt+k",handler:"pages:select-prev"},kmSelectFirstPage:{id:"pages:select-first",keys:"ctrl+alt+h",handler:"pages:select-first"}};function aw(t,e){if(t.Commands.add(ow,Qb),e.disableKeymaps)return;e.prefixKey&&(iw=e.prefixKey);const n=t.Keymaps;for(const t in sw)n.add(sw[t].id,sw[t].keys,sw[t].handler,{prevent:!0,...sw[t].options});document.addEventListener("keydown",(e=>{if(e.key.toLowerCase()===sw.kmClosePanel.keys){const n=e.target;if(t.getEditing())return;t.Modal.isOpen()?t.Modal.close():n&&("INPUT"===n.tagName&&"submit"===n.getAttribute("type")?rw(t):tw(n)&&n.blur())}}))}const lw="publish-open-dialog";function cw(t){return t[t.length-1]?.map((t=>t.replace(/\[.*\]/g,"").trim()))?.filter((t=>!!t))?.join("\n")}class uw{editor;options;isOpen=!1;errorMessage="";el;settings;sender=null;constructor(t,e){this.editor=t,this.options=e,this.el=this.createDialogElements();const n=()=>this.openDialog(),r=()=>this.closeDialog(),o=t=>this.sender=t;t.Commands.add(lw,{run(t,e){o(e),n()},stop(t){r()}})}isSuccess(t){return t===Mw.STATUS_SUCCESS}isPending(t){return t===Mw.STATUS_PENDING}isError(t){return t===Mw.STATUS_ERROR}isLoggedOut(t){return t===Mw.STATUS_LOGGED_OUT}isReady(t){return t===Mw.STATUS_NONE}userContent=null;setUserContent(t){this.userContent=t}createDialogElements(){const t=document.createElement("div");return t.id="publish-dialog",t.className="silex-dialog-inline silex-dialog gjs-two-color",document.body.append(t),setTimeout((()=>{this.editor.Panels.addButton(this.options.appendTo,{id:"publish-button",className:"silex-button--size publish-button",command:lw,attributes:{title:`Publish (${ew(sw.kmOpenPublish.keys,"+")})`},label:'<span class="fa-solid fa-upload"></span><span class="silex-button--small">Publish</span>'})})),t}move(t){Object.keys(t).forEach((e=>this.el.style[e]=t[e]+"px"))}async renderDialog(t,e){try{if(this.isOpen&&(!e||!this.settings))throw new Error("PublicationUi: open but no status or settings");if(Tm(am`
|
|
277
|
-
${this.isOpen?this.settings.connector?await this.renderOpenDialog(t,e):await this.renderLoginDialog(e):""}
|
|
278
|
-
`,this.el),this.isOpen){this.el.classList.remove("silex-dialog-hide");const t=this.el.querySelector(".silex-button--primary");t&&t.focus()}else this.el.classList.add("silex-dialog-hide")}catch(t){console.error("Error while rendering the dialog",t)}}async renderOpenDialog(t,e){return am`
|
|
279
|
-
<header>
|
|
280
|
-
<span>${km('<svg width="100%" height="100%" viewBox="0 0 44 23" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"><g><g><path d="M2,11.427c0,0 3.846,-2.655 7.376,0c3.531,2.656 7.45,0 7.45,0" style="fill:none;stroke:#a291ff;stroke-width:4px;"/></g><path d="M32.165,6.424l9.156,0" style="fill:none;stroke:#a291ff;stroke-width:4px;"/><path d="M32.165,2l0,18.854" style="fill:none;stroke:#a291ff;stroke-width:4px;"/><path d="M32.165,16.43l9.156,0" style="fill:none;stroke:#a291ff;stroke-width:4px;"/><path d="M26.253,20.854c-5.203,0 -9.427,-4.224 -9.427,-9.427c-0,-5.203 4.224,-9.427 9.427,-9.427l5.912,-0l0,18.854l-5.912,0Z" style="fill:none;stroke:#a291ff;stroke-width:4px;"/></g></svg>')} Connected to <span class="connector">${this.settings.connector.displayName}</span></span>
|
|
281
|
-
${this.settings.connector.disableLogout?"":am`
|
|
282
|
-
<button
|
|
283
|
-
class="silex-button silex-button--secondary"
|
|
284
|
-
id="publish-button--secondary"
|
|
285
|
-
@click=${()=>this.editor.Commands.run(jw)}
|
|
286
|
-
>Disconnect
|
|
287
|
-
</button>`}
|
|
288
|
-
</header>
|
|
289
|
-
<main>
|
|
290
|
-
${this.userContent||am`
|
|
291
|
-
${this.isPending(e)?am`
|
|
292
|
-
<p>Publication in progress...</p>
|
|
293
|
-
`:""}
|
|
294
|
-
${this.isReady(e)?am`
|
|
295
|
-
<p>Click on the button below to publish your website.</p>
|
|
296
|
-
${this.settings.options&&Object.entries(this.settings.options).length&&am`<p>Publication options: <ul>${Object.entries(this.settings.options).map((([t,e])=>am`<li>${t}: ${e}</li>`))}</ul></p>`}
|
|
297
|
-
`:""}
|
|
298
|
-
${this.isSuccess(e)?am`
|
|
299
|
-
<h3 class="status">Publication success ${km('<svg viewBox="0 0 40 28" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"><path d="M3,12.969l11.868,11.869l21.838,-21.838" style="fill:none;stroke:#37bf76;stroke-width:6px;"/></svg>')}</h3>
|
|
300
|
-
${this.settings.options?.websiteUrl?am`<p><a href="${this.settings.options.websiteUrl}" target="_blank">Click here to view the published website</a></p>`:""}
|
|
301
|
-
`:""}
|
|
302
|
-
${this.isError(e)||this.isLoggedOut(e)?am`
|
|
303
|
-
<h3 class="status">Publication error ${km('<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"><g><path d="M3,28.915l25.915,-25.915" style="fill:none;stroke:#cf4443;stroke-width:6px;"/><path d="M28.915,28.915l-25.915,-25.915" style="fill:none;stroke:#cf4443;stroke-width:6px;"/></g></svg>')}</h3>
|
|
304
|
-
<details open>
|
|
305
|
-
<summary>Details</summary>
|
|
306
|
-
${km(this.errorMessage)}
|
|
307
|
-
</details>
|
|
308
|
-
`:""}
|
|
309
|
-
${t?.message?am`
|
|
310
|
-
<details open>
|
|
311
|
-
<summary>Details</summary>
|
|
312
|
-
${km(t.message)}
|
|
313
|
-
</details>
|
|
314
|
-
`:""}
|
|
315
|
-
${this.isPending(e)?am`
|
|
316
|
-
<progress
|
|
317
|
-
value=""
|
|
318
|
-
style="width: 100%;"
|
|
319
|
-
></progress>
|
|
320
|
-
`:""}
|
|
321
|
-
${t?.logs?.length&&t.logs[0].length?am`
|
|
322
|
-
<details>
|
|
323
|
-
<summary>Logs</summary>
|
|
324
|
-
<div class="logs">${km(cw(t.logs))}</div>
|
|
325
|
-
</details>
|
|
326
|
-
`:""}
|
|
327
|
-
${t?.errors?.length&&t.errors[0].length?am`
|
|
328
|
-
<details>
|
|
329
|
-
<summary>Errors</summary>
|
|
330
|
-
<pre style="
|
|
331
|
-
max-width: 100%;
|
|
332
|
-
font-size: x-small;
|
|
333
|
-
"
|
|
334
|
-
>${km(cw(t.errors))}
|
|
335
|
-
</pre>
|
|
336
|
-
</details>
|
|
337
|
-
`:""}
|
|
338
|
-
${this.isPending(e)||this.isLoggedOut(e)?"":am`
|
|
339
|
-
<button
|
|
340
|
-
class="silex-button silex-button--primary"
|
|
341
|
-
id="publish-button--primary"
|
|
342
|
-
@click=${()=>this.editor.Commands.run(kw)}
|
|
343
|
-
>Publish</button>
|
|
344
|
-
`}
|
|
345
|
-
`}
|
|
346
|
-
</main>
|
|
347
|
-
<footer>
|
|
348
|
-
${this.isLoggedOut(e)?am`
|
|
349
|
-
<button
|
|
350
|
-
class="silex-button silex-button--primary"
|
|
351
|
-
id="publish-button--primary"
|
|
352
|
-
@click=${()=>this.editor.Commands.run(Pw,this.settings.connector)}
|
|
353
|
-
>Connect</button>
|
|
354
|
-
`:""}
|
|
355
|
-
<a href="https://docs.silex.me/en/user/publish" target="_blank">Help</a>
|
|
356
|
-
<button
|
|
357
|
-
class="silex-button silex-button--secondary"
|
|
358
|
-
id="publish-button--secondary"
|
|
359
|
-
@click=${()=>this.editor.Commands.stop(lw)}
|
|
360
|
-
>Close</button>
|
|
361
|
-
</footer>
|
|
362
|
-
`}async renderLoginDialog(t){try{Tm(am`<main><p>Loading</p></main>`,this.el);const e=await yy({type:ly.HOSTING}),n=e.filter((t=>t.isLoggedIn));return 1===e.length&&1===n.length?(this.settings.connector=n[0],this.renderOpenDialog(null,Mw.STATUS_NONE)):am`
|
|
363
|
-
<main>
|
|
364
|
-
<p>You need to select a hosting connector to publish your website.</p>
|
|
365
|
-
${this.isError(t)||this.isLoggedOut(t)?am`
|
|
366
|
-
<p>Login error</p>
|
|
367
|
-
<div>${km(this.errorMessage)}</div>
|
|
368
|
-
`:""}
|
|
369
|
-
<div class="buttons">
|
|
370
|
-
${e.map((t=>am`
|
|
371
|
-
<button
|
|
372
|
-
class="silex-button"
|
|
373
|
-
id="publish-button--primary"
|
|
374
|
-
@click=${()=>this.editor.Commands.run(Pw,t)}
|
|
375
|
-
>${t.displayName}</button>
|
|
376
|
-
`))}
|
|
377
|
-
</div>
|
|
378
|
-
</main>
|
|
379
|
-
<footer>
|
|
380
|
-
<a href="https://docs.silex.me/en/user/publish" target="_blank">Help</a>
|
|
381
|
-
<button
|
|
382
|
-
class="silex-button silex-button--secondary"
|
|
383
|
-
id="publish-button--secondary"
|
|
384
|
-
@click=${()=>this.editor.Commands.stop(lw)}
|
|
385
|
-
>Close</button>
|
|
386
|
-
</footer>
|
|
387
|
-
`}catch(t){return console.error(t),am`
|
|
388
|
-
<header>
|
|
389
|
-
<h3>Oops</h3>
|
|
390
|
-
</header>
|
|
391
|
-
<main>
|
|
392
|
-
<p>Unable to load hosting connectors</p>
|
|
393
|
-
<p>Something went wrong: ${t.message}</p>
|
|
394
|
-
</main>
|
|
395
|
-
<footer>
|
|
396
|
-
<a href="https://docs.silex.me/en/user/publish" target="_blank">Help</a>
|
|
397
|
-
<button
|
|
398
|
-
class="silex-button silex-button--secondary"
|
|
399
|
-
id="publish-button--secondary"
|
|
400
|
-
@click=${()=>this.editor.Commands.stop(lw)}
|
|
401
|
-
>Close</button>
|
|
402
|
-
</footer>
|
|
403
|
-
`}}displayPending(t,e){this.errorMessage=null,this.renderDialog(t,e)}displayError(t,e,n){console.info(t),this.errorMessage=t,this.renderDialog(e,n)}async closeDialog(){this.isOpen=!1,this.renderDialog(null,null),this.sender&&"function"==typeof this.sender.set&&this.sender.set("active",0),this.sender=null,this.editor.trigger(Mb.PUBLICATION_UI_CLOSE,{publicationUi:this})}async toggleDialog(){this.isOpen?this.closeDialog():this.openDialog()}async openDialog(){this.isOpen=!0;const t=this.editor.Panels.getPanel("options")?.view.el.querySelector(".publish-button");if(t){const e=t.getBoundingClientRect(),n=450,r=20,o=50;this.move({left:e.right-n-r,top:e.bottom+10,width:n,minHeight:o})}else console.error("Unable to find publish button");this.renderDialog(null,Mw.STATUS_NONE),this.editor.trigger(Mb.PUBLICATION_UI_OPEN,{publicationUi:this})}}const pw="tmp-pre-publication-transformer-tohtml",dw="tmp-pre-publication-transformer-src",fw="tmp-pre-publication-transformer-attributes-src",hw="tmp-pre-publication-transformer-inline-css",gw="tmp-pre-publication-transformer-href",vw="tmp-pre-publication-transformer-tocss",mw={renderComponent:(t,e)=>e(),renderCssRule:(t,e)=>e(),transformPath:(t,e)=>t,transformPermalink(t,e,n){switch(n){case ay.HTML:return t;case ay.CSS:return`../${t.replace(/^\//,"")}`;default:throw new Error(`Unknown initiator ${n}`)}},transformFile:t=>t};function yw(t,e){return e.replace(/url\(([^)]+)\)/g,((e,n)=>{const r=n.replace(/['"]/g,"");return`url("${ww(t,r,sy.ASSET,ay.CSS)}")`}))}function bw(t,e){const n=e["background-image"];if(n){const r="string"==typeof n?yw(t,n):n.map((e=>yw(t,e)));return{...e,"background-image":r}}return e}function ww(t,e,n,r){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>e.transformPermalink?e.transformPermalink(t,n,r)??t:t),e)}function _w(t,e,n){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>e.transformPath?e.transformPath(t,n)??t:t),e)}const xw=window.location.pathname.replace(/\/$/,""),Cw=window.location.origin;function Sw(t,e,n){if(t.startsWith("/assets")){const r=new URL(t,Cw);return r.pathname=r.pathname.replace(/^\/assets/,""),r.pathname=`${xw}${f}${S}${j}${r.pathname}`,r.searchParams.set("websiteId",e),r.searchParams.set("connectorId",n),`${decodeURIComponent(r.pathname)}${r.search}`}return t.startsWith("<svg")||t.startsWith("data:image")||console.warn("storedToDisplayed: path is not a stored path",t),t}function Tw(t){const e=`${xw}${f}${S}${j}`;if(t.startsWith(e)){const n=new URL(t,Cw);n.pathname=n.pathname.replace(new RegExp(`^${e}`),""),n.pathname=`${xw}/assets${n.pathname}`,n.searchParams.delete("websiteId"),n.searchParams.delete("connectorId");const r="/"+n.toString().replace(new RegExp(`^${Cw}${xw}`),"").replace(/^\//,"");return decodeURIComponent(r)}return t.startsWith("<svg")||t.startsWith("data:image")||console.warn("displayedToStored: path is not a displayed path",t),t}const Ow={transformPath(t,e){if(e===sy.ASSET)return Tw(t)},transformPermalink(t,e){if(e===sy.ASSET)return Tw(t)}};function Aw(t,e,n){const r=t.attributes?.src?{...t,attributes:{...t.attributes,src:Sw(t.attributes.src,e,n)}}:t;return r.components&&(r.components=r.components.map((t=>Aw(t,e,n)))),r}function Ew(t){const e=t.attributes?.src?{...t,attributes:{...t.attributes,src:Tw(t.attributes.src)}}:t;return e.components&&(e.components=e.components.map((t=>Ew(t)))),e}const kw="publish",Pw="publish-login",jw="publish-logout";var Mw;function Nw(t,e){t.PublicationManager=new $w(t,e)}function Lw(t){switch(t){case cy.IN_PROGRESS:return Mw.STATUS_PENDING;case cy.ERROR:return Mw.STATUS_ERROR;case cy.SUCCESS:return Mw.STATUS_SUCCESS}throw new Error(`Unknown job status ${t}`)}!function(t){t.STATUS_NONE="STATUS_NONE",t.STATUS_PENDING="STATUS_PENDING",t.STATUS_ERROR="STATUS_ERROR",t.STATUS_SUCCESS="STATUS_SUCCESS",t.STATUS_LOGGED_OUT="STATUS_AUTH_ERROR"}(Mw||(Mw={}));const Iw=window.location.origin+window.location.pathname.replace(/\/$/,"");class $w{editor;dialog;_settings;get settings(){return this._settings}set settings(t){this._settings=t,this.dialog&&(this.dialog.settings=t)}options;job=null;status=Mw.STATUS_NONE;constructor(t,e){this.editor=t,this.options={appendTo:"options",...e},t.on("storage:start:store",(t=>{t.publication=this.settings})),t.on("storage:end:load",(t=>{this.settings=t.publication??{},hy({type:ly.HOSTING,connectorId:this.settings.connector?.connectorId}).then((t=>{})).catch((t=>{this.status=Mw.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login",this.job,this.status)}))})),t.Commands.add(kw,(()=>this.startPublication())),t.Commands.add(Pw,((t,e,n)=>this.goLogin(n))),t.Commands.add(jw,(()=>this.goLogout())),this.options.appendTo?this.dialog=new uw(t,{appendTo:this.options.appendTo}):console.info("PublicationUi is disabled because no appendTo option is set")}async goLogin(t){let e=!1;if(this.editor.trigger(Mb.PUBLISH_LOGIN_START,{connector:t,publicationManager:this,preventDefault:()=>e=!0}),e)return this.status=Mw.STATUS_NONE,void(this.dialog&&this.dialog.displayPending(this.job,this.status));if(t.isLoggedIn)return this.settings={...this.settings,connector:t},this.status=Mw.STATUS_NONE,void(this.dialog&&this.dialog.displayPending(this.job,this.status));this.settings={},this.status=Mw.STATUS_LOGGED_OUT,this.dialog&&this.dialog.displayPending(this.job,this.status);const n=t.connectorId,r=t.type;return window.open(t.oauthUrl||`${Iw}${f}${h}${y}?connectorId=${n}&type=${r}`,"_blank"),new Promise(((e,n)=>{const r=async o=>{const i=o.data;"login"===i?.type&&(window.removeEventListener("message",r),i.error?(this.status=Mw.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError(i.message,this.job,this.status),n(new Error(i.message))):(this.editor.trigger(Mb.PUBLISH_LOGIN_END),this.settings.connector=t,this.settings.options=i.options,this.status=Mw.STATUS_NONE,this.dialog&&this.dialog.displayPending(this.job,this.status),e()))};window.addEventListener("message",r,!1)}))}async goLogout(){try{await gy({type:ly.HOSTING,connectorId:this.settings.connector.connectorId}),this.settings={},this.dialog&&this.dialog.displayPending(this.job,this.status)}catch(t){console.error("logout error",t),this.status=Mw.STATUS_ERROR,this.dialog&&this.dialog.displayError(t.message,this.job,this.status)}}async getPublicationData(t,e,n){this.setPublicationTransformers();const r=(await this.getHtmlFiles(e,n)).flatMap((t=>[{path:t.htmlPath,content:t.html,type:sy.HTML},{path:t.cssPath,content:t.css,type:sy.CSS}])).concat(t.assets.map((t=>{const e=_w(this.editor,t.src,sy.ASSET),n=Tw(t.src).replace(/^\/assets\//,"");return{...t,path:e,src:n,type:sy.ASSET}}))),o={...t,assets:t.assets.map((t=>({...t,src:Tw(t.src)}))),settings:e,publication:this.settings,files:r};return this.resetPublicationTransformers(),function(t,e){const n=t.getModel().get("config");e.files=n.publicationTransformers.reduce(((t,n)=>t.map(((t,r)=>(e.pages[r],n.transformFile?n.transformFile(t)??t:t)))),e.files)}(this.editor,o),this.editor.trigger(Mb.PUBLISH_DATA,{data:o,preventDefault:n,publicationManager:this}),o}async startPublication(){try{if(this.status===Mw.STATUS_PENDING)throw new Error("Publication is already in progress");this.status=Mw.STATUS_PENDING,this.job=null,this.dialog&&this.dialog.displayPending(this.job,this.status);const t={...this.editor.getProjectData()},e={...this.editor.getModel().get("settings")};let n=!1;if(this.editor.trigger(Mb.PUBLISH_START,{projectData:t,siteSettings:e,preventDefault:()=>n=!0,publicationManager:this}),n)return this.status=Mw.STATUS_NONE,void(this.dialog&&this.dialog.displayPending(this.job,this.status));let r=!1;const o=await this.getPublicationData(t,e,(()=>r=!0));if(r)return this.status=Mw.STATUS_NONE,void(this.dialog&&this.dialog.displayPending(this.job,this.status));const i=this.editor.getModel().get("user");if(!i)throw new Error("User not logged in to a storage connector");if(!this.settings.connector?.connectorId)throw new Error("User not logged in to a hosting connector");const s=this.options.websiteId,a=i.storage.connectorId,[l,c]=await vy({websiteId:s,hostingId:this.settings.connector.connectorId,storageId:a,data:o,options:this.settings.options});console.info("Gitlab url: ",l),this.job=c,this.status=Lw(this.job.status),this.trackProgress()}catch(t){return console.error("publish error",t),401===t.code||401===t.httpStatusCode?(this.status=Mw.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login.",this.job,this.status)):(this.status=Mw.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status)),this.editor.trigger(Mb.PUBLISH_ERROR,{success:!1,message:t.message}),void this.editor.trigger(Mb.PUBLISH_END,{success:!1,message:t.message})}}async getHtmlFiles(t,e){return Promise.all(this.editor.Pages.getAll().map((async n=>{t={...t};const r={...n.get("settings")};function o(e){return(r||{})[e]||(t||[])[e]||""}const i=n.getMainComponent(),s=this.editor.getCss({component:i});console.time(`getHtml ${n.getId()} ${n.get("name")}`);const a=this.editor.getHtml({component:i});console.timeEnd(`getHtml ${n.getId()} ${n.get("name")}`);const l=Gb(n.get("name")),c=`/css/${l}-${await Zb(s)}.css`,u=`/${l}.html`,p=ww(this.editor,c,sy.CSS,ay.HTML),d=_w(this.editor,c,sy.CSS),f=_w(this.editor,u,sy.HTML);this.editor.trigger(Mb.PUBLISH_PAGE,{page:n,siteSettings:t,pageSettings:r,preventDefault:e,publicationManager:this});const h=o("title"),g=o("favicon");return{html:`<!DOCTYPE html>\n<html lang="${o("lang")}">\n<head>\n<meta charset="UTF-8">\n<link rel="stylesheet" href="${p}" />\n${t?.head||""}\n${r?.head||""}\n${h?`<title>${h}</title>`:""}\n${g?`<link rel="icon" href="${g}" />`:""}\n${["description","og:title","og:description","og:image"].filter((t=>!!o(t))).map((t=>`<meta name="${t}" property="${t}" content="${o(t)}"/>`)).join("\n")}\n</head>\n${a}\n</html>`,css:s,cssPath:d,htmlPath:f}})))}async trackProgress(){try{this.job=await my({jobId:this.job.jobId}),this.status=Lw(this.job.status)}catch(t){return this.status=Mw.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status),this.editor.trigger(Mb.PUBLISH_END,{success:!1,message:t.message}),void this.editor.trigger(Mb.PUBLISH_ERROR,{success:!1,message:t.message})}this.job.status===cy.IN_PROGRESS?setTimeout((()=>this.trackProgress()),2e3):this.editor.trigger(Mb.PUBLISH_END,{success:this.job.status===cy.SUCCESS,message:this.job.message}),this.dialog&&this.dialog.displayPending(this.job,this.status)}setPublicationTransformers(){!function(t){const e=t.getModel().get("config");Jb(t,(n=>{if(n.get(pw))console.warn("Publication transformer: HTML transform already altered",n);else{const r=n.toHTML.bind(n);n[pw]=n.toHTML;const o=n.getStyle.bind(n);n[hw]=n.getStyle;const i=n.get("attributes").href;if(i?.startsWith("./")&&(n[gw]=i,n.set("attributes",{...n.get("attributes"),href:ww(t,i,sy.HTML,ay.HTML)})),n.get("attributes").src){n[dw]=n.get("attributes").src;const e=ww(t,n.get("attributes").src,sy.ASSET,ay.HTML);n.set("attributes",{...n.get("attributes"),src:e})}if(n.get("src")){n[fw]=n.get("src");const e=ww(t,n.get("src"),sy.ASSET,ay.HTML);n.set("src",e)}n.toHTML=()=>e.publicationTransformers.reduce(((t,e)=>e.renderComponent?e.renderComponent(n,(()=>t))??t:t),r()),n.getStyle=()=>bw(t,o())}}))}(this.editor),function(t){const e=t.getModel().get("config");t.Css.getAll().forEach((n=>{if(n[vw])console.warn("Publication transformer: CSS transform already altered",n);else{const r=n.getStyle.bind(n);n[vw]=n.getStyle,n.getStyle=()=>{const n=bw(t,r()),o=e.publicationTransformers.reduce(((t,e)=>({...e.renderCssRule?e.renderCssRule(t,(()=>n))??t:t})),n);return o}}}))}(this.editor)}resetPublicationTransformers(){!function(t){Jb(t,(t=>{t[pw]&&(t.toHTML=t[pw],delete t[pw]),t[hw]&&(t.getStyle=t[hw],delete t[hw]),t[dw]&&(t.set("attributes",{...t.get("attributes"),src:t[dw]}),delete t[dw]),t[fw]&&(t.set("src",t[fw]),delete t[fw]),t[gw]&&(t.set("attributes",{...t.get("attributes"),href:t[gw]}),delete t[gw])}))}(this.editor),function(t){t.Css.getAll().forEach((t=>{t[vw]&&(t.getStyle=t[vw],delete t[vw])}))}(this.editor)}}const Dw="fa fa-fw fa-paste silex-button",Rw=" disabled",Hw="pause-auto-save";let Fw=null,Vw=!1;const Uw=document.createElement("div"),Bw=[{name:"./project-bar",value:Ab},{name:"grapesjs-style-bg",value:Yy()},{name:"./settings",value:(t,e)=>{t.Commands.add(Db,{run:(e,n,{page:r})=>{$b=t.Modal.open({title:r?"Page settings":"Site Settings",content:"",attributes:{class:"settings-dialog"}}).onceClose((()=>{n?.set&&n.set("active",0),t.stopCommand(Db)})),function(t,e,n=t.getModel()){const r=n.get("settings")||{};n.set("settings",r);const o=Pb(n)?Nb:Lb;Rb=Rb||o[0];const i=o.map((t=>{try{return t.render(r,n)}catch(e){return console.error("Error rendering settings section",t.id,e),am`<div class="silex-error">Error rendering settings section ${t.id}</div>`}}));Tm(am`
|
|
404
|
-
<form class="silex-form">
|
|
405
|
-
<div class="silex-help">
|
|
406
|
-
${Pb(n)?am`
|
|
407
|
-
<p>Here you can set the name of your website, SEO and social networks sharing data.</p>
|
|
408
|
-
<p>These settings are overriden by the page settings, <a href="https://github.com/silexlabs/Silex/wiki/Settings" target="_blank">more info about settings here</a>.</p>
|
|
409
|
-
`:am`
|
|
410
|
-
<p>Here you can set the name of your page, SEO and social networks sharing data.</p>
|
|
411
|
-
<p>These settings override the site settings, <a href="https://github.com/silexlabs/Silex/wiki/Settings" target="_blank">more info about settings here</a>.</p>
|
|
412
|
-
`}
|
|
413
|
-
</div>
|
|
414
|
-
<section class="silex-sidebar-dialog">
|
|
415
|
-
<aside class="silex-bar">
|
|
416
|
-
<ul class="silex-list silex-list--menu">
|
|
417
|
-
${o.map((e=>am`
|
|
418
|
-
<li
|
|
419
|
-
id="settings-sidebar-${e.id}"
|
|
420
|
-
class=${e.id===Rb.id?"active":""}
|
|
421
|
-
@click=${n=>{n.preventDefault(),Fb(e),t.trigger(Mb.SETTINGS_SECTION_CHANGE,e.id)}}
|
|
422
|
-
>
|
|
423
|
-
${e.label}
|
|
424
|
-
</li>
|
|
425
|
-
`))}
|
|
426
|
-
</ul>
|
|
427
|
-
</aside>
|
|
428
|
-
<main id="settings__main">
|
|
429
|
-
${i}
|
|
430
|
-
</main>
|
|
431
|
-
</section>
|
|
432
|
-
<footer>
|
|
433
|
-
<p class="silex-version">Silex ${I}</p>
|
|
434
|
-
<input class="silex-button" type="button" @click=${e=>t.stopCommand(Db)} value="Cancel">
|
|
435
|
-
<input class="silex-button" type="submit" value="Apply">
|
|
436
|
-
</footer>
|
|
437
|
-
</form>
|
|
438
|
-
`,Ib),Fb(Rb),Ib.querySelector(`#${kb}`)?.appendChild(Hb.getElement()),Hb.setContent(r.head||"")}(t,0,r),$b.setContent(Ib);const o=Ib.querySelector("form");return o.onsubmit=e=>{e.preventDefault(),t.trigger(Mb.SETTINGS_SAVE_START,r),function(t,e,n=t.getModel()){const r=Ib.querySelector("form"),o=new FormData(r),i=Array.from(o).reduce(((t,[e,n])=>(""!==n&&(t[e]=n),t)),{}),{name:s,...a}=i;n.set({settings:{...i,head:Hb.getContent()},name:s}),t.getModel().set("changesCount",t.getDirtyCount()+1),Ub(t)}(t,0,r),t.trigger(Mb.SETTINGS_SAVE_END,r),t.stopCommand(Db)},o.querySelector("input")?.focus(),t.trigger(Mb.SETTINGS_OPEN,r),$b},stop:()=>{$b.close(),t.trigger(Mb.SETTINGS_CLOSE)}}),t.on("storage:start:store",(e=>{e.settings=t.getModel().get("settings"),e.name=t.getModel().get("name")})),t.on("storage:end:load",(e=>{const n=t.getModel();n.set("settings",e.settings||{}),n.set("name",e.name),t.once("canvas:frame:load",(()=>{Ub(t)}))})),t.on("canvas:frame:load",(()=>{Ub(t)})),t.on("page",(e=>{Ub(t)})),Hb=t.CodeManager.createViewer({readOnly:!1,codeName:"htmlmixed",lineNumbers:!0,lineWrapping:!0,autoFormat:!1})}},{name:"@silexlabs/grapesjs-fonts",value:ey()},{name:"./new-page-dialog",value:(t,e)=>{t.Commands.add(Sb,{run:(e,n,{page:r})=>{Cb=t.Modal.open({title:"New Page",content:"",attributes:{class:"new-page-dialog"}}).onceClose((()=>{t.stopCommand(Sb)})),function(t,e,n){Tm(am`
|
|
439
|
-
<form class="silex-form">
|
|
440
|
-
<label class="silex-form__element">
|
|
441
|
-
<h3>Name</h3>
|
|
442
|
-
<input type="text" name="name" .value=${_b(n.getName()||"")}/>
|
|
443
|
-
</label>
|
|
444
|
-
<footer>
|
|
445
|
-
<input class="silex-button" type="button" @click=${e=>function(t,e){t.Pages.select(e),t.runCommand("gjs-open-import-webpage")}(t,n)} value="Import from website">
|
|
446
|
-
<input class="silex-button" type="button" @click=${e=>t.stopCommand(Sb)} value="Cancel">
|
|
447
|
-
<input class="silex-button" type="submit" value="Ok">
|
|
448
|
-
</footer>
|
|
449
|
-
</form>
|
|
450
|
-
`,xb)}(t,0,r),Cb.setContent(xb);const o=xb.querySelector("form");return o.onsubmit=e=>{e.preventDefault(),function(t,e,n){const r=xb.querySelector("form"),o=new FormData(r),i=Array.from(o).reduce(((t,[e,n])=>(t[e]=n,t)),{});n.set(i),t.getModel().set("changesCount",t.getDirtyCount()+1)}(t,0,r),t.stopCommand(Sb)},o.querySelector("input")?.focus(),Cb},stop:()=>{Cb.close()}})}},{name:"./page-panel",value:wb},{name:"grapesjs-blocks-basic",value:nv()},{name:"./blocks",value:(t,e)=>{const n="container";t.BlockManager.add(n,{label:"Container",category:"Basics",attributes:{class:"container-png"},content:{type:n,style:{"min-height":"100px"}}}),t.DomComponents.addType(n,{})}},{name:"./view-buttons",value:function(t){const[e,n]=t.Panels.addButton("options",[{id:"copy",className:"fa fa-fw fa-copy",command:"core:copy",attributes:{title:"Copy (Ctrl+C)"}},{id:"paste",className:Dw+Rw,command:"core:paste",attributes:{title:"Paste (Ctrl+V)"},active:!1}]);t.EditorModel.on("change:clipboard",((t,e)=>{const r=e&&e.length>0;n.set("className",Dw+(r?"":Rw))}))}},{name:"./semantic",value:(t,e)=>{function n(t,e){const r=zb.includes(e.toUpperCase())?zb:zb.concat(e.toUpperCase());Tm(am`
|
|
451
|
-
<label for="semantic__select" class="gjs-one-bg silex-label">Type</label>
|
|
452
|
-
<select id="semantic__select" @change=${e=>n(t,e.target.value)}>
|
|
453
|
-
${Bb(r,(t=>am`
|
|
454
|
-
<option value="${t}" ?selected=${e.toUpperCase()===t}>${t}</option>
|
|
455
|
-
`))}
|
|
456
|
-
</select>
|
|
457
|
-
`,t)}function r(e){n(e,t.getSelected()?.get("tagName")||"")}t.DomComponents.getTypes().map((e=>{t.DomComponents.addType(e.id,{model:{defaults:{traits:[...t.DomComponents.getType(e.id).model.prototype.defaults.traits,{label:"Tag name",type:"tag-name",name:"tag-name"}]}}})})),t.TraitManager.addType("tag-name",{createInput({trait:e}){const n=document.createElement("div");return t.on("page",(()=>r(n))),r(n),n},onEvent({elInput:t,component:e,event:n}){const r=t.querySelector("#semantic__select").value;e.get("tagName").toUpperCase()===r.toUpperCase()||e.set("tagName",r)},onUpdate({elInput:t,component:e}){n(t,e.get("tagName"))}})}},{name:"./rich-text",value:(t,e)=>{}},{name:"grapesjs-style-filter",value:ov()},{name:"grapesjs-plugin-forms",value:sv()},{name:"grapesjs-custom-code",value:lv()},{name:"./internal-links",value:Xb},{name:"./keymaps",value:aw},{name:"@silexlabs/grapesjs-ui-suggest-classes",value:uv()},{name:"@silexlabs/grapesjs-filter-styles",value:dv()},{name:"./symbolDialogs",value:(t,e)=>{t.Commands.add(ny,{run:(e,n)=>{const r=prompt("Label",function(e){let n=1;for(;t.Symbols.find((t=>t.get("label")===e+n));)n++;return e+n}("Symbol "));t.runCommand(Xm,{label:r,icon:"fa-gem"})}})}},{name:"@silexlabs/grapesjs-symbols",value:Jm},{name:"./PublicationManager",value:Nw},{name:"./storage",value:t=>{function e(e){const n="string"==typeof e?JSON.parse(e):e;if(console.error("Error with loading or saving website or uploading asset",n,n instanceof ry),!(n instanceof ry))return t.Modal.open({title:"Error",content:`An error occured.<br>${n.message}`});switch(console.error("ApiError",n.httpStatusCode,n.message),n.httpStatusCode){case 404:return t.Modal.open({title:"Website not found",content:`This website could not be found.<br><hr>${n.message}`});case 403:return t.Modal.open({title:"Access denied",content:`You are not allowed to access this website.<br><hr>${n.message}`});case 401:return void t.trigger(Iy);default:return t.Modal.open({title:"Error",content:`An error occured.<br>${n.message}`})}}t.Commands.add(Hw,{run:()=>{if(!t.StorageManager.isAutosave())throw new Error("Autosave is not enabled");t.StorageManager.setAutosave(!1)},stop:()=>{t.editor.set("changesCount",0),t.UndoManager.clear(),t.StorageManager.setAutosave(!0)}}),t.Storage.add("connector",{async load(e){try{const i=await $y(t)??await Dy(t,ly.STORAGE,e.connectorId);if(!i)throw new ry("Not logged in",401);const s=await wy({websiteId:e.id,connectorId:i.storage.connectorId});return s.assets&&(s.assets=(n=s.assets,r=e.id,o=i.storage.connectorId,n.map((t=>t.src?{...t,src:Sw(t.src,r,o)}:t)))),s.pages&&(s.pages=function(t,e,n){return t.map((t=>({...t,frames:t.frames.map((t=>({...t,component:Aw(t.component,e,n)})))})))}(s.pages,e.id,i.storage.connectorId)),s.styles&&(s.styles=function(t,e,n){return new RegExp(/(.*)(url\((["']?)([^"']+?)\1\))*(.*)/,"g"),t.map((t=>{if(t.style&&t.style["background-image"]){const r=t.style["background-image"].replace(/url\((['"]?)([^'"]+)\1\)/g,((t,r,o)=>`url(${r}${Sw(o,e,n)}${r})`));return{...t,style:{...t.style,"background-image":r}}}return t}))}(s.styles,e.id,i.storage.connectorId)),s}catch(n){throw t.UndoManager.clear(),401===n.httpStatusCode&&(t.once(Ny,(async()=>{try{t.runCommand(Hw);const n=await t.Storage.load(e);t.once("canvas:frame:load",(()=>t.stopCommand(Hw))),t.loadProjectData(n)}catch(t){throw console.error("connectorPlugin load error",t),t}})),t.Commands.run(Py)),console.error("connectorPlugin load error",n),n}var n,r,o},async store(t,e){const n={...t};return await this.addToQueue(n,e)},async addToQueue(t,e){return Fw=t,this.doStore(Fw,e)},async doStore(e,n){if(t.PublicationManager?.status===Mw.STATUS_PENDING)return new Promise((r=>{t.once(Mb.PUBLISH_END,(()=>{r(this.doStore(e,n))}))}));try{if(Vw)t.once("storage:start:store",(()=>{this.doStore(e,n)}));else if(Fw===e){Fw=null,Vw=!0;const r=await $y(t);r?(e.assets=e.assets.map((t=>t.src?{...t,src:Tw(t.src)}:t)),e.pages=function(t){return t.map((t=>({...t,frames:t.frames.map((t=>({...t,component:Ew(t.component)})))})))}(e.pages),e.styles=e.styles.map((t=>{if(t.style&&t.style["background-image"]){const e=t.style["background-image"].replace(/url\((['"]?)([^'"]+)\1\)/g,((t,e,n)=>`url(${e}${Tw(n)}${e})`));return{...t,style:{...t.style,"background-image":e}}}return t})),await _y({websiteId:n.id,connectorId:r.storage.connectorId,data:e}),Vw=!1):(t.once(Ny,(()=>(Vw=!1,t.Storage.store()))),t.Commands.run(Py))}}catch(t){throw console.error("connectorPlugin store error",t),Vw=!1,t}}}),t.on("storage:error:load",(t=>{e(t)})),t.on("storage:error:store",(t=>{e(t)})),t.on("asset:upload:end",(e=>{t.store()})),t.on("asset:upload:error",(t=>{e(t)}))}},{name:"./LoginDialog",value:Vy},{name:"@silexlabs/grapesjs-loading",value:Qm()},{name:"./breadcrumbs",value:function(t,e){let n;var r;function o(){let e=t.getSelected()??t.Pages.getSelected().getMainComponent();if(!n)return;for(n.innerHTML="";e;){const t=i(e);n.prepend(t),e=e.parent()}const r=document.createElement("span");r.innerHTML="<h3>Selection: </h3>",n.prepend(r)}function i(e){const n=document.createElement("span");return e.model,n.onclick=()=>{t.select(e)},n.classList.add("breadcrumb"),n.innerHTML=`<span>${e.getName()??e.get("tagName")}</span>`,n}r=t=>{n=document.createElement("div"),n.id="breadcrumbs-container",t.prepend(n);const e=document.createElement("style");e.innerHTML='\n #breadcrumbs-container {\n display: flex;\n align-items: center;\n height: 100%;\n padding: 0 10px;\n font-size: 12px;\n color: #999;\n overflow-x: auto;\n overflow-y: hidden;\n }\n #breadcrumbs-container h3 {\n font-size: inherit;\n margin: 0;\n }\n #breadcrumbs-container .breadcrumb {\n margin: 0 5px;\n font-size: 14px;\n line-height: 1;\n cursor: pointer;\n white-space: nowrap;\n }\n #breadcrumbs-container .breadcrumb::after {\n content: "➔";\n margin-left: 10px;\n }\n\n #breadcrumbs-container .breadcrumb:last-child::after {\n content: "";\n }\n ',t.prepend(e),o()},Uy?r(Uy):By.push(r),t.on("component:selected style:target component:drag:end",(()=>o()))}},{name:"./img",value:zy},{name:"./css-props",value:(t,e)=>{t.on("load",(()=>{t.StyleManager.removeProperty("general","display"),t.StyleManager.addProperty("general",{name:"Display",property:"display",type:"select",defaults:"",options:[{value:"",name:""},{value:"block",name:"block"},{value:"inline",name:"inline"},{value:"inline-block",name:"inline-block"},{value:"flex",name:"flex"},{value:"none",name:"none"}],info:""}),t.StyleManager.addProperty("general",{name:"Visibility",property:"visibility",type:"select",defaults:"",options:[{value:"",name:""},{value:"visible",name:"visible"},{value:"hidden",name:"hidden"},{value:"collapse",name:"collapse"}],info:"The visibility CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or columns in a <table>."}),t.StyleManager.removeProperty("general","float"),t.StyleManager.removeProperty("general","position"),t.StyleManager.addProperty("general",{name:"Position",property:"position",type:"select",defaults:"",full:!0,options:[{value:"",name:""},{value:"static",name:"static"},{value:"relative",name:"relative"},{value:"absolute",name:"absolute"},{value:"fixed",name:"fixed"}],info:""}),t.StyleManager.removeProperty("general","top"),t.StyleManager.addProperty("general",{name:"Top",property:"top",type:"number",defaults:"",units:["px","%","em","rem","vh","vw"],info:""}),t.StyleManager.removeProperty("general","bottom"),t.StyleManager.addProperty("general",{name:"Bottom",property:"bottom",type:"number",defaults:"",units:["px","%","em","rem","vh","vw"],info:""}),t.StyleManager.removeProperty("general","right"),t.StyleManager.addProperty("general",{name:"Right",property:"right",type:"number",defaults:"",units:["px","%","em","rem","vh","vw"],info:""}),t.StyleManager.removeProperty("general","left"),t.StyleManager.addProperty("general",{name:"Left",property:"left",type:"number",defaults:"",units:["px","%","em","rem","vh","vw"],info:""});const e=t.StyleManager.addProperty("general",{name:"Content",property:"content",type:"text",defaults:"",info:"The content CSS property replaces an element with a generated value. Objects inserted using the content property are anonymous replaced elements.",full:!0,visible:!1},{at:0});function n(){const n=t.SelectorManager.getState();["before","after"].includes(n)?e.set("visible",!0):e.set("visible",!1)}t.StyleManager.removeProperty("dimension","width"),t.StyleManager.addProperty("dimension",{name:"Width",property:"width",type:"integer",units:["px","%","em","rem","vh","vw"],default:"",fixedValues:["inherit","initial","unset","none","max-content","min-content","fit-content","auto"]},{at:0}),t.StyleManager.removeProperty("dimension","height"),t.StyleManager.addProperty("dimension",{name:"Height",property:"height",type:"integer",units:["px","%","em","rem","vh","vw"],default:"",fixedValues:["inherit","initial","unset","none","max-content","min-content","fit-content","auto"]},{at:1}),t.StyleManager.addProperty("dimension",{name:"Min width",property:"min-width",type:"integer",units:["px","%","em","rem","vh","vw"],default:"",fixedValues:["inherit","initial","unset","none","max-content","min-content","fit-content","auto"]},{at:2}),t.StyleManager.removeProperty("dimension","max-width"),t.StyleManager.addProperty("dimension",{name:"Max width",property:"max-width",type:"integer",units:["px","%","em","rem","vh","vw"],default:"",fixedValues:["inherit","initial","unset","none","max-content","min-content","fit-content","auto"]},{at:3}),t.StyleManager.removeProperty("dimension","min-height"),t.StyleManager.addProperty("dimension",{name:"Min height",property:"min-height",type:"integer",units:["px","%","em","rem","vh","vw"],default:"",fixedValues:["inherit","initial","unset","none","max-content","min-content","fit-content","auto"]},{at:4}),t.StyleManager.addProperty("dimension",{name:"Max height",property:"max-height",type:"integer",units:["px","%","em","rem","vh","vw"],default:"",fixedValues:["inherit","initial","unset","none","max-content","min-content","fit-content","auto"]},{at:5}),t.StyleManager.addProperty("dimension",{name:"Overflow",property:"overflow",type:"composite",properties:[{name:"Overflow X",type:"select",defaults:"",options:[{value:"",name:""},{value:"auto",name:"auto"},{value:"hidden",name:"hidden"},{value:"visible",name:"visible"},{value:"scroll",name:"scroll"}]},{name:"Overflow Y",type:"select",defaults:"",options:[{value:"",name:""},{value:"auto",name:"auto"},{value:"hidden",name:"hidden"},{value:"visible",name:"visible"},{value:"scroll",name:"scroll"}]}],info:"The overflow CSS property sets what to do when an element's content is too big to fit in its block formatting context. It is a shorthand for overflow-x and overflow-y."},{at:6}),t.StyleManager.removeProperty("dimension","margin"),t.StyleManager.addProperty("dimension",{name:"Margin",property:"margin",type:"composite",defaults:"",fixedValues:["initial","inherit","auto"],full:!0,properties:[{property:"margin-top",name:"Margin top",type:"number",default:"",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]},{property:"margin-right",name:"Margin right",type:"number",default:"",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]},{property:"margin-bottom",name:"Margin bottom",type:"number",default:"",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]},{property:"margin-left",name:"Margin left",type:"number",default:"",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]}]},{at:7}),t.StyleManager.removeProperty("dimension","padding"),t.StyleManager.addProperty("dimension",{name:"Padding",property:"padding",type:"composite",fixedValues:["initial","inherit","auto"],full:!0,properties:[{property:"padding-top",name:"Padding top",type:"number",default:"",value:"10",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]},{property:"padding-right",name:"Padding right",type:"number",default:"",value:"10",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]},{property:"padding-bottom",name:"Padding bottom",type:"number",default:"",value:"10",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]},{property:"padding-left",name:"Padding left",type:"number",default:"",value:"10",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]}]},{at:8}),t.StyleManager.removeProperty("typography","font-size"),t.StyleManager.addProperty("typography",{name:"Font size",property:"font-size",type:"number",default:"",fixedValues:["medium","xx-small","x-small","small","large","x-large","xx-large","smaller","larger","length","initial","inherit"],units:["px","%","em","rem","vh","vw"]},{at:1}),t.StyleManager.removeProperty("typography","font-weight"),t.StyleManager.addProperty("typography",{name:"Font weight",property:"font-weight",type:"select",default:"",fixedValues:["inherit","initial","unset","auto"],options:[{id:"",label:""},{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"}]},{at:2}),t.StyleManager.removeProperty("typography","letter-spacing"),t.StyleManager.addProperty("typography",{name:"Letter spacing",property:"letter-spacing",type:"number",default:"",fixedValues:["normal","initial","inherit","unset"],units:["px","%","em","rem","vh","vw"]},{at:3}),t.StyleManager.removeProperty("typography","color"),t.StyleManager.addProperty("typography",{name:"Color",property:"color",type:"color",default:"",full:!0},{at:4}),t.StyleManager.removeProperty("typography","line-height"),t.StyleManager.addProperty("typography",{name:"Line height",property:"line-height",type:"number",default:"",fixedValues:["normal","initial","inherit","unset"],units:["px","%","em","rem","vh","vw"]},{at:5}),t.StyleManager.removeProperty("typography","text-align"),t.StyleManager.addProperty("typography",{name:"Text align",property:"text-align",type:"select",defaults:"",options:[{id:"",label:""},{id:"left",label:"left"},{id:"center",label:"center"},{id:"right",label:"right"},{id:"justified",label:"justified"}]},{at:6}),t.StyleManager.addProperty("typography",{name:"Word break",property:"word-break",type:"select",defaults:"",options:[{value:"",name:""},{value:"normal",name:"normal"},{value:"break-all",name:"break-all"},{value:"keep-all",name:"keep-all"},{value:"break-word",name:"break-word"}],info:"The word-break CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box."},{at:7}),t.StyleManager.addProperty("typography",{name:"Word wrap",property:"word-wrap",type:"select",defaults:"",options:[{value:"",name:""},{value:"normal",name:"normal"},{value:"break-word",name:"break-word"}],info:"The word-wrap CSS property sets whether the line may be broken within a word in order to prevent overflow when an otherwise unbreakable string is too long to fit in its containing box."},{at:8}),t.StyleManager.addProperty("typography",{name:"White space",property:"white-space",type:"select",defaults:"",options:[{value:"",name:""},{value:"normal",name:"normal"},{value:"nowrap",name:"nowrap"},{value:"pre",name:"pre"},{value:"pre-wrap",name:"pre-wrap"},{value:"pre-line",name:"pre-line"},{value:"break-spaces",name:"break-spaces"}],info:"The white-space CSS property sets how white space inside an element is handled."},{at:9}),t.StyleManager.addProperty("typography",{name:"Text decoration",property:"text-decoration",type:"composite",properties:[{name:"Text decoration line",property:"text-decoration-line",type:"select",defaults:"",fixedValues:["auto","inherit","initial","revert","unset"],options:[{value:"",name:""},{value:"none",name:"none"},{value:"underline",name:"underline"},{value:"overline",name:"overline"},{value:"line-through",name:"line-through"},{value:"blink",name:"blink"}],info:"The text-decoration CSS property sets the appearance of decorative lines on text."},{name:"Text decoration style",property:"text-decoration-style",type:"select",defaults:"",options:[{value:"",name:""},{value:"solid",name:"solid"},{value:"double",name:"double"},{value:"dotted",name:"dotted"},{value:"dashed",name:"dashed"},{value:"wavy",name:"wavy"}],info:"The text-decoration-style CSS property sets the style of the lines specified by text-decoration-line. The style applies to all lines, there is no way to define different styles for each of the lines."},{name:"Text decoration color",property:"text-decoration-color",type:"color",defaults:"",fixedValues:["inherit","initial","revert","unset"],info:"The text-decoration-color CSS property sets the color of decorations added to text by text-decoration-line."},{name:"Text decoration thickness",property:"text-decoration-thickness",type:"integer",units:["px","%","em"],info:"The text-decoration-thickness CSS property sets the stroke thickness of the decoration line that is used on text in an element, such as a line-through, underline, or overline.",default:"",fixedValues:["auto","inherit","initial","revert","unset"]}]},{at:10}),t.StyleManager.addProperty("typography",{name:"Text transform",property:"text-transform",type:"select",defaults:"",options:[{value:"",name:""},{value:"none",name:"none"},{value:"capitalize",name:"capitalize"},{value:"uppercase",name:"uppercase"},{value:"lowercase",name:"lowercase"}],info:"The text-transform CSS property sets how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized."},{at:11}),t.StyleManager.addProperty("typography",{name:"Text overflow",property:"text-overflow",type:"select",defaults:"",options:[{value:"",name:""},{value:"clip",name:"clip"},{value:"ellipsis",name:"ellipsis"}],info:"The text-overflow CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-clip and text-overflow-string."},{at:12}),t.StyleManager.removeProperty("decorations","background-color"),t.StyleManager.addProperty("decorations",{name:"Background color",property:"background-color",type:"color",default:"",full:!0},{at:0}),t.StyleManager.removeProperty("decorations","border-radius"),t.StyleManager.addProperty("decorations",{name:"Border radius",property:"border-radius",type:"composite",defaults:"",fixedValues:["initial","inherit","auto"],full:!0,properties:[{property:"border-top-left-radius",name:"Top left",type:"number",default:"",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]},{property:"border-top-right-radius",name:"Top right",type:"number",default:"",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]},{property:"border-bottom-right-radius",name:"Bottom right",type:"number",default:"",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]},{property:"border-bottom-left-radius",name:"Bottom left",type:"number",default:"",fixedValues:["initial","inherit","auto"],units:["px","%","em","rem","vh","vw"]}]},{at:2}),t.StyleManager.addProperty("decorations",{name:"Outline",property:"outline",type:"composite",properties:[{name:"Outline width",property:"outline-width",type:"integer",units:["px","%","em"],info:"The outline-width CSS property sets the thickness of an element's outline. An outline is a line that is drawn around an element, outside the border.",default:"",fixedValues:["medium","thin","thick","inherit","initial","revert","unset"]},{name:"Outline style",property:"outline-style",type:"select",defaults:"",options:[{value:"",name:""},{value:"none",name:"none"},{value:"hidden",name:"hidden"},{value:"dotted",name:"dotted"},{value:"dashed",name:"dashed"},{value:"solid",name:"solid"},{value:"double",name:"double"},{value:"groove",name:"groove"},{value:"ridge",name:"ridge"},{value:"inset",name:"inset"},{value:"outset",name:"outset"}],info:"The outline-style CSS property sets the style of an element's outline. An outline is a line that is drawn around an element, outside the border."},{name:"Outline color",property:"outline-color",type:"color",defaults:"",info:"The outline-color CSS property sets the color of an element's outline."}]},{at:8}),t.StyleManager.addProperty("extra",{name:"Z index",property:"z-index",type:"slider",step:1,min:-1e4,max:1e4,units:[],info:"Stacking order of the element",default:"",fixedValues:["auto","unset","initial","inherit","revert"]},{at:1}),t.StyleManager.addProperty("extra",{name:"Pointer events",property:"pointer-events",type:"select",defaults:"",options:[{value:"",name:""},{value:"auto",name:"auto"},{value:"none",name:"none"},{value:"visiblePainted",name:"visiblePainted"},{value:"visibleFill",name:"visibleFill"},{value:"visibleStroke",name:"visibleStroke"},{value:"visible",name:"visible"},{value:"painted",name:"painted"},{value:"fill",name:"fill"},{value:"stroke",name:"stroke"},{value:"all",name:"all"}],info:"The pointer-events CSS property sets under what circumstances (if any) a particular graphic element can become the target of pointer events."},{at:2}),t.StyleManager.addProperty("extra",{name:"Cursor",property:"cursor",type:"select",defaults:"",options:[{value:"",name:""},{value:"auto",name:"auto"},{value:"default",name:"default"},{value:"none",name:"none"},{value:"context-menu",name:"context-menu"},{value:"help",name:"help"},{value:"pointer",name:"pointer"},{value:"progress",name:"progress"},{value:"wait",name:"wait"},{value:"cell",name:"cell"},{value:"crosshair",name:"crosshair"},{value:"text",name:"text"},{value:"vertical-text",name:"vertical-text"},{value:"alias",name:"alias"},{value:"copy",name:"copy"},{value:"move",name:"move"},{value:"no-drop",name:"no-drop"},{value:"not-allowed",name:"not-allowed"},{value:"grab",name:"grab"},{value:"grabbing",name:"grabbing"},{value:"all-scroll",name:"all-scroll"},{value:"col-resize",name:"col-resize"},{value:"row-resize",name:"row-resize"},{value:"n-resize",name:"n-resize"},{value:"e-resize",name:"e-resize"},{value:"s-resize",name:"s-resize"},{value:"w-resize",name:"w-resize"},{value:"ne-resize",name:"ne-resize"},{value:"nw-resize",name:"nw-resize"},{value:"se-resize",name:"se-resize"},{value:"sw-resize",name:"sw-resize"},{value:"ew-resize",name:"ew-resize"},{value:"ns-resize",name:"ns-resize"},{value:"nesw-resize",name:"nesw-resize"},{value:"nwse-resize",name:"nwse-resize"},{value:"zoom-in",name:"zoom-in"},{value:"zoom-out",name:"zoom-out"}],info:"The cursor CSS property sets the type of mouse cursor, if any, to show when the mouse pointer is over an element."},{at:3}),t.StyleManager.addProperty("extra",{name:"Column count",property:"column-count",type:"integer",units:[],info:"The column-count CSS property breaks an element's content into the specified number of columns.",default:"",fixedValues:["auto","inherit","initial","revert","unset"],min:1},{at:4}),t.StyleManager.addProperty("extra",{name:"Column width",property:"column-width",type:"integer",units:["px","%","em"],info:"The column-width CSS property suggests an optimal column width. This is not an absolute value but a mere hint. Browser will adjust the width of the element automatically.",default:"",fixedValues:["auto","inherit","initial","revert","unset"]},{at:5}),t.StyleManager.addProperty("extra",{name:"Column gap",property:"column-gap",type:"integer",units:["px","%","em"],info:"The column-gap CSS property sets the size of the gap (gutter) between an element's columns.",default:"",fixedValues:["normal","inherit","initial","revert","unset"]},{at:6}),t.StyleManager.addProperty("extra",{name:"Column rule",property:"column-rule",type:"composite",properties:[{name:"Column rule width",property:"column-rule-width",type:"integer",units:["px","%","em"],info:"The column-rule-width CSS property sets the width of the line drawn between columns in a multi-column layout.",default:"",fixedValues:["medium","thin","thick","inherit","initial","revert","unset"]},{name:"Column rule style",property:"column-rule-style",type:"select",defaults:"",options:[{value:"",name:""},{value:"none",name:"none"},{value:"hidden",name:"hidden"},{value:"dotted",name:"dotted"},{value:"dashed",name:"dashed"},{value:"solid",name:"solid"},{value:"double",name:"double"},{value:"groove",name:"groove"},{value:"ridge",name:"ridge"},{value:"inset",name:"inset"},{value:"outset",name:"outset"},{value:"inherit",name:"inherit"}],info:"The column-rule-style CSS property sets the style of the line drawn between columns in a multi-column layout."},{name:"Column rule color",property:"column-rule-color",type:"color",defaults:"",info:"The column-rule-color CSS property sets the color of the line drawn between columns in a multi-column layout."}]},{at:7}),t.StyleManager.addProperty("extra",{name:"Column span",property:"column-span",type:"select",defaults:"",options:[{value:"",name:""},{value:"none",name:"none"},{value:"all",name:"all"}],info:"The column-span CSS property makes it possible for an element to span across all columns when its value is set to all."},{at:8}),t.on("selector:state component:selected component:styleUpdate style:sector:update",((t,e)=>setTimeout((()=>n())))),t.StyleManager.getSector("general").on("change",(()=>n())),t.SelectorManager.states.add({name:"before",label:"Before"}),t.SelectorManager.states.add({name:"after",label:"After"}),t.SelectorManager.states.add({name:"active",label:"Active"}),t.SelectorManager.states.add({name:"first-child",label:"First child"}),t.SelectorManager.states.add({name:"last-child",label:"Last child"}),t.SelectorManager.states.add({name:"focus",label:"Focus"}),t.SelectorManager.states.add({name:"visited",label:"Visited"}),t.SelectorManager.states.add({name:"link",label:"Link"}),t.SelectorManager.states.add({name:"first-letter",label:"First letter"}),t.SelectorManager.states.add({name:"first-line",label:"First line"}),t.SelectorManager.states.add({name:"selection",label:"Selection"}),t.SelectorManager.states.add({name:"empty",label:"Empty"}),t.SelectorManager.states.add({name:"enabled",label:"Enabled"}),t.SelectorManager.states.add({name:"disabled",label:"Disabled"}),t.SelectorManager.states.add({name:"checked",label:"Checked"}),t.SelectorManager.states.add({name:"indeterminate",label:"Indeterminate"}),t.SelectorManager.states.add({name:"placeholder-shown",label:"Placeholder shown"}),t.SelectorManager.states.add({name:"placeholder",label:"Placeholder"}),t.SelectorManager.states.add({name:"default",label:"Default"}),t.SelectorManager.states.add({name:"valid",label:"Valid"}),t.SelectorManager.states.add({name:"invalid",label:"Invalid"}),t.SelectorManager.states.add({name:"in-range",label:"In range"}),t.SelectorManager.states.add({name:"out-of-range",label:"Out of range"}),t.SelectorManager.states.add({name:"required",label:"Required"}),t.SelectorManager.states.add({name:"optional",label:"Optional"}),t.SelectorManager.states.add({name:"read-only",label:"Read only"}),t.SelectorManager.states.add({name:"read-write",label:"Read write"})}))}},{name:"./footer",value:function(t,e){const n=t.Panels.addPanel({id:"footer",visible:!0,buttons:[]});setTimeout((()=>{Uy=n.view?.el,By.forEach((t=>t(Uy))),By=[]}))}},{name:"@silexlabs/grapesjs-storage-rate-limit",value:Wy},{name:"grapesjs-style-border",value:Gy()},{name:"./resize-panel",value:function(t){t.Panels.addPanel({id:"viewsOptions",buttons:[{id:"resize",className:"viewsOptions__size-btn",command:"resize-panel",attributes:{title:"Resize panel"}}]}),t.Commands.add("resize-panel",{run:(t,e)=>{document.documentElement.style.setProperty("--viewsPanelWidth","40%")},stop:(t,e)=>{document.documentElement.style.setProperty("--viewsPanelWidth","20%")}})}},{name:"@silexlabs/grapesjs-notifications",value:Jy()},{name:"@silexlabs/grapesjs-keymaps-dialog",value:Qy()}];Bw.filter((t=>"function"!=typeof t.value)).forEach((t=>{throw new Error(`Plugin ${t.name} could not be loaded correctly (${t.value})`)}));const zw="#333333",Ww="#ddd",qw="#8873FE",Gw="#A291FF",Kw="#363636",Yw="#575757",Xw="open-layers",Jw="open-blocks",Zw="open-symbols",Qw="open-notifications",t_="Containers",e_="Components";function n_(t){const{websiteId:e,storageId:n,rootUrl:r}=t;return{container:"#gjs",height:"100%",showOffsets:!0,showDevices:!0,layerManager:{appendTo:".layer-manager-container"},blockManager:{appendTo:".block-manager-container"},assetManager:{upload:`${r}${f}${S}${M}/?websiteId=${e}${n?`&connectorId=${n}`:""}`},storageManager:{autoload:!1,type:"connector",options:{connector:{id:e,connectorId:n}}},cssIcons:"./css/all.min.css",canvasCss:`\n :root {\n --primaryColor: ${zw};\n --secondaryColor: ${Ww};\n --tertiaryColor: ${qw};\n --quaternaryColor: ${Gw};\n --darkerPrimaryColor: ${Kw};\n --lighterPrimaryColor: ${Yw};\n }\n .gjs-frame-selected {\n box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5) !important; // Change to red border\n }\n .gjs-selected {\n outline: 2px solid var(--tertiaryColor) !important;\n outline-offset: -2px;\n }\n `,richTextEditor:{actions:["bold","italic","underline","strikethrough","link","wrap",Wb,qb]},plugins:Bw.map((t=>t.value)),pluginsOpts:{[nv().toString()]:{blocks:["text","image","video","map"],category:t_},[Ab.toString()]:{panels:[{id:"dash",className:"logo",attributes:{title:"Dashboard"},command:()=>{window.location.href="/"}},{id:"block-manager-btn",className:"block-manager-btn fa fa-fw fa-plus",name:"Blocks",attributes:{title:`Blocks (${ew(sw.kmBlocks.keys,"+")})`,containerClassName:"block-manager-container"},command:Jw},{id:"symbols-btn",className:"symbols-btn fa-regular fa-gem",name:"Symbols",attributes:{title:`Symbols (${ew(sw.kmSymbols.keys,"+")})`,containerClassName:"symbols-list-container"},command:Zw,buttons:[{id:"symbol-create-button",className:"gjs-pn-btn",command:ny,text:"✚"}]},{id:"page-panel-btn",className:"page-panel-btn fa fa-fw fa-file",name:"Pages",attributes:{title:`Pages (${ew(sw.kmPages.keys,"+")})`,containerClassName:"page-panel-container"},command:gb,buttons:[{className:"gjs-pn-btn",command:vb,text:"✚"}]},{id:"layer-manager-btn",className:"layer-manager-btn fa-solid fa-layer-group",name:"Layers",attributes:{title:`Layers (${ew(sw.kmLayers.keys,"+")})`,containerClassName:"layer-manager-container"},command:Xw},{id:"font-dialog-btn",className:"font-manager-btn fa-solid fa-font",name:"Fonts",attributes:{title:`Fonts (${ew(sw.kmOpenFonts.keys,"+")})`},command:()=>{r_.runCommand("open-fonts")}},{id:"settings-dialog-btn",className:"page-panel-btn fa-solid fa-gears",name:"Settings",attributes:{title:`Settings (${ew(sw.kmOpenSettings.keys,"+")})`},command:Db},{id:"spacer",attributes:{},className:"project-bar-spacer"},{id:"keymaps-btn",className:"keymaps-btn fa-solid fa-keyboard",name:"Shortcuts",attributes:{title:"Keyboard Shortcuts (Shift+H)"},command:Zy.cmdKeymapsDialog},{id:"notifications-btn",className:"notifications-btn fa-regular fa-bell",name:"Notifications",attributes:{title:`Notifications (${ew(sw.kmNotifications.keys,"+")})`,containerClassName:"notifications-container"},command:Qw,buttons:[{className:"gjs-pn-btn",command:"notifications:clear",text:"✖"}]},{id:"dash2",className:"fa-solid fa-house",attributes:{title:"Dashboard"},command:()=>{window.location.href="/"}},{id:"help",className:"fa fa-fw fa-question-circle",attributes:{title:"Documentation"},command:()=>{window.open("https://docs.silex.me/","_blank")}},{id:"logout-button",className:"page-panel-btn fa fa-fw fa-sign-out",attributes:{title:"Sign out"},command:jy}]},[Nw.toString()]:{appendTo:"options",websiteId:e},[wb.toString()]:{cmdOpenNewPageDialog:Sb,cmdOpenSettings:Db,appendTo:".page-panel-container"},[uv().toString()]:{enableCount:!1,enablePerformance:!1},[dv().toString()]:{appendBefore:".gjs-sm-sectors"},[Xb.toString()]:{onError:t=>console.warn("Links errors:",t)},[aw.toString()]:{disableKeymaps:!1},[lv().toString()]:{blockLabel:"HTML",blockCustomCode:{category:e_},codeViewOptions:{autoFormat:!1}},[Jm.toString()]:{appendTo:".symbols-list-container",emptyText:"No symbol yet.",primaryColor:zw,secondaryColor:Ww,highlightColor:qw},[ey().toString()]:{api_key:t.fontsApiKey,server_url:t.fontsServerUrl,api_url:t.fontsApiUrl},[Vy.toString()]:{id:e},[Wy.toString()]:{time:5e3},[zy.toString()]:{replacedElements:t.replacedElements},[Jy().toString()]:{container:Uw,reverse:!0},[Qy().toString()]:{longPressDuration:null,shortcut:"shift+h"}}}}let r_;async function o_(t){if(r_)throw new Error("Grapesjs editor already created");return new Promise(((e,n)=>{try{r_=tv.init(t)}catch(t){console.error("Error initializing GrapesJs with plugins:",Bw,t),n(t)}["text"].forEach((t=>r_.Blocks.get(t)?.set("category","Basics"))),["image","video"].forEach((t=>r_.Blocks.get(t)?.set("category","Media"))),["map"].forEach((t=>r_.Blocks.get(t)?.set("category","Components"))),r_.Blocks.render([]),r_.Commands.add("gjs-open-import-webpage",function(t,e){const n=t.getConfig("stylePrefix"),r=t.Modal,o=t.CodeManager.getViewer("CodeMirror").clone(),i=document.createElement("div"),s=e.modalImportLabel,a=e.modalImportContent;let l=o.editor;const c=document.createElement("button");return c.type="button",c.innerHTML=e.modalImportButton,c.className=`${n}btn-prim ${n}btn-import`,c.onclick=e=>{t.setComponents(l.getValue().trim()),r.close()},o.set({codeName:"htmlmixed",theme:"hopscotch",readOnly:0,...e.importViewerOptions}),{run(u){if(!l){const t=document.createElement("textarea");if(s){const t=document.createElement("div");t.className=`${n}import-label`,t.innerHTML=s,i.appendChild(t)}i.appendChild(t),i.appendChild(c),o.init(t),l=o.editor}r.setTitle(e.modalImportTitle),r.setContent(i);const p="function"==typeof a?a(t):a;o.setContent(p||""),r.open().getModel().once("change:open",(()=>t.stopCommand(this.id))),l.refresh()},stop(){r.close()}}}(r_,{modalImportLabel:"",modalImportContent:"Paste a web page HTML code here.",modalImportButton:"Import",modalImportTitle:"Import from website"}));const r={view:{onRender({editor:t,el:e,model:n}){const r=n.getAttributes().src;e.addEventListener("error",(()=>{t.runCommand("notifications:add",{type:"error",group:"Image loading error",message:`Error loading image: ${r}`,componentId:n.getId()})}))}}};r_.DomComponents.addType("image",r),r_.DomComponents.addType("iframe",r),r_.on("load",(()=>{const t=r_.Panels.getPanel("views");t.buttons.remove(Jw),t.buttons.remove(Xw),r_.Panels.getPanel("options").buttons.remove("export-template"),r_.Panels.getPanel("options").buttons.remove("fullscreen"),r_.BlockManager.render(null),r_.StyleManager.addProperty("extra",{extend:"filter"}),r_.SelectorManager.selectorTags.el.parentElement.classList.add("top-style-section"),document.body.querySelector(".notifications-container")?.appendChild(Uw),r_.on("notifications:changed",(()=>{const t=r_.Panels.getPanel(Tb).view?.el.querySelector(".notifications-btn");r_.NotificationManager.length?t?.classList.add("project-bar__dirty"):t?.classList.remove("project-bar__dirty")})),e(r_)}))}))}function i_(){return r_}async function s_(t){t.addPublicationTransformers({renderComponent:(t,e)=>"custom-code"===t.get("type")&&t.get("custom-code-plugin__code")?t.get("custom-code-plugin__code"):e()})}const a_="important",l_=" !"+a_;Om(class extends Am{constructor(t){if(super(t),1!==t.type||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,n)=>{const r=t[n];return null==r?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?n.removeProperty(t):n[t]=null);for(const t in e){const r=e[t];if(null!=r){this.ft.add(t);const e="string"==typeof r&&r.endsWith(l_);t.includes("-")||e?n.setProperty(t,e?r.slice(0,-11):r,e?a_:""):n[t]=r}}return lm}}),document.createElement("div");let c_;try{c_=JSON.parse(localStorage.getItem("silex-loaded-fonts-list"))}catch(Bv){console.error("Could not get fonts from local storage:",Bv)}ub(),ub();async function u_(t){t.addPublicationTransformers({transformFile(e){const n=e;if(n.type===sy.HTML&&n.content){const e=t.getEditor().runCommand("get-fonts-html");n.content=n.content.replace(/<\/head>/,`${e}</head>`)}return e}})}class p_ extends q{api=o;websiteId=new URL(location.href).searchParams.get("id")??u;storageId=new URL(location.href).searchParams.get("connectorId");lang=new URL(location.href).searchParams.get("lang")??p;rootUrl=window.location.origin+window.location.pathname.replace(/\/$/,"");debug=!1;addHashInCssFileName=!0;replacedElements=["img","video","iframe","embed","object","audio","canvas"];grapesJsConfig={plugins:[],pluginsOpts:{}};clientConfigUrl=`${this.rootUrl}/${d}`;fontsApiKey="AIzaSyAdJTYSLPlKz4w5Iqyy-JAF2o8uQKd1FKc";fontsServerUrl="https://fonts.googleapis.com";fontsApiUrl="https://www.googleapis.com";initGrapesConfig(){const t=n_(this);this.grapesJsConfig={...this.grapesJsConfig,...t,plugins:[...this.grapesJsConfig.plugins,...t.plugins],pluginsOpts:{...this.grapesJsConfig.pluginsOpts,...t.pluginsOpts}}}getEditor(){return i_()}publicationTransformers=[Ow,mw];resetPublicationTransformers(){this.publicationTransformers=[Ow]}addPublicationTransformers(t){Array.isArray(t)||(t=[t]),t.forEach((t=>{!function(t){const e=["renderComponent","renderCssRule","transformFile","transformPermalink","transformPath"];Object.keys(t).forEach((t=>{if(!e.includes(t))throw new Error(`Publication transformer: unknown property ${t}`)})),e.forEach((e=>{if("function"!=typeof t[e]&&void 0!==t[e])throw new Error(`Publication transformer: ${e} must be a function`)}))}(t)})),this.publicationTransformers=this.publicationTransformers.concat(t)}addSettings(t,e,n="last"){!function(t,e,n){const r="site"===e?Nb:Lb;if("first"===n)r.unshift(t);else if("last"===n)r.push(t);else{if("number"!=typeof n)throw new Error("Invalid position for settings section");r.splice(n,0,t)}}(t,e,n)}removeSettings(t,e){!function(t,e){const n="site"===e?Nb:Lb,r=n.findIndex((e=>e.id===t));if(-1===r)throw new Error(`Cannot find section with id ${t}`);n.splice(r,1)}(t,e)}async addDefaultPlugins(){await this.addPlugin([s_,u_],{})}}let d_;async function f_(t={}){console.info($),d_=new p_,Object.assign(d_,t),await d_.addPlugin(d_.clientConfigUrl,{}),d_.debug&&console.warn("Silex starting in debug mode.",{config:d_}),d_.emit(Mb.STARTUP_START),d_.initGrapesConfig(),d_.emit(Mb.GRAPESJS_START);try{await o_(d_.grapesJsConfig)}catch(t){throw console.error("Error starting Silex",t),t}const e=i_();e.getModel().set("config",d_),d_.emit(Mb.GRAPESJS_END,{editor:e}),e.I18n.setLocale(d_.lang),await d_.addDefaultPlugins();try{e.runCommand(Hw),await e.load(null),e.once("canvas:frame:load",(()=>e.stopCommand(Hw)))}catch(t){t.httpStatusCode}finally{e.getModel().getCurrentFrame().loaded?h_(e):e.once("canvas:frame:load",(()=>h_(e)))}}function h_(t){document.querySelector(".silex-loader").classList.add("silex-dialog-hide"),document.querySelector("#gjs").classList.remove("silex-dialog-hide"),d_.emit(Mb.STARTUP_END,{editor:t,config:d_})}console.info("\nSilex client loaded\n")})(),silex=r})();
|