(function(mp){typeof define=="function"&&define.amd?define(mp):mp()})(function(){"use strict";const mp="",Lm="",Dm="";var El=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jd(Ls){return Ls&&Ls.__esModule&&Object.prototype.hasOwnProperty.call(Ls,"default")?Ls.default:Ls}var Bf={exports:{}};/*! grapesjs - 0.21.2 */(function(Ls,Nm){(function(Wf,Fc){Ls.exports=Fc()})(typeof globalThis<"u"?globalThis:typeof window<"u"?window:El,()=>(()=>{var Wf={410:(S,H,pt)=>{var at,_t,J;_t=[pt(50),pt(316)],(J=typeof(at=function(W,z){var k=Array.prototype.slice;function P(j,V,Y){return Y.length<=4?j.call(V,Y[0],Y[1],Y[2],Y[3]):j.apply(V,Y)}function E(j,V){return k.call(j,V)}function M(j,V){return j!=null&&(W.isArray(V)||(V=E(arguments,1)),W.all(V,function(Y){return Y in j}))}var D=function(){var j=!1,V=-1;function Y(){V++,j=!0,W.defer(function(){j=!1})}return function(){return j||Y(),V}}();function ot(){this.registeredObjects=[],this.cidIndexes=[]}function it(j,V,Y,nt){for(var wt,rt=0,gt=V.length;rtj.maximumStackLength&&(j.shift(),j.pointer--)}}}ot.prototype={isRegistered:function(j){return j&&j.cid?this.registeredObjects[j.cid]:W.contains(this.registeredObjects,j)},register:function(j){return!this.isRegistered(j)&&(j&&j.cid?(this.registeredObjects[j.cid]=j,this.cidIndexes.push(j.cid)):this.registeredObjects.push(j),!0)},unregister:function(j){if(this.isRegistered(j)){if(j&&j.cid)delete this.registeredObjects[j.cid],this.cidIndexes.splice(W.indexOf(this.cidIndexes,j.cid),1);else{var V=W.indexOf(this.registeredObjects,j);this.registeredObjects.splice(V,1)}return!0}return!1},get:function(){return W.map(this.cidIndexes,function(j){return this.registeredObjects[j]},this).concat(this.registeredObjects)}};var xt={add:{undo:function(j,V,Y,nt){j.remove(Y,nt)},redo:function(j,V,Y,nt){nt.index&&(nt.at=nt.index),j.add(Y,nt)},on:function(j,V,Y){return{object:V,before:void 0,after:j,options:W.clone(Y)}}},remove:{undo:function(j,V,Y,nt){"index"in nt&&(nt.at=nt.index),j.add(V,nt)},redo:function(j,V,Y,nt){j.remove(V,nt)},on:function(j,V,Y){return{object:V,before:j,after:void 0,options:W.clone(Y)}}},change:{undo:function(j,V,Y,nt){W.isEmpty(V)?W.each(W.keys(Y),j.unset,j):(j.set(V),nt&&nt.unsetData&&nt.unsetData.before&&nt.unsetData.before.length&&W.each(nt.unsetData.before,j.unset,j))},redo:function(j,V,Y,nt){W.isEmpty(Y)?W.each(W.keys(V),j.unset,j):(j.set(Y),nt&&nt.unsetData&&nt.unsetData.after&&nt.unsetData.after.length&&W.each(nt.unsetData.after,j.unset,j))},on:function(j,V){var Y=j.changedAttributes(),nt=W.keys(Y),wt=W.pick(j.previousAttributes(),nt),rt=W.keys(wt),gt=(V||(V={})).unsetData={after:[],before:[]};return nt.length!=rt.length&&(nt.length>rt.length?W.each(nt,function(N){N in wt||gt.before.push(N)},this):W.each(rt,function(N){N in Y||gt.after.push(N)})),{object:j,before:wt,after:Y,options:W.clone(V)}}},reset:{undo:function(j,V,Y){j.reset(V)},redo:function(j,V,Y){j.reset(Y)},on:function(j,V){return{object:j,before:V.previousModels,after:W.clone(j.models)}}}};function bt(){}function Wt(j,V,Y,nt){if(typeof V=="object")return W.each(V,function(wt,rt){j===2?Wt(j,wt,Y,nt):Wt(j,rt,wt,Y)});switch(j){case 0:M(Y,"undo","redo","on")&&W.all(W.pick(Y,"undo","redo","on"),W.isFunction)&&(nt[V]=Y);break;case 1:nt[V]&&W.isObject(Y)&&(nt[V]=W.extend({},nt[V],Y));break;case 2:delete nt[V]}return this}bt.prototype=xt;var Ft=z.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(j){Et("undo",this.attributes)},redo:function(j){Et("redo",this.attributes)}}),Ht=z.Collection.extend({model:Ft,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(j){this.maximumStackLength=j}}),Q=z.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(j){this.stack=new Ht,this.objectRegistry=new ot,this.undoTypes=new bt,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(V,Y){this.stack.setMaxLength(Y)},this),j&&j.track&&this.startTracking(),j&&j.register&&(W.isArray(j.register)||W.isArguments(j.register)?P(this.register,this,j.register):this.register(j.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(j){ee(this.stack,j,E(arguments,1),this.undoTypes)},register:function(){it("on",arguments,this._addToStack,this)},unregister:function(){it("off",arguments,this._addToStack,this)},unregisterAll:function(){P(this.unregister,this,this.objectRegistry.get())},undo:function(j){jt("undo",this,this.stack,j)},undoAll:function(){jt("undo",this,this.stack,!1,!0)},redo:function(j){jt("redo",this,this.stack,j)},redoAll:function(){jt("redo",this,this.stack,!1,!0)},isAvailable:function(j){var V=this.stack,Y=V.length;switch(j){case"undo":return Y>0&&V.pointer>-1;case"redo":return Y>0&&V.pointer{var at,_t;(function(J){var W=typeof self=="object"&&self.self===self&&self||typeof pt.g=="object"&&pt.g.global===pt.g&&pt.g;at=[pt(50),pt(895),H],_t=function(z,k,P){W.Backbone=function(E,M,D,ot){var it=E.Backbone,Et=Array.prototype.slice;M.VERSION="1.4.1",M.$=ot,M.noConflict=function(){return E.Backbone=it,this},M.emulateHTTP=!1,M.emulateJSON=!1;var jt,Dt=M.Events={},ee=/\s+/,xt=function(b,I,U,ht,kt){var Ot,fe=0;if(U&&typeof U=="object")for(ht!==void 0&&("context"in kt)&&kt.context===void 0&&(kt.context=ht),Ot=D.keys(U);fethis.length&&(ht=this.length),ht<0&&(ht+=this.length+1);var kt,Ot,fe=[],ke=[],Ve=[],ze=[],Qe={},Kt=I.add,R=I.merge,tt=I.remove,ut=!1,yt=this.comparator&&ht==null&&I.sort!==!1,Yt=D.isString(this.comparator)?this.comparator:null;for(Ot=0;Ot7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(Xe,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var I=this.root.slice(0,-1)||"/";return this.location.replace(I+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var U=document.body,ht=U.insertBefore(this.iframe,U.firstChild).contentWindow;ht.document.open(),ht.document.close(),ht.location.hash="#"+this.fragment}var kt=window.addEventListener||function(Ot,fe){return attachEvent("on"+Ot,fe)};if(this._usePushState?kt("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?kt("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var b=window.removeEventListener||function(I,U){return detachEvent("on"+I,U)};this._usePushState?b("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&b("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),Ae.started=!1},route:function(b,I){this.handlers.unshift({route:b,callback:I})},checkUrl:function(b){var I=this.getFragment();if(I===this.fragment&&this.iframe&&(I=this.getHash(this.iframe.contentWindow)),I===this.fragment)return!1;this.iframe&&this.navigate(I),this.loadUrl()},loadUrl:function(b){return!!this.matchRoot()&&(b=this.fragment=this.getFragment(b),D.some(this.handlers,function(I){if(I.route.test(b))return I.callback(b),!0}))},navigate:function(b,I){if(!Ae.started)return!1;I&&I!==!0||(I={trigger:!!I}),b=this.getFragment(b||"");var U=this.root;b!==""&&b.charAt(0)!=="?"||(U=U.slice(0,-1)||"/");var ht=U+b;b=b.replace(vn,"");var kt=this.decodeFragment(b);if(this.fragment!==kt){if(this.fragment=kt,this._usePushState)this.history[I.replace?"replaceState":"pushState"]({},document.title,ht);else{if(!this._wantsHashChange)return this.location.assign(ht);if(this._updateHash(this.location,b,I.replace),this.iframe&&b!==this.getHash(this.iframe.contentWindow)){var Ot=this.iframe.contentWindow;I.replace||(Ot.document.open(),Ot.document.close()),this._updateHash(Ot.location,b,I.replace)}}return I.trigger?this.loadUrl(b):void 0}},_updateHash:function(b,I,U){if(U){var ht=b.href.replace(/(javascript:|#).*$/,"");b.replace(ht+"#"+I)}else b.hash="#"+I}}),M.history=new Ae;var Rn=function(b,I){var U,ht=this;return U=b&&D.has(b,"constructor")?b.constructor:function(){return ht.apply(this,arguments)},D.extend(U,ht,I),U.prototype=D.create(ht.prototype,b),U.prototype.constructor=U,U.__super__=ht.prototype,U};Y.extend=nt.extend=Xt.extend=Se.extend=Ae.extend=Rn;var mt=function(){throw new Error('A "url" property or function must be specified')},zt=function(b,I){var U=I.error;I.error=function(ht){U&&U.call(I.context,b,ht,I),b.trigger("error",b,ht,I)}};return M}(W,P,z,k)}.apply(H,at),_t===void 0||(S.exports=_t)})()},210:(S,H,pt)=>{(function(at){at.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(J,W){return/^[;{}]$/.test(W)}}),at.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(J,W,z,k){return this.jsonMode?/^[\[,{]$/.test(W)||/^}/.test(z):(W!=";"||!k.lexical||k.lexical.type!=")")&&/^[;{}]$/.test(W)&&!/^;/.test(z)}});var _t=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;at.extendMode("xml",{commentStart:"",newlineAfterToken:function(J,W,z,k){var P=!1;return this.configuration=="html"&&(P=!!k.context&&_t.test(k.context.tagName)),!P&&(J=="tag"&&/>$/.test(W)&&k.context||/^-1&&D>-1&&D>M&&(E=E.substr(0,M)+E.substring(M+P.commentStart.length,D)+E.substr(D+P.commentEnd.length)),k.replaceRange(E,W,z)}})}),at.defineExtension("autoIndentRange",function(J,W){var z=this;this.operation(function(){for(var k=J.line;k<=W.line;k++)z.indentLine(k,"smart")})}),at.defineExtension("autoFormatRange",function(J,W){var z=this,k=z.getMode(),P=z.getRange(J,W).split(` `),E=at.copyState(k,z.getTokenAt(J).state),M=z.getOption("tabSize"),D="",ot=0,it=J.ch===0;function Et(){D+=` `,it=!0,++ot}for(var jt=0;jt2),ee=/Android/.test(H),xt=Dt||ee||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(H),bt=Dt||/Mac/.test(pt),Wt=/\bCrOS\b/.test(H),Ft=/win/i.test(pt),Ht=ot&&H.match(/Version\/(\d*\.\d*)/);Ht&&(Ht=Number(Ht[1])),Ht&&Ht>=15&&(ot=!1,P=!0);var Q=bt&&(E||ot&&(Ht==null||Ht<12.11)),j=at||z&&k>=9;function V(o){return new RegExp("(^|\\s)"+o+"(?:$|\\s)\\s*")}var Y,nt=function(o,s){var u=o.className,c=V(s).exec(u);if(c){var p=u.slice(c.index+c[0].length);o.className=u.slice(0,c.index)+(p?c[1]+p:"")}};function wt(o){for(var s=o.childNodes.length;s>0;--s)o.removeChild(o.firstChild);return o}function rt(o,s){return wt(o).appendChild(s)}function gt(o,s,u,c){var p=document.createElement(o);if(u&&(p.className=u),c&&(p.style.cssText=c),typeof s=="string")p.appendChild(document.createTextNode(s));else if(s)for(var g=0;g=s)return m+(s-g);m+=y-g,m+=u-m%u,g=y+1}}Dt?Se=function(o){o.selectionStart=0,o.selectionEnd=o.value.length}:z&&(Se=function(o){try{o.select()}catch{}});var Te=function(){this.id=null,this.f=null,this.time=0,this.handler=_e(this.onTimeout,this)};function be(o,s){for(var u=0;u=s)return c+Math.min(m,s-p);if(p+=g-c,c=g+1,(p+=u-p%u)>=s)return c}}var ne=[""];function ae(o){for(;ne.length<=o;)ne.push(Zt(ne)+" ");return ne[o]}function Zt(o){return o[o.length-1]}function Ae(o,s){for(var u=[],c=0;c"€"&&(o.toUpperCase()!=o.toLowerCase()||Rn.test(o))}function zt(o,s){return s?!!(s.source.indexOf("\\w")>-1&&mt(o))||s.test(o):mt(o)}function b(o){for(var s in o)if(o.hasOwnProperty(s)&&o[s])return!1;return!0}var I=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function U(o){return o.charCodeAt(0)>=768&&I.test(o)}function ht(o,s,u){for(;(u<0?s>0:su?-1:1;;){if(s==u)return s;var p=(s+u)/2,g=c<0?Math.ceil(p):Math.floor(p);if(g==s)return o(g)?s:u;o(g)?u=g:s=g+c}}function Ot(o,s,u,c){if(!o)return c(s,u,"ltr",0);for(var p=!1,g=0;gs||s==u&&m.to==s)&&(c(Math.max(m.from,s),Math.min(m.to,u),m.level==1?"rtl":"ltr",g),p=!0)}p||c(s,u,"ltr")}var fe=null;function ke(o,s,u){var c;fe=null;for(var p=0;ps)return p;g.to==s&&(g.from!=g.to&&u=="before"?c=p:fe=p),g.from==s&&(g.from!=g.to&&u!="before"?c=p:fe=p)}return c??fe}var Ve=function(){var o="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",s="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(O){return O<=247?o.charAt(O):1424<=O&&O<=1524?"R":1536<=O&&O<=1785?s.charAt(O-1536):1774<=O&&O<=2220?"r":8192<=O&&O<=8203?"w":O==8204?"b":"L"}var c=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,p=/[stwN]/,g=/[LRr]/,m=/[Lb1n]/,y=/[1n]/;function x(O,B,$){this.level=O,this.from=B,this.to=$}return function(O,B){var $=B=="ltr"?"L":"R";if(O.length==0||B=="ltr"&&!c.test(O))return!1;for(var ft=O.length,dt=[],Ct=0;Ct-1&&(c[s]=p.slice(0,g).concat(p.slice(g+1)))}}}function ut(o,s){var u=R(o,s);if(u.length)for(var c=Array.prototype.slice.call(arguments,2),p=0;p0}function Re(o){o.prototype.on=function(s,u){Kt(this,s,u)},o.prototype.off=function(s,u){tt(this,s,u)}}function We(o){o.preventDefault?o.preventDefault():o.returnValue=!1}function Ln(o){o.stopPropagation?o.stopPropagation():o.cancelBubble=!0}function pn(o){return o.defaultPrevented!=null?o.defaultPrevented:o.returnValue==0}function Ne(o){We(o),Ln(o)}function Ar(o){return o.target||o.srcElement}function Yn(o){var s=o.which;return s==null&&(1&o.button?s=1:2&o.button?s=3:4&o.button&&(s=2)),bt&&o.ctrlKey&&s==1&&(s=3),s}var jr,fn,_n=function(){if(z&&k<9)return!1;var o=gt("div");return"draggable"in o||"dragDrop"in o}();function Bn(o){if(jr==null){var s=gt("span","​");rt(o,gt("span",[s,document.createTextNode("x")])),o.firstChild.offsetHeight!=0&&(jr=s.offsetWidth<=1&&s.offsetHeight>2&&!(z&&k<8))}var u=jr?gt("span","​"):gt("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}function Mr(o){if(fn!=null)return fn;var s=rt(o,document.createTextNode("AخA")),u=Y(s,0,1).getBoundingClientRect(),c=Y(s,1,2).getBoundingClientRect();return wt(o),!(!u||u.left==u.right)&&(fn=c.right-u.right<3)}var Dn,_o=` b`.split(/\n/).length!=3?function(o){for(var s=0,u=[],c=o.length;s<=c;){var p=o.indexOf(` `,s);p==-1&&(p=o.length);var g=o.slice(s,o.charAt(p-1)=="\r"?p-1:p),m=g.indexOf("\r");m!=-1?(u.push(g.slice(0,m)),s+=m+1):(u.push(g),s=p+1)}return u}:function(o){return o.split(/\r\n?|\n/)},Vo=window.getSelection?function(o){try{return o.selectionStart!=o.selectionEnd}catch{return!1}}:function(o){var s;try{s=o.ownerDocument.selection.createRange()}catch{}return!(!s||s.parentElement()!=o)&&s.compareEndPoints("StartToEnd",s)!=0},xo="oncopy"in(Dn=gt("div"))||(Dn.setAttribute("oncopy","return;"),typeof Dn.oncopy=="function"),Ro=null;function ro(o){if(Ro!=null)return Ro;var s=rt(o,gt("span","x")),u=s.getBoundingClientRect(),c=Y(s,0,1).getBoundingClientRect();return Ro=Math.abs(u.left-c.left)>1}var ur={},ln={};function Ho(o,s){arguments.length>2&&(s.dependencies=Array.prototype.slice.call(arguments,2)),ur[o]=s}function Lr(o,s){ln[o]=s}function Co(o){if(typeof o=="string"&&ln.hasOwnProperty(o))o=ln[o];else if(o&&typeof o.name=="string"&&ln.hasOwnProperty(o.name)){var s=ln[o.name];typeof s=="string"&&(s={name:s}),(o=vn(s,o)).name=s.name}else{if(typeof o=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(o))return Co("application/xml");if(typeof o=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(o))return Co("application/json")}return typeof o=="string"?{name:o}:o||{name:"null"}}function Jr(o,s){s=Co(s);var u=ur[s.name];if(!u)return Jr(o,"text/plain");var c=u(o,s);if(Wn.hasOwnProperty(s.name)){var p=Wn[s.name];for(var g in p)p.hasOwnProperty(g)&&(c.hasOwnProperty(g)&&(c["_"+g]=c[g]),c[g]=p[g])}if(c.name=s.name,s.helperType&&(c.helperType=s.helperType),s.modeProps)for(var m in s.modeProps)c[m]=s.modeProps[m];return c}var Wn={};function Nn(o,s){De(s,Wn.hasOwnProperty(o)?Wn[o]:Wn[o]={})}function $n(o,s){if(s===!0)return s;if(o.copyState)return o.copyState(s);var u={};for(var c in s){var p=s[c];p instanceof Array&&(p=p.concat([])),u[c]=p}return u}function zo(o,s){for(var u;o.innerMode&&(u=o.innerMode(s))&&u.mode!=o;)s=u.state,o=u.mode;return u||{mode:o,state:s}}function mo(o,s,u){return!o.startState||o.startState(s,u)}var qe=function(o,s,u){this.pos=this.start=0,this.string=o,this.tabSize=s||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};function ve(o,s){if((s-=o.first)<0||s>=o.size)throw new Error("There is no line "+(s+o.first)+" in the document.");for(var u=o;!u.lines;)for(var c=0;;++c){var p=u.children[c],g=p.chunkSize();if(s=o.first&&su?Bt(u,ve(o,u).text.length):Hn(s,ve(o,s.line).text.length)}function Hn(o,s){var u=o.ch;return u==null||u>s?Bt(o.line,s):u<0?Bt(o.line,0):o}function Tn(o,s){for(var u=[],c=0;c=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.poss},qe.prototype.eatSpace=function(){for(var o=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>o},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(o){var s=this.string.indexOf(o,this.pos);if(s>-1)return this.pos=s,!0},qe.prototype.backUp=function(o){this.pos-=o},qe.prototype.column=function(){return this.lastColumnPos0?null:(c&&s!==!1&&(this.pos+=c[0].length),c)}var p=function(g){return u?g.toLowerCase():g};if(p(this.string.substr(this.pos,o.length))==p(o))return s!==!1&&(this.pos+=o.length),!0},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(o,s){this.lineStart+=o;try{return s()}finally{this.lineStart-=o}},qe.prototype.lookAhead=function(o){var s=this.lineOracle;return s&&s.lookAhead(o)},qe.prototype.baseToken=function(){var o=this.lineOracle;return o&&o.baseToken(this.pos)};var Hi=function(o,s){this.state=o,this.lookAhead=s},_r=function(o,s,u,c){this.state=s,this.doc=o,this.line=u,this.maxLookAhead=c||0,this.baseTokens=null,this.baseTokenPos=1};function Ds(o,s,u,c){var p=[o.state.modeGen],g={};So(o,s.text,o.doc.mode,u,function(O,B){return p.push(O,B)},g,c);for(var m=u.state,y=function(O){u.baseTokens=p;var B=o.state.overlays[O],$=1,ft=0;u.state=!0,So(o,s.text,B.mode,u,function(dt,Ct){for(var Rt=$;ftdt&&p.splice($,1,dt,p[$+1],$t),$+=2,ft=Math.min(dt,$t)}if(Ct)if(B.opaque)p.splice(Rt,$-Rt,dt,"overlay "+Ct),$=Rt+2;else for(;Rt<$;Rt+=2){var re=p[Rt+1];p[Rt+1]=(re?re+" ":"")+"overlay "+Ct}},g),u.state=m,u.baseTokens=null,u.baseTokenPos=1},x=0;xo.options.maxHighlightLength&&$n(o.doc.mode,c.state),g=Ds(o,s,c);p&&(c.state=p),s.stateAfter=c.save(!p),s.styles=g.styles,g.classes?s.styleClasses=g.classes:s.styleClasses&&(s.styleClasses=null),u===o.doc.highlightFrontier&&(o.doc.modeFrontier=Math.max(o.doc.modeFrontier,++o.doc.highlightFrontier))}return s.styles}function bo(o,s,u){var c=o.doc,p=o.display;if(!c.mode.startState)return new _r(c,!0,s);var g=zi(o,s,u),m=g>c.first&&ve(c,g-1).stateAfter,y=m?_r.fromSaved(c,m,g):new _r(c,mo(c.mode),g);return c.iter(g,s,function(x){oo(o,x.text,y);var O=y.line;x.stateAfter=O==s-1||O%5==0||O>=p.viewFrom&&Os.start)return g}throw new Error("Mode "+o.name+" failed to advance stream.")}_r.prototype.lookAhead=function(o){var s=this.doc.getLine(this.line+o);return s!=null&&o>this.maxLookAhead&&(this.maxLookAhead=o),s},_r.prototype.baseToken=function(o){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=o;)this.baseTokenPos+=2;var s=this.baseTokens[this.baseTokenPos+1];return{type:s&&s.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-o}},_r.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},_r.fromSaved=function(o,s,u){return s instanceof Hi?new _r(o,$n(o.mode,s.state),u,s.lookAhead):new _r(o,$n(o.mode,s),u)},_r.prototype.save=function(o){var s=o!==!1?$n(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Hi(s,this.maxLookAhead):s};var wo=function(o,s,u){this.start=o.start,this.end=o.pos,this.string=o.current(),this.type=s||null,this.state=u};function Wo(o,s,u,c){var p,g,m=o.doc,y=m.mode,x=ve(m,(s=oe(m,s)).line),O=bo(o,s.line,u),B=new qe(x.text,o.options.tabSize,O);for(c&&(g=[]);(c||B.poso.options.maxHighlightLength?(y=!1,m&&oo(o,s,c,$.pos),$.pos=s.length,x=null):x=Ns(Xn(u,$,c.state,ft),g),ft){var dt=ft[0].name;dt&&(x="m-"+(x?dt+" "+x:dt))}if(!y||B!=x){for(;O<$.start;)p(O=Math.min($.start,O+5e3),B);B=x}$.start=$.pos}for(;O<$.pos;){var Ct=Math.min($.pos,O+5e3);p(Ct,B),O=Ct}}function zi(o,s,u){for(var c,p,g=o.doc,m=u?-1:s-(o.doc.mode.innerMode?1e3:100),y=s;y>m;--y){if(y<=g.first)return g.first;var x=ve(g,y-1),O=x.stateAfter;if(O&&(!u||y+(O instanceof Hi?O.lookAhead:0)<=g.modeFrontier))return y;var B=xe(x.text,null,o.options.tabSize);(p==null||c>B)&&(p=y-1,c=B)}return p}function Is(o,s){if(o.modeFrontier=Math.min(o.modeFrontier,s),!(o.highlightFrontieru;c--){var p=ve(o,c).stateAfter;if(p&&(!(p instanceof Hi)||c+p.lookAhead=s:g.to>s);(c||(c=[])).push(new Cr(m,g.from,y?null:g.to))}}return c}function hi(o,s,u){var c;if(o)for(var p=0;p=s:g.to>s)||g.from==s&&m.type=="bookmark"&&(!u||g.marker.insertLeft)){var y=g.from==null||(m.inclusiveLeft?g.from<=s:g.from0&&y)for(var Jt=0;Jt0)){var B=[x,1],$=T(O.from,y.from),ft=T(O.to,y.to);($<0||!m.inclusiveLeft&&!$)&&B.push({from:O.from,to:y.from}),(ft>0||!m.inclusiveRight&&!ft)&&B.push({from:y.to,to:O.to}),p.splice.apply(p,B),x+=B.length-3}}return p}function Zn(o){var s=o.markedSpans;if(s){for(var u=0;us)&&(!u||mn(u,g.marker)<0)&&(u=g.marker)}return u}function yn(o,s,u,c,p){var g=ve(o,s),m=Zr&&g.markedSpans;if(m)for(var y=0;y=0&&$<=0||B<=0&&$>=0)&&(B<=0&&(x.marker.inclusiveRight&&p.inclusiveLeft?T(O.to,u)>=0:T(O.to,u)>0)||B>=0&&(x.marker.inclusiveRight&&p.inclusiveLeft?T(O.from,c)<=0:T(O.from,c)<0)))return!0}}}function Or(o){for(var s;s=qo(o);)o=s.find(-1,!0).line;return o}function $i(o){for(var s;s=Dr(o);)o=s.find(1,!0).line;return o}function gi(o){for(var s,u;s=Dr(o);)o=s.find(1,!0).line,(u||(u=[])).push(o);return u}function pr(o,s){var u=ve(o,s),c=Or(u);return u==c?s:Ye(c)}function Nr(o,s){if(s>o.lastLine())return s;var u,c=ve(o,s);if(!Ir(o,c))return s;for(;u=Dr(c);)c=u.find(1,!0).line;return Ye(c)+1}function Ir(o,s){var u=Zr&&s.markedSpans;if(u){for(var c=void 0,p=0;ps.maxLineLength&&(s.maxLineLength=p,s.maxLine=c)})}var Vr=function(o,s,u){this.text=o,Bi(this,s),this.height=u?u(this):1};function Hs(o,s,u,c){o.text=s,o.stateAfter&&(o.stateAfter=null),o.styles&&(o.styles=null),o.order!=null&&(o.order=null),Zn(o),Bi(o,u);var p=c?c(o):1;p!=o.height&&or(o,p)}function ja(o){o.parent=null,Zn(o)}Vr.prototype.lineNo=function(){return Ye(this)},Re(Vr);var Ma={},qi={};function Go(o,s){if(!o||/^\s*$/.test(o))return null;var u=s.addModeClass?qi:Ma;return u[o]||(u[o]=o.replace(/\S+/g,"cm-$&"))}function Gi(o,s){var u=N("span",null,null,P?"padding-right: .1px":null),c={pre:N("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:o,trailingSpace:!1,splitSpaces:o.getOption("lineWrapping")};s.measure={};for(var p=0;p<=(s.rest?s.rest.length:0);p++){var g=p?s.rest[p-1]:s.line,m=void 0;c.pos=0,c.addToken=Da,Mr(o.display.measure)&&(m=ze(g,o.doc.direction))&&(c.addToken=Al(c.addToken,m)),c.map=[],Ki(g,c,xr(o,g,s!=o.display.externalMeasured&&Ye(g))),g.styleClasses&&(g.styleClasses.bgClass&&(c.bgClass=Oe(g.styleClasses.bgClass,c.bgClass||"")),g.styleClasses.textClass&&(c.textClass=Oe(g.styleClasses.textClass,c.textClass||""))),c.map.length==0&&c.map.push(0,0,c.content.appendChild(Bn(o.display.measure))),p==0?(s.measure.map=c.map,s.measure.cache={}):((s.measure.maps||(s.measure.maps=[])).push(c.map),(s.measure.caches||(s.measure.caches=[])).push({}))}if(P){var y=c.content.lastChild;(/\bcm-tab\b/.test(y.className)||y.querySelector&&y.querySelector(".cm-tab"))&&(c.content.className="cm-tab-wrap-hack")}return ut(o,"renderLine",o,s.line,c.pre),c.pre.className&&(c.textClass=Oe(c.pre.className,c.textClass||"")),c}function La(o){var s=gt("span","•","cm-invalidchar");return s.title="\\u"+o.charCodeAt(0).toString(16),s.setAttribute("aria-label",s.title),s}function Da(o,s,u,c,p,g,m){if(s){var y,x=o.splitSpaces?Na(s,o.trailingSpace):s,O=o.cm.state.specialChars,B=!1;if(O.test(s)){y=document.createDocumentFragment();for(var $=0;;){O.lastIndex=$;var ft=O.exec(s),dt=ft?ft.index-$:s.length-$;if(dt){var Ct=document.createTextNode(x.slice($,$+dt));z&&k<9?y.appendChild(gt("span",[Ct])):y.appendChild(Ct),o.map.push(o.pos,o.pos+dt,Ct),o.col+=dt,o.pos+=dt}if(!ft)break;$+=dt+1;var Rt=void 0;if(ft[0]==" "){var $t=o.cm.options.tabSize,re=$t-o.col%$t;(Rt=y.appendChild(gt("span",ae(re),"cm-tab"))).setAttribute("role","presentation"),Rt.setAttribute("cm-text"," "),o.col+=re}else ft[0]=="\r"||ft[0]==` `?((Rt=y.appendChild(gt("span",ft[0]=="\r"?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",ft[0]),o.col+=1):((Rt=o.cm.options.specialCharPlaceholder(ft[0])).setAttribute("cm-text",ft[0]),z&&k<9?y.appendChild(gt("span",[Rt])):y.appendChild(Rt),o.col+=1);o.map.push(o.pos,o.pos+1,Rt),o.pos++}}else o.col+=s.length,y=document.createTextNode(x),o.map.push(o.pos,o.pos+s.length,y),z&&k<9&&(B=!0),o.pos+=s.length;if(o.trailingSpace=x.charCodeAt(s.length-1)==32,u||c||p||B||g||m){var le=u||"";c&&(le+=c),p&&(le+=p);var Jt=gt("span",[y],le,g);if(m)for(var ye in m)m.hasOwnProperty(ye)&&ye!="style"&&ye!="class"&&Jt.setAttribute(ye,m[ye]);return o.content.appendChild(Jt)}o.content.appendChild(y)}}function Na(o,s){if(o.length>1&&!/ /.test(o))return o;for(var u=s,c="",p=0;pO&&$.from<=O);ft++);if($.to>=B)return o(u,c,p,g,m,y,x);o(u,c.slice(0,$.to-O),p,g,null,y,x),g=null,c=c.slice($.to-O),O=$.to}}}function To(o,s,u,c){var p=!c&&u.widgetNode;p&&o.map.push(o.pos,o.pos+s,p),!c&&o.cm.display.input.needsContentAttribute&&(p||(p=o.content.appendChild(document.createElement("span"))),p.setAttribute("cm-marker",u.id)),p&&(o.cm.display.input.setUneditable(p),o.content.appendChild(p)),o.pos+=s,o.trailingSpace=!1}function Ki(o,s,u){var c=o.markedSpans,p=o.text,g=0;if(c)for(var m,y,x,O,B,$,ft,dt=p.length,Ct=0,Rt=1,$t="",re=0;;){if(re==Ct){x=O=B=y="",ft=null,$=null,re=1/0;for(var le=[],Jt=void 0,ye=0;yeCt||Ce.collapsed&&me.to==Ct&&me.from==Ct)){if(me.to!=null&&me.to!=Ct&&re>me.to&&(re=me.to,O=""),Ce.className&&(x+=" "+Ce.className),Ce.css&&(y=(y?y+";":"")+Ce.css),Ce.startStyle&&me.from==Ct&&(B+=" "+Ce.startStyle),Ce.endStyle&&me.to==re&&(Jt||(Jt=[])).push(Ce.endStyle,me.to),Ce.title&&((ft||(ft={})).title=Ce.title),Ce.attributes)for(var sn in Ce.attributes)(ft||(ft={}))[sn]=Ce.attributes[sn];Ce.collapsed&&(!$||mn($.marker,Ce)<0)&&($=me)}else me.from>Ct&&re>me.from&&(re=me.from)}if(Jt)for(var an=0;an=dt)break;for(var hn=Math.min(dt,re);;){if($t){var sr=Ct+$t.length;if(!$){var vr=sr>hn?$t.slice(0,hn-Ct):$t;s.addToken(s,vr,m?m+x:x,B,Ct+vr.length==re?O:"",y,ft)}if(sr>=hn){$t=$t.slice(hn-Ct),Ct=hn;break}Ct=sr,B=""}$t=p.slice(g,g=u[Rt++]),m=Go(u[Rt++],s.cm.options)}}else for(var xn=1;xn2&&g.push((x.bottom+O.top)/2-u.top)}}g.push(u.bottom-u.top)}}function He(o,s,u){if(o.line==s)return{map:o.measure.map,cache:o.measure.cache};if(o.rest){for(var c=0;cu)return{map:o.measure.maps[p],cache:o.measure.caches[p],before:!0}}}function cn(o,s){var u=Ye(s=Or(s)),c=o.display.externalMeasured=new Yi(o.doc,s,u);c.lineN=u;var p=c.built=Gi(o,c);return c.text=p.pre,rt(o.display.lineMeasure,p.pre),c}function Rr(o,s,u,c){return Hr(o,Eo(o,s),u,c)}function ts(o,s){if(s>=o.display.viewFrom&&s=u.lineN&&ss)&&(p=(g=x-y)-1,s>=x&&(m="right")),p!=null){if(c=o[O+2],y==x&&u==(c.insertLeft?"left":"right")&&(m=u),u=="left"&&p==0)for(;O&&o[O-2]==o[O-3]&&o[O-1].insertLeft;)c=o[(O-=3)+2],m="left";if(u=="right"&&p==x-y)for(;O=0&&(u=o[p]).left==u.right;p--);return u}function bp(o,s,u,c){var p,g=Ws(s.map,u,c),m=g.node,y=g.start,x=g.end,O=g.collapse;if(m.nodeType==3){for(var B=0;B<4;B++){for(;y&&U(s.line.text.charAt(g.coverStart+y));)--y;for(;g.coverStart+x0&&(O=c="right"),p=o.options.lineWrapping&&($=m.getClientRects()).length>1?$[c=="right"?$.length-1:0]:m.getBoundingClientRect()}if(z&&k<9&&!y&&(!p||!p.left&&!p.right)){var ft=m.parentNode.getClientRects()[0];p=ft?{left:ft.left,right:ft.left+Jo(o.display),top:ft.top,bottom:ft.bottom}:Vc}for(var dt=p.top-s.rect.top,Ct=p.bottom-s.rect.top,Rt=(dt+Ct)/2,$t=s.view.measure.heights,re=0;re<$t.length-1&&!(Rt<$t[re]);re++);var le=re?$t[re-1]:0,Jt=$t[re],ye={left:(O=="right"?p.right:p.left)-s.rect.left,right:(O=="left"?p.left:p.right)-s.rect.left,top:le,bottom:Jt};return p.left||p.right||(ye.bogus=!0),o.options.singleCursorHeightPerLine||(ye.rtop=dt,ye.rbottom=Ct),ye}function wp(o,s){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ro(o))return s;var u=screen.logicalXDPI/screen.deviceXDPI,c=screen.logicalYDPI/screen.deviceYDPI;return{left:s.left*u,right:s.right*u,top:s.top*c,bottom:s.bottom*c}}function Hc(o){if(o.measure&&(o.measure.cache={},o.measure.heights=null,o.rest))for(var s=0;s=c.text.length?(x=c.text.length,O="before"):x<=0&&(x=0,O="after"),!y)return m(O=="before"?x-1:x,O=="before");function B(Ct,Rt,$t){return m($t?Ct-1:Ct,y[Rt].level==1!=$t)}var $=ke(y,x,O),ft=fe,dt=B(x,$,O=="before");return ft!=null&&(dt.other=B(x,ft,O!="before")),dt}function za(o,s){var u=0;s=oe(o.doc,s),o.options.lineWrapping||(u=Jo(o.display)*s.ch);var c=ve(o.doc,s.line),p=Fr(c)+K(o.display);return{left:u,right:u,top:p,bottom:p+c.height}}function Ll(o,s,u,c,p){var g=Bt(o,s,u);return g.xRel=p,c&&(g.outside=c),g}function Dl(o,s,u){var c=o.doc;if((u+=o.display.viewOffset)<0)return Ll(c.first,0,null,-1,-1);var p=In(c,u),g=c.first+c.size-1;if(p>g)return Ll(c.first+c.size-1,ve(c,g).text.length,null,1,1);s<0&&(s=0);for(var m=ve(c,p);;){var y=Nl(o,m,p,s,u),x=Wi(m,y.ch+(y.xRel>0||y.outside>0?1:0));if(!x)return y;var O=x.find(1);if(O.line==p)return O;m=ve(c,p=O.line)}}function Uc(o,s,u,c){c-=Va(s);var p=s.text.length,g=kt(function(m){return Hr(o,u,m-1).bottom<=c},p,0);return{begin:g,end:p=kt(function(m){return Hr(o,u,m).top>c},g,p)}}function Bc(o,s,u,c){return u||(u=Eo(o,s)),Uc(o,s,u,Ra(o,s,Hr(o,u,c),"line").top)}function ns(o,s,u,c){return!(o.bottom<=u)&&(o.top>u||(c?o.left:o.right)>s)}function Nl(o,s,u,c,p){p-=Fr(s);var g=Eo(o,s),m=Va(s),y=0,x=s.text.length,O=!0,B=ze(s,o.doc.direction);if(B){var $=(o.options.lineWrapping?os:rs)(o,s,u,g,B,c,p);y=(O=$.level!=1)?$.from:$.to-1,x=O?$.to:$.from-1}var ft,dt,Ct=null,Rt=null,$t=kt(function(me){var Ce=Hr(o,g,me);return Ce.top+=m,Ce.bottom+=m,!!ns(Ce,c,p,!1)&&(Ce.top<=p&&Ce.left<=c&&(Ct=me,Rt=Ce),!0)},y,x),re=!1;if(Rt){var le=c-Rt.left=ye.bottom?1:0}return Ll(u,$t=ht(s.text,$t,1),dt,re,c-ft)}function rs(o,s,u,c,p,g,m){var y=kt(function($){var ft=p[$],dt=ft.level!=1;return ns(kr(o,Bt(u,dt?ft.to:ft.from,dt?"before":"after"),"line",s,c),g,m,!0)},0,p.length-1),x=p[y];if(y>0){var O=x.level!=1,B=kr(o,Bt(u,O?x.from:x.to,O?"after":"before"),"line",s,c);ns(B,g,m,!0)&&B.top>m&&(x=p[y-1])}return x}function os(o,s,u,c,p,g,m){var y=Uc(o,s,c,m),x=y.begin,O=y.end;/\s/.test(s.text.charAt(O-1))&&O--;for(var B=null,$=null,ft=0;ft=O||dt.to<=x)){var Ct=Hr(o,c,dt.level!=1?Math.min(O,dt.to)-1:Math.max(x,dt.from)).right,Rt=CtRt)&&(B=dt,$=Rt)}}return B||(B=p[p.length-1]),B.fromO&&(B={from:B.from,to:O,level:B.level}),B}function ao(o){if(o.cachedTextHeight!=null)return o.cachedTextHeight;if(Ao==null){Ao=gt("pre",null,"CodeMirror-line-like");for(var s=0;s<49;++s)Ao.appendChild(document.createTextNode("x")),Ao.appendChild(gt("br"));Ao.appendChild(document.createTextNode("x"))}rt(o.measure,Ao);var u=Ao.offsetHeight/50;return u>3&&(o.cachedTextHeight=u),wt(o.measure),u||1}function Jo(o){if(o.cachedCharWidth!=null)return o.cachedCharWidth;var s=gt("span","xxxxxxxxxx"),u=gt("pre",[s],"CodeMirror-line-like");rt(o.measure,u);var c=s.getBoundingClientRect(),p=(c.right-c.left)/10;return p>2&&(o.cachedCharWidth=p),p||10}function Il(o){for(var s=o.display,u={},c={},p=s.gutters.clientLeft,g=s.gutters.firstChild,m=0;g;g=g.nextSibling,++m){var y=o.display.gutterSpecs[m].className;u[y]=g.offsetLeft+g.clientLeft+p,c[y]=g.clientWidth}return{fixedPos:Fl(s),gutterTotalWidth:s.gutters.offsetWidth,gutterLeft:u,gutterWidth:c,wrapperWidth:s.wrapper.clientWidth}}function Fl(o){return o.scroller.getBoundingClientRect().left-o.sizer.getBoundingClientRect().left}function Wc(o){var s=ao(o.display),u=o.options.lineWrapping,c=u&&Math.max(5,o.display.scroller.clientWidth/Jo(o.display)-3);return function(p){if(Ir(o.doc,p))return 0;var g=0;if(p.widgets)for(var m=0;m0&&(x=ve(o.doc,O.line).text).length==O.ch){var B=xe(x,x.length,o.options.tabSize)-x.length;O=Bt(O.line,Math.max(0,Math.round((g-vt(o.display).left)/Jo(o.display))-B))}return O}function _i(o,s){if(s>=o.display.viewTo||(s-=o.display.viewFrom)<0)return null;for(var u=o.display.view,c=0;cs)&&(p.updateLineNumbers=s),o.curOp.viewChanged=!0,s>=p.viewTo)Zr&&pr(o.doc,s)p.viewFrom?Zo(o):(p.viewFrom+=c,p.viewTo+=c);else if(s<=p.viewFrom&&u>=p.viewTo)Zo(o);else if(s<=p.viewFrom){var g=Ua(o,u,u+c,1);g?(p.view=p.view.slice(g.index),p.viewFrom=g.lineN,p.viewTo+=c):Zo(o)}else if(u>=p.viewTo){var m=Ua(o,s,s,-1);m?(p.view=p.view.slice(0,m.index),p.viewTo=m.lineN):Zo(o)}else{var y=Ua(o,s,s,-1),x=Ua(o,u,u+c,1);y&&x?(p.view=p.view.slice(0,y.index).concat(so(o,y.lineN,x.lineN)).concat(p.view.slice(x.index)),p.viewTo+=c):Zo(o)}var O=p.externalMeasured;O&&(u=p.lineN&&s=c.viewTo)){var g=c.view[_i(o,s)];if(g.node!=null){var m=g.changes||(g.changes=[]);be(m,u)==-1&&m.push(u)}}}function Zo(o){o.display.viewFrom=o.display.viewTo=o.doc.first,o.display.view=[],o.display.viewOffset=0}function Ua(o,s,u,c){var p,g=_i(o,s),m=o.display.view;if(!Zr||u==o.doc.first+o.doc.size)return{index:g,lineN:u};for(var y=o.display.viewFrom,x=0;x0){if(g==m.length-1)return null;p=y+m[g].size-s,g++}else p=y-s;s+=p,u+=p}for(;pr(o.doc,u)!=u;){if(g==(c<0?0:m.length-1))return null;u+=c*m[g-(c<0?1:0)].size,g+=c}return{index:g,lineN:u}}function _p(o,s,u){var c=o.display;c.view.length==0||s>=c.viewTo||u<=c.viewFrom?(c.view=so(o,s,u),c.viewFrom=s):(c.viewFrom>s?c.view=so(o,s,c.viewFrom).concat(c.view):c.viewFromu&&(c.view=c.view.slice(0,_i(o,u)))),c.viewTo=u}function $c(o){for(var s=o.display.view,u=0,c=0;c=o.display.viewTo||x.to().line0?m:o.defaultCharWidth())+"px"}if(c.other){var y=u.appendChild(gt("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));y.style.display="",y.style.left=c.other.left+"px",y.style.top=c.other.top+"px",y.style.height=.85*(c.other.bottom-c.other.top)+"px"}}function Ys(o,s){return o.top-s.top||o.left-s.left}function xp(o,s,u){var c=o.display,p=o.doc,g=document.createDocumentFragment(),m=vt(o.display),y=m.left,x=Math.max(c.sizerWidth,Nt(o)-c.sizer.offsetLeft)-m.right,O=p.direction=="ltr";function B(Jt,ye,me,Ce){ye<0&&(ye=0),ye=Math.round(ye),Ce=Math.round(Ce),g.appendChild(gt("div",null,"CodeMirror-selected","position: absolute; left: "+Jt+`px; top: `+ye+"px; width: "+(me??x-Jt)+`px; height: `+(Ce-ye)+"px"))}function $(Jt,ye,me){var Ce,sn,an=ve(p,Jt),gr=an.text.length;function hn(xn,En){return Ha(o,Bt(Jt,xn),"div",an,En)}function sr(xn,En,dr){var Vn=Bc(o,an,null,xn),An=En=="ltr"==(dr=="after")?"left":"right";return hn(dr=="after"?Vn.begin:Vn.end-(/\s/.test(an.text.charAt(Vn.end-1))?2:1),An)[An]}var vr=ze(an,p.direction);return Ot(vr,ye||0,me??gr,function(xn,En,dr,Vn){var An=dr=="ltr",jn=hn(xn,An?"left":"right"),mr=hn(En-1,An?"right":"left"),ri=ye==null&&xn==0,fo=me==null&&En==gr,ar=Vn==0,Cn=!vr||Vn==vr.length-1;if(mr.top-jn.top<=3){var wc=(O?fo:ri)&&Cn,Fo=(O?ri:fo)&&ar?y:(An?jn:mr).left,Li=wc?x:(An?mr:jn).right;B(Fo,jn.top,Li-Fo,jn.bottom)}else{var Di,zn,Cs,_c;An?(Di=O&&ri&&ar?y:jn.left,zn=O?x:sr(xn,dr,"before"),Cs=O?y:sr(En,dr,"after"),_c=O&&fo&&Cn?x:mr.right):(Di=O?sr(xn,dr,"before"):y,zn=!O&&ri&&ar?x:jn.right,Cs=!O&&fo&&Cn?y:mr.left,_c=O?sr(En,dr,"after"):x),B(Di,jn.top,zn-Di,jn.bottom),jn.bottom0?s.blinker=setInterval(function(){o.hasFocus()||xi(o),s.cursorDiv.style.visibility=(u=!u)?"":"hidden"},o.options.cursorBlinkRate):o.options.cursorBlinkRate<0&&(s.cursorDiv.style.visibility="hidden")}}function qc(o){o.hasFocus()||(o.display.input.focus(),o.state.focused||Hl(o))}function Rl(o){o.state.delayingBlurEvent=!0,setTimeout(function(){o.state.delayingBlurEvent&&(o.state.delayingBlurEvent=!1,o.state.focused&&xi(o))},100)}function Hl(o,s){o.state.delayingBlurEvent&&!o.state.draggingText&&(o.state.delayingBlurEvent=!1),o.options.readOnly!="nocursor"&&(o.state.focused||(ut(o,"focus",o,s),o.state.focused=!0,Qt(o.display.wrapper,"CodeMirror-focused"),o.curOp||o.display.selForContextMenu==o.doc.sel||(o.display.input.reset(),P&&setTimeout(function(){return o.display.input.reset(!0)},20)),o.display.input.receivedFocus()),is(o))}function xi(o,s){o.state.delayingBlurEvent||(o.state.focused&&(ut(o,"blur",o,s),o.state.focused=!1,nt(o.display.wrapper,"CodeMirror-focused")),clearInterval(o.display.blinker),setTimeout(function(){o.state.focused||(o.display.shift=!1)},150))}function Ba(o){for(var s=o.display,u=s.lineDiv.offsetTop,c=Math.max(0,s.scroller.getBoundingClientRect().top),p=s.lineDiv.getBoundingClientRect().top,g=0,m=0;m.005||dt<-.005)&&(po.display.sizerWidth){var Rt=Math.ceil(B/Jo(o.display));Rt>o.display.maxLineLength&&(o.display.maxLineLength=Rt,o.display.maxLine=y.line,o.display.maxLineChanged=!0)}}}Math.abs(g)>2&&(s.scroller.scrollTop+=g)}function Xs(o){if(o.widgets)for(var s=0;s=m&&(g=In(s,Fr(ve(s,x))-o.wrapper.clientHeight),m=x)}return{from:g,to:Math.max(m,g+1)}}function Cp(o,s){if(!yt(o,"scrollCursorIntoView")){var u=o.display,c=u.sizer.getBoundingClientRect(),p=null;if(s.top+c.top<0?p=!0:s.bottom+c.top>(window.innerHeight||document.documentElement.clientHeight)&&(p=!1),p!=null&&!jt){var g=gt("div","​",null,`position: absolute; top: `+(s.top-u.viewOffset-K(o.display))+`px; height: `+(s.bottom-s.top+lt(o)+u.barHeight)+`px; left: `+s.left+"px; width: "+Math.max(2,s.right-s.left)+"px;");o.display.lineSpace.appendChild(g),g.scrollIntoView(p),o.display.lineSpace.removeChild(g)}}}function zl(o,s,u,c){var p;c==null&&(c=0),o.options.lineWrapping||s!=u||(u=s.sticky=="before"?Bt(s.line,s.ch+1,"before"):s,s=s.ch?Bt(s.line,s.sticky=="before"?s.ch-1:s.ch,"after"):s);for(var g=0;g<5;g++){var m=!1,y=kr(o,s),x=u&&u!=s?kr(o,u):y,O=Ul(o,p={left:Math.min(y.left,x.left),top:Math.min(y.top,x.top)-c,right:Math.max(y.left,x.left),bottom:Math.max(y.bottom,x.bottom)+c}),B=o.doc.scrollTop,$=o.doc.scrollLeft;if(O.scrollTop!=null&&(Qs(o,O.scrollTop),Math.abs(o.doc.scrollTop-B)>1&&(m=!0)),O.scrollLeft!=null&&(jo(o,O.scrollLeft),Math.abs(o.doc.scrollLeft-$)>1&&(m=!0)),!m)break}return p}function Sp(o,s){var u=Ul(o,s);u.scrollTop!=null&&Qs(o,u.scrollTop),u.scrollLeft!=null&&jo(o,u.scrollLeft)}function Ul(o,s){var u=o.display,c=ao(o.display);s.top<0&&(s.top=0);var p=o.curOp&&o.curOp.scrollTop!=null?o.curOp.scrollTop:u.scroller.scrollTop,g=Gt(o),m={};s.bottom-s.top>g&&(s.bottom=s.top+g);var y=o.doc.height+Z(u),x=s.topy-c;if(s.topp+g){var B=Math.min(s.top,(O?y:s.bottom)-g);B!=p&&(m.scrollTop=B)}var $=o.options.fixedGutter?0:u.gutters.offsetWidth,ft=o.curOp&&o.curOp.scrollLeft!=null?o.curOp.scrollLeft:u.scroller.scrollLeft-$,dt=Nt(o)-u.gutters.offsetWidth,Ct=s.right-s.left>dt;return Ct&&(s.right=s.left+dt),s.left<10?m.scrollLeft=0:s.leftdt+ft-3&&(m.scrollLeft=s.right+(Ct?0:10)-dt),m}function Wa(o,s){s!=null&&(Ci(o),o.curOp.scrollTop=(o.curOp.scrollTop==null?o.doc.scrollTop:o.curOp.scrollTop)+s)}function ss(o){Ci(o);var s=o.getCursor();o.curOp.scrollToPos={from:s,to:s,margin:o.options.cursorScrollMargin}}function Zs(o,s,u){s==null&&u==null||Ci(o),s!=null&&(o.curOp.scrollLeft=s),u!=null&&(o.curOp.scrollTop=u)}function Op(o,s){Ci(o),o.curOp.scrollToPos=s}function Ci(o){var s=o.curOp.scrollToPos;s&&(o.curOp.scrollToPos=null,Gc(o,za(o,s.from),za(o,s.to),s.margin))}function Gc(o,s,u,c){var p=Ul(o,{left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-c,right:Math.max(s.right,u.right),bottom:Math.max(s.bottom,u.bottom)+c});Zs(o,p.scrollLeft,p.scrollTop)}function Qs(o,s){Math.abs(o.doc.scrollTop-s)<2||(at||Wl(o,{top:s}),ta(o,s,!0),at&&Wl(o),ls(o,100))}function ta(o,s,u){s=Math.max(0,Math.min(o.display.scroller.scrollHeight-o.display.scroller.clientHeight,s)),(o.display.scroller.scrollTop!=s||u)&&(o.doc.scrollTop=s,o.display.scrollbars.setScrollTop(s),o.display.scroller.scrollTop!=s&&(o.display.scroller.scrollTop=s))}function jo(o,s,u,c){s=Math.max(0,Math.min(s,o.display.scroller.scrollWidth-o.display.scroller.clientWidth)),(u?s==o.doc.scrollLeft:Math.abs(o.doc.scrollLeft-s)<2)&&!c||(o.doc.scrollLeft=s,oa(o),o.display.scroller.scrollLeft!=s&&(o.display.scroller.scrollLeft=s),o.display.scrollbars.setScrollLeft(s))}function ea(o){var s=o.display,u=s.gutters.offsetWidth,c=Math.round(o.doc.height+Z(o.display));return{clientHeight:s.scroller.clientHeight,viewHeight:s.wrapper.clientHeight,scrollWidth:s.scroller.scrollWidth,clientWidth:s.scroller.clientWidth,viewWidth:s.wrapper.clientWidth,barLeft:o.options.fixedGutter?u:0,docHeight:c,scrollHeight:c+lt(o)+s.barHeight,nativeBarWidth:s.nativeBarWidth,gutterWidth:u}}var Si=function(o,s,u){this.cm=u;var c=this.vert=gt("div",[gt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),p=this.horiz=gt("div",[gt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");c.tabIndex=p.tabIndex=-1,o(c),o(p),Kt(c,"scroll",function(){c.clientHeight&&s(c.scrollTop,"vertical")}),Kt(p,"scroll",function(){p.clientWidth&&s(p.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,z&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Si.prototype.update=function(o){var s=o.scrollWidth>o.clientWidth+1,u=o.scrollHeight>o.clientHeight+1,c=o.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=s?c+"px":"0";var p=o.viewHeight-(s?c:0);this.vert.firstChild.style.height=Math.max(0,o.scrollHeight-o.clientHeight+p)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(s){this.horiz.style.display="block",this.horiz.style.right=u?c+"px":"0",this.horiz.style.left=o.barLeft+"px";var g=o.viewWidth-o.barLeft-(u?c:0);this.horiz.firstChild.style.width=Math.max(0,o.scrollWidth-o.clientWidth+g)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&o.clientHeight>0&&(c==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?c:0,bottom:s?c:0}},Si.prototype.setScrollLeft=function(o){this.horiz.scrollLeft!=o&&(this.horiz.scrollLeft=o),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Si.prototype.setScrollTop=function(o){this.vert.scrollTop!=o&&(this.vert.scrollTop=o),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Si.prototype.zeroWidthHack=function(){var o=bt&&!Et?"12px":"18px";this.horiz.style.height=this.vert.style.width=o,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Te,this.disableVert=new Te},Si.prototype.enableZeroWidthBar=function(o,s,u){function c(){var p=o.getBoundingClientRect();(u=="vert"?document.elementFromPoint(p.right-1,(p.top+p.bottom)/2):document.elementFromPoint((p.right+p.left)/2,p.bottom-1))!=o?o.style.visibility="hidden":s.set(1e3,c)}o.style.visibility="",s.set(1e3,c)},Si.prototype.clear=function(){var o=this.horiz.parentNode;o.removeChild(this.horiz),o.removeChild(this.vert)};var na=function(){};function as(o,s){s||(s=ea(o));var u=o.display.barWidth,c=o.display.barHeight;zr(o,s);for(var p=0;p<4&&u!=o.display.barWidth||c!=o.display.barHeight;p++)u!=o.display.barWidth&&o.options.lineWrapping&&Ba(o),zr(o,ea(o)),u=o.display.barWidth,c=o.display.barHeight}function zr(o,s){var u=o.display,c=u.scrollbars.update(s);u.sizer.style.paddingRight=(u.barWidth=c.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=c.bottom)+"px",u.heightForcer.style.borderBottom=c.bottom+"px solid transparent",c.right&&c.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=c.bottom+"px",u.scrollbarFiller.style.width=c.right+"px"):u.scrollbarFiller.style.display="",c.bottom&&o.options.coverGutterNextToScrollbar&&o.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=c.bottom+"px",u.gutterFiller.style.width=s.gutterWidth+"px"):u.gutterFiller.style.display=""}na.prototype.update=function(){return{bottom:0,right:0}},na.prototype.setScrollLeft=function(){},na.prototype.setScrollTop=function(){},na.prototype.clear=function(){};var Kc={native:Si,null:na};function Yc(o){o.display.scrollbars&&(o.display.scrollbars.clear(),o.display.scrollbars.addClass&&nt(o.display.wrapper,o.display.scrollbars.addClass)),o.display.scrollbars=new Kc[o.options.scrollbarStyle](function(s){o.display.wrapper.insertBefore(s,o.display.scrollbarFiller),Kt(s,"mousedown",function(){o.state.focused&&setTimeout(function(){return o.display.input.focus()},0)}),s.setAttribute("cm-not-content","true")},function(s,u){u=="horizontal"?jo(o,s):Qs(o,s)},o),o.display.scrollbars.addClass&&Qt(o.display.wrapper,o.display.scrollbars.addClass)}var Tp=0;function Oi(o){o.curOp={cm:o,viewChanged:!1,startHeight:o.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Tp,markArrays:null},mi(o.curOp)}function Ti(o){var s=o.curOp;s&&Ji(s,function(u){for(var c=0;c=u.viewTo)||u.maxLineChanged&&s.options.lineWrapping,o.update=o.mustUpdate&&new $a(s,o.mustUpdate&&{top:o.scrollTop,ensure:o.scrollToPos},o.forceUpdate)}function Ep(o){o.updatedDisplay=o.mustUpdate&&Bl(o.cm,o.update)}function Ap(o){var s=o.cm,u=s.display;o.updatedDisplay&&Ba(s),o.barMeasure=ea(s),u.maxLineChanged&&!s.options.lineWrapping&&(o.adjustWidthTo=Rr(s,u.maxLine,u.maxLine.text.length).left+3,s.display.sizerWidth=o.adjustWidthTo,o.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+o.adjustWidthTo+lt(s)+s.display.barWidth),o.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+o.adjustWidthTo-Nt(s))),(o.updatedDisplay||o.selectionChanged)&&(o.preparedSelection=u.input.prepareSelection())}function ra(o){var s=o.cm;o.adjustWidthTo!=null&&(s.display.sizer.style.minWidth=o.adjustWidthTo+"px",o.maxScrollLeft=o.display.viewTo)){var u=+new Date+o.options.workTime,c=bo(o,s.highlightFrontier),p=[];s.iter(c.line,Math.min(s.first+s.size,o.display.viewTo+500),function(g){if(c.line>=o.display.viewFrom){var m=g.styles,y=g.text.length>o.options.maxHighlightLength?$n(s.mode,c.state):null,x=Ds(o,g,c,!0);y&&(c.state=y),g.styles=x.styles;var O=g.styleClasses,B=x.classes;B?g.styleClasses=B:O&&(g.styleClasses=null);for(var $=!m||m.length!=g.styles.length||O!=B&&(!O||!B||O.bgClass!=B.bgClass||O.textClass!=B.textClass),ft=0;!$&&ftu)return ls(o,o.options.workDelay),!0}),s.highlightFrontier=c.line,s.modeFrontier=Math.max(s.modeFrontier,c.line),p.length&&fr(o,function(){for(var g=0;g=u.viewFrom&&s.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&$c(o)==0)return!1;Zc(o)&&(Zo(o),s.dims=Il(o));var p=c.first+c.size,g=Math.max(s.visible.from-o.options.viewportMargin,c.first),m=Math.min(p,s.visible.to+o.options.viewportMargin);u.viewFromm&&u.viewTo-m<20&&(m=Math.min(p,u.viewTo)),Zr&&(g=pr(o.doc,g),m=Nr(o.doc,m));var y=g!=u.viewFrom||m!=u.viewTo||u.lastWrapHeight!=s.wrapperHeight||u.lastWrapWidth!=s.wrapperWidth;_p(o,g,m),u.viewOffset=Fr(ve(o.doc,u.viewFrom)),o.display.mover.style.top=u.viewOffset+"px";var x=$c(o);if(!y&&x==0&&!s.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var O=Lp(o);return x>4&&(u.lineDiv.style.display="none"),Jc(o,u.updateLineNumbers,s.dims),x>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,Dp(O),wt(u.cursorDiv),wt(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,y&&(u.lastWrapHeight=s.wrapperHeight,u.lastWrapWidth=s.wrapperWidth,ls(o,400)),u.updateLineNumbers=null,!0}function Xc(o,s){for(var u=s.viewport,c=!0;;c=!1){if(c&&o.options.lineWrapping&&s.oldDisplayWidth!=Nt(o))c&&(s.visible=Js(o.display,o.doc,u));else if(u&&u.top!=null&&(u={top:Math.min(o.doc.height+Z(o.display)-Gt(o),u.top)}),s.visible=Js(o.display,o.doc,u),s.visible.from>=o.display.viewFrom&&s.visible.to<=o.display.viewTo)break;if(!Bl(o,s))break;Ba(o);var p=ea(o);qs(o),as(o,p),qa(o,p),s.force=!1}s.signal(o,"update",o),o.display.viewFrom==o.display.reportedViewFrom&&o.display.viewTo==o.display.reportedViewTo||(s.signal(o,"viewportChange",o,o.display.viewFrom,o.display.viewTo),o.display.reportedViewFrom=o.display.viewFrom,o.display.reportedViewTo=o.display.viewTo)}function Wl(o,s){var u=new $a(o,s);if(Bl(o,u)){Ba(o),Xc(o,u);var c=ea(o);qs(o),as(o,c),qa(o,c),u.finish()}}function Jc(o,s,u){var c=o.display,p=o.options.lineNumbers,g=c.lineDiv,m=g.firstChild;function y(Ct){var Rt=Ct.nextSibling;return P&&bt&&o.display.currentWheelTarget==Ct?Ct.style.display="none":Ct.parentNode.removeChild(Ct),Rt}for(var x=c.view,O=c.viewFrom,B=0;B-1&&(ft=!1),zs(o,$,O,u)),ft&&(wt($.lineNumber),$.lineNumber.appendChild(document.createTextNode(Bo(o.options,O)))),m=$.node.nextSibling}else{var dt=Bs(o,$,O,u);g.insertBefore(dt,m)}O+=$.size}for(;m;)m=y(m)}function $l(o){var s=o.gutters.offsetWidth;o.sizer.style.marginLeft=s+"px",bn(o,"gutterChanged",o)}function qa(o,s){o.display.sizer.style.minHeight=s.docHeight+"px",o.display.heightForcer.style.top=s.docHeight+"px",o.display.gutters.style.height=s.docHeight+o.display.barHeight+lt(o)+"px"}function oa(o){var s=o.display,u=s.view;if(s.alignWidgets||s.gutters.firstChild&&o.options.fixedGutter){for(var c=Fl(s)-s.scroller.scrollLeft+o.doc.scrollLeft,p=s.gutters.offsetWidth,g=c+"px",m=0;m=102&&(o.display.chromeScrollHack==null?o.display.sizer.style.pointerEvents="none":clearTimeout(o.display.chromeScrollHack),o.display.chromeScrollHack=setTimeout(function(){o.display.chromeScrollHack=null,o.display.sizer.style.pointerEvents=""},100));var u=eu(s),c=u.x,p=u.y,g=Mo;s.deltaMode===0&&(c=s.deltaX,p=s.deltaY,g=1);var m=o.display,y=m.scroller,x=y.scrollWidth>y.clientWidth,O=y.scrollHeight>y.clientHeight;if(c&&x||p&&O){if(p&&bt&&P){t:for(var B=s.target,$=m.view;B!=y;B=B.parentNode)for(var ft=0;ft<$.length;ft++)if($[ft].node==B){o.display.currentWheelTarget=B;break t}}if(c&&!at&&!ot&&g!=null)return p&&O&&Qs(o,Math.max(0,y.scrollTop+p*g)),jo(o,Math.max(0,y.scrollLeft+c*g)),(!p||p&&O)&&We(s),void(m.wheelStartX=null);if(p&&g!=null){var dt=p*g,Ct=o.doc.scrollTop,Rt=Ct+m.wrapper.clientHeight;dt<0?Ct=Math.max(0,Ct+dt-50):Rt=Math.min(o.doc.height,Rt+dt+50),Wl(o,{top:Ct,bottom:Rt})}Ka<20&&s.deltaMode!==0&&(m.wheelStartX==null?(m.wheelStartX=y.scrollLeft,m.wheelStartY=y.scrollTop,m.wheelDX=c,m.wheelDY=p,setTimeout(function(){if(m.wheelStartX!=null){var $t=y.scrollLeft-m.wheelStartX,re=y.scrollTop-m.wheelStartY,le=re&&m.wheelDY&&re/m.wheelDY||$t&&m.wheelDX&&$t/m.wheelDX;m.wheelStartX=m.wheelStartY=null,le&&(Mo=(Mo*Ka+le)/(Ka+1),++Ka)}},200)):(m.wheelDX+=c,m.wheelDY+=p))}}z?Mo=-.53:at?Mo=15:M?Mo=-.7:it&&(Mo=-.3333333333333333);var Ur=function(o,s){this.ranges=o,this.primIndex=s};Ur.prototype.primary=function(){return this.ranges[this.primIndex]},Ur.prototype.equals=function(o){if(o==this)return!0;if(o.primIndex!=this.primIndex||o.ranges.length!=this.ranges.length)return!1;for(var s=0;s=0&&T(o,c.to())<=0)return u}return-1};var tn=function(o,s){this.anchor=o,this.head=s};function Qr(o,s,u){var c=o&&o.options.selectionsMayTouch,p=s[u];s.sort(function(ft,dt){return T(ft.from(),dt.from())}),u=be(s,p);for(var g=1;g0:x>=0){var O=de(y.from(),m.from()),B=te(y.to(),m.to()),$=y.empty()?m.from()==m.head:y.from()==y.head;g<=u&&--u,s.splice(--g,2,new tn($?B:O,$?O:B))}}return new Ur(s,u)}function Qo(o,s){return new Ur([new tn(o,s||o)],0)}function co(o){return o.text?Bt(o.from.line+o.text.length-1,Zt(o.text).length+(o.text.length==1?o.from.ch:0)):o.to}function ru(o,s){if(T(o,s.from)<0)return o;if(T(o,s.to)<=0)return co(s);var u=o.line+s.text.length-(s.to.line-s.from.line)-1,c=o.ch;return o.line==s.to.line&&(c+=co(s).ch-s.to.ch),Bt(u,c)}function Ya(o,s){for(var u=[],c=0;c1&&o.remove(y.line+1,Ct-1),o.insert(y.line+1,re)}bn(o,"change",o,s)}function Do(o,s,u){function c(p,g,m){if(p.linked)for(var y=0;y1&&!o.done[o.done.length-2].ranges?(o.done.pop(),Zt(o.done)):void 0}function Kl(o,s,u,c){var p=o.history;p.undone.length=0;var g,m,y=+new Date;if((p.lastOp==c||p.lastOrigin==s.origin&&s.origin&&(s.origin.charAt(0)=="+"&&p.lastModTime>y-(o.cm?o.cm.options.historyEventDelay:500)||s.origin.charAt(0)=="*"))&&(g=Fp(p,p.lastOp==c)))m=Zt(g.changes),T(s.from,s.to)==0&&T(s.from,m.to)==0?m.to=co(s):g.changes.push(Gl(o,s));else{var x=Zt(p.done);for(x&&x.ranges||Qa(o.sel,p.done),g={changes:[Gl(o,s)],generation:p.generation},p.done.push(g);p.done.length>p.undoDepth;)p.done.shift(),p.done[0].ranges||p.done.shift()}p.done.push(u),p.generation=++p.maxGeneration,p.lastModTime=p.lastSelTime=y,p.lastOp=p.lastSelOp=c,p.lastOrigin=p.lastSelOrigin=s.origin,m||ut(o,"historyAdded")}function Yl(o,s,u,c){var p=s.charAt(0);return p=="*"||p=="+"&&u.ranges.length==c.ranges.length&&u.somethingSelected()==c.somethingSelected()&&new Date-o.history.lastSelTime<=(o.cm?o.cm.options.historyEventDelay:500)}function Vp(o,s,u,c){var p=o.history,g=c&&c.origin;u==p.lastSelOp||g&&p.lastSelOrigin==g&&(p.lastModTime==p.lastSelTime&&p.lastOrigin==g||Yl(o,g,Zt(p.done),s))?p.done[p.done.length-1]=s:Qa(s,p.done),p.lastSelTime=+new Date,p.lastSelOrigin=g,p.lastSelOp=u,c&&c.clearRedo!==!1&&au(p.undone)}function Qa(o,s){var u=Zt(s);u&&u.ranges&&u.equals(o)||s.push(o)}function Xl(o,s,u,c){var p=s["spans_"+o.id],g=0;o.iter(Math.max(o.first,u),Math.min(o.first+o.size,c),function(m){m.markedSpans&&((p||(p=s["spans_"+o.id]={}))[g]=m.markedSpans),++g})}function Rp(o){if(!o)return null;for(var s,u=0;u-1&&(Zt(y)[$]=O[$],delete O[$])}}}return c}function Pi(o,s,u,c){if(c){var p=o.anchor;if(u){var g=T(s,p)<0;g!=T(u,p)<0?(p=s,s=u):g!=T(s,u)<0&&(s=u)}return new tn(p,s)}return new tn(u||s,s)}function tl(o,s,u,c,p){p==null&&(p=o.cm&&(o.cm.display.shift||o.extend)),tr(o,new Ur([Pi(o.sel.primary(),s,u,p)],0),c)}function lu(o,s,u){for(var c=[],p=o.cm&&(o.cm.display.shift||o.extend),g=0;g=s.ch:y.to>s.ch))){if(p&&(ut(x,"beforeCursorEnter"),x.explicitlyCleared)){if(g.markedSpans){--m;continue}break}if(!x.atomic)continue;if(u){var $=x.find(c<0?1:-1),ft=void 0;if((c<0?B:O)&&($=fs(o,$,-c,$&&$.line==s.line?g:null)),$&&$.line==s.line&&(ft=T($,u))&&(c<0?ft<0:ft>0))return Ei(o,$,s,c,p)}var dt=x.find(c<0?-1:1);return(c<0?O:B)&&(dt=fs(o,dt,c,dt.line==s.line?g:null)),dt?Ei(o,dt,s,c,p):null}}return s}function ia(o,s,u,c,p){var g=c||1,m=Ei(o,s,u,g,p)||!p&&Ei(o,s,u,g,!0)||Ei(o,s,u,-g,p)||!p&&Ei(o,s,u,-g,!0);return m||(o.cantEdit=!0,Bt(o.first,0))}function fs(o,s,u,c){return u<0&&s.ch==0?s.line>o.first?oe(o,Bt(s.line-1)):null:u>0&&s.ch==(c||ve(o,s.line)).text.length?s.line=0;--p)fu(o,{from:c[p].from,to:c[p].to,text:p?[""]:s.text,origin:s.origin});else fu(o,s)}}function fu(o,s){if(s.text.length!=1||s.text[0]!=""||T(s.from,s.to)!=0){var u=Ya(o,s);Kl(o,s,u,o.cm?o.cm.curOp.id:NaN),sa(o,s,u,$o(o,s));var c=[];Do(o,function(p,g){g||be(c,p.history)!=-1||(hu(p.history,s),c.push(p.history)),sa(p,s,null,$o(p,s))})}}function ol(o,s,u){var c=o.cm&&o.cm.state.suppressEdits;if(!c||u){for(var p,g=o.history,m=o.sel,y=s=="undo"?g.done:g.undone,x=s=="undo"?g.undone:g.done,O=0;O=0;--dt){var Ct=ft(dt);if(Ct)return Ct.v}}}}function ec(o,s){if(s!=0&&(o.first+=s,o.sel=new Ur(Ae(o.sel.ranges,function(p){return new tn(Bt(p.anchor.line+s,p.anchor.ch),Bt(p.head.line+s,p.head.ch))}),o.sel.primIndex),o.cm)){Qn(o.cm,o.first,o.first-s,s);for(var u=o.cm.display,c=u.viewFrom;co.lastLine())){if(s.from.lineg&&(s={from:s.from,to:Bt(g,ve(o,g).text.length),text:[s.text[0]],origin:s.origin}),s.removed=rr(o,s.from,s.to),u||(u=Ya(o,s)),o.cm?zp(o.cm,s,c):ql(o,s,c),nl(o,u,ce),o.cantEdit&&ia(o,Bt(o.firstLine(),0))&&(o.cantEdit=!1)}}function zp(o,s,u){var c=o.doc,p=o.display,g=s.from,m=s.to,y=!1,x=g.line;o.options.lineWrapping||(x=Ye(Or(ve(c,g.line))),c.iter(x,m.line+1,function(dt){if(dt==p.maxLine)return y=!0,!0})),c.sel.contains(s.from,s.to)>-1&&Yt(o),ql(c,s,u,Wc(o)),o.options.lineWrapping||(c.iter(x,g.line+s.text.length,function(dt){var Ct=vi(dt);Ct>p.maxLineLength&&(p.maxLine=dt,p.maxLineLength=Ct,p.maxLineChanged=!0,y=!1)}),y&&(o.curOp.updateMaxLine=!0)),Is(c,g.line),ls(o,400);var O=s.text.length-(m.line-g.line)-1;s.full?Qn(o):g.line!=m.line||s.text.length!=1||iu(o.doc,s)?Qn(o,g.line,m.line+1,O):lo(o,g.line,"text");var B=he(o,"changes"),$=he(o,"change");if($||B){var ft={from:g,to:m,text:s.text,removed:s.removed,origin:s.origin};$&&bn(o,"change",o,ft),B&&(o.curOp.changeObjs||(o.curOp.changeObjs=[])).push(ft)}o.display.selForContextMenu=null}function ds(o,s,u,c,p){var g;c||(c=u),T(c,u)<0&&(u=(g=[c,u])[0],c=g[1]),typeof s=="string"&&(s=o.splitLines(s)),Ai(o,{from:u,to:c,text:s,origin:p})}function du(o,s,u,c){u1||!(this.children[0]instanceof ca))){var y=[];this.collapse(y),this.children=[new ca(y)],this.children[0].parent=this}},collapse:function(o){for(var s=0;s50){for(var m=p.lines.length%25+25,y=m;y10);o.parent.maybeSpill()}},iterN:function(o,s,u){for(var c=0;c0||m==0&&g.clearWhenEmpty!==!1)return g;if(g.replacedWith&&(g.collapsed=!0,g.widgetNode=N("span",[g.replacedWith],"CodeMirror-widget"),c.handleMouseEvents||g.widgetNode.setAttribute("cm-ignore-events","true"),c.insertLeft&&(g.widgetNode.insertLeft=!0)),g.collapsed){if(yn(o,s.line,s,u,g)||s.line!=u.line&&yn(o,u.line,s,u,g))throw new Error("Inserting collapsed marker partially overlapping an existing one");Fs()}g.addToHistory&&Kl(o,{from:s,to:u,origin:"markText"},o.sel,NaN);var y,x=s.line,O=o.cm;if(o.iter(x,u.line+1,function($){O&&g.collapsed&&!O.options.lineWrapping&&Or($)==O.display.maxLine&&(y=!0),g.collapsed&&x!=s.line&&or($,0),Vs($,new Cr(g,x==s.line?s.ch:null,x==u.line?u.ch:null),o.cm&&o.cm.curOp),++x}),g.collapsed&&o.iter(s.line,u.line+1,function($){Ir(o,$)&&or($,0)}),g.clearOnEnter&&Kt(g,"beforeCursorEnter",function(){return g.clear()}),g.readOnly&&(fi(),(o.history.done.length||o.history.undone.length)&&o.clearHistory()),g.collapsed&&(g.id=++oc,g.atomic=!0),O){if(y&&(O.curOp.updateMaxLine=!0),g.collapsed)Qn(O,s.line,u.line+1);else if(g.className||g.startStyle||g.endStyle||g.css||g.attributes||g.title)for(var B=s.line;B<=u.line;B++)lo(O,B,"text");g.atomic&&rl(O.doc),bn(O,"markerAdded",O,g)}return g}ei.prototype.clear=function(){if(!this.explicitlyCleared){var o=this.doc.cm,s=o&&!o.curOp;if(s&&Oi(o),he(this,"clear")){var u=this.find();u&&bn(this,"clear",u.from,u.to)}for(var c=null,p=null,g=0;go.display.maxLineLength&&(o.display.maxLine=O,o.display.maxLineLength=B,o.display.maxLineChanged=!0)}c!=null&&o&&this.collapsed&&Qn(o,c,p+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,o&&rl(o.doc)),o&&bn(o,"markerCleared",o,this,c,p),s&&Ti(o),this.parent&&this.parent.clear()}},ei.prototype.find=function(o,s){var u,c;o==null&&this.type=="bookmark"&&(o=1);for(var p=0;p=0;x--)Ai(this,c[x]);y?Ql(this,y):this.cm&&ss(this.cm)}),undo:Kn(function(){ol(this,"undo")}),redo:Kn(function(){ol(this,"redo")}),undoSelection:Kn(function(){ol(this,"undo",!0)}),redoSelection:Kn(function(){ol(this,"redo",!0)}),setExtending:function(o){this.extend=o},getExtending:function(){return this.extend},historySize:function(){for(var o=this.history,s=0,u=0,c=0;c=o.ch)&&s.push(p.marker.parent||p.marker)}return s},findMarks:function(o,s,u){o=oe(this,o),s=oe(this,s);var c=[],p=o.line;return this.iter(o.line,s.line+1,function(g){var m=g.markedSpans;if(m)for(var y=0;y=x.to||x.from==null&&p!=o.line||x.from!=null&&p==s.line&&x.from>=s.ch||u&&!u(x.marker)||c.push(x.marker.parent||x.marker)}++p}),c},getAllMarks:function(){var o=[];return this.iter(function(s){var u=s.markedSpans;if(u)for(var c=0;co)return s=o,!0;o-=g,++u}),oe(this,Bt(u,s))},indexFromPos:function(o){var s=(o=oe(this,o)).ch;if(o.lines&&(s=o.from),o.to!=null&&o.to-1)return s.state.draggingText(o),void setTimeout(function(){return s.display.input.focus()},20);try{var B=o.dataTransfer.getData("Text");if(B){var $;if(s.state.draggingText&&!s.state.draggingText.copy&&($=s.listSelections()),nl(s.doc,Qo(u,u)),$)for(var ft=0;ft<$.length;++ft)ds(s.doc,"",$[ft].anchor,$[ft].head,"drag");s.replaceSelection(B,"around","paste"),s.display.input.focus()}}catch{}}}}function bu(o,s){if(z&&(!o.state.draggingText||+new Date-yu<100))Ne(s);else if(!yt(o,s)&&!A(o.display,s)&&(s.dataTransfer.setData("Text",o.getSelection()),s.dataTransfer.effectAllowed="copyMove",s.dataTransfer.setDragImage&&!it)){var u=gt("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ot&&(u.width=u.height=1,o.display.wrapper.appendChild(u),u._top=u.offsetTop),s.dataTransfer.setDragImage(u,0,0),ot&&u.parentNode.removeChild(u)}}function $p(o,s){var u=wi(o,s);if(u){var c=document.createDocumentFragment();Ks(o,u,c),o.display.dragCursor||(o.display.dragCursor=gt("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),o.display.lineSpace.insertBefore(o.display.dragCursor,o.display.cursorDiv)),rt(o.display.dragCursor,c)}}function wu(o){o.display.dragCursor&&(o.display.lineSpace.removeChild(o.display.dragCursor),o.display.dragCursor=null)}function ic(o){if(document.getElementsByClassName){for(var s=document.getElementsByClassName("CodeMirror"),u=[],c=0;c=0;y--)ds(o.doc,"",c[y].from,c[y].to,"+delete");ss(o)})}function fa(o,s,u){var c=ht(o.text,s+u,u);return c<0||c>o.text.length?null:c}function al(o,s,u){var c=fa(o,s.ch,u);return c==null?null:new Bt(s.line,c,u<0?"after":"before")}function ll(o,s,u,c,p){if(o){s.doc.direction=="rtl"&&(p=-p);var g=ze(u,s.doc.direction);if(g){var m,y=p<0?Zt(g):g[0],x=p<0==(y.level==1)?"after":"before";if(y.level>0||s.doc.direction=="rtl"){var O=Eo(s,u);m=p<0?u.text.length-1:0;var B=Hr(s,O,m).top;m=kt(function($){return Hr(s,O,$).top==B},p<0==(y.level==1)?y.from:y.to-1,m),x=="before"&&(m=fa(u,m,1))}else m=p<0?y.to:y.from;return new Bt(c,m,x)}}return new Bt(c,p<0?u.text.length:0,p<0?"before":"after")}function Tu(o,s,u,c){var p=ze(s,o.doc.direction);if(!p)return al(s,u,c);u.ch>=s.text.length?(u.ch=s.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var g=ke(p,u.ch,u.sticky),m=p[g];if(o.doc.direction=="ltr"&&m.level%2==0&&(c>0?m.to>u.ch:m.from=m.from&&ft>=B.begin)){var dt=$?"before":"after";return new Bt(u.line,ft,dt)}}var Ct=function(re,le,Jt){for(var ye=function(an,gr){return gr?new Bt(u.line,x(an,1),"before"):new Bt(u.line,an,"after")};re>=0&&re0==(me.level!=1),sn=Ce?Jt.begin:x(Jt.end,-1);if(me.from<=sn&&sn0?B.end:x(B.begin,-1);return $t==null||c>0&&$t==s.text.length||!(Rt=Ct(c>0?0:p.length-1,c,O($t)))?null:Rt}uo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},uo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},uo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},uo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},uo.default=bt?uo.macDefault:uo.pcDefault;var ms={selectAll:uu,singleSelection:function(o){return o.setSelection(o.getCursor("anchor"),o.getCursor("head"),ce)},killLine:function(o){return ni(o,function(s){if(s.empty()){var u=ve(o.doc,s.head.line).text.length;return s.head.ch==u&&s.head.line0)p=new Bt(p.line,p.ch+1),o.replaceRange(g.charAt(p.ch-1)+g.charAt(p.ch-2),Bt(p.line,p.ch-2),p,"+transpose");else if(p.line>o.doc.first){var m=ve(o.doc,p.line-1).text;m&&(p=new Bt(p.line,1),o.replaceRange(g.charAt(0)+o.doc.lineSeparator()+m.charAt(m.length-1),Bt(p.line-1,m.length-1),p,"+transpose"))}}u.push(new tn(p,p))}o.setSelections(u)})},newlineAndIndent:function(o){return fr(o,function(){for(var s=o.listSelections(),u=s.length-1;u>=0;u--)o.replaceRange(o.doc.lineSeparator(),s[u].anchor,s[u].head,"+input");s=o.listSelections();for(var c=0;c-1&&(T((p=m.ranges[p]).from(),s)<0||s.xRel>0)&&(T(p.to(),s)>0||s.xRel<0)?Xp(o,c,s,g):ma(o,c,s,g)}function Xp(o,s,u,c){var p=o.display,g=!1,m=Gn(o,function(O){P&&(p.scroller.draggable=!1),o.state.draggingText=!1,o.state.delayingBlurEvent&&(o.hasFocus()?o.state.delayingBlurEvent=!1:Rl(o)),tt(p.wrapper.ownerDocument,"mouseup",m),tt(p.wrapper.ownerDocument,"mousemove",y),tt(p.scroller,"dragstart",x),tt(p.scroller,"drop",m),g||(We(O),c.addNew||tl(o.doc,u,null,null,c.extend),P&&!it||z&&k==9?setTimeout(function(){p.wrapper.ownerDocument.body.focus({preventScroll:!0}),p.input.focus()},20):p.input.focus())}),y=function(O){g=g||Math.abs(s.clientX-O.clientX)+Math.abs(s.clientY-O.clientY)>=10},x=function(){return g=!0};P&&(p.scroller.draggable=!0),o.state.draggingText=m,m.copy=!c.moveOnDrag,Kt(p.wrapper.ownerDocument,"mouseup",m),Kt(p.wrapper.ownerDocument,"mousemove",y),Kt(p.scroller,"dragstart",x),Kt(p.scroller,"drop",m),o.state.delayingBlurEvent=!0,setTimeout(function(){return p.input.focus()},20),p.scroller.dragDrop&&p.scroller.dragDrop()}function Nu(o,s,u){if(u=="char")return new tn(s,s);if(u=="word")return o.findWordAt(s);if(u=="line")return new tn(Bt(s.line,0),oe(o.doc,Bt(s.line+1,0)));var c=u(o,s);return new tn(c.from,c.to)}function ma(o,s,u,c){z&&Rl(o);var p=o.display,g=o.doc;We(s);var m,y,x=g.sel,O=x.ranges;if(c.addNew&&!c.extend?(y=g.sel.contains(u),m=y>-1?O[y]:new tn(u,u)):(m=g.sel.primary(),y=g.sel.primIndex),c.unit=="rectangle")c.addNew||(m=new tn(u,u)),u=wi(o,s,!0,!0),y=-1;else{var B=Nu(o,u,c.unit);m=c.extend?Pi(m,B.anchor,B.head,c.extend):B}c.addNew?y==-1?(y=O.length,tr(g,Qr(o,O.concat([m]),y),{scroll:!1,origin:"*mouse"})):O.length>1&&O[y].empty()&&c.unit=="char"&&!c.extend?(tr(g,Qr(o,O.slice(0,y).concat(O.slice(y+1)),0),{scroll:!1,origin:"*mouse"}),x=g.sel):el(g,y,m,st):(y=0,tr(g,new Ur([m],0),st),x=g.sel);var $=u;function ft(Jt){if(T($,Jt)!=0)if($=Jt,c.unit=="rectangle"){for(var ye=[],me=o.options.tabSize,Ce=xe(ve(g,u.line).text,u.ch,me),sn=xe(ve(g,Jt.line).text,Jt.ch,me),an=Math.min(Ce,sn),gr=Math.max(Ce,sn),hn=Math.min(u.line,Jt.line),sr=Math.min(o.lastLine(),Math.max(u.line,Jt.line));hn<=sr;hn++){var vr=ve(g,hn).text,xn=qt(vr,an,me);an==gr?ye.push(new tn(Bt(hn,xn),Bt(hn,xn))):vr.length>xn&&ye.push(new tn(Bt(hn,xn),Bt(hn,qt(vr,gr,me))))}ye.length||ye.push(new tn(u,u)),tr(g,Qr(o,x.ranges.slice(0,y).concat(ye),y),{origin:"*mouse",scroll:!1}),o.scrollIntoView(Jt)}else{var En,dr=m,Vn=Nu(o,Jt,c.unit),An=dr.anchor;T(Vn.anchor,An)>0?(En=Vn.head,An=de(dr.from(),Vn.anchor)):(En=Vn.anchor,An=te(dr.to(),Vn.head));var jn=x.ranges.slice(0);jn[y]=fl(o,new tn(oe(g,An),En)),tr(g,Qr(o,jn,y),st)}}var dt=p.wrapper.getBoundingClientRect(),Ct=0;function Rt(Jt){var ye=++Ct,me=wi(o,Jt,!0,c.unit=="rectangle");if(me)if(T(me,$)!=0){o.curOp.focus=Tt(),ft(me);var Ce=Js(p,g);(me.line>=Ce.to||me.linedt.bottom?20:0;sn&&setTimeout(Gn(o,function(){Ct==ye&&(p.scroller.scrollTop+=sn,Rt(Jt))}),50)}}function $t(Jt){o.state.selectingText=!1,Ct=1/0,Jt&&(We(Jt),p.input.focus()),tt(p.wrapper.ownerDocument,"mousemove",re),tt(p.wrapper.ownerDocument,"mouseup",le),g.history.lastSelOrigin=null}var re=Gn(o,function(Jt){Jt.buttons!==0&&Yn(Jt)?Rt(Jt):$t(Jt)}),le=Gn(o,$t);o.state.selectingText=le,Kt(p.wrapper.ownerDocument,"mousemove",re),Kt(p.wrapper.ownerDocument,"mouseup",le)}function fl(o,s){var u=s.anchor,c=s.head,p=ve(o.doc,u.line);if(T(u,c)==0&&u.sticky==c.sticky)return s;var g=ze(p);if(!g)return s;var m=ke(g,u.ch,u.sticky),y=g[m];if(y.from!=u.ch&&y.to!=u.ch)return s;var x,O=m+(y.from==u.ch==(y.level!=1)?0:1);if(O==0||O==g.length)return s;if(c.line!=u.line)x=(c.line-u.line)*(o.doc.direction=="ltr"?1:-1)>0;else{var B=ke(g,c.ch,c.sticky),$=B-m||(c.ch-u.ch)*(y.level==1?-1:1);x=B==O-1||B==O?$<0:$>0}var ft=g[O+(x?-1:0)],dt=x==(ft.level==1),Ct=dt?ft.from:ft.to,Rt=dt?"after":"before";return u.ch==Ct&&u.sticky==Rt?s:new tn(new Bt(u.line,Ct,Rt),c)}function pc(o,s,u,c){var p,g;if(s.touches)p=s.touches[0].clientX,g=s.touches[0].clientY;else try{p=s.clientX,g=s.clientY}catch{return!1}if(p>=Math.floor(o.display.gutters.getBoundingClientRect().right))return!1;c&&We(s);var m=o.display,y=m.lineDiv.getBoundingClientRect();if(g>y.bottom||!he(o,u))return pn(s);g-=y.top-m.viewOffset;for(var x=0;x=p)return ut(o,u,o,In(o.doc,g),o.display.gutterSpecs[x].className,s),pn(s)}}function fc(o,s){return pc(o,s,"gutterClick",!0)}function Iu(o,s){A(o.display,s)||Jp(o,s)||yt(o,s,"contextmenu")||j||o.display.input.onContextMenu(s)}function Jp(o,s){return!!he(o,"gutterContextMenu")&&pc(o,s,"gutterContextMenu",!1)}function dc(o){o.display.wrapper.className=o.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+o.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Xo(o)}ul.prototype.compare=function(o,s,u){return this.time+Kp>o&&T(s,this.pos)==0&&u==this.button};var bs={toString:function(){return"CodeMirror.Init"}},Fu={},ws={};function Vu(o){var s=o.optionHandlers;function u(c,p,g,m){o.defaults[c]=p,g&&(s[c]=m?function(y,x,O){O!=bs&&g(y,x,O)}:g)}o.defineOption=u,o.Init=bs,u("value","",function(c,p){return c.setValue(p)},!0),u("mode",null,function(c,p){c.doc.modeOption=p,Xa(c)},!0),u("indentUnit",2,Xa,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(c){Lo(c),Xo(c),Qn(c)},!0),u("lineSeparator",null,function(c,p){if(c.doc.lineSep=p,p){var g=[],m=c.doc.first;c.doc.iter(function(x){for(var O=0;;){var B=x.text.indexOf(p,O);if(B==-1)break;O=B+p.length,g.push(Bt(m,B))}m++});for(var y=g.length-1;y>=0;y--)ds(c.doc,p,g[y],Bt(g[y].line,g[y].ch+p.length))}}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(c,p,g){c.state.specialChars=new RegExp(p.source+(p.test(" ")?"":"| "),"g"),g!=bs&&c.refresh()}),u("specialCharPlaceholder",La,function(c){return c.refresh()},!0),u("electricChars",!0),u("inputStyle",xt?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(c,p){return c.getInputField().spellcheck=p},!0),u("autocorrect",!1,function(c,p){return c.getInputField().autocorrect=p},!0),u("autocapitalize",!1,function(c,p){return c.getInputField().autocapitalize=p},!0),u("rtlMoveVisually",!Ft),u("wholeLineUpdateBefore",!0),u("theme","default",function(c){dc(c),cs(c)},!0),u("keyMap","default",function(c,p,g){var m=No(p),y=g!=bs&&No(g);y&&y.detach&&y.detach(c,m),m.attach&&m.attach(c,y||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Qp,!0),u("gutters",[],function(c,p){c.display.gutterSpecs=Ga(p,c.options.lineNumbers),cs(c)},!0),u("fixedGutter",!0,function(c,p){c.display.gutters.style.left=p?Fl(c.display)+"px":"0",c.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(c){return as(c)},!0),u("scrollbarStyle","native",function(c){Yc(c),as(c),c.display.scrollbars.setScrollTop(c.doc.scrollTop),c.display.scrollbars.setScrollLeft(c.doc.scrollLeft)},!0),u("lineNumbers",!1,function(c,p){c.display.gutterSpecs=Ga(c.options.gutters,p),cs(c)},!0),u("firstLineNumber",1,cs,!0),u("lineNumberFormatter",function(c){return c},cs,!0),u("showCursorWhenSelecting",!1,qs,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(c,p){p=="nocursor"&&(xi(c),c.display.input.blur()),c.display.input.readOnlyChanged(p)}),u("screenReaderLabel",null,function(c,p){p=p===""?null:p,c.display.input.screenReaderLabelChanged(p)}),u("disableInput",!1,function(c,p){p||c.display.input.reset()},!0),u("dragDrop",!0,Zp),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,qs,!0),u("singleCursorHeightPerLine",!0,qs,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,Lo,!0),u("addModeClass",!1,Lo,!0),u("pollInterval",100),u("undoDepth",200,function(c,p){return c.doc.history.undoDepth=p}),u("historyEventDelay",1250),u("viewportMargin",10,function(c){return c.refresh()},!0),u("maxHighlightLength",1e4,Lo,!0),u("moveInputWithCursor",!0,function(c,p){p||c.display.input.resetPosition()}),u("tabindex",null,function(c,p){return c.display.input.getField().tabIndex=p||""}),u("autofocus",null),u("direction","ltr",function(c,p){return c.doc.setDirection(p)},!0),u("phrases",null)}function Zp(o,s,u){if(!s!=!(u&&u!=bs)){var c=o.display.dragFunctions,p=s?Kt:tt;p(o.display.scroller,"dragstart",c.start),p(o.display.scroller,"dragenter",c.enter),p(o.display.scroller,"dragover",c.over),p(o.display.scroller,"dragleave",c.leave),p(o.display.scroller,"drop",c.drop)}}function Qp(o){o.options.lineWrapping?(Qt(o.display.wrapper,"CodeMirror-wrap"),o.display.sizer.style.minWidth="",o.display.sizerWidth=null):(nt(o.display.wrapper,"CodeMirror-wrap"),Rs(o)),Vl(o),Qn(o),Xo(o),setTimeout(function(){return as(o)},100)}function wn(o,s){var u=this;if(!(this instanceof wn))return new wn(o,s);this.options=s=s?De(s):{},De(Fu,s,!1);var c=s.value;typeof c=="string"?c=new Fn(c,s.mode,null,s.lineSeparator,s.direction):s.mode&&(c.modeOption=s.mode),this.doc=c;var p=new wn.inputStyles[s.inputStyle](this),g=this.display=new tu(o,c,p,s);for(var m in g.wrapper.CodeMirror=this,dc(this),s.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Yc(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Te,keySeq:null,specialChars:null},s.autofocus&&!xt&&g.input.focus(),z&&k<11&&setTimeout(function(){return u.display.input.reset(!0)},20),tf(this),Sn(),Oi(this),this.curOp.forceUpdate=!0,su(this,c),s.autofocus&&!xt||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&Hl(u)},20):xi(this),ws)ws.hasOwnProperty(m)&&ws[m](this,s[m],bs);Zc(this),s.finishInit&&s.finishInit(this);for(var y=0;y400}Kt(s.scroller,"touchstart",function(x){if(!yt(o,x)&&!g(x)&&!fc(o,x)){s.input.ensurePolled(),clearTimeout(u);var O=+new Date;s.activeTouch={start:O,moved:!1,prev:O-c.end<=300?c:null},x.touches.length==1&&(s.activeTouch.left=x.touches[0].pageX,s.activeTouch.top=x.touches[0].pageY)}}),Kt(s.scroller,"touchmove",function(){s.activeTouch&&(s.activeTouch.moved=!0)}),Kt(s.scroller,"touchend",function(x){var O=s.activeTouch;if(O&&!A(s,x)&&O.left!=null&&!O.moved&&new Date-O.start<300){var B,$=o.coordsChar(s.activeTouch,"page");B=!O.prev||m(O,O.prev)?new tn($,$):!O.prev.prev||m(O,O.prev.prev)?o.findWordAt($):new tn(Bt($.line,0),oe(o.doc,Bt($.line+1,0))),o.setSelection(B.anchor,B.head),o.focus(),We(x)}p()}),Kt(s.scroller,"touchcancel",p),Kt(s.scroller,"scroll",function(){s.scroller.clientHeight&&(Qs(o,s.scroller.scrollTop),jo(o,s.scroller.scrollLeft,!0),ut(o,"scroll",o))}),Kt(s.scroller,"mousewheel",function(x){return nu(o,x)}),Kt(s.scroller,"DOMMouseScroll",function(x){return nu(o,x)}),Kt(s.wrapper,"scroll",function(){return s.wrapper.scrollTop=s.wrapper.scrollLeft=0}),s.dragFunctions={enter:function(x){yt(o,x)||Ne(x)},over:function(x){yt(o,x)||($p(o,x),Ne(x))},start:function(x){return bu(o,x)},drop:Gn(o,Wp),leave:function(x){yt(o,x)||wu(o)}};var y=s.input.getField();Kt(y,"keyup",function(x){return Au.call(o,x)}),Kt(y,"keydown",Gn(o,uc)),Kt(y,"keypress",Gn(o,ju)),Kt(y,"focus",function(x){return Hl(o,x)}),Kt(y,"blur",function(x){return xi(o,x)})}wn.defaults=Fu,wn.optionHandlers=ws;var hc=[];function ya(o,s,u,c){var p,g=o.doc;u==null&&(u="add"),u=="smart"&&(g.mode.indent?p=bo(o,s).state:u="prev");var m=o.options.tabSize,y=ve(g,s),x=xe(y.text,null,m);y.stateAfter&&(y.stateAfter=null);var O,B=y.text.match(/^\s*/)[0];if(c||/\S/.test(y.text)){if(u=="smart"&&((O=g.mode.indent(p,y.text.slice(B.length),y.text))==pe||O>150)){if(!c)return;u="prev"}}else O=0,u="not";u=="prev"?O=s>g.first?xe(ve(g,s-1).text,null,m):0:u=="add"?O=x+o.options.indentUnit:u=="subtract"?O=x-o.options.indentUnit:typeof u=="number"&&(O=x+u),O=Math.max(0,O);var $="",ft=0;if(o.options.indentWithTabs)for(var dt=Math.floor(O/m);dt;--dt)ft+=m,$+=" ";if(ftm,x=_o(s),O=null;if(y&&c.ranges.length>1)if(po&&po.text.join(` `)==s){if(c.ranges.length%po.text.length==0){O=[];for(var B=0;B=0;ft--){var dt=c.ranges[ft],Ct=dt.from(),Rt=dt.to();dt.empty()&&(u&&u>0?Ct=Bt(Ct.line,Ct.ch-u):o.state.overwrite&&!y?Rt=Bt(Rt.line,Math.min(ve(g,Rt.line).text.length,Rt.ch+Zt(x).length)):y&&po&&po.lineWise&&po.text.join(` `)==x.join(` `)&&(Ct=Rt=Bt(Ct.line,0)));var $t={from:Ct,to:Rt,text:O?O[ft%O.length]:x,origin:p||(y?"paste":o.state.cutIncoming>m?"cut":"+input")};Ai(o.doc,$t),bn(o,"inputRead",o,$t)}s&&!y&&vc(o,s),ss(o),o.curOp.updateInput<2&&(o.curOp.updateInput=$),o.curOp.typing=!0,o.state.pasteIncoming=o.state.cutIncoming=-1}function Ru(o,s){var u=o.clipboardData&&o.clipboardData.getData("Text");if(u)return o.preventDefault(),s.isReadOnly()||s.options.disableInput||!s.hasFocus()||fr(s,function(){return gc(s,u,0,null,"paste")}),!0}function vc(o,s){if(o.options.electricChars&&o.options.smartIndent)for(var u=o.doc.sel,c=u.ranges.length-1;c>=0;c--){var p=u.ranges[c];if(!(p.head.ch>100||c&&u.ranges[c-1].head.line==p.head.line)){var g=o.getModeAt(p.head),m=!1;if(g.electricChars){for(var y=0;y-1){m=ya(o,p.head.line,"smart");break}}else g.electricInput&&g.electricInput.test(ve(o.doc,p.head.line).text.slice(0,p.head.ch))&&(m=ya(o,p.head.line,"smart"));m&&bn(o,"electricInput",o,p.head.line)}}}function Hu(o){for(var s=[],u=[],c=0;cg&&(ya(this,y.head.line,c,!0),g=y.head.line,m==this.doc.sel.primIndex&&ss(this));else{var x=y.from(),O=y.to(),B=Math.max(g,x.line);g=Math.min(this.lastLine(),O.line-(O.ch?0:1))+1;for(var $=B;$0&&el(this.doc,m,new tn(x,ft[m].to()),ce)}}}),getTokenAt:function(c,p){return Wo(this,c,p)},getLineTokens:function(c,p){return Wo(this,Bt(c),p,!0)},getTokenTypeAt:function(c){c=oe(this.doc,c);var p,g=xr(this,ve(this.doc,c.line)),m=0,y=(g.length-1)/2,x=c.ch;if(x==0)p=g[2];else for(;;){var O=m+y>>1;if((O?g[2*O-1]:0)>=x)y=O;else{if(!(g[2*O+1]x&&(c=x,y=!0),m=ve(this.doc,c)}else m=c;return Ra(this,m,{top:0,left:0},p||"page",g||y).top+(y?this.doc.height-Fr(m):0)},defaultTextHeight:function(){return ao(this.display)},defaultCharWidth:function(){return Jo(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(c,p,g,m,y){var x=this.display,O=(c=kr(this,oe(this.doc,c))).bottom,B=c.left;if(p.style.position="absolute",p.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(p),x.sizer.appendChild(p),m=="over")O=c.top;else if(m=="above"||m=="near"){var $=Math.max(x.wrapper.clientHeight,this.doc.height),ft=Math.max(x.sizer.clientWidth,x.lineSpace.clientWidth);(m=="above"||c.bottom+p.offsetHeight>$)&&c.top>p.offsetHeight?O=c.top-p.offsetHeight:c.bottom+p.offsetHeight<=$&&(O=c.bottom),B+p.offsetWidth>ft&&(B=ft-p.offsetWidth)}p.style.top=O+"px",p.style.left=p.style.right="",y=="right"?(B=x.sizer.clientWidth-p.offsetWidth,p.style.right="0px"):(y=="left"?B=0:y=="middle"&&(B=(x.sizer.clientWidth-p.offsetWidth)/2),p.style.left=B+"px"),g&&Sp(this,{left:B,top:O,right:B+p.offsetWidth,bottom:O+p.offsetHeight})},triggerOnKeyDown:ir(uc),triggerOnKeyPress:ir(ju),triggerOnKeyUp:Au,triggerOnMouseDown:ir(Mu),execCommand:function(c){if(ms.hasOwnProperty(c))return ms[c].call(null,this)},triggerElectric:ir(function(c){vc(this,c)}),findPosH:function(c,p,g,m){var y=1;p<0&&(y=-1,p=-p);for(var x=oe(this.doc,c),O=0;O0&&O(p.charAt(g-1));)--g;for(;m.5||this.options.lineWrapping)&&Vl(this),ut(this,"refresh",this)}),swapDoc:ir(function(c){var p=this.doc;return p.cm=null,this.state.selectingText&&this.state.selectingText(),su(this,c),Xo(this),this.display.input.reset(),Zs(this,c.scrollLeft,c.scrollTop),this.curOp.forceScroll=!0,bn(this,"swapDoc",this,p),p}),phrase:function(c){var p=this.options.phrases;return p&&Object.prototype.hasOwnProperty.call(p,c)?p[c]:c},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Re(o),o.registerHelper=function(c,p,g){u.hasOwnProperty(c)||(u[c]=o[c]={_global:[]}),u[c][p]=g},o.registerGlobalHelper=function(c,p,g,m){o.registerHelper(c,p,m),u[c]._global.push({pred:g,val:m})}}function hl(o,s,u,c,p){var g=s,m=u,y=ve(o,s.line),x=p&&o.direction=="rtl"?-u:u;function O(){var le=s.line+x;return!(le=o.first+o.size)&&(s=new Bt(le,s.ch,s.sticky),y=ve(o,le))}function B(le){var Jt;if(c=="codepoint"){var ye=y.text.charCodeAt(s.ch+(u>0?0:-1));if(isNaN(ye))Jt=null;else{var me=u>0?ye>=55296&&ye<56320:ye>=56320&&ye<57343;Jt=new Bt(s.line,Math.max(0,Math.min(y.text.length,s.ch+u*(me?2:1))),-u)}}else Jt=p?Tu(o.cm,y,s,u):al(y,s,u);if(Jt==null){if(le||!O())return!1;s=ll(p,o.cm,y,s.line,x)}else s=Jt;return!0}if(c=="char"||c=="codepoint")B();else if(c=="column")B(!0);else if(c=="word"||c=="group")for(var $=null,ft=c=="group",dt=o.cm&&o.cm.getHelper(s,"wordChars"),Ct=!0;!(u<0)||B(!Ct);Ct=!1){var Rt=y.text.charAt(s.ch)||` `,$t=zt(Rt,dt)?"w":ft&&Rt==` `?"n":!ft||/\s/.test(Rt)?null:"p";if(!ft||Ct||$t||($t="s"),$&&$!=$t){u<0&&(u=1,B(),s.sticky="after");break}if($t&&($=$t),u>0&&!B(!Ct))break}var re=ia(o,s,g,m,!0);return G(g,re)&&(re.hitSide=!0),re}function gl(o,s,u,c){var p,g,m=o.doc,y=s.left;if(c=="page"){var x=Math.min(o.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),O=Math.max(x-.5*ao(o.display),3);p=(u>0?s.bottom:s.top)+u*O}else c=="line"&&(p=u>0?s.bottom+3:s.top-3);for(;(g=Dl(o,y,p)).outside;){if(u<0?p<=0:p>=m.height){g.hitSide=!0;break}p+=5*u}return g}var rn=function(o){this.cm=o,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Te,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function yc(o,s){var u=ts(o,s.line);if(!u||u.hidden)return null;var c=ve(o.doc,s.line),p=He(u,c,s.line),g=ze(c,o.doc.direction),m="left";g&&(m=ke(g,s.ch)%2?"right":"left");var y=Ws(p.map,s.ch,m);return y.offset=y.collapse=="right"?y.end:y.start,y}function ef(o){for(var s=o;s;s=s.parentNode)if(/CodeMirror-gutter-wrapper/.test(s.className))return!0;return!1}function _s(o,s){return s&&(o.bad=!0),o}function bc(o,s,u,c,p){var g="",m=!1,y=o.doc.lineSeparator(),x=!1;function O(dt){return function(Ct){return Ct.id==dt}}function B(){m&&(g+=y,x&&(g+=y),m=x=!1)}function $(dt){dt&&(B(),g+=dt)}function ft(dt){if(dt.nodeType==1){var Ct=dt.getAttribute("cm-text");if(Ct)return void $(Ct);var Rt,$t=dt.getAttribute("cm-marker");if($t){var re=o.findMarks(Bt(c,0),Bt(p+1,0),O(+$t));return void(re.length&&(Rt=re[0].find(0))&&$(rr(o.doc,Rt.from,Rt.to).join(y)))}if(dt.getAttribute("contenteditable")=="false")return;var le=/^(pre|div|p|li|table|br)$/i.test(dt.nodeName);if(!/^br$/i.test(dt.nodeName)&&dt.textContent.length==0)return;le&&B();for(var Jt=0;Jt=s.display.viewTo||p.line=s.display.viewFrom&&yc(s,c)||{node:y[0].measure.map[2],offset:0},O=p.linec.firstLine()&&(m=Bt(m.line-1,ve(c.doc,m.line-1).length)),y.ch==ve(c.doc,y.line).text.length&&y.linep.viewTo-1)return!1;m.line==p.viewFrom||(o=_i(c,m.line))==0?(s=Ye(p.view[0].line),u=p.view[0].node):(s=Ye(p.view[o].line),u=p.view[o-1].node.nextSibling);var x,O,B=_i(c,y.line);if(B==p.view.length-1?(x=p.viewTo-1,O=p.lineDiv.lastChild):(x=Ye(p.view[B+1].line)-1,O=p.view[B+1].node.previousSibling),!u)return!1;for(var $=c.doc.splitLines(bc(c,u,O,s,x)),ft=rr(c.doc,Bt(s,0),Bt(x,ve(c.doc,x).text.length));$.length>1&&ft.length>1;)if(Zt($)==Zt(ft))$.pop(),ft.pop(),x--;else{if($[0]!=ft[0])break;$.shift(),ft.shift(),s++}for(var dt=0,Ct=0,Rt=$[0],$t=ft[0],re=Math.min(Rt.length,$t.length);dtm.ch&&le.charCodeAt(le.length-Ct-1)==Jt.charCodeAt(Jt.length-Ct-1);)dt--,Ct++;$[$.length-1]=le.slice(0,le.length-Ct).replace(/^\u200b+/,""),$[0]=$[0].slice(dt).replace(/\u200b+$/,"");var me=Bt(s,dt),Ce=Bt(x,ft.length?Zt(ft).length-Ct:0);return $.length>1||$[0]||T(me,Ce)?(ds(c.doc,$,me,Ce,"+input"),!0):void 0},rn.prototype.ensurePolled=function(){this.forceCompositionEnd()},rn.prototype.reset=function(){this.forceCompositionEnd()},rn.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},rn.prototype.readFromDOMSoon=function(){var o=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(o.readDOMTimeout=null,o.composing){if(!o.composing.done)return;o.composing=null}o.updateFromDOM()},80))},rn.prototype.updateFromDOM=function(){var o=this;!this.cm.isReadOnly()&&this.pollContent()||fr(this.cm,function(){return Qn(o.cm)})},rn.prototype.setUneditable=function(o){o.contentEditable="false"},rn.prototype.onKeyPress=function(o){o.charCode==0||this.composing||(o.preventDefault(),this.cm.isReadOnly()||Gn(this.cm,gc)(this.cm,String.fromCharCode(o.charCode==null?o.keyCode:o.charCode),0))},rn.prototype.readOnlyChanged=function(o){this.div.contentEditable=String(o!="nocursor")},rn.prototype.onContextMenu=function(){},rn.prototype.resetPosition=function(){},rn.prototype.needsContentAttribute=!0;var Pn=function(o){this.cm=o,this.prevInput="",this.pollingFast=!1,this.polling=new Te,this.hasSelection=!1,this.composing=null};function rf(o,s){if((s=s?De(s):{}).value=o.value,!s.tabindex&&o.tabIndex&&(s.tabindex=o.tabIndex),!s.placeholder&&o.placeholder&&(s.placeholder=o.placeholder),s.autofocus==null){var u=Tt();s.autofocus=u==o||o.getAttribute("autofocus")!=null&&u==document.body}function c(){o.value=y.getValue()}var p;if(o.form&&(Kt(o.form,"submit",c),!s.leaveSubmitMethodAlone)){var g=o.form;p=g.submit;try{var m=g.submit=function(){c(),g.submit=p,g.submit(),g.submit=m}}catch{}}s.finishInit=function(x){x.save=c,x.getTextArea=function(){return o},x.toTextArea=function(){x.toTextArea=isNaN,c(),o.parentNode.removeChild(x.getWrapperElement()),o.style.display="",o.form&&(tt(o.form,"submit",c),s.leaveSubmitMethodAlone||typeof o.form.submit!="function"||(o.form.submit=p))}},o.style.display="none";var y=wn(function(x){return o.parentNode.insertBefore(x,o.nextSibling)},s);return y}function of(o){o.off=tt,o.on=Kt,o.wheelEventPixels=Np,o.Doc=Fn,o.splitLines=_o,o.countColumn=xe,o.findColumn=qt,o.isWordChar=mt,o.Pass=pe,o.signal=ut,o.Line=Vr,o.changeEnd=co,o.scrollbarModel=Kc,o.Pos=Bt,o.cmpPos=T,o.modes=ur,o.mimeModes=ln,o.resolveMode=Co,o.getMode=Jr,o.modeExtensions=Wn,o.extendMode=Nn,o.copyState=$n,o.startState=mo,o.innerMode=zo,o.commands=ms,o.keyMap=uo,o.keyName=Ou,o.isModifierKey=ac,o.lookupKey=Mi,o.normalizeKeyMap=sl,o.StringStream=qe,o.SharedTextMarker=pa,o.TextMarker=ei,o.LineWidget=ua,o.e_preventDefault=We,o.e_stopPropagation=Ln,o.e_stop=Ne,o.addClass=Qt,o.contains=Lt,o.rmClass=nt,o.keyNames=to}Pn.prototype.init=function(o){var s=this,u=this,c=this.cm;this.createField(o);var p=this.textarea;function g(m){if(!yt(c,m)){if(c.somethingSelected())dl({lineWise:!1,text:c.getSelections()});else{if(!c.options.lineWiseCopyCut)return;var y=Hu(c);dl({lineWise:!0,text:y.text}),m.type=="cut"?c.setSelections(y.ranges,null,ce):(u.prevInput="",p.value=y.text.join(` `),Se(p))}m.type=="cut"&&(c.state.cutIncoming=+new Date)}}o.wrapper.insertBefore(this.wrapper,o.wrapper.firstChild),Dt&&(p.style.width="0px"),Kt(p,"input",function(){z&&k>=9&&s.hasSelection&&(s.hasSelection=null),u.poll()}),Kt(p,"paste",function(m){yt(c,m)||Ru(m,c)||(c.state.pasteIncoming=+new Date,u.fastPoll())}),Kt(p,"cut",g),Kt(p,"copy",g),Kt(o.scroller,"paste",function(m){if(!A(o,m)&&!yt(c,m)){if(!p.dispatchEvent)return c.state.pasteIncoming=+new Date,void u.focus();var y=new Event("paste");y.clipboardData=m.clipboardData,p.dispatchEvent(y)}}),Kt(o.lineSpace,"selectstart",function(m){A(o,m)||We(m)}),Kt(p,"compositionstart",function(){var m=c.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:m,range:c.markText(m,c.getCursor("to"),{className:"CodeMirror-composing"})}}),Kt(p,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},Pn.prototype.createField=function(o){this.wrapper=Uu(),this.textarea=this.wrapper.firstChild},Pn.prototype.screenReaderLabelChanged=function(o){o?this.textarea.setAttribute("aria-label",o):this.textarea.removeAttribute("aria-label")},Pn.prototype.prepareSelection=function(){var o=this.cm,s=o.display,u=o.doc,c=Gs(o);if(o.options.moveInputWithCursor){var p=kr(o,u.sel.primary().head,"div"),g=s.wrapper.getBoundingClientRect(),m=s.lineDiv.getBoundingClientRect();c.teTop=Math.max(0,Math.min(s.wrapper.clientHeight-10,p.top+m.top-g.top)),c.teLeft=Math.max(0,Math.min(s.wrapper.clientWidth-10,p.left+m.left-g.left))}return c},Pn.prototype.showSelection=function(o){var s=this.cm.display;rt(s.cursorDiv,o.cursors),rt(s.selectionDiv,o.selection),o.teTop!=null&&(this.wrapper.style.top=o.teTop+"px",this.wrapper.style.left=o.teLeft+"px")},Pn.prototype.reset=function(o){if(!this.contextMenuPending&&!this.composing){var s=this.cm;if(s.somethingSelected()){this.prevInput="";var u=s.getSelection();this.textarea.value=u,s.state.focused&&Se(this.textarea),z&&k>=9&&(this.hasSelection=u)}else o||(this.prevInput=this.textarea.value="",z&&k>=9&&(this.hasSelection=null))}},Pn.prototype.getField=function(){return this.textarea},Pn.prototype.supportsTouch=function(){return!1},Pn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!xt||Tt()!=this.textarea))try{this.textarea.focus()}catch{}},Pn.prototype.blur=function(){this.textarea.blur()},Pn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Pn.prototype.receivedFocus=function(){this.slowPoll()},Pn.prototype.slowPoll=function(){var o=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){o.poll(),o.cm.state.focused&&o.slowPoll()})},Pn.prototype.fastPoll=function(){var o=!1,s=this;function u(){s.poll()||o?(s.pollingFast=!1,s.slowPoll()):(o=!0,s.polling.set(60,u))}s.pollingFast=!0,s.polling.set(20,u)},Pn.prototype.poll=function(){var o=this,s=this.cm,u=this.textarea,c=this.prevInput;if(this.contextMenuPending||!s.state.focused||Vo(u)&&!c&&!this.composing||s.isReadOnly()||s.options.disableInput||s.state.keySeq)return!1;var p=u.value;if(p==c&&!s.somethingSelected())return!1;if(z&&k>=9&&this.hasSelection===p||bt&&/[\uf700-\uf7ff]/.test(p))return s.display.input.reset(),!1;if(s.doc.sel==s.display.selForContextMenu){var g=p.charCodeAt(0);if(g!=8203||c||(c="​"),g==8666)return this.reset(),this.cm.execCommand("undo")}for(var m=0,y=Math.min(c.length,p.length);m1e3||p.indexOf(` `)>-1?u.value=o.prevInput="":o.prevInput=p,o.composing&&(o.composing.range.clear(),o.composing.range=s.markText(o.composing.start,s.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Pn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Pn.prototype.onKeyPress=function(){z&&k>=9&&(this.hasSelection=null),this.fastPoll()},Pn.prototype.onContextMenu=function(o){var s=this,u=s.cm,c=u.display,p=s.textarea;s.contextMenuPending&&s.contextMenuPending();var g=wi(u,o),m=c.scroller.scrollTop;if(g&&!ot){u.options.resetSelectionOnContextMenu&&u.doc.sel.contains(g)==-1&&Gn(u,tr)(u.doc,Qo(g),ce);var y,x=p.style.cssText,O=s.wrapper.style.cssText,B=s.wrapper.offsetParent.getBoundingClientRect();if(s.wrapper.style.cssText="position: static",p.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(o.clientY-B.top-5)+"px; left: "+(o.clientX-B.left-5)+`px; z-index: 1000; background: `+(z?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`,P&&(y=window.scrollY),c.input.focus(),P&&window.scrollTo(null,y),c.input.reset(),u.somethingSelected()||(p.value=s.prevInput=" "),s.contextMenuPending=dt,c.selForContextMenu=u.doc.sel,clearTimeout(c.detectingSelectAll),z&&k>=9&&ft(),j){Ne(o);var $=function(){tt(window,"mouseup",$),setTimeout(dt,20)};Kt(window,"mouseup",$)}else setTimeout(dt,50)}function ft(){if(p.selectionStart!=null){var Ct=u.somethingSelected(),Rt="​"+(Ct?p.value:"");p.value="⇚",p.value=Rt,s.prevInput=Ct?"":"​",p.selectionStart=1,p.selectionEnd=Rt.length,c.selForContextMenu=u.doc.sel}}function dt(){if(s.contextMenuPending==dt&&(s.contextMenuPending=!1,s.wrapper.style.cssText=O,p.style.cssText=x,z&&k<9&&c.scrollbars.setScrollTop(c.scroller.scrollTop=m),p.selectionStart!=null)){(!z||z&&k<9)&&ft();var Ct=0,Rt=function(){c.selForContextMenu==u.doc.sel&&p.selectionStart==0&&p.selectionEnd>0&&s.prevInput=="​"?Gn(u,uu)(u):Ct++<10?c.detectingSelectAll=setTimeout(Rt,500):(c.selForContextMenu=null,c.input.reset())};c.detectingSelectAll=setTimeout(Rt,200)}}},Pn.prototype.readOnlyChanged=function(o){o||this.reset(),this.textarea.disabled=o=="nocursor",this.textarea.readOnly=!!o},Pn.prototype.setUneditable=function(){},Pn.prototype.needsContentAttribute=!1,Vu(wn),mc(wn);var Bu="iter insert remove copy getEditor constructor".split(" ");for(var xs in Fn.prototype)Fn.prototype.hasOwnProperty(xs)&&be(Bu,xs)<0&&(wn.prototype[xs]=function(o){return function(){return o.apply(this.doc,arguments)}}(Fn.prototype[xs]));return Re(Fn),wn.inputStyles={textarea:Pn,contenteditable:rn},wn.defineMode=function(o){wn.defaults.mode||o=="null"||(wn.defaults.mode=o),Ho.apply(this,arguments)},wn.defineMIME=Lr,wn.defineMode("null",function(){return{token:function(o){return o.skipToEnd()}}}),wn.defineMIME("text/plain","null"),wn.defineExtension=function(o,s){wn.prototype[o]=s},wn.defineDocExtension=function(o,s){Fn.prototype[o]=s},wn.fromTextArea=rf,of(wn),wn.version="5.65.6",wn}()},629:(S,H,pt)=>{(function(at){function _t(j){for(var V={},Y=0;Y*\/]/.test(b)?st(null,"select-op"):b=="."&&mt.match(/^-?[_a-z][_a-z0-9-]*/i)?st("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(b)?st(null,b):mt.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(mt.current())&&(zt.tokenize=ne),st("variable callee","variable")):/[\w\\\-]/.test(b)?(mt.eatWhile(/[\w\\\-]/),st("property","word")):st(null,null):/[\d.]/.test(mt.peek())?(mt.eatWhile(/[\w.%]/),st("number","unit")):mt.match(/^-[\w\\\-]*/)?(mt.eatWhile(/[\w\\\-]/),mt.match(/^\s*:/,!1)?st("variable-2","variable-definition"):st("variable-2","variable")):mt.match(/^\w+-/)?st("meta","meta"):void 0}function qt(mt){return function(zt,b){for(var I,U=!1;(I=zt.next())!=null;){if(I==mt&&!U){mt==")"&&zt.backUp(1);break}U=!U&&I=="\\"}return(I==mt||!U&&mt!=")")&&(b.tokenize=null),st("string","string")}}function ne(mt,zt){return mt.next(),mt.match(/^\s*[\"\')]/,!1)?zt.tokenize=null:zt.tokenize=qt(")"),st(null,"(")}function ae(mt,zt,b){this.type=mt,this.indent=zt,this.prev=b}function Zt(mt,zt,b,I){return mt.context=new ae(b,zt.indentation()+(I===!1?0:rt),mt.context),b}function Ae(mt){return mt.context.prev&&(mt.context=mt.context.prev),mt.context.type}function Ke(mt,zt,b){return Rn[b.context.type](mt,zt,b)}function Xe(mt,zt,b,I){for(var U=I||1;U>0;U--)b.context=b.context.prev;return Ke(mt,zt,b)}function vn(mt){var zt=mt.current().toLowerCase();wt=Te.hasOwnProperty(zt)?"atom":xe.hasOwnProperty(zt)?"keyword":"variable"}var Rn={top:function(mt,zt,b){if(mt=="{")return Zt(b,zt,"block");if(mt=="}"&&b.context.prev)return Ae(b);if(pe&&/@component/i.test(mt))return Zt(b,zt,"atComponentBlock");if(/^@(-moz-)?document$/i.test(mt))return Zt(b,zt,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(mt))return Zt(b,zt,"atBlock");if(/^@(font-face|counter-style)/i.test(mt))return b.stateArg=mt,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(mt))return"keyframes";if(mt&&mt.charAt(0)=="@")return Zt(b,zt,"at");if(mt=="hash")wt="builtin";else if(mt=="word")wt="tag";else{if(mt=="variable-definition")return"maybeprop";if(mt=="interpolation")return Zt(b,zt,"interpolation");if(mt==":")return"pseudo";if(be&&mt=="(")return Zt(b,zt,"parens")}return b.context.type},block:function(mt,zt,b){if(mt=="word"){var I=zt.current().toLowerCase();return Oe.hasOwnProperty(I)?(wt="property","maybeprop"):Se.hasOwnProperty(I)?(wt=ce?"string-2":"property","maybeprop"):be?(wt=zt.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(wt+=" error","maybeprop")}return mt=="meta"?"block":be||mt!="hash"&&mt!="qualifier"?Rn.top(mt,zt,b):(wt="error","block")},maybeprop:function(mt,zt,b){return mt==":"?Zt(b,zt,"prop"):Ke(mt,zt,b)},prop:function(mt,zt,b){if(mt==";")return Ae(b);if(mt=="{"&&be)return Zt(b,zt,"propBlock");if(mt=="}"||mt=="{")return Xe(mt,zt,b);if(mt=="(")return Zt(b,zt,"parens");if(mt!="hash"||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(zt.current())){if(mt=="word")vn(zt);else if(mt=="interpolation")return Zt(b,zt,"interpolation")}else wt+=" error";return"prop"},propBlock:function(mt,zt,b){return mt=="}"?Ae(b):mt=="word"?(wt="property","maybeprop"):b.context.type},parens:function(mt,zt,b){return mt=="{"||mt=="}"?Xe(mt,zt,b):mt==")"?Ae(b):mt=="("?Zt(b,zt,"parens"):mt=="interpolation"?Zt(b,zt,"interpolation"):(mt=="word"&&vn(zt),"parens")},pseudo:function(mt,zt,b){return mt=="meta"?"pseudo":mt=="word"?(wt="variable-3",b.context.type):Ke(mt,zt,b)},documentTypes:function(mt,zt,b){return mt=="word"&&N.hasOwnProperty(zt.current())?(wt="tag",b.context.type):Rn.atBlock(mt,zt,b)},atBlock:function(mt,zt,b){if(mt=="(")return Zt(b,zt,"atBlock_parens");if(mt=="}"||mt==";")return Xe(mt,zt,b);if(mt=="{")return Ae(b)&&Zt(b,zt,be?"block":"top");if(mt=="interpolation")return Zt(b,zt,"interpolation");if(mt=="word"){var I=zt.current().toLowerCase();wt=I=="only"||I=="not"||I=="and"||I=="or"?"keyword":Lt.hasOwnProperty(I)?"attribute":Tt.hasOwnProperty(I)?"property":Qt.hasOwnProperty(I)?"keyword":Oe.hasOwnProperty(I)?"property":Se.hasOwnProperty(I)?ce?"string-2":"property":Te.hasOwnProperty(I)?"atom":xe.hasOwnProperty(I)?"keyword":"error"}return b.context.type},atComponentBlock:function(mt,zt,b){return mt=="}"?Xe(mt,zt,b):mt=="{"?Ae(b)&&Zt(b,zt,be?"block":"top",!1):(mt=="word"&&(wt="error"),b.context.type)},atBlock_parens:function(mt,zt,b){return mt==")"?Ae(b):mt=="{"||mt=="}"?Xe(mt,zt,b,2):Rn.atBlock(mt,zt,b)},restricted_atBlock_before:function(mt,zt,b){return mt=="{"?Zt(b,zt,"restricted_atBlock"):mt=="word"&&b.stateArg=="@counter-style"?(wt="variable","restricted_atBlock_before"):Ke(mt,zt,b)},restricted_atBlock:function(mt,zt,b){return mt=="}"?(b.stateArg=null,Ae(b)):mt=="word"?(wt=b.stateArg=="@font-face"&&!_e.hasOwnProperty(zt.current().toLowerCase())||b.stateArg=="@counter-style"&&!De.hasOwnProperty(zt.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(mt,zt,b){return mt=="word"?(wt="variable","keyframes"):mt=="{"?Zt(b,zt,"top"):Ke(mt,zt,b)},at:function(mt,zt,b){return mt==";"?Ae(b):mt=="{"||mt=="}"?Xe(mt,zt,b):(mt=="word"?wt="tag":mt=="hash"&&(wt="builtin"),"at")},interpolation:function(mt,zt,b){return mt=="}"?Ae(b):mt=="{"||mt==";"?Xe(mt,zt,b):(mt=="word"?wt="variable":mt!="variable"&&mt!="("&&mt!=")"&&(wt="error"),"interpolation")}};return{startState:function(mt){return{tokenize:null,state:Y?"block":"top",stateArg:null,context:new ae(Y?"block":"top",mt||0,null)}},token:function(mt,zt){if(!zt.tokenize&&mt.eatSpace())return null;var b=(zt.tokenize||Xt)(mt,zt);return b&&typeof b=="object"&&(nt=b[1],b=b[0]),wt=b,nt!="comment"&&(zt.state=Rn[zt.state](nt,mt,zt)),wt},indent:function(mt,zt){var b=mt.context,I=zt&&zt.charAt(0),U=b.indent;return b.type!="prop"||I!="}"&&I!=")"||(b=b.prev),b.prev&&(I!="}"||b.type!="block"&&b.type!="top"&&b.type!="interpolation"&&b.type!="restricted_atBlock"?(I!=")"||b.type!="parens"&&b.type!="atBlock_parens")&&(I!="{"||b.type!="at"&&b.type!="atBlock")||(U=Math.max(0,b.indent-rt)):U=(b=b.prev).indent),U},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:ge,fold:"brace"}});var J=["domain","regexp","url","url-prefix"],W=_t(J),z=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],k=_t(z),P=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],E=_t(P),M=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],D=_t(M),ot=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],it=_t(ot),Et=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],jt=_t(Et),Dt=_t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),ee=_t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),xt=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],bt=_t(xt),Wt=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],Ft=_t(Wt),Ht=J.concat(z).concat(P).concat(M).concat(ot).concat(Et).concat(xt).concat(Wt);function Q(j,V){for(var Y,nt=!1;(Y=j.next())!=null;){if(nt&&Y=="/"){V.tokenize=null;break}nt=Y=="*"}return["comment","comment"]}at.registerHelper("hintWords","css",Ht),at.defineMIME("text/css",{documentTypes:W,mediaTypes:k,mediaFeatures:E,mediaValueKeywords:D,propertyKeywords:it,nonStandardPropertyKeywords:jt,fontProperties:Dt,counterDescriptors:ee,colorKeywords:bt,valueKeywords:Ft,tokenHooks:{"/":function(j,V){return!!j.eat("*")&&(V.tokenize=Q,Q(j,V))}},name:"css"}),at.defineMIME("text/x-scss",{mediaTypes:k,mediaFeatures:E,mediaValueKeywords:D,propertyKeywords:it,nonStandardPropertyKeywords:jt,colorKeywords:bt,valueKeywords:Ft,fontProperties:Dt,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(j,V){return j.eat("/")?(j.skipToEnd(),["comment","comment"]):j.eat("*")?(V.tokenize=Q,Q(j,V)):["operator","operator"]},":":function(j){return!!j.match(/^\s*\{/,!1)&&[null,null]},$:function(j){return j.match(/^[\w-]+/),j.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(j){return!!j.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),at.defineMIME("text/x-less",{mediaTypes:k,mediaFeatures:E,mediaValueKeywords:D,propertyKeywords:it,nonStandardPropertyKeywords:jt,colorKeywords:bt,valueKeywords:Ft,fontProperties:Dt,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(j,V){return j.eat("/")?(j.skipToEnd(),["comment","comment"]):j.eat("*")?(V.tokenize=Q,Q(j,V)):["operator","operator"]},"@":function(j){return j.eat("{")?[null,"interpolation"]:!j.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(j.eatWhile(/[\w\\\-]/),j.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),at.defineMIME("text/x-gss",{documentTypes:W,mediaTypes:k,mediaFeatures:E,propertyKeywords:it,nonStandardPropertyKeywords:jt,fontProperties:Dt,counterDescriptors:ee,colorKeywords:bt,valueKeywords:Ft,supportsAtComponent:!0,tokenHooks:{"/":function(j,V){return!!j.eat("*")&&(V.tokenize=Q,Q(j,V))}},name:"css",helperType:"gss"})})(pt(631))},531:(S,H,pt)=>{(function(at){var _t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function J(D,ot,it){var Et=D.current(),jt=Et.search(ot);return jt>-1?D.backUp(Et.length-jt):Et.match(/<\/?$/)&&(D.backUp(Et.length),D.match(ot,!1)||D.match(Et)),it}var W={};function z(D){var ot=W[D];return ot||(W[D]=new RegExp("\\s+"+D+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function k(D,ot){var it=D.match(z(ot));return it?/^\s*(.*?)\s*$/.exec(it[2])[1]:""}function P(D,ot){return new RegExp((ot?"^":"")+"","i")}function E(D,ot){for(var it in D)for(var Et=ot[it]||(ot[it]=[]),jt=D[it],Dt=jt.length-1;Dt>=0;Dt--)Et.unshift(jt[Dt])}function M(D,ot){for(var it=0;it=0;ee--)Et.script.unshift(["type",Dt[ee].matches,Dt[ee].mode]);function xt(bt,Wt){var Ft,Ht=it.token(bt,Wt.htmlState),Q=/\btag\b/.test(Ht);if(Q&&!/[<>\s\/]/.test(bt.current())&&(Ft=Wt.htmlState.tagName&&Wt.htmlState.tagName.toLowerCase())&&Et.hasOwnProperty(Ft))Wt.inTag=Ft+" ";else if(Wt.inTag&&Q&&/>$/.test(bt.current())){var j=/^([\S]+) (.*)/.exec(Wt.inTag);Wt.inTag=null;var V=bt.current()==">"&&M(Et[j[1]],j[2]),Y=at.getMode(D,V),nt=P(j[1],!0),wt=P(j[1],!1);Wt.token=function(rt,gt){return rt.match(nt,!1)?(gt.token=xt,gt.localState=gt.localMode=null,null):J(rt,wt,gt.localMode.token(rt,gt.localState))},Wt.localMode=Y,Wt.localState=at.startState(Y,it.indent(Wt.htmlState,"",""))}else Wt.inTag&&(Wt.inTag+=bt.current(),bt.eol()&&(Wt.inTag+=" "));return Ht}return{startState:function(){return{token:xt,inTag:null,localMode:null,localState:null,htmlState:at.startState(it)}},copyState:function(bt){var Wt;return bt.localState&&(Wt=at.copyState(bt.localMode,bt.localState)),{token:bt.token,inTag:bt.inTag,localMode:bt.localMode,localState:Wt,htmlState:at.copyState(it,bt.htmlState)}},token:function(bt,Wt){return Wt.token(bt,Wt)},indent:function(bt,Wt,Ft){return!bt.localMode||/^\s*<\//.test(Wt)?it.indent(bt.htmlState,Wt,Ft):bt.localMode.indent?bt.localMode.indent(bt.localState,Wt,Ft):at.Pass},innerMode:function(bt){return{state:bt.localState||bt.htmlState,mode:bt.localMode||it}}}},"xml","javascript","css"),at.defineMIME("text/html","htmlmixed")})(pt(631),pt(589),pt(876),pt(629))},876:(S,H,pt)=>{(function(at){at.defineMode("javascript",function(_t,J){var W,z,k=_t.indentUnit,P=J.statementIndent,E=J.jsonld,M=J.json||E,D=J.trackScope!==!1,ot=J.typescript,it=J.wordCharacters||/[\w$\xa1-\uffff]/,Et=function(){function T(Hn){return{type:Hn,style:"keyword"}}var G=T("keyword a"),Mt=T("keyword b"),te=T("keyword c"),de=T("keyword d"),$e=T("operator"),oe={type:"atom",style:"atom"};return{if:T("if"),while:G,with:G,else:Mt,do:Mt,try:Mt,finally:Mt,return:de,break:de,continue:de,new:T("new"),delete:te,void:te,throw:te,debugger:T("debugger"),var:T("var"),const:T("var"),let:T("var"),function:T("function"),catch:T("catch"),for:T("for"),switch:T("switch"),case:T("case"),default:T("default"),in:$e,typeof:$e,instanceof:$e,true:oe,false:oe,null:oe,undefined:oe,NaN:oe,Infinity:oe,this:T("this"),class:T("class"),super:T("atom"),yield:te,export:T("export"),import:T("import"),extends:te,await:te}}(),jt=/[+\-*&%=<>!?|~^@]/,Dt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function ee(T){for(var G,Mt=!1,te=!1;(G=T.next())!=null;){if(!Mt){if(G=="/"&&!te)return;G=="["?te=!0:te&&G=="]"&&(te=!1)}Mt=!Mt&&G=="\\"}}function xt(T,G,Mt){return W=T,z=Mt,G}function bt(T,G){var Mt=T.next();if(Mt=='"'||Mt=="'")return G.tokenize=Wt(Mt),G.tokenize(T,G);if(Mt=="."&&T.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return xt("number","number");if(Mt=="."&&T.match(".."))return xt("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(Mt))return xt(Mt);if(Mt=="="&&T.eat(">"))return xt("=>","operator");if(Mt=="0"&&T.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return xt("number","number");if(/\d/.test(Mt))return T.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),xt("number","number");if(Mt=="/")return T.eat("*")?(G.tokenize=Ft,Ft(T,G)):T.eat("/")?(T.skipToEnd(),xt("comment","comment")):Bt(T,G,1)?(ee(T),T.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),xt("regexp","string-2")):(T.eat("="),xt("operator","operator",T.current()));if(Mt=="`")return G.tokenize=Ht,Ht(T,G);if(Mt=="#"&&T.peek()=="!")return T.skipToEnd(),xt("meta","meta");if(Mt=="#"&&T.eatWhile(it))return xt("variable","property");if(Mt=="<"&&T.match("!--")||Mt=="-"&&T.match("->")&&!/\S/.test(T.string.slice(0,T.start)))return T.skipToEnd(),xt("comment","comment");if(jt.test(Mt))return Mt==">"&&G.lexical&&G.lexical.type==">"||(T.eat("=")?Mt!="!"&&Mt!="="||T.eat("="):/[<>*+\-|&?]/.test(Mt)&&(T.eat(Mt),Mt==">"&&T.eat(Mt))),Mt=="?"&&T.eat(".")?xt("."):xt("operator","operator",T.current());if(it.test(Mt)){T.eatWhile(it);var te=T.current();if(G.lastType!="."){if(Et.propertyIsEnumerable(te)){var de=Et[te];return xt(de.type,de.style,te)}if(te=="async"&&T.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return xt("async","keyword",te)}return xt("variable","variable",te)}}function Wt(T){return function(G,Mt){var te,de=!1;if(E&&G.peek()=="@"&&G.match(Dt))return Mt.tokenize=bt,xt("jsonld-keyword","meta");for(;(te=G.next())!=null&&(te!=T||de);)de=!de&&te=="\\";return de||(Mt.tokenize=bt),xt("string","string")}}function Ft(T,G){for(var Mt,te=!1;Mt=T.next();){if(Mt=="/"&&te){G.tokenize=bt;break}te=Mt=="*"}return xt("comment","comment")}function Ht(T,G){for(var Mt,te=!1;(Mt=T.next())!=null;){if(!te&&(Mt=="`"||Mt=="$"&&T.eat("{"))){G.tokenize=bt;break}te=!te&&Mt=="\\"}return xt("quasi","string-2",T.current())}var Q="([{}])";function j(T,G){G.fatArrowAt&&(G.fatArrowAt=null);var Mt=T.string.indexOf("=>",T.start);if(!(Mt<0)){if(ot){var te=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(T.string.slice(T.start,Mt));te&&(Mt=te.index)}for(var de=0,$e=!1,oe=Mt-1;oe>=0;--oe){var Hn=T.string.charAt(oe),Tn=Q.indexOf(Hn);if(Tn>=0&&Tn<3){if(!de){++oe;break}if(--de==0){Hn=="("&&($e=!0);break}}else if(Tn>=3&&Tn<6)++de;else if(it.test(Hn))$e=!0;else if(/["'\/`]/.test(Hn))for(;;--oe){if(oe==0)return;if(T.string.charAt(oe-1)==Hn&&T.string.charAt(oe-2)!="\\"){oe--;break}}else if($e&&!de){++oe;break}}$e&&!de&&(G.fatArrowAt=oe)}}var V={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function Y(T,G,Mt,te,de,$e){this.indented=T,this.column=G,this.type=Mt,this.prev=de,this.info=$e,te!=null&&(this.align=te)}function nt(T,G){if(!D)return!1;for(var Mt=T.localVars;Mt;Mt=Mt.next)if(Mt.name==G)return!0;for(var te=T.context;te;te=te.prev)for(Mt=te.vars;Mt;Mt=Mt.next)if(Mt.name==G)return!0}function wt(T,G,Mt,te,de){var $e=T.cc;for(rt.state=T,rt.stream=de,rt.marked=null,rt.cc=$e,rt.style=G,T.lexical.hasOwnProperty("align")||(T.lexical.align=!0);;)if(($e.length?$e.pop():M?qt:st)(Mt,te)){for(;$e.length&&$e[$e.length-1].lex;)$e.pop()();return rt.marked?rt.marked:Mt=="variable"&&nt(T,te)?"variable-2":G}}var rt={state:null,column:null,marked:null,cc:null};function gt(){for(var T=arguments.length-1;T>=0;T--)rt.cc.push(arguments[T])}function N(){return gt.apply(null,arguments),!0}function Lt(T,G){for(var Mt=G;Mt;Mt=Mt.next)if(Mt.name==T)return!0;return!1}function Tt(T){var G=rt.state;if(rt.marked="def",D){if(G.context){if(G.lexical.info=="var"&&G.context&&G.context.block){var Mt=Qt(T,G.context);if(Mt!=null)return void(G.context=Mt)}else if(!Lt(T,G.localVars))return void(G.localVars=new _e(T,G.localVars))}J.globalVars&&!Lt(T,G.globalVars)&&(G.globalVars=new _e(T,G.globalVars))}}function Qt(T,G){if(G){if(G.block){var Mt=Qt(T,G.prev);return Mt?Mt==G.prev?G:new Se(Mt,G.vars,!0):null}return Lt(T,G.vars)?G:new Se(G.prev,new _e(T,G.vars),!1)}return null}function Oe(T){return T=="public"||T=="private"||T=="protected"||T=="abstract"||T=="readonly"}function Se(T,G,Mt){this.prev=T,this.vars=G,this.block=Mt}function _e(T,G){this.name=T,this.next=G}var De=new _e("this",new _e("arguments",null));function xe(){rt.state.context=new Se(rt.state.context,rt.state.localVars,!1),rt.state.localVars=De}function Te(){rt.state.context=new Se(rt.state.context,rt.state.localVars,!0),rt.state.localVars=null}function be(){rt.state.localVars=rt.state.context.vars,rt.state.context=rt.state.context.prev}function ge(T,G){var Mt=function(){var te=rt.state,de=te.indented;if(te.lexical.type=="stat")de=te.lexical.indented;else for(var $e=te.lexical;$e&&$e.type==")"&&$e.align;$e=$e.prev)de=$e.indented;te.lexical=new Y(de,rt.stream.column(),T,null,te.lexical,G)};return Mt.lex=!0,Mt}function pe(){var T=rt.state;T.lexical.prev&&(T.lexical.type==")"&&(T.indented=T.lexical.indented),T.lexical=T.lexical.prev)}function ce(T){function G(Mt){return Mt==T?N():T==";"||Mt=="}"||Mt==")"||Mt=="]"?gt():N(G)}return G}function st(T,G){return T=="var"?N(ge("vardef",G),fn,ce(";"),pe):T=="keyword a"?N(ge("form"),ae,st,pe):T=="keyword b"?N(ge("form"),st,pe):T=="keyword d"?rt.stream.match(/^\s*$/,!1)?N():N(ge("stat"),Ae,ce(";"),pe):T=="debugger"?N(ce(";")):T=="{"?N(ge("}"),Te,Qe,pe,be):T==";"?N():T=="if"?(rt.state.lexical.info=="else"&&rt.state.cc[rt.state.cc.length-1]==pe&&rt.state.cc.pop()(),N(ge("form"),ae,st,pe,Vo)):T=="function"?N(ur):T=="for"?N(ge("form"),Te,xo,st,be,pe):T=="class"||ot&&G=="interface"?(rt.marked="keyword",N(ge("form",T=="class"?T:G),Jr,pe)):T=="variable"?ot&&G=="declare"?(rt.marked="keyword",N(st)):ot&&(G=="module"||G=="enum"||G=="type")&&rt.stream.match(/^\s*\w/,!1)?(rt.marked="keyword",G=="enum"?N(In):G=="type"?N(Ho,ce("operator"),yt,ce(";")):N(ge("form"),_n,ce("{"),ge("}"),Qe,pe,pe)):ot&&G=="namespace"?(rt.marked="keyword",N(ge("form"),qt,st,pe)):ot&&G=="abstract"?(rt.marked="keyword",N(st)):N(ge("stat"),ht):T=="switch"?N(ge("form"),ae,ce("{"),ge("}","switch"),Te,Qe,pe,pe,be):T=="case"?N(qt,ce(":")):T=="default"?N(ce(":")):T=="catch"?N(ge("form"),xe,Xt,st,pe,be):T=="export"?N(ge("stat"),zo,pe):T=="import"?N(ge("stat"),qe,pe):T=="async"?N(st):G=="@"?N(qt,st):gt(ge("stat"),qt,ce(";"),pe)}function Xt(T){if(T=="(")return N(Lr,ce(")"))}function qt(T,G){return Zt(T,G,!1)}function ne(T,G){return Zt(T,G,!0)}function ae(T){return T!="("?gt():N(ge(")"),Ae,ce(")"),pe)}function Zt(T,G,Mt){if(rt.state.fatArrowAt==rt.stream.start){var te=Mt?zt:mt;if(T=="(")return N(xe,ge(")"),Ve(Lr,")"),pe,ce("=>"),te,be);if(T=="variable")return gt(xe,_n,ce("=>"),te,be)}var de=Mt?Xe:Ke;return V.hasOwnProperty(T)?N(de):T=="function"?N(ur,de):T=="class"||ot&&G=="interface"?(rt.marked="keyword",N(ge("form"),Co,pe)):T=="keyword c"||T=="async"?N(Mt?ne:qt):T=="("?N(ge(")"),Ae,ce(")"),pe,de):T=="operator"||T=="spread"?N(Mt?ne:qt):T=="["?N(ge("]"),Ye,pe,de):T=="{"?ze(Ot,"}",null,de):T=="quasi"?gt(vn,de):T=="new"?N(b(Mt)):N()}function Ae(T){return T.match(/[;\}\)\],]/)?gt():gt(qt)}function Ke(T,G){return T==","?N(Ae):Xe(T,G,!1)}function Xe(T,G,Mt){var te=Mt==0?Ke:Xe,de=Mt==0?qt:ne;return T=="=>"?N(xe,Mt?zt:mt,be):T=="operator"?/\+\+|--/.test(G)||ot&&G=="!"?N(te):ot&&G=="<"&&rt.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?N(ge(">"),Ve(yt,">"),pe,te):G=="?"?N(qt,ce(":"),de):N(de):T=="quasi"?gt(vn,te):T!=";"?T=="("?ze(ne,")","call",te):T=="."?N(kt,te):T=="["?N(ge("]"),Ae,ce("]"),pe,te):ot&&G=="as"?(rt.marked="keyword",N(yt,te)):T=="regexp"?(rt.state.lastType=rt.marked="operator",rt.stream.backUp(rt.stream.pos-rt.stream.start-1),N(de)):void 0:void 0}function vn(T,G){return T!="quasi"?gt():G.slice(G.length-2)!="${"?N(vn):N(Ae,Rn)}function Rn(T){if(T=="}")return rt.marked="string-2",rt.state.tokenize=Ht,N(vn)}function mt(T){return j(rt.stream,rt.state),gt(T=="{"?st:qt)}function zt(T){return j(rt.stream,rt.state),gt(T=="{"?st:ne)}function b(T){return function(G){return G=="."?N(T?U:I):G=="variable"&&ot?N(Ar,T?Xe:Ke):gt(T?ne:qt)}}function I(T,G){if(G=="target")return rt.marked="keyword",N(Ke)}function U(T,G){if(G=="target")return rt.marked="keyword",N(Xe)}function ht(T){return T==":"?N(pe,st):gt(Ke,ce(";"),pe)}function kt(T){if(T=="variable")return rt.marked="property",N()}function Ot(T,G){return T=="async"?(rt.marked="property",N(Ot)):T=="variable"||rt.style=="keyword"?(rt.marked="property",G=="get"||G=="set"?N(fe):(ot&&rt.state.fatArrowAt==rt.stream.start&&(Mt=rt.stream.match(/^\s*:\s*/,!1))&&(rt.state.fatArrowAt=rt.stream.pos+Mt[0].length),N(ke))):T=="number"||T=="string"?(rt.marked=E?"property":rt.style+" property",N(ke)):T=="jsonld-keyword"?N(ke):ot&&Oe(G)?(rt.marked="keyword",N(Ot)):T=="["?N(qt,Kt,ce("]"),ke):T=="spread"?N(ne,ke):G=="*"?(rt.marked="keyword",N(Ot)):T==":"?gt(ke):void 0;var Mt}function fe(T){return T!="variable"?gt(ke):(rt.marked="property",N(ur))}function ke(T){return T==":"?N(ne):T=="("?gt(ur):void 0}function Ve(T,G,Mt){function te(de,$e){if(Mt?Mt.indexOf(de)>-1:de==","){var oe=rt.state.lexical;return oe.info=="call"&&(oe.pos=(oe.pos||0)+1),N(function(Hn,Tn){return Hn==G||Tn==G?gt():gt(T)},te)}return de==G||$e==G?N():Mt&&Mt.indexOf(";")>-1?gt(T):N(ce(G))}return function(de,$e){return de==G||$e==G?N():gt(T,te)}}function ze(T,G,Mt){for(var te=3;te"),yt):T=="quasi"?gt(We,Ne):void 0}function Yt(T){if(T=="=>")return N(yt)}function he(T){return T.match(/[\}\)\]]/)?N():T==","||T==";"?N(he):gt(Re,he)}function Re(T,G){return T=="variable"||rt.style=="keyword"?(rt.marked="property",N(Re)):G=="?"||T=="number"||T=="string"?N(Re):T==":"?N(yt):T=="["?N(ce("variable"),R,ce("]"),Re):T=="("?gt(ln,Re):T.match(/[;\}\)\],]/)?void 0:N()}function We(T,G){return T!="quasi"?gt():G.slice(G.length-2)!="${"?N(We):N(yt,Ln)}function Ln(T){if(T=="}")return rt.marked="string-2",rt.state.tokenize=Ht,N(We)}function pn(T,G){return T=="variable"&&rt.stream.match(/^\s*[?:]/,!1)||G=="?"?N(pn):T==":"?N(yt):T=="spread"?N(pn):gt(yt)}function Ne(T,G){return G=="<"?N(ge(">"),Ve(yt,">"),pe,Ne):G=="|"||T=="."||G=="&"?N(yt):T=="["?N(yt,ce("]"),Ne):G=="extends"||G=="implements"?(rt.marked="keyword",N(yt)):G=="?"?N(yt,ce(":"),yt):void 0}function Ar(T,G){if(G=="<")return N(ge(">"),Ve(yt,">"),pe,Ne)}function Yn(){return gt(yt,jr)}function jr(T,G){if(G=="=")return N(yt)}function fn(T,G){return G=="enum"?(rt.marked="keyword",N(In)):gt(_n,Kt,Dn,_o)}function _n(T,G){return ot&&Oe(G)?(rt.marked="keyword",N(_n)):T=="variable"?(Tt(G),N()):T=="spread"?N(_n):T=="["?ze(Mr,"]"):T=="{"?ze(Bn,"}"):void 0}function Bn(T,G){return T!="variable"||rt.stream.match(/^\s*:/,!1)?(T=="variable"&&(rt.marked="property"),T=="spread"?N(_n):T=="}"?gt():T=="["?N(qt,ce("]"),ce(":"),Bn):N(ce(":"),_n,Dn)):(Tt(G),N(Dn))}function Mr(){return gt(_n,Dn)}function Dn(T,G){if(G=="=")return N(ne)}function _o(T){if(T==",")return N(fn)}function Vo(T,G){if(T=="keyword b"&&G=="else")return N(ge("form","else"),st,pe)}function xo(T,G){return G=="await"?N(xo):T=="("?N(ge(")"),Ro,pe):void 0}function Ro(T){return T=="var"?N(fn,ro):T=="variable"?N(ro):gt(ro)}function ro(T,G){return T==")"?N():T==";"?N(ro):G=="in"||G=="of"?(rt.marked="keyword",N(qt,ro)):gt(qt,ro)}function ur(T,G){return G=="*"?(rt.marked="keyword",N(ur)):T=="variable"?(Tt(G),N(ur)):T=="("?N(xe,ge(")"),Ve(Lr,")"),pe,tt,st,be):ot&&G=="<"?N(ge(">"),Ve(Yn,">"),pe,ur):void 0}function ln(T,G){return G=="*"?(rt.marked="keyword",N(ln)):T=="variable"?(Tt(G),N(ln)):T=="("?N(xe,ge(")"),Ve(Lr,")"),pe,tt,be):ot&&G=="<"?N(ge(">"),Ve(Yn,">"),pe,ln):void 0}function Ho(T,G){return T=="keyword"||T=="variable"?(rt.marked="type",N(Ho)):G=="<"?N(ge(">"),Ve(Yn,">"),pe):void 0}function Lr(T,G){return G=="@"&&N(qt,Lr),T=="spread"?N(Lr):ot&&Oe(G)?(rt.marked="keyword",N(Lr)):ot&&T=="this"?N(Kt,Dn):gt(_n,Kt,Dn)}function Co(T,G){return T=="variable"?Jr(T,G):Wn(T,G)}function Jr(T,G){if(T=="variable")return Tt(G),N(Wn)}function Wn(T,G){return G=="<"?N(ge(">"),Ve(Yn,">"),pe,Wn):G=="extends"||G=="implements"||ot&&T==","?(G=="implements"&&(rt.marked="keyword"),N(ot?yt:qt,Wn)):T=="{"?N(ge("}"),Nn,pe):void 0}function Nn(T,G){return T=="async"||T=="variable"&&(G=="static"||G=="get"||G=="set"||ot&&Oe(G))&&rt.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(rt.marked="keyword",N(Nn)):T=="variable"||rt.style=="keyword"?(rt.marked="property",N($n,Nn)):T=="number"||T=="string"?N($n,Nn):T=="["?N(qt,Kt,ce("]"),$n,Nn):G=="*"?(rt.marked="keyword",N(Nn)):ot&&T=="("?gt(ln,Nn):T==";"||T==","?N(Nn):T=="}"?N():G=="@"?N(qt,Nn):void 0}function $n(T,G){if(G=="!"||G=="?")return N($n);if(T==":")return N(yt,Dn);if(G=="=")return N(ne);var Mt=rt.state.lexical.prev;return gt(Mt&&Mt.info=="interface"?ln:ur)}function zo(T,G){return G=="*"?(rt.marked="keyword",N(or,ce(";"))):G=="default"?(rt.marked="keyword",N(qt,ce(";"))):T=="{"?N(Ve(mo,"}"),or,ce(";")):gt(st)}function mo(T,G){return G=="as"?(rt.marked="keyword",N(ce("variable"))):T=="variable"?gt(ne,mo):void 0}function qe(T){return T=="string"?N():T=="("?gt(qt):T=="."?gt(Ke):gt(ve,rr,or)}function ve(T,G){return T=="{"?ze(ve,"}"):(T=="variable"&&Tt(G),G=="*"&&(rt.marked="keyword"),N(Uo))}function rr(T){if(T==",")return N(ve,rr)}function Uo(T,G){if(G=="as")return rt.marked="keyword",N(ve)}function or(T,G){if(G=="from")return rt.marked="keyword",N(qt)}function Ye(T){return T=="]"?N():gt(Ve(ne,"]"))}function In(){return gt(ge("form"),_n,ce("{"),ge("}"),Ve(yo,"}"),pe,pe)}function yo(){return gt(_n,Dn)}function Bo(T,G){return T.lastType=="operator"||T.lastType==","||jt.test(G.charAt(0))||/[,.]/.test(G.charAt(0))}function Bt(T,G,Mt){return G.tokenize==bt&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(G.lastType)||G.lastType=="quasi"&&/\{\s*$/.test(T.string.slice(0,T.pos-(Mt||0)))}return xe.lex=Te.lex=!0,be.lex=!0,pe.lex=!0,{startState:function(T){var G={tokenize:bt,lastType:"sof",cc:[],lexical:new Y((T||0)-k,0,"block",!1),localVars:J.localVars,context:J.localVars&&new Se(null,null,!1),indented:T||0};return J.globalVars&&typeof J.globalVars=="object"&&(G.globalVars=J.globalVars),G},token:function(T,G){if(T.sol()&&(G.lexical.hasOwnProperty("align")||(G.lexical.align=!1),G.indented=T.indentation(),j(T,G)),G.tokenize!=Ft&&T.eatSpace())return null;var Mt=G.tokenize(T,G);return W=="comment"?Mt:(G.lastType=W!="operator"||z!="++"&&z!="--"?W:"incdec",wt(G,Mt,W,z,T))},indent:function(T,G){if(T.tokenize==Ft||T.tokenize==Ht)return at.Pass;if(T.tokenize!=bt)return 0;var Mt,te=G&&G.charAt(0),de=T.lexical;if(!/^\s*else\b/.test(G))for(var $e=T.cc.length-1;$e>=0;--$e){var oe=T.cc[$e];if(oe==pe)de=de.prev;else if(oe!=Vo&&oe!=be)break}for(;(de.type=="stat"||de.type=="form")&&(te=="}"||(Mt=T.cc[T.cc.length-1])&&(Mt==Ke||Mt==Xe)&&!/^[,\.=+\-*:?[\(]/.test(G));)de=de.prev;P&&de.type==")"&&de.prev.type=="stat"&&(de=de.prev);var Hn=de.type,Tn=te==Hn;return Hn=="vardef"?de.indented+(T.lastType=="operator"||T.lastType==","?de.info.length+1:0):Hn=="form"&&te=="{"?de.indented:Hn=="form"?de.indented+k:Hn=="stat"?de.indented+(Bo(T,G)?P||k:0):de.info!="switch"||Tn||J.doubleIndentSwitch==0?de.align?de.column+(Tn?0:1):de.indented+(Tn?0:k):de.indented+(/^(?:case|default)\b/.test(G)?k:2*k)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:M?null:"/*",blockCommentEnd:M?null:"*/",blockCommentContinue:M?null:" * ",lineComment:M?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:M?"json":"javascript",jsonldMode:E,jsonMode:M,expressionAllowed:Bt,skipExpression:function(T){wt(T,"atom","atom","true",new at.StringStream("",2,null))}}}),at.registerHelper("wordChars","javascript",/[\w$]/),at.defineMIME("text/javascript","javascript"),at.defineMIME("text/ecmascript","javascript"),at.defineMIME("application/javascript","javascript"),at.defineMIME("application/x-javascript","javascript"),at.defineMIME("application/ecmascript","javascript"),at.defineMIME("application/json",{name:"javascript",json:!0}),at.defineMIME("application/x-json",{name:"javascript",json:!0}),at.defineMIME("application/manifest+json",{name:"javascript",json:!0}),at.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),at.defineMIME("text/typescript",{name:"javascript",typescript:!0}),at.defineMIME("application/typescript",{name:"javascript",typescript:!0})})(pt(631))},589:(S,H,pt)=>{(function(at){var _t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},J={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};at.defineMode("xml",function(W,z){var k,P,E=W.indentUnit,M={},D=z.htmlMode?_t:J;for(var ot in D)M[ot]=D[ot];for(var ot in z)M[ot]=z[ot];function it(N,Lt){function Tt(Oe){return Lt.tokenize=Oe,Oe(N,Lt)}var Qt=N.next();return Qt=="<"?N.eat("!")?N.eat("[")?N.match("CDATA[")?Tt(Dt("atom","]]>")):null:N.match("--")?Tt(Dt("comment","-->")):N.match("DOCTYPE",!0,!0)?(N.eatWhile(/[\w\._\-]/),Tt(ee(1))):null:N.eat("?")?(N.eatWhile(/[\w\._\-]/),Lt.tokenize=Dt("meta","?>"),"meta"):(k=N.eat("/")?"closeTag":"openTag",Lt.tokenize=Et,"tag bracket"):Qt=="&"?(N.eat("#")?N.eat("x")?N.eatWhile(/[a-fA-F\d]/)&&N.eat(";"):N.eatWhile(/[\d]/)&&N.eat(";"):N.eatWhile(/[\w\.\-:]/)&&N.eat(";"))?"atom":"error":(N.eatWhile(/[^&<]/),null)}function Et(N,Lt){var Tt=N.next();if(Tt==">"||Tt=="/"&&N.eat(">"))return Lt.tokenize=it,k=Tt==">"?"endTag":"selfcloseTag","tag bracket";if(Tt=="=")return k="equals",null;if(Tt=="<"){Lt.tokenize=it,Lt.state=Ht,Lt.tagName=Lt.tagStart=null;var Qt=Lt.tokenize(N,Lt);return Qt?Qt+" tag error":"tag error"}return/[\'\"]/.test(Tt)?(Lt.tokenize=jt(Tt),Lt.stringStartCol=N.column(),Lt.tokenize(N,Lt)):(N.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function jt(N){var Lt=function(Tt,Qt){for(;!Tt.eol();)if(Tt.next()==N){Qt.tokenize=Et;break}return"string"};return Lt.isInAttribute=!0,Lt}function Dt(N,Lt){return function(Tt,Qt){for(;!Tt.eol();){if(Tt.match(Lt)){Qt.tokenize=it;break}Tt.next()}return N}}function ee(N){return function(Lt,Tt){for(var Qt;(Qt=Lt.next())!=null;){if(Qt=="<")return Tt.tokenize=ee(N+1),Tt.tokenize(Lt,Tt);if(Qt==">"){if(N==1){Tt.tokenize=it;break}return Tt.tokenize=ee(N-1),Tt.tokenize(Lt,Tt)}}return"meta"}}function xt(N){return N&&N.toLowerCase()}function bt(N,Lt,Tt){this.prev=N.context,this.tagName=Lt||"",this.indent=N.indented,this.startOfLine=Tt,(M.doNotIndent.hasOwnProperty(Lt)||N.context&&N.context.noIndent)&&(this.noIndent=!0)}function Wt(N){N.context&&(N.context=N.context.prev)}function Ft(N,Lt){for(var Tt;;){if(!N.context||(Tt=N.context.tagName,!M.contextGrabbers.hasOwnProperty(xt(Tt))||!M.contextGrabbers[xt(Tt)].hasOwnProperty(xt(Lt))))return;Wt(N)}}function Ht(N,Lt,Tt){return N=="openTag"?(Tt.tagStart=Lt.column(),Q):N=="closeTag"?j:Ht}function Q(N,Lt,Tt){return N=="word"?(Tt.tagName=Lt.current(),P="tag",nt):M.allowMissingTagName&&N=="endTag"?(P="tag bracket",nt(N,Lt,Tt)):(P="error",Q)}function j(N,Lt,Tt){if(N=="word"){var Qt=Lt.current();return Tt.context&&Tt.context.tagName!=Qt&&M.implicitlyClosed.hasOwnProperty(xt(Tt.context.tagName))&&Wt(Tt),Tt.context&&Tt.context.tagName==Qt||M.matchClosing===!1?(P="tag",V):(P="tag error",Y)}return M.allowMissingTagName&&N=="endTag"?(P="tag bracket",V(N,Lt,Tt)):(P="error",Y)}function V(N,Lt,Tt){return N!="endTag"?(P="error",V):(Wt(Tt),Ht)}function Y(N,Lt,Tt){return P="error",V(N,Lt,Tt)}function nt(N,Lt,Tt){if(N=="word")return P="attribute",wt;if(N=="endTag"||N=="selfcloseTag"){var Qt=Tt.tagName,Oe=Tt.tagStart;return Tt.tagName=Tt.tagStart=null,N=="selfcloseTag"||M.autoSelfClosers.hasOwnProperty(xt(Qt))?Ft(Tt,Qt):(Ft(Tt,Qt),Tt.context=new bt(Tt,Qt,Oe==Tt.indented)),Ht}return P="error",nt}function wt(N,Lt,Tt){return N=="equals"?rt:(M.allowMissing||(P="error"),nt(N,Lt,Tt))}function rt(N,Lt,Tt){return N=="string"?gt:N=="word"&&M.allowUnquoted?(P="string",nt):(P="error",nt(N,Lt,Tt))}function gt(N,Lt,Tt){return N=="string"?gt:nt(N,Lt,Tt)}return it.isInText=!0,{startState:function(N){var Lt={tokenize:it,state:Ht,indented:N||0,tagName:null,tagStart:null,context:null};return N!=null&&(Lt.baseIndent=N),Lt},token:function(N,Lt){if(!Lt.tagName&&N.sol()&&(Lt.indented=N.indentation()),N.eatSpace())return null;k=null;var Tt=Lt.tokenize(N,Lt);return(Tt||k)&&Tt!="comment"&&(P=null,Lt.state=Lt.state(k||Tt,N,Lt),P&&(Tt=P=="error"?Tt+" error":P)),Tt},indent:function(N,Lt,Tt){var Qt=N.context;if(N.tokenize.isInAttribute)return N.tagStart==N.indented?N.stringStartCol+1:N.indented+E;if(Qt&&Qt.noIndent)return at.Pass;if(N.tokenize!=Et&&N.tokenize!=it)return Tt?Tt.match(/^(\s*)/)[0].length:0;if(N.tagName)return M.multilineTagIndentPastTag!==!1?N.tagStart+N.tagName.length+2:N.tagStart+E*(M.multilineTagIndentFactor||1);if(M.alignCDATA&&/$/,blockCommentStart:"",configuration:M.htmlMode?"html":"xml",helperType:M.htmlMode?"html":"xml",skipAttribute:function(N){N.state==rt&&(N.state=nt)},xmlCurrentTag:function(N){return N.tagName?{name:N.tagName,close:N.type=="closeTag"}:null},xmlCurrentContext:function(N){for(var Lt=[],Tt=N.context;Tt;Tt=Tt.prev)Lt.push(Tt.tagName);return Lt.reverse()}}}),at.defineMIME("text/xml","xml"),at.defineMIME("application/xml","xml"),at.mimeModes.hasOwnProperty("text/html")||at.defineMIME("text/html",{name:"xml",htmlMode:!0})})(pt(631))},858:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>at});const at={run:function(_t){_t.DomComponents.clear(),_t.CssComposer.clear()}}},884:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>W});var at=pt(50),_t=pt(163),J=pt(668);const W={run:function(z){(0,at.bindAll)(this,"onKeyUp","enableDragger","disableDragger"),this.editor=z,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(z){this.toggleMove(),this.disableDragger()},onKeyUp:function(z){(0,_t.getKeyChar)(z)===" "&&this.editor.stopCommand(this.id)},enableDragger:function(z){this.toggleDragger(1,z)},disableDragger:function(z){this.toggleDragger(0,z)},toggleDragger:function(z,k){var P=this.canvasModel,E=this.em,M=this.dragger,D=z?"add":"remove";this.getCanvas().classList[D]("".concat(this.ppfx,"is__grabbing")),M||(M=new J.Z({getPosition:function(){return{x:P.get("x"),y:P.get("y")}},setPosition:function(ot){var it=ot.x,Et=ot.y;P.set({x:it,y:Et})},onStart:function(ot,it){E.trigger("canvas:move:start",it)},onDrag:function(ot,it){E.trigger("canvas:move",it)},onEnd:function(ot,it){E.trigger("canvas:move:end",it)}}),this.dragger=M),z?M.start(k):M.stop()},toggleMove:function(z){var k=this.ppfx,P=z?"add":"remove",E=z?"on":"off",M={on:_t.on,off:_t.off},D=this.getCanvas(),ot=["".concat(k,"is__grab")];!z&&ot.push("".concat(k,"is__grabbing")),ot.forEach(function(it){return D.classList[P](it)}),M[E](document,"keyup",this.onKeyUp),M[E](D,"mousedown",this.enableDragger),M[E](document,"mouseup",this.disableDragger)}}},790:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>z,defineCommand:()=>W});var at,_t=pt(346),J=(at=function(k,P){return at=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,M){E.__proto__=M}||function(E,M){for(var D in M)Object.prototype.hasOwnProperty.call(M,D)&&(E[D]=M[D])},at(k,P)},function(k,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");function E(){this.constructor=k}at(k,P),k.prototype=P===null?Object.create(P):(E.prototype=P.prototype,new E)});function W(k){return k}const z=function(k){function P(E){var M=k.call(this,0)||this;M.config=E||{},M.em=M.config.em||{};var D=M.config.stylePrefix;return M.pfx=D,M.ppfx=M.config.pStylePrefix,M.hoverClass="".concat(D,"hover"),M.badgeClass="".concat(D,"badge"),M.plhClass="".concat(D,"placeholder"),M.freezClass="".concat(M.ppfx,"freezed"),M.canvas=M.em.Canvas,M.init(M.config),M}return J(P,k),P.prototype.onFrameScroll=function(E){},P.prototype.getCanvas=function(){return this.canvas.getElement()},P.prototype.getCanvasBody=function(){return this.canvas.getBody()},P.prototype.getCanvasTools=function(){return this.canvas.getToolsEl()},P.prototype.offset=function(E){var M=E.getBoundingClientRect();return{top:M.top+E.ownerDocument.body.scrollTop,left:M.left+E.ownerDocument.body.scrollLeft}},P.prototype.init=function(E){},P.prototype.callRun=function(E,M){M===void 0&&(M={});var D=this.id;if(E.trigger("run:".concat(D,":before"),M),!M||!M.abort){var ot=M.sender||E,it=this.run(E,ot,M);return E.trigger("run:".concat(D),it,M),E.trigger("run",D,it,M),it}E.trigger("abort:".concat(D),M)},P.prototype.callStop=function(E,M){M===void 0&&(M={});var D=this.id,ot=M.sender||E;E.trigger("stop:".concat(D,":before"),M);var it=this.stop(E,ot,M);return E.trigger("stop:".concat(D),it,M),E.trigger("stop",D,it,M),it},P.prototype.stopCommand=function(E){this.em.Commands.stop(this.id,E)},P.prototype.run=function(E,M,D){},P.prototype.stop=function(E,M,D){},P}(_t.Hn)},180:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>J});var at=pt(50),_t=function(W,z,k){if(k||arguments.length===2)for(var P,E=0,M=z.length;E{pt.r(H),pt.d(H,{default:()=>z});var at=pt(50),_t=pt(668),J=function(){return J=Object.assign||function(k){for(var P,E=1,M=arguments.length;E
`);(P=document.createElement("div")).className="".concat(it,"guides"),Et.className="".concat(it,"guide-info ").concat(it,"guide-info__x"),jt.className="".concat(it,"guide-info ").concat(it,"guide-info__y"),Et.innerHTML=Dt,jt.innerHTML=Dt,P.appendChild(Et),P.appendChild(jt),M.Canvas.getGlobalToolsEl().appendChild(P),this.guidesEl=P,this.elGuideInfoX=Et,this.elGuideInfoY=jt,this.elGuideInfoContentX=Et.querySelector(".".concat(it,"guide-info__content")),this.elGuideInfoContentY=jt.querySelector(".".concat(it,"guide-info__content")),D.on("canvas:update frame:scroll",(0,at.debounce)(function(){var ee;k.updateGuides(),ot.debug&&((ee=k.guides)===null||ee===void 0||ee.forEach(function(xt){return k.renderGuide(xt)}))},200))}return P},getGuidesStatic:function(){var k=this,P=[],E=this.target.getEl(),M=E.parentNode,D=M===void 0?{}:M;return(0,at.each)(D.children,function(ot){return P=P.concat(E!==ot?k.getElementGuides(ot):[])}),P.concat(this.getElementGuides(D))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(k){var P,E,M=this;(k||this.guides).forEach(function(D){var ot=D.origin,it=P===ot?E:M.getElementPos(ot);P=ot,E=it,(0,at.each)(M.getGuidePosUpdate(D,it),function(Et,jt){return D[jt]=Et}),D.originRect=it})},getGuidePosUpdate:function(k,P){var E={},M=P.top,D=P.height,ot=P.left,it=P.width;switch(k.type){case"t":E.y=M;break;case"b":E.y=M+D;break;case"l":E.x=ot;break;case"r":E.x=ot+it;break;case"x":E.x=ot+it/2;break;case"y":E.y=M+D/2}return E},renderGuide:function(k){k===void 0&&(k={});var P=k.guide||document.createElement("div"),E="px",M=k.active?2:1,D=P.children[0];return P.style="position: absolute; background-color: ".concat(k.active?"green":"red",";"),P.children.length||((D=document.createElement("div")).style="position: absolute; color: red; padding: 5px; top: 0; left: 0;",P.appendChild(D)),k.y?(P.style.width="100%",P.style.height="".concat(M).concat(E),P.style.top="".concat(k.y).concat(E),P.style.left=0):(P.style.width="".concat(M).concat(E),P.style.height="100%",P.style.left="".concat(k.x).concat(E),P.style.top="0".concat(E)),!k.guide&&this.guidesContainer.appendChild(P),P},getElementPos:function(k){return this.editor.Canvas.getElementPos(k,{noScroll:1})},getElementGuides:function(k){var P=this,E=this.opts,M=this.getElementPos(k),D=M.top,ot=M.height,it=M.left,Et=M.width,jt=[{type:"t",y:D},{type:"b",y:D+ot},{type:"l",x:it},{type:"r",x:it+Et},{type:"x",x:it+Et/2},{type:"y",y:D+ot/2}].map(function(Dt){return J(J({},Dt),{origin:k,originRect:M,guide:E.debug&&P.renderGuide(Dt)})});return jt.forEach(function(Dt){var ee;return(ee=P.guides)===null||ee===void 0?void 0:ee.push(Dt)}),jt},getTranslate:function(k,P){P===void 0&&(P="x");var E=0;return(k||"").split(" ").forEach(function(M){var D=M.trim(),ot="translate".concat(P.toUpperCase(),"(");D.indexOf(ot)===0&&(E=parseFloat(D.replace(ot,"")))}),E},setTranslate:function(k,P,E){var M="translate".concat(P.toUpperCase(),"("),D="".concat(M).concat(E,")"),ot=(k||"").split(" ").map(function(it){return it.trim().indexOf(M)===0&&(it=D),it}).join(" ");return ot.indexOf(M)<0&&(ot+=" ".concat(D)),ot},getPosition:function(){var k=this.target,P=this.isTran,E=k.getStyle(),M=E.left,D=E.top,ot=E.transform,it=0,Et=0;return P?(it=this.getTranslate(ot),Et=this.getTranslate(ot,"y")):(it=parseFloat(M||0),Et=parseFloat(D||0)),{x:it,y:Et}},setPosition:function(k){var P=k.x,E=k.y,M=k.end,D=k.position,ot=k.width,it=k.height,Et=this,jt=Et.target,Dt=Et.isTran,ee=Et.em,xt="px",bt=!M,Wt="".concat(parseInt(P,10)).concat(xt),Ft="".concat(parseInt(E,10)).concat(xt),Ht={};if(Dt){var Q=jt.getStyle().transform||"";Q=this.setTranslate(Q,"x",Wt),Ht={transform:Q=this.setTranslate(Q,"y",Ft),__p:bt},jt.addStyle(Ht,{avoidStore:!M})}else{var j={position:D,width:ot,height:it},V={left:Wt,top:Ft,__p:bt};(0,at.keys)(j).forEach(function(Y){var nt=j[Y];nt&&(V[Y]=nt)}),Ht=V,jt.addStyle(Ht,{avoidStore:!M})}ee==null||ee.Styles.__emitCmpStyleUpdate(Ht,{components:ee.getSelected()})},_getDragData:function(){var k=this.target;return{target:k,parent:k.parent(),index:k.index()}},onStart:function(k){var P=this,E=P.target,M=P.editor,D=P.isTran,ot=P.opts,it=ot.center,Et=ot.onStart,jt=M.Canvas,Dt=E.getStyle(),ee="absolute",xt=[ee,"relative"];if(Et&&Et(this._getDragData()),!D&&Dt.position!==ee){var bt=jt.offset(E.getEl()),Wt=bt.left,Ft=bt.top,Ht=bt.width,Q=bt.height,j=E.parent(),V=void 0;do{var Y=j.getStyle();V=xt.indexOf(Y.position)>=0?j:null,j=j.parent()}while(j&&!V);if(it){var nt=jt.getMouseRelativeCanvas(k);Wt=nt.x,Ft=nt.y}else if(V){var wt=jt.offset(V.getEl());Wt-=wt.left,Ft-=wt.top}this.setPosition({x:Wt,y:Ft,width:"".concat(Ht,"px"),height:"".concat(Q,"px"),position:ee})}},onDrag:function(){for(var k=this,P=[],E=0;E0}).sort(function(Te,be){return Te.gap-be.gap}).map(function(Te){return Te.guide})[0];if(Q){var j=Q.originRect,V=j.left,Y=j.width,nt=j.top,wt=j.height,rt=j.rect,gt=jt?V{pt.r(H),pt.d(H,{default:()=>at});const at={run:function(_t){if(_t.Canvas.hasFocus()){var J=[];_t.getSelectedAll().forEach(function(W){var z=W.components(),k=z&&z.filter(function(P){return P.get("selectable")})[0];k&&J.push(k)}),J.length&&_t.select(J)}}}},368:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>at});const at={run:function(_t,J,W){if(W===void 0&&(W={}),_t.Canvas.hasFocus()||W.force){var z=[];_t.getSelectedAll().forEach(function(k){for(var P=k.parent();P&&!P.get("selectable");)P=P.parent();P&&z.push(P)}),z.length&&_t.select(z)}}}},243:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>at});const at={run:function(_t){if(_t.Canvas.hasFocus()){var J=[];_t.getSelectedAll().forEach(function(W){var z=W.parent();if(z){var k,P=z.components().length,E=0,M=0;do E++,k=(M=W.index()+E)<=P?z.getChildAt(M):null;while(k&&!k.get("selectable"));J.push(k||W)}}),J.length&&_t.select(J)}}}},400:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>at});const at={run:function(_t){if(_t.Canvas.hasFocus()){var J=[];_t.getSelectedAll().forEach(function(W){var z=W.parent();if(z){var k,P=0,E=0;do P++,k=(E=W.index()-P)>=0?z.getChildAt(E):null;while(k&&!k.get("selectable"));J.push(k||W)}}),J.length&&_t.select(J)}}}},910:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>_t});var at=pt(50);const _t={run:function(J,W,z){z===void 0&&(z={});var k=z.target,P=[];if(!k.get("styles"))return P;var E=k.get("type"),M=J.Pages.getAllWrappers();if(!(0,at.flatten)(M.map(function(ot){return ot.findType(E)})).length){var D=J.CssComposer.getAll();P=D.filter(function(ot){return ot.get("group")==="cmp:".concat(E)}),D.remove(P)}return P}}},744:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>_t});var at=function(J,W,z){if(z||arguments.length===2)for(var k,P=0,E=W.length;P{pt.r(H),pt.d(H,{default:()=>W});var at=pt(50),_t=pt(895),J=pt(407);const W=(0,at.extend)({},J.default,{init:function(){(0,at.bindAll)(this,"startDelete","stopDelete","onDelete"),this.hoverClass=this.pfx+"hover-delete",this.badgeClass=this.pfx+"badge-red"},enable:function(){this.$el.find("*").mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete)},startDelete:function(z){z.stopPropagation();var k=(0,_t.default)(z.target);k.data("model").get("removable")&&(k.addClass(this.hoverClass),this.attachBadge(k.get(0)))},stopDelete:function(z){z.stopPropagation(),(0,_t.default)(z.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(z){z.stopPropagation();var k=(0,_t.default)(z.target);k.data("model").get("removable")&&(k.data("model").destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(z){this.badge.html("Remove "+z.getName())}})},457:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>_t});var at=pt(895);const _t={run:function(J,W,z){var k=this;z===void 0&&(z={}),W&&W.set&&W.set("active",0);var P=J.getConfig(),E=J.Modal,M=P.stylePrefix;if(this.cm=J.CodeManager||null,!this.$editors){var D=this.buildEditor("htmlmixed","hopscotch","HTML"),ot=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=D.el,this.cssEditor=ot.el;var it=(0,at.default)('
'));it.append(D.$el).append(ot.$el),this.$editors=it}E.open({title:P.textViewCode,content:this.$editors}).getModel().once("change:open",function(){return J.stopCommand("".concat(k.id))}),this.htmlEditor.setContent(J.getHtml(z.optsHtml)),this.cssEditor.setContent(J.getCss(z.optsCss))},stop:function(J){var W=J.Modal;W&&W.close()},buildEditor:function(J,W,z){var k=document.createElement("textarea");!this.codeMirror&&(this.codeMirror=this.cm.getViewer("CodeMirror"));var P=this.codeMirror.clone().set({label:z,codeName:J,theme:W,input:k}),E=new this.cm.EditorView({model:P,config:this.cm.getConfig()}).render().$el;return P.init(k),{el:P,$el:E}}}},975:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>_t});var at=pt(50);const _t={isEnabled:function(){var J=document;return!!(J.fullscreenElement||J.webkitFullscreenElement||J.mozFullScreenElement)},enable:function(J){var W="";return J.requestFullscreen?J.requestFullscreen():J.webkitRequestFullscreen?(W="webkit",J.webkitRequestFullscreen()):J.mozRequestFullScreen?(W="moz",J.mozRequestFullScreen()):J.msRequestFullscreen&&J.msRequestFullscreen(),W},disable:function(){var J=document;this.isEnabled()&&(J.exitFullscreen?J.exitFullscreen():J.webkitExitFullscreen?J.webkitExitFullscreen():J.mozCancelFullScreen?J.mozCancelFullScreen():J.msExitFullscreen&&J.msExitFullscreen())},fsChanged:function(J){this.isEnabled()||(this.stopCommand({sender:this.sender}),document.removeEventListener("".concat(J||"","fullscreenchange"),this.fsChanged))},run:function(J,W,z){z===void 0&&(z={}),this.sender=W;var k=z.target,P=(0,at.isElement)(k)?k:document.querySelector(k),E=this.enable(P||J.getContainer());this.fsChanged=this.fsChanged.bind(this,E),document.addEventListener(E+"fullscreenchange",this.fsChanged),J.trigger("change:canvasOffset")},stop:function(J,W){W&&W.set&&W.set("active",!1),this.disable(),J&&J.trigger("change:canvasOffset")}}},191:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>k});var at=pt(50),_t=pt(895),J=pt(163),W=pt(407),z=pt(189);const k=(0,at.extend)({},z.default,W.default,{init:function(P){W.default.init.apply(this,arguments),(0,at.bindAll)(this,"initSorter","rollback","onEndMove"),this.opt=P,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var P=[],E=0;E{pt.r(H),pt.d(H,{default:()=>J});var at=pt(50),_t=pt(491);const J={open:function(W){var z=this,k=this,P=k.editor,E=k.title,M=k.config,D=k.am,ot=M.custom;if((0,at.isFunction)(ot.open))return ot.open(D.__customData());P.Modal.open({title:E,content:W}).onceClose(function(){return P.stopCommand(z.id)})},close:function(){var W=this.config.custom;if((0,at.isFunction)(W.close))return W.close(this.am.__customData());var z=this.editor.Modal;z&&z.close()},run:function(W,z,k){k===void 0&&(k={});var P=W.AssetManager,E=P.getConfig(),M=k.types,D=M===void 0?[]:M,ot=k.accept,it=k.select;if(this.title=k.modalTitle||W.t("assetManager.modalTitle")||"",this.editor=W,this.config=E,this.am=P,P.setTarget(k.target),P.onClick(k.onClick),P.onDblClick(k.onDblClick),P.onSelect(k.onSelect),P.__behaviour({select:it,types:D,options:k}),E.custom)this.rendered=this.rendered||(0,_t.ut)("div"),this.rendered.className="".concat(E.stylePrefix,"custom-wrp"),P.__behaviour({container:this.rendered}),P.__trgCustom();else{if(!this.rendered||D){var Et=P.getAll().filter(function(Dt){return Dt});D&&D.length&&(Et=Et.filter(function(Dt){return D.indexOf(Dt.get("type"))!==-1})),P.render(Et),this.rendered=P.getContainer()}if(ot){var jt=this.rendered.querySelector("input#".concat(E.stylePrefix,"uploadFile"));jt&&jt.setAttribute("accept",ot)}}return this.open(this.rendered),this},stop:function(W){this.editor=W,this.close(this.rendered)}}},117:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>J});var at=pt(50),_t=pt(491);const J={open:function(){var W=this,z=W.container,k=W.editor,P=W.bm,E=W.config,M=E.custom,D=E.appendTo;if((0,at.isFunction)(M.open))return M.open(P.__customData());if(this.firstRender&&!D){var ot="views-container",it=k.Panels;(it.getPanel(ot)||it.addPanel({id:ot})).set("appendContent",z).trigger("change:appendContent"),M||z.appendChild(P.render())}z&&(z.style.display="block")},close:function(){var W=this.container,z=this.config.custom;if((0,at.isFunction)(z.close))return z.close(this.bm.__customData());W&&(W.style.display="none")},run:function(W){var z=W.Blocks;this.config=z.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,_t.ut)("div"),this.editor=W,this.bm=z;var k=this.container;z.__behaviour({container:k}),this.config.custom&&z.__trgCustom(),this.open()},stop:function(){this.close()}}},614:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>at});const at={run:function(_t){var J=_t.LayerManager,W=_t.Panels,z=J.getConfig();if(!z.appendTo){if(!this.layers){var k="views-container",P=document.createElement("div"),E=W.getPanel(k)||W.addPanel({id:k});z.custom?J.__trgCustom({container:P}):P.appendChild(J.render()),E.set("appendContent",P).trigger("change:appendContent"),this.layers=P}this.layers.style.display="block"}},stop:function(){var _t=this.layers;_t&&(_t.style.display="none")}}},801:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>_t});var at=pt(895);const _t={run:function(J,W){if(this.sender=W,!this.$cn){var z=J.getConfig(),k=J.Panels,P="change:appendContent";this.$cn=(0,at.default)("
"),this.$cn2=(0,at.default)("
"),this.$cn.append(this.$cn2);var E=J.DeviceManager;if(E&&z.showDevices){var M=k.addPanel({id:"devices-c"}),D=E.render();M.set("appendContent",D).trigger(P)}var ot=J.SelectorManager;this.slm=ot;var it=ot.getConfig();it.custom?ot.__trgCustom({container:this.$cn2.get(0)}):it.appendTo||this.$cn2.append(ot.render([]));var Et=J.StyleManager;this.sm=Et;var jt=Et.getConfig(),Dt=jt.stylePrefix;this.$header=(0,at.default)('
').concat(J.t("styleManager.empty"),"
")),this.$cn.append(this.$header),jt.custom?Et.__trgCustom({container:this.$cn2.get(0)}):jt.appendTo||this.$cn2.append(Et.render());var ee="views-container";this.panel=k.getPanel(ee),this.panel||(this.panel=k.addPanel({id:ee})),this.panel.set("appendContent",this.$cn).trigger(P),this.em=J.getModel(),this.listenTo(this.em,Et.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var J,W,z,k,P=this.sender,E=this.sm;P&&P.get&&!P.get("active")||!E||(E.getSelected()?((J=this.$cn2)===null||J===void 0||J.show(),(W=this.$header)===null||W===void 0||W.hide()):((z=this.$cn2)===null||z===void 0||z.hide(),(k=this.$header)===null||k===void 0||k.show()))},stop:function(){var J,W;(J=this.$cn2)===null||J===void 0||J.hide(),(W=this.$header)===null||W===void 0||W.hide()}}},395:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>_t});var at=pt(895);const _t={run:function(J,W){this.sender=W;var z,k=J.getModel(),P=J.Config.stylePrefix,E=J.TraitManager,M=E.getConfig();if(!M.appendTo){if(!this.$cn){this.$cn=(0,at.default)("
"),this.$cn2=(0,at.default)("
"),this.$cn.append(this.$cn2),this.$header=(0,at.default)("
").append('
').concat(k.t("traitManager.empty"),"
")),this.$cn.append(this.$header),this.$cn2.append('
').concat(k.t("traitManager.label"),"
")),this.$cn2.append(E.render());var D=J.Panels;(z=D.getPanel("views-container")?D.getPanel("views-container"):D.addPanel({id:"views-container"}))==null||z.set("appendContent",this.$cn.get(0)).trigger("change:appendContent"),this.target=J.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()}},toggleTm:function(){var J=this.sender;J&&J.get&&!J.get("active")||(this.target.getSelectedAll().length===1?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},98:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>_t});var at=pt(50);const _t={run:function(J,W,z){z===void 0&&(z={});var k=J.getModel().get("clipboard"),P=J.getSelected();k&&P&&(J.getSelectedAll().forEach(function(E){var M=E.collection;if(M){var D,ot={at:E.index()+1,action:z.action||"paste-component"};if((0,at.contains)(k,E)&&E.get("copyable"))D=M.add(E.clone(),ot);else{var it=k.filter(function(Et){return Et.get("copyable")}).filter(function(Et){return J.Components.canMove(E.parent(),Et).result});D=M.add(it.map(function(Et){return Et.clone()}),ot)}(D=(0,at.isArray)(D)?D:[D]).forEach(function(Et){return J.trigger("component:paste",Et)})}}),P.emitUpdate())}}},129:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>W});var at=pt(50),_t=function(z,k,P){if(P||arguments.length===2)for(var E,M=0,D=k.length;M{pt.r(H),pt.d(H,{default:()=>_t});var at=function(){return at=Object.assign||function(J){for(var W,z=1,k=arguments.length;z{pt.r(H),pt.d(H,{default:()=>Ht});var at,_t=pt(50),J=pt(895),W=pt(346),z=(at=function(Q,j){return at=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,Y){V.__proto__=Y}||function(V,Y){for(var nt in Y)Object.prototype.hasOwnProperty.call(Y,nt)&&(V[nt]=Y[nt])},at(Q,j)},function(Q,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");function V(){this.constructor=Q}at(Q,j),Q.prototype=j===null?Object.create(j):(V.prototype=j.prototype,new V)});const k=function(Q){function j(){return Q!==null&&Q.apply(this,arguments)||this}return z(j,Q),j.prototype.defaults=function(){return{command:"",attributes:{}}},j}(W.Hn);var P=function(){var Q=function(j,V){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,nt){Y.__proto__=nt}||function(Y,nt){for(var wt in nt)Object.prototype.hasOwnProperty.call(nt,wt)&&(Y[wt]=nt[wt])},Q(j,V)};return function(j,V){if(typeof V!="function"&&V!==null)throw new TypeError("Class extends value "+String(V)+" is not a constructor or null");function Y(){this.constructor=j}Q(j,V),j.prototype=V===null?Object.create(V):(Y.prototype=V.prototype,new Y)}}(),E=function(Q){function j(){return Q!==null&&Q.apply(this,arguments)||this}return P(j,Q),j}(W.FE);const M=E;E.prototype.model=k;var D=pt(330),ot=function(){var Q=function(j,V){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,nt){Y.__proto__=nt}||function(Y,nt){for(var wt in nt)Object.prototype.hasOwnProperty.call(nt,wt)&&(Y[wt]=nt[wt])},Q(j,V)};return function(j,V){if(typeof V!="function"&&V!==null)throw new TypeError("Class extends value "+String(V)+" is not a constructor or null");function Y(){this.constructor=j}Q(j,V),j.prototype=V===null?Object.create(V):(Y.prototype=V.prototype,new Y)}}(),it=function(){return it=Object.assign||function(Q){for(var j,V=1,Y=arguments.length;V').concat(gt,"
"):"",`
').concat(nt.getName(),"
");wt.innerHTML=Tt?Tt(nt):Qt}var Oe="px",Se=wt.style;Se.display="block";var _e=Y.getTargetToElementFixed(Q,wt,{pos:j}).top,De=V.leftOff<0?-V.leftOff:0;Se.top=_e+Oe,Se.left=De+Oe}},showHighlighter:function(Q){this.canvas.getHighlighter(Q).style.opacity=""},initResize:function(Q){var j,V=this.em,Y=this.canvas,nt=V==null?void 0:V.Editor,wt=(V==null?void 0:V.config).stylePrefix||"",rt="".concat(wt,"resizing"),gt=!(0,_t.isElement)(Q)&&(0,Wt.isTaggableNode)(Q)?Q:V.getSelected(),N=gt&>.get("resizable"),Lt={},Tt=function(Oe,Se,_e){var De=_e.docs;De&&De.forEach(function(xe){var Te=xe.body,be=Te.className||"";Te.className=(Oe=="add"?"".concat(be," ").concat(rt):be.replace(rt,"")).trim()})};if(nt&&N){var Qt=(0,_t.isElement)(Q)?Q:gt.getEl();Lt={onStart:function(Oe,Se){Se===void 0&&(Se={});var _e=Se.el,De=Se.config,xe=Se.resizer,Te=De.keyHeight,be=De.keyWidth,ge=De.currentUnit,pe=De.keepAutoHeight,ce=De.keepAutoWidth;Tt("add",0,Se),j=V.Styles.getModelToStyle(gt),Y.toggleFramesEvents(!1);var st=getComputedStyle(_e),Xt=j.getStyle(),qt=Xt[be];De.autoWidth=ce&&qt==="auto",isNaN(parseFloat(qt))&&(qt=st[be]);var ne=Xt[Te];De.autoHeight=pe&&ne==="auto",isNaN(parseFloat(ne))&&(ne=st[Te]),xe.startDim.w=parseFloat(qt),xe.startDim.h=parseFloat(ne),xt=!1,ge&&(De.unitHeight=(0,Wt.getUnitFromValue)(ne),De.unitWidth=(0,Wt.getUnitFromValue)(qt))},onMove:function(){nt.trigger("component:resize")},onEnd:function(Oe,Se){Tt("remove",0,Se),nt.trigger("component:resize"),Y.toggleFramesEvents(!0),xt=!0},updateTarget:function(Oe,Se,_e){if(_e===void 0&&(_e={}),j){var De=_e.store,xe=_e.selectedHandler,Te=_e.config,be=Te.keyHeight,ge=Te.keyWidth,pe=Te.autoHeight,ce=Te.autoWidth,st=Te.unitWidth,Xt=Te.unitHeight,qt=["tc","bc"].indexOf(xe)>=0,ne=["cl","cr"].indexOf(xe)>=0,ae={};if(!qt){var Zt=Y.getBody().offsetWidth,Ae=Se.w{pt.r(H),pt.d(H,{default:()=>_t});var at=pt(895);const _t={startSelectPosition:function(J,W,z){var k=this;z===void 0&&(z={}),this.isPointed=!1;var P=this.em.Utils,E=J.ownerDocument.body;P&&!this.sorter&&(this.sorter=new P.Sorter({container:E,placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:W,wmargin:1,nested:1,em:this.em,canvasRelative:1,scale:function(){return k.em.getZoomDecimal()}})),z.onStart&&(this.sorter.onStart=z.onStart),J&&this.sorter.startSort(J,{container:E})},getOffsetDim:function(){var J=this.offset(this.canvas.getFrameEl()),W=this.offset(this.canvas.getElement());return{top:J.top-W.top,left:J.left-W.left}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex=this.posMethod=="after"&&this.cDim.length!==0?this.posIndex+1:this.posIndex,this.sorter&&(this.sorter.moved=0,this.sorter.endMove()),this.cDim&&(this.posIsLastEl=this.cDim.length!==0&&this.posMethod=="after"&&this.posIndex==this.cDim.length,this.posTargetEl=this.cDim.length===0?(0,at.default)(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?(0,at.default)(this.cDim[this.posIndex][5]).parent():(0,at.default)(this.outsideElem),this.posTargetModel=this.posTargetEl.data("model"),this.posTargetCollection=this.posTargetEl.data("model-comp"))},enable:function(){this.startSelectPosition()},nearFloat:function(J,W,z){var k=J||0,P=W||"before",E=z.length,M=E!==0&&P=="after"&&k==E;return E!==0&&(!M&&!z[k][4]||z[k-1]&&!z[k-1][4]||M&&!z[k-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}},804:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>z});var at=pt(50),_t=pt(895),J=pt(163),W=function(){return W=Object.assign||function(k){for(var P,E=1,M=arguments.length;E')).get(0),Tt=(0,_t.default)('
')).get(0),Qt=xt+N+"-el",Oe="".concat(xt+gt+"-el"," ").concat(xt+gt),Se="".concat(Qt," ").concat(xt+N);Ft=(0,_t.default)('
')).get(0),Ht=(0,_t.default)('
')).get(0),Q=(0,_t.default)('
')).get(0),j=(0,_t.default)('
')).get(0),V=(0,_t.default)('
')).get(0),Y=(0,_t.default)('
')).get(0),nt=(0,_t.default)('
')).get(0),wt=(0,_t.default)('
')).get(0),this["marginT"+D]=Ft,this["marginB"+D]=Ht,this["marginL"+D]=Q,this["marginR"+D]=j,this["padT"+D]=V,this["padB"+D]=Y,this["padL"+D]=nt,this["padR"+D]=wt,Lt.appendChild(Ft),Lt.appendChild(Ht),Lt.appendChild(Q),Lt.appendChild(j),Tt.appendChild(V),Tt.appendChild(Y),Tt.appendChild(nt),Tt.appendChild(wt),Wt.appendChild(Lt),Wt.appendChild(Tt),this[bt]="1"}var _e="px",De=parseFloat(ee.marginLeft.replace(_e,""))*it,xe=parseFloat(ee.marginRight.replace(_e,""))*it,Te=parseFloat(ee.marginTop.replace(_e,""))*it,be=parseFloat(ee.marginBottom.replace(_e,""))*it,ge=Ft.style,pe=Ht.style,ce=Q.style,st=j.style,Xt=V.style,qt=Y.style,ne=nt.style,ae=wt.style,Zt=parseFloat(Dt.left),Ae=parseFloat(ee.width)*it+_e;ge.height=Te+_e,ge.width=Ae,ge.top=Dt.top-Te+_e,ge.left=Zt+_e,pe.height=be+_e,pe.width=Ae,pe.top=Dt.top+Dt.height+_e,pe.left=Zt+_e;var Ke=Dt.height+Te+be+_e,Xe=Dt.top-Te+_e;ce.height=Ke,ce.width=De+_e,ce.top=Xe,ce.left=Zt-De+_e,st.height=Ke,st.width=xe+_e,st.top=Xe,st.left=Zt+Dt.width+_e;var vn=parseFloat(ee.paddingTop)*it;Xt.height=vn+_e;var Rn=parseFloat(ee.paddingBottom)*it;qt.height=Rn+_e;var mt=Dt.height-Rn-vn+_e,zt=Dt.top+vn+_e;ne.height=mt,ne.width=parseFloat(ee.paddingLeft)*it+_e,ne.top=zt;var b=parseFloat(ee.paddingRight)*it;ae.height=mt,ae.width=b+_e,ae.top=zt}},stop:function(k,P,E){E===void 0&&(E={});var M=(E||{}).state||"",D=this.getOffsetMethod(M);k.Canvas[D](E.view).style.opacity=0}}},434:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>_t});var at=pt(50);const _t={init:function(){(0,at.bindAll)(this,"_onFramesChange")},run:function(J){this.toggleVis(J)},stop:function(J){this.toggleVis(J,0)},toggleVis:function(J,W){var z=this;if(W===void 0&&(W=1),!J.Commands.isActive("preview")){var k=J.Canvas,P=W?"on":"off";k.getFrames().forEach(function(E){return z._upFrame(E,W)}),k.getModel()[P]("change:frames",this._onFramesChange)}},_onFramesChange:function(J,W){var z=this;W.forEach(function(k){return k.once("loaded",function(){return z._upFrame(k,!0)})})},_upFrame:function(J,W){var z,k=W?"add":"remove";(z=J.view)===null||z===void 0||z.getBody().classList[k]("".concat(this.ppfx,"dashed"))}}},346:(S,H,pt)=>{pt.d(H,{FE:()=>k,G7:()=>P,Hn:()=>z});var at,_t=pt(316),J=pt.n(_t),W=(at=function(E,M){return at=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,ot){D.__proto__=ot}||function(D,ot){for(var it in ot)Object.prototype.hasOwnProperty.call(ot,it)&&(D[it]=ot[it])},at(E,M)},function(E,M){if(typeof M!="function"&&M!==null)throw new TypeError("Class extends value "+String(M)+" is not a constructor or null");function D(){this.constructor=E}at(E,M),E.prototype=M===null?Object.create(M):(D.prototype=M.prototype,new D)}),z=function(E){function M(){return E!==null&&E.apply(this,arguments)||this}return W(M,E),M}(J().Model),k=function(E){function M(){return E!==null&&E.apply(this,arguments)||this}return W(M,E),M}(J().Collection),P=function(E){function M(){return E!==null&&E.apply(this,arguments)||this}return W(M,E),M}(J().View)},330:(S,H,pt)=>{pt.d(H,{Z:()=>k});var at,_t=pt(50),J=pt(346),W=(at=function(P,E){return at=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,D){M.__proto__=D}||function(M,D){for(var ot in D)Object.prototype.hasOwnProperty.call(D,ot)&&(M[ot]=D[ot])},at(P,E)},function(P,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");function M(){this.constructor=P}at(P,E),P.prototype=E===null?Object.create(E):(M.prototype=E.prototype,new M)}),z=function(P){function E(M,D,ot){M===void 0&&(M={}),ot===void 0&&(ot=!1);var it=P.call(this,M)||this;return it.itemsView="",it.itemType="type",it.reuseView=!1,it.config=D||M.config||{},ot&&it.listenTo(it.collection,"add",it.addTo),it.items=[],it}return W(E,P),E.prototype.addTo=function(M){this.add(M)},E.prototype.itemViewNotFound=function(M){var D=this.config,ot=this.ns,it=D.em,Et="".concat(ot?"[".concat(ot,"]: "):"","'").concat(M,"' type not found");it&&it.logWarning(Et)},E.prototype.add=function(M,D){var ot,it=this,Et=it.config,jt=it.reuseView,Dt=it.items,ee=this.itemsView||{},xt=D||null,bt=this.itemView,Wt=M.get(this.itemType);ee[Wt]?bt=ee[Wt]:!Wt||ee[Wt]||(0,_t.includes)(["button","checkbox","color","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"],Wt)||this.itemViewNotFound(Wt),ot=M.view&&jt?M.view:new bt({model:M,config:Et},Et),Dt&&Dt.push(ot);var Ft=ot.render().el;xt?xt.appendChild(Ft):this.$el.append(Ft)},E.prototype.render=function(){var M=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each(function(D){this.add(D,M)},this),this.$el.append(M),this.onRender(),this},E.prototype.onRender=function(){},E.prototype.onRemoveBefore=function(M,D){},E.prototype.onRemove=function(M,D){},E.prototype.remove=function(M){M===void 0&&(M={});var D=this.items;return this.onRemoveBefore(D,M),this.clearItems(),P.prototype.remove.call(this),this.onRemove(D,M),this},E.prototype.clearItems=function(){this.items},E}(J.G7);const k=z;z.prototype.itemView=""},668:(S,H,pt)=>{pt.d(H,{Z:()=>z});var at=pt(50),_t=pt(163),J=function(){return J=Object.assign||function(k){for(var P,E=1,M=arguments.length;E=E&&P<=E+D||P<=E&&P>=E-D},k.prototype.setGuideLock=function(P,E){var M=(0,at.isUndefined)(P.x)?"Y":"X",D="trg".concat(M);return E!==null?(P.active=!0,P.lock=E,this[D]=P):(delete P.active,delete P.lock,delete this[D]),P},k.prototype.stop=function(P,E){E===void 0&&(E={});var M=this.delta,D=!!E.cancel,ot=D?0:M.x,it=D?0:M.y;this.toggleDrag(),this.lockedAxis=null,this.move(ot,it,!0);var Et=this.opts.onEnd;(0,at.isFunction)(Et)&&Et(P,this,{cancelled:D})},k.prototype.keyHandle=function(P){(0,_t.isEscKey)(P)&&this.stop(P,{cancel:!0})},k.prototype.move=function(P,E,M){var D=this.el,ot=this.opts,it=this.startPosition;if(it){var Et=ot.setPosition,jt=it.x+P,Dt=it.y+E;this.position={x:jt,y:Dt,end:M},(0,at.isFunction)(Et)&&Et(this.position),D&&(D.style.left="".concat(jt,"px"),D.style.top="".concat(Dt,"px"))}},k.prototype.getContainerEl=function(){var P=this.opts.container;return P?[P]:this.getDocumentEl()},k.prototype.getWindowEl=function(){return this.getContainerEl().map(function(P){var E=P.ownerDocument||P;return E.defaultView||E.parentWindow})},k.prototype.getDocumentEl=function(P){var E=this.opts.doc;if(P=P||this.el,!this.docs.length){var M=[document];P&&M.push(P.ownerDocument),E&&M.push(E),this.docs=M}return this.docs},k.prototype.getPointerPos=function(P){var E=this.opts.getPointerPosition,M=(0,_t.getPointerEvent)(P);return E?E(P):{x:M.clientX,y:M.clientY}},k.prototype.getStartPosition=function(){var P=this.el,E=this.opts.getPosition,M={x:0,y:0};return(0,at.isFunction)(E)?M=E():P&&(M={x:parseFloat(P.style.left),y:parseFloat(P.style.top)}),M},k.prototype.getScrollInfo=function(){var P=this.opts.doc,E=P&&P.body;return{y:E?E.scrollTop:0,x:E?E.scrollLeft:0}},k.prototype.detectAxisLock=function(P,E){var M=P,D=E,ot=Math.abs(M),it=Math.abs(D);return D>=ot||D<=-ot?"x":M>it||M<-it?"y":void 0},k}()},895:(S,H,pt)=>{pt.r(H),pt.d(H,{default:()=>Kt});var at=typeof document<"u"?document:null,_t=typeof window<"u"?window:null,J=Array.prototype,W=J.filter,z=J.indexOf,k=J.map,P=J.push,E=J.reverse,M=J.slice,D=J.splice,ot=/^#[\w-]*$/,it=/^\.[\w-]*$/,Et=/<.+>/,jt=/^\w+$/;function Dt(R,tt){return tt===void 0&&(tt=at),it.test(R)?tt.getElementsByClassName(R.slice(1)):jt.test(R)?tt.getElementsByTagName(R):tt.querySelectorAll(R)}function ee(R,tt){if(tt===void 0&&(tt=at),R){if(R.__cash)return R;var ut=R;if(nt(R)){if(tt.__cash&&(tt=tt[0]),!(ut=ot.test(R)?tt.getElementById(R.slice(1)):Et.test(R)?Ve(R):Dt(R,tt)))return}else if(Y(R))return this.ready(R);(ut.nodeType||ut===_t)&&(ut=[ut]),this.length=ut.length;for(var yt=0,Yt=this.length;yt=0}):ut.value=Yt})},bt.clone=function(){return this.map(function(R,tt){return tt.cloneNode(!0)})},bt.detach=function(){return this.each(function(R,tt){tt.parentNode&&tt.parentNode.removeChild(tt)})};var Ot,fe=/^\s*<(\w+)[^>]*>/,ke=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function Ve(R){if(function(){if(!Ot){var yt=at.createElement("table"),Yt=at.createElement("tr");Ot={"*":at.createElement("div"),tr:at.createElement("tbody"),td:Yt,th:Yt,thead:yt,tbody:yt,tfoot:yt}}}(),!nt(R))return[];if(ke.test(R))return[at.createElement(RegExp.$1)];var tt=fe.test(R)&&RegExp.$1,ut=Ot[tt]||Ot["*"];return ut.innerHTML=R,xt(ut.childNodes).detach().get()}function ze(R,tt,ut){if(tt!==void 0){var yt=nt(tt);!yt&&tt.length?Q(tt,function(Yt){return ze(R,Yt,ut)}):Q(R,yt?function(Yt){Yt.insertAdjacentHTML(ut?"afterbegin":"beforeend",tt)}:function(Yt,he){return function(Re,We,Ln){Ln?Re.insertBefore(We,Re.childNodes[0]):Re.appendChild(We)}(Yt,he?tt.cloneNode(!0):tt,ut)})}}xt.parseHTML=Ve,bt.empty=function(){var R=this[0];if(R)for(;R.firstChild;)R.removeChild(R.firstChild);return this},bt.append=function(){var R=this;return Q(arguments,function(tt){ze(R,tt)}),this},bt.appendTo=function(R){return ze(xt(R),this),this},bt.html=function(R){if(R===void 0)return this[0]&&this[0].innerHTML;var tt=R.nodeType?R[0].outerHTML:R;return this.each(function(ut,yt){yt.innerHTML=tt})},bt.insertAfter=function(R){var tt=this;return xt(R).each(function(ut,yt){var Yt=yt.parentNode;tt.each(function(he,Re){Yt.insertBefore(ut?Re.cloneNode(!0):Re,yt.nextSibling)})}),this},bt.after=function(){var R=this;return Q(E.apply(arguments),function(tt){E.apply(xt(tt).slice()).insertAfter(R)}),this},bt.insertBefore=function(R){var tt=this;return xt(R).each(function(ut,yt){var Yt=yt.parentNode;tt.each(function(he,Re){Yt.insertBefore(ut?Re.cloneNode(!0):Re,yt)})}),this},bt.before=function(){var R=this;return Q(arguments,function(tt){xt(tt).insertBefore(R)}),this},bt.prepend=function(){var R=this;return Q(arguments,function(tt){ze(R,tt,!0)}),this},bt.prependTo=function(R){return ze(xt(R),E.apply(this.slice()),!0),this},bt.remove=function(){return this.detach().off()},bt.replaceWith=function(R){var tt=this;return this.each(function(ut,yt){var Yt=yt.parentNode;if(Yt){var he=ut?xt(R).clone():xt(R);if(!he[0])return tt.remove(),!1;Yt.replaceChild(he[0],yt),xt(he[0]).after(he.slice(1))}})},bt.replaceAll=function(R){return xt(R).replaceWith(this),this},bt.text=function(R){return R===void 0?this[0]?this[0].textContent:"":this.each(function(tt,ut){ut.textContent=R})};var Qe=at&&at.documentElement;bt.offset=function(){var R=this[0];if(R){var tt=R.getBoundingClientRect();return{top:tt.top+_t.pageYOffset-Qe.clientTop,left:tt.left+_t.pageXOffset-Qe.clientLeft}}},bt.offsetParent=function(){return xt(this[0]&&this[0].offsetParent)},bt.position=function(){var R=this[0];if(R)return{left:R.offsetLeft,top:R.offsetTop}},bt.children=function(R){var tt=[];return this.each(function(ut,yt){P.apply(tt,yt.children)}),tt=xt(Tt(tt)),R?tt.filter(function(ut,yt){return V(yt,R)}):tt},bt.contents=function(){var R=[];return this.each(function(tt,ut){P.apply(R,ut.tagName==="IFRAME"?[ut.contentDocument]:ut.childNodes)}),xt(R.length&&Tt(R))},bt.find=function(R){for(var tt=[],ut=0,yt=this.length;ut{pt.d(H,{$Q:()=>Et,FW:()=>D,G1:()=>z,GX:()=>Wt,L_:()=>P,Mx:()=>k,R3:()=>jt,SJ:()=>bt,cx:()=>E,dL:()=>it,pn:()=>ot,rw:()=>ee,sE:()=>M,t3:()=>xt,ut:()=>Dt});var at=pt(50),_t=function(Ft,Ht,Q){if(Q||arguments.length===2)for(var j,V=0,Y=Ht.length;V=V?Ft.appendChild(Ht):Ft.insertBefore(Ht,j[Y])},jt=function(Ft,Ht){return Et(Ft,Ht)},Dt=function(Ft,Ht,Q){Ht===void 0&&(Ht={});var j=document.createElement(Ft);return Ht&&(0,at.each)(Ht,function(V,Y){return j.setAttribute(Y,V)}),Q&&((0,at.isString)(Q)?j.innerHTML=Q:j.appendChild(Q)),j},ee=function(Ft){return document.createTextNode(Ft)},xt=function(Ft,Ht){var Q,j=Ft.type;try{Q=new window[Ht](j,Ft)}catch{(Q=document.createEvent(Ht)).initEvent(j,!0,!0)}return Q._parentEvent=Ft,j.indexOf("key")===0&&(Q.keyCodeVal=Ft.keyCode,["keyCode","which"].forEach(function(V){Object.defineProperty(Q,V,{get:function(){return this.keyCodeVal}})})),Q},bt=function(Ft,Ht){Ht===void 0&&(Ht=[]),(Array.isArray(Ht)?Ht:[Ht]).forEach(function(Q){var j=Q[J]||"div",V=Q[W]||{},Y=document.createElement(j);(0,at.each)(V,function(nt,wt){Y.setAttribute(wt,nt)}),Ft.appendChild(Y)})},Wt=function(Ft){var Ht=(Ft==null?void 0:Ft.ownerDocument)||document,Q=Ht.documentElement,j=Ht.defaultView||window;return{x:(j.pageXOffset||Q.scrollLeft||0)-(Q.clientLeft||0),y:(j.pageYOffset||Q.scrollTop||0)-(Q.clientTop||0)}}},163:(S,H,pt)=>{pt.r(H),pt.d(H,{appendStyles:()=>ot,buildBase64UrlFromSvg:()=>ce,camelCase:()=>xt,capitalize:()=>De,createId:()=>pe,deepMerge:()=>wt,escape:()=>Y,escapeNodeContent:()=>nt,find:()=>V,getElRect:()=>gt,getElement:()=>Ft,getGlobal:()=>k,getKeyChar:()=>Tt,getKeyCode:()=>Lt,getModel:()=>rt,getPointerEvent:()=>N,getUiClass:()=>D,getUnitFromValue:()=>Dt,getViewEl:()=>be,hasDnd:()=>Wt,hasWin:()=>z,isCommentNode:()=>Q,isComponent:()=>xe,isDef:()=>W,isEmptyObj:()=>_e,isEnterKey:()=>Oe,isEscKey:()=>Qt,isObject:()=>Se,isRule:()=>Te,isTaggableNode:()=>j,isTextNode:()=>Ht,matches:()=>M,normalizeFloat:()=>bt,off:()=>jt,on:()=>Et,setViewEl:()=>ge,shallowDiff:()=>it,toLowerCase:()=>P,upFirst:()=>ee});var at=pt(50),_t=function(){return _t=Object.assign||function(st){for(var Xt,qt=1,ne=arguments.length;qt=0?Zt!==Ae&&(qt[ae]=Ae):qt[ae]=null}for(var ae in Xt)Xt.hasOwnProperty(ae)&&(0,at.isUndefined)(st[ae])&&(qt[ae]=Xt[ae]);return qt},Et=function(st,Xt,qt,ne){var ae=Xt.split(/\s+/);st=st instanceof Array?st:[st];for(var Zt=function(Ke){st.forEach(function(Xe){return Xe&&Xe.addEventListener(ae[Ke],qt,ne)})},Ae=0;Ae/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")},nt=function(st){return st===void 0&&(st=""),"".concat(st).replace(/&/g,"&").replace(//g,">")},wt=function(){for(var st=[],Xt=0;Xt{var at={"./CanvasClear":858,"./CanvasClear.ts":858,"./CanvasMove":884,"./CanvasMove.ts":884,"./CommandAbstract":790,"./CommandAbstract.ts":790,"./ComponentDelete":180,"./ComponentDelete.ts":180,"./ComponentDrag":544,"./ComponentDrag.ts":544,"./ComponentEnter":236,"./ComponentEnter.ts":236,"./ComponentExit":368,"./ComponentExit.ts":368,"./ComponentNext":243,"./ComponentNext.ts":243,"./ComponentPrev":400,"./ComponentPrev.ts":400,"./ComponentStyleClear":910,"./ComponentStyleClear.ts":910,"./CopyComponent":744,"./CopyComponent.ts":744,"./DeleteComponent":517,"./DeleteComponent.ts":517,"./ExportTemplate":457,"./ExportTemplate.ts":457,"./Fullscreen":975,"./Fullscreen.ts":975,"./MoveComponent":191,"./MoveComponent.ts":191,"./OpenAssets":912,"./OpenAssets.ts":912,"./OpenBlocks":117,"./OpenBlocks.ts":117,"./OpenLayers":614,"./OpenLayers.ts":614,"./OpenStyleManager":801,"./OpenStyleManager.ts":801,"./OpenTraitManager":395,"./OpenTraitManager.ts":395,"./PasteComponent":98,"./PasteComponent.ts":98,"./Preview":129,"./Preview.ts":129,"./Resize":116,"./Resize.ts":116,"./SelectComponent":407,"./SelectComponent.ts":407,"./SelectPosition":189,"./SelectPosition.ts":189,"./ShowOffset":804,"./ShowOffset.ts":804,"./SwitchVisibility":434,"./SwitchVisibility.ts":434};function _t(W){var z=J(W);return pt(z)}function J(W){if(!pt.o(at,W)){var z=new Error("Cannot find module '"+W+"'");throw z.code="MODULE_NOT_FOUND",z}return at[W]}_t.keys=function(){return Object.keys(at)},_t.resolve=J,S.exports=_t,_t.id=828},50:(S,H,pt)=>{pt.r(H),pt.d(H,{VERSION:()=>_t,after:()=>Cr,all:()=>$i,allKeys:()=>Kt,any:()=>gi,assign:()=>Dn,before:()=>Oo,bind:()=>io,bindAll:()=>Wo,chain:()=>Ds,chunk:()=>Yo,clone:()=>Ro,collect:()=>Sr,compact:()=>Xi,compose:()=>Fs,constant:()=>Ae,contains:()=>pr,countBy:()=>La,create:()=>xo,debounce:()=>Jn,default:()=>jl,defaults:()=>_o,defer:()=>zi,delay:()=>So,detect:()=>hr,difference:()=>ko,drop:()=>Tr,each:()=>mn,escape:()=>Bt,every:()=>$i,extend:()=>Mr,extendOwn:()=>Dn,filter:()=>yn,find:()=>hr,findIndex:()=>hi,findKey:()=>Vs,findLastIndex:()=>$o,findWhere:()=>qn,first:()=>so,flatten:()=>Ji,foldl:()=>Dr,foldr:()=>Wi,forEach:()=>mn,functions:()=>_n,get:()=>Lr,groupBy:()=>Go,has:()=>Co,head:()=>so,identity:()=>Jr,include:()=>pr,includes:()=>pr,indexBy:()=>Gi,indexOf:()=>Zn,initial:()=>Yi,inject:()=>Dr,intersection:()=>Ko,invert:()=>fn,invoke:()=>Nr,isArguments:()=>ne,isArray:()=>st,isArrayBuffer:()=>Se,isBoolean:()=>nt,isDataView:()=>ce,isDate:()=>Lt,isElement:()=>wt,isEmpty:()=>ht,isEqual:()=>Qe,isError:()=>Qt,isFinite:()=>ae,isFunction:()=>xe,isMap:()=>Ln,isMatch:()=>kt,isNaN:()=>Zt,isNull:()=>V,isNumber:()=>N,isObject:()=>j,isRegExp:()=>Tt,isSet:()=>Ne,isString:()=>gt,isSymbol:()=>Oe,isTypedArray:()=>zt,isUndefined:()=>Y,isWeakMap:()=>pn,isWeakSet:()=>Ar,iteratee:()=>mo,keys:()=>U,last:()=>mi,lastIndexOf:()=>Bi,map:()=>Sr,mapObject:()=>ve,matcher:()=>Wn,matches:()=>Wn,max:()=>Fr,memoize:()=>Ns,methods:()=>_n,min:()=>vi,mixin:()=>Bs,negate:()=>fi,noop:()=>rr,now:()=>In,object:()=>Ia,omit:()=>Ki,once:()=>di,pairs:()=>jr,partial:()=>oo,partition:()=>Da,pick:()=>To,pluck:()=>Ir,property:()=>Nn,propertyOf:()=>Uo,random:()=>Ye,range:()=>Zi,reduce:()=>Dr,reduceRight:()=>Wi,reject:()=>Or,rest:()=>Tr,restArguments:()=>Q,result:()=>Tn,sample:()=>Hs,select:()=>yn,shuffle:()=>ja,size:()=>Na,some:()=>gi,sortBy:()=>Ma,sortedIndex:()=>Ui,tail:()=>Tr,take:()=>so,tap:()=>ro,template:()=>Hn,templateSettings:()=>G,throttle:()=>Is,times:()=>or,toArray:()=>Vr,toPath:()=>ur,transpose:()=>yi,unescape:()=>T,union:()=>zs,uniq:()=>Po,unique:()=>Po,uniqueId:()=>_r,unzip:()=>yi,values:()=>Yn,where:()=>kn,without:()=>bn,wrap:()=>Zr,zip:()=>Us});var at={};pt.r(at),pt.d(at,{VERSION:()=>_t,after:()=>Cr,all:()=>$i,allKeys:()=>Kt,any:()=>gi,assign:()=>Dn,before:()=>Oo,bind:()=>io,bindAll:()=>Wo,chain:()=>Ds,chunk:()=>Yo,clone:()=>Ro,collect:()=>Sr,compact:()=>Xi,compose:()=>Fs,constant:()=>Ae,contains:()=>pr,countBy:()=>La,create:()=>xo,debounce:()=>Jn,default:()=>Fa,defaults:()=>_o,defer:()=>zi,delay:()=>So,detect:()=>hr,difference:()=>ko,drop:()=>Tr,each:()=>mn,escape:()=>Bt,every:()=>$i,extend:()=>Mr,extendOwn:()=>Dn,filter:()=>yn,find:()=>hr,findIndex:()=>hi,findKey:()=>Vs,findLastIndex:()=>$o,findWhere:()=>qn,first:()=>so,flatten:()=>Ji,foldl:()=>Dr,foldr:()=>Wi,forEach:()=>mn,functions:()=>_n,get:()=>Lr,groupBy:()=>Go,has:()=>Co,head:()=>so,identity:()=>Jr,include:()=>pr,includes:()=>pr,indexBy:()=>Gi,indexOf:()=>Zn,initial:()=>Yi,inject:()=>Dr,intersection:()=>Ko,invert:()=>fn,invoke:()=>Nr,isArguments:()=>ne,isArray:()=>st,isArrayBuffer:()=>Se,isBoolean:()=>nt,isDataView:()=>ce,isDate:()=>Lt,isElement:()=>wt,isEmpty:()=>ht,isEqual:()=>Qe,isError:()=>Qt,isFinite:()=>ae,isFunction:()=>xe,isMap:()=>Ln,isMatch:()=>kt,isNaN:()=>Zt,isNull:()=>V,isNumber:()=>N,isObject:()=>j,isRegExp:()=>Tt,isSet:()=>Ne,isString:()=>gt,isSymbol:()=>Oe,isTypedArray:()=>zt,isUndefined:()=>Y,isWeakMap:()=>pn,isWeakSet:()=>Ar,iteratee:()=>mo,keys:()=>U,last:()=>mi,lastIndexOf:()=>Bi,map:()=>Sr,mapObject:()=>ve,matcher:()=>Wn,matches:()=>Wn,max:()=>Fr,memoize:()=>Ns,methods:()=>_n,min:()=>vi,mixin:()=>Bs,negate:()=>fi,noop:()=>rr,now:()=>In,object:()=>Ia,omit:()=>Ki,once:()=>di,pairs:()=>jr,partial:()=>oo,partition:()=>Da,pick:()=>To,pluck:()=>Ir,property:()=>Nn,propertyOf:()=>Uo,random:()=>Ye,range:()=>Zi,reduce:()=>Dr,reduceRight:()=>Wi,reject:()=>Or,rest:()=>Tr,restArguments:()=>Q,result:()=>Tn,sample:()=>Hs,select:()=>yn,shuffle:()=>ja,size:()=>Na,some:()=>gi,sortBy:()=>Ma,sortedIndex:()=>Ui,tail:()=>Tr,take:()=>so,tap:()=>ro,template:()=>Hn,templateSettings:()=>G,throttle:()=>Is,times:()=>or,toArray:()=>Vr,toPath:()=>ur,transpose:()=>yi,unescape:()=>T,union:()=>zs,uniq:()=>Po,unique:()=>Po,uniqueId:()=>_r,unzip:()=>yi,values:()=>Yn,where:()=>kn,without:()=>bn,wrap:()=>Zr,zip:()=>Us});var _t="1.13.4",J=typeof self=="object"&&self.self===self&&self||typeof El=="object"&&El.global===El&&El||Function("return this")()||{},W=Array.prototype,z=Object.prototype,k=typeof Symbol<"u"?Symbol.prototype:null,P=W.push,E=W.slice,M=z.toString,D=z.hasOwnProperty,ot=typeof ArrayBuffer<"u",it=typeof DataView<"u",Et=Array.isArray,jt=Object.keys,Dt=Object.create,ee=ot&&ArrayBuffer.isView,xt=isNaN,bt=isFinite,Wt=!{toString:null}.propertyIsEnumerable("toString"),Ft=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Ht=Math.pow(2,53)-1;function Q(_,A){return A=A==null?_.length-1:+A,function(){for(var K=Math.max(arguments.length-A,0),Z=Array(K),vt=0;vt=0&&K<=Ht}}function Xe(_){return function(A){return A==null?void 0:A[_]}}const vn=Xe("byteLength"),Rn=Ke(vn);var mt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const zt=ot?function(_){return ee?ee(_)&&!ce(_):Rn(_)&&mt.test(M.call(_))}:Ae(!1),b=Xe("length");function I(_,A){A=function(Nt){for(var Gt={},je=Nt.length,He=0;He":">",'"':""","'":"'","`":"`"},Bt=yo(Bo),T=yo(fn(Bo)),G=Ot.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Mt=/(.)^/,te={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},de=/\\|'|\r|\n|\u2028|\u2029/g;function $e(_){return"\\"+te[_]}var oe=/^\s*(\w|\$)+\s*$/;function Hn(_,A,K){!A&&K&&(A=K),A=_o({},A,Ot.templateSettings);var Z=RegExp([(A.escape||Mt).source,(A.interpolate||Mt).source,(A.evaluate||Mt).source].join("|")+"|$","g"),vt=0,lt="__p+='";_.replace(Z,function(He,cn,Rr,ts,Eo){return lt+=_.slice(vt,Eo).replace(de,$e),vt=Eo+He.length,cn?lt+=`'+ ((__t=(`+cn+`))==null?'':_.escape(__t))+ '`:Rr?lt+=`'+ ((__t=(`+Rr+`))==null?'':__t)+ '`:ts&&(lt+=`'; `+ts+` __p+='`),He}),lt+=`'; `;var Nt,Gt=A.variable;if(Gt){if(!oe.test(Gt))throw new Error("variable is not a bare identifier: "+Gt)}else lt=`with(obj||{}){ `+lt+`} `,Gt="obj";lt=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');}; `+lt+`return __p; `;try{Nt=new Function(Gt,"_",lt)}catch(He){throw He.source=lt,He}var je=function(He){return Nt.call(this,He,Ot)};return je.source="function("+Gt+`){ `+lt+"}",je}function Tn(_,A,K){var Z=(A=ln(A)).length;if(!Z)return xe(K)?K.call(_):K;for(var vt=0;vt1)wo(Gt,A-1,K,Z),vt=Z.length;else for(var je=0,He=Gt.length;jeA?(Z&&(clearTimeout(Z),Z=null),Gt=cn,Nt=_.apply(vt,lt),Z||(vt=lt=null)):Z||K.trailing===!1||(Z=setTimeout(je,Rr)),Nt};return He.cancel=function(){clearTimeout(Z),Gt=0,Z=vt=lt=null},He}function Jn(_,A,K){var Z,vt,lt,Nt,Gt,je=function(){var cn=In()-vt;A>cn?Z=setTimeout(je,A-cn):(Z=null,K||(Nt=_.apply(Gt,lt)),Z||(lt=Gt=null))},He=Q(function(cn){return Gt=this,lt=cn,vt=In(),Z||(Z=setTimeout(je,A),K&&(Nt=_.apply(Gt,lt))),Nt});return He.cancel=function(){clearTimeout(Z),Z=lt=Gt=null},He}function Zr(_,A){return oo(A,_)}function fi(_){return function(){return!_.apply(this,arguments)}}function Fs(){var _=arguments,A=_.length-1;return function(){for(var K=A,Z=_[A].apply(this,arguments);K--;)Z=_[K].call(this,Z);return Z}}function Cr(_,A){return function(){if(--_<1)return A.apply(this,arguments)}}function Oo(_,A){var K;return function(){return--_>0&&(K=A.apply(this,arguments)),_<=1&&(A=null),K}}const di=oo(Oo,2);function Vs(_,A,K){A=qe(A,K);for(var Z,vt=U(_),lt=0,Nt=vt.length;lt0?0:vt-1;lt>=0&<0?Nt=lt>=0?lt:Math.max(lt+Gt,Nt):Gt=lt>=0?Math.min(lt+1,Gt):lt+Gt+1;else if(K&<&&Gt)return Z[lt=K(Z,vt)]===vt?lt:-1;if(vt!=vt)return(lt=A(E.call(Z,Nt,Gt),Zt))>=0?lt+Nt:-1;for(lt=_>0?Nt:Gt-1;lt>=0&<0?0:Gt-1;for(lt||(vt=K[Nt?Nt[je]:je],je+=_);je>=0&&je=3;return A(K,$n(Z,lt,4),vt,Nt)}}const Dr=qo(1),Wi=qo(-1);function yn(_,A,K){var Z=[];return A=qe(A,K),mn(_,function(vt,lt,Nt){A(vt,lt,Nt)&&Z.push(vt)}),Z}function Or(_,A,K){return yn(_,fi(qe(A)),K)}function $i(_,A,K){A=qe(A,K);for(var Z=!Xn(_)&&U(_),vt=(Z||_).length,lt=0;lt=0}const Nr=Q(function(_,A,K){var Z,vt;return xe(A)?vt=A:(A=ln(A),Z=A.slice(0,-1),A=A[A.length-1]),Sr(_,function(lt){var Nt=vt;if(!Nt){if(Z&&Z.length&&(lt=Ho(lt,Z)),lt==null)return;Nt=lt[A]}return Nt==null?Nt:Nt.apply(lt,K)})});function Ir(_,A){return Sr(_,Nn(A))}function kn(_,A){return yn(_,Wn(A))}function Fr(_,A,K){var Z,vt,lt=-1/0,Nt=-1/0;if(A==null||typeof A=="number"&&typeof _[0]!="object"&&_!=null)for(var Gt=0,je=(_=Xn(_)?_:Yn(_)).length;Gtlt&&(lt=Z);else A=qe(A,K),mn(_,function(He,cn,Rr){((vt=A(He,cn,Rr))>Nt||vt===-1/0&<===-1/0)&&(lt=He,Nt=vt)});return lt}function vi(_,A,K){var Z,vt,lt=1/0,Nt=1/0;if(A==null||typeof A=="number"&&typeof _[0]!="object"&&_!=null)for(var Gt=0,je=(_=Xn(_)?_:Yn(_)).length;GtGt||Nt===void 0)return 1;if(Nt1&&(Z=$n(Z,A[1])),A=Kt(_)):(Z=Al,A=wo(A,!1,!1),_=Object(_));for(var vt=0,lt=A.length;vt1&&(K=A[1])):(A=Sr(wo(A,!1,!1),String),Z=function(vt,lt){return!pr(A,lt)}),To(_,Z,K)});function Yi(_,A,K){return E.call(_,0,Math.max(0,_.length-(A==null||K?1:A)))}function so(_,A,K){return _==null||_.length<1?A==null||K?void 0:[]:A==null||K?_[0]:Yi(_,_.length-A)}function Tr(_,A,K){return E.call(_,A==null||K?1:A)}function mi(_,A,K){return _==null||_.length<1?A==null||K?void 0:[]:A==null||K?_[_.length-1]:Tr(_,Math.max(0,_.length-A))}function Xi(_){return yn(_,Boolean)}function Ji(_,A){return wo(_,A,!1)}const ko=Q(function(_,A){return A=wo(A,!0,!0),yn(_,function(K){return!pr(A,K)})}),bn=Q(function(_,A){return ko(_,A)});function Po(_,A,K,Z){nt(A)||(Z=K,K=A,A=!1),K!=null&&(K=qe(K,Z));for(var vt=[],lt=[],Nt=0,Gt=b(_);Nt{var H=S&&S.__esModule?()=>S.default:()=>S;return gn.d(H,{a:H}),H},gn.d=(S,H)=>{for(var pt in H)gn.o(H,pt)&&!gn.o(S,pt)&&Object.defineProperty(S,pt,{enumerable:!0,get:H[pt]})},gn.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),gn.o=(S,H)=>Object.prototype.hasOwnProperty.call(S,H),gn.r=S=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(S,"__esModule",{value:!0})};var yp={};return(()=>{gn.d(yp,{default:()=>fm});var S=gn(50),H=gn(163);function pt(a){for(var r=[],t=1;t',move:'',plus:'',caret:'',delete:'',copy:'',arrowUp:'',chevron:'',eye:'',eyeOff:''},i18n:{},undoManager:{},assetManager:{},canvas:{},layerManager:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:"Code",keepUnusedStyles:!1,multiFrames:!1,customUI:!1};var _t=gn(316),J=gn.n(_t),W=gn(895),z,k=gn(346),P=(z=function(a,r){return z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},z(a,r)},function(a,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function t(){this.constructor=a}z(a,r),a.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}),E=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return P(r,a),r}(k.Hn);const M=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return P(r,a),r.prototype.getByComponent=function(t){var e=this;return this.filter(function(n){return e.getComponent(n)===t})[0]},r.prototype.addComponent=function(t,e){var n=this,i=((0,S.isArray)(t)?t:[t]).filter(function(l){return!n.hasComponent(l)}).map(function(l){return new E({component:l})})[0];return this.push(i,e)},r.prototype.getComponent=function(t){return t.get("component")},r.prototype.hasComponent=function(t){var e=this.getByComponent(t);return e&&this.contains(e)},r.prototype.lastComponent=function(){var t=this.last();return t?this.getComponent(t):void 0},r.prototype.allComponents=function(){var t=this;return this.map(function(e){return t.getComponent(e)}).filter(function(e){return e})},r.prototype.removeComponent=function(t,e){var n=this,i=((0,S.isArray)(t)?t:[t]).map(function(l){return n.getByComponent(l)});return this.remove(i,e)},r}(k.FE);var D=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ot=function(){return ot=Object.assign||function(a){for(var r,t=1,e=arguments.length;t",frameStyle:` body { background-color: #fff } * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) } * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) } * ::-webkit-scrollbar { width: 10px } `,notTextable:["button","a","input[type=checkbox]","input[type=radio]"]};var xt=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const bt=function(a){function r(t,e,n){var i=a.call(this,e,n)||this;return i._module=t,i}return xt(r,a),Object.defineProperty(r.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),r}(k.Hn);var Wt=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Ft=function(a){function r(t,e,n){return a.call(this,e,{module:t,modelConstructor:n})||this}return Wt(r,a),r.prototype.add=function(t,e){var n,i=this,l=(0,S.isArray)(t)?t:(0,S.isUndefined)(t)?void 0:[t];return l=(n=l==null?void 0:l.map(function(f){return f instanceof i.newModel?f:new i.newModel(i.module,f)}))!==null&&n!==void 0?n:[void 0],a.prototype.add.call(this,(0,S.isArray)(t)?l:l[0],e)},r.prototype.preinitialize=function(t,e){this.newModel=e.modelConstructor,this.module=e.module},r}(k.FE);var Ht=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Q=function(){return Q=Object.assign||function(a){for(var r,t=1,e=arguments.length;t=0&&this.head.splice(l,1)},r.prototype.addLink=function(t){var e="link";!this.getHeadByAttr("href",t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:"stylesheet"}})},r.prototype.removeLink=function(t){this.removeHeadByAttr("href",t,"link")},r.prototype.addScript=function(t){var e="script";!this.getHeadByAttr("src",t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},r.prototype.removeScript=function(t){this.removeHeadByAttr("src",t,"script")},r.prototype.getPage=function(){var t;return(t=this.collection)===null||t===void 0?void 0:t.page},r.prototype._emitUpdated=function(t){t===void 0&&(t={}),this.em.trigger("frame:updated",Q({frame:this},t))},r.prototype.toJSON=function(t){t===void 0&&(t={});var e=bt.prototype.toJSON.call(this,t),n=(0,S.result)(this,"defaults");return t.fromUndo&&delete e.component,delete e.styles,delete e.changesCount,e[V]&&delete e.width,e[Y]&&delete e.height,(0,S.forEach)(e,function(i,l){l.indexOf("_")===0&&delete e[l]}),(0,S.forEach)(n,function(i,l){e[l]===i&&delete e[l]}),(0,S.forEach)(["attributes","head"],function(i){(0,S.isEmpty)(e[i])&&delete e[i]}),e},r}(bt);const wt=nt;var rt=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const gt=function(a){function r(t,e){e===void 0&&(e=[]);var n=a.call(this,t,e,wt)||this;return n.loadedItems=0,n.itemsToLoad=0,(0,S.bindAll)(n,"itemLoaded"),n.on("reset",n.onReset),n.on("remove",n.onRemove),n}return rt(r,a),r.prototype.onReset=function(t,e){var n=this;((e==null?void 0:e.previousModels)||[]).map(function(i){return n.onRemove(i)})},r.prototype.onRemove=function(t){t==null||t.onRemove()},r.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger("loaded:all"),this.listenToLoadItems(!1))},r.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},r.prototype.listenToLoadItems=function(t){var e=this;this.forEach(function(n){return n[t?"on":"off"]("loaded",e.itemLoaded)})},r}(Ft);var N=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Lt=function(a){function r(t,e){e===void 0&&(e={});var n=a.call(this,t,e)||this,i=e.em,l={};n.em=i,t.frames||(l.component=t.component,l.styles=t.styles,["component","styles"].map(function(h){return n.unset(h)}));var f=t.frames||[l],d=new gt(i.Canvas,f);d.page=n,n.set("frames",d),!n.getId()&&n.set("id",i==null?void 0:i.get("PageManager")._createId());var v=i==null?void 0:i.get("UndoManager");return v==null||v.add(d),n}return N(r,a),r.prototype.defaults=function(){return{frames:[],_undo:!0}},r.prototype.onRemove=function(){this.getFrames().reset()},r.prototype.getFrames=function(){return this.get("frames")},r.prototype.getId=function(){return this.id},r.prototype.getName=function(){return this.get("name")},r.prototype.setName=function(t){return this.set({name:t})},r.prototype.getAllFrames=function(){return this.getFrames().models||[]},r.prototype.getMainFrame=function(){return this.getFrames().at(0)},r.prototype.getMainComponent=function(){var t=this.getMainFrame();return t==null?void 0:t.getComponent()},r.prototype.toJSON=function(t){t===void 0&&(t={});var e=k.Hn.prototype.toJSON.call(this,t),n=(0,S.result)(this,"defaults");return(0,S.forEach)(e,function(i,l){l.indexOf("_")===0&&delete e[l]}),(0,S.forEach)(n,function(i,l){e[l]===i&&delete e[l]}),e},r}(k.Hn);var Tt=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Qt=function(){return Qt=Object.assign||function(a){for(var r,t=1,e=arguments.length;t',`
`],[`
',`
`])),e,n,e,e,e,e,e,e,e)},r.prototype.events=function(){return{change:"updateDevice","click [data-add-trasp]":"startAdd"}},r.prototype.startAdd=function(){},r.prototype.updateDevice=function(){var t=this.em;if(t){var e=this.devicesEl;t.set("device",e?e.val():"")}},r.prototype.updateSelect=function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel();e.val(n?n.get("id"):"")}},r.prototype.getOptions=function(){var t=this.collection,e=this.em,n="";return t.forEach(function(i){var l=i.attributes,f=l.name,d=l.id,v=e&&e.t&&e.t("deviceManager.devices.".concat(d))||f;n+='")}),n},r.prototype.render=function(){var t=this,e=t.em,n=t.ppfx,i=t.$el,l=t.el,f=e&&e.t&&e.t("deviceManager.device");return i.html(this.template({ppfx:n,label:f})),this.devicesEl=i.find(".".concat(n,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(e.get("device")),l.className="".concat(n,"devices-c"),this},r}(k.G7);var ht,kt=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ot=function(){return Ot=Object.assign||function(a){for(var r,t=1,e=arguments.length;t";if(e.stopDefault(),e.inAbsoluteMode()){var h=e.Components.getWrapper(),w=h.append({})[0],C=e.Commands.run("core:component-drag",{event:r,guidesInfo:1,center:1,target:w,onEnd:function(F,q,et){var X;if(!et.cancelled){X=h.append(v)[0];var At=n.getOffset(),It=w.getStyle(),ie=It.top,se=It.left,Me=It.position,Ie=(0,Ne.GX)(F.target),Je=parseInt("".concat(parseFloat(se)+Ie.x-At.left),10),dn=parseInt("".concat(parseFloat(ie)+Ie.y-At.top),10);X.addStyle({left:Je+"px",top:dn+"px",position:Me})}t.handleDragEnd(X,i),w.remove()}});l=function(F){return C.stop(r,{cancel:F})},f=function(F){return v=F}}else{var L=new d.Sorter(xo({em:e,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:this.el,placer:n.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:"gjs-",onEndMove:function(F){return t.handleDragEnd(F,i)},document:this.el.ownerDocument},this.sortOpts||{}));L.setDropContent(v),L.startSort(),this.sorter=L,l=function(F){F&&(L.moved=!1),L.endMove()},f=function(F){return L.setDropContent(F)}}this.dragStop=l,this.dragContent=f,e.trigger("canvas:dragenter",i,v)}},a.prototype.handleDragEnd=function(r,t){var e=this.em;this.over=!1,r&&(e.set("dragResult",r),e.trigger("canvas:drop",t,r)),e.runDefault({preserveSelected:1})},a.prototype.handleDragOver=function(r){r.preventDefault(),this.em.trigger("canvas:dragover",r)},a.prototype.handleDrop=function(r){r.preventDefault();var t=this.dragContent,e=r.dataTransfer,n=this.getContentByData(e).content;r.target.style.border="",n&&t&&t(n),this.endDrop(!n,r)},a.prototype.getContentByData=function(r){var t=this.em,e=r&&r.types,n=r&&r.files||[],i=t.get("dragContent"),l=r&&r.getData("text");if(n.length){l=[];for(var f=0;f=0)l=r&&r.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if((0,S.indexOf)(e,"text/uri-list")>=0)l={type:"link",attributes:{href:l},content:l};else if((0,S.indexOf)(e,"text/json")>=0){var h=r&&r.getData("text/json");h&&(l=JSON.parse(h))}else e.length===1&&e[0]==="text/plain"&&(l="
".concat(l,"
"));var w={content:l};return t.trigger("canvas:dragdata",r,w),w},a}();const ro=Ro;var ur=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ln=function(){return ln=Object.assign||function(a){for(var r,t=1,e=arguments.length;td&&(v+=l-d),!(0,S.isUndefined)(t)&&v!==i&&v>0&&v0){var L=w.shift(),F=(0,Ne.ut)("script",ln({type:"text/javascript"},(0,S.isString)(L)?{src:L}:L));F.onerror=F.onload=h.bind(null,w),(C=n.contentDocument)===null||C===void 0||C.head.appendChild(F)}else t.renderBody(),l&&l.trigger(f,d)};n.onload=function(){var w=t.config.frameContent;if(w){var C=t.getDoc();C.open(),C.write(w),C.close()}l&&l.trigger("".concat(f,":before"),d),h(Ho([],v.get("scripts"),!0))}},r.prototype.renderStyles=function(t){t===void 0&&(t={});var e=this.getHead(),n=this.getCanvasModel(),i=function(w){return w.map(function(C){return{tag:"link",attributes:ln({rel:"stylesheet"},(0,S.isString)(C)?{href:C}:C)}})},l=i(t.prev||n.previous("styles")),f=i(n.get("styles")),d=[],v=[],h=function(w,C,L){w.forEach(function(F){var q=F.attributes.href;!C.some(function(et){return et.attributes.href===q})&&L.push(F)})};h(f,l,v),h(l,f,d),d.forEach(function(w){var C,L=e.querySelector('link[href="'.concat(w.attributes.href,'"]'));(C=L==null?void 0:L.parentNode)===null||C===void 0||C.removeChild(L)}),(0,Ne.SJ)(e,v)},r.prototype.renderBody=function(){var t,e,n=this,i=this,l=i.config,f=i.em,d=i.model,v=i.ppfx,h=this.getDoc(),w=this.getBody(),C=this.getWindow(),L=f.config;C._isEditor=!0,this.renderStyles({prev:[]}),(0,Ne.R3)(w,``));var F=d.getComponent(),q=f.Components.getType("wrapper").view;this.wrapper=new q({model:F,config:ln(ln({},F.config),{em:f,frameView:this})}).render(),(0,Ne.R3)(w,(t=this.wrapper)===null||t===void 0?void 0:t.el),(0,Ne.R3)(w,new Vo({collection:d.getStyles(),config:ln(ln({},f.Css.getConfig()),{frameView:this})}).render().el),(0,Ne.R3)(w,this.getJsContainer()),(0,H.on)(w,"click",function(et){var X;return et&&((X=et.target)===null||X===void 0?void 0:X.tagName)=="A"&&et.preventDefault()}),(0,H.on)(w,"submit",function(et){return et&&et.preventDefault()}),[{event:"keydown keyup keypress",class:"KeyboardEvent"},{event:"mousedown mousemove mouseup",class:"MouseEvent"},{event:"pointerdown pointermove pointerup",class:"PointerEvent"},{event:"wheel",class:"WheelEvent"}].forEach(function(et){return et.event.split(" ").forEach(function(X){h.addEventListener(X,function(At){return n.el.dispatchEvent((0,Ne.t3)(At,et.class))})})}),this._toggleEffects(!0),(0,H.hasDnd)(f)&&(this.droppable=new ro(f,(e=this.wrapper)===null||e===void 0?void 0:e.el)),d.trigger("loaded")},r.prototype._toggleEffects=function(t){var e=t?H.on:H.off,n=this.getWindow();n&&e(n,"".concat(Ne.G1," resize"),this._emitUpdate)},r.prototype._emitUpdate=function(){this.model._emitUpdated()},r}(pn);const Co=Lr;var Jr=gn(668),Wn=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Nn=function(){return Nn=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
`).concat(f.get("name")||"",`
`)).append(e.el);var h=(0,Ne.ut)("div",{class:"".concat(i,"tools"),style:"pointer-events:none; display: none"},`
`));this.elTools=h;var w=l==null?void 0:l.toolsWrapper;return w&&w.appendChild(h),v&&v({el:d,elTop:d.querySelector("[data-frame-top]"),elRight:d.querySelector("[data-frame-right]"),elBottom:d.querySelector("[data-frame-bottom]"),elLeft:d.querySelector("[data-frame-left]"),frame:f,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},r}(pn);var zo=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),mo=function(a){function r(t,e){t===void 0&&(t={});var n=a.call(this,t,!0)||this;return n.listenTo(n.collection,"reset",n.render),n.canvasView=e.canvasView,n._module=e.module,n}return zo(r,a),r.prototype.onRemoveBefore=function(t,e){e===void 0&&(e={}),t.forEach(function(n){return n.remove(e)})},r.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},r.prototype.renderView=function(t,e){return new $n(t,this.canvasView)},r}(Yn);const qe=mo;var ve=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rr=function(){return rr=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
`)},r.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},r.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,i=t.config,l=t.em,f=n.frames;l.set("readyCanvas",0),f.once("loaded:all",function(){return l.set("readyCanvas",1)}),e==null||e.remove(),this.frames=new qe({collection:f},rr(rr({},i),{canvasView:this}))},r.prototype.checkSelected=function(t,e){var n;e===void 0&&(e={});var i=e.scroll,l=this.em.get("currentFrame");i&&((n=t.views)===null||n===void 0||n.forEach(function(f){f._getFrame()===l&&f.scrollIntoView(i)}))},r.prototype.remove=function(){for(var t,e=[],n=0;n=0&&f>=0&&l<=i.height&&f<=i.width},r.prototype.offset=function(t,e){e===void 0&&(e={});var n=e.noScroll,i=(0,H.getElRect)(t),l=n?{x:0,y:0}:(0,Ne.GX)(t);return{top:i.top+l.y,left:i.left+l.x,width:i.width,height:i.height}},r.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},r.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=(e=this.frame)===null||e===void 0?void 0:e.el,i=t==null?void 0:t.ownerDocument.defaultView,l=i?i.frameElement:n;this.frmOff=this.offset(l||n)}return this.frmOff},r.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},r.prototype.getElementPos=function(t,e){e===void 0&&(e={});var n=this.getZoom(),i=this.getFrameOffset(t),l=this.el,f=this.getCanvasOffset(),d=this.offset(t,e),v=e.avoidFrameOffset?0:i.top,h=e.avoidFrameOffset?0:i.left,w=e.avoidFrameZoom?d.top:d.top*n,C=e.avoidFrameZoom?d.left:d.left*n;return{top:e.avoidFrameOffset?w:w+v-f.top+l.scrollTop,left:e.avoidFrameOffset?C:C+h-f.left+l.scrollLeft,height:e.avoidFrameZoom?d.height:d.height*n,width:e.avoidFrameZoom?d.width:d.width*n,zoom:n,rect:d}},r.prototype.getElementOffsets=function(t){var e=this;if(!t||(0,H.isTextNode)(t))return{};var n={},i=window.getComputedStyle(t);return["marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft"].forEach(function(l){n[l]=parseFloat(i[l])*e.getZoom()}),n},r.prototype.getPosition=function(t){var e;t===void 0&&(t={});var n=(e=this.frame)===null||e===void 0?void 0:e.el.contentDocument;if(!n)return{top:0,left:0,width:0,height:0};var i=n.body,l=this.getZoom(),f=this.getFrameOffset(),d=this.getCanvasOffset(),v=t.noScroll;return{top:f.top+(v?0:i.scrollTop)*l-d.top,left:f.left+(v?0:i.scrollLeft)*l-d.left,width:d.width,height:d.height}},r.prototype.updateScript=function(t){var e=t.model,n=e.getId();t.scriptContainer||(t.scriptContainer=(0,Ne.ut)("div",{"data-id":n}),this.getJsContainer().appendChild(t.scriptContainer)),t.el.id=n,t.scriptContainer.innerHTML="";var i=document.createElement("script"),l=e.getScriptString(),f=e.get("script-props")?l:`function(){ `.concat(l,` ;}`),d=JSON.stringify(e.__getScriptProps());i.innerHTML=` setTimeout(function() { var item = document.getElementById('`.concat(n,`'); if (!item) return; (`).concat(f,".bind(item))(").concat(d,`) }, 1);`),setTimeout(function(){var v=t.scriptContainer;v==null||v.appendChild(i)},0)},r.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return e&&e.getJsContainer()},r.prototype.getFrameView=function(t){return(t==null?void 0:t._getFrame())||this.em.get("currentFrame")},r.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,i=t.em,l=t.framesArea,f=e.frames;f.listenToLoad(),n.render();var d=f.at(0),v=d==null?void 0:d.view;i.setCurrentFrame(v),l==null||l.appendChild(n.el),this.frame=v}},r.prototype.render=function(){var t=this,e=t.el,n=t.$el,i=t.ppfx,l=t.config,f=t.em;n.html(this.template());var d=n.find("[data-frames]");this.framesArea=d.get(0);var v=n.find("[data-tools]");return this.toolsWrapper=v.get(0),v.append(`
`).concat(l.extHl?'
'):"",`
`)),this.toolsEl=e.querySelector("#".concat(i,"tools")),this.hlEl=e.querySelector(".".concat(i,"highlighter")),this.badgeEl=e.querySelector(".".concat(i,"badge")),this.placerEl=e.querySelector(".".concat(i,"placeholder")),this.ghostEl=e.querySelector(".".concat(i,"ghost")),this.toolbarEl=e.querySelector(".".concat(i,"toolbar")),this.resizerEl=e.querySelector(".".concat(i,"resizer")),this.offsetEl=e.querySelector(".".concat(i,"offset-v")),this.fixedOffsetEl=e.querySelector(".".concat(i,"offset-fixed-v")),this.toolsGlobEl=e.querySelector(".".concat(i,"tools-gl")),this.el.className=(0,H.getUiClass)(f,this.className),this.ready=!0,this._renderFrames(),this},r}(pn);const or=Uo;var Ye=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),In=function(){return In=Object.assign||function(a){for(var r,t=1,e=arguments.length;tf.top+f.height?f.top+f.height:q,left:F,elementTop:f.top,elementLeft:f.left,elementWidth:f.width,elementHeight:f.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:l.top,canvasLeft:l.left,canvasWidth:l.width,canvasHeight:l.height};return w&&this.em&&this.em.trigger(w,et),et}},r.prototype.canvasRectOffset=function(t,e,n){var i=this;n===void 0&&(n={});var l=function(f,d,v){d===void 0&&(d=1);var h=i.em.getZoomDecimal(),w=d?"top":"left",C=f.ownerDocument,L=n.offset?function(Je){var dn=Je.defaultView;return dn==null?void 0:dn.frameElement}(C):{},F=L.offsetTop,q=F===void 0?0:F,et=L.offsetLeft,X=et===void 0?0:et,At=C.body||{},It=At.scrollTop,ie=It===void 0?0:It,se=At.scrollLeft,Me=d?ie:se===void 0?0:se,Ie=d?q:X;return v[w]-(Me-Ie)*h};return{top:l(t,1,e),left:l(t,0,e)}},r.prototype.getTargetToElementFixed=function(t,e,n){n===void 0&&(n={});var i=n.pos||this.getElementPos(t,{noScroll:!0}),l=n.canvasOff||this.canvasRectOffset(t,i),f=e.offsetHeight||0,d=e.offsetWidth||0,v=i.left+i.width,h=this.getCanvasView(),w=h.getPosition(),C=h.getFrameOffset(t),L=n.event,F=-f,q=(0,S.isUndefined)(n.left)?i.width-d:n.left;if(q=i.left<-q?-i.left:q,q=v>w.width?q-(v-w.width):q,l.top"||(F.void=!0);var qr=F.components;if(!F.type&&qr){for(var Gr=1,no=0,Kr=0;Kr".concat(At,""),dn=se.parseFromString(Je,Me);if(Ie){var Er=dn.head,qr=dn.body,Gr=Er.querySelectorAll("script");(0,S.each)(Gr,function(Kr){return qr.appendChild(Kr)});var no=[];(0,S.each)(Er.children,function(Kr){return no.push(Kr)}),(0,S.each)(no,function(Kr,ii){return qr.insertBefore(Kr,qr.children[ii])}),ie=qr}else ie=dn.firstChild;return ie}(t,v),w=h.querySelectorAll("script"),C=w.length;if(!((0,S.isUndefined)(l.allowScripts)?v.allowScripts:l.allowScripts))for(;C--;)w[C].parentNode.removeChild(w[C]);if(v.allowUnsafeAttr||this.__clearUnsafeAttr(h),e){for(var L=h.querySelectorAll("style"),F=L.length,q="";F--;)q=L[F].innerHTML+q,L[F].parentNode.removeChild(L[F]);q&&(f.css=e.parse(q))}a&&a.trigger("".concat($e,":root"),{input:t,root:h});var et=this.parseNode(h,d),X=et.length!==1||d.returnArray?et:et[0];return f.html=X,a&&a.trigger($e,{input:t,output:f}),f},__clearUnsafeAttr:function(t){var e=this,n=t.attributes||[],i=t.childNodes||[],l=[];(0,S.each)(n,function(f){var d=f.nodeName||"";d.indexOf("on")===0&&l.push(d)}),l.map(function(f){return t.removeAttribute(f)}),(0,S.each)(i,function(f){return e.__clearUnsafeAttr(f)})}}};var Hn=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Tn=function(){return Tn=Object.assign||function(a){for(var r,t=1,e=arguments.length;t=0:l,d="".concat(n[i]).concat(f?" !important":""),v=i.substr(0,2)=="__";d&&!v&&e.push("".concat(i,":").concat(d,";"))}return e.join("")},r.prototype.getSelectors=function(){return this.get("selectors")||this.get("classes")},r.prototype.getSelectorsString=function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},r}(k.Hn);var Ds=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),xr=function(){return xr=Object.assign||function(a){for(var r,t=1,e=arguments.length;t0&&L.reset(C,t)}else w.components=C}return w})},wo=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return Ds(r,a),r.prototype.initialize=function(t,e){e===void 0&&(e={}),this.opt=e,this.listenTo(this,"add",this.onAdd),this.listenTo(this,"remove",this.removeChildren),this.listenTo(this,"reset",this.resetChildren);var n=e.em,i=e.config;this.config=i,this.em=n,this.domc=e.domc||(n==null?void 0:n.Components)},r.prototype.resetChildren=function(t,e){var n=this;e===void 0&&(e={});var i=this,l=e.previousModels||[],f=l.filter(function(h){return!t.get(h.cid)}),d=io(t),v=io(l).filter(function(h){return d.indexOf(h)>=0});e.keepIds=(e.keepIds||[]).concat(v),f.forEach(function(h){return n.removeChildren(h,i,e)}),t.each(function(h){return n.onAdd(h)})},r.prototype.resetFromString=function(t,e){var n,i;t===void 0&&(t=""),e===void 0&&(e={}),e.keepIds=io(this);var l=this,f=l.domc,d=l.em,v=l.parent,h=d==null?void 0:d.Css,w=(f==null?void 0:f.allById())||{},C=this.parseString(t,e),L=Xn(C,w,e),F=e.visitedCmps,q=F===void 0?{}:F;Object.keys(q).forEach(function(et){var X=q[et];if(X.length){var At=(h==null?void 0:h.getRules("#".concat(et)))||[];At.length&&X.forEach(function(It){At.forEach(function(ie){var se=ie.clone();se.set("selectors",["#".concat(It.attributes.id)]),h.getAll().add(se)})})}}),this.reset(L,e),d==null||d.trigger("component:content",v,e,t),(i=(n=v).__checkInnerChilds)===null||i===void 0||i.call(n)},r.prototype.removeChildren=function(t,e,n){var i=this;if(n===void 0&&(n={}),t){var l=this.domc,f=this.em,d=n.temporary||n.fromUndo;if(t.prevColl=this,!d){var v=t.getId(),h=f.Selectors.getAll(),w=f.Css.getAll(),C=(n.keepIds||[]).indexOf(v)<0;delete(l?l.allById():{})[v];var L=C?w.remove(w.filter(function(q){return q.getSelectors().getFullString()==="#".concat(v)}),n):[];h.remove(L.map(function(q){return q.getSelectors().at(0)})),t.opt.temporary||(f.Commands.run("core:component-style-clear",{target:t}),t.removed(),t.trigger("removed"),f.trigger("component:remove",t)),t.components().forEach(function(q){return i.removeChildren(q,e,n)})}var F=t.components();f.stopListening(F),f.stopListening(t),f.stopListening(t.get("classes")),t.__postRemove()}},r.prototype.model=function(t,e){var n,i=e.collection.opt,l=i.em,f=l.Components.componentTypes;e.em=l,e.config=i.config,e.componentTypes=f,e.domc=i.domc;for(var d=0;d=0&&this.set("void",!0),e.em=i,this.opt=e,this.em=i,this.frame=e.frame,this.config=e.config||{},this.set("attributes",Be(Be({},(0,S.result)(this,"defaults").attributes||{}),this.get("attributes")||{})),this.ccid=r.createId(this,e),this.initClasses(),this.initComponents(),this.initTraits(),this.initToolbar(),this.initScriptProps(),this.listenTo(this,"change:script",this.scriptUpdated),this.listenTo(this,"change:tagName",this.tagUpdated),this.listenTo(this,"change:attributes",this.attrUpdated),this.listenTo(this,"change:attributes:id",this._idUpdated),this.on("change:toolbar",this.__emitUpdateTlb),this.on("change",this.__onChange),this.on(Dr,this.__propToParent),this.set("status",""),this.views=[],["classes","traits","components"].forEach(function(q){var et="add remove ".concat(q!=="components"?"change":"");n.listenTo(n.get(q),et.trim(),function(){for(var X=[],At=0;At=0})},r.prototype.__getSymbToUp=function(t){var e=this;t===void 0&&(t={});var n=[],i=t.changed;if(t.fromInstance||t.noPropagate||t.fromUndo||i&&this.__isSymbOvrd(i))return n;var l=this.__getSymbols()||[],f=this.__getSymbol();return n=(f?Zn([f],f.__getSymbols()||[],!0):l).filter(function(d){return d!==e}).filter(function(d){return!(i&&d.__isSymbOvrd(i))})},r.prototype.__getSymbTop=function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e},r.prototype.__upSymbProps=function(t,e){var n=this;e===void 0&&(e={});var i=this.changedAttributes()||{},l=i.attributes||{};if(delete i.status,delete i.open,delete i[qn],delete i[mn],delete i[Sr],delete i.attributes,delete l.id,(0,H.isEmptyObj)(l)||(i.attributes=l),!(0,H.isEmptyObj)(i)){var f=this.__getSymbToUp(e);(0,S.keys)(i).map(function(d){n.__isSymbOvrd(d)&&delete i[d]}),this.__logSymbol("props",f,{opts:e,changed:i}),f.forEach(function(d){var v=Be({},i);(0,S.keys)(v).map(function(h){d.__isSymbOvrd(h)&&delete v[h]}),d.set(v,Be({fromInstance:n},e))})}},r.prototype.__upSymbCls=function(t,e,n){var i=this;n===void 0&&(n={});var l=this.__getSymbToUp(n);this.__logSymbol("classes",l,{opts:n}),l.forEach(function(f){f.set("classes",i.get("classes"),{fromInstance:i})}),this.__changesUp(n)},r.prototype.__upSymbComps=function(t,e,n){var i=this,l=n||e||{},f={fromInstance:l.fromInstance,fromUndo:l.fromUndo},d=t.opt.temporary;if(n)if(n.add){var v=[],h=!!this.__getSymbols();if((It=this.__getSymbToUp(Be(Be({},f),{changed:"components:add"}))).length){var w=t.__getSymbol();v=(w?w.__getSymbols():t.__getSymbols())||[],(v=Zn([],v,!0)).push(w||t)}!d&&this.__logSymbol("add",It,{opts:n,addedInstances:v.map(function(se){return se.cid}),added:t.cid}),It.forEach(function(se){var Me=se.__getSymbTop(),Ie=v.filter(function(Je){var dn=Je.__getSymbTop({prev:1});return Me&&dn&&dn===Me})[0]||t.clone({symbol:!0,symbolInv:h});se.append(Ie,Be({fromInstance:i},n))})}else{var C=t.__getSymbol();if(C&&!n.temporary&&C.set(qn,C.__getSymbols().filter(function(se){return se!==t})),!t.__isSymbolTop()){var L="components:remove",F=n.index,q=t.parent(),et=Be({fromInstance:t},n),X=t.__isSymbolNested(),At=function(se){var Me=se.parent();Me&&!Me.__isSymbOvrd(L)&&se.remove(et)};It=q!=null&&q.__isSymbOvrd(L)?[]:t.__getSymbToUp(f),X&&(It=q==null?void 0:q.__getSymbToUp(Be(Be({},f),{changed:L})),At=function(se){var Me=se.components().at(F);Me&&Me.remove(Be({fromInstance:q},et))}),!d&&this.__logSymbol("remove",It,{opts:n,removed:t.cid,isSymbNested:X}),It.forEach(At)}}else{var It=this.__getSymbToUp(Be(Be({},f),{changed:"components:reset"})),ie=t.models;this.__logSymbol("reset",It,{components:ie}),It.forEach(function(se){var Me=ie.map(function(Ie){return Ie.clone({symbol:!0})});se.components().reset(Me,Be({fromInstance:i},e))})}this.__changesUp(l)},r.prototype.initClasses=function(t,e,n){n===void 0&&(n={});var i=this.get("attributes").class||[],l=[this,"change:classes",this.initClasses],f=this.get("classes")||i,d=(0,S.isString)(f)?f.split(" "):f;this.stopListening.apply(this,l);var v=this.normalizeClasses(d),h=new Cr([]);return this.set("classes",h,n),h.add(v),h.on("add remove reset",this.__upSymbCls),this.listenTo.apply(this,l),this},r.prototype.initComponents=function(){var t=[this,"change:components",this.initComponents];this.stopListening.apply(this,t);var e=new Wo([],this.opt);e.parent=this;var n=this.get("components"),i=!this.opt.avoidChildren;return this.set("components",e),i&&n&&e.add((0,S.isFunction)(n)?n(this):n,this.opt),e.on("add remove reset",this.__upSymbComps),this.listenTo.apply(this,t),this},r.prototype.initTraits=function(t){var e=this.em,n="change:traits";this.off(n,this.initTraits),this.__loadTraits();var i=Be({},this.get("attributes")),l=this.traits;return l.each(function(f){if(!f.get("changeProp")){var d=f.get("name"),v=f.getInitValue();d&&v&&(i[d]=v)}}),l.length&&this.set("attributes",i),this.on(n,this.initTraits),t&&e&&e.trigger("component:toggled"),this},r.prototype.initScriptProps=function(){if(!this.opt.temporary){var t="script-props",e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],i=this.get(t)||[],l=n.map(function(d){return"change:".concat(d)}).join(" "),f=i.map(function(d){return"change:".concat(d)}).join(" ");l&&this.off(l,this.__scriptPropsChange),f&&this.on(f,this.__scriptPropsChange),this.on.apply(this,e)}},r.prototype.__scriptPropsChange=function(t,e,n){n===void 0&&(n={}),n.avoidStore||this.trigger("rerender")},r.prototype.append=function(t,e){e===void 0&&(e={});var n=((0,S.isArray)(t)?Zn([],t,!0):[t]).map(function(l){return(0,S.isString)(l)||l.collection&&l.collection.remove(l,{temporary:!0}),l}),i=this.components().add(n,e);return(0,S.isArray)(i)?i:[i]},r.prototype.components=function(t,e){e===void 0&&(e={});var n=this.get("components");return(0,S.isUndefined)(t)?n:(n.reset(void 0,e),t?this.append(t,e):[])},r.prototype.getChildAt=function(t){return this.components().at(t||0)||void 0},r.prototype.getLastChild=function(){var t=this.components();return t.at(t.length-1)||null},r.prototype.empty=function(t){return t===void 0&&(t={}),this.components().reset(void 0,t),this},r.prototype.parent=function(t){t===void 0&&(t={});var e=this.collection||t.prev&&this.prevColl;return e?e.parent:void 0},r.prototype.parents=function(){var t=this.parent();return t?[t].concat(t.parents()):[]},r.prototype.scriptUpdated=function(){this.set("scriptUpdated",1)},r.prototype.initToolbar=function(){var t=this.em,e=this,n=t&&t.getConfig().stylePrefix||"";if(!e.get("toolbar")&&t){var i=[];e.collection&&i.push({label:t.getIcon("arrowUp"),command:function(l){return l.runCommand("core:component-exit",{force:1})}}),e.get("draggable")&&i.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:t.getIcon("move"),command:"tlb-move"}),e.get("copyable")&&i.push({label:t.getIcon("copy"),command:"tlb-clone"}),e.get("removable")&&i.push({label:t.getIcon("delete"),command:"tlb-delete"}),e.set("toolbar",i)}},r.prototype.__loadTraits=function(t,e){e===void 0&&(e={});var n=t||this.traits;if(!(n instanceof $o)){n=(0,S.isFunction)(n)?n(this):n;var i=new $o([],this.opt);i.setTarget(this),n.length&&(n.forEach(function(l){return l.attributes&&delete l.attributes.value}),i.add(n)),this.set({traits:i},e)}return this},r.prototype.getTraits=function(){return this.__loadTraits(),Zn([],this.traits.models,!0)},r.prototype.setTraits=function(t){var e=(0,S.isArray)(t)?t:[t];return this.set({traits:e}),this.getTraits()},r.prototype.getTrait=function(t){return this.getTraits().filter(function(e){return e.get("id")===t||e.get("name")===t})[0]||null},r.prototype.updateTrait=function(t,e){var n,i=this.getTrait(t);return i&&i.set(e),(n=this.em)===null||n===void 0||n.trigger("component:toggled"),this},r.prototype.getTraitIndex=function(t){var e=this.getTrait(t);return e?this.traits.indexOf(e):-1},r.prototype.removeTrait=function(t){var e,n=this,i=((0,S.isArray)(t)?t:[t]).map(function(d){return n.getTrait(d)}),l=this.traits,f=i.length?l.remove(i):[];return(e=this.em)===null||e===void 0||e.trigger("component:toggled"),(0,S.isArray)(f)?f:[f]},r.prototype.addTrait=function(t,e){var n;e===void 0&&(e={}),this.__loadTraits();var i=this.traits.add(t,e);return(n=this.em)===null||n===void 0||n.trigger("component:toggled"),(0,S.isArray)(i)?i:[i]},r.prototype.normalizeClasses=function(t){var e=[],n=this.em,i=n==null?void 0:n.Selectors;return i?t.models?Zn([],t.models,!0):(t.forEach(function(l){return e.push(i.add(l))}),e):[]},r.prototype.clone=function(t){t===void 0&&(t={});var e=this.em,n=Be({},this.attributes),i=Be({},this.opt),l=this.getId(),f=e==null?void 0:e.Css;n.attributes=Be({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=!0),this.get("components").each(function(L,F){n.components[F]=L.clone(Be(Be({},t),{_inner:1}))}),this.get("traits").each(function(L,F){n.traits[F]=L.clone()}),this.get("classes").each(function(L,F){n.classes[F]=L.get("name")}),n.status="",i.collection=null;var d=new this.constructor(n,i),v="#".concat(d.getId());(f?f.getRules("#".concat(l)):[]).forEach(function(L){var F=L.clone();F.set("selectors",[v]),f.getAll().add(F)}),d.set(qn,0);var h=this.__getSymbol(),w=this.__getSymbols();t.symbol||!h&&!w?h?(h.set(qn,Zn(Zn([],h.__getSymbols(),!0),[d],!1)),d.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(qn,Zn(Zn([],w,!0),[d],!1)),d.set(mn,this),d.__initSymb()):t.symbolInv?(this.set(qn,[d]),d.set(mn,this),[this,d].map(function(L){return L.__initSymb()})):(d.set(qn,[this]),[this,d].map(function(L){return L.__initSymb()}),this.set(mn,d))):(d.set(mn,0),d.set(qn,0));var C="component:clone";return e&&e.trigger(C,d),this.trigger(C,d),d},r.prototype.getName=function(t){t===void 0&&(t={});var e=this.em,n=this.attributes,i=n.type,l=n.tagName,f=n.name,d=i||l,v=i?"":l,h="domComponents.names.",w=f&&(e==null?void 0:e.t("".concat(h).concat(f))),C=v&&(e==null?void 0:e.t("".concat(h).concat(v))),L=e&&(e.t("".concat(h).concat(i))||e.t("".concat(h).concat(l))),F=this.get("custom-name");return(t.noCustom?"":F)||w||f||C||(0,H.capitalize)(v)||L||(0,H.capitalize)(d)},r.prototype.getIcon=function(){var t=this.get("icon");return t?t+" ":""},r.prototype.toHTML=function(t){t===void 0&&(t={});var e=this,n=[],i=t.tag||e.get("tagName"),l=e.get("void"),f=t.attributes,d=this.getAttrToHTML();if(delete t.tag,f&&((0,S.isFunction)(f)?d=f(e,d)||{}:(0,H.isObject)(f)&&(d=f)),t.withProps){var v=this.toJSON();(0,S.forEach)(v,function(X,At){At[0]!=="_"&&["classes","attributes","components"].indexOf(At)<0&&(d["data-gjs-".concat(At)]=(0,S.isArray)(X)||(0,H.isObject)(X)?JSON.stringify(X):X)})}for(var h in d){var w=d[h];if(!(0,S.isUndefined)(w)&&w!==null)if((0,S.isBoolean)(w))w&&n.push(h);else{var C="";if(t.altQuoteAttr&&(0,S.isString)(w)&&w.indexOf('"')>=0)C="'".concat(w.replace(/'/g,"'"),"'");else{var L=(0,S.isString)(w)?w.replace(/"/g,"""):w;C='"'.concat(L,'"')}n.push("".concat(h,"=").concat(C))}}var F=n.length?" ".concat(n.join(" ")):"",q=e.getInnerHTML(t),et="<".concat(i).concat(F).concat(l?"/":"",">").concat(q);return!l&&(et+="")),et},r.prototype.getInnerHTML=function(t){return this.__innerHTML(t)},r.prototype.__innerHTML=function(t){t===void 0&&(t={});var e=this.components();return e.length?e.map(function(n){return n.toHTML(t)}).join(""):this.get("content")},r.prototype.getAttrToHTML=function(){var t=this.getAttributes();return delete t.style,t},r.prototype.toJSON=function(t){t===void 0&&(t={});var e=_t.Model.prototype.toJSON.call(this,t);if(e.attributes=this.getAttributes(),delete e.attributes.class,delete e.toolbar,delete e.traits,delete e.status,delete e.open,delete e._undoexc,!t.fromUndo){var n=e[mn],i=e[qn];i&&(0,S.isArray)(i)&&(e[qn]=i.filter(function(l){return l}).map(function(l){return l.getId?l.getId():l})),n&&!(0,S.isString)(n)&&(e[mn]=n.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(e),e},r.prototype.getChangedProps=function(t){var e=t||_t.Model.prototype.toJSON.apply(this),n=(0,S.result)(this,"defaults");return(0,S.forEach)(n,function(i,l){["type"].indexOf(l)===-1&&e[l]===i&&delete e[l]}),(0,S.isEmpty)(e.type)&&delete e.type,(0,S.forEach)(["attributes","style"],function(i){(0,S.isEmpty)(n[i])&&(0,S.isEmpty)(e[i])&&delete e[i]}),(0,S.forEach)(["classes","components"],function(i){(!e[i]||(0,S.isEmpty)(n[i])&&!e[i].length)&&delete e[i]}),e},r.prototype.getId=function(){return(this.get("attributes")||{}).id||this.ccid||this.cid},r.prototype.setId=function(t,e){var n=Be({},this.get("attributes"));return n.id=t,this.set("attributes",n,e),this},r.prototype.getEl=function(t){t===void 0&&(t=void 0);var e=this.getView(t);return e&&e.el},r.prototype.getView=function(t){var e=this.view,n=this.views;return t&&(e=n.filter(function(i){return i._getFrame()===t.view})[0]),e},r.prototype.getCurrentView=function(){var t=(this.em.get("currentFrame")||{}).model;return this.getView(t)},r.prototype.__getScriptProps=function(){var t=this.props();return(this.get("script-props")||[]).reduce(function(e,n){return e[n]=t[n],e},{})},r.prototype.getScriptString=function(t){var e=this,n=t||this.get("script")||"";if(!n)return n;if(this.get("script-props"))n=n.toString().trim();else{if(typeof n=="function"){var i=n.toString().trim();n=(i=i.replace(/^function[\s\w]*\(\)\s?\{/,"").replace(/\}$/,"")).trim()}var l=this.em.getConfig(),f=Bi(l.tagVarStart||"{[ "),d=Bi(l.tagVarEnd||" ]}"),v=new RegExp("".concat(f,"([\\w\\d-]*)").concat(d),"g");n=n.replace(v,function(h,w){e.scriptUpdated();var C=e.attributes[w]||"";return(0,S.isArray)(C)||typeof C=="object"?JSON.stringify(C):C})}return n},r.prototype.emitUpdate=function(t){for(var e,n=[],i=1;i=0&&this.__propSelfToParent({component:this,changed:(e={},e[t]=d,e),options:n[2]||n[1]||{}})},r.prototype.onAll=function(t){return(0,S.isFunction)(t)&&(t(this),this.components().forEach(function(e){return e.onAll(t)})),this},r.prototype.forEachChild=function(t){(0,S.isFunction)(t)&&this.components().forEach(function(e){t(e),e.forEachChild(t)})},r.prototype.remove=function(t){var e=this;t===void 0&&(t={});var n=this.em,i=this.collection,l=function(){i&&i.remove(e,Be(Be({},t),{action:"remove-component"})),i||(e.components("",t),e.components().removeChildren(e,void 0,t))},f=Be({},t);return[this,n].map(function(d){return d.trigger("component:remove:before",e,l,f)}),!f.abort&&l(),this},r.prototype.move=function(t,e){if(e===void 0&&(e={}),t){var n=e.at,i=this.index(),l=t===this.parent();l&&(i===n||i===n-1)||(l&&n&&n>i&&(e.at=n-1),this.remove({temporary:1}),t.append(this,e),this.emitUpdate())}return this},r.prototype.isInstanceOf=function(t){var e,n,i=(n=(e=this.em)===null||e===void 0?void 0:e.Components.getType(t))===null||n===void 0?void 0:n.model;return!!i&&this instanceof i},r.prototype.isChildOf=function(t){for(var e=(0,S.isString)(t),n=this.parent();n;){if(e){if(n.isInstanceOf(t))return!0}else if(n===t)return!0;n=n.parent()}return!1},r.prototype.resetId=function(t){var e=this.em,n=this.getId();if(!n)return this;var i=r.createId(this);this.setId(i);var l=e==null?void 0:e.Css.getIdRule(n),f=l==null?void 0:l.get("selectors").at(0);return f==null||f.set("name",i),this},r.prototype._getStyleRule=function(t){var e=(t===void 0?{}:t).id,n=this.em,i=e||this.getId();return n==null?void 0:n.Css.getIdRule(i)},r.prototype._getStyleSelector=function(t){var e=this._getStyleRule(t);return e==null?void 0:e.get("selectors").at(0)},r.prototype._idUpdated=function(t,e,n){if(n===void 0&&(n={}),!n.idUpdate){var i=this.ccid,l=(this.get("attributes")||{}).id,f=(this.previous("attributes")||{}).id||i,d=r.getList(this);if(d[l]||!l&&f)return this.setId(f,{idUpdate:!0});delete d[f],d[l]=this,this.ccid=l;var v=this._getStyleSelector({id:f});v&&v.set({name:l,label:l})}},r.getDefaults=function(){return(0,S.result)(this.prototype,"defaults")},r.isComponent=function(t){return{tagName:(0,H.toLowerCase)(t.tagName)}},r.ensureInList=function(t){var e=r.getList(t),n=t.getId(),i=e[n];if(i){if(i!==t){var l=r.getIncrementId(n,e);t.setId(l),e[l]=t}}else e[n]=t;t.components().forEach(function(f){return r.ensureInList(f)})},r.createId=function(t,e){e===void 0&&(e={});var n,i=r.getList(t),l=e.idMap,f=l===void 0?{}:l,d=t.get("attributes").id;return d?(n=r.getIncrementId(d,i,e),t.setId(n),d!==n&&(f[d]=n)):n=r.getNewId(i),i[n]=t,n},r.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),i="i".concat(n);t[i];)i=r.getNewId(t);return i},r.getIncrementId=function(t,e,n){n===void 0&&(n={});var i=n.keepIds,l=1,f=t;if((i===void 0?[]:i).indexOf(t)<0)for(;e[f];)l++,f="".concat(t,"-").concat(l);return f},r.getList=function(t){var e=t.opt,n=e===void 0?{}:e,i=n.domc,l=n.em,f=i||(l==null?void 0:l.Components);return f?f.componentsById:{}},r.checkId=function(t,e,n,i){e===void 0&&(e=[]),n===void 0&&(n={}),i===void 0&&(i={});var l=(0,S.isArray)(t)?t:[t],f=i.keepIds,d=f===void 0?[]:f;l.forEach(function(v){v.attributes;var h=v.attributes,w=h===void 0?{}:h,C=v.components,L=w.id;if(L&&n[L]&&d.indexOf(L)<0){var F=r.getIncrementId(L,n);w.id=F,(0,S.isArray)(e)&&e.forEach(function(q){var et=q.selectors;et.forEach(function(X,At){X==="#".concat(L)&&(et[At]="#".concat(F))})})}C&&r.checkId(C,e,n,i)})},r}(_r);const yn=Wi;var Or=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),$i=function(a){function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.compView=kn,t}return Or(r,a),r.prototype.initialize=function(t){this.opts=t||{},this.config=t.config||{},this.em=this.config.em;var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.resetChildren),this.listenTo(e,"remove",this.removeChildren)},r.prototype.removeChildren=function(t,e,n){var i=this;n===void 0&&(n={}),t.views.forEach(function(l){if(l){var f=l.childrenView,d=l.scriptContainer;f&&f.stopListening(),(0,Ne.L_)(d),l.remove.apply(l)}}),t.components().forEach(function(l){return i.removeChildren(l,e,n)})},r.prototype.addTo=function(t,e,n){n===void 0&&(n={});var i=this.em,l=this.collection.indexOf(t);if(this.addToCollection(t,null,l),i&&!n.temporary){var f=function(d){i.trigger("component:add",d),d.components().forEach(function(v){return f(v)})};f(t)}},r.prototype.addToCollection=function(t,e,n){for(var i=this,l=i.config,f=i.opts,d=i.em,v=e||null,h=l.frameView,w=(h==null?void 0:h.model)&&t.getView(h.model),C=f.componentTypes||(d==null?void 0:d.Components.getTypes()),L=t.get("type")||"default",F=this.compView,q=0;q=w.scrollTop&&h>=w.scrollLeft&&v<=w.scrollBottom&&h<=(f==null?void 0:f.offsetWidth)+l.scrollLeft},r.prototype.scrollIntoView=function(t){var e;t===void 0&&(t={});var n=this.getOffsetRect();if(!this.isInViewport({rect:n})||t.force){var i=this.el;t.behavior!=="smooth"?(e=i.ownerDocument.defaultView)===null||e===void 0||e.scrollTo(0,n.top):i.scrollIntoView(Nr({behavior:"smooth",block:"nearest"},t))}},r.prototype.reset=function(){var t=this.el;this.el="",this._ensureElement(),this._setData(),(0,Ne.dL)(t,this.el),this.render()},r.prototype._setData=function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})},r.prototype._getFrame=function(){var t;return(t=this.em)===null||t===void 0?void 0:t.get("Canvas").config.frameView},r.prototype.renderChildren=function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new gi({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),i=0,l=n.length;i=0},r}(yn);var ja=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Ma=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return ja(r,a),r}(kn);var qi=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Go=function(){return Go=Object.assign||function(a){for(var r,t=1,e=arguments.length;t `),fallback:" `),file:""})},enumerable:!1,configurable:!0}),r.prototype.initialize=function(t,e){a.prototype.initialize.call(this,t,e);var n=this.get("attributes").src;n&&(0,H.buildBase64UrlFromSvg)((0,S.result)(this,"defaults").src)!==n&&this.set("src",n,{silent:!0})},r.prototype.initToolbar=function(){a.prototype.initToolbar.call(this);var t=this.em;if(t){var e="image-editor";if(t.Commands.has(e)){for(var n=!1,i=this.get("toolbar"),l=0;l=0)&&delete n.editable})}return n},r}(Ao);const wp=bp;var Hc=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),es=function(){return es=Object.assign||function(a){for(var r,t=1,e=arguments.length;t0&&n[n.length-1])||h[0]!==6&&h[0]!==2)){l=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]")},r.isComponent=function(t){if(t.nodeType==8)return{tagName:"NULL",type:"comment",content:t.textContent}},r}(Js);var Ul=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Wa=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return Ul(r,a),r.prototype._setAttributes=function(){},r.prototype.renderAttributes=function(){},r.prototype.updateStatus=function(){},r.prototype.updateClasses=function(){},r.prototype.setAttribute=function(){},r.prototype.updateAttributes=function(){},r.prototype.initClasses=function(){},r.prototype.initComponents=function(){},r.prototype.delegateEvents=function(){return this},r.prototype._createElement=function(){return document.createTextNode("")},r.prototype.render=function(){var t=this.model,e=this.el;return t.opt.temporary||(e.textContent=t.get("content")),this},r}(kn);var ss=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Zs=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return ss(r,a),r.prototype._createElement=function(){return document.createComment(this.model.get("content"))},r}(Wa);var Op=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ci=function(){return Ci=Object.assign||function(a){for(var r,t=1,e=arguments.length;t-1;return zr(zr({},l),!w||C?{reason:2}:{result:!0})},r.prototype.allById=function(){return this.componentsById},r.prototype.getById=function(t){return this.componentsById[t]||null},r.prototype.destroy=function(){var t,e=this.allById();Object.keys(e).forEach(function(n){return e[n]&&e[n].remove()}),(t=this.componentView)===null||t===void 0||t.remove(),[this.em,this.componentsById,this.componentView].forEach(function(n){return{}})},r}(Dt);const Tp=Yc,Oi={stylePrefix:"css-",rules:[]};var Ti=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),kp=Number.MAX_VALUE,Pp=function(a){function r(){var t=a.call(this)||this;return(0,S.bindAll)(t,"sortRules"),t.compCls=[],t.ids=[],t}return Ti(r,a),r.prototype.buildFromModel=function(t,e){var n=this;e===void 0&&(e={});var i="",l=this.em,f=l&&l.getConfig().avoidInlineStyle,d=t.styleToString(),v=t.classes;return this.ids.push("#".concat(t.getId())),v.forEach(function(h){return n.compCls.push(h.getFullName())}),!f&&d&&(i="#".concat(t.getId(),"{").concat(d,"}")),t.components().forEach(function(h){return i+=n.buildFromModel(h,e)}),i},r.prototype.build=function(t,e){var n=this;e===void 0&&(e={});var i=e.json,l=e.em,f=e.cssc||(l==null?void 0:l.Css);this.em=l,this.compCls=[],this.ids=[],this.model=t;var d=[],v=t?this.buildFromModel(t,e):"",h=(0,S.isUndefined)(e.clearStyles)&&l?l.getConfig().clearStyles:e.clearStyles;if(f){var w=e.rules||f.getAll(),C={},L=[];e.onlyMatched&&t&&(0,H.hasWin)()&&(w=this.matchedRules(t,w)),w.forEach(function(F){var q=F.getAtRule();if(q){var et=C[q];et?et.push(F):C[q]=[F]}else{var X=n.buildFromRule(F,L,e);i?d.push(X):v+=X}}),this.sortMediaObject(C).forEach(function(F){var q="",et=F.key;F.value.forEach(function(X){var At=n.buildFromRule(X,L,e);X.get("singleAtRule")?v+="".concat(et,"{").concat(At,"}"):q+=At,i&&d.push(At)}),q&&(v+="".concat(et,"{").concat(q,"}"))}),l&&h&&w.remove&&w.remove(L)}return i?d.filter(function(F){return F}):v},r.prototype.buildFromRule=function(t,e,n){var i,l=this;n===void 0&&(n={});var f,d="",v=this.model,h=t.selectorsToString({skipAdd:1}),w=t.get("selectorsAdd"),C=t.get("singleAtRule");if((i=t.get("selectors"))===null||i===void 0||i.forEach(function(F){var q=F.getFullName();(l.compCls.indexOf(q)>=0||l.ids.indexOf(q)>=0||n.keepUnusedStyles)&&(f=1)}),h&&f||w||C||!v){var L=t.getDeclaration({body:1});L&&(n.json?d=t:d+=L)}else e.push(t);return d},r.prototype.matchedRules=function(t,e){var n=this,i=t.getEl(),l=[];return e.forEach(function(f){try{f.selectorsToString().split(",").some(function(d){return i==null?void 0:i.matches(n.__cleanSelector(d))})&&l.push(f)}catch{}}),t.components().forEach(function(f){l=l.concat(n.matchedRules(f,e))}),l=l.filter(function(f,d){return l.indexOf(f)===d})},r.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):kp},r.prototype.sortMediaObject=function(t){var e=this;t===void 0&&(t={});var n=[];return(0,S.each)(t,function(i,l){return n.push({key:l,value:i})}),n.sort(function(i,l){var f=[i.key,l.key].every(function(h){return h.indexOf("min-width")!==-1}),d=f?i.key:l.key,v=f?l.key:i.key;return e.getQueryLength(d)-e.getQueryLength(v)})},r.prototype.sortRules=function(t,e){var n=function(d){return d.get("mediaText")||""},i=[n(t),n(e)].every(function(d){return d.indexOf("min-width")!==-1}),l=n(i?t:e),f=n(i?e:t);return this.getQueryLength(l)-this.getQueryLength(f)},r.prototype.__cleanSelector=function(t){return t.split(" ").map(function(e){return e.split(":")[0]}).join(" ")},r}(k.Hn);const Ep=Pp;var Ap=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ra=function(){return ra=Object.assign||function(a){for(var r,t=1,e=arguments.length;t=0})},r.prototype.setIdRule=function(t,e,n){e===void 0&&(e={}),n===void 0&&(n={});var i=n.addOpts,l=i===void 0?{}:i,f=n.mediaText,d=n.state||"",v=(0,S.isUndefined)(f)?this.em.getCurrentMedia():f,h=this.em.Selectors.add({name:t,type:Jn.TYPE_ID},l),w=this.add(h,d,v,{},l);return w.setStyle(e,ki(ki({},n),l)),w},r.prototype.getIdRule=function(t,e){e===void 0&&(e={});var n=e.mediaText,i=e.state||"",l=(0,S.isUndefined)(n)?this.em.getCurrentMedia():n,f=this.em.Selectors.get(t,Jn.TYPE_ID);return f&&this.get(f,i,l)},r.prototype.setClassRule=function(t,e,n){e===void 0&&(e={}),n===void 0&&(n={});var i=n.state||"",l=n.mediaText||this.em.getCurrentMedia(),f=this.em.Selectors.add({name:t,type:Jn.TYPE_CLASS}),d=this.add(f,i,l);return d.setStyle(e,n),d},r.prototype.getClassRule=function(t,e){e===void 0&&(e={});var n=e.state||"",i=e.mediaText||this.em.getCurrentMedia(),l=this.em.Selectors.get(t,Jn.TYPE_CLASS);return l&&this.get(l,n,i)},r.prototype.remove=function(t,e){var n=(0,S.isString)(t)?this.getRules(t):t,i=this.getAll().remove(n,e);return(0,S.isArray)(i)?i:[i]},r.prototype.clear=function(t){return t===void 0&&(t={}),this.getAll().reset([],t),this},r.prototype.getComponentRules=function(t,e){e===void 0&&(e={});var n=e.state,i=e.mediaText;e.current&&(n=this.em.get("state")||"",i=this.em.getCurrentMedia());var l=t.getId();return this.getAll().filter(function(f){return!(!(0,S.isUndefined)(n)&&f.get("state")!==n)&&!(!(0,S.isUndefined)(i)&&f.get("mediaText")!==i)&&f.getSelectorsString()==="#".concat(l)})},r.prototype.render=function(){var t;return(t=this.rulesView)===null||t===void 0||t.remove(),this.rulesView=new Vo({collection:this.rules,config:this.config}),this.rulesView.render().el},r.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),(t=this.rulesView)===null||t===void 0||t.remove()},r}(Dt);const Bl=Dp,Xc={appendTo:"",blocks:[],appendOnClick:!1,custom:!1};var Wl=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Jc=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return Wl(r,a),r.prototype.defaults=function(){return{label:"",content:"",media:"",category:"",activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{}}},r.prototype.getId=function(){return this.id},r.prototype.getLabel=function(){return this.get("label")},r.prototype.getMedia=function(){return this.get("media")},r.prototype.getContent=function(){return this.get("content")},r.prototype.getCategoryLabel=function(){var t=this.get("category");return(0,S.isFunction)(t==null?void 0:t.get)?t.get("label"):t!=null&&t.label?t==null?void 0:t.label:t},r}(k.Hn);var $l=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),qa=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return $l(r,a),r}(k.FE);const oa=qa;qa.prototype.model=Jc;var Zc=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Ga=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return Zc(r,a),r.prototype.defaults=function(){return{id:"",label:"",open:!0,attributes:{}}},r}(k.Hn);var Qc=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),cs=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return Qc(r,a),r}(k.FE);const tu=cs;cs.prototype.model=Ga;var Ka=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Mo=function(a){function r(t,e){e===void 0&&(e={});var n=a.call(this,t)||this,i=n.model;return n.em=e.em,n.config=e,n.endDrag=n.endDrag.bind(n),n.ppfx=e.pStylePrefix||"",n.listenTo(i,"destroy remove",n.remove),n.listenTo(i,"change",n.render),n}return Ka(r,a),r.prototype.events=function(){return{click:"handleClick",mousedown:"startDrag",dragstart:"handleDragStart",drag:"handleDrag",dragend:"handleDragEnd"}},r.prototype.__getModule=function(){return this.em.Blocks},r.prototype.handleClick=function(t){var e=this,n=e.config,i=e.model,l=e.em,f=i.get("onClick")||n.appendOnClick;if(l.trigger("block:click",i,t),f){if((0,S.isFunction)(f))return f(i,l==null?void 0:l.getEditor(),{event:t});var d,v,h=n.getSorter(),w=i.get("content"),C=l.getSelected();if(h.setDropContent(w),C)if(h.validTarget(C.getEl(),w).valid)d=C;else{var L=C.parent();L&&h.validTarget(L.getEl(),w).valid&&(d=L,v=L.components().indexOf(C)+1)}if(!d){var F=l.getWrapper();h.validTarget(F.getEl(),w).valid&&(d=F)}var q=d&&d.append(w,{at:v})[0];q&&l.setSelected(q,{scroll:1})}},r.prototype.startDrag=function(t){var e=this,n=e.config,i=e.em,l=e.model,f=l.get("disable");if(t.button===0&&n.getSorter&&!this.el.draggable&&!f){i.refreshCanvas();var d=n.getSorter();d.__currentBlock=l,d.setDragHelper(this.el,t),d.setDropContent(this.model.get("content")),d.startSort(this.el),(0,H.on)(document,"mouseup",this.endDrag)}},r.prototype.handleDragStart=function(t){this.__getModule().__startDrag(this.model,t)},r.prototype.handleDrag=function(t){this.__getModule().__drag(t)},r.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},r.prototype.endDrag=function(){(0,H.off)(document,"mouseup",this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},r.prototype.render=function(){var t,e=this,n=e.em,i=e.el,l=e.$el,f=e.ppfx,d=e.model,v=d.get("disable"),h=d.get("attributes")||{},w=h.class||"",C="".concat(f,"block"),L=n&&n.t("blockManager.labels.".concat(d.id))||d.get("label"),F=d.get("render"),q=d.get("media"),et=v?"".concat(C,"--disable"):"".concat(f,"four-color-h");l.attr(h),i.className="".concat(w," ").concat(C," ").concat(f,"one-bg ").concat(et).trim(),i.innerHTML=` `.concat(q?'
').concat(q,"
"):"",`
').concat(L,`
`),i.title=h.title||((t=i.textContent)===null||t===void 0?void 0:t.trim()),i.setAttribute("draggable","".concat(!(!(0,H.hasDnd)(n)||v)));var X=F&&F({el:i,model:d,className:C,prefix:f});return X&&(i.innerHTML=X),this},r}(k.G7);const eu=Mo;var Np=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),nu=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},Ur=function(a){function r(t,e){var n=a.call(this,t)||this;n.config=e;var i=e.pStylePrefix||"";return n.em=e.em,n.pfx=i,n.caretR="fa fa-caret-right",n.caretD="fa fa-caret-down",n.iconClass="".concat(i,"caret-icon"),n.activeClass="".concat(i,"open"),n.className="".concat(i,"block-category"),n.listenTo(n.model,"change:open",n.updateVisibility),n.model.view=n,n}return Np(r,a),r.prototype.events=function(){return{"click [data-title]":"toggle"}},r.prototype.template=function(t){var e=t.pfx,n=t.label;return pt(Qr||(Qr=nu([`
`,`
`],[`
`,`
`])),e,e,n,e)},r.prototype.attributes=function(){return this.model.get("attributes")||{}},r.prototype.updateVisibility=function(){this.model.get("open")?this.open():this.close()},r.prototype.open=function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=""},r.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display="none"},r.prototype.toggle=function(){var t=this.model;t.set("open",!t.get("open"))},r.prototype.getIconEl=function(){return this.iconEl||(this.iconEl=this.el.querySelector(".".concat(this.iconClass))),this.iconEl},r.prototype.getBlocksEl=function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.pfx,"blocks-c"))),this.blocksEl},r.prototype.append=function(t){this.getBlocksEl().appendChild(t)},r.prototype.render=function(){var t=this,e=t.em,n=t.el,i=t.$el,l=t.model,f=t.pfx,d=e.t("blockManager.categories.".concat(l.id))||l.get("label");return n.innerHTML=this.template({pfx:f,label:d}),i.addClass(this.className),i.css({order:l.get("order")}),this.updateVisibility(),this},r}(k.G7);const tn=Ur;var Qr,Qo=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),co=function(){return co=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
`),this.collection.each(function(l){return t.add(l,n)}),this.append(n);var i="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(i),this.rendered=!0,this},r}(k.G7);const Ya=ru;var ou=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ti=function(){return ti=Object.assign||function(a){for(var r,t=1,e=arguments.length;t',iconSync:'',iconTagOn:'',iconTagOff:'',iconTagRemove:'',componentFirst:!1,custom:!1};var Fp=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Kl=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return Fp(r,a),r.prototype.defaults=function(){return{name:"",label:""}},r.prototype.getName=function(){return this.get("name")},r.prototype.getLabel=function(){return this.get("label")||this.getName()},r}(k.Hn);const Yl=Kl;Kl.prototype.idAttribute="name";var Vp=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Qa=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},Xl="contentEditable",Rp=function(a){function r(t){t===void 0&&(t={});var e=a.call(this,t)||this,n=t.config||{};return e.config=n,e.module=t.module,e.coll=t.coll||null,e.pfx=n.stylePrefix||"",e.ppfx=n.pStylePrefix||"",e.em=n.em,e.listenTo(e.model,"change:active",e.updateStatus),e}return Vp(r,a),r.prototype.template=function(){var t=this,e=t.pfx,n=t.model,i=t.config,l=n.get("label")||"";return pt(Jl||(Jl=Qa([` ',` $',` `],[` ',` $',` `])),e,e,e,l,e,e,i.iconTagRemove)},r.prototype.events=function(){return{"click [data-tag-remove]":"removeTag","click [data-tag-status]":"changeStatus","dblclick [data-tag-name]":"startEditTag","focusout [data-tag-name]":"endEditTag"}},r.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector("[data-tag-name]")),this.inputEl},r.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[Xl]="true",e.focus(),t==null||t.setEditing(!0)},r.prototype.endEditTag=function(){var t=this.model,e=this.em,n=this.getInputEl(),i=n.textContent||"",l=e==null?void 0:e.Selectors;n[Xl]="false",e==null||e.setEditing(!1),l&&l.rename(t,i)!==t&&(n.innerText=t.get("label"))},r.prototype.changeStatus=function(){var t=this.model;t.set("active",!t.get("active"))},r.prototype.removeTag=function(){this.module.removeSelected(this.model)},r.prototype.updateStatus=function(){var t=this,e=t.model,n=t.$el,i=t.config,l=i.iconTagOn,f=i.iconTagOff,d=n.find("[data-tag-status]");e.get("active")?(d.html(l),n.removeClass("opac50")):(d.html(f),n.addClass("opac50"))},r.prototype.render=function(){var t=this.pfx,e=this.ppfx;return this.$el.html(this.template()),this.$el.attr("class","".concat(t,"tag ").concat(e,"three-bg")),this.updateStatus(),this},r}(k.G7);const Hp=Rp;var Jl,us=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Pi=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},tl=function(a){function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;e.config=t.config||{},e.pfx=e.config.stylePrefix||"",e.ppfx=e.config.pStylePrefix||"",e.className=e.pfx+"tags",e.stateInputId=e.pfx+"states",e.stateInputC=e.pfx+"input-c",e.states=e.config.states||[];var n=e.config.em,i=e.collection;e.target=n;var l=n.Selectors;return e.module=l,e.em=n,e.componentChanged=(0,S.debounce)(e.componentChanged.bind(e),0),e.checkSync=(0,S.debounce)(e.checkSync.bind(e),0),e.listenTo(n,"component:toggled component:update:classes",e.componentChanged),e.listenTo(n,"styleManager:update",e.componentChanged),e.listenTo(n,"component:update:classes change:state",e.__handleStateChange),e.listenTo(n,"styleable:change change:device",e.checkSync),e.listenTo(i,"add",e.addNew),e.listenTo(i,"reset",e.renderClasses),e.listenTo(i,"remove",e.tagRemoved),e.listenTo(l.getAll(),l.events.state,(0,S.debounce)(function(){return e.renderStates()},0)),e.delegateEvents(),e}return us(r,a),r.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,i=t.iconSync,l=t.iconAdd,f=t.pfx,d=t.ppfx;return pt(el||(el=Pi(['
',`
$',`
',`:
`],['
',`
$',`
',`:
`])),f,f,f,f,n,f,f,f,d,d,d,f,d,d,f,d,f,f,f,f,f,l,f,f,i,f,f,e,f)},r.prototype.events=function(){return{"change [data-states]":"stateChanged","click [data-add]":"startNewTag","focusout [data-input]":"endNewTag","keyup [data-input]":"onInputKeyUp","click [data-sync-style]":"syncStyle"}},r.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),i=e.Css,l=this.getCommonSelectors({opts:{noDisabled:1}}),f=e.get("state"),d=e.getCurrentMedia(),v=[],h=i.get(l,f,d)||i.add(l,f,d);this.getTargets().forEach(function(w){var C=i.getIdRule(w.getId(),{state:f,mediaText:d});t=C.getStyle(),C.setStyle({}),v.push(C)}),t&&h.addStyle(t),e.trigger("component:toggled"),e.trigger("component:sync-style",{component:n,selectors:l,mediaText:d,rule:h,ruleComponents:v,state:f})},r.prototype.tagRemoved=function(t){this.updateStateVis()},r.prototype.addNew=function(t){this.addToClasses(t)},r.prototype.startNewTag=function(){var t,e;(t=this.$addBtn)===null||t===void 0||t.css({display:"none"}),(e=this.$input)===null||e===void 0||e.show().focus()},r.prototype.endNewTag=function(){var t,e;(t=this.$addBtn)===null||t===void 0||t.css({display:""}),(e=this.$input)===null||e===void 0||e.hide().val("")},r.prototype.onInputKeyUp=function(t){var e;t.keyCode===13?(t.preventDefault(),this.addNewTag((e=this.$input)===null||e===void 0?void 0:e.val())):t.keyCode===27&&this.endNewTag()},r.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},r.prototype.componentChanged=function(t){var e=(t===void 0?{}:t).targets;this.updateSelection(e)},r.prototype.updateSelection=function(t){var e=t||this.getTargets(),n=[];return(e=(0,S.isArray)(e)?e:[e])&&e.length&&(n=this.getCommonSelectors({targets:e}),this.checkSync({validSelectors:n})),this.collection.reset(n),this.updateStateVis(e),this.module.__trgCustom(),n},r.prototype.getCommonSelectors=function(t){var e=t===void 0?{}:t,n=e.targets,i=e.opts,l=i===void 0?{}:i,f=n||this.getTargets();return this.module.__getCommonSelectors(f,l)},r.prototype._commonSelectors=function(){for(var t,e=[],n=0;n',""],['',""])),i,t);else{var h=t==null?void 0:t.getSelectors();if(!h)return"";var w=h.getStyleable(),C=f.get("state"),L=t.getId?pt(cu||(cu=Pi(['',` #',""],['',` #',""])),i,t.getName(),i,t.getId()):"";e=(e=this.collection.getFullString(w))?pt(Ql||(Ql=Pi(['',""],['',""])),i,e):t.get("selectorsAdd")||L,e=v&&L?L:e,e+=C?pt(tr||(tr=Pi([':',""],[':',""])),i,C):"",e=d?d({result:e,state:C,target:t}):e}return e&&'').concat(e,"")},r.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set("state",n)},r.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},r.prototype.addToClasses=function(t,e){var n=e,i=this.getClasses(),l=new Hp({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(l):i.append(l),l},r.prototype.renderClasses=function(){var t=this,e=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each(function(i){return t.addToClasses(i,e)}),n.append(e)},r.prototype.getClasses=function(){return this.$el.find("[data-selectors]")},r.prototype.getStates=function(){if(!this.$states){var t=this.$el.find("[data-states]");this.$states=t[0]&&t}return this.$states},r.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},r.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t("selectorManager.emptyState"),i=t.getStates().map(function(f){var d=e.t("selectorManager.states.".concat(f.id))||f.getLabel()||f.id;return'")}).join(""),l=this.getStates();l&&l.html('").concat(i)),this.checkStates()},r.prototype.render=function(){var t=this,e=t.em,n=t.pfx,i=t.ppfx,l=t.config,f=t.$el,d=t.el,v=l.render,h={iconSync:l.iconSync,iconAdd:l.iconAdd,labelHead:e.t("selectorManager.label"),labelInfo:e.t("selectorManager.selected"),ppfx:i,pfx:n,el:d};f.html(this.template(h));var w=v&&v(h);return w&&w!==d&&f.empty().append(w),this.$input=f.find("[data-input]"),this.$addBtn=f.find("[data-add]"),this.$classes=f.find("#"+n+"tags-c"),this.$btnSyncEl=f.find("[data-sync-style]"),this.$input.hide(),this.renderStates(),this.renderClasses(),f.attr("class","".concat(this.className," ").concat(i,"one-bg ").concat(i,"two-color")),this},r}(k.G7);const lu=tl;var el,Zl,cu,Ql,tr,nl=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ps=function(){return ps=Object.assign||function(a){for(var r,t=1,e=arguments.length;t=0}):e.slice(1).reduce(function(i,l){return t.__common(i,l)},e[0]):[]},r.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},r}(Dt);const ds=zp,du={textTags:["br","b","i","u","a","ul","ol"],parserCss:void 0,parserHtml:void 0,optionsHtml:{htmlType:"text/html",allowScripts:!1,allowUnsafeAttr:!1,keepEmptyTextNodes:!1}};var aa={4:"media",5:"font-face",6:"page",7:"keyframes",11:"counter-style",12:"supports",13:"document",14:"font-feature-values",15:"viewport"},hu=(0,S.keys)(aa),la=["5","6","11","15"],ca=["font-face","page","counter-style","viewport"],hs=function(a){a===void 0&&(a="");for(var r=[],t=[],e=a.split(","),n=0,i=e.length;n=0&&(e.singleAtRule=!0),d&&(e.atRuleType=d),v&&(e.selectorsAdd=v),h&&(e.mediaText=h),f&&(a[n-1]=l[0],e.state=f,l.splice(l.length-1,1)),e.selectors=a,e.style=r,e},oc=function(a){for(var r=[],t=a.cssRules||[],e=0,n=t.length;e=0;if(w)f=!0,d=aa[l],v=nc(i);else if(hu.indexOf(l)>=0){var C=oc(i);v=nc(i);for(var L=0,F=C.length;L0&&n[n.length-1])||h[0]!==6&&h[0]!==2)){l=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]0&&n[n.length-1])||h[0]!==6&&h[0]!==2)){l=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]0&&n[n.length-1])||h[0]!==6&&h[0]!==2)){l=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]').concat(n,"")},r.prototype.templateInput=function(t){var e=this.clsField;return'
')},r.prototype.getClbOpts=function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},r.prototype.removeView=function(){this.remove(),this.removed()},r.prototype.init=function(){},r.prototype.removed=function(){},r.prototype.onRender=function(t){},r.prototype.onUpdate=function(t){},r.prototype.onEvent=function(t){},r.prototype.onChange=function(t){var e=this.getInputElem();e&&!(0,S.isUndefined)(e.value)&&this.model.set("value",e.value),this.onEvent(ys(ys({},this.getClbOpts()),{event:t}))},r.prototype.getValueForTarget=function(){return this.model.get("value")},r.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.value=t)},r.prototype.onValueChange=function(t,e,n){if(n===void 0&&(n={}),n.fromTarget)this.setInputValue(t.get("value")),this.postUpdate();else{var i=this.getValueForTarget();t.setTargetValue(i,n)}},r.prototype.renderLabel=function(){var t=this.$el,e=this.target,n=this.getLabel(),i=this.templateLabel(e);this.createLabel&&(i=this.createLabel({label:n,component:e,trait:this})||""),t.find("[data-label]").append(i)},r.prototype.getLabel=function(){var t=this.em,e=this.model.attributes,n=e.label,i=e.name;return t.t("traitManager.traits.labels.".concat(i))||(0,H.capitalize)(n||i).replace(/-/g," ")},r.prototype.getComponent=function(){return this.target},r.prototype.getInputEl=function(){if(!this.$input){var t=this.em,e=this.model,n=e,i=e.attributes.name,l=n.get("placeholder")||n.get("default")||"",f=n.get("type")||"text",d=n.get("min"),v=n.get("max"),h=this.getModelValue(),w=(0,W.default)('')),C=t.t("traitManager.traits.attributes.".concat(i))||{};w.attr(ys({placeholder:l},C)),(0,S.isUndefined)(h)||(n.set({value:h},{silent:!0}),w.prop("value",h)),d&&w.prop("min",d),v&&w.prop("max",v),this.$input=w}return this.$input.get(0)},r.prototype.getInputElem=function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()},r.prototype.getModelValue=function(){var t,e=this.model,n=this.target,i=e.getName();if(e.get("changeProp"))t=n.get(i);else{var l=n.get("attributes");t=e.get("value")||l[i]}return(0,S.isUndefined)(t)?"":t},r.prototype.getElInput=function(){return this.elInput},r.prototype.renderField=function(){var t=this,e=t.$el,n=t.appendInput,i=t.model,l=e.find("[data-input]"),f=l[l.length-1],d=i.el;d||(d=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,S.isString)(d)?(f.innerHTML=d,this.elInput=f.firstChild):(n?f.appendChild(d):f.insertBefore(d,f.firstChild),this.elInput=d),i.el=this.elInput},r.prototype.hasLabel=function(){var t=this.model.attributes.label;return!this.noLabel&&t!==!1},r.prototype.rerender=function(){delete this.model.el,this.render()},r.prototype.postUpdate=function(){this.onUpdate(this.getClbOpts())},r.prototype.render=function(){var t=this,e=t.$el,n=t.pfx,i=t.ppfx,l=t.model.attributes,f=l.type,d=l.id,v=this.hasLabel&&this.hasLabel(),h="".concat(n,"trait");delete this.$input;var w='
`).concat(v?'
'):"",`
`).concat(this.templateInput?(0,S.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:"",`
`);return e.empty().append(w),v&&this.renderLabel(),this.renderField(),this.el.className="".concat(h,"__wrp ").concat(h,"__wrp-").concat(d),this.postUpdate(),this.onRender(this.getClbOpts()),this},r}(k.G7);const Io=lc;lc.prototype.eventCapture=["change"];var cc=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),uc=function(a){function r(t,e){t===void 0&&(t={});var n=a.call(this,t)||this;n.reuseView=!0,n.itemsView=e;var i=t.config||{},l=i.stylePrefix||"",f=t.editor;return n.config=i,n.em=f,n.pfx=l,n.ppfx=i.pStylePrefix||"",n.className="".concat(l,"traits"),n.listenTo(f,"component:toggled",n.updatedCollection),n.updatedCollection(),n}return cc(r,a),r.prototype.updatedCollection=function(){var t=this,e=t.ppfx,n=t.className,i=t.em.getSelected();this.el.className="".concat(n," ").concat(e,"one-bg ").concat(e,"two-color"),this.collection=i?i.traits:[],this.render()},r}(Gp.Z);const Eu=uc;uc.prototype.itemView=Io;var Au=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const ju=function(a){function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;return e.listenTo(e.model,"change:options",e.rerender),e}return Au(r,a),r.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return'
`)},r.prototype.getInputEl=function(){if(!this.$input){var t=this.model,e=this.em,n=t.get("name"),i=t.get("options")||[],l=[],f="",this.$input=(0,W.default)(f);var d=t.getTargetValue(),v=l.indexOf(d)>=0?d:t.get("default");!(0,S.isUndefined)(v)&&this.$input.val(v)}return this.$input.get(0)},r}(Io);var ga=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const va=function(a){function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.appendInput=!1,t}return ga(r,a),r.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return'`)},r.prototype.onChange=function(){this.model.set("value",this.getInputElem().checked)},r.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.checked=!!t)},r.prototype.getInputEl=function(){for(var t=[],e=0;e')},r.prototype.inputClass=function(){return"".concat(this.ppfx,"field")},r.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},r.prototype.elementUpdated=function(){this.model.trigger("el:change")},r.prototype.setValue=function(t,e){var n=this.model,i=t||n.get("defaults"),l=this.getInputEl();l&&(l.value=i)},r.prototype.handleModelChange=function(t,e,n){this.setValue(e,n)},r.prototype.handleChange=function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()},r.prototype.__onInputChange=function(t){this.model.set({value:t},{fromInput:1})},r.prototype.getInputEl=function(){if(!this.inputEl){var t=this.model,e=this.opts.type||"text",n=t.get("placeholder")||t.get("defaults")||t.get("default")||"";this.inputEl=(0,W.default)(''))}return this.inputEl.get(0)},r.prototype.render=function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this},r}(k.G7);const pl=ul;ul.prototype.events={change:"handleChange"};var Mu=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Lu=function(a){function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;return(0,S.bindAll)(e,"moveIncrement","upIncrement"),e.doc=document,e.listenTo(e.model,"change:unit",e.handleModelChange),e}return Mu(r,a),r.prototype.template=function(){var t=this.ppfx;return`
`)},r.prototype.inputClass=function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")},r.prototype.setValue=function(t,e){var n=e||{},i=this.validateInputValue(t,{deepCheck:1}),l={value:i.value,unit:""};(i.unit||i.force)&&(l.unit=i.unit),this.model.set(l,n),n.silent&&this.handleModelChange()},r.prototype.handleChange=function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},r.prototype.handleUnitChange=function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set("unit",e),this.elementUpdated()},r.prototype.handleKeyDown=function(t){t.key==="ArrowUp"&&(t.preventDefault(),this.upArrowClick()),t.key==="ArrowDown"&&(t.preventDefault(),this.downArrowClick())},r.prototype.elementUpdated=function(){this.model.trigger("el:change")},r.prototype.handleModelChange=function(){var t=this.model;this.getInputEl().value=t.get("value");var e=this.getUnitEl();e&&(e.value=t.get("unit")||"")},r.prototype.getUnitEl=function(){if(!this.unitEl){var t=this.model,e=t.get("units")||[];if(e.length){var n=[''];e.forEach(function(l){var f=l==t.get("unit")?"selected":"";n.push(""))});var i=document.createElement("div");i.innerHTML='"),this.unitEl=i.firstChild}}return this.unitEl},r.prototype.upArrowClick=function(){var t=this.model,e=t.get("step"),n=parseFloat(t.get("value"));this.setValue(this.normalizeValue(n+e)),this.elementUpdated()},r.prototype.downArrowClick=function(){var t=this.model,e=t.get("step"),n=parseFloat(t.get("value"));this.setValue(this.normalizeValue(n-e)),this.elementUpdated()},r.prototype.downIncrement=function(t){t.preventDefault(),this.moved=!1;var e=this.model.get("value")||0;e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,H.on)(this.doc,"mousemove",this.moveIncrement),(0,H.on)(this.doc,"mouseup",this.upIncrement)},r.prototype.moveIncrement=function(t){this.moved=!0;var e=this.model,n=e.get("step"),i=this.current,l=this.normalizeValue(i.val+(i.y-t.pageY)*n),f=this.validateInputValue(l),d=f.value,v=f.unit;return this.prValue=d,e.set({value:d,unit:v},{avoidStore:1}),!1},r.prototype.upIncrement=function(){var t=this.model,e=t.get("step");if((0,H.off)(this.doc,"mouseup",this.upIncrement),(0,H.off)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set("value",n,{avoidStore:1}).set("value",n+e),this.elementUpdated()}},r.prototype.normalizeValue=function(t,e){e===void 0&&(e=0);var n=this.model.get("step"),i=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var l=n.toString().split(".")[1];i=l?l.length:0}return i?parseFloat(t.toFixed(i)):t},r.prototype.validateInputValue=function(t,e){e===void 0&&(e={});var n=0,i=e||{},l=this.model,f="",d=(0,S.isUndefined)(t)?f:t,v=e.units||l.get("units")||[],h=l.get("unit")||v.length&&v[0]||"",w=(0,S.isUndefined)(e.max)?l.get("max"):e.max,C=(0,S.isUndefined)(e.min)?l.get("min"):e.min,L=!!l.get("limitlessMax"),F=!!l.get("limitlessMin");if(i.deepCheck){var q=l.get("fixedValues")||[];if(d===""&&(h=""),d){var et=new RegExp("^"+q.join("|"),"g");if(q.length&&et.test(d))d=d.match(et)[0],h="",n=1;else{var X=d+"";d+="",d=parseFloat(d.replace(",",".")),d=isNaN(d)?f:d;var At=X.replace(d,"");(0,S.indexOf)(v,At)>=0&&(h=At)}}}return L||(0,S.isUndefined)(w)||w===""||(d=d>w?w:d),F||(0,S.isUndefined)(C)||C===""||(d=d","
","
▼
",""].join(""),f=function(){var ct="";if(n)for(var St=1;St<=6;St++)ct+="
";return["
","
","
","
","","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
","
",ct,"
","
","
","
","
","","
","
","
","","","
","
","
"].join("")}(),d="spectrum.id";a.fn.spectrum=function(ct,St){if(typeof ct=="string"){var Pt=this,Ut=Array.prototype.slice.call(arguments,1);return this.each(function(){var ue=e[a(this).data(d)];if(ue){var Vt=ue[ct];if(!Vt)throw new Error("Spectrum: no such method: '"+ct+"'");ct=="get"?Pt=ue.get():ct=="container"?Pt=ue.container:ct=="option"?Pt=ue.option.apply(ue,Ut):ct=="destroy"?(ue.destroy(),a(this).removeData(d)):Vt.apply(ue,Ut)}}),Pt}return this.spectrum("destroy").each(function(){var ue=dn(this,a.extend({},ct,a(this).data()));a(this).data(d,ue.id)})},a.fn.spectrum.load=!0,a.fn.spectrum.loadOpts={},a.fn.spectrum.draggable=no,a.fn.spectrum.defaults=t,a.fn.spectrum.inputTypeColorSupport=function ct(){if(ct._cachedResult===void 0){var St=a("")[0];ct._cachedResult=St.type==="color"&&St.value!==""}return ct._cachedResult},a.spectrum={},a.spectrum.localization={},a.spectrum.palettes={},a.fn.spectrum.processNativeColorInputs=function(){var ct=a("input[type=color]");ct.length&&!Kr()&&ct.spectrum({preferredFormat:"hex6"})};var v=/^[\s,#]+/,h=/\s+$/,w=0,C=Math,L=C.round,F=C.min,q=C.max,et=C.random,X=function(ct,St){if(St=St||{},(ct=ct||"")instanceof X)return ct;if(!(this instanceof X))return new X(ct,St);var Pt=function(Ut){var ue={r:0,g:0,b:0},Vt=1,Ue=!1,en=!1;typeof Ut=="string"&&(Ut=function(nn){nn=nn.replace(v,"").replace(h,"").toLowerCase();var we,on=!1;if(se[nn])nn=se[nn],on=!0;else if(nn=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(we=Ie.rgb.exec(nn))?{r:we[1],g:we[2],b:we[3]}:(we=Ie.rgba.exec(nn))?{r:we[1],g:we[2],b:we[3],a:we[4]}:(we=Ie.hsl.exec(nn))?{h:we[1],s:we[2],l:we[3]}:(we=Ie.hsla.exec(nn))?{h:we[1],s:we[2],l:we[3],a:we[4]}:(we=Ie.hsv.exec(nn))?{h:we[1],s:we[2],v:we[3]}:(we=Ie.hsva.exec(nn))?{h:we[1],s:we[2],v:we[3],a:we[4]}:(we=Ie.hex8.exec(nn))?{a:Tm(we[1]),r:si(we[2]),g:si(we[3]),b:si(we[4]),format:on?"name":"hex8"}:(we=Ie.hex6.exec(nn))?{r:si(we[1]),g:si(we[2]),b:si(we[3]),format:on?"name":"hex"}:(we=Ie.hex3.exec(nn))?{r:si(we[1]+""+we[1]),g:si(we[2]+""+we[2]),b:si(we[3]+""+we[3]),format:on?"name":"hex"}:!1}(Ut)),typeof Ut=="object"&&(Ut.hasOwnProperty("r")&&Ut.hasOwnProperty("g")&&Ut.hasOwnProperty("b")?(Ze=Ut.r,go=Ut.g,cr=Ut.b,ue={r:255*Mn(Ze,255),g:255*Mn(go,255),b:255*Mn(cr,255)},Ue=!0,en=String(Ut.r).substr(-1)==="%"?"prgb":"rgb"):Ut.hasOwnProperty("h")&&Ut.hasOwnProperty("s")&&Ut.hasOwnProperty("v")?(Ut.s=Ec(Ut.s),Ut.v=Ec(Ut.v),ue=function(nn,we,on){nn=6*Mn(nn,360),we=Mn(we,100),on=Mn(on,100);var un=C.floor(nn),er=nn-un,Un=on*(1-we),yr=on*(1-er*we),Yr=on*(1-(1-er)*we),vo=un%6,ai=[on,yr,Un,Un,Yr,on][vo],ks=[Yr,on,on,yr,Un,Un][vo],br=[Un,Un,Yr,on,on,yr][vo];return{r:255*ai,g:255*ks,b:255*br}}(Ut.h,Ut.s,Ut.v),Ue=!0,en="hsv"):Ut.hasOwnProperty("h")&&Ut.hasOwnProperty("s")&&Ut.hasOwnProperty("l")&&(Ut.s=Ec(Ut.s),Ut.l=Ec(Ut.l),ue=function(nn,we,on){var un,er,Un;function yr(ai,ks,br){return br<0&&(br+=1),br>1&&(br-=1),br<1/6?ai+6*(ks-ai)*br:br<1/2?ks:br<2/3?ai+(ks-ai)*(2/3-br)*6:ai}if(nn=Mn(nn,360),we=Mn(we,100),on=Mn(on,100),we===0)un=er=Un=on;else{var Yr=on<.5?on*(1+we):on+we-on*we,vo=2*on-Yr;un=yr(vo,Yr,nn+1/3),er=yr(vo,Yr,nn),Un=yr(vo,Yr,nn-1/3)}return{r:255*un,g:255*er,b:255*Un}}(Ut.h,Ut.s,Ut.l),Ue=!0,en="hsl"),Ut.hasOwnProperty("a")&&(Vt=Ut.a));var Ze,go,cr;return Vt=Dd(Vt),{ok:Ue,format:Ut.format||en,r:F(255,q(ue.r,0)),g:F(255,q(ue.g,0)),b:F(255,q(ue.b,0)),a:Vt}}(ct);this._originalInput=ct,this._r=Pt.r,this._g=Pt.g,this._b=Pt.b,this._a=Pt.a,this._roundA=L(100*this._a)/100,this._format=St.format||Pt.format,this._gradientType=St.gradientType,this._r<1&&(this._r=L(this._r)),this._g<1&&(this._g=L(this._g)),this._b<1&&(this._b=L(this._b)),this._ok=Pt.ok,this._tc_id=w++};X.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ct=this.toRgb();return(299*ct.r+587*ct.g+114*ct.b)/1e3},setAlpha:function(ct){return this._a=Dd(ct),this._roundA=L(100*this._a)/100,this},toHsv:function(){var ct=Vi(this._r,this._g,this._b);return{h:360*ct.h,s:ct.s,v:ct.v,a:this._a}},toHsvString:function(){var ct=Vi(this._r,this._g,this._b),St=L(360*ct.h),Pt=L(100*ct.s),Ut=L(100*ct.v);return this._a==1?"hsv("+St+", "+Pt+"%, "+Ut+"%)":"hsva("+St+", "+Pt+"%, "+Ut+"%, "+this._roundA+")"},toHsl:function(){var ct=ii(this._r,this._g,this._b);return{h:360*ct.h,s:ct.s,l:ct.l,a:this._a}},toHslString:function(){var ct=ii(this._r,this._g,this._b),St=L(360*ct.h),Pt=L(100*ct.s),Ut=L(100*ct.l);return this._a==1?"hsl("+St+", "+Pt+"%, "+Ut+"%)":"hsla("+St+", "+Pt+"%, "+Ut+"%, "+this._roundA+")"},toHex:function(ct){return Ca(this._r,this._g,this._b,ct)},toHexString:function(ct){return"#"+this.toHex(ct)},toHex8:function(){return Ld(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:L(this._r),g:L(this._g),b:L(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+L(this._r)+", "+L(this._g)+", "+L(this._b)+")":"rgba("+L(this._r)+", "+L(this._g)+", "+L(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:L(100*Mn(this._r,255))+"%",g:L(100*Mn(this._g,255))+"%",b:L(100*Mn(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+L(100*Mn(this._r,255))+"%, "+L(100*Mn(this._g,255))+"%, "+L(100*Mn(this._b,255))+"%)":"rgba("+L(100*Mn(this._r,255))+"%, "+L(100*Mn(this._g,255))+"%, "+L(100*Mn(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(Me[Ca(this._r,this._g,this._b,!0)]||!1)},toFilter:function(ct){var St="#"+Ld(this._r,this._g,this._b,this._a),Pt=St,Ut=this._gradientType?"GradientType = 1, ":"";return ct&&(Pt=X(ct).toHex8String()),"progid:DXImageTransform.Microsoft.gradient("+Ut+"startColorstr="+St+",endColorstr="+Pt+")"},toString:function(ct){var St=!!ct;ct=ct||this._format;var Pt=!1,Ut=this._a<1&&this._a>=0;return St||!Ut||ct!=="hex"&&ct!=="hex6"&&ct!=="hex3"&&ct!=="name"?(ct==="rgb"&&(Pt=this.toRgbString()),ct==="prgb"&&(Pt=this.toPercentageRgbString()),ct!=="hex"&&ct!=="hex6"||(Pt=this.toHexString()),ct==="hex3"&&(Pt=this.toHexString(!0)),ct==="hex8"&&(Pt=this.toHex8String()),ct==="name"&&(Pt=this.toName()),ct==="hsl"&&(Pt=this.toHslString()),ct==="hsv"&&(Pt=this.toHsvString()),Pt||this.toHexString()):ct==="name"&&this._a===0?this.toName():this.toRgbString()},_applyModification:function(ct,St){var Pt=ct.apply(null,[this].concat([].slice.call(St)));return this._r=Pt._r,this._g=Pt._g,this._b=Pt._b,this.setAlpha(Pt._a),this},lighten:function(){return this._applyModification(vm,arguments)},brighten:function(){return this._applyModification(mm,arguments)},darken:function(){return this._applyModification(ym,arguments)},desaturate:function(){return this._applyModification(dm,arguments)},saturate:function(){return this._applyModification(hm,arguments)},greyscale:function(){return this._applyModification(gm,arguments)},spin:function(){return this._applyModification(bm,arguments)},_applyCombination:function(ct,St){return ct.apply(null,[this].concat([].slice.call(St)))},analogous:function(){return this._applyCombination(Sm,arguments)},complement:function(){return this._applyCombination(wm,arguments)},monochromatic:function(){return this._applyCombination(Om,arguments)},splitcomplement:function(){return this._applyCombination(Cm,arguments)},triad:function(){return this._applyCombination(_m,arguments)},tetrad:function(){return this._applyCombination(xm,arguments)}},X.fromRatio=function(ct,St){if(typeof ct=="object"){var Pt={};for(var Ut in ct)ct.hasOwnProperty(Ut)&&(Pt[Ut]=Ut==="a"?ct[Ut]:Ec(ct[Ut]));ct=Pt}return X(ct,St)},X.equals=function(ct,St){return!(!ct||!St)&&X(ct).toRgbString()==X(St).toRgbString()},X.random=function(){return X.fromRatio({r:et(),g:et(),b:et()})},X.mix=function(ct,St,Pt){Pt=Pt===0?0:Pt||50;var Ut,ue=X(ct).toRgb(),Vt=X(St).toRgb(),Ue=Pt/100,en=2*Ue-1,Ze=Vt.a-ue.a,go=1-(Ut=((Ut=en*Ze==-1?en:(en+Ze)/(1+en*Ze))+1)/2),cr={r:Vt.r*Ut+ue.r*go,g:Vt.g*Ut+ue.g*go,b:Vt.b*Ut+ue.b*go,a:Vt.a*Ue+ue.a*(1-Ue)};return X(cr)},X.readability=function(ct,St){var Pt=X(ct),Ut=X(St),ue=Pt.toRgb(),Vt=Ut.toRgb(),Ue=Pt.getBrightness(),en=Ut.getBrightness(),Ze=Math.max(ue.r,Vt.r)-Math.min(ue.r,Vt.r)+Math.max(ue.g,Vt.g)-Math.min(ue.g,Vt.g)+Math.max(ue.b,Vt.b)-Math.min(ue.b,Vt.b);return{brightness:Math.abs(Ue-en),color:Ze}},X.isReadable=function(ct,St){var Pt=X.readability(ct,St);return Pt.brightness>125&&Pt.color>500},X.mostReadable=function(ct,St){for(var Pt=null,Ut=0,ue=!1,Vt=0;Vt125&&Ue.color>500,Ze=3*(Ue.brightness/125)+Ue.color/500;(en&&!ue||en&&ue&&Ze>Ut||!en&&!ue&&Ze>Ut)&&(ue=en,Ut=Ze,Pt=X(St[Vt]))}return Pt};var At,It,ie,se=X.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Me=X.hexNames=function(ct){var St={};for(var Pt in ct)ct.hasOwnProperty(Pt)&&(St[ct[Pt]]=Pt);return St}(se),Ie=(It="[\\s|\\(]+("+(At="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+At+")[,|\\s]+("+At+")\\s*\\)?",ie="[\\s|\\(]+("+At+")[,|\\s]+("+At+")[,|\\s]+("+At+")[,|\\s]+("+At+")\\s*\\)?",{rgb:new RegExp("rgb"+It),rgba:new RegExp("rgba"+ie),hsl:new RegExp("hsl"+It),hsla:new RegExp("hsla"+ie),hsv:new RegExp("hsv"+It),hsva:new RegExp("hsva"+ie),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=X,a(function(){a.fn.spectrum.load&&a.fn.spectrum.processNativeColorInputs()})}function Je(ct,St,Pt,Ut){for(var ue=[],Vt=0;Vt')}else ue.push(a("
").append(a('').attr("title",Ut.noColorSelectedText)).html())}return"
"+ue.join("")+"
"}function dn(ct,St){var Pt,Ut,ue,Vt=function(Pe,Ee){var Fe=a.extend({},t,Pe);return Fe.callbacks={move:Gr(Fe.move,Ee),change:Gr(Fe.change,Ee),show:Gr(Fe.show,Ee),hide:Gr(Fe.hide,Ee),beforeShow:Gr(Fe.beforeShow,Ee)},Fe}(St,ct),Ue=Vt.flat,en=Vt.showSelectionPalette,Ze=Vt.localStorageKey,go=Vt.theme,cr=Vt.callbacks,nn=(Pt=Pa,Ut=10,function(){var Pe=this,Ee=arguments,Fe=function(){ue=null,Pt.apply(Pe,Ee)};ue||(ue=setTimeout(Fe,Ut))}),we=!1,on=!1,un=!0,er=0,Un=0,yr=0,Yr=0,vo=0,ai=0,ks=0,br=0,Ac=0,jc=0,li=1,cp=[],Mc=[],up={},ci=Vt.selectionPalette.slice(0),km=Vt.maxSelectionSize,Nd="sp-dragging",Ps=null,Lc=ct.ownerDocument,nr=(Lc.body,a(ct)),Af=!1,Ge=a(f,Lc).addClass(go),Pm=Ge.find(".sp-picker-container"),pp=Ge.find(".sp-color"),fp=Ge.find(".sp-dragger"),jf=Ge.find(".sp-hue"),dp=Ge.find(".sp-slider"),Dc=Ge.find(".sp-alpha-inner"),Id=Ge.find(".sp-alpha"),hp=Ge.find(".sp-alpha-handle"),ui=Ge.find(".sp-input"),Fd=Ge.find(".sp-palette"),Vd=Ge.find(".sp-initial"),Rd=Ge.find(".sp-cancel"),Mf=Ge.find(".sp-clear"),Hd=Ge.find(".sp-choose"),Lf=Ge.find(".sp-palette-toggle"),gp=nr.is("input"),Em=gp&&nr.attr("type")==="color"&&Kr(),Df=gp&&!Ue,Cl=Df?a(l).addClass(go).addClass(Vt.className).addClass(Vt.replacerClassName):a([]),Nc=Df?Cl:nr,Sl=Cl.find(".sp-preview-inner"),Ic=Vt.color||gp&&nr.val(),Ol=!1,Tl=Vt.preferredFormat,Am=!Vt.showButtons||Vt.clickoutFiresChange,Es=!Ic,Oa=Vt.allowEmpty&&!Em;function Nf(){if(Vt.showPaletteOnly&&(Vt.showPalette=!0),Lf.text(Vt.showPaletteOnly?Vt.togglePaletteMoreText:Vt.togglePaletteLessText),Vt.palette){cp=Vt.palette.slice(0),Mc=a.isArray(cp[0])?cp:[cp],up={};for(var Pe=0;Pe1&&(delete window.localStorage[Ze],a.each(Pe,function(Ee,Fe){If(Fe)}))}catch{}try{ci=window.localStorage[Ze].split(";")}catch{}}}function If(Pe){if(en){var Ee=X(Pe).toRgbString();if(!up[Ee]&&a.inArray(Ee,ci)===-1)for(ci.push(Ee);ci.length>km;)ci.shift();if(Ze&&window.localStorage)try{window.localStorage[Ze]=ci.join(";")}catch{}}}function Ud(){var Pe=Xr(),Ee=a.map(Mc,function(Fe,Le){return Je(Fe,Pe,"sp-palette-row sp-palette-row-"+Le,Vt)});zd(),ci&&Ee.push(Je(function(){var Fe=[];if(Vt.showPalette)for(var Le=0;LeUf&&Uf>Le?Math.abs(Ri.left+Le-Uf):0),Ri.top-=Math.min(Ri.top,Ri.top+wr>Xd&&Xd>wr?Math.abs(wr+pi-Fe):Fe),Ri}(Ge,Nc))),Kd(),Vt.showPalette&&Ud(),nr.trigger("reflow.spectrum"))}function Yd(){As(),Af=!0,nr.attr("disabled",!0),Nc.addClass("sp-disabled")}(function(){if(n&&Ge.find("*:not(input)").attr("unselectable","on"),Nf(),Df&&nr.after(Cl).hide(),Oa||Mf.hide(),Ue)nr.after(Ge).hide();else{var Pe=Vt.appendTo==="parent"?nr.parent():a(Vt.appendTo);Pe.length!==1&&(Pe=a("body")),Pe.append(Ge)}function Ee(Le){return Le.data&&Le.data.ignore?(Ta(a(Le.target).closest(".sp-thumb-el").data("color")),kl()):(Ta(a(Le.target).closest(".sp-thumb-el").data("color")),kl(),Vt.hideAfterPaletteSelect&&(ka(!0),As())),!1}zd(),Nc.bind("click.spectrum touchstart.spectrum",function(Le){Af||Wd(),Le.stopPropagation(),a(Le.target).is("input")||Le.preventDefault()}),(nr.is(":disabled")||Vt.disabled===!0)&&Yd(),Ge.click(qr),ui.change(Rf),ui.bind("paste",function(){setTimeout(Rf,1)}),ui.keydown(function(Le){Le.keyCode==13&&Rf()}),Rd.text(Vt.cancelText),Rd.bind("click.spectrum",function(Le){Le.stopPropagation(),Le.preventDefault(),Gd(),As()}),Mf.attr("title",Vt.clearText),Mf.bind("click.spectrum",function(Le){Le.stopPropagation(),Le.preventDefault(),Es=!0,kl(),Ue&&ka(!0)}),Hd.text(Vt.chooseText),Hd.bind("click.spectrum",function(Le){Le.stopPropagation(),Le.preventDefault(),n&&ui.is(":focus")&&ui.trigger("change"),ui.hasClass("sp-validation-error")||(ka(!0),As())}),Lf.text(Vt.showPaletteOnly?Vt.togglePaletteMoreText:Vt.togglePaletteLessText),Lf.bind("click.spectrum",function(Le){Le.stopPropagation(),Le.preventDefault(),Vt.showPaletteOnly=!Vt.showPaletteOnly,Vt.showPaletteOnly||Ue||Ge.css("left","-="+(Pm.outerWidth(!0)+5)),Nf()}),no(Id,function(Le,wr,pi){li=Le/vo,Es=!1,pi.shiftKey&&(li=Math.round(10*li)/10),kl()},Ff,Vf),no(jf,function(Le,wr){br=parseFloat(wr/Yr),Es=!1,Vt.showAlpha||(li=1),kl()},Ff,Vf),no(pp,function(Le,wr,pi){if(pi.shiftKey){if(!Ps){var js=Ac*er,Ms=Un-jc*Un,Ea=Math.abs(Le-js)>Math.abs(wr-Ms);Ps=Ea?"x":"y"}}else Ps=null;var zf=!Ps||Ps==="y";(!Ps||Ps==="x")&&(Ac=parseFloat(Le/er)),zf&&(jc=parseFloat((Un-wr)/Un)),Es=!1,Vt.showAlpha||(li=1),kl()},Ff,Vf),Ic?(Ta(Ic),Pl(),Tl=Vt.preferredFormat||X(Ic).getFormat(),If(Ic)):Pl(),Ue&&Hf();var Fe=n?"mousedown.spectrum":"click.spectrum touchstart.spectrum";Fd.delegate(".sp-thumb-el",Fe,Ee),Vd.delegate(".sp-thumb-el:nth-child(1)",Fe,{ignore:!0},Ee)})();var vp={show:Hf,hide:As,toggle:Wd,reflow:Pa,option:function(Pe,Ee){return Pe===r?a.extend({},Vt):Ee===r?Vt[Pe]:(Vt[Pe]=Ee,Pe==="preferredFormat"&&(Tl=Vt.preferredFormat),void Nf())},enable:function(){Af=!1,nr.attr("disabled",!1),Nc.removeClass("sp-disabled")},disable:Yd,offset:function(Pe){Vt.offset=Pe,Pa()},set:function(Pe){Ta(Pe),ka()},get:Xr,destroy:function(){nr.show(),Nc.unbind("click.spectrum touchstart.spectrum"),Ge.remove(),Cl.remove(),e[vp.id]=null},container:Ge};return vp.id=e.push(vp)-1,vp}function Er(){}function qr(ct){ct.stopPropagation()}function Gr(ct,St){var Pt=Array.prototype.slice,Ut=Pt.call(arguments,2);return function(){return ct.apply(St,Ut.concat(Pt.call(arguments)))}}function no(ct,St,Pt,Ut){St=St||function(){},Pt=Pt||function(){},Ut=Ut||function(){};var ue=document,Vt=!1,Ue={},en=0,Ze=0,go="ontouchstart"in window,cr={};function nn(un){un.stopPropagation&&un.stopPropagation(),un.preventDefault&&un.preventDefault(),un.returnValue=!1}function we(un){if(Vt){if(n&&ue.documentMode<9&&!un.button)return on();var er=un&&un.touches&&un.touches[0],Un=er&&er.pageX||un.pageX,yr=er&&er.pageY||un.pageY,Yr=Math.max(0,Math.min(Un-Ue.left,Ze)),vo=Math.max(0,Math.min(yr-Ue.top,en));go&&nn(un),St.apply(ct,[Yr,vo,un])}}function on(){Vt&&(a(ue).unbind(cr),a(ue.body).removeClass("sp-dragging"),setTimeout(function(){Ut.apply(ct,arguments)},0)),Vt=!1}cr.selectstart=nn,cr.dragstart=nn,cr["touchmove mousemove"]=we,cr["touchend mouseup"]=on,a(ct).bind("touchstart mousedown",function(un){var er=un.which?un.which==3:un.button==2;er||Vt||Pt.apply(ct,arguments)!==!1&&(Vt=!0,en=a(ct).height(),Ze=a(ct).width(),Ue=a(ct).offset(),a(ue).bind(cr),a(ue.body).addClass("sp-dragging"),we(un),nn(un))})}function Kr(){return a.fn.spectrum.inputTypeColorSupport()}function ii(ct,St,Pt){ct=Mn(ct,255),St=Mn(St,255),Pt=Mn(Pt,255);var Ut,ue,Vt=q(ct,St,Pt),Ue=F(ct,St,Pt),en=(Vt+Ue)/2;if(Vt==Ue)Ut=ue=0;else{var Ze=Vt-Ue;switch(ue=en>.5?Ze/(2-Vt-Ue):Ze/(Vt+Ue),Vt){case ct:Ut=(St-Pt)/Ze+(St>1)+720)%360;--St;)Ut.h=(Ut.h+ue)%360,Vt.push(X(Ut));return Vt}function Om(ct,St){St=St||6;for(var Pt=X(ct).toHsv(),Ut=Pt.h,ue=Pt.s,Vt=Pt.v,Ue=[],en=1/St;St--;)Ue.push(X({h:Ut,s:ue,v:Vt})),Vt=(Vt+en)%1;return Ue}function Dd(ct){return ct=parseFloat(ct),(isNaN(ct)||ct<0||ct>1)&&(ct=1),ct}function Mn(ct,St){(function(Ut){return typeof Ut=="string"&&Ut.indexOf(".")!=-1&&parseFloat(Ut)===1})(ct)&&(ct="100%");var Pt=function(Ut){return typeof Ut=="string"&&Ut.indexOf("%")!=-1}(ct);return ct=F(St,q(0,parseFloat(ct))),Pt&&(ct=parseInt(ct*St,10)/100),C.abs(ct-St)<1e-6?1:ct%St/parseFloat(St)}function lp(ct){return F(1,q(0,ct))}function si(ct){return parseInt(ct,16)}function Sa(ct){return ct.length==1?"0"+ct:""+ct}function Ec(ct){return ct<=1&&(ct=100*ct+"%"),ct}function Tm(ct){return si(ct)/255}}(W.default);var fl=function(a){var r=a.getFormat()==="name"&&a.toName(),t=a.getAlpha()==1?a.toHexString():a.toRgbString();return r||t.replace(/ /g,"")};const pc=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return Nu(r,a),r.prototype.template=function(){var t=this.ppfx;return`
`)},r.prototype.inputClass=function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},r.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},r.prototype.remove=function(){return a.prototype.remove.call(this),this.colorEl.spectrum("destroy"),this},r.prototype.handleChange=function(t){t.stopPropagation();var e=t.target.value;(0,S.isUndefined)(e)||this.__onInputChange(e)},r.prototype.__onInputChange=function(t){var e=this.model,n=this.opts.onChange,i=t,l=this.getColorEl();if(l){l.spectrum("set",i);var f=l.spectrum("get"),d=i&&fl(f);d&&(i=d)}n?n(i):e.set({value:i},{fromInput:1})},r.prototype.setValue=function(t,e){e===void 0&&(e={});var n=this.model,i=(0,S.isUndefined)(e.def)?n.get("defaults"):e.def,l=(0,S.isUndefined)(t)?(0,S.isUndefined)(i)?"":i:t,f=this.getInputEl(),d=this.getColorEl(),v=l!="none"?l:"";f.value=l,d.get(0).style.backgroundColor=v,(e.fromTarget||e.fromInput&&!e.avoidStore)&&(d.spectrum("set",v),this.noneColor=l=="none",this.movedColor=v)},r.prototype.getColorEl=function(){var t=this;if(!this.colorEl){var e=this,n=e.em,i=e.model,l=e.opts,f=this.ppfx,d=l.onChange,v=(0,W.default)('
')),h=v.get(0).style,w=n&&n.config?n.config.el:"",C=n&&n.getConfig&&n.getConfig().colorPicker||{};this.movedColor="";var L,F=!1;this.$el.find("[data-colorp-c]").append(v);var q=function(et,X){X===void 0&&(X=!0),d?d(et,!X):(X&&i.setValueFromInput(0,!1),i.setValueFromInput(et,X))};v.spectrum(ma(ma(ma({color:i.getValue()||!1,containerClassName:"".concat(f,"one-bg ").concat(f,"two-color"),appendTo:w||"body",maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"⨯",palette:[]},C),i.get("colorPicker")||{}),{move:function(et){var X=fl(et);t.movedColor=X,h.backgroundColor=X,q(X,!1)},change:function(et){F=!0;var X=fl(et);h.backgroundColor=X,q(X),t.noneColor=!1},show:function(et){F=!1,t.movedColor="",L=d?i.getValue({noDefault:!0}):fl(et)},hide:function(){F||!L&&!d||(t.noneColor&&(L=""),h.backgroundColor=L,v.spectrum("set",L),q(L,!1))}})),n&&n.on&&this.listenTo(n,"component:selected",function(){t.movedColor&&q(t.movedColor),F=!0,t.movedColor="",v.spectrum("hide")}),this.colorEl=v}return this.colorEl},r.prototype.render=function(){return pl.prototype.render.call(this),this.getColorEl(),this},r}(pl);var fc=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Iu=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return fc(r,a),r.prototype.templateInput=function(){return""},r.prototype.getInputEl=function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new pc({model:t,target:this.config.em,contClass:this.ppfx+"field-color",ppfx:this.ppfx}).render();n.setValue(e,{fromTarget:1}),this.input=n.el}return this.input},r}(Io);var Jp=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),dc=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return Jp(r,a),r.prototype.templateInput=function(){return""},r.prototype.onChange=function(){this.handleClick()},r.prototype.handleClick=function(){var t=this.model,e=this.em,n=t.get("command");n&&((0,S.isString)(n)?e.Commands.run(n):n(e.Editor,t))},r.prototype.renderLabel=function(){this.model.get("label")&&Io.prototype.renderLabel.apply(this)},r.prototype.getInputEl=function(){var t=this.model,e=this.ppfx,n=t.props(),i=n.labelButton,l=n.text,f=n.full,d=i||l,v="".concat(e,"btn");return'")},r}(Io);const bs=dc;dc.prototype.eventCapture=["click button"];var Fu=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ws=function(){return ws=Object.assign||function(a){for(var r,t=1,e=arguments.length;t ').concat(Je,` ').concat(dn,` `):"",`
').concat(Er,` `).concat(ie?'').concat(ie,""):"",` ').concat(It,`
').concat(C||"",`
').concat(Ie||"",`
')},Object.defineProperty(r.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),r.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,i=e.components();this.listenTo(i,"remove add reset",this.checkChildren),[["change:status",this.updateStatus],["change:open",this.updateOpening],["change:layerable",this.updateLayerable],["change:style:display",this.updateVisibility],["rerender:layer",this.render],["change:name change:custom-name",this.updateName]].forEach(function(l){return t.listenTo(e,l[0],l[1])}),this.$el.data("model",e),this.$el.data("collection",i),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},r.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},r.prototype.getVisibilityEl=function(){return this.eyeEl||(this.eyeEl=this.$el.children(".".concat(this.pfx,"layer-vis"))),this.eyeEl},r.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,i=t.module,l="".concat(e,"layer-hidden"),f=i.isVisible(n)?"removeClass":"addClass";this.$el[f](l),this.getVisibilityEl()[f]("".concat(e,"layer-off"))},r.prototype.toggleVisibility=function(t){t==null||t.stopPropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},r.prototype.handleEdit=function(t){t==null||t.stopPropagation();var e=this,n=e.em,i=e.$el,l=e.clsNoEdit,f=e.clsEdit,d=this.getInputName();d[vc]="true",d.focus(),document.execCommand("selectAll",!1),n.setEditing(!0),i.find(".".concat(this.inputNameCls)).removeClass(l).addClass(f)},r.prototype.handleEditKey=function(t){t.stopPropagation(),((0,H.isEscKey)(t)||(0,H.isEnterKey)(t))&&this.handleEditEnd(t)},r.prototype.handleEditEnd=function(t){t==null||t.stopPropagation();var e=this,n=e.em,i=e.$el,l=e.clsNoEdit,f=e.clsEdit,d=this.getInputName(),v=d.textContent;d.scrollLeft=0,d[vc]="false",this.setName(v,{component:this.model,propName:"custom-name"}),n.setEditing(!1),i.find(".".concat(this.inputNameCls)).addClass(l).removeClass(f),this.updateName()},r.prototype.setName=function(t,e){var n=e.propName;this.model.set(n,t)},r.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},r.prototype.updateOpening=function(){var t=this,e=t.$el,n=t.model,i=t.pfx,l="open",f="".concat(i,"layer-open"),d=this.getCaret();this.module.isOpen(n)?(e.addClass(l),d.addClass(f)):(e.removeClass(l),d.removeClass(f))},r.prototype.toggleOpening=function(t){var e=this.model,n=this.module;t==null||t.stopImmediatePropagation(),e.get("components").length&&n.setOpen(e,!n.isOpen(e))},r.prototype.handleSelect=function(t){t==null||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},r.prototype.handleHover=function(t){t==null||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},r.prototype.handleHoverOut=function(t){t==null||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},r.prototype.startSort=function(t){t.stopPropagation();var e=this.em,n=this.sorter;t.button&&t.button!==0||n&&(n.onStart=function(i){return e.trigger("".concat(hr,":start"),i)},n.onMoveClb=function(i){return e.trigger(hr,i)},n.startSort(t.target))},r.prototype.updateStatus=function(){kn.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:!0}])},r.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,i=t.$el,l=t.module,f=l.getComponents(e).length,d=i.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)),v=this.cnt;v||(v=i.children("[data-count]").get(0),this.cnt=v),d[f?"removeClass":"addClass"](n),v&&(v.innerHTML=f||""),!f&&l.setOpen(e,!1)},r.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))),this.caret},r.prototype.setRoot=function(t){t=(0,S.isString)(t)?this.em.getWrapper().find(t)[0]:t;var e=(0,H.getModel)(t,0);e&&(this.stopListening(),this.model=e,this.initComponent(),this._rendered&&this.render())},r.prototype.updateLayerable=function(){(this.parentView||this).render()},r.prototype.__clearItems=function(){var t;(t=this.items)===null||t===void 0||t.remove()},r.prototype.remove=function(){for(var t=[],e=0;e `).concat(this.getPreview(),`
`).concat(this.getInfo(),`
⨯
`)},r.prototype.updateTarget=function(t){t&&t.set&&(t.set("attributes",(0,S.clone)(t.get("attributes"))),t.set("src",this.model.get("src")))},r.prototype.getPreview=function(){return""},r.prototype.getInfo=function(){return""},r.prototype.render=function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this},r}(k.G7);const g=p;var m=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),y=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},x=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return m(r,a),r.prototype.getPreview=function(){var t=this,e=t.pfx,n=t.ppfx,i=t.model.get("src");return pt(B||(B=y([`
`],[`
`])),e,i,e,n)},r.prototype.getInfo=function(){var t=this.pfx,e=this.model,n=e.get("name"),i=e.get("width"),l=e.get("height"),f=e.get("unitDim"),d=i&&l?"".concat(i,"x").concat(l).concat(f):"";return n=n||e.getFilename(),pt($||($=y([`
',`
',`
`],[`
',`
',`
`])),t,n,t,d)},r.prototype.init=function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},r.prototype.onClick=function(){var t=this.model,e=this.pfx,n=this.__getBhv().select,i=this.config.onClick,l=this.collection;l.trigger("deselectAll"),this.$el.addClass(e+"highlight"),(0,S.isFunction)(n)?n(t,!1):(0,S.isFunction)(i)?i(t):this.updateTarget(l.target)},r.prototype.onDblClick=function(){var t=this.em,e=this.model,n=this.__getBhv().select,i=this.config.onDblClick,l=this.collection,f=l.target,d=l.onSelect;(0,S.isFunction)(n)?n(e,!0):(0,S.isFunction)(i)?i(e):(this.updateTarget(f),t==null||t.Modal.close()),(0,S.isFunction)(d)&&d(e)},r.prototype.onRemove=function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)},r}(g);const O=x;var B,$;x.prototype.events={"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"};var ft=function(){return ft=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
`)),`
`).concat(l,`
`)},r.prototype.handleSubmit=function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),i=this.config.handleAdd;if(n){e.value="";var l=this.getAssetsEl();l&&(l.scrollTop=0),i?i.bind(this)(n):this.options.globalCollection.add(n,{at:0})}},r.prototype.getAssetsEl=function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},r.prototype.getAddInput=function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},r.prototype.removedAsset=function(t){this.collection.length||this.toggleNoAssets()},r.prototype.addToAsset=function(t){this.collection.length==1&&this.toggleNoAssets(!0),this.addAsset(t)},r.prototype.addAsset=function(t,e){e===void 0&&(e=null);var n=e,i=this.collection,l=this.config,f=new t.typeView({model:t,collection:i,config:l}).render().el;if(n)n.appendChild(f);else{var d=this.getAssetsEl();d&&d.insertBefore(f,d.firstChild)}return f},r.prototype.toggleNoAssets=function(t){t===void 0&&(t=!1);var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}},r.prototype.deselectAll=function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))},r.prototype.renderAssets=function(){var t=this,e=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(!!this.collection.length),this.collection.each(function(i){return t.addAsset(i,e)}),n.append(e)},r.prototype.render=function(){var t=this.options.fu.render().el;return this.$el.empty(),this.$el.append(t).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this},r}(k.G7);const ye=Jt;Jt.prototype.events={submit:"handleSubmit"};var me=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ce=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},sn=function(a){function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;e.options=t;var n=t.config||{};e.module=t.module,e.config=n,e.em=e.config.em,e.pfx=n.stylePrefix||"",e.ppfx=n.pStylePrefix||"",e.target=e.options.globalCollection||{},e.uploadId=e.pfx+"uploadFile",e.disabled=n.disableUpload!==void 0?n.disableUpload:!n.upload&&!n.embedAsBase64,e.multiUpload=n.multiUpload===void 0||n.multiUpload;var i=n.uploadFile;return i?e.uploadFile=i.bind(e):!n.upload&&n.embedAsBase64&&(e.uploadFile=r.embedAsBase64),e.delegateEvents(),e}return me(r,a),r.prototype.template=function(t){var e=t.pfx,n=t.title,i=t.uploadId,l=t.disabled,f=t.multiUpload;return pt(gr||(gr=Ce([`
',`
`],[`
',`
`])),e,n,i,l?"disabled":"",f?"multiple":"")},r.prototype.events=function(){return{"change [data-input]":"uploadFile"}},r.prototype.onUploadStart=function(){var t=this.module;t&&t.__propEv("asset:upload:start")},r.prototype.onUploadEnd=function(t){var e=this.$el,n=this.module;n&&n.__propEv("asset:upload:end",t);var i=e.find("input");i&&i.val("")},r.prototype.onUploadError=function(t){var e=this.module;console.error(t),this.onUploadEnd(t),e&&e.__propEv("asset:upload:error",t)},r.prototype.onUploadResponse=function(t,e){var n,i=this,l=i.module,f=i.config,d=i.target;try{n=typeof t=="string"?JSON.parse(t):t}catch{n=t}l&&l.__propEv("asset:upload:response",n),f.autoAdd&&d&&d.add(n.data,{at:0}),this.onUploadEnd(t),e==null||e(n)},r.prototype.uploadFile=function(t,e){var n=this,i=t.dataTransfer?t.dataTransfer.files:t.target.files,l=this.config,f=l.beforeUpload;if((f&&f(i))!==!1){var d=new FormData,v=l.params,h=l.customFetch,w=l.fetchOptions;for(var C in v)d.append(C,v[C]);if(this.multiUpload)for(var L=0;L').concat(i.dropzoneContent,"")),L(),"draggable"in f&&[f,v].forEach(function(X){X.ondragover=F,X.ondragleave=q,X.ondrop=et})},r.prototype.render=function(){var t=this,e=t.$el,n=t.pfx,i=t.em;return e.html(this.template({title:i&&i.t("assetManager.uploadTitle"),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:n})),this.initDrop(),e.attr("class",n+"file-uploader"),this},r.embedAsBase64=function(t,e){var n=this,i=t.dataTransfer?t.dataTransfer.files:t.target.files,l={data:[]};if(FileReader){for(var f=[],d=/^(.+)\/(.+)$/,v=function(C){var L=new Promise(function(F,q){var et=new FileReader;et.addEventListener("load",function(X){var At,It=C.name,ie=d.exec(C.type);if((At=ie?ie[1]:C.type)==="image"){var se={src:et.result,name:It,type:At,height:0,width:0},Me=new Image;Me.addEventListener("error",function(Ie){q(Ie)}),Me.addEventListener("load",function(){se.height=Me.height,se.width=Me.width,F(se)}),Me.src=se.src}else F(At?{src:et.result,name:It,type:At}:et.result)}),et.addEventListener("error",function(X){q(X)}),et.addEventListener("abort",function(X){q("Aborted")}),et.readAsDataURL(C)});f.push(L)},h=0,w=i;h0&&(l=t.split(".").reduce(function(f,d){if(!(0,S.isUndefined)(f))return f[d]},i)),l}},r.prototype._debug=function(t,e){e===void 0&&(e={});var n=this.em,i=this.config;(e.debug||i.debug)&&n&&n.logWarning(t)},r.prototype.destroy=function(){},r}(jt);const oh=rh;var ih=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ss=function(){return Ss=Object.assign||function(a){for(var r,t=1,e=arguments.length;tv+C-e||fh+w-e)return 1},r.prototype.getCurrentPos=function(){var t=this.eventMove;return{x:(t==null?void 0:t.pageX)||0,y:(t==null?void 0:t.pageY)||0}},r.prototype.getDim=function(t){var e,n,i,l,f=this.em,d=this.canvasRelative,v=f==null?void 0:f.Canvas,h=v?v.getElementOffsets(t):{};if(d&&f){var w=v.getElementPos(t,{noScroll:1});e=w.top,n=w.left,i=w.height,l=w.width}else{var C=this.offset(t);e=this.relative?t.offsetTop:C.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:C.left-(this.wmargin?-1:1)*this.elL,i=t.offsetHeight,l=t.offsetWidth}return{top:e,left:n,height:i,width:l,offsets:h}},r.prototype.getChildrenDim=function(t){var e=this,n=[];if(!t)return n;var i=this.getTargetModel(t);if(i&&i.view&&!this.ignoreViewChildren){var l=i.getCurrentView?i.getCurrentView():i.view;t=l.getChildrenContainer()}return(0,S.each)(t.children,function(f,d){var v=f,h=(0,H.getModel)(v,W.default),w=h&&h.index?h.index():d;if((0,H.isTextNode)(v)||e.matches(v,e.itemSel)){var C,L=e.getDim(v),F=e.direction;C=F=="v"||F!="h"&&e.isInFlow(v,t),L.dir=C,L.el=v,L.indexEl=w,n.push(L)}}),n},r.prototype.nearBorders=function(t,e,n){var i=!1,l=this.borderOffset,f=e||0,d=n||0,v=t.top,h=t.left,w=t.height,C=t.width;return(v+l>d||d>v+w-l||h+l>f||f>h+C-l)&&(i=!0),i},r.prototype.findPosition=function(t,e,n){for(var i,l={index:0,indexEl:0,method:"before"},f=0,d=0,v=0,h=0,w=0,C=0,L=0,F=t.length;Ld||v&&w>=v||f&&et+Atie&&(At.at=w-1))}i&&(It?(delete At.at,l=F.getView().insertComponent(i,At)):l=L.add(i,At)),delete this.dropContent,delete this.prevTarget}else if(f){var Me=C.dropInfo||(F==null?void 0:F.get("droppable")),Ie=C.dragInfo||(q==null?void 0:q.get("draggable"));!L&&h.push("Target collection not found"),!X&&Me&&h.push("Target is not droppable, accepts [".concat(Me,"]")),!et&&Ie&&h.push("Component not draggable, acceptable by [".concat(Ie,"]")),f.logWarning("Invalid target position",{errors:h,model:q,context:"sorter",target:F})}return f==null||f.trigger("sorter:drag:end",{targetCollection:L,modelToDrop:i,warns:h,validResult:C,dst:t,srcEl:v}),l},r.prototype.rollback=function(t){(0,H.off)(this.getDocuments(),"keydown",this.rollback),(t.which||t.keyCode)==27&&(this.moved=!1,this.endMove())},r}(k.G7);const lh=ah;var ba=function(){return ba=Object.assign||function(a){for(var r,t=1,e=arguments.length;tIt?et.h=Math.round(et.w/It):et.w=Math.round(et.h*It)}for(var ie in~X.indexOf("l")&&(et.l+=i.w-et.w),~X.indexOf("t")&&(et.t+=i.h-et.h),et){var se=ie;et[se]=parseInt("".concat(et[se]),10)}return et}},a}();const uh=ch;var ph=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),af=function(){return af=Object.assign||function(a){for(var r,t=1,e=arguments.length;t=0&&ml.splice(e,1),t!=93&&t!=224||(t=91),t in Br)for(r in Br[t]=!1,wa)wa[r]==t&&(Wr[r]=!1)}function mh(){for(eo in Br)Br[eo]=!1;for(eo in wa)Wr[eo]=!1}function Wr(a,r,t){var e,n;e=Gf(a),t===void 0&&(t=r,r="all");for(var i=0;i1&&(n=Kf(a),a=[a[a.length-1]]),a=a[0],(a=lf(a))in ho||(ho[a]=[]),ho[a].push({shortcut:e[i],scope:r,method:t,key:e[i],mods:n})}for(eo in wa)Wr[eo]=!1;function cf(){return $f||"all"}function Gf(a){var r;return(r=(a=a.replace(/\s/g,"")).split(","))[r.length-1]==""&&(r[r.length-2]+=","),r}function Kf(a){for(var r=a.slice(0,a.length-1),t=0;t1&&(f=Kf(e)),a=e[e.length-1],a=lf(a),r===void 0&&(r=cf()),!ho[a])return;for(n=0;n0,Br)(!Br[i]&&xc(n.mods,+i)>-1||Br[i]&&xc(n.mods,+i)==-1)&&(f=!1);(n.mods.length!=0||Br[16]||Br[18]||Br[17]||Br[91])&&!f||n.method(t,n)===!1&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}})(r)}),uf(a.document,"keyup",vh),uf(a,"focus",mh)};const Cc=Wr,yh={defaults:{"core:undo":{keys:"⌘+z, ctrl+z",handler:"core:undo"},"core:redo":{keys:"⌘+shift+z, ctrl+shift+z",handler:"core:redo"},"core:copy":{keys:"⌘+c, ctrl+c",handler:"core:copy"},"core:paste":{keys:"⌘+v, ctrl+v",handler:"core:paste"},"core:component-next":{keys:"s",handler:"core:component-next"},"core:component-prev":{keys:"w",handler:"core:component-prev"},"core:component-enter":{keys:"d",handler:"core:component-enter"},"core:component-exit":{keys:"a",handler:"core:component-exit"},"core:component-delete":{keys:"backspace, delete",handler:"core:component-delete",opts:{prevent:!0}}}};var bh=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Yf=function(a,r,t){if(t||arguments.length===2)for(var e,n=0,i=r.length;n
').concat(l,`
⨯
').concat(i,`
')},r.prototype.events=function(){return{click:"onClick","click [data-close-modal]":"hide"}},r.prototype.onClick=function(t){this.config.backdrop&&t.target===this.el&&this.hide()},r.prototype.getCollector=function(){return this.$collector||(this.$collector=this.$el.find("."+this.pfx+"collector")),this.$collector},r.prototype.getContent=function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content},r.prototype.getTitle=function(t){return t===void 0&&(t={}),this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),t.$?this.$title:this.$title.get(0)},r.prototype.updateContent=function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),i=this.model.get("content");e.length&&n.append(e),t.empty().append(i)},r.prototype.updateTitle=function(){var t=this.getTitle({$:!0});t&&t.empty().append(this.model.get("title"))},r.prototype.updateOpen=function(){this.el.style.display=this.model.get("open")?"":"none"},r.prototype.hide=function(){this.model.close()},r.prototype.show=function(){this.model.open()},r.prototype.updateAttr=function(t){var e=this,n=e.pfx,i=e.$el,l=e.el,f=[].slice.call(l.attributes).map(function(d){return d.name});i.removeAttr(f.join(" ")),i.attr(Wu(Wu({},t||{}),{class:"".concat(n,"container ").concat(t&&t.class||"").trim()}))},r.prototype.render=function(){var t=this.$el,e=this.model.toJSON();return e.pfx=this.pfx,e.ppfx=this.ppfx,t.html(this.template(e)),this.updateAttr(),this.updateOpen(),this},r}(pn);var kh=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Ph=function(a){function r(t){var e=a.call(this,t,"Modal",xh)||this;return e.model=new Sh(e),e.model.on("change:open",function(n,i){t.trigger("modal:".concat(i?"open":"close"))}),e.model.on("change",(0,S.debounce)(function(){var n=e._evData(),i=e.config.custom;(0,S.isFunction)(i)&&i(n),t.trigger("modal",n)},0)),e}return kh(r,a),r.prototype._evData=function(){var t=this,e=this.getTitle(),n=this.getContent(),i=this.model.attributes;return{open:i.open,attributes:i.attributes,title:(0,S.isString)(e)?(0,Ne.rw)(e):e,content:(0,S.isString)(n)?(0,Ne.rw)(n):n.get?n.get(0):n,close:function(){t.close()}}},r.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(e==null||e.appendChild(n))},r.prototype.open=function(t){t===void 0&&(t={});var e=t.attributes||{};return t.title&&this.setTitle(t.title),t.content&&this.setContent(t.content),this.model.set("attributes",e),this.model.open(),this.modal&&this.modal.updateAttr(e),this},r.prototype.close=function(){return this.model.close(),this},r.prototype.onceClose=function(t){return this.em.once("modal:close",t),this},r.prototype.onceOpen=function(t){return this.em.once("modal:open",t),this},r.prototype.isOpen=function(){return!!this.model.get("open")},r.prototype.setTitle=function(t){return this.model.set("title",t),this},r.prototype.getTitle=function(){return this.model.get("title")},r.prototype.setContent=function(t){return this.model.set("content"," "),this.model.set("content",t),this},r.prototype.getContent=function(){return this.model.get("content")},r.prototype.getContentEl=function(){var t;return(t=this.modal)===null||t===void 0?void 0:t.getContent().get(0)},r.prototype.getModel=function(){return this.model},r.prototype.render=function(){var t;if(!this.config.custom){var e=Th.extend(this.config.extend),n=this.modal&&this.modal.el;return this.modal=new e({el:n,model:this.model,config:this.config}),(t=this.modal)===null||t===void 0?void 0:t.render().el}},r.prototype.destroy=function(){var t;(t=this.modal)===null||t===void 0||t.remove()},r}(jt);var Xf="sw-visibility",Jf="export-template",Zf="open-sm",Qf="open-tm",td="open-layers",ed="open-blocks",pf="fullscreen",ff="preview";const df={stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:Xf,className:"fa fa-square-o",command:"core:component-outline",context:Xf,attributes:{title:"View components"}},{id:ff,className:"fa fa-eye",command:ff,context:ff,attributes:{title:"Preview"}},{id:pf,className:"fa fa-arrows-alt",command:pf,context:pf,attributes:{title:"Fullscreen"}},{id:Jf,className:"fa fa-code",command:Jf,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:Zf,className:"fa fa-paint-brush",command:Zf,active:!0,togglable:!1,attributes:{title:"Open Style Manager"}},{id:Qf,className:"fa fa-cog",command:Qf,togglable:!1,attributes:{title:"Settings"}},{id:td,className:"fa fa-bars",command:td,togglable:!1,attributes:{title:"Open Layer Manager"}},{id:ed,className:"fa fa-th-large",command:ed,togglable:!1,attributes:{title:"Open Blocks"}}]}]};var Eh=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const nd=function(a){function r(t,e){var n=a.call(this,t,e)||this;return n.get("buttons").length&&n.set("buttons",new od(n.module,n.get("buttons"))),n}return Eh(r,a),r.prototype.defaults=function(){return{id:"",label:"",tagName:"span",className:"",command:"",context:"",buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1}},Object.defineProperty(r.prototype,"className",{get:function(){return this.get("className")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"command",{get:function(){return this.get("command")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"active",{get:function(){return this.get("active")},set:function(t){this.set("active",t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"togglable",{get:function(){return this.get("togglable")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"runDefaultCommand",{get:function(){return this.get("runDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"stopDefaultCommand",{get:function(){return this.get("stopDefaultCommand")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"disable",{get:function(){return this.get("disable")},enumerable:!1,configurable:!0}),r}(bt);var Ah=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rd=function(a){function r(t,e){return a.call(this,t,e,nd)||this}return Ah(r,a),r.prototype.deactivateAllExceptOne=function(t,e){this.forEach(function(n,i){n!==t&&(n.set("active",!1),e&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(t,e))})},r.prototype.deactivateAll=function(t,e){var n=t||"";this.forEach(function(i){i.get("context")==n&&i!==e&&i.set("active",!1,{fromCollection:!0})})},r.prototype.disableAllButtons=function(t){var e=t||"";this.forEach(function(n,i){n.get("context")==e&&n.set("disable",!0)})},r.prototype.disableAllButtonsExceptOne=function(t,e){this.forEach(function(n,i){n!==t&&(n.set("disable",!0),e&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(t,e))})},r}(Ft);const od=rd;rd.prototype.model=nd;var jh=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const id=function(a){function r(t,e){var n=a.call(this,t,e)||this,i=n.get("buttons")||[];return n.buttons=new od(t,i),n}return jh(r,a),r.prototype.defaults=function(){return{id:"",content:"",visible:!0,buttons:[],attributes:{}}},Object.defineProperty(r.prototype,"buttons",{get:function(){return this.get("buttons")},set:function(t){this.set("buttons",t)},enumerable:!1,configurable:!0}),r}(bt);var Mh=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),sd=function(a){function r(t,e){return a.call(this,t,e,id)||this}return Mh(r,a),r}(Ft);const Lh=sd;sd.prototype.model=id;var Dh=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),yl=function(){return yl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
',`
`],[`
',`
`])),e,e,n,e,i,e)},r.prototype.initialize=function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},r.prototype.render=function(){var t=this,e=t.model,n=t.pfx,i=t.$el,l=e.toJSON();return l.pfx=n,i.html(this.template(l)),i.attr("class","".concat(n,"editor-c")),i.find("#".concat(n,"code")).append(e.get("input")),this},r}(k.G7);var ld,ag=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),lg="CodeMirror",cg=function(a){function r(t){var e=a.call(this,t,"CodeManager",qh)||this;e.EditorView=sg;var n=e.config,i=n.pStylePrefix;return i&&(n.stylePrefix=i+n.stylePrefix),e.generators={},e.viewers={},e.defGenerators={html:new Yh,css:new Ep,json:new Zh,js:new eg},e.defViewers={CodeMirror:new rg},e.loadDefaultGenerators().loadDefaultViewers(),e}return ag(r,a),r.prototype.addGenerator=function(t,e){return this.generators[t]=e,this},r.prototype.getGenerator=function(t){return this.generators[t]},r.prototype.getGenerators=function(){return this.generators},r.prototype.addViewer=function(t,e){return this.viewers[t]=e,this},r.prototype.getViewer=function(t){return this.viewers[t]},r.prototype.getViewers=function(){return this.viewers},r.prototype.createViewer=function(t){t===void 0&&(t={});var e=(0,S.isUndefined)(t.type)?lg:t.type,n=this.getViewer(e)&&this.getViewer(e).clone(),i=document.createElement("div"),l=document.createElement("textarea");return i.appendChild(l),n.set(t),n.init(l),n.setElement(i),n},r.prototype.updateViewer=function(t,e){t.setContent(e)},r.prototype.getCode=function(t,e,n){n===void 0&&(n={}),n.em=this.em;var i=this.getGenerator(e);return i?i.build(t,n):""},r.prototype.loadDefaultGenerators=function(){for(var t in this.defGenerators)this.addGenerator(t,this.defGenerators[t]);return this},r.prototype.loadDefaultViewers=function(){for(var t in this.defViewers)this.addViewer(t,this.defViewers[t]);return this},r.prototype.destroy=function(){},r}(jt);const ug=cg;var pg=gn(410),fg=gn.n(pg);const dg={maximumStackLength:500,trackSelection:!0};var hg=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ni=function(){return Ni=Object.assign||function(a){for(var r,t=1,e=arguments.length;t=0}))return!1;if((0,S.isBoolean)(l)||(0,S.isArray)(l)&&cd(i).some(function(d){return l.indexOf(d)>=0}))return!0}return!1},on:function(i,l,f){var d=this;!this.beforeCache&&(this.beforeCache=i.previousAttributes());var v=f||l||{};if(v.noUndo&&setTimeout(function(){d.beforeCache=null}),!$u(v)){var h=i.toJSON({fromUndo:n}),w={object:i,before:this.beforeCache,after:h};if(this.beforeCache=null,!(0,S.isEmpty)(h))return w}}}),e.um.changeUndoType("add",{on:function(i,l,f){if(f===void 0&&(f={}),!$u(f)&&e.isRegistered(l))return{object:l,before:void 0,after:i,options:Ni(Ni({},f),{fromUndo:n})}}}),e.um.changeUndoType("remove",{on:function(i,l,f){if(f===void 0&&(f={}),!$u(f)&&e.isRegistered(l))return{object:l,before:i,after:void 0,options:Ni(Ni({},f),{fromUndo:n})}}}),e.um.changeUndoType("reset",{undo:function(i,l){i.reset(l,{fromUndo:n})},redo:function(i,l,f){i.reset(f,{fromUndo:n})},on:function(i,l){if(l===void 0&&(l={}),!$u(l)&&e.isRegistered(i))return{object:i,before:l.previousModels,after:gg([],i.models,!0),options:Ni(Ni({},l),{fromUndo:n})}}}),e.um.on("undo redo",function(){t.trigger("change:canvasOffset"),t.getSelectedAll().map(function(i){return i.trigger("rerender:layer")})}),["undo","redo"].forEach(function(i){return e.um.on(i,function(){return t.trigger(i)})}),e}return hg(r,a),r.prototype.postLoad=function(){var t=this.config,e=this.em;t.trackSelection&&e&&this.add(e.get("selected"))},r.prototype.add=function(t){return this.um.register(t),this},r.prototype.remove=function(t){return this.um.unregister(t),this},r.prototype.removeAll=function(){return this.um.unregisterAll(),this},r.prototype.start=function(){return this.um.startTracking(),this},r.prototype.stop=function(){return this.um.stopTracking(),this},r.prototype.undo=function(t){t===void 0&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.undo(t),this},r.prototype.undoAll=function(){return this.um.undoAll(),this},r.prototype.redo=function(t){t===void 0&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.redo(t),this},r.prototype.redoAll=function(){return this.um.redoAll(),this},r.prototype.hasUndo=function(){return!!this.um.isAvailable("undo")},r.prototype.hasRedo=function(){return!!this.um.isAvailable("redo")},r.prototype.isRegistered=function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},r.prototype.getStack=function(){return this.um.stack},r.prototype.getStackGroup=function(){var t=[],e=[];return this.getStack().forEach(function(n){var i=n.get("magicFusionIndex");e.indexOf(i)<0&&(e.push(i),t.push(n))}),t},r.prototype.skip=function(t){this.stop(),t(),this.start()},r.prototype.getGroupedStack=function(){var t={},e=this.getStack();return e.forEach(function(n,i){var l=n.get("magicFusionIndex"),f=function(d,v){var h=d.attributes,w=h.type,C=h.after,L=h.before,F=h.object,q=h.options;return{index:v,type:w,after:C,before:L,object:F,options:q===void 0?{}:q}}(n,i);t[l]?t[l].push(f):t[l]=[f]}),Object.keys(t).map(function(n){var i=t[n];return{index:i[i.length-1].index,actions:i,labels:(0,S.unique)(i.reduce(function(l,f){var d,v=(d=f.options)===null||d===void 0?void 0:d.action;return v&&l.push(v),l},[]))}})},r.prototype.goToGroup=function(t){var e=this;if(t){var n=this.getPointer(),i=t.index-n;(0,S.times)(Math.abs(i),function(){e[i<0?"undo":"redo"](!1)})}},r.prototype.getPointer=function(){return this.getStack().pointer},r.prototype.clear=function(){return this.um.clear(),this},r.prototype.getInstance=function(){return this.um},r.prototype.destroy=function(){this.clear().removeAll()},r}(jt);const mg=vg,yg={stylePrefix:"rte-",adjustToolbar:!0,actions:["bold","italic","underline","strikethrough","link","wrap"],custom:!1};var qu,bl=function(){return bl=Object.assign||function(a){for(var r,t=1,e=arguments.length;tB",attributes:{title:"Bold"},result:function(a){return a.exec("bold")}},italic:{name:"italic",icon:"I",attributes:{title:"Italic"},result:function(a){return a.exec("italic")}},underline:{name:"underline",icon:"U",attributes:{title:"Underline"},result:function(a){return a.exec("underline")}},strikethrough:{name:"strikethrough",icon:"S",attributes:{title:"Strike-through"},result:function(a){return a.exec("strikeThrough")}},link:{icon:` `,name:"link",attributes:{style:"font-size:1.4rem;padding:0 4px 2px;",title:"Link"},state:function(a){return a&&a.selection()&&Gu(a)?ud:mf},result:function(a){Gu(a)?a.exec("unlink"):a.insertHTML('").concat(a.selection(),""),{select:!0})}},wrap:{name:"wrap",icon:` `,attributes:{title:"Wrap for style"},state:function(a){return a!=null&&a.selection()&&Gu(a,"SPAN")?pd:mf},result:function(a){!Gu(a,"SPAN")&&a.insertHTML("").concat(a.selection(),""),{select:!0})}}},bg=function(){function a(r,t,e){e===void 0&&(e={});var n=this;if(this.em=r,this.settings=e,t[vf])return t[vf];t[vf]=this,this.setEl(t),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var i=(e.actions||[]).map(function(h){var w=h;return(0,S.isString)(h)?w=bl({},Oc[h]):Oc[h.name]&&(w=bl(bl({},Oc[h.name]),h)),w}),l=i.length?i:Object.keys(Oc).map(function(h){return Oc[h]});e.classes=bl({actionbar:"actionbar",button:"action",active:"active",disabled:"disabled",inactive:"inactive"},e.classes);var f=e.classes,d=e.actionbar;if(this.actionbar=d,this.classes=f,this.actions=l,!d){if(!this.isCustom(e.module)){var v=e.actionbarContainer;(d=document.createElement("div")).className=f.actionbar,v==null||v.appendChild(d),this.actionbar=d}l.forEach(function(h){return n.addAction(h)})}return e.styleWithCSS&&this.exec("styleWithCSS"),this}return a.prototype.isCustom=function(r){var t=r||this.em.RichTextEditor;return!(!(t!=null&&t.config.custom)&&!(t!=null&&t.customRte))},a.prototype.destroy=function(){},a.prototype.setEl=function(r){this.el=r,this.doc=r.ownerDocument},a.prototype.updateActiveActions=function(){var r=this,t=this.getActions();t.forEach(function(e){var n=e.update,i=e.btn,l=r.classes,f=l.active,d=l.inactive,v=l.disabled,h=e.state,w=e.name,C=r.doc,L=qu.INACTIVE;if(i&&(i.className=i.className.replace(f,"").trim(),i.className=i.className.replace(d,"").trim(),i.className=i.className.replace(v,"").trim()),h){var F=h(r,C);if(L=F,i)switch(F){case ud:i.className+=" ".concat(f);break;case mf:i.className+=" ".concat(d);break;case pd:i.className+=" ".concat(v)}}else C.queryCommandSupported(w)&&C.queryCommandState(w)&&(i&&(i.className+=" ".concat(f)),L=qu.ACTIVE);e.currentState=L,n==null||n(r,e)}),t.length&&this.em.RichTextEditor.__dbdTrgCustom()},a.prototype.enable=function(r){return this.enabled?this:this.__toggleEffects(!0,r)},a.prototype.disable=function(){return this.__toggleEffects(!1)},a.prototype.__toggleEffects=function(r,t){r===void 0&&(r=!1),t===void 0&&(t={});var e=r?H.on:H.off,n=this.el,i=this.doc,l=this.actionbarEl();if(l&&(l.style.display=r?"":"none"),n.contentEditable="".concat(!!r),e(n,"mouseup keyup",this.updateActiveActions),e(i,"keydown",this.__onKeydown),e(i,"paste",this.__onPaste),this.enabled=r,r){var f=t.event;if(this.syncActions(),this.updateActiveActions(),f){var d=null;if(i.caretRangeFromPoint){var v=(0,H.getPointerEvent)(f);d=i.caretRangeFromPoint(v.clientX,v.clientY)}else f.rangeParent&&(d=i.createRange()).setStart(f.rangeParent,f.rangeOffset);var h=i.getSelection();h==null||h.removeAllRanges(),d&&(h==null||h.addRange(d))}n.focus()}return this},a.prototype.__onKeydown=function(r){var t=r,e=this.doc;t.key!=="Enter"||["insertOrderedList","insertUnorderedList"].some(function(n){return e.queryCommandState(n)})||(e.execCommand("insertLineBreak"),t.preventDefault())},a.prototype.__onPaste=function(r){var t=r.clipboardData||window.clipboardData,e=t.getData("text"),n=t.getData("text/html");if(e&&!n){r.preventDefault();var i=e.replace(/(?:\r\n|\r|\n)/g,"
");this.doc.execCommand("insertHTML",!1,i)}},a.prototype.syncActions=function(){var r=this;this.getActions().forEach(function(t){if(r.actionbar&&(!t.state||t.state&&t.state(r,r.doc)>=0)){var e=t.event||"click",n=t.btn;n&&(n["on".concat(e)]=function(){t.result(r,t),r.updateActiveActions()})}})},a.prototype.addAction=function(r,t){t===void 0&&(t={});var e=t.sync,n=this.actionbarEl();if(n){var i=r.icon,l=r.attributes,f=l===void 0?{}:l,d=document.createElement("span");for(var v in d.className=this.classes.button,r.btn=d,f)d.setAttribute(v,f[v]);typeof i=="string"?d.innerHTML=i:d.appendChild(i),n.appendChild(d)}e&&(this.actions.push(r),this.syncActions())},a.prototype.getActions=function(){return this.actions},a.prototype.selection=function(){return this.doc.getSelection()},a.prototype.exec=function(r,t){this.doc.execCommand(r,!1,t)},a.prototype.actionbarEl=function(){return this.actionbar},a.prototype.insertHTML=function(r,t){var e=(t===void 0?{}:t).select,n=this,i=n.em,l=n.doc,f=n.el,d=l.getSelection();if(d&&d.rangeCount){var v=(0,H.getModel)(f),h=l.createElement("div"),w=d.getRangeAt(0);w.deleteContents(),(0,S.isString)(r)?h.innerHTML=r:r&&h.appendChild(r),Array.prototype.slice.call(h.childNodes).forEach(function(C){w.insertNode(C)}),d.removeAllRanges(),d.addRange(w),f.focus(),e&&v&&(v.once("rte:disable",function(){var C=v.find("[".concat(Ku,"]"))[0];C&&(i.setSelected(C),C.removeAttributes(Ku))}),v.trigger("disable"))}},a}();const wg=bg;var _g=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),fd=function(a,r,t,e){return new(t||(t=Promise))(function(n,i){function l(v){try{d(e.next(v))}catch(h){i(h)}}function f(v){try{d(e.throw(v))}catch(h){i(h)}}function d(v){var h;v.done?n(v.value):(h=v.value,h instanceof t?h:new t(function(w){w(h)})).then(l,f)}d((e=e.apply(a,r||[])).next())})},dd=function(a,r){var t,e,n,i,l={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function f(d){return function(v){return function(h){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,h[0]&&(l=0)),l;)try{if(t=1,e&&(n=2&h[0]?e.return:h[0]?e.throw||((n=e.return)&&n.call(e),0):e.next)&&!(n=n.call(e,h[1])).done)return n;switch(e=0,n&&(h=[2&h[0],n.value]),h[0]){case 0:case 1:n=h;break;case 4:return l.label++,{value:h[1],done:!1};case 5:l.label++,e=h[1],h=[0];continue;case 7:h=l.ops.pop(),l.trys.pop();continue;default:if(n=l.trys,!((n=n.length>0&&n[n.length-1])||h[0]!==6&&h[0]!==2)){l=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]=0})),et=this.get("onChange"),X={property:this,from:C,to:w,value:v,opts:e};l.__trgEv(l.events.propertyUpdate,X),et&&et(X),q&&this.__upTargetsStyle(((n={})[f]=v,n),e)},r.prototype.__upTargetsStyle=function(t,e){var n,i=(n=this.em)===null||n===void 0?void 0:n.get("StyleManager");i==null||i.addStyleTargets($r($r({},t),{__p:!!e.avoidStore}),e)},r.prototype._up=function(t,e){e===void 0&&(e={}),e.noTarget&&(e.__up=!0);var n=e.partial,i=Mg(e,["partial"]);return t.__p=!(!i.avoidStore&&!n),this.set(t,$r($r({},i),{avoidStore:t.__p}))},r.prototype.up=function(t,e){e===void 0&&(e={}),this.set(t,$r($r({},e),{__up:!0}))},r.prototype.init=function(){},r.prototype.getId=function(){return this.get("id")},r.prototype.getType=function(){return this.get("type")},r.prototype.getName=function(){return this.get("property")},r.prototype.getLabel=function(t){var e;t===void 0&&(t={});var n=t.locale,i=n===void 0||n,l=this.getId(),f=this.get("name")||this.get("label");return i&&((e=this.em)===null||e===void 0?void 0:e.t("styleManager.properties.".concat(l)))||f},r.prototype.getValue=function(t){t===void 0&&(t={});var e=t.noDefault,n=this.get("value");return this.hasValue()||e?n:this.getDefaultValue()},r.prototype.hasValue=function(t){t===void 0&&(t={});var e=t.noParent&&this.getParentTarget(),n=this.get("value");return!(0,S.isUndefined)(n)&&n!==""&&!e},r.prototype.hasValueParent=function(){return this.hasValue()&&!this.hasValue({noParent:!0})},r.prototype.getStyle=function(t){var e;t===void 0&&(t={});var n=this.getName();return(e={})[t.camelCase?(0,H.camelCase)(n):n]=this.__getFullValue(t),e},r.prototype.getDefaultValue=function(){var t=this.get("default");return"".concat((0,S.isUndefined)(t)?this.get("defaults"):t)},r.prototype.upValue=function(t,e){e===void 0&&(e={});var n=t===null||t===""?this.__getClearProps():this.__parseValue(t,e);return this._up(n,e)},r.prototype.isVisible=function(){return!!this.get("visible")},r.prototype.clear=function(t){return t===void 0&&(t={}),this._up(this.__getClearProps(),$r($r({},t),{__clear:!0})),this},r.prototype.canClear=function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})},r.prototype.getParent=function(){return this.__getParentProp()||null},r.prototype.isFull=function(){return!!this.get("full")},r.prototype.__parseValue=function(t,e){return this.parseValue(t,e)},r.prototype.__getClearProps=function(){return{value:""}},r.prototype.setValue=function(t,e,n){e===void 0&&(e=!0),n===void 0&&(n={});var i=this.parseValue(t),l=!e;!l&&this.set({value:void 0},{avoidStore:l,silent:!0}),this.set(i,$r({avoidStore:l},n))},r.prototype.setValueFromInput=function(t,e,n){n===void 0&&(n={}),this.setValue(t,e,$r($r({},n),{fromInput:1}))},r.prototype.parseValue=function(t,e){e===void 0&&(e={});var n={value:t},i="!important";if((0,S.isString)(t)&&t.indexOf(i)!==-1&&(n.value=t.replace(i,"").trim(),n.important=!0),!this.get("functionName")&&!e.complete)return n;var l=[],f="".concat(n.value),d=f.indexOf("(")+1,v=f.lastIndexOf(")"),h=f.substring(0,d-1);if(h&&(n.functionName=h),l.push(d),v>=0&&l.push(v),n.value=String.prototype.substring.apply(f,l),e.numeric){var w=parseFloat(n.value);n.unit=n.value.replace(w,""),n.value=w}return n},r.prototype.__getFullValue=function(t){var e=(t===void 0?{}:t).withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()},r.prototype.getFullValue=function(t,e){e===void 0&&(e={});var n=this.get("functionName"),i=this.getDefaultValue(),l=(0,S.isUndefined)(t)?this.get("value"):t,f=!(0,S.isUndefined)(l)&&l!=="";if(l&&i&&l===i)return i;if(n&&f){var d=n==="url"?"'".concat(l.replace(/'|"/g,""),"'"):l;l="".concat(n,"(").concat(d,")")}return f&&this.get("important")&&!e.skipImportant&&(l="".concat(l," !important")),l||""},r.prototype.__setParentTarget=function(t){this.up({parentTarget:t})},r.prototype.getParentTarget=function(){return this.get("parentTarget")||null},r.prototype.__parseFn=function(t){t===void 0&&(t="");var e=t.indexOf("(")+1,n=t.lastIndexOf(")");return{name:t.substring(0,e-1).trim(),value:String.prototype.substring.apply(t,[e,n>=0?n:void 0]).trim()}},r.prototype.__checkVisibility=function(t){var e=t.target,n=t.component,i=t.sectors,l=n||e;if(!l)return!1;var f=this.getId(),d=this.getName(),v=this.get("toRequire"),h=this.get("requires"),w=this.get("requiresParent"),C=l.get("unstylable"),L=l.get("stylable-require"),F=l.get("stylable");if((0,S.isArray)(F)&&(F=F.indexOf(d)>=0),(0,S.isArray)(C)&&(F=C.indexOf(d)<0),v&&(F=!e||L&&(L.indexOf(f)>=0||L.indexOf(d)>=0)),i&&h){var q=(0,S.keys)(h);i.forEach(function(It){It.getProperties().forEach(function(ie){if((0,S.includes)(q,ie.id)){var se=h[ie.id];F=F&&(0,S.includes)(se,ie.get("value"))}})})}if(w){var et=n&&n.parent(),X=et&&et.getEl();if(X){var At=(0,H.hasWin)()?window.getComputedStyle(X):{};(0,S.each)(w,function(It,ie){F=F&&At[ie]&&(0,S.includes)(It,At[ie])})}else F=!1}return!!F},r}(k.Hn);const On=wf;wf.callParentInit=function(a,r,t,e){e===void 0&&(e={}),a.prototype.initialize.apply(r,[t,$r($r({},e),{skipInit:1})])},wf.callInit=function(a,r,t){t===void 0&&(t={}),!t.skipInit&&a.init(r,t)};var Lg=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),wl=function(){return wl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t=0?t:void 0},r.prototype.selectLayer=function(t){return this.set("selectedLayer",t,{__select:!0})},r.prototype.selectLayerAt=function(t){t===void 0&&(t=0);var e=this.getLayer(t);return e&&this.selectLayer(e)},r.prototype.moveLayer=function(t,e){e===void 0&&(e=0);var n=t?t.getIndex():-1;n>=0&&(0,S.isNumber)(e)&&e>=0&&e0&&!e},r.prototype.clear=function(t){return t===void 0&&(t={}),this.__getLayers().reset(),this.__upTargetsStyleProps(t),On.prototype.clear.call(this),this},r.prototype.__canClearProp=function(){return!1},r}(_l);const $g=Wg;var qg=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ju=function(){return Ju=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
`)},r.prototype.templateLabel=function(t){var e=this.pfx,n=this.em,i=t.parent,l=t.attributes,f=l.icon,d=f===void 0?"":f,v=l.info,h=v===void 0?"":v,w=n==null?void 0:n.getConfig().icons,C=(w==null?void 0:w.close)||"";return` `).concat(t.getLabel(),` `).concat(i?"":'"),` `)},r.prototype.templateInput=function(t){return`
`)},r.prototype.remove=function(){var t=this;return k.G7.prototype.remove.apply(this,arguments),["em","input","$input","view"].forEach(function(e){return t[e]=null}),this.__destroyFn(this._getClbOpts()),this},r.prototype.updateStatus=function(){var t,e=this,n=e.model,i=e.pfx,l=e.ppfx,f=e.config,d="".concat(l,"four-color"),v="".concat(l,"color-warn"),h=this.$el.children(".".concat(i,"label")),w=this.getClearEl(),C=w?w.style:{};h.removeClass("".concat(d," ").concat(v)),C.display="none",n.hasValue({noParent:!0})&&f.highlightChanged?(h.addClass(d),f.clearProperties&&(C.display="")):n.hasValue()&&f.highlightComputed&&h.addClass(v),(t=this.parent)===null||t===void 0||t.updateStatus()},r.prototype.clear=function(t){t&&t.stopPropagation(),this.model.clear()},r.prototype.getClearEl=function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(_f,"]"))),this.clearEl},r.prototype.inputValueChanged=function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)},r.prototype.onValueChange=function(t,e,n){this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},r.prototype.setValue=function(t){var e=this.model,n=(0,S.isUndefined)(t)||t===""?e.getDefaultValue():t;if(this.update)return this.__update(n);this.__setValueInput(n)},r.prototype.__setValueInput=function(t){var e=this.getInputEl();e&&(e.value=t)},r.prototype.getInputEl=function(){return this.input||(this.input=this.el.querySelector("input")),this.input},r.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},r.prototype.clearCached=function(){delete this.clearEl,delete this.input,delete this.$input},r.prototype.__unset=function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())},r.prototype.__update=function(t){var e=this.update&&this.update.bind(this);e&&e(Ju(Ju({},this._getClbOpts()),{value:t}))},r.prototype.__change=function(){for(var t=[],e=0;e `)},r.prototype.remove=function(){var t;return(t=this.props)===null||t===void 0||t.remove(),Ii.prototype.remove.apply(this,arguments),this},r.prototype.onValueChange=function(){},r.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.get("properties");if(n.length&&!this.props){var i=e.isDetached(),l=new xf({config:Zu(Zu({},this.config),{highlightComputed:i,highlightChanged:i}),collection:n,parent:this});l.render(),this.$el.find("#".concat(t,"input-holder")).append(l.el),this.props=l}},r.prototype.clearCached=function(){Ii.prototype.clearCached.apply(this,arguments),delete this.props},r}(Ii);var Qg=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),tv=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return Qg(r,a),r.prototype.events=function(){return{click:"select","click [data-close-layer]":"removeItem","mousedown [data-move-layer]":"initSorter","touchstart [data-move-layer]":"initSorter"}},r.prototype.template=function(){var t=this,e=t.pfx,n=t.ppfx,i=t.em,l=i==null?void 0:i.getConfig().icons,f=(l==null?void 0:l.close)||"",d=(l==null?void 0:l.move)||"";return`
`).concat(d,`
`).concat(f,`
`)},r.prototype.initialize=function(t){t===void 0&&(t={});var e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.propertyView=t.propertyView;var i=this.propertyView.model;this.listenTo(e,"destroy remove",this.remove),this.listenTo(e,"change:values",this.updateLabel),this.listenTo(i,"change:selectedLayer",this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data("model",e)},r.prototype.initSorter=function(){var t;(t=this.sorter)===null||t===void 0||t.startSort(this.el)},r.prototype.removeItem=function(t){t&&t.stopPropagation(),this.model.remove()},r.prototype.select=function(){this.model.select()},r.prototype.getPropertiesWrapper=function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector("[data-properties]")),this.propsWrapEl},r.prototype.getPreviewEl=function(){return this.previewEl||(this.previewEl=this.el.querySelector("[data-preview]")),this.previewEl},r.prototype.getLabelEl=function(){return this.labelEl||(this.labelEl=this.el.querySelector("[data-label]")),this.labelEl},r.prototype.updateLabel=function(){var t=this.model,e=t.getLabel();if(this.getLabelEl().innerHTML=e,t.hasPreview()){var n=this.getPreviewEl(),i=t.getStylePreview({number:{min:-3,max:3}}),l=(0,S.keys)(i).map(function(f){return"".concat(f,":").concat(i[f])}).join(";");n.setAttribute("style",l)}},r.prototype.updateVisibility=function(){var t,e=this,n=e.pfx,i=e.model,l=e.propertyView,f=this.getPropertiesWrapper(),d=i.isSelected();f.style.display=d?"":"none",this.$el[d?"addClass":"removeClass"]("".concat(n,"active")),d&&f.appendChild((t=l.props)===null||t===void 0?void 0:t.el)},r.prototype.render=function(){var t=this,e=t.el,n=t.pfx,i=t.model;return e.innerHTML=this.template(),e.className="".concat(n,"layer"),i.hasPreview()&&(e.querySelector("[data-preview-box]").style.display=""),this.updateLabel(),this.updateVisibility(),this},r}(k.G7);const ev=tv;var nv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rv=function(a){function r(t){var e=a.call(this,t)||this,n=e.collection,i=t.config||{},l=i.em,f=i.stylePrefix||"",d=i.pStylePrefix||"";e.config=i,e.pfx=f,e.ppfx=d,e.propertyView=t.propertyView,e.className="".concat(f,"layers ").concat(d,"field"),e.listenTo(n,"add",e.addTo),e.listenTo(n,"reset",e.reset),e.items=[];var v=l==null?void 0:l.Utils;return e.sorter=v?new v.Sorter({container:e.el,ignoreViewChildren:1,containerSel:".".concat(f,"layers"),itemSel:".".concat(f,"layer"),pfx:i.pStylePrefix}):"",n.view=e,e.$el.data("model",n),e.$el.data("collection",n),e}return nv(r,a),r.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},r.prototype.addToCollection=function(t,e,n){var i=e||null,l=this,f=l.propertyView,d=l.config,v=l.sorter,h=l.$el,w=new ev({model:t,config:d,sorter:v,propertyView:f}),C=w.render().el;if(this.items.push(w),i)i.appendChild(C);else if(n!==void 0){var L="before";h.children().length===n&&(n--,L="after"),n<0?h.append(C):h.children().eq(n)[L](C)}else h.append(C);return C},r.prototype.reset=function(t,e){this.clearItems(),this.render()},r.prototype.remove=function(){return this.clearItems(),k.G7.prototype.remove.apply(this,arguments),this},r.prototype.clearItems=function(){this.items.forEach(function(t){return t.remove()}),this.items=[]},r.prototype.render=function(){var t=this,e=this.$el,n=this.sorter,i=document.createDocumentFragment();return e.empty(),this.collection.forEach(function(l){return t.addToCollection(l,i)}),e.append(i),e.attr("class",this.className),n&&(n.plh=null),this},r}(k.G7);const ov=rv;var iv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),xl=function(){return xl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
`)},r.prototype.init=function(){var t=this.model;this.listenTo(t.__getLayers(),"change reset",this.updateStatus)},r.prototype.addLayer=function(){this.model.addLayer({},{at:0})},r.prototype.setValue=function(){},r.prototype.remove=function(){var t;return(t=this.layersView)===null||t===void 0||t.remove(),Tc.prototype.remove.apply(this,arguments),this},r.prototype.clearCached=function(){Tc.prototype.clearCached.apply(this,arguments),delete this.layersView},r.prototype.onRender=function(){var t=this,e=t.model,n=t.el,i=t.config,l=e.get("properties");if(l.length&&!this.props){var f=new xf({config:xl(xl({},i),{highlightComputed:!1,highlightChanged:!1}),collection:l,parent:this});f.render();var d=new ov({collection:e.__getLayers(),config:i,propertyView:this});d.render(),n.querySelector("[data-layers-wrapper]").appendChild(d.el),this.props=f,this.layersView=d}},r}(Tc);const av=sv;var lv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Qu=function(){return Qu=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
').concat(l,`
`)},r.prototype.__setValueInput=function(t){var e=this.model,n=this.el,i=e.getDefaultValue(),l=n.querySelector("[data-preview-box]"),f=n.querySelector("[data-preview]");l.style.display=t&&t!==i?"":"none",f.style.backgroundImage=t||e.getDefaultValue()},r.prototype.openAssetManager=function(){var t,e=this,n=(t=this.em)===null||t===void 0?void 0:t.Assets;n==null||n.open({select:function(i,l){var f=(0,S.isString)(i)?i:i.get("src");e.model.upValue(f,{partial:!l}),l&&n.close()},types:["image"],accept:"image/*"})},r}(Ii);var uv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const Fi=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return uv(r,a),r.prototype.templateInput=function(t){return""},r.prototype.init=function(){var t=this.model;this.listenTo(t,"change:unit",this.onValueChange),this.listenTo(t,"change:units",this.render)},r.prototype.setValue=function(t){},r.prototype.onRender=function(){var t=this,e=t.ppfx,n=t.model,i=t.el;if(!this.inputInst){var l=n.input;l.ppfx=e,l.render(),i.querySelector(".".concat(e,"fields")).appendChild(l.el),this.input=l.inputEl.get(0),this.inputInst=l}},r.prototype.clearCached=function(){Ii.prototype.clearCached.apply(this,arguments),this.inputInst=null},r}(Ii);var pv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();const fv=function(a){function r(){return a!==null&&a.apply(this,arguments)||this}return pv(r,a),r.prototype.setValue=function(t){var e;(e=this.inputInst)===null||e===void 0||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})},r.prototype.remove=function(){var t=this;Fi.prototype.remove.apply(this,arguments);var e=this.inputInst;return e&&e.remove&&e.remove(),["inputInst","$color"].forEach(function(n){return t[n]=null}),this},r.prototype.__handleChange=function(t,e){this.model.upValue(t,{partial:e})},r.prototype.onRender=function(){var t;if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var e=this,n=e.ppfx,i=e.model,l=e.em,f=e.el,d=new pc({target:l,model:i,ppfx:n,onChange:this.__handleChange}).render();f.querySelector(".".concat(n,"fields")).appendChild(d.el),this.input=(t=d.inputEl)===null||t===void 0?void 0:t.get(0),this.inputInst=d}},r}(Fi);var dv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),tp=function(){return tp=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
`)},r.prototype.updateOptions=function(){delete this.input,this.onRender()},r.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.getOptions();if(!this.input){var i=[];n.forEach(function(f){var d=e.getOptionId(f),v=e.getOptionLabel(d),h=f.style?f.style.replace(/"/g,"""):"",w=h?'style="'.concat(h,'"'):"",C=d.replace(/"/g,""");i.push('"))});var l=this.el.querySelector("#".concat(t,"input-holder"));l.innerHTML=""),this.input=l.firstChild}},r.prototype.__setValueInput=function(t){var e=this.model,n=this.getInputEl(),i=e.getOptions()[0],l=i?e.getOptionId(i):"";n&&(n.value=t||l)},r}(Ii);var gv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ep=function(){return ep=Object.assign||function(a){for(var r,t=1,e=arguments.length;t')},r.prototype.onRender=function(){var t=this.pfx,e=this.ppfx,n=this.model,i="".concat(e,"radio-item-label"),l=n.getName(),f=n.getOptions(),d="".concat(t,"radio ").concat(t,"radio-").concat(l),v=n.cid;if(!this.input){var h=[];f.forEach(function(C){var L=C.className?"".concat(C.className," ").concat(t,"icon ").concat(i):"",F=n.getOptionId(C),q="".concat(l,"-").concat(F,"-").concat(v),et=L?"":n.getOptionLabel(F),X=C.title?'title="'.concat(C.title,'"'):"",At=n.getValue()===F?"checked":"";h.push(`
`))});var w=this.el.querySelector(".".concat(e,"field"));w.innerHTML='
').concat(h.join(""),"
"),this.input=w.firstChild}},r.prototype.__setValueInput=function(t){var e,n=this.model,i=t||n.getDefaultValue(),l=(e=this.getInputEl())===null||e===void 0?void 0:e.querySelector('[value="'.concat(i,'"]'));l&&(l.checked=!0)},r}(_d);var bv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),_a=function(){return _a=Object.assign||function(a){for(var r,t=1,e=arguments.length;t `)},r.prototype.getSliderEl=function(){return this.slider||(this.slider=this.el.querySelector("input[type=range]")),this.slider},r.prototype.inputValueChanged=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value)},r.prototype.inputValueChangedSoft=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value,{partial:!0})},r.prototype.setValue=function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=t===""?e.getDefaultValue():parseFloat(n.value),Fi.prototype.setValue.apply(this,arguments)},r.prototype.onRender=function(){Fi.prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},r.prototype.clearCached=function(){Fi.prototype.clearCached.apply(this,arguments),delete this.slider},r}(Fi),Sf=k.FE.extend(Ct).extend({extendViewApi:1,init:function(){var a=this.opts,r=this.em,t=a.module||(r==null?void 0:r.get("StyleManager"));t&&(t.__listenAdd(this,t.events.propertyAdd),t.__listenRemove(this,t.events.propertyRemove))},types:[{id:"stack",model:$g,view:av,isType:function(a){if(a&&a.type=="stack")return a}},{id:"composite",model:_l,view:Tc,isType:function(a){if(a&&a.type=="composite")return a}},{id:"file",model:On,view:cv,isType:function(a){if(a&&a.type=="file")return a}},{id:"color",model:On,view:fv,isType:function(a){if(a&&a.type=="color")return a}},{id:"select",model:Cf,view:_d,isType:function(a){if(a&&a.type=="select")return a}},{id:"radio",model:vv,view:yv,isType:function(a){if(a&&a.type=="radio")return a}},{id:"slider",model:_v,view:Cv,isType:function(a){if(a&&a.type=="slider")return a}},{id:"integer",model:np,view:Fi,isType:function(a){if(a&&a.type=="integer")return a}},{id:"number",model:np,view:Fi,isType:function(a){if(a&&a.type=="number")return a}},{id:"base",model:On,view:Ii,isType:function(a){return a.type="base",a}}]});var Sv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ip=function(){return ip=Object.assign||function(a){for(var r,t=1,e=arguments.length;t
$',`
',`
`],[`
$',`
',`
`])),d,d,f,d,i)},r.prototype.events=function(){return{"click [data-sector-title]":"toggle"}},r.prototype.updateOpen=function(){var t=this,e=t.$el,n=t.model,i=t.pfx,l=n.isOpen();e[l?"addClass":"removeClass"]("".concat(i,"open")),this.getPropertiesEl().style.display=l?"":"none"},r.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?"":"none"},r.prototype.getPropertiesEl=function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)},r.prototype.toggle=function(){var t=this.model;t.setOpen(!t.get("open"))},r.prototype.renderProperties=function(){var t=this.model,e=this.config,n=t.get("properties");if(n){var i=new xf({collection:n,config:e});this.$el.append(i.render().el)}},r.prototype.render=function(){var t=this,e=t.pfx,n=t.model,i=t.$el,l=n.getId(),f=n.getName();return i.html(this.template({pfx:e,label:f})),this.renderProperties(),i.attr("class","".concat(e,"sector ").concat(e,"sector__").concat(l," no-select")),this.updateOpen(),this},r}(k.G7);const Nv=Dv;var Cd,Iv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Fv=function(a){function r(t){t===void 0&&(t={});var e=a.call(this,t)||this,n=t.module,i=t.config,l=e.collection;return e.pfx=(i==null?void 0:i.stylePrefix)||"",e.ppfx=(i==null?void 0:i.pStylePrefix)||"",e.config=i,e.module=n,e.listenTo(l,"add",e.addTo),e.listenTo(l,"reset",e.render),e}return Iv(r,a),r.prototype.remove=function(){var t=this;return k.G7.prototype.remove.apply(this,arguments),["config","module","em"].forEach(function(e){return t[e]={}}),this},r.prototype.addTo=function(t,e,n){n===void 0&&(n={}),this.addToCollection(t,null,n)},r.prototype.addToCollection=function(t,e,n){n===void 0&&(n={});var i=this.config,l=this.el,f=e||l,d=new Nv({model:t,config:i}).render().el;return(0,Ne.$Q)(f,d,n.at),d},r.prototype.render=function(){var t=this,e=this,n=e.$el,i=e.pfx,l=e.ppfx;n.empty();var f=document.createDocumentFragment();return this.collection.each(function(d){return t.addToCollection(d,f)}),n.append(f),n.addClass("".concat(i,"sectors ").concat(l,"one-bg ").concat(l,"two-color")),this},r}(k.G7);const Vv=Fv;var Rv=function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}a(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ts=function(){return Ts=Object.assign||function(a){for(var r,t=1,e=arguments.length;t0&&n[n.length-1])||h[0]!==6&&h[0]!==2)){l=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]=e.getStepsBeforeSave()&&this.store().catch(function(i){return t.logError(i)})},r.prototype.loadModule=function(t){var e=new t(this);return this.set(e.name,e),e.onLoad&&this.toLoad.push(e),this.modules.push(e),e},r.prototype.loadStorableModule=function(t){var e=this.loadModule(t);return this.storables.push(e),e},r.prototype.init=function(t,e){e===void 0&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set("Editor",t)},r.prototype.getEditor=function(){return this.get("Editor")},r.prototype.handleUpdates=function(t,e,n){var i=this;n===void 0&&(n={}),this.__skip||n.temporary||n.noCount||n.avoidStore||!this.get("ready")||(this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout(function(){var l=i.getDirtyCount()||0,f=(n.unset,Jv(n,["unset"]));i.set("changesCount",l+1,f)},0))},r.prototype.changesUp=function(t){this.handleUpdates(0,0,t)},r.prototype.componentHovered=function(t,e,n){var i=this.previous("componentHovered");i&&this.trigger("component:unhovered",i,n),e&&this.trigger("component:hovered",e,n)},r.prototype.getSelected=function(){return this.selected.lastComponent()},r.prototype.getSelectedAll=function(){return this.selected.allComponents()},r.prototype.setSelected=function(t,e){var n=this;e===void 0&&(e={});var i=e.event,l=i&&(i.ctrlKey||i.metaKey),f=(i||{}).shiftKey,d=((0,S.isArray)(t)?t:[t]).map(function(C){return(0,H.getModel)(C,W.default)}),v=this.getSelectedAll(),h=this.getConfig().multipleSelection,w=(0,S.isArray)(t);w&&this.removeSelected(v.filter(function(C){return!(0,S.contains)(d,C)})),d.forEach(function(C){var L=(0,H.getModel)(C,void 0);if(L&&(n.trigger("component:select:before",L,e),!L.get("selectable")||e.abort)){if(!e.useValid)return;for(var F=L.parent();F&&!F.get("selectable");)F=F.parent();L=F}if(l&&h)return n.toggleSelected(L);if(f&&h){n.clearSelection(n.get("Canvas").getWindow());var q,et,X=L.collection,At=L.index();if(n.getSelectedAll().forEach(function(It){var ie=It.collection,se=It.index();ie===X&&(seAt&&(et=(0,S.isUndefined)(et)?se:Math.min(et,se)))}),!(0,S.isUndefined)(q))for(;q!==At;)n.addSelected(X.at(q)),q++;if(!(0,S.isUndefined)(et))for(;et!==At;)n.addSelected(X.at(et)),et--;return n.addSelected(L)}!w&&n.removeSelected(v.filter(function(It){return It!==L})),n.addSelected(L,e)})},r.prototype.addSelected=function(t,e){var n=this;e===void 0&&(e={});var i=(0,H.getModel)(t,W.default);((0,S.isArray)(i)?i:[i]).forEach(function(l){var f=n.selected;l&&l.get("selectable")&&!l.parents().some(function(d){return f.hasComponent(d)})&&(e.forceChange&&n.removeSelected(l,e),f.allComponents().filter(function(d){return(0,S.contains)(d.parents(),l)}).forEach(function(d){return n.removeSelected(d,e)}),f.addComponent(l,e),l&&n.trigger("component:select",l,e))})},r.prototype.removeSelected=function(t,e){e===void 0&&(e={}),this.selected.removeComponent((0,H.getModel)(t,W.default),e)},r.prototype.toggleSelected=function(t,e){var n=this;e===void 0&&(e={});var i=(0,H.getModel)(t,W.default);((0,S.isArray)(i)?i:[i]).forEach(function(l){n.selected.hasComponent(l)?n.removeSelected(l,e):n.addSelected(l,e)})},r.prototype.setHovered=function(t,e){if(e===void 0&&(e={}),!t)return this.set("componentHovered","");var n="component:hover",i=(0,H.getModel)(t,void 0);if(i){if(e.forceChange&&this.set("componentHovered",""),this.trigger("".concat(n,":before"),i,e),!i.get("hoverable")){if(!e.useValid||e.abort)return;for(var l=i&&i.parent();l&&!l.get("hoverable");)l=l.parent();i=l}e.abort||(this.set("componentHovered",i,e),this.trigger(n,i,e))}},r.prototype.getHovered=function(){return this.get("componentHovered")},r.prototype.setComponents=function(t,e){return e===void 0&&(e={}),this.get("DomComponents").setComponents(t,e)},r.prototype.getComponents=function(){var t=this.get("DomComponents"),e=this.get("CodeManager");if(t&&e){var n=t.getComponents();return e.getCode(n,"json")}},r.prototype.setStyle=function(t,e){e===void 0&&(e={});var n=this.get("CssComposer");return n.clear(e),n.getAll().add(t,e),this},r.prototype.addStyle=function(t,e){e===void 0&&(e={});var n=this.getStyle().add(t,e);return(0,S.isArray)(n)?n:[n]},r.prototype.getStyle=function(){return this.Css.getAll()},r.prototype.setState=function(t){return this.set("state",t),this},r.prototype.getState=function(){return this.get("state")||""},r.prototype.getHtml=function(t){t===void 0&&(t={});var e=this.config,n=e.optsHtml,i=e.jsInHtml?this.getJs(t):"",l=t.component||this.get("DomComponents").getComponent(),f=l?this.get("CodeManager").getCode(l,"html",Pr(Pr({},n),t)):"";return f+=i?"