1import"./chunk-OID2WIP6.js";var Ag={982:((a,r,t)=>{var e,n,i;(function(l){n=[t(523),t(391)],e=l,i=typeof e=="function"?e.apply(r,n):e,i!==void 0&&(a.exports=i)})(function(l,u){var c=Array.prototype.slice;function f(q,lt,H){return H.length<=4?q.call(lt,H[0],H[1],H[2],H[3]):q.apply(lt,H)}function v(q,lt){return c.call(q,lt)}function g(q,lt){return q==null?!1:(l.isArray(lt)||(lt=v(arguments,1)),l.all(lt,function(H){return H in q}))}var y=(function(){var q=!1,lt=-1;function H(){lt++,q=!0,l.defer(function(){q=!1})}return function(){return q||H(),lt}})();function _(){this.registeredObjects=[],this.cidIndexes=[]}_.prototype={isRegistered:function(q){return q&&q.cid?this.registeredObjects[q.cid]:l.contains(this.registeredObjects,q)},register:function(q){return this.isRegistered(q)?!1:(q&&q.cid?(this.registeredObjects[q.cid]=q,this.cidIndexes.push(q.cid)):this.registeredObjects.push(q),!0)},unregister:function(q){if(this.isRegistered(q)){if(q&&q.cid)delete this.registeredObjects[q.cid],this.cidIndexes.splice(l.indexOf(this.cidIndexes,q.cid),1);else{var lt=l.indexOf(this.registeredObjects,q);this.registeredObjects.splice(lt,1)}return!0}return!1},get:function(){return l.map(this.cidIndexes,function(q){return this.registeredObjects[q]},this).concat(this.registeredObjects)}};function b(q,lt,H,I){for(var B=0,U=lt.length,et;B<U;B++)if(et=lt[B],!!et){if(q==="on"){if(!I.objectRegistry.register(et))continue}else if(!I.objectRegistry.unregister(et))continue;l.isFunction(et[q])&&et[q]("all",H,I)}}function S(q,lt){var H=lt.type,I=lt.undoTypes,B=!I[H]||I[H][q];l.isFunction(B)&&B(lt.object,lt.before,lt.after,lt.options)}function E(q,lt,H,I,B){if(!(H.isCurrentlyUndoRedoing||q==="undo"&&H.pointer===-1||q==="redo"&&H.pointer===H.length-1)){H.isCurrentlyUndoRedoing=!0;var U,et,A=q==="undo";for(B?et=A&&H.pointer===H.length-1||!A&&H.pointer===-1?l.clone(H.models):c.apply(H.models,A?[0,H.pointer]:[H.pointer,H.length-1]):(U=H.at(A?H.pointer:H.pointer+1),et=I?H.where({magicFusionIndex:U.get("magicFusionIndex")}):[U]),H.pointer+=(A?-1:1)*et.length;U=A?et.pop():et.shift();)U[q]();H.isCurrentlyUndoRedoing=!1,lt.trigger(q,lt)}}function N(q,lt){var H=q.condition,I=typeof H;return I==="function"?!!f(H,q,lt):I==="boolean"?H:!0}function z(q,lt,H,I){if(q.track&&!q.isCurrentlyUndoRedoing&< in I&&N(I[lt],H)){var B=f(I[lt].on,I[lt],H),U;if(g(B,"object","before","after")){if(B.type=lt,B.magicFusionIndex=y(),B.undoTypes=I,q.pointer<q.length-1)for(var U=q.length-q.pointer-1;U--;)q.pop();q.pointer=q.length,q.add(B),q.length>q.maximumStackLength&&(q.shift(),q.pointer--)}}}var R={add:{undo:function(q,lt,H,I){q.remove(H,I)},redo:function(q,lt,H,I){I.index&&(I.at=I.index),q.add(H,I)},on:function(q,lt,H){return{object:lt,before:void 0,after:q,options:l.clone(H)}}},remove:{undo:function(q,lt,H,I){"index"in I&&(I.at=I.index),q.add(lt,I)},redo:function(q,lt,H,I){q.remove(lt,I)},on:function(q,lt,H){return{object:lt,before:q,after:void 0,options:l.clone(H)}}},change:{undo:function(q,lt,H,I){l.isEmpty(lt)?l.each(l.keys(H),q.unset,q):(q.set(lt),I&&I.unsetData&&I.unsetData.before&&I.unsetData.before.length&&l.each(I.unsetData.before,q.unset,q))},redo:function(q,lt,H,I){l.isEmpty(H)?l.each(l.keys(lt),q.unset,q):(q.set(H),I&&I.unsetData&&I.unsetData.after&&I.unsetData.after.length&&l.each(I.unsetData.after,q.unset,q))},on:function(q,lt){var H=q.changedAttributes(),I=l.keys(H),B=l.pick(q.previousAttributes(),I),U=l.keys(B),et=(lt||(lt={})).unsetData={after:[],before:[]};return I.length!=U.length&&(I.length>U.length?l.each(I,function(A){A in B||et.before.push(A)},this):l.each(U,function(A){A in H||et.after.push(A)})),{object:q,before:B,after:H,options:l.clone(lt)}}},reset:{undo:function(q,lt,H){q.reset(lt)},redo:function(q,lt,H){q.reset(H)},on:function(q,lt){return{object:q,before:lt.previousModels,after:l.clone(q.models)}}}};function W(){}W.prototype=R;function ct(q,lt,H,I){if(typeof lt=="object")return l.each(lt,function(B,U){q===2?ct(q,B,H,I):ct(q,U,B,H)});switch(q){case 0:g(H,"undo","redo","on")&&l.all(l.pick(H,"undo","redo","on"),l.isFunction)&&(I[lt]=H);break;case 1:I[lt]&&l.isObject(H)&&(I[lt]=l.extend({},I[lt],H));break;case 2:delete I[lt];break}return this}var _t=u.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(q){S("undo",this.attributes)},redo:function(q){S("redo",this.attributes)}}),xt=u.Collection.extend({model:_t,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(q){this.maximumStackLength=q}}),ut=u.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(q){this.stack=new xt,this.objectRegistry=new _,this.undoTypes=new W,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(lt,H){this.stack.setMaxLength(H)},this),q&&q.track&&this.startTracking(),q&&q.register&&(l.isArray(q.register)||l.isArguments(q.register)?f(this.register,this,q.register):this.register(q.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")}
vendor: 5,976 bytes, line 1
1,_addToStack:function(q){z(this.stack,q,v(arguments,1),this.undoTypes)},register:function(){b("on",arguments,this._addToStack,this)},unregister:function(){b("off",arguments,this._addToStack,this)},unregisterAll:function(){f(this.unregister,this,this.objectRegistry.get())},undo:function(q){E("undo",this,this.stack,q)},undoAll:function(){E("undo",this,this.stack,!1,!0)},redo:function(q){E("redo",this,this.stack,q)},redoAll:function(){E("redo",this,this.stack,!1,!0)},isAvailable:function(q){var lt=this.stack,H=lt.length;switch(q){case"undo":return H>0&<.pointer>-1;case"redo":return H>0&<.pointer<H-1;default:return!1}},merge:function(q){for(var lt=l.isArray(q)?q:v(arguments),H;H=lt.pop();)H instanceof ut&&H.stack instanceof xt&&(H.stack=this.stack)},addUndoType:function(q,lt){ct(0,q,lt,this.undoTypes)},changeUndoType:function(q,lt){ct(1,q,lt,this.undoTypes)},removeUndoType:function(q){ct(2,q,void 0,this.undoTypes)},clear:function(){this.stack.reset(),this.stack.pointer=-1}});return l.extend(ut,{defaults:function(q){l.extend(ut.prototype.defaults,q)},addUndoType:function(q,lt){ct(0,q,lt,R)},changeUndoType:function(q,lt){ct(1,q,lt,R)},removeUndoType:function(q){ct(2,q,void 0,R)}}),u.UndoManager=ut})}),391:((a,r,t)=>{var e,n;(function(i){var l=typeof self=="object"&&self.self===self&&self||typeof t.g=="object"&&t.g.global===t.g&&t.g;if(1)e=[t(523),t(694),r],n=function(f,v,g){l.Backbone=i(l,g,f,v)}.apply(r,e),n!==void 0&&(a.exports=n);else var u,c})(function(i,l,u,c){var f=i.Backbone,v=Array.prototype.slice;l.VERSION="1.4.1",l.$=c,l.noConflict=function(){return i.Backbone=f,this},l.emulateHTTP=!1,l.emulateJSON=!1;var g=l.Events={},y=/\s+/,_,b=function(T,F,$,ot,vt){var K=0,ft;if($&&typeof $=="object")for(ot!==void 0&&("context"in vt)&&vt.context===void 0&&(vt.context=ot),ft=u.keys($);K<ft.length;K++)F=b(T,F,ft[K],$[ft[K]],vt);else if($&&y.test($))for(ft=$.split(y);K<ft.length;K++)F=T(F,ft[K],ot,vt);else F=T(F,$,ot,vt);return F};g.on=function(T,F,$){if(this._events=b(S,this._events||{},T,F,{context:$,ctx:this,listening:_}),_){var ot=this._listeners||(this._listeners={});ot[_.id]=_,_.interop=!1}return this},g.listenTo=function(T,F,$){if(!T)return this;var ot=T._listenId||(T._listenId=u.uniqueId("l")),vt=this._listeningTo||(this._listeningTo={}),K=_=vt[ot];K||(this._listenId||(this._listenId=u.uniqueId("l")),K=_=vt[ot]=new ct(this,T));var ft=E(T,F,$,this);if(_=void 0,ft)throw ft;return K.interop&&K.on(F,$),this};var S=function(T,F,$,ot){if($){var vt=T[F]||(T[F]=[]),K=ot.context,ft=ot.ctx,it=ot.listening;it&&it.count++,vt.push({callback:$,context:K,ctx:K||ft,listening:it})}return T},E=function(T,F,$,ot){try{T.on(F,$,ot)}catch(vt){return vt}};g.off=function(T,F,$){return this._events?(this._events=b(N,this._events,T,F,{context:$,listeners:this._listeners}),this):this},g.stopListening=function(T,F,$){var ot=this._listeningTo;if(!ot)return this;for(var vt=T?[T._listenId]:u.keys(ot),K=0;K<vt.length;K++){var ft=ot[vt[K]];if(!ft)break;ft.obj.off(F,$,this),ft.interop&&ft.off(F,$)}return u.isEmpty(ot)&&(this._listeningTo=void 0),this};var N=function(T,F,$,ot){if(T){var vt=ot.context,K=ot.listeners,ft=0,it;if(!F&&!vt&&!$){for(it=u.keys(K);ft<it.length;ft++)K[it[ft]].cleanup();return}for(it=F?[F]:u.keys(T);ft<it.length;ft++){F=it[ft];var ne=T[F];if(!ne)break;for(var ye=[],de=0;de<ne.length;de++){var V=ne[de];if($&&$!==V.callback&&$!==V.callback._callback||vt&&vt!==V.context)ye.push(V);else{var tt=V.listening;tt&&tt.off(F,$)}}ye.length?T[F]=ye:delete T[F]}return T}};g.once=function(T,F,$){var ot=b(z,{},T,F,this.off.bind(this));return typeof T=="string"&&$==null&&(F=void 0),this.on(ot,F,$)},g.listenToOnce=function(T,F,$){var ot=b(z,{},F,$,this.stopListening.bind(this,T));return this.listenTo(T,ot)};var z=function(T,F,$,ot){if($){var vt=T[F]=u.once(function(){ot(F,vt),$.apply(this,arguments)});vt._callback=$}return T};g.trigger=function(T){if(!this._events)return this;for(var F=Math.max(0,arguments.length-1),$=Array(F),ot=0;ot<F;ot++)$[ot]=arguments[ot+1];return b(R,this._events,T,void 0,$),this};var R=function(T,F,$,ot){if(T){var vt=T[F],K=T.all;vt&&K&&(K=K.slice()),vt&&W(vt,ot),K&&W(K,[F].concat(ot))}return T},W=function(T,F){var $,ot=-1,vt=T.length,K=F[0],ft=F[1],it=F[2];switch(F.length){case 0:for(;++ot<vt;)($=T[ot]).callback.call($.ctx);return;case 1:for(;++ot<vt;)($=T[ot]).callback.call($.ctx,K);return;case 2:for(;++ot<vt;)($=T[ot]).callback.call($.ctx,K,ft);return;case 3:for(;++ot<vt;)($=T[ot]).callback.call($.ctx,K,ft,it);return;default:for(;++ot<vt;)($=T[ot]).callback.apply($.ctx,F);return}},ct=function(T,F){this.id=T._listenId,this.listener=T,this.obj=F,this.interop=!0,this.count=0,this._events=void 0};ct.prototype.on=g.on,ct.prototype.off=function(T,F){var $;this.interop?(this._events=b(N,this._events,T,F,{context:void 0,listeners:void 0}),$=!this._events):(this.count--,$=this.count===0),$&&this.cleanup()},ct.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},g.bind=g.on,g.unbind=g.off,u.extend(l,g);var _t=l.Model=function(T,F){var $=T||{};F||(F={}),this.preinitialize.apply(this,arguments),this.cid=u.uniqueId(this.cidPrefix),this.attributes={},F.collection&&(this.collection=F.collection),F.parse&&($=this.parse($,F)||{});var ot=u.result(this,"defaults");$=u.defaults(u.extend({},ot,$),ot),this.set($,F),this.changed={},this.initialize.apply(this,arguments)};u.extend(_t.prototype,g,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(T){return u.clone(this.attributes)},sync:function(){return l.sync.apply(this,arguments)},get:function(T){return this.attributes[T]},escape:function(T){return u.escape(this.get(T))},has:function(T){return this.get(T)!=null},matches:function(T){return!!u.iteratee(T,this)(this.attributes)},set:function(T,F,$){if(T==null)return this;var ot;if(typeof T=="object"?(ot=T,$=F):(ot={})[T]=F,$||($={}
1),!this._validate(ot,$))return!1;var vt=$.unset,K=$.silent,ft=[],it=this._changing;this._changing=!0,it||(this._previousAttributes=u.clone(this.attributes),this.changed={});var ne=this.attributes,ye=this.changed,de=this._previousAttributes;for(var V in ot)F=ot[V],u.isEqual(ne[V],F)||ft.push(V),u.isEqual(de[V],F)?delete ye[V]:ye[V]=F,vt?delete ne[V]:ne[V]=F;if(this.idAttribute in ot){var tt=this.id;this.id=this.get(this.idAttribute),this.trigger("changeId",this,tt,$)}if(!K){ft.length&&(this._pending=$);for(var M=0;M<ft.length;M++)this.trigger("change:"+ft[M],this,ne[ft[M]],$)}if(it)return this;if(!K)for(;this._pending;)$=this._pending,this._pending=!1,this.trigger("change",this,$);return this._pending=!1,this._changing=!1,this},unset:function(T,F){return this.set(T,void 0,u.extend({},F,{unset:!0}))},clear:function(T){var F={};for(var $ in this.attributes)F[$]=void 0;return this.set(F,u.extend({},T,{unset:!0}))},hasChanged:function(T){return T==null?!u.isEmpty(this.changed):u.has(this.changed,T)},changedAttributes:function(T){if(!T)return this.hasChanged()?u.clone(this.changed):!1;var F=this._changing?this._previousAttributes:this.attributes,$={},ot;for(var vt in T){var K=T[vt];u.isEqual(F[vt],K)||($[vt]=K,ot=!0)}return ot?$:!1},previous:function(T){return T==null||!this._previousAttributes?null:this._previousAttributes[T]},previousAttributes:function(){return u.clone(this._previousAttributes)},fetch:function(T){T=u.extend({parse:!0},T);var F=this,$=T.success;return T.success=function(ot){var vt=T.parse?F.parse(ot,T):ot;if(!F.set(vt,T))return!1;$&&$.call(T.context,F,ot,T),F.trigger("sync",F,ot,T)},pe(this,T),this.sync("read",this,T)},save:function(T,F,$){var ot;T==null||typeof T=="object"?(ot=T,$=F):(ot={})[T]=F,$=u.extend({validate:!0,parse:!0},$);var vt=$.wait;if(ot&&!vt){if(!this.set(ot,$))return!1}else if(!this._validate(ot,$))return!1;var K=this,ft=$.success,it=this.attributes;$.success=function(de){K.attributes=it;var V=$.parse?K.parse(de,$):de;if(vt&&(V=u.extend({},ot,V)),V&&!K.set(V,$))return!1;ft&&ft.call($.context,K,de,$),K.trigger("sync",K,de,$)},pe(this,$),ot&&vt&&(this.attributes=u.extend({},it,ot));var ne=this.isNew()?"create":$.patch?"patch":"update";ne==="patch"&&!$.attrs&&($.attrs=ot);var ye=this.sync(ne,this,$);return this.attributes=it,ye},destroy:function(T){T=T?u.clone(T):{};var F=this,$=T.success,ot=T.wait,vt=function(){F.stopListening(),F.trigger("destroy",F,F.collection,T)};T.success=function(ft){ot&&vt(),$&&$.call(T.context,F,ft,T),F.isNew()||F.trigger("sync",F,ft,T)};var K=!1;return this.isNew()?u.defer(T.success):(pe(this,T),K=this.sync("delete",this,T)),ot||vt(),K},url:function(){var T=u.result(this,"urlRoot")||u.result(this.collection,"url")||je();if(this.isNew())return T;var F=this.get(this.idAttribute);return T.replace(/[^\/]$/,"$&/")+encodeURIComponent(F)},parse:function(T,F){return T},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(T){return this._validate({},u.extend({},T,{validate:!0}))},_validate:function(T,F){if(!F.validate||!this.validate)return!0;T=u.extend({},this.attributes,T);var $=this.validationError=this.validate(T,F)||null;return $?(this.trigger("invalid",this,$,u.extend(F,{validationError:$})),!1):!0}});var xt=l.Collection=function(T,F){F||(F={}),this.preinitialize.apply(this,arguments),F.model&&(this.model=F.model),F.comparator!==void 0&&(this.comparator=F.comparator),this._reset(),this.initialize.apply(this,arguments),T&&this.reset(T,u.extend({silent:!0},F))},ut={add:!0,remove:!0,merge:!0},q={add:!0,remove:!1},lt=function(T,F,$){$=Math.min(Math.max($,0),T.length);var ot=Array(T.length-$),vt=F.length,K;for(K=0;K<ot.length;K++)ot[K]=T[K+$];for(K=0;K<vt;K++)T[K+$]=F[K];for(K=0;K<ot.length;K++)T[K+vt+$]=ot[K]};u.extend(xt.prototype,g,{model:_t,preinitialize:function(){},initialize:function(){},toJSON:function(T){return this.map(function(F){return F.toJSON(T)})},sync:function(){return l.sync.apply(this,arguments)},add:function(T,F){return this.set(T,u.extend({merge:!1},F,q))},remove:function(T,F){F=u.extend({},F);var $=!u.isArray(T);T=$?[T]:T.slice();var ot=this._removeModels(T,F);return!F.silent&&ot.length&&(F.changes={added:[],merged:[],removed:ot},this.trigger("update",this,F)),$?ot[0]:ot},set:function(T,F){if(T!=null){F=u.extend({},ut,F),F.parse&&!this._isModel(T)&&(T=this.parse(T,F)||[]);var $=!u.isArray(T);T=$?[T]:T.slice();var ot=F.at;ot!=null&&(ot=+ot),ot>this.length&&(ot=this.length),ot<0&&(ot+=this.length+1);var vt=[],K=[],ft=[],it=[],ne={},ye=F.add,de=F.merge,V=F.remove,tt=!1,M=this.comparator&&ot==null&&F.sort!==!1,Tt=u.isString(this.comparator)?this.comparator:null,ht,Lt;for(Lt=0;Lt<T.length;
1Lt++){ht=T[Lt];var Yt=this.get(ht);if(Yt){if(de&&ht!==Yt){var qt=this._isModel(ht)?ht.attributes:ht;F.parse&&(qt=Yt.parse(qt,F)),Yt.set(qt,F),ft.push(Yt),M&&!tt&&(tt=Yt.hasChanged(Tt))}ne[Yt.cid]||(ne[Yt.cid]=!0,vt.push(Yt)),T[Lt]=Yt}else ye&&(ht=T[Lt]=this._prepareModel(ht,F),ht&&(K.push(ht),this._addReference(ht,F),ne[ht.cid]=!0,vt.push(ht)))}if(V){for(Lt=0;Lt<this.length;Lt++)ht=this.models[Lt],ne[ht.cid]||it.push(ht);it.length&&this._removeModels(it,F)}var Bt=!1,re=!M&&ye&&V;if(vt.length&&re?(Bt=this.length!==vt.length||u.some(this.models,function(Ce,Pe){return Ce!==vt[Pe]}),this.models.length=0,lt(this.models,vt,0),this.length=this.models.length):K.length&&(M&&(tt=!0),lt(this.models,K,ot??this.length),this.length=this.models.length),tt&&this.sort({silent:!0}),!F.silent){for(Lt=0;Lt<K.length;Lt++)ot!=null&&(F.index=ot+Lt),ht=K[Lt],ht.trigger("add",ht,this,F);(tt||Bt)&&this.trigger("sort",this,F),(K.length||it.length||ft.length)&&(F.changes={added:K,removed:it,merged:ft},this.trigger("update",this,F))}return $?T[0]:T}},reset:function(T,F){F=F?u.clone(F):{};for(var $=0;$<this.models.length;$++)this._removeReference(this.models[$],F);return F.previousModels=this.models,this._reset(),T=this.add(T,u.extend({silent:!0},F)),F.silent||this.trigger("reset",this,F),T},push:function(T,F){return this.add(T,u.extend({at:this.length},F))},pop:function(T){var F=this.at(this.length-1);return this.remove(F,T)},unshift:function(T,F){return this.add(T,u.extend({at:0},F))},shift:function(T){var F=this.at(0);return this.remove(F,T)},slice:function(){return v.apply(this.models,arguments)},get:function(T){if(T!=null)return this._byId[T]||this._byId[this.modelId(this._isModel(T)?T.attributes:T,T.idAttribute)]||T.cid&&this._byId[T.cid]},has:function(T){return this.get(T)!=null},at:function(T){return T<0&&(T+=this.length),this.models[T]},where:function(T,F){return this[F?"find":"filter"](T)},findWhere:function(T){return this.where(T,!0)},sort:function(T){var F=this.comparator;if(!F)throw new Error("Cannot sort a set without a comparator");T||(T={});var $=F.length;return u.isFunction(F)&&(F=F.bind(this)),$===1||u.isString(F)?this.models=this.sortBy(F):this.models.sort(F),T.silent||this.trigger("sort",this,T),this},pluck:function(T){return this.map(T+"")},fetch:function(T){T=u.extend({parse:!0},T);var F=T.success,$=this;return T.success=function(ot){var vt=T.reset?"reset":"set";$[vt](ot,T),F&&F.call(T.context,$,ot,T),$.trigger("sync",$,ot,T)},pe(this,T),this.sync("read",this,T)},create:function(T,F){F=F?u.clone(F):{};var $=F.wait;if(T=this._prepareModel(T,F),!T)return!1;$||this.add(T,F);var ot=this,vt=F.success;return F.success=function(K,ft,it){$&&ot.add(K,it),vt&&vt.call(it.context,K,ft,it)},T.save(null,F),T},parse:function(T,F){return T},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(T,F){return T[F||this.model.prototype.idAttribute||"id"]},values:function(){return new I(this,B)},keys:function(){return new I(this,U)},entries:function(){return new I(this,et)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(T,F){if(this._isModel(T))return T.collection||(T.collection=this),T;F=F?u.clone(F):{},F.collection=this;var $;return this.model.prototype?$=new this.model(T,F):$=this.model(T,F),$.validationError?(this.trigger("invalid",this,$.validationError,F),!1):$},_removeModels:function(T,F){for(var $=[],ot=0;ot<T.length;ot++){var vt=this.get(T[ot]);if(vt){var K=this.indexOf(vt);this.models.splice(K,1),this.length--,delete this._byId[vt.cid];var ft=this.modelId(vt.attributes,vt.idAttribute);ft!=null&&delete this._byId[ft],F.silent||(F.index=K,vt.trigger("remove",vt,this,F)),$.push(vt),this._removeReference(vt,F)}}return $},_isModel:function(T){return T instanceof _t},_addReference:function(T,F){this._byId[T.cid]=T;var $=this.modelId(T.attributes,T.idAttribute);$!=null&&(this._byId[$]=T),T.on("all",this._onModelEvent,this)},_removeReference:function(T,F){delete this._byId[T.cid];var $=this.modelId(T.attributes,T.idAttribute);$!=null&&delete this._byId[$],this===T.collection&&delete T.collection,T.off("all",this._onModelEvent,this)},_onModelEvent:function(T,F,$,ot){if(F){if((T==="add"||T==="remove")&&$!==this)return;if(T==="destroy"&&this.remove(F,ot),T==="changeId"){var vt=this.modelId(F.previousAttributes(),F.idAttribute),K=this.modelId(F.attributes,F.idAttribute);vt!=null&&delete this._byId[vt],K!=null&&(this._byId[K]=F)}}this.trigger.apply(this,arguments)}});var H=typeof Symbol=="function"&&Symbol.iterator;H&&(xt.prototype[H]=xt.prototype.values);var I=function(T,F){this._collection=T,this._kind=F,this._index=0},B=1,U=2,et=3;H&&(I.prototype[H]=function(){return this}),I.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var T=this._collection.at(this._index);this._index++;var F;if(this._kind===B)F=T;else{var $=this._collection.modelId(T.attributes,T.idAttribute);this._kind===U?F=$:F=[$,T]}return{value:F,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var A=l.View=function(T){this.cid=u.uniqueId("view"),this.preinitialize.apply(this,arguments),u.extend(this,u.pick(T,yt)),this._ensureElement(),this.initialize.apply(this,arguments)},gt=/^(\S+)\s*(.*)$/,yt=["model","collection","el","id","attributes","className","tagName","events"];u.extend(A.prototype,g,{tagName:"div",$:function(T){return this.$el.find(T)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(T){return this.undelegateEvents(),this._setElement(T),this.delegateEvents(),this},_setElement:function(T){this.$el=T instanceof l.$?T:l.$(T),this.el=this.$el[0]},delegateEvents:function(T){if(T||(T=u.result(this,"events")),!T)return this;this.undelegateEvents();for(var F in T){var $=T[F];if(u.isFunction($)||($=this[$]),!!$){var ot=F.match(gt);this.delegate(ot[1],ot[2],$.bind(this))}}return this},delegate:function(T,F,$){return this.$el.on(T+".delegateEvents"+this.cid,F,$),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(T,F,$){return this.$el.off(T+".delegateEvents"+this.cid,F,$),this},_createElement:function(T){return document.createElement(T)},_ensureElement:function(){if(this.el)this.setElement(u.result(this,"el"));else{var T=u.extend({},u.result(this,"attributes"));this.id&&(T.id=u.result(this,"id")),this.className&&(T.class=u.result(this,"className")),this.setElement(this._createElement(u.result(this,"tagName"))),this._setAttributes(T)}},_setAttributes:function(T){this.$el.attr(T)}});var jt=function(T,F,$,ot){switch(F){case 1:return function(){return T[$](this[ot])};case 2:return function(vt){return T[$](this[ot],vt)};case 3:return function(vt,K){return T[$](this[ot],Xt(vt,this),K)};case 4:return function(vt,K,ft){return T[$](this[ot],Xt(vt,this),K,ft)};default:return function(){var vt=v.call(arguments);return vt.unshift(this[ot]),T[$].apply(T,vt)}}},te=function(T,F,$,ot){u.each($,function(vt,K){F[K]&&(T.prototype[K]=jt(F,vt,K,ot))})},Xt=function(T,F){return u.isFunction(T)?T:u.isObject(T)&&!F._isModel(T)?he(T):u.isString(T)?function($){return $.get(T)}:T},he=function(T){var F=u.matches(T);return function($){return F($.attributes)}},mt={forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},bt={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};u.each([[xt,mt,"models"],[_t,bt,"attributes"]],function(T){var F=T[0],$=T[1],ot=T[2];F.mixin=function(vt){var K=u.reduce(u.functions(vt),function(ft,it){return ft[it]=0,ft},{});te(F,vt,K,ot)},te(F,u,$,ot)}),l.sync=function(T,F,$){var ot=It[T];u.defaults($||($={}),{emulateHTTP:l.emulateHTTP,emulateJSON:l.emulateJSON});var vt={type:ot,dataType:"json"};if($.url||(vt.url=u.result(F,"url")||je()),$.data==null&&F&&(T==="create"||T==="update"||T==="patch")&&(vt.contentType="application/json",vt.data=JSON.stringify($.attrs||F.toJSON($))),$.emulateJSON&&(vt.contentType="application/x-www-form-urlencoded",vt.data=vt.data?{model:vt.data}:{}),$.emulateHTTP&&(ot==="PUT"||ot==="DELETE"||ot==="PATCH")){vt.type="POST",$.emulateJSON&&(vt.data._method=ot);var K=$.beforeSend;$.beforeSend=function(ne){if(ne.setRequestHeader("X-HTTP-Method-Override",ot),K)return K.apply(this,arguments)}}vt.type!=="GET"&&!$.emulateJSON&&(vt.processData=!1);var ft=$.error;$.error=function(ne,ye,de){$.textStatus=ye,$.errorThrown=de,ft&&ft.call($.context,ne,ye,de)};var it=$.xhr=l.ajax(u.extend(vt,$));return F.trigger("request",F,it,$),it};var It={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};l.ajax=function(){return l.$.ajax.apply(l.$,arguments)};var nt=l.Router=function(T){T||(T={}),this.preinitialize.apply(this,arguments),T.routes&&(this.routes=T.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},wt=/\((.*?)\)/g,Ot=/(\(\?)?:\w+/g,Ht=/\*\w+/g,Vt=/[\-{}\[\]+?.,\\\^$|#\s]/g;u.extend(nt.prototype,g,{preinitialize:function(){},initialize:function(){},route:function(T,F,$){u.isRegExp(T)||(T=this._routeToRegExp(T)),u.isFunction(F)&&
1($=F,F=""),$||($=this[F]);var ot=this;return l.history.route(T,function(vt){var K=ot._extractParameters(T,vt);ot.execute($,K,F)!==!1&&(ot.trigger.apply(ot,["route:"+F].concat(K)),ot.trigger("route",F,K),l.history.trigger("route",ot,F,K))}),this},execute:function(T,F,$){T&&T.apply(this,F)},navigate:function(T,F){return l.history.navigate(T,F),this},_bindRoutes:function(){if(this.routes){this.routes=u.result(this,"routes");for(var T,F=u.keys(this.routes);(T=F.pop())!=null;)this.route(T,this.routes[T])}},_routeToRegExp:function(T){return T=T.replace(Vt,"\\$&").replace(wt,"(?:$1)?").replace(Ot,function(F,$){return $?F:"([^/?]+)"}).replace(Ht,"([^?]*?)"),new RegExp("^"+T+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(T,F){var $=T.exec(F).slice(1);return u.map($,function(ot,vt){return vt===$.length-1?ot||null:ot?decodeURIComponent(ot):null})}});var Nt=l.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),typeof window<"u"&&(this.location=window.location,this.history=window.history)},Jt=/^[#\/]|\s+$/g,Ee=/^\/+|\/+$/g,ue=/#.*$/;Nt.started=!1,u.extend(Nt.prototype,g,{interval:50,atRoot:function(){var T=this.location.pathname.replace(/[^\/]$/,"$&/");return T===this.root&&!this.getSearch()},matchRoot:function(){var T=this.decodeFragment(this.location.pathname),F=T.slice(0,this.root.length-1)+"/";return F===this.root},decodeFragment:function(T){return decodeURI(T.replace(/%25/g,"%2525"))},getSearch:function(){var T=this.location.href.replace(/#.*/,"").match(/\?.+/);return T?T[0]:""},getHash:function(T){var F=(T||this).location.href.match(/#(.*)$/);return F?F[1]:""},getPath:function(){var T=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return T.charAt(0)==="/"?T.slice(1):T},getFragment:function(T){return T==null&&(this._usePushState||!this._wantsHashChange?T=this.getPath():T=this.getHash()),T.replace(Jt,"")},start:function(T){if(Nt.started)throw new Error("Backbone.history has already been started");if(Nt.started=!0,this.options=u.extend({root:"/"},this.options,T),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._hasHashChange="onhashchange"in window&&(document.documentMode===void 0||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.history&&this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(Ee,"/"),this._wantsHashChange&&this._wantsPushState)if(!this._hasPushState&&!this.atRoot()){var F=this.root.slice(0,-1)||"/";return this.location.replace(F+"#"+this.getPath()),!0}else 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 $=document.body,ot=$.insertBefore(this.iframe,$.firstChild).contentWindow;ot.document.open(),ot.document.close(),ot.location.hash="#"+this.fragment}var vt=window.addEventListener||function(K,ft){return attachEvent("on"+K,ft)};if(this._usePushState?vt("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?vt("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var T=window.removeEventListener||function(F,$){return detachEvent("on"+F,$)};this._usePushState?T("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&T("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),Nt.started=!1},route:function(T,F){this.handlers.unshift({route:T,callback:F})},checkUrl:function(T){var F=this.getFragment();if(F===this.fragment&&this.iframe&&(F=this.getHash(this.iframe.contentWindow)),F===this.fragment)return!1;this.iframe&&this.navigate(F),this.loadUrl()},loadUrl:function(T){return this.matchRoot()?(T=this.fragment=this.getFragment(T),u.some(this.handlers,function(F){if(F.route.test(T))return F.callback(T),!0})):!1},navigate:function(T,F){if(!Nt.started)return!1;(!F||F===!0)&&(F={trigger:!!F}),T=this.getFragment(T||"");var $=this.root;(T===""||T.charAt(0)==="?")&&($=$.slice(0,-1)||"/");var ot=$+T;T=T.replace(ue,"");var vt=this.decodeFragment(T);if(this.fragment!==vt){if(this.fragment=vt,this._usePushState)this.history[F.replace?"replaceState":"pushState"]({},document.title,ot);else if(this._wantsHashChange){if(this._updateHash(this.location,T,F.replace),this.iframe&&T!==this.getHash(this.iframe.contentWindow)){var K=this.iframe.contentWindow;F.replace||(K.document.open(),K.document.close()),this._updateHash(K.location,T,F.replace)}}else return this.location.assign(ot);if(F.trigger)return this.loadUrl(T)}},_updateHash:function(T,F,$){if($){var ot=T.href.replace(/(javascript:|#).*$/,"");T.replace(ot+"#"+F)}else T.hash="#"+F}}),l.history=new Nt;var Be=function(T,F){var $=this,ot;return T&&u.has(T,"constructor")?ot=T.constructor:ot=function(){return $.apply(this,arguments)},u.extend(ot,$,F),ot.prototype=u.create($.prototype,T),ot.prototype.constructor=ot,ot.__super__=$.prototype,ot};_t.extend=xt.extend=nt.extend=A.extend=Nt.extend=Be;var je=function(){throw new Error('A "url" property or function must be specified')},pe=function(T,F){var $=F.error;F.error=function(ot){$&&$.call(F.context,T,ot,F),T.trigger("error",T,ot,F)}};return l})}),862:((a,r,t)=>
1{(function(e){e(t(237))})(function(e){e.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(i,l){return/^[;{}]$/.test(l)}}),e.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(i,l,u,c){return this.jsonMode?/^[\[,{]$/.test(l)||/^}/.test(u):l==";"&&c.lexical&&c.lexical.type==")"?!1:/^[;{}]$/.test(l)&&!/^;/.test(u)}});var n=/^(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)$/;e.extendMode("xml",{commentStart:"<!--",commentEnd:"-->",newlineAfterToken:function(i,l,u,c){var f=!1;return this.configuration=="html"&&(f=c.context?n.test(c.context.tagName):!1),!f&&(i=="tag"&&/>$/.test(l)&&c.context||/^</.test(u))}}),e.defineExtension("commentRange",function(i,l,u){var c=this,f=e.innerMode(c.getMode(),c.getTokenAt(l).state).mode;c.operation(function(){if(i)c.replaceRange(f.commentEnd,u),c.replaceRange(f.commentStart,l),l.line==u.line&&l.ch==u.ch&&c.setCursor(l.line,l.ch+f.commentStart.length);else{var v=c.getRange(l,u),g=v.indexOf(f.commentStart),y=v.lastIndexOf(f.commentEnd);g>-1&&y>-1&&y>g&&(v=v.substr(0,g)+v.substring(g+f.commentStart.length,y)+v.substr(y+f.commentEnd.length)),c.replaceRange(v,l,u)}})}),e.defineExtension("autoIndentRange",function(i,l){var u=this;this.operation(function(){for(var c=i.line;c<=l.line;c++)u.indentLine(c,"smart")})}),e.defineExtension("autoFormatRange",function(i,l){var u=this,c=u.getMode(),f=u.getRange(i,l).split(` 2`),v=e.copyState(c,u.getTokenAt(i).state),g=u.getOption("tabSize"),y="",_=0,b=i.ch===0;function S(){y+=` 3`,b=!0,++_}for(var E=0;E<f.length;++E){for(var N=new e.StringStream(f[E],g);!N.eol();){var z=e.innerMode(c,v),R=c.token(N,v),W=N.current();N.start=N.pos,(!b||/\S/.test(W))&&(y+=W,b=!1),!b&&z.mode.newlineAfterToken&&z.mode.newlineAfterToken(R,W,N.string.slice(N.pos)||f[E+1]||"",z.state)&&S()}!N.pos&&c.blankLine&&c.blankLine(v),!b&&E<f.length-1&&S()}u.operation(function(){u.replaceRange(y,i,l);for(var ct=i.line+1,_t=i.line+_;ct<=_t;++ct)u.indentLine(ct,"smart");u.setSelection(i,u.getCursor(!1))})})})}),237:(function(a){(function(r,t){a.exports=t()})(this,function(){"use strict";var r=navigator.userAgent,t=navigator.platform,e=/gecko\/\d/i.test(r),n=/MSIE \d/.test(r),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r),l=/Edge\/(\d+)/.exec(r),u=n||i||l,c=u&&(n?document.documentMode||6:+(l||i)[1]),f=!l&&/WebKit\//.test(r),v=f&&/Qt\/\d+\.\d+/.test(r),g=!l&&/Chrome\//.test(r),y=/Opera\//.test(r),_=/Apple Computer/.test(navigator.vendor),b=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r),S=/PhantomJS/.test(r),E=_&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2),N=/Android/.test(r),z=E||N||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r),R=E||/Mac/.test(t),W=/\bCrOS\b/.test(r),ct=/win/i.test(t),_t=y&&r.match(/Version\/(\d*\.\d*)/);_t&&(_t=Number(_t[1])),_t&&_t>=15&&(y=!1,f=!0);var xt=R&&(v||y&&(_t==null||_t<12.11)),ut=e||u&&c>=9;function q(o){return new RegExp("(^|\\s)"+o+"(?:$|\\s)\\s*")}var lt=function(o,s){var p=o.className,d=q(s).exec(p);if(d){var h=p.slice(d.index+d[0].length);o.className=p.slice(0,d.index)+(h?d[1]+h:"")}};function H(o){for(var s=o.childNodes.length;s>0;--s)o.removeChild(o.firstChild);return o}function I(o,s){return H(o).appendChild(s)}function B(o,s,p,d){var h=document.createElement(o);if(p&&(h.className=p),d&&(h.style.cssText=d),typeof s=="string")h.appendChild(document.createTextNode(s));else if(s)for(var m=0;m<s.length;++m)h.appendChild(s[m]);return h}function U(o,s,p,d){var h=B(o,s,p,d);return h.setAttribute("role","presentation"),h}var et;document.createRange?et=function(o,s,p,d){var h=document.createRange();return h.setEnd(d||o,p),h.setStart(o,s),h}:et=function(o,s,p){var d=document.body.createTextRange();try{d.moveToElementText(o.parentNode)}catch(h){return d}return d.collapse(!0),d.moveEnd("character",p),d.moveStart("character",s),d};function A(o,s){if(s.nodeType==3&&(s=s.parentNode),o.contains)return o.contains(s);do if(s.nodeType==11&&(s=s.host),s==o)return!0;while(s=s.parentNode)}function gt(){var o;try{o=document.activeElement}catch(s){o=document.body||null}for(;o&&o.shadowRoot&&o.shadowRoot.activeElement;)o=o.shadowRoot.activeElement;return o}function yt(o,s){var p=o.className;q(s).test(p)||(o.className+=(p?" ":"")+s)}function jt(o,s){for(var p=o.split(" "),d=0;d<p.length;d++)p[d]&&!q(p[d]).test(s)&&(s+=" "+p[d]);return s}var te=function(o){o.select()};E?te=function(o){o.selectionStart=0,o.selectionEnd=o.value.length}:u&&(te=function(o){try{o.select()}catch(s){}});
vendor: 134,814 bytes, lines 3-14
3function Xt(o){var s=Array.prototype.slice.call(arguments,1);return function(){return o.apply(null,s)}}function he(o,s,p){s||(s={});for(var d in o)o.hasOwnProperty(d)&&(p!==!1||!s.hasOwnProperty(d))&&(s[d]=o[d]);return s}function mt(o,s,p,d,h){s==null&&(s=o.search(/[^\s\u00a0]/),s==-1&&(s=o.length));for(var m=d||0,w=h||0;;){var x=o.indexOf(" ",m);if(x<0||x>=s)return w+(s-m);w+=x-m,w+=p-w%p,m=x+1}}var bt=function(){this.id=null,this.f=null,this.time=0,this.handler=Xt(this.onTimeout,this)};bt.prototype.onTimeout=function(o){o.id=0,o.time<=+new Date?o.f():setTimeout(o.handler,o.time-+new Date)},bt.prototype.set=function(o,s){this.f=s;var p=+new Date+o;(!this.id||p<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,o),this.time=p)};function It(o,s){for(var p=0;p<o.length;++p)if(o[p]==s)return p;return-1}var nt=50,wt={toString:function(){return"CodeMirror.Pass"}},Ot={scroll:!1},Ht={origin:"*mouse"},Vt={origin:"+move"};function Nt(o,s,p){for(var d=0,h=0;;){var m=o.indexOf(" ",d);m==-1&&(m=o.length);var w=m-d;if(m==o.length||h+w>=s)return d+Math.min(w,s-h);if(h+=m-d,h+=p-h%p,d=m+1,h>=s)return d}}var Jt=[""];function Ee(o){for(;Jt.length<=o;)Jt.push(ue(Jt)+" ");return Jt[o]}function ue(o){return o[o.length-1]}function Be(o,s){for(var p=[],d=0;d<o.length;d++)p[d]=s(o[d],d);return p}function je(o,s,p){for(var d=0,h=p(s);d<o.length&&p(o[d])<=h;)d++;o.splice(d,0,s)}function pe(){}function T(o,s){var p;return Object.create?p=Object.create(o):(pe.prototype=o,p=new pe),s&&he(s,p),p}var F=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function $(o){return/\w/.test(o)||o>"\x80"&&(o.toUpperCase()!=o.toLowerCase()||F.test(o))}function ot(o,s){return s?s.source.indexOf("\\w")>-1&&$(o)?!0:s.test(o):$(o)}function vt(o){for(var s in o)if(o.hasOwnProperty(s)&&o[s])return!1;return!0}var K=/[\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 ft(o){return o.charCodeAt(0)>=768&&K.test(o)}function it(o,s,p){for(;(p<0?s>0:s<o.length)&&ft(o.charAt(s));)s+=p;return s}function ne(o,s,p){for(var d=s>p?-1:1;;){if(s==p)return s;var h=(s+p)/2,m=d<0?Math.ceil(h):Math.floor(h);if(m==s)return o(m)?s:p;o(m)?p=m:s=m+d}}function ye(o,s,p,d){if(!o)return d(s,p,"ltr",0);for(var h=!1,m=0;m<o.length;++m){var w=o[m];(w.from<p&&w.to>s||s==p&&w.to==s)&&(d(Math.max(w.from,s),Math.min(w.to,p),w.level==1?"rtl":"ltr",m),h=!0)}h||d(s,p,"ltr")}var de=null;function V(o,s,p){var d;de=null;for(var h=0;h<o.length;++h){var m=o[h];if(m.from<s&&m.to>s)return h;m.to==s&&(m.from!=m.to&&p=="before"?d=h:de=h),m.from==s&&(m.from!=m.to&&p!="before"?d=h:de=h)}return d??de}var tt=(function(){var o="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",s="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function p(P){return P<=247?o.charAt(P):1424<=P&&P<=1524?"R":1536<=P&&P<=1785?s.charAt(P-1536):1774<=P&&P<=2220?"r":8192<=P&&P<=8203?"w":P==8204?"b":"L"}var d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,h=/[stwN]/,m=/[LRr]/,w=/[Lb1n]/,x=/[1n]/;function C(P,G,J){this.level=P,this.from=G,this.to=J}return function(P,G){var J=G=="ltr"?"L":"R";if(P.length==0||G=="ltr"&&!d.test(P))return!1;for(var dt=P.length,rt=[],Ct=0;Ct<dt;++Ct)rt.push(p(P.charCodeAt(Ct)));for(var kt=0,Ft=J;kt<dt;++kt){var Kt=rt[kt];Kt=="m"?rt[kt]=Ft:Ft=Kt}for(var Qt=0,Gt=J;Qt<dt;++Qt){var ee=rt[Qt];ee=="1"&&Gt=="r"?rt[Qt]="n":m.test(ee)&&(Gt=ee,ee=="r"&&(rt[Qt]="R"))}for(var ce=1,se=rt[0];ce<dt-1;++ce){var Se=rt[ce];Se=="+"&&se=="1"&&rt[ce+1]=="1"?rt[ce]="1":Se==","&&se==rt[ce+1]&&(se=="1"||se=="n")&&(rt[ce]=se),se=Se}for(var He=0;He<dt;++He){var xn=rt[He];if(xn==",")rt[He]="N";else if(xn=="%"){var Xe=void 0;for(Xe=He+1;Xe<dt&&rt[Xe]=="%";++Xe);for(var sr=He&&rt[He-1]=="!"||Xe<dt&&rt[Xe]=="1"?"1":"N",Kn=He;Kn<Xe;++Kn)rt[Kn]=sr;He=Xe-1}}for(var sn=0,Gn=J;sn<dt;++sn){var En=rt[sn];Gn=="L"&&En=="1"?rt[sn]="L":m.test(En)&&(Gn=En)}for(var gn=0;gn<dt;++gn)if(h.test(rt[gn])){var ln=void 0;for(ln=gn+1;ln<dt&&h.test(rt[ln]);++ln);for(var tn=(gn?rt[gn-1]:J)=="L",$n=(ln<dt?rt[ln]:J)=="L",Ao=tn==$n?tn?"L":"R":J,ki=gn;ki<ln;++ki)rt[ki]=Ao;gn=ln-1}for(var Ln=[],Kr,Cn=0;Cn<dt;)if(w.test(rt[Cn])){var bu=Cn;for(++Cn;Cn<dt&&w.test(rt[Cn]);++Cn);Ln.push(new C(0,bu,Cn))}else{var ri=Cn,Xi=Ln.length,Ji=G=="rtl"?1:0;for(++Cn;Cn<dt&&rt[Cn]!="L";++Cn);for(var Rn=ri;Rn<Cn;)if(x.test(rt[Rn])){ri<Rn&&(Ln.splice(Xi,0,new C(1,ri,Rn)),Xi+=Ji);var ko=Rn;for(++Rn;Rn<Cn&&x.test(rt[Rn]);++Rn);Ln.splice(Xi,0,new C(2,ko,Rn)),Xi+=Ji,ri=Rn}else++Rn;ri<Cn&&Ln.splice(Xi,0,new C(1,ri,Cn))}return G=="ltr"&&(Ln[0].level==1&&(Kr=P.match(/^\s+/))&&(Ln[0].from=Kr[0].length,Ln.unshift(new C(0,0,Kr[0].length))),ue(Ln).level==1&&(Kr=P.match(/\s+$/))&&(ue(Ln).to-=Kr[0].length,Ln.push(new C(0,dt-Kr[0].length,dt)))),G=="rtl"?Ln.reverse():Ln}})();function M(o,s){var p=o.order;return p==null&&(p=o.order=tt(o.text,s)),p}var Tt=[],ht=function(o,s,p){if(o.addEventListener)o.addEventListener(s,p,!1);else if(o.attachEvent)o.attachEvent("on"+s,p);else{var d=o._handlers||(o._handlers={});d[s]=(d[s]||Tt).concat(p)}};function Lt(o,s){return o._handlers&&o._handlers[s]||Tt}function Yt(o,s,p){if(o.removeEventListener)o.removeEventListener(s,p,!1);else if(o.detachEvent)o.detachEvent("on"+s,p);else{var d=o._handlers,h=d&&d[s];if(h){var m=It(h,p);m>-1&&(d[s]=h.slice(0,m).concat(h.slice(m+1)))}}}function qt(o,s){var p=Lt(o,s);if(p.length)for(var d=Array.prototype.slice.call(arguments,2),h=0;h<p.length;++h)p[h].apply(null,d)}function Bt(o,s,p){return typeof s=="string"&&(s={type:s,preventDefault:function(){this.defaultPrevented=!0}}),qt(o,p||s.type,o,s),cn(s)||s.codemirrorIgnore}function re(o){var s=o._handlers&&o._handlers.cursorActivity;if(s)for(var p=o.curOp.cursorActivityHandlers||(o.curOp.cursorActivityHandlers=[]),d=0;d<s.length;++d)It(p,s[d])==-1&&p.push(s[d])}function Ce(o,s){return Lt(o,s).length>0}function Pe(o){o.prototype.on=function(s,p){ht(this,s,p)},o.prototype.off=function(s,p){Yt(this,s,p)}}function Oe(o){o.preventDefault?o.preventDefault():o.returnValue=!1}function qe(o){o.stopPropagation?o.stopPropagation():o.cancelBubble=!0}function cn(o){return o.defaultPrevented!=null?o.defaultPrevented:o.returnValue==!1}function j(o){Oe(o),qe(o)}function Z(o){return o.target||o.srcElement}function at(o){var s=o.which;return s==null&&(o.button&1?s=1:o.button&2?s=3:o.button&4&&(s=2)),R&&o.ctrlKey&&s==1&&(s=3),s}var Pt=(function(){if(u&&c<9)return!1;var o=B("div");return"draggable"in o||"dragDrop"in o})(),zt;function ie(o){if(zt==null){var s=B("span","\u200B");I(o,B("span",[s,document.createTextNode("x")])),o.firstChild.offsetHeight!=0&&(zt=s.offsetWidth<=1&&s.offsetHeight>2&&!(u&&c<8))}var p=zt?B("span","\u200B"):B("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return p.setAttribute("cm-text",""),p}var ge;function rn(o){if(ge!=null)return ge;var s=I(o,document.createTextNode("A\u062EA")),p=et(s,0,1).getBoundingClientRect(),d=et(s,1,2).getBoundingClientRect();return H(o),!p||p.left==p.right?!1:ge=d.right-p.right<3}var Fe=` 4 5b`.split(/\n/).length!=3?function(o){for(var s=0,p=[],d=o.length;s<=d;){var h=o.indexOf(` 6`,s);h==-1&&(h=o.length);var m=o.slice(s,o.charAt(h-1)=="\r"?h-1:h),w=m.indexOf("\r");w!=-1?(p.push(m.slice(0,w)),s+=w+1):(p.push(m),s=h+1)}return p}:function(o){return o.split(/\r\n?|\n/)},We=window.getSelection?function(o){try{return o.selectionStart!=o.selectionEnd}catch(s){return!1}}:function(o){var s;try{s=o.ownerDocument.selection.createRange()}catch(p){}return!s||s.parentElement()!=o?!1:s.compareEndPoints("StartToEnd",s)!=0},Qn=(function(){var o=B("div");return"oncopy"in o?!0:(o.setAttribute("oncopy","return;"),typeof o.oncopy=="function")})(),fn=null;function ze(o){if(fn!=null)return fn;var s=I(o,B("span","x")),p=s.getBoundingClientRect(),d=et(s,0,1).getBoundingClientRect();return fn=Math.abs(p.left-d.left)>1}var hr={},Ve={};function Ke(o,s){arguments.length>2&&(s.dependencies=Array.prototype.slice.call(arguments,2)),hr[o]=s}function Ye(o,s){Ve[o]=s}function tr(o){if(typeof o=="string"&&Ve.hasOwnProperty(o))o=Ve[o];else if(o&&typeof o.name=="string"&&Ve.hasOwnProperty(o.name)){var s=Ve[o.name];typeof s=="string"&&(s={name:s}),o=T(s,o),o.name=s.name}else{if(typeof o=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(o))return tr("application/xml");if(typeof o=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(o))return tr("application/json")}return typeof o=="string"?{name:o}:o||{name:"null"}}function Ae(o,s){s=tr(s);var p=hr[s.name];if(!p)return Ae(o,"text/plain");var d=p(o,s);if(Dn.hasOwnProperty(s.name)){var h=Dn[s.name];for(var m in h)h.hasOwnProperty(m)&&(d.hasOwnProperty(m)&&(d["_"+m]=d[m]),d[m]=h[m])}if(d.name=s.name,s.helperType&&(d.helperType=s.helperType),s.modeProps)for(var w in s.modeProps)d[w]=s.modeProps[w];return d}var Dn={};function ve(o,s){var p=Dn.hasOwnProperty(o)?Dn[o]:Dn[o]={};he(s,p)}function On(o,s){if(s===!0)return s;if(o.copyState)return o.copyState(s);var p={};for(var d in s){var h=s[d];h instanceof Array&&(h=h.concat([])),p[d]=h}return p}function en(o,s){for(var p;o.innerMode&&(p=o.innerMode(s),!(!p||p.mode==o));)s=p.state,o=p.mode;return p||{mode:o,state:s}}function jn(o,s,p){return o.startState?o.startState(s,p):!0}var ke=function(o,s,p){this.pos=this.start=0,this.string=o,this.tabSize=s||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=p};ke.prototype.eol=function(){return this.pos>=this.string.length},ke.prototype.sol=function(){return this.pos==this.lineStart},ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ke.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ke.prototype.eat=function(o){var s=this.string.charAt(this.pos),p;if(typeof o=="string"?p=s==o:p=s&&(o.test?o.test(s):o(s)),p)return++this.pos,s},ke.prototype.eatWhile=function(o){for(var s=this.pos;this.eat(o););return this.pos>s},ke.prototype.eatSpace=function(){for(var o=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>o},ke.prototype.skipToEnd=function(){this.pos=this.string.length},ke.prototype.skipTo=function(o){var s=this.string.indexOf(o,this.pos);if(s>-1)return this.pos=s,!0},ke.prototype.backUp=function(o){this.pos-=o},ke.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=mt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?mt(this.string,this.lineStart,this.tabSize):0)},ke.prototype.indentation=function(){return mt(this.string,null,this.tabSize)-(this.lineStart?mt(this.string,this.lineStart,this.tabSize):0)},ke.prototype.match=function(o,s,p){if(typeof o=="string"){var d=function(w){return p?w.toLowerCase():w},h=this.string.substr(this.pos,o.length);if(d(h)==d(o))return s!==!1&&(this.pos+=o.length),!0}else{var m=this.string.slice(this.pos).match(o);return m&&m.index>0?null:(m&&s!==!1&&(this.pos+=m[0].length),m)}},ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},ke.prototype.hideFirstChars=function(o,s){this.lineStart+=o;try{return s()}finally{this.lineStart-=o}},ke.prototype.lookAhead=function(o){var s=this.lineOracle;return s&&s.lookAhead(o)},ke.prototype.baseToken=function(){var o=this.lineOracle;return o&&o.baseToken(this.pos)};function Zt(o,s){if(s-=o.first,s<0||s>=o.size)throw new Error("There is no line "+(s+o.first)+" in the document.");for(var p=o;!p.lines;)for(var d=0;;++d){var h=p.children[d],m=h.chunkSize();if(s<m){p=h;break}s-=m}return p.lines[s]}function dn(o,s,p){var d=[],h=s.line;return o.iter(s.line,p.line+1,function(m){var w=m.text;h==p.line&&(w=w.slice(0,p.ch)),h==s.line&&(w=w.slice(s.ch)),d.push(w),++h}),d}function Pn(o,s,p){var d=[];return o.iter(s,p,function(h){d.push(h.text)}),d}function on(o,s){var p=s-o.height;if(p)for(var d=o;d;d=d.parent)d.height+=p}function _e(o){if(o.parent==null)return null;for(var s=o.parent,p=It(s.lines,o),d=s.parent;d;s=d,d=d.parent)for(var h=0;d.children[h]!=s;++h)p+=d.children[h].chunkSize();return p+s.first}function Ne(o,s){var p=o.first;t:do{for(var d=0;d<o.children.length;++d){var h=o.children[d],m=h.height;if(s<m){o=h;continue t}s-=m,p+=h.chunkSize()}return p}while(!o.lines);for(var w=0;w<o.lines.length;++w){var x=o.lines[w],C=x.height;if(s<C)break;s-=C}return p+w}function vr(o,s){return s>=o.first&&s<o.first+o.size}function gr(o,s){return String(o.lineNumberFormatter(s+o.firstLineNumber))}function Mt(o,s,p){if(p===void 0&&(p=null),!(this instanceof Mt))return new Mt(o,s,p);this.line=o,this.ch=s,this.sticky=p}function fe(o,s){return o.line-s.line||o.ch-s.ch}function Un(o,s){return o.sticky==s.sticky&&fe(o,s)==0}function L(o){return Mt(o.line,o.ch)}function X(o,s){return fe(o,s)<0?s:o}function St(o,s){return fe(o,s)<0?o:s}function Dt(o,s){return Math.max(o.first,Math.min(s,o.first+o.size-1))}function Rt(o,s){if(s.line<o.first)return Mt(o.first,0);var p=o.first+o.size-1;return s.line>p?Mt(p,Zt(o,p).text.length):xe(s,Zt(o,s.line).text.length)}function xe(o,s){var p=o.ch;return p==null||p>s?Mt(o.line,s):p<0?Mt(o.line,0):o}function Te(o,s){for(var p=[],d=0;d<s.length;d++)p[d]=Rt(o,s[d]);return p}var Le=function(o,s){this.state=o,this.lookAhead=s},Ie=function(o,s,p,d){this.state=s,this.doc=o,this.line=p,this.maxLookAhead=d||0,this.baseTokens=null,this.baseTokenPos=1};Ie.prototype.lookAhead=function(o){var s=this.doc.getLine(this.line+o);return s!=null&&o>this.maxLookAhead&&(this.maxLookAhead=o),s},Ie.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}},Ie.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ie.fromSaved=function(o,s,p){return s instanceof Le?new Ie(o,On(o.mode,s.state),p,s.lookAhead):new Ie(o,On(o.mode,s),p)},Ie.prototype.save=function(o){var s=o!==!1?On(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Le(s,this.maxLookAhead):s};function ui(o,s,p,d){var h=[o.state.modeGen],m={};Yr(o,s.text,o.doc.mode,p,function(P,G){return h.push(P,G)},m,d);for(var w=p.state,x=function(P){p.baseTokens=h;var G=o.state.overlays[P],J=1,dt=0;p.state=!0,Yr(o,s.text,G.mode,p,function(rt,Ct){for(var kt=J;dt<rt;){var Ft=h[J];Ft>rt&&h.splice(J,1,rt,h[J+1],Ft),J+=2,dt=Math.min(rt,Ft)}if(Ct)if(G.opaque)h.splice(kt,J-kt,rt,"overlay "+Ct),J=kt+2;else for(;kt<J;kt+=2){var Kt=h[kt+1];h[kt+1]=(Kt?Kt+" ":"")+"overlay "+Ct}},m),p.state=w,p.baseTokens=null,p.baseTokenPos=1},C=0;C<o.state.overlays.length;++C)x(C);return{styles:h,classes:m.bgClass||m.textClass?m:null}}function yr(o,s,p){if(!s.styles||s.styles[0]!=o.state.modeGen){var d=Bn(o,_e(s)),h=s.text.length>o.options.maxHighlightLength&&On(o.doc.mode,d.state),m=ui(o,s,d);h&&(d.state=h),s.stateAfter=d.save(!h),s.styles=m.styles,m.classes?s.styleClasses=m.classes:s.styleClasses&&(s.styleClasses=null),p===o.doc.highlightFrontier&&(o.doc.modeFrontier=Math.max(o.doc.modeFrontier,++o.doc.highlightFrontier))}return s.styles}function Bn(o,s,p){var d=o.doc,h=o.display;if(!d.mode.startState)return new Ie(d,!0,s);var m=jr(o,s,p),w=m>d.first&&Zt(d,m-1).stateAfter,x=w?Ie.fromSaved(d,w,m):new Ie(d,jn(d.mode),m);return d.iter(m,s,function(C){Wr(o,C.text,x);var P=x.line;C.stateAfter=P==s-1||P%5==0||P>=h.viewFrom&&P<h.viewTo?x.save():null,x.nextLine()}),p&&(d.modeFrontier=x.line),x}function Wr(o,s,p,d){var h=o.doc.mode,m=new ke(s,o.options.tabSize,p);for(m.start=m.pos=d||0,s==""&&Ni(h,p.state);!m.eol();)ci(h,m,p.state),m.start=m.pos}function Ni(o,s){if(o.blankLine)return o.blankLine(s);if(o.innerMode){var p=en(o,s);if(p.mode.blankLine)return p.mode.blankLine(p.state)}}function ci(o,s,p,d){for(var h=0;h<10;h++){d&&(d[0]=en(o,p).mode);var m=o.token(s,p);if(s.pos>s.start)return m}throw new Error("Mode "+o.name+" failed to advance stream.")}var qr=function(o,s,p){this.start=o.start,this.end=o.pos,this.string=o.current(),this.type=s||null,this.state=p};function Fi(o,s,p,d){var h=o.doc,m=h.mode,w;s=Rt(h,s);var x=Zt(h,s.line),C=Bn(o,s.line,p),P=new ke(x.text,o.options.tabSize,C),G;for(d&&(G=[]);(d||P.pos<s.ch)&&!P.eol();)P.start=P.pos,w=ci(m,P,C.state),d&&G.push(new qr(P,w,On(h.mode,C.state)));return d?G:new qr(P,w,C.state)}function fi(o,s){if(o)for(;;){var p=o.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!p)break;o=o.slice(0,p.index)+o.slice(p.index+p[0].length);var d=p[1]?"bgClass":"textClass";s[d]==null?s[d]=p[2]:new RegExp("(?:^|\\s)"+p[2]+"(?:$|\\s)").test(s[d])||(s[d]+=" "+p[2])}return o}function Yr(o,s,p,d,h,m,w){var x=p.flattenSpans;x==null&&(x=o.options.flattenSpans);var C=0,P=null,G=new ke(s,o.options.tabSize,d),J,dt=o.options.addModeClass&&[null];for(s==""&&fi(Ni(p,d.state),m);!G.eol();){if(G.pos>o.options.maxHighlightLength?(x=!1,w&&Wr(o,s,d,G.pos),G.pos=s.length,J=null):J=fi(ci(p,G,d.state,dt),m),dt){var rt=dt[0].name;rt&&(J="m-"+(J?rt+" "+J:rt))}if(!x||P!=J){for(;C<G.start;)C=Math.min(G.start,C+5e3),h(C,P);P=J}G.start=G.pos}for(;C<G.pos;){var Ct=Math.min(G.pos,C+5e3);h(Ct,P),C=Ct}}function jr(o,s,p){for(var d,h,m=o.doc,w=p?-1:s-(o.doc.mode.innerMode?1e3:100),x=s;x>w;--x){if(x<=m.first)return m.first;var C=Zt(m,x-1),P=C.stateAfter;if(P&&(!p||x+(P instanceof Le?P.lookAhead:0)<=m.modeFrontier))return x;var G=mt(C.text,null,o.options.tabSize);(h==null||d>G)&&(h=x-1,d=G)}return h}function Xr(o,s){if(o.modeFrontier=Math.min(o.modeFrontier,s),!(o.highlightFrontier<s-10)){for(var p=o.first,d=s-1;d>p;d--){var h=Zt(o,d).stateAfter;if(h&&(!(h instanceof Le)||d+h.lookAhead<s)){p=d+1;break}}o.highlightFrontier=Math.min(o.highlightFrontier,p)}}var an=!1,pn=!1;function di(){an=!0}function Vi(){pn=!0}function Ir(o,s,p){this.marker=o,this.from=s,this.to=p}function An(o,s){if(o)for(var p=0;p<o.length;++p){var d=o[p];if(d.marker==s)return d}}function Hi(o,s){for(var p,d=0;d<o.length;++d)o[d]!=s&&(p||(p=[])).push(o[d]);return p}function Er(o,s,p){var d=p&&window.WeakSet&&(p.markedSpans||(p.markedSpans=new WeakSet));d&&d.has(o.markedSpans)?o.markedSpans.push(s):(o.markedSpans=o.markedSpans?o.markedSpans.concat([s]):[s],d&&d.add(o.markedSpans)),s.marker.attachLine(o)}function hn(o,s,p){var d;if(o)for(var h=0;h<o.length;++h){var m=o[h],w=m.marker,x=m.from==null||(w.inclusiveLeft?m.from<=s:m.from<s);if(x||m.from==s&&w.type=="bookmark"&&(!p||!m.marker.insertLeft)){var C=m.to==null||(w.inclusiveRight?m.to>=s:m.to>s);(d||(d=[])).push(new Ir(w,m.from,C?null:m.to))}}return d}function pi(o,s,p){var d;if(o)for(var h=0;h<o.length;++h){var m=o[h],w=m.marker,x=m.to==null||(w.inclusiveRight?m.to>=s:m.to>s);if(x||m.from==s&&w.type=="bookmark"&&(!p||m.marker.insertLeft)){var C=m.from==null||(w.inclusiveLeft?m.from<=s:m.from<s);(d||(d=[])).push(new Ir(w,C?null:m.from-s,m.to==null?null:m.to-s))}}return d}function mr(o,s){if(s.full)return null;var p=vr(o,s.from.line)&&Zt(o,s.from.line).markedSpans,d=vr(o,s.to.line)&&Zt(o,s.to.line).markedSpans;if(!p&&!d)return null;var h=s.from.ch,m=s.to.ch,w=fe(s.from,s.to)==0,x=hn(p,h,w),C=pi(d,m,w),P=s.text.length==1,G=ue(s.text).length+(P?h:0);if(x)for(var J=0;J<x.length;++J){var dt=x[J];if(dt.to==null){var rt=An(C,dt.marker);rt?P&&(dt.to=rt.to==null?null:rt.to+G):dt.to=h}}if(C)for(var Ct=0;Ct<C.length;++Ct){var kt=C[Ct];if(kt.to!=null&&(kt.to+=G),kt.from==null){var Ft=An(x,kt.marker);Ft||(kt.from=G,P&&(x||(x=[])).push(kt))}else kt.from+=G,P&&(x||(x=[])).push(kt)}x&&(x=Pr(x)),C&&C!=x&&(C=Pr(C));var Kt=[x];if(!P){var Qt=s.text.length-2,Gt;if(Qt>0&&x)for(var ee=0;ee<x.length;++ee)x[ee].to==null&&(Gt||(Gt=[])).push(new Ir(x[ee].marker,null,null));for(var ce=0;ce<Qt;++ce)Kt.push(Gt);Kt.push(C)}return Kt}function Pr(o){for(var s=0;s<o.length;++s){var p=o[s];p.from!=null&&p.from==p.to&&p.marker.clearWhenEmpty!==!1&&o.splice(s--,1)}return o.length?o:null}function hi(o,s,p){var d=null;if(o.iter(s.line,p.line+1,function(rt){if(rt.markedSpans)for(var Ct=0;Ct<rt.markedSpans.length;++Ct){var kt=rt.markedSpans[Ct].marker;kt.readOnly&&(!d||It(d,kt)==-1)&&(d||(d=[])).push(kt)}}),!d)return null;for(var h=[{from:s,to:p}],m=0;m<d.length;++m)for(var w=d[m],x=w.find(0),C=0;C<h.length;++C){var P=h[C];if(!(fe(P.to,x.from)<0||fe(P.from,x.to)>0)){var G=[C,1],J=fe(P.from,x.from),dt=fe(P.to,x.to);(J<0||!w.inclusiveLeft&&!J)&&G.push({from:P.from,to:x.from}),(dt>0||!w.inclusiveRight&&!dt)&&G.push({from:x.to,to:P.to}),h.splice.apply(h,G),C+=G.length-3}}return h}function _r(o){var s=o.markedSpans;if(s){for(var p=0;p<s.length;++p)s[p].marker.detachLine(o);o.markedSpans=null}}function er(o,s){if(s){for(var p=0;p<s.length;++p)s[p].marker.attachLine(o);o.markedSpans=s}}function Jr(o){return o.inclusiveLeft?-1:0}function Rr(o){return o.inclusiveRight?1:0}function Zr(o,s){var p=o.lines.length-s.lines.length;if(p!=0)return p;var d=o.find(),h=s.find(),m=fe(d.from,h.from)||Jr(o)-Jr(s);if(m)return-m;var w=fe(d.to,h.to)||Rr(o)-Rr(s);return w||s.id-o.id}function Qr(o,s){var p=pn&&o.markedSpans,d;if(p)for(var h=void 0,m=0;m<p.length;++m)h=p[m],h.marker.collapsed&&(s?h.from:h.to)==null&&(!d||Zr(d,h.marker)<0)&&(d=h.marker);return d}function Ui(o){return Qr(o,!0)}function wr(o){return Qr(o,!1)}function ae(o,s){var p=pn&&o.markedSpans,d;if(p)for(var h=0;h<p.length;++h){var m=p[h];m.marker.collapsed&&(m.from==null||m.from<s)&&(m.to==null||m.to>s)&&(!d||Zr(d,m.marker)<0)&&(d=m.marker)}return d}function oe(o,s,p,d,h){var m=Zt(o,s),w=pn&&m.markedSpans;if(w)for(var x=0;x<w.length;++x){var C=w[x];if(C.marker.collapsed){var P=C.marker.find(0),G=fe(P.from,p)||Jr(C.marker)-Jr(h),J=fe(P.to,d)||Rr(C.marker)-Rr(h);if(!(G>=0&&J<=0||G<=0&&J>=0)&&(G<=0&&(C.marker.inclusiveRight&&h.inclusiveLeft?fe(P.to,p)>=0:fe(P.to,p)>0)||G>=0&&(C.marker.inclusiveRight&&h.inclusiveLeft?fe(P.from,d)<=0:fe(P.from,d)<0)))return!0}}}function we(o){for(var s;s=Ui(o);)o=s.find(-1,!0).line;return o}function le(o){for(var s;s=wr(o);)o=s.find(1,!0).line;return o}function Ze(o){for(var s,p;s=wr(o);)o=s.find(1,!0).line,(p||(p=[])).push(o);return p}function nr(o,s){var p=Zt(o,s),d=we(p);return p==d?s:_e(d)}function rr(o,s){if(s>o.lastLine())return s;var p=Zt(o,s),d;if(!mn(o,p))return s;for(;d=wr(p);)p=d.find(1,!0).line;return _e(p)+1}function mn(o,s){var p=pn&&s.markedSpans;if(p){for(var d=void 0,h=0;h<p.length;++h)if(d=p[h],!!d.marker.collapsed){if(d.from==null)return!0;if(!d.marker.widgetNode&&d.from==0&&d.marker.inclusiveLeft&&Tn(o,s,d))return!0}}}function Tn(o,s,p){if(p.to==null){var d=p.marker.find(1,!0);return Tn(o,d.line,An(d.line.markedSpans,p.marker))}if(p.marker.inclusiveRight&&p.to==s.text.length)return!0;for(var h=void 0,m=0;m<s.markedSpans.length;++m)if(h=s.markedSpans[m],h.marker.collapsed&&!h.marker.widgetNode&&h.from==p.to&&(h.to==null||h.to!=p.from)&&(h.marker.inclusiveLeft||p.marker.inclusiveRight)&&Tn(o,s,h))return!0}function ir(o){o=we(o);for(var s=0,p=o.parent,d=0;d<p.lines.length;++d){var h=p.lines[d];if(h==o)break;s+=h.height}for(var m=p.parent;m;p=m,m=p.parent)for(var w=0;w<m.children.length;++w){var x=m.children[w];if(x==p)break;s+=x.height}return s}function Nr(o){if(o.height==0)return 0;for(var s=o.text.length,p,d=o;p=Ui(d);){var h=p.find(0,!0);d=h.from.line,s+=h.from.ch-h.to.ch}for(d=o;p=wr(d);){var m=p.find(0,!0);s-=d.text.length-m.from.ch,d=m.to.line,s+=d.text.length-m.to.ch}return s}function vi(o){var s=o.display,p=o.doc;s.maxLine=Zt(p,p.first),s.maxLineLength=Nr(s.maxLine),s.maxLineChanged=!0,p.iter(function(d){var h=Nr(d);h>s.maxLineLength&&(s.maxLineLength=h,s.maxLine=d)})}var _n=function(o,s,p){this.text=o,er(this,s),this.height=p?p(this):1};_n.prototype.lineNo=function(){return _e(this)},Pe(_n);function Ya(o,s,p,d){o.text=s,o.stateAfter&&(o.stateAfter=null),o.styles&&(o.styles=null),o.order!=null&&(o.order=null),_r(o),er(o,p);var h=d?d(o):1;h!=o.height&&on(o,h)}function uo(o){o.parent=null,_r(o)}var Xa={},qo={};function Yo(o,s){if(!o||/^\s*$/.test(o))return null;var p=s.addModeClass?qo:Xa;return p[o]||(p[o]=o.replace(/\S+/g,"cm-$&"))}function co(o,s){var p=U("span",null,null,f?"padding-right: .1px":null),d={pre:U("pre",[p],"CodeMirror-line"),content:p,col:0,pos:0,cm:o,trailingSpace:!1,splitSpaces:o.getOption("lineWrapping")};s.measure={};for(var h=0;h<=(s.rest?s.rest.length:0);h++){var m=h?s.rest[h-1]:s.line,w=void 0;d.pos=0,d.addToken=Za,rn(o.display.measure)&&(w=M(m,o.doc.direction))&&(d.addToken=Qa(d.addToken,w)),d.map=[];var x=s!=o.display.externalMeasured&&_e(m);ts(m,d,yr(o,m,x)),m.styleClasses&&(m.styleClasses.bgClass&&(d.bgClass=jt(m.styleClasses.bgClass,d.bgClass||"")),m.styleClasses.textClass&&(d.textClass=jt(m.styleClasses.textClass,d.textClass||""))),d.map.length==0&&d.map.push(0,0,d.content.appendChild(ie(o.display.measure))),h==0?(s.measure.map=d.map,s.measure.cache={}):((s.measure.maps||(s.measure.maps=[])).push(d.map),(s.measure.caches||(s.measure.caches=[])).push({}))}if(f){var C=d.content.lastChild;(/\bcm-tab\b/.test(C.className)||C.querySelector&&C.querySelector(".cm-tab"))&&(d.content.className="cm-tab-wrap-hack")}return qt(o,"renderLine",o,s.line,d.pre),d.pre.className&&(d.textClass=jt(d.pre.className,d.textClass||"")),d}function Ja(o){var s=B("span","\u2022","cm-invalidchar");return s.title="\\u"+o.charCodeAt(0).toString(16),s.setAttribute("aria-label",s.title),s}function Za(o,s,p,d,h,m,w){if(s){var x=o.splitSpaces?fo(s,o.trailingSpace):s,C=o.cm.state.specialChars,P=!1,G;if(!C.test(s))o.col+=s.length,G=document.createTextNode(x),o.map.push(o.pos,o.pos+s.length,G),u&&c<9&&(P=!0),o.pos+=s.length;else{G=document.createDocumentFragment();for(var J=0;;){C.lastIndex=J;var dt=C.exec(s),rt=dt?dt.index-J:s.length-J;if(rt){var Ct=document.createTextNode(x.slice(J,J+rt));u&&c<9?G.appendChild(B("span",[Ct])):G.appendChild(Ct),o.map.push(o.pos,o.pos+rt,Ct),o.col+=rt,o.pos+=rt}if(!dt)break;J+=rt+1;var kt=void 0;if(dt[0]==" "){var Ft=o.cm.options.tabSize,Kt=Ft-o.col%Ft;kt=G.appendChild(B("span",Ee(Kt),"cm-tab")),kt.setAttribute("role","presentation"),kt.setAttribute("cm-text"," "),o.col+=Kt}else dt[0]=="\r"||dt[0]==` 7`?(kt=G.appendChild(B("span",dt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),kt.setAttribute("cm-text",dt[0]),o.col+=1):(kt=o.cm.options.specialCharPlaceholder(dt[0]),kt.setAttribute("cm-text",dt[0]),u&&c<9?G.appendChild(B("span",[kt])):G.appendChild(kt),o.col+=1);o.map.push(o.pos,o.pos+1,kt),o.pos++}}if(o.trailingSpace=x.charCodeAt(s.length-1)==32,p||d||h||P||m||w){var Qt=p||"";d&&(Qt+=d),h&&(Qt+=h);var Gt=B("span",[G],Qt,m);if(w)for(var ee in w)w.hasOwnProperty(ee)&&ee!="style"&&ee!="class"&&Gt.setAttribute(ee,w[ee]);return o.content.appendChild(Gt)}o.content.appendChild(G)}}function fo(o,s){if(o.length>1&&!/ /.test(o))return o;for(var p=s,d="",h=0;h<o.length;h++){var m=o.charAt(h);m==" "&&p&&(h==o.length-1||o.charCodeAt(h+1)==32)&&(m="\xA0"),d+=m,p=m==" "}return d}function Qa(o,s){return function(p,d,h,m,w,x,C){h=h?h+" cm-force-border":"cm-force-border";for(var P=p.pos,G=P+d.length;;){for(var J=void 0,dt=0;dt<s.length&&(J=s[dt],!(J.to>P&&J.from<=P));dt++);if(J.to>=G)return o(p,d,h,m,w,x,C);o(p,d.slice(0,J.to-P),h,m,null,x,C),m=null,d=d.slice(J.to-P),P=J.to}}}function Xo(o,s,p,d){var h=!d&&p.widgetNode;h&&o.map.push(o.pos,o.pos+s,h),!d&&o.cm.display.input.needsContentAttribute&&(h||(h=o.content.appendChild(document.createElement("span"))),h.setAttribute("cm-marker",p.id)),h&&(o.cm.display.input.setUneditable(h),o.content.appendChild(h)),o.pos+=s,o.trailingSpace=!1}function ts(o,s,p){var d=o.markedSpans,h=o.text,m=0;if(!d){for(var w=1;w<p.length;w+=2)s.addToken(s,h.slice(m,m=p[w]),Yo(p[w+1],s.cm.options));return}for(var x=h.length,C=0,P=1,G="",J,dt,rt=0,Ct,kt,Ft,Kt,Qt;;){if(rt==C){Ct=kt=Ft=dt="",Qt=null,Kt=null,rt=1/0;for(var Gt=[],ee=void 0,ce=0;ce<d.length;++ce){var se=d[ce],Se=se.marker;if(Se.type=="bookmark"&&se.from==C&&Se.widgetNode)Gt.push(Se);else if(se.from<=C&&(se.to==null||se.to>C||Se.collapsed&&se.to==C&&se.from==C)){if(se.to!=null&&se.to!=C&&rt>se.to&&(rt=se.to,kt=""),Se.className&&(Ct+=" "+Se.className),Se.css&&(dt=(dt?dt+";":"")+Se.css),Se.startStyle&&se.from==C&&(Ft+=" "+Se.startStyle),Se.endStyle&&se.to==rt&&(ee||(ee=[])).push(Se.endStyle,se.to),Se.title&&((Qt||(Qt={})).title=Se.title),Se.attributes)for(var He in Se.attributes)(Qt||(Qt={}))[He]=Se.attributes[He];Se.collapsed&&(!Kt||Zr(Kt.marker,Se)<0)&&(Kt=se)}else se.from>C&&rt>se.from&&(rt=se.from)}if(ee)for(var xn=0;xn<ee.length;xn+=2)ee[xn+1]==rt&&(kt+=" "+ee[xn]);if(!Kt||Kt.from==C)for(var Xe=0;Xe<Gt.length;++Xe)Xo(s,0,Gt[Xe]);if(Kt&&(Kt.from||0)==C){if(Xo(s,(Kt.to==null?x+1:Kt.to)-C,Kt.marker,Kt.from==null),Kt.to==null)return;Kt.to==C&&(Kt=!1)}}if(C>=x)break;for(var sr=Math.min(x,rt);;){if(G){var Kn=C+G.length;if(!Kt){var sn=Kn>sr?G.slice(0,sr-C):G;s.addToken(s,sn,J?J+Ct:Ct,Ft,C+sn.length==rt?kt:"",dt,Qt)}if(Kn>=sr){G=G.slice(sr-C),C=sr;break}C=Kn,Ft=""}G=h.slice(m,m=p[P++]),J=Yo(p[P++],s.cm.options)}}}function Jo(o,s,p){this.line=s,this.rest=Ze(s),this.size=this.rest?_e(ue(this.rest))-p+1:1,this.node=this.text=null,this.hidden=mn(o,s)}function po(o,s,p){for(var d=[],h,m=s;m<p;m=h){var w=new Jo(o.doc,Zt(o.doc,m),m);h=m+w.size,d.push(w)}return d}var ti=null;function es(o){ti?ti.ops.push(o):o.ownsGroup=ti={ops:[o],delayedCallbacks:[]}}function Bl(o){var s=o.delayedCallbacks,p=0;do{for(;p<s.length;p++)s[p].call(null);for(var d=0;d<o.ops.length;d++){var h=o.ops[d];if(h.cursorActivityHandlers)for(;h.cursorActivityCalled<h.cursorActivityHandlers.length;)h.cursorActivityHandlers[h.cursorActivityCalled++].call(null,h.cm)}}while(p<s.length)}function Zo(o,s){var p=o.ownsGroup;if(p)try{Bl(p)}finally{ti=null,s(p)}}var gi=null;function Qe(o,s){var p=Lt(o,s);if(p.length){var d=Array.prototype.slice.call(arguments,2),h;ti?h=ti.delayedCallbacks:gi?h=gi:(h=gi=[],setTimeout(yi,0));for(var m=function(x){h.push(function(){return p[x].apply(null,d)})},w=0;w<p.length;++w)m(w)}}function yi(){var o=gi;gi=null;for(var s=0;s<o.length;++s)o[s]()}function zr(o,s,p,d){for(var h=0;h<s.changes.length;h++){var m=s.changes[h];m=="text"?ta(o,s):m=="gutter"?_i(o,s,p,d):m=="class"?ho(o,s):m=="widget"&&rs(o,s,d)}s.changes=null}function mi(o){return o.node==o.text&&(o.node=B("div",null,null,"position: relative"),o.text.parentNode&&o.text.parentNode.replaceChild(o.node,o.text),o.node.appendChild(o.text),u&&c<8&&(o.node.style.zIndex=2)),o.node}function ns(o,s){var p=s.bgClass?s.bgClass+" "+(s.line.bgClass||""):s.line.bgClass;if(p&&(p+=" CodeMirror-linebackground"),s.background)p?s.background.className=p:(s.background.parentNode.removeChild(s.background),s.background=null);else if(p){var d=mi(s);s.background=d.insertBefore(B("div",null,p),d.firstChild),o.display.input.setUneditable(s.background)}}function Qo(o,s){var p=o.display.externalMeasured;return p&&p.line==s.line?(o.display.externalMeasured=null,s.measure=p.measure,p.built):co(o,s)}function ta(o,s){var p=s.text.className,d=Qo(o,s);s.text==s.node&&(s.node=d.pre),s.text.parentNode.replaceChild(d.pre,s.text),s.text=d.pre,d.bgClass!=s.bgClass||d.textClass!=s.textClass?(s.bgClass=d.bgClass,s.textClass=d.textClass,ho(o,s)):p&&(s.text.className=p)}function ho(o,s){ns(o,s),s.line.wrapClass?mi(s).className=s.line.wrapClass:s.node!=s.text&&(s.node.className="");var p=s.textClass?s.textClass+" "+(s.line.textClass||""):s.line.textClass;s.text.className=p||""}function _i(o,s,p,d){if(s.gutter&&(s.node.removeChild(s.gutter),s.gutter=null),s.gutterBackground&&(s.node.removeChild(s.gutterBackground),s.gutterBackground=null),s.line.gutterClass){var h=mi(s);s.gutterBackground=B("div",null,"CodeMirror-gutter-background "+s.line.gutterClass,"left: "+(o.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px"),o.display.input.setUneditable(s.gutterBackground),h.insertBefore(s.gutterBackground,s.text)}var m=s.line.gutterMarkers;if(o.options.lineNumbers||m){var w=mi(s),x=s.gutter=B("div",null,"CodeMirror-gutter-wrapper","left: "+(o.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px");if(x.setAttribute("aria-hidden","true"),o.display.input.setUneditable(x),w.insertBefore(x,s.text),s.line.gutterClass&&(x.className+=" "+s.line.gutterClass),o.options.lineNumbers&&(!m||!m["CodeMirror-linenumbers"])&&(s.lineNumber=x.appendChild(B("div",gr(o.options,p),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+o.display.lineNumInnerWidth+"px"))),m)for(var C=0;C<o.display.gutterSpecs.length;++C){var P=o.display.gutterSpecs[C].className,G=m.hasOwnProperty(P)&&m[P];G&&x.appendChild(B("div",[G],"CodeMirror-gutter-elt","left: "+d.gutterLeft[P]+"px; width: "+d.gutterWidth[P]+"px"))}}}function rs(o,s,p){s.alignable&&(s.alignable=null);for(var d=q("CodeMirror-linewidget"),h=s.node.firstChild,m=void 0;h;h=m)m=h.nextSibling,d.test(h.className)&&s.node.removeChild(h);wi(o,s,p)}function is(o,s,p,d){var h=Qo(o,s);return s.text=s.node=h.pre,h.bgClass&&(s.bgClass=h.bgClass),h.textClass&&(s.textClass=h.textClass),ho(o,s),_i(o,s,p,d),wi(o,s,d),s.node}function wi(o,s,p){if(ea(o,s.line,s,p,!0),s.rest)for(var d=0;d<s.rest.length;d++)ea(o,s.rest[d],s,p,!1)}function ea(o,s,p,d,h){if(s.widgets)for(var m=mi(p),w=0,x=s.widgets;w<x.length;++w){var C=x[w],P=B("div",[C.node],"CodeMirror-linewidget"+(C.className?" "+C.className:""));C.handleMouseEvents||P.setAttribute("cm-ignore-events","true"),os(C,P,p,d),o.display.input.setUneditable(P),h&&C.above?m.insertBefore(P,p.gutter||p.text):m.appendChild(P),Qe(C,"redraw")}}function os(o,s,p,d){if(o.noHScroll){(p.alignable||(p.alignable=[])).push(s);var h=d.wrapperWidth;s.style.left=d.fixedPos+"px",o.coverGutter||(h-=d.gutterTotalWidth,s.style.paddingLeft=d.gutterTotalWidth+"px"),s.style.width=h+"px"}o.coverGutter&&(s.style.zIndex=5,s.style.position="relative",o.noHScroll||(s.style.marginLeft=-d.gutterTotalWidth+"px"))}function bi(o){if(o.height!=null)return o.height;var s=o.doc.cm;if(!s)return 0;if(!A(document.body,o.node)){var p="position: relative;";o.coverGutter&&(p+="margin-left: -"+s.display.gutters.offsetWidth+"px;"),o.noHScroll&&(p+="width: "+s.display.wrapper.clientWidth+"px;"),I(s.display.measure,B("div",[o.node],null,p))}return o.height=o.node.parentNode.offsetHeight}function Ar(o,s){for(var p=Z(s);p!=o.wrapper;p=p.parentNode)if(!p||p.nodeType==1&&p.getAttribute("cm-ignore-events")=="true"||p.parentNode==o.sizer&&p!=o.mover)return!0}function xi(o){return o.lineSpace.offsetTop}function Bi(o){return o.mover.offsetHeight-o.lineSpace.offsetHeight}function as(o){if(o.cachedPaddingH)return o.cachedPaddingH;var s=I(o.measure,B("pre","x","CodeMirror-line-like")),p=window.getComputedStyle?window.getComputedStyle(s):s.currentStyle,d={left:parseInt(p.paddingLeft),right:parseInt(p.paddingRight)};return!isNaN(d.left)&&!isNaN(d.right)&&(o.cachedPaddingH=d),d}function or(o){return nt-o.display.nativeBarWidth}function ei(o){return o.display.scroller.clientWidth-or(o)-o.display.barWidth}function O(o){return o.display.scroller.clientHeight-or(o)-o.display.barHeight}function D(o,s,p){var d=o.options.lineWrapping,h=d&&ei(o);if(!s.measure.heights||d&&s.measure.width!=h){var m=s.measure.heights=[];if(d){s.measure.width=h;for(var w=s.text.firstChild.getClientRects(),x=0;x<w.length-1;x++){var C=w[x],P=w[x+1];Math.abs(C.bottom-P.bottom)>2&&m.push((C.bottom+P.top)/2-p.top)}}m.push(p.bottom-p.top)}}function Y(o,s,p){if(o.line==s)return{map:o.measure.map,cache:o.measure.cache};for(var d=0;d<o.rest.length;d++)if(o.rest[d]==s)return{map:o.measure.maps[d],cache:o.measure.caches[d]};for(var h=0;h<o.rest.length;h++)if(_e(o.rest[h])>p)return{map:o.measure.maps[h],cache:o.measure.caches[h],before:!0}}function Q(o,s){s=we(s);var p=_e(s),d=o.display.externalMeasured=new Jo(o.doc,s,p);d.lineN=p;var h=d.built=co(o,d);return d.text=h.pre,I(o.display.lineMeasure,h.pre),d}function pt(o,s,p,d){return Ut(o,Et(o,s),p,d)}function st(o,s){if(s>=o.display.viewFrom&&s<o.display.viewTo)return o.display.view[Ki(o,s)];var p=o.display.externalMeasured;if(p&&s>=p.lineN&&s<p.lineN+p.size)return p}function Et(o,s){var p=_e(s),d=st(o,p);d&&!d.text?d=null:d&&d.changes&&(zr(o,d,p,$l(o)),o.curOp.forceUpdate=!0),d||(d=Q(o,s));var h=Y(d,s,p);return{line:s,view:d,rect:null,map:h.map,cache:h.cache,before:h.before,hasHeights:!1}}function Ut(o,s,p,d,h){s.before&&(p=-1);var m=p+(d||""),w;return s.cache.hasOwnProperty(m)?w=s.cache[m]:(s.rect||(s.rect=s.view.text.getBoundingClientRect()),s.hasHeights||(D(o,s.view,s.rect),s.hasHeights=!0),w=kn(o,s,p,d),w.bogus||(s.cache[m]=w)),{left:w.left,right:w.right,top:h?w.rtop:w.top,bottom:h?w.rbottom:w.bottom}}var be={left:0,right:0,top:0,bottom:0};function me(o,s,p){for(var d,h,m,w,x,C,P=0;P<o.length;P+=3)if(x=o[P],C=o[P+1],s<x?(h=0,m=1,w="left"):s<C?(h=s-x,m=h+1):(P==o.length-3||s==C&&o[P+3]>s)&&(m=C-x,h=m-1,s>=C&&(w="right")),h!=null){if(d=o[P+2],x==C&&p==(d.insertLeft?"left":"right")&&(w=p),p=="left"&&h==0)for(;P&&o[P-2]==o[P-3]&&o[P-1].insertLeft;)d=o[(P-=3)+2],w="left";if(p=="right"&&h==C-x)for(;P<o.length-3&&o[P+3]==o[P+4]&&!o[P+5].insertLeft;)d=o[(P+=3)+2],w="right";break}return{node:d,start:h,end:m,collapse:w,coverStart:x,coverEnd:C}}function vn(o,s){var p=be;if(s=="left")for(var d=0;d<o.length&&(p=o[d]).left==p.right;d++);else for(var h=o.length-1;h>=0&&(p=o[h]).left==p.right;h--);return p}function kn(o,s,p,d){var h=me(s.map,p,d),m=h.node,w=h.start,x=h.end,C=h.collapse,P;if(m.nodeType==3){for(var G=0;G<4;G++){for(;w&&ft(s.line.text.charAt(h.coverStart+w));)--w;for(;h.coverStart+x<h.coverEnd&&ft(s.line.text.charAt(h.coverStart+x));)++x;if(u&&c<9&&w==0&&x==h.coverEnd-h.coverStart?P=m.parentNode.getBoundingClientRect():P=vn(et(m,w,x).getClientRects(),d),P.left||P.right||w==0)break;x=w,w=w-1,C="right"}u&&c<11&&(P=ss(o.display.measure,P))}else{w>0&&(C=d="right");var J;o.options.lineWrapping&&(J=m.getClientRects()).length>1?P=J[d=="right"?J.length-1:0]:P=m.getBoundingClientRect()}if(u&&c<9&&!w&&(!P||!P.left&&!P.right)){var dt=m.parentNode.getClientRects()[0];dt?P={left:dt.left,right:dt.left+go(o.display),top:dt.top,bottom:dt.bottom}:P=be}for(var rt=P.top-s.rect.top,Ct=P.bottom-s.rect.top,kt=(rt+Ct)/2,Ft=s.view.measure.heights,Kt=0;Kt<Ft.length-1&&!(kt<Ft[Kt]);Kt++);var Qt=Kt?Ft[Kt-1]:0,Gt=Ft[Kt],ee={left:(C=="right"?P.right:P.left)-s.rect.left,right:(C=="left"?P.left:P.right)-s.rect.left,top:Qt,bottom:Gt};return!P.left&&!P.right&&(ee.bogus=!0),o.options.singleCursorHeightPerLine||(ee.rtop=rt,ee.rbottom=Ct),ee}function ss(o,s){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ze(o))return s;var p=screen.logicalXDPI/screen.deviceXDPI,d=screen.logicalYDPI/screen.deviceYDPI;return{left:s.left*p,right:s.right*p,top:s.top*d,bottom:s.bottom*d}}function na(o){if(o.measure&&(o.measure.cache={},o.measure.heights=null,o.rest))for(var s=0;s<o.rest.length;s++)o.measure.caches[s]={}}function Vc(o){o.display.externalMeasure=null,H(o.display.lineMeasure);for(var s=0;s<o.display.view.length;s++)na(o.display.view[s])}function ra(o){Vc(o),o.display.cachedCharWidth=o.display.cachedTextHeight=o.display.cachedPaddingH=null,o.options.lineWrapping||(o.display.maxLineChanged=!0),o.display.lineNumChars=null}function Hc(){return g&&N?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Uc(){return g&&N?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Wl(o){var s=0;if(o.widgets)for(var p=0;p<o.widgets.length;++p)o.widgets[p].above&&(s+=bi(o.widgets[p]));return s}function ls(o,s,p,d,h){if(!h){var m=Wl(s);p.top+=m,p.bottom+=m}if(d=="line")return p;d||(d="local");var w=ir(s);if(d=="local"?w+=xi(o.display):w-=o.display.viewOffset,d=="page"||d=="window"){var x=o.display.lineSpace.getBoundingClientRect();w+=x.top+(d=="window"?0:Uc());var C=x.left+(d=="window"?0:Hc());p.left+=C,p.right+=C}return p.top+=w,p.bottom+=w,p}function Bc(o,s,p){if(p=="div")return s;var d=s.left,h=s.top;if(p=="page")d-=Hc(),h-=Uc();else if(p=="local"||!p){var m=o.display.sizer.getBoundingClientRect();d+=m.left,h+=m.top}var w=o.display.lineSpace.getBoundingClientRect();return{left:d-w.left,top:h-w.top}}function us(o,s,p,d,h){return d||(d=Zt(o.doc,s.line)),ls(o,d,pt(o,d,s.ch,h),p)}function Fr(o,s,p,d,h,m){d=d||Zt(o.doc,s.line),h||(h=Et(o,d));function w(Ct,kt){var Ft=Ut(o,h,Ct,kt?"right":"left",m);return kt?Ft.left=Ft.right:Ft.right=Ft.left,ls(o,d,Ft,p)}var x=M(d,o.doc.direction),C=s.ch,P=s.sticky;if(C>=d.text.length?(C=d.text.length,P="before"):C<=0&&(C=0,P="after"),!x)return w(P=="before"?C-1:C,P=="before");function G(Ct,kt,Ft){var Kt=x[kt],Qt=Kt.level==1;return w(Ft?Ct-1:Ct,Qt!=Ft)}var J=V(x,C,P),dt=de,rt=G(C,J,P=="before");return dt!=null&&(rt.other=G(C,dt,P!="before")),rt}function Wc(o,s){var p=0;s=Rt(o.doc,s),o.options.lineWrapping||(p=go(o.display)*s.ch);var d=Zt(o.doc,s.line),h=ir(d)+xi(o.display);return{left:p,right:p,top:h,bottom:h+d.height}}function zl(o,s,p,d,h){var m=Mt(o,s,p);return m.xRel=h,d&&(m.outside=d),m}function Kl(o,s,p){var d=o.doc;if(p+=o.display.viewOffset,p<0)return zl(d.first,0,null,-1,-1);var h=Ne(d,p),m=d.first+d.size-1;if(h>m)return zl(d.first+d.size-1,Zt(d,m).text.length,null,1,1);s<0&&(s=0);for(var w=Zt(d,h);;){var x=dv(o,w,h,s,p),C=ae(w,x.ch+(x.xRel>0||x.outside>0?1:0));if(!C)return x;var P=C.find(1);if(P.line==h)return P;w=Zt(d,h=P.line)}}function zc(o,s,p,d){d-=Wl(s);var h=s.text.length,m=ne(function(w){return Ut(o,p,w-1).bottom<=d},h,0);return h=ne(function(w){return Ut(o,p,w).top>d},m,h),{begin:m,end:h}}function Kc(o,s,p,d){p||(p=Et(o,s));var h=ls(o,s,Ut(o,p,d),"line").top;return zc(o,s,p,h)}function Gl(o,s,p,d){return o.bottom<=p?!1:o.top>p?!0:(d?o.left:o.right)>s}function dv(o,s,p,d,h){h-=ir(s);var m=Et(o,s),w=Wl(s),x=0,C=s.text.length,P=!0,G=M(s,o.doc.direction);if(G){var J=(o.options.lineWrapping?hv:pv)(o,s,p,m,G,d,h);P=J.level!=1,x=P?J.from:J.to-1,C=P?J.to:J.from-1}var dt=null,rt=null,Ct=ne(function(ce){var se=Ut(o,m,ce);return se.top+=w,se.bottom+=w,Gl(se,d,h,!1)?(se.top<=h&&se.left<=d&&(dt=ce,rt=se),!0):!1},x,C),kt,Ft,Kt=!1;if(rt){var Qt=d-rt.left<rt.right-d,Gt=Qt==P;Ct=dt+(Gt?0:1),Ft=Gt?"after":"before",kt=Qt?rt.left:rt.right}else{!P&&(Ct==C||Ct==x)&&Ct++,Ft=Ct==0?"after":Ct==s.text.length?"before":Ut(o,m,Ct-(P?1:0)).bottom+w<=h==P?"after":"before";var ee=Fr(o,Mt(p,Ct,Ft),"line",s,m);kt=ee.left,Kt=h<ee.top?-1:h>=ee.bottom?1:0}return Ct=it(s.text,Ct,1),zl(p,Ct,Ft,Kt,d-kt)}function pv(o,s,p,d,h,m,w){var x=ne(function(J){var dt=h[J],rt=dt.level!=1;return Gl(Fr(o,Mt(p,rt?dt.to:dt.from,rt?"before":"after"),"line",s,d),m,w,!0)},0,h.length-1),C=h[x];if(x>0){var P=C.level!=1,G=Fr(o,Mt(p,P?C.from:C.to,P?"after":"before"),"line",s,d);Gl(G,m,w,!0)&&G.top>w&&(C=h[x-1])}return C}function hv(o,s,p,d,h,m,w){var x=zc(o,s,d,w),C=x.begin,P=x.end;/\s/.test(s.text.charAt(P-1))&&P--;for(var G=null,J=null,dt=0;dt<h.length;dt++){var rt=h[dt];if(!(rt.from>=P||rt.to<=C)){var Ct=rt.level!=1,kt=Ut(o,d,Ct?Math.min(P,rt.to)-1:Math.max(C,rt.from)).right,Ft=kt<m?m-kt+1e9:kt-m;(!G||J>Ft)&&(G=rt,J=Ft)}}return G||(G=h[h.length-1]),G.from<C&&(G={from:C,to:G.to,level:G.level}),G.to>P&&(G={from:G.from,to:P,level:G.level}),G}var Wi;function vo(o){if(o.cachedTextHeight!=null)return o.cachedTextHeight;if(Wi==null){Wi=B("pre",null,"CodeMirror-line-like");for(var s=0;s<49;++s)Wi.appendChild(document.createTextNode("x")),Wi.appendChild(B("br"));Wi.appendChild(document.createTextNode("x"))}I(o.measure,Wi);var p=Wi.offsetHeight/50;return p>3&&(o.cachedTextHeight=p),H(o.measure),p||1}function go(o){if(o.cachedCharWidth!=null)return o.cachedCharWidth;var s=B("span","xxxxxxxxxx"),p=B("pre",[s],"CodeMirror-line-like");I(o.measure,p);var d=s.getBoundingClientRect(),h=(d.right-d.left)/10;return h>2&&(o.cachedCharWidth=h),h||10}function $l(o){for(var s=o.display,p={},d={},h=s.gutters.clientLeft,m=s.gutters.firstChild,w=0;m;m=m.nextSibling,++w){var x=o.display.gutterSpecs[w].className;p[x]=m.offsetLeft+m.clientLeft+h,d[x]=m.clientWidth}return{fixedPos:ql(s),gutterTotalWidth:s.gutters.offsetWidth,gutterLeft:p,gutterWidth:d,wrapperWidth:s.wrapper.clientWidth}}function ql(o){return o.scroller.getBoundingClientRect().left-o.sizer.getBoundingClientRect().left}function Gc(o){var s=vo(o.display),p=o.options.lineWrapping,d=p&&Math.max(5,o.display.scroller.clientWidth/go(o.display)-3);return function(h){if(mn(o.doc,h))return 0;var m=0;if(h.widgets)for(var w=0;w<h.widgets.length;w++)h.widgets[w].height&&(m+=h.widgets[w].height);return p?m+(Math.ceil(h.text.length/d)||1)*s:m+s}}function Yl(o){var s=o.doc,p=Gc(o);s.iter(function(d){var h=p(d);h!=d.height&&on(d,h)})}function zi(o,s,p,d){var h=o.display;if(!p&&Z(s).getAttribute("cm-not-content")=="true")return null;var m,w,x=h.lineSpace.getBoundingClientRect();try{m=s.clientX-x.left,w=s.clientY-x.top}catch(J){return null}var C=Kl(o,m,w),P;if(d&&C.xRel>0&&(P=Zt(o.doc,C.line).text).length==C.ch){var G=mt(P,P.length,o.options.tabSize)-P.length;C=Mt(C.line,Math.max(0,Math.round((m-as(o.display).left)/go(o.display))-G))}return C}function Ki(o,s){if(s>=o.display.viewTo||(s-=o.display.viewFrom,s<0))return null;for(var p=o.display.view,d=0;d<p.length;d++)if(s-=p[d].size,s<0)return d}function Wn(o,s,p,d){s==null&&(s=o.doc.first),p==null&&(p=o.doc.first+o.doc.size),d||(d=0);var h=o.display;if(d&&p<h.viewTo&&(h.updateLineNumbers==null||h.updateLineNumbers>s)&&(h.updateLineNumbers=s),o.curOp.viewChanged=!0,s>=h.viewTo)pn&&nr(o.doc,s)<h.viewTo&&Si(o);else if(p<=h.viewFrom)pn&&rr(o.doc,p+d)>h.viewFrom?Si(o):(h.viewFrom+=d,h.viewTo+=d);else if(s<=h.viewFrom&&p>=h.viewTo)Si(o);else if(s<=h.viewFrom){var m=cs(o,p,p+d,1);m?(h.view=h.view.slice(m.index),h.viewFrom=m.lineN,h.viewTo+=d):Si(o)}else if(p>=h.viewTo){var w=cs(o,s,s,-1);w?(h.view=h.view.slice(0,w.index),h.viewTo=w.lineN):Si(o)}else{var x=cs(o,s,s,-1),C=cs(o,p,p+d,1);x&&C?(h.view=h.view.slice(0,x.index).concat(po(o,x.lineN,C.lineN)).concat(h.view.slice(C.index)),h.viewTo+=d):Si(o)}var P=h.externalMeasured;P&&(p<P.lineN?P.lineN+=d:s<P.lineN+P.size&&(h.externalMeasured=null))}function Ci(o,s,p){o.curOp.viewChanged=!0;var d=o.display,h=o.display.externalMeasured;if(h&&s>=h.lineN&&s<h.lineN+h.size&&(d.externalMeasured=null),!(s<d.viewFrom||s>=d.viewTo)){var m=d.view[Ki(o,s)];if(m.node!=null){var w=m.changes||(m.changes=[]);It(w,p)==-1&&w.push(p)}}}function Si(o){o.display.viewFrom=o.display.viewTo=o.doc.first,o.display.view=[],o.display.viewOffset=0}function cs(o,s,p,d){var h=Ki(o,s),m,w=o.display.view;if(!pn||p==o.doc.first+o.doc.size)return{index:h,lineN:p};for(var x=o.display.viewFrom,C=0;C<h;C++)x+=w[C].size;if(x!=s){if(d>0){if(h==w.length-1)return null;m=x+w[h].size-s,h++}else m=x-s;s+=m,p+=m}for(;nr(o.doc,p)!=p;){if(h==(d<0?0:w.length-1))return null;p+=d*w[h-(d<0?1:0)].size,h+=d}return{index:h,lineN:p}}function vv(o,s,p){var d=o.display,h=d.view;h.length==0||s>=d.viewTo||p<=d.viewFrom?(d.view=po(o,s,p),d.viewFrom=s):(d.viewFrom>s?d.view=po(o,s,d.viewFrom).concat(d.view):d.viewFrom<s&&(d.view=d.view.slice(Ki(o,s))),d.viewFrom=s,d.viewTo<p?d.view=d.view.concat(po(o,d.viewTo,p)):d.viewTo>p&&(d.view=d.view.slice(0,Ki(o,p)))),d.viewTo=p}function $c(o){for(var s=o.display.view,p=0,d=0;d<s.length;d++){var h=s[d];!h.hidden&&(!h.node||h.changes)&&++p}return p}function ia(o){o.display.input.showSelection(o.display.input.prepareSelection())}function qc(o,s){s===void 0&&(s=!0);for(var p=o.doc,d={},h=d.cursors=document.createDocumentFragment(),m=d.selection=document.createDocumentFragment(),w=0;w<p.sel.ranges.length;w++)if(!(!s&&w==p.sel.primIndex)){var x=p.sel.ranges[w];if(!(x.from().line>=o.display.viewTo||x.to().line<o.display.viewFrom)){var C=x.empty();(C||o.options.showCursorWhenSelecting)&&Yc(o,x.head,h),C||gv(o,x,m)}}return d}function Yc(o,s,p){var d=Fr(o,s,"div",null,null,!o.options.singleCursorHeightPerLine),h=p.appendChild(B("div","\xA0","CodeMirror-cursor"));if(h.style.left=d.left+"px",h.style.top=d.top+"px",h.style.height=Math.max(0,d.bottom-d.top)*o.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(o.getWrapperElement().className)){var m=us(o,s,"div",null,null);m.right-m.left>0&&(h.style.width=m.right-m.left+"px")}if(d.other){var w=p.appendChild(B("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));w.style.display="",w.style.left=d.other.left+"px",w.style.top=d.other.top+"px",w.style.height=(d.other.bottom-d.other.top)*.85+"px"}}function fs(o,s){return o.top-s.top||o.left-s.left}function gv(o,s,p){var d=o.display,h=o.doc,m=document.createDocumentFragment(),w=as(o.display),x=w.left,C=Math.max(d.sizerWidth,ei(o)-d.sizer.offsetLeft)-w.right,P=h.direction=="ltr";function G(Gt,ee,ce,se){ee<0&&(ee=0),ee=Math.round(ee),se=Math.round(se),m.appendChild(B("div",null,"CodeMirror-selected","position: absolute; left: "+Gt+`px; 8 top: `+ee+"px; width: "+(ce??C-Gt)+`px; 9 height: `+(se-ee)+"px"))}function J(Gt,ee,ce){var se=Zt(h,Gt),Se=se.text.length,He,xn;function Xe(sn,Gn){return us(o,Mt(Gt,sn),"div",se,Gn)}function sr(sn,Gn,En){var gn=Kc(o,se,null,sn),ln=Gn=="ltr"==(En=="after")?"left":"right",tn=En=="after"?gn.begin:gn.end-(/\s/.test(se.text.charAt(gn.end-1))?2:1);return Xe(tn,ln)[ln]}var Kn=M(se,h.direction);return ye(Kn,ee||0,ce??Se,function(sn,Gn,En,gn){var ln=En=="ltr",tn=Xe(sn,ln?"left":"right"),$n=Xe(Gn-1,ln?"right":"left"),Ao=ee==null&&sn==0,ki=ce==null&&Gn==Se,Ln=gn==0,Kr=!Kn||gn==Kn.length-1;if($n.top-tn.top<=3){var Cn=(P?Ao:ki)&&Ln,bu=(P?ki:Ao)&&Kr,ri=Cn?x:(ln?tn:$n).left,Xi=bu?C:(ln?$n:tn).right;G(ri,tn.top,Xi-ri,tn.bottom)}else{var Ji,Rn,ko,xu;ln?(Ji=P&&Ao&&Ln?x:tn.left,Rn=P?C:sr(sn,En,"before"),ko=P?x:sr(Gn,En,"after"),xu=P&&ki&&Kr?C:$n.right):(Ji=P?sr(sn,En,"before"):x,Rn=!P&&Ao&&Ln?C:tn.right,ko=!P&&ki&&Kr?x:$n.left,xu=P?sr(Gn,En,"after"):C),G(Ji,tn.top,Rn-Ji,tn.bottom),tn.bottom<$n.top&&G(x,tn.bottom,null,$n.top),G(ko,$n.top,xu-ko,$n.bottom)}(!He||fs(tn,He)<0)&&(He=tn),fs($n,He)<0&&(He=$n),(!xn||fs(tn,xn)<0)&&(xn=tn),fs($n,xn)<0&&(xn=$n)}),{start:He,end:xn}}var dt=s.from(),rt=s.to();if(dt.line==rt.line)J(dt.line,dt.ch,rt.ch);else{var Ct=Zt(h,dt.line),kt=Zt(h,rt.line),Ft=we(Ct)==we(kt),Kt=J(dt.line,dt.ch,Ft?Ct.text.length+1:null).end,Qt=J(rt.line,Ft?0:null,rt.ch).start;Ft&&(Kt.top<Qt.top-2?(G(Kt.right,Kt.top,null,Kt.bottom),G(x,Qt.top,Qt.left,Qt.bottom)):G(Kt.right,Kt.top,Qt.left-Kt.right,Kt.bottom)),Kt.bottom<Qt.top&&G(x,Kt.bottom,null,Qt.top)}p.appendChild(m)}function Xl(o){if(o.state.focused){var s=o.display;clearInterval(s.blinker);var p=!0;s.cursorDiv.style.visibility="",o.options.cursorBlinkRate>0?s.blinker=setInterval(function(){o.hasFocus()||yo(o),s.cursorDiv.style.visibility=(p=!p)?"":"hidden"},o.options.cursorBlinkRate):o.options.cursorBlinkRate<0&&(s.cursorDiv.style.visibility="hidden")}}function Xc(o){o.hasFocus()||(o.display.input.focus(),o.state.focused||Zl(o))}function Jl(o){o.state.delayingBlurEvent=!0,setTimeout(function(){o.state.delayingBlurEvent&&(o.state.delayingBlurEvent=!1,o.state.focused&&yo(o))},100)}function Zl(o,s){o.state.delayingBlurEvent&&!o.state.draggingText&&(o.state.delayingBlurEvent=!1),o.options.readOnly!="nocursor"&&(o.state.focused||(qt(o,"focus",o,s),o.state.focused=!0,yt(o.display.wrapper,"CodeMirror-focused"),!o.curOp&&o.display.selForContextMenu!=o.doc.sel&&(o.display.input.reset(),f&&setTimeout(function(){return o.display.input.reset(!0)},20)),o.display.input.receivedFocus()),Xl(o))}function yo(o,s){o.state.delayingBlurEvent||(o.state.focused&&(qt(o,"blur",o,s),o.state.focused=!1,lt(o.display.wrapper,"CodeMirror-focused")),clearInterval(o.display.blinker),setTimeout(function(){o.state.focused||(o.display.shift=!1)},150))}function ds(o){for(var s=o.display,p=s.lineDiv.offsetTop,d=Math.max(0,s.scroller.getBoundingClientRect().top),h=s.lineDiv.getBoundingClientRect().top,m=0,w=0;w<s.view.length;w++){var x=s.view[w],C=o.options.lineWrapping,P=void 0,G=0;if(!x.hidden){if(h+=x.line.height,u&&c<8){var J=x.node.offsetTop+x.node.offsetHeight;P=J-p,p=J}else{var dt=x.node.getBoundingClientRect();P=dt.bottom-dt.top,!C&&x.text.firstChild&&(G=x.text.firstChild.getBoundingClientRect().right-dt.left-1)}var rt=x.line.height-P;if((rt>.005||rt<-.005)&&(h<d&&(m-=rt),on(x.line,P),Jc(x.line),x.rest))for(var Ct=0;Ct<x.rest.length;Ct++)Jc(x.rest[Ct]);if(G>o.display.sizerWidth){var kt=Math.ceil(G/go(o.display));kt>o.display.maxLineLength&&(o.display.maxLineLength=kt,o.display.maxLine=x.line,o.display.maxLineChanged=!0)}}}Math.abs(m)>2&&(s.scroller.scrollTop+=m)}function Jc(o){if(o.widgets)for(var s=0;s<o.widgets.length;++s){var p=o.widgets[s],d=p.node.parentNode;d&&(p.height=d.offsetHeight)}}function ps(o,s,p){var d=p&&p.top!=null?Math.max(0,p.top):o.scroller.scrollTop;d=Math.floor(d-xi(o));var h=p&&p.bottom!=null?p.bottom:d+o.wrapper.clientHeight,m=Ne(s,d),w=Ne(s,h);if(p&&p.ensure){var x=p.ensure.from.line,C=p.ensure.to.line;x<m?(m=x,w=Ne(s,ir(Zt(s,x))+o.wrapper.clientHeight)):Math.min(C,s.lastLine())>=w&&(m=Ne(s,ir(Zt(s,C))-o.wrapper.clientHeight),w=C)}return{from:m,to:Math.max(w,m+1)}}function yv(o,s){if(!Bt(o,"scrollCursorIntoView")){var p=o.display,d=p.sizer.getBoundingClientRect(),h=null;if(s.top+d.top<0?h=!0:s.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(h=!1),h!=null&&!S){var m=B("div","\u200B",null,`position: absolute; 10 top: `+(s.top-p.viewOffset-xi(o.display))+`px; 11 height: `+(s.bottom-s.top+or(o)+p.barHeight)+`px; 12 left: `+s.left+"px; width: "+Math.max(2,s.right-s.left)+"px;");o.display.lineSpace.appendChild(m),m.scrollIntoView(h),o.display.lineSpace.removeChild(m)}}}function mv(o,s,p,d){d==null&&(d=0);var h;!o.options.lineWrapping&&s==p&&(p=s.sticky=="before"?Mt(s.line,s.ch+1,"before"):s,s=s.ch?Mt(s.line,s.sticky=="before"?s.ch-1:s.ch,"after"):s);for(var m=0;m<5;m++){var w=!1,x=Fr(o,s),C=!p||p==s?x:Fr(o,p);h={left:Math.min(x.left,C.left),top:Math.min(x.top,C.top)-d,right:Math.max(x.left,C.left),bottom:Math.max(x.bottom,C.bottom)+d};var P=Ql(o,h),G=o.doc.scrollTop,J=o.doc.scrollLeft;if(P.scrollTop!=null&&(aa(o,P.scrollTop),Math.abs(o.doc.scrollTop-G)>1&&(w=!0)),P.scrollLeft!=null&&(Gi(o,P.scrollLeft),Math.abs(o.doc.scrollLeft-J)>1&&(w=!0)),!w)break}return h}function _v(o,s){var p=Ql(o,s);p.scrollTop!=null&&aa(o,p.scrollTop),p.scrollLeft!=null&&Gi(o,p.scrollLeft)}function Ql(o,s){var p=o.display,d=vo(o.display);s.top<0&&(s.top=0);var h=o.curOp&&o.curOp.scrollTop!=null?o.curOp.scrollTop:p.scroller.scrollTop,m=O(o),w={};s.bottom-s.top>m&&(s.bottom=s.top+m);var x=o.doc.height+Bi(p),C=s.top<d,P=s.bottom>x-d;if(s.top<h)w.scrollTop=C?0:s.top;else if(s.bottom>h+m){var G=Math.min(s.top,(P?x:s.bottom)-m);G!=h&&(w.scrollTop=G)}var J=o.options.fixedGutter?0:p.gutters.offsetWidth,dt=o.curOp&&o.curOp.scrollLeft!=null?o.curOp.scrollLeft:p.scroller.scrollLeft-J,rt=ei(o)-p.gutters.offsetWidth,Ct=s.right-s.left>rt;return Ct&&(s.right=s.left+rt),s.left<10?w.scrollLeft=0:s.left<dt?w.scrollLeft=Math.max(0,s.left+J-(Ct?0:10)):s.right>rt+dt-3&&(w.scrollLeft=s.right+(Ct?0:10)-rt),w}function tu(o,s){s!=null&&(hs(o),o.curOp.scrollTop=(o.curOp.scrollTop==null?o.doc.scrollTop:o.curOp.scrollTop)+s)}function mo(o){hs(o);var s=o.getCursor();o.curOp.scrollToPos={from:s,to:s,margin:o.options.cursorScrollMargin}}function oa(o,s,p){(s!=null||p!=null)&&hs(o),s!=null&&(o.curOp.scrollLeft=s),p!=null&&(o.curOp.scrollTop=p)}function wv(o,s){hs(o),o.curOp.scrollToPos=s}function hs(o){var s=o.curOp.scrollToPos;if(s){o.curOp.scrollToPos=null;var p=Wc(o,s.from),d=Wc(o,s.to);Zc(o,p,d,s.margin)}}function Zc(o,s,p,d){var h=Ql(o,{left:Math.min(s.left,p.left),top:Math.min(s.top,p.top)-d,right:Math.max(s.right,p.right),bottom:Math.max(s.bottom,p.bottom)+d});oa(o,h.scrollLeft,h.scrollTop)}function aa(o,s){Math.abs(o.doc.scrollTop-s)<2||(e||nu(o,{top:s}),Qc(o,s,!0),e&&nu(o),ua(o,100))}function Qc(o,s,p){s=Math.max(0,Math.min(o.display.scroller.scrollHeight-o.display.scroller.clientHeight,s)),!(o.display.scroller.scrollTop==s&&!p)&&(o.doc.scrollTop=s,o.display.scrollbars.setScrollTop(s),o.display.scroller.scrollTop!=s&&(o.display.scroller.scrollTop=s))}function Gi(o,s,p,d){s=Math.max(0,Math.min(s,o.display.scroller.scrollWidth-o.display.scroller.clientWidth)),!((p?s==o.doc.scrollLeft:Math.abs(o.doc.scrollLeft-s)<2)&&!d)&&(o.doc.scrollLeft=s,of(o),o.display.scroller.scrollLeft!=s&&(o.display.scroller.scrollLeft=s),o.display.scrollbars.setScrollLeft(s))}function sa(o){var s=o.display,p=s.gutters.offsetWidth,d=Math.round(o.doc.height+Bi(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?p:0,docHeight:d,scrollHeight:d+or(o)+s.barHeight,nativeBarWidth:s.nativeBarWidth,gutterWidth:p}}var $i=function(o,s,p){this.cm=p;var d=this.vert=B("div",[B("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),h=this.horiz=B("div",[B("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");d.tabIndex=h.tabIndex=-1,o(d),o(h),ht(d,"scroll",function(){d.clientHeight&&s(d.scrollTop,"vertical")}),ht(h,"scroll",function(){h.clientWidth&&s(h.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,u&&c<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};$i.prototype.update=function(o){var s=o.scrollWidth>o.clientWidth+1,p=o.scrollHeight>o.clientHeight+1,d=o.nativeBarWidth;if(p){this.vert.style.display="block",this.vert.style.bottom=s?d+"px":"0";var h=o.viewHeight-(s?d:0);this.vert.firstChild.style.height=Math.max(0,o.scrollHeight-o.clientHeight+h)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(s){this.horiz.style.display="block",this.horiz.style.right=p?d+"px":"0",this.horiz.style.left=o.barLeft+"px";var m=o.viewWidth-o.barLeft-(p?d:0);this.horiz.firstChild.style.width=Math.max(0,o.scrollWidth-o.clientWidth+m)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&o.clientHeight>0&&(d==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:p?d:0,bottom:s?d:0}},$i.prototype.setScrollLeft=function(o){this.horiz.scrollLeft!=o&&(this.horiz.scrollLeft=o),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},$i.prototype.setScrollTop=function(o){this.vert.scrollTop!=o&&(this.vert.scrollTop=o),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},$i.prototype.zeroWidthHack=function(){var o=R&&!b?"12px":"18px";this.horiz.style.height=this.vert.style.width=o,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new bt,this.disableVert=new bt},$i.prototype.enableZeroWidthBar=function(o,s,p){o.style.pointerEvents="auto";function d(){var h=o.getBoundingClientRect(),m=p=="vert"?document.elementFromPoint(h.right-1,(h.top+h.bottom)/2):document.elementFromPoint((h.right+h.left)/2,h.bottom-1);m!=o?o.style.pointerEvents="none":s.set(1e3,d)}s.set(1e3,d)},$i.prototype.clear=function(){var o=this.horiz.parentNode;o.removeChild(this.horiz),o.removeChild(this.vert)};var la=function(){};la.prototype.update=function(){return{bottom:0,right:0}},la.prototype.setScrollLeft=function(){},la.prototype.setScrollTop=function(){},la.prototype.clear=function(){};function _o(o,s){s||(s=sa(o));var p=o.display.barWidth,d=o.display.barHeight;tf(o,s);for(var h=0;h<4&&p!=o.display.barWidth||d!=o.display.barHeight;h++)p!=o.display.barWidth&&o.options.lineWrapping&&ds(o),tf(o,sa(o)),p=o.display.barWidth,d=o.display.barHeight}function tf(o,s){var p=o.display,d=p.scrollbars.update(s);p.sizer.style.paddingRight=(p.barWidth=d.right)+"px",p.sizer.style.paddingBottom=(p.barHeight=d.bottom)+"px",p.heightForcer.style.borderBottom=d.bottom+"px solid transparent",d.right&&d.bottom?(p.scrollbarFiller.style.display="block",p.scrollbarFiller.style.height=d.bottom+"px",p.scrollbarFiller.style.width=d.right+"px"):p.scrollbarFiller.style.display="",d.bottom&&o.options.coverGutterNextToScrollbar&&o.options.fixedGutter?(p.gutterFiller.style.display="block",p.gutterFiller.style.height=d.bottom+"px",p.gutterFiller.style.width=s.gutterWidth+"px"):p.gutterFiller.style.display=""}var ef={native:$i,null:la};function nf(o){o.display.scrollbars&&(o.display.scrollbars.clear(),o.display.scrollbars.addClass&<(o.display.wrapper,o.display.scrollbars.addClass)),o.display.scrollbars=new ef[o.options.scrollbarStyle](function(s){o.display.wrapper.insertBefore(s,o.display.scrollbarFiller),ht(s,"mousedown",function(){o.state.focused&&setTimeout(function(){return o.display.input.focus()},0)}),s.setAttribute("cm-not-content","true")},function(s,p){p=="horizontal"?Gi(o,s):aa(o,s)},o),o.display.scrollbars.addClass&&yt(o.display.wrapper,o.display.scrollbars.addClass)}var bv=0;function qi(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:++bv,markArrays:null},es(o.curOp)}function Yi(o){var s=o.curOp;s&&Zo(s,function(p){for(var d=0;d<p.ops.length;d++)p.ops[d].cm.curOp=null;xv(p)})}function xv(o){for(var s=o.ops,p=0;p<s.length;p++)Cv(s[p]);for(var d=0;d<s.length;d++)Sv(s[d]);for(var h=0;h<s.length;h++)Ov(s[h]);for(var m=0;m<s.length;m++)Tv(s[m]);for(var w=0;w<s.length;w++)Ev(s[w])}function Cv(o){var s=o.cm,p=s.display;Av(s),o.updateMaxLine&&vi(s),o.mustUpdate=o.viewChanged||o.forceUpdate||o.scrollTop!=null||o.scrollToPos&&(o.scrollToPos.from.line<p.viewFrom||o.scrollToPos.to.line>=p.viewTo)||p.maxLineChanged&&s.options.lineWrapping,o.update=o.mustUpdate&&new vs(s,o.mustUpdate&&{top:o.scrollTop,ensure:o.scrollToPos},o.forceUpdate)}function Sv(o){o.updatedDisplay=o.mustUpdate&&eu(o.cm,o.update)}function Ov(o){var s=o.cm,p=s.display;o.updatedDisplay&&ds(s),o.barMeasure=sa(s),p.maxLineChanged&&!s.options.lineWrapping&&(o.adjustWidthTo=pt(s,p.maxLine,p.maxLine.text.length).left+3,s.display.sizerWidth=o.adjustWidthTo,o.barMeasure.scrollWidth=Math.max(p.scroller.clientWidth,p.sizer.offsetLeft+o.adjustWidthTo+or(s)+s.display.barWidth),o.maxScrollLeft=Math.max(0,p.sizer.offsetLeft+o.adjustWidthTo-ei(s))),(o.updatedDisplay||o.selectionChanged)&&(o.preparedSelection=p.input.prepareSelection())}function Tv(o){var s=o.cm;o.adjustWidthTo!=null&&(s.display.sizer.style.minWidth=o.adjustWidthTo+"px",o.maxScrollLeft<s.doc.scrollLeft&&Gi(s,Math.min(s.display.scroller.scrollLeft,o.maxScrollLeft),!0),s.display.maxLineChanged=!1);var p=o.focus&&o.focus==gt();o.preparedSelection&&s.display.input.showSelection(o.preparedSelection,p),(o.updatedDisplay||o.startHeight!=s.doc.height)&&_o(s,o.barMeasure),o.updatedDisplay&&iu(s,o.barMeasure),o.selectionChanged&&Xl(s),s.state.focused&&o.updateInput&&s.display.input.reset(o.typing),p&&Xc(o.cm)}function Ev(o){var s=o.cm,p=s.display,d=s.doc;if(o.updatedDisplay&&rf(s,o.update),p.wheelStartX!=null&&(o.scrollTop!=null||o.scrollLeft!=null||o.scrollToPos)&&(p.wheelStartX=p.wheelStartY=null),o.scrollTop!=null&&Qc(s,o.scrollTop,o.forceScroll),o.scrollLeft!=null&&Gi(s,o.scrollLeft,!0,!0),o.scrollToPos){var h=mv(s,Rt(d,o.scrollToPos.from),Rt(d,o.scrollToPos.to),o.scrollToPos.margin);yv(s,h)}var m=o.maybeHiddenMarkers,w=o.maybeUnhiddenMarkers;if(m)for(var x=0;x<m.length;++x)m[x].lines.length||qt(m[x],"hide");if(w)for(var C=0;C<w.length;++C)w[C].lines.length&&qt(w[C],"unhide");p.wrapper.offsetHeight&&(d.scrollTop=s.display.scroller.scrollTop),o.changeObjs&&qt(s,"changes",s,o.changeObjs),o.update&&o.update.finish()}function ar(o,s){if(o.curOp)return s();qi(o);try{return s()}finally{Yi(o)}}function wn(o,s){return function(){if(o.curOp)return s.apply(o,arguments);qi(o);try{return s.apply(o,arguments)}finally{Yi(o)}}}function In(o){return function(){if(this.curOp)return o.apply(this,arguments);qi(this);try{return o.apply(this,arguments)}finally{Yi(this)}}}function bn(o){return function(){var s=this.cm;if(!s||s.curOp)return o.apply(this,arguments);qi(s);try{return o.apply(this,arguments)}finally{Yi(s)}}}function ua(o,s){o.doc.highlightFrontier<o.display.viewTo&&o.state.highlight.set(s,Xt(Pv,o))}function Pv(o){var s=o.doc;if(!(s.highlightFrontier>=o.display.viewTo)){var p=+new Date+o.options.workTime,d=Bn(o,s.highlightFrontier),h=[];s.iter(d.line,Math.min(s.first+s.size,o.display.viewTo+500),function(m){if(d.line>=o.display.viewFrom){var w=m.styles,x=m.text.length>o.options.maxHighlightLength?On(s.mode,d.state):null,C=ui(o,m,d,!0);x&&(d.state=x),m.styles=C.styles;var P=m.styleClasses,G=C.classes;G?m.styleClasses=G:P&&(m.styleClasses=null);for(var J=!w||w.length!=m.styles.length||P!=G&&(!P||!G||P.bgClass!=G.bgClass||P.textClass!=G.textClass),dt=0;!J&&dt<w.length;++dt)J=w[dt]!=m.styles[dt];J&&h.push(d.line),m.stateAfter=d.save(),d.nextLine()}else m.text.length<=o.options.maxHighlightLength&&Wr(o,m.text,d),m.stateAfter=d.line%5==0?d.save():null,d.nextLine();if(+new Date>p)return ua(o,o.options.workDelay),!0}),s.highlightFrontier=d.line,s.modeFrontier=Math.max(s.modeFrontier,d.line),h.length&&ar(o,function(){for(var m=0;m<h.length;m++)Ci(o,h[m],"text")})}}var vs=function(o,s,p){var d=o.display;this.viewport=s,this.visible=ps(d,o.doc,s),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=ei(o),this.force=p,this.dims=$l(o),this.events=[]};vs.prototype.signal=function(o,s){Ce(o,s)&&this.events.push(arguments)},vs.prototype.finish=function(){for(var o=0;o<this.events.length;o++)qt.apply(null,this.events[o])};function Av(o){var s=o.display;!s.scrollbarsClipped&&s.scroller.offsetWidth&&(s.nativeBarWidth=s.scroller.offsetWidth-s.scroller.clientWidth,s.heightForcer.style.height=or(o)+"px",s.sizer.style.marginBottom=-s.nativeBarWidth+"px",s.sizer.style.borderRightWidth=or(o)+"px",s.scrollbarsClipped=!0)}function kv(o){if(o.hasFocus())return null;var s=gt();if(!s||!A(o.display.lineDiv,s))return null;var p={activeElt:s};if(window.getSelection){var d=window.getSelection();d.anchorNode&&d.extend&&A(o.display.lineDiv,d.anchorNode)&&(p.anchorNode=d.anchorNode,p.anchorOffset=d.anchorOffset,p.focusNode=d.focusNode,p.focusOffset=d.focusOffset)}return p}function Mv(o){if(!(!o||!o.activeElt||o.activeElt==gt())&&(o.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(o.activeElt.nodeName)&&o.anchorNode&&A(document.body,o.anchorNode)&&A(document.body,o.focusNode))){var s=window.getSelection(),p=document.createRange();p.setEnd(o.anchorNode,o.anchorOffset),p.collapse(!1),s.removeAllRanges(),s.addRange(p),s.extend(o.focusNode,o.focusOffset)}}function eu(o,s){var p=o.display,d=o.doc;if(s.editorIsHidden)return Si(o),!1;if(!s.force&&s.visible.from>=p.viewFrom&&s.visible.to<=p.viewTo&&(p.updateLineNumbers==null||p.updateLineNumbers>=p.viewTo)&&p.renderedView==p.view&&$c(o)==0)return!1;af(o)&&(Si(o),s.dims=$l(o));var h=d.first+d.size,m=Math.max(s.visible.from-o.options.viewportMargin,d.first),w=Math.min(h,s.visible.to+o.options.viewportMargin);p.viewFrom<m&&m-p.viewFrom<20&&(m=Math.max(d.first,p.viewFrom)),p.viewTo>w&&p.viewTo-w<20&&(w=Math.min(h,p.viewTo)),pn&&(m=nr(o.doc,m),w=rr(o.doc,w));var x=m!=p.viewFrom||w!=p.viewTo||p.lastWrapHeight!=s.wrapperHeight||p.lastWrapWidth!=s.wrapperWidth;vv(o,m,w),p.viewOffset=ir(Zt(o.doc,p.viewFrom)),o.display.mover.style.top=p.viewOffset+"px";var C=$c(o);if(!x&&C==0&&!s.force&&p.renderedView==p.view&&(p.updateLineNumbers==null||p.updateLineNumbers>=p.viewTo))return!1;var P=kv(o);return C>4&&(p.lineDiv.style.display="none"),Lv(o,p.updateLineNumbers,s.dims),C>4&&(p.lineDiv.style.display=""),p.renderedView=p.view,Mv(P),H(p.cursorDiv),H(p.selectionDiv),p.gutters.style.height=p.sizer.style.minHeight=0,x&&(p.lastWrapHeight=s.wrapperHeight,p.lastWrapWidth=s.wrapperWidth,ua(o,400)),p.updateLineNumbers=null,!0}function rf(o,s){for(var p=s.viewport,d=!0;;d=!1){if(!d||!o.options.lineWrapping||s.oldDisplayWidth==ei(o)){if(p&&p.top!=null&&(p={top:Math.min(o.doc.height+Bi(o.display)-O(o),p.top)}),s.visible=ps(o.display,o.doc,p),s.visible.from>=o.display.viewFrom&&s.visible.to<=o.display.viewTo)break}else d&&(s.visible=ps(o.display,o.doc,p));if(!eu(o,s))break;ds(o);var h=sa(o);ia(o),_o(o,h),iu(o,h),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 nu(o,s){var p=new vs(o,s);if(eu(o,p)){ds(o),rf(o,p);var d=sa(o);ia(o),_o(o,d),iu(o,d),p.finish()}}function Lv(o,s,p){var d=o.display,h=o.options.lineNumbers,m=d.lineDiv,w=m.firstChild;function x(Ct){var kt=Ct.nextSibling;return f&&R&&o.display.currentWheelTarget==Ct?Ct.style.display="none":Ct.parentNode.removeChild(Ct),kt}for(var C=d.view,P=d.viewFrom,G=0;G<C.length;G++){var J=C[G];if(!J.hidden)if(!J.node||J.node.parentNode!=m){var dt=is(o,J,P,p);m.insertBefore(dt,w)}else{for(;w!=J.node;)w=x(w);var rt=h&&s!=null&&s<=P&&J.lineNumber;J.changes&&(It(J.changes,"gutter")>-1&&(rt=!1),zr(o,J,P,p)),rt&&(H(J.lineNumber),J.lineNumber.appendChild(document.createTextNode(gr(o.options,P)))),w=J.node.nextSibling}P+=J.size}for(;w;)w=x(w)}function ru(o){var s=o.gutters.offsetWidth;o.sizer.style.marginLeft=s+"px",Qe(o,"gutterChanged",o)}function iu(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+or(o)+"px"}function of(o){var s=o.display,p=s.view;if(!(!s.alignWidgets&&(!s.gutters.firstChild||!o.options.fixedGutter))){for(var d=ql(s)-s.scroller.scrollLeft+o.doc.scrollLeft,h=s.gutters.offsetWidth,m=d+"px",w=0;w<p.length;w++)if(!p[w].hidden){o.options.fixedGutter&&(p[w].gutter&&(p[w].gutter.style.left=m),p[w].gutterBackground&&(p[w].gutterBackground.style.left=m));var x=p[w].alignable;if(x)for(var C=0;C<x.length;C++)x[C].style.left=m}o.options.fixedGutter&&(s.gutters.style.left=d+h+"px")}}function af(o){if(!o.options.lineNumbers)return!1;var s=o.doc,p=gr(o.options,s.first+s.size-1),d=o.display;if(p.length!=d.lineNumChars){var h=d.measure.appendChild(B("div",[B("div",p)],"CodeMirror-linenumber CodeMirror-gutter-elt")),m=h.firstChild.offsetWidth,w=h.offsetWidth-m;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(m,d.lineGutter.offsetWidth-w)+1,d.lineNumWidth=d.lineNumInnerWidth+w,d.lineNumChars=d.lineNumInnerWidth?p.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",ru(o.display),!0}return!1}function ou(o,s){for(var p=[],d=!1,h=0;h<o.length;h++){var m=o[h],w=null;if(typeof m!="string"&&(w=m.style,m=m.className),m=="CodeMirror-linenumbers")if(s)d=!0;else continue;p.push({className:m,style:w})}return s&&!d&&p.push({className:"CodeMirror-linenumbers",style:null}),p}function sf(o){var s=o.gutters,p=o.gutterSpecs;H(s),o.lineGutter=null;for(var d=0;d<p.length;++d){var h=p[d],m=h.className,w=h.style,x=s.appendChild(B("div",null,"CodeMirror-gutter "+m));w&&(x.style.cssText=w),m=="CodeMirror-linenumbers"&&(o.lineGutter=x,x.style.width=(o.lineNumWidth||1)+"px")}s.style.display=p.length?"":"none",ru(o)}function ca(o){sf(o.display),Wn(o),of(o)}function Dv(o,s,p,d){var h=this;this.input=p,h.scrollbarFiller=B("div",null,"CodeMirror-scrollbar-filler"),h.scrollbarFiller.setAttribute("cm-not-content","true"),h.gutterFiller=B("div",null,"CodeMirror-gutter-filler"),h.gutterFiller.setAttribute("cm-not-content","true"),h.lineDiv=U("div",null,"CodeMirror-code"),h.selectionDiv=B("div",null,null,"position: relative; z-index: 1"),h.cursorDiv=B("div",null,"CodeMirror-cursors"),h.measure=B("div",null,"CodeMirror-measure"),h.lineMeasure=B("div",null,"CodeMirror-measure"),h.lineSpace=U("div",[h.measure,h.lineMeasure,h.selectionDiv,h.cursorDiv,h.lineDiv],null,"position: relative; outline: none");var m=U("div",[h.lineSpace],"CodeMirror-lines");h.mover=B("div",[m],null,"position: relative"),h.sizer=B("div",[h.mover],"CodeMirror-sizer"),h.sizerWidth=null,h.heightForcer=B("div",null,null,"position: absolute; height: "+nt+"px; width: 1px;"),h.gutters=B("div",null,"CodeMirror-gutters"),h.lineGutter=null,h.scroller=B("div",[h.sizer,h.heightForcer,h.gutters],"CodeMirror-scroll"),h.scroller.setAttribute("tabIndex","-1"),h.wrapper=B("div",[h.scrollbarFiller,h.gutterFiller,h.scroller],"CodeMirror"),h.wrapper.setAttribute("translate","no"),u&&c<8&&(h.gutters.style.zIndex=-1,h.scroller.style.paddingRight=0),!f&&!(e&&z)&&(h.scroller.draggable=!0),o&&(o.appendChild?o.appendChild(h.wrapper):o(h.wrapper)),h.viewFrom=h.viewTo=s.first,h.reportedViewFrom=h.reportedViewTo=s.first,h.view=[],h.renderedView=null,h.externalMeasured=null,h.viewOffset=0,h.lastWrapHeight=h.lastWrapWidth=0,h.updateLineNumbers=null,h.nativeBarWidth=h.barHeight=h.barWidth=0,h.scrollbarsClipped=!1,h.lineNumWidth=h.lineNumInnerWidth=h.lineNumChars=null,h.alignWidgets=!1,h.cachedCharWidth=h.cachedTextHeight=h.cachedPaddingH=null,h.maxLine=null,h.maxLineLength=0,h.maxLineChanged=!1,h.wheelDX=h.wheelDY=h.wheelStartX=h.wheelStartY=null,h.shift=!1,h.selForContextMenu=null,h.activeTouch=null,h.gutterSpecs=ou(d.gutters,d.lineNumbers),sf(h),p.init(h)}var gs=0,br=null;u?br=-.53:e?br=15:g?br=-.7:_&&(br=-.3333333333333333);function lf(o){var s=o.wheelDeltaX,p=o.wheelDeltaY;return s==null&&o.detail&&o.axis==o.HORIZONTAL_AXIS&&(s=o.detail),p==null&&o.detail&&o.axis==o.VERTICAL_AXIS?p=o.detail:p==null&&(p=o.wheelDelta),{x:s,y:p}}function jv(o){var s=lf(o);return s.x*=br,s.y*=br,s}function uf(o,s){var p=lf(s),d=p.x,h=p.y,m=o.display,w=m.scroller,x=w.scrollWidth>w.clientWidth,C=w.scrollHeight>w.clientHeight;if(d&&x||h&&C){if(h&&R&&f){t:for(var P=s.target,G=m.view;P!=w;P=P.parentNode)for(var J=0;J<G.length;J++)if(G[J].node==P){o.display.currentWheelTarget=P;break t}}if(d&&!e&&!y&&br!=null){h&&C&&aa(o,Math.max(0,w.scrollTop+h*br)),Gi(o,Math.max(0,w.scrollLeft+d*br)),(!h||h&&C)&&Oe(s),m.wheelStartX=null;return}if(h&&br!=null){var dt=h*br,rt=o.doc.scrollTop,Ct=rt+m.wrapper.clientHeight;dt<0?rt=Math.max(0,rt+dt-50):Ct=Math.min(o.doc.height,Ct+dt+50),nu(o,{top:rt,bottom:Ct})}gs<20&&(m.wheelStartX==null?(m.wheelStartX=w.scrollLeft,m.wheelStartY=w.scrollTop,m.wheelDX=d,m.wheelDY=h,setTimeout(function(){if(m.wheelStartX!=null){var kt=w.scrollLeft-m.wheelStartX,Ft=w.scrollTop-m.wheelStartY,Kt=Ft&&m.wheelDY&&Ft/m.wheelDY||kt&&m.wheelDX&&kt/m.wheelDX;m.wheelStartX=m.wheelStartY=null,Kt&&(br=(br*gs+Kt)/(gs+1),++gs)}},200)):(m.wheelDX+=d,m.wheelDY+=h))}}var xr=function(o,s){this.ranges=o,this.primIndex=s};xr.prototype.primary=function(){return this.ranges[this.primIndex]},xr.prototype.equals=function(o){if(o==this)return!0;if(o.primIndex!=this.primIndex||o.ranges.length!=this.ranges.length)return!1;for(var s=0;s<this.ranges.length;s++){var p=this.ranges[s],d=o.ranges[s];if(!Un(p.anchor,d.anchor)||!Un(p.head,d.head))return!1}return!0},xr.prototype.deepCopy=function(){for(var o=[],s=0;s<this.ranges.length;s++)o[s]=new Me(L(this.ranges[s].anchor),L(this.ranges[s].head));return new xr(o,this.primIndex)},xr.prototype.somethingSelected=function(){for(var o=0;o<this.ranges.length;o++)if(!this.ranges[o].empty())return!0;return!1},xr.prototype.contains=function(o,s){s||(s=o);for(var p=0;p<this.ranges.length;p++){var d=this.ranges[p];if(fe(s,d.from())>=0&&fe(o,d.to())<=0)return p}return-1};var Me=function(o,s){this.anchor=o,this.head=s};Me.prototype.from=function(){return St(this.anchor,this.head)},Me.prototype.to=function(){return X(this.anchor,this.head)},Me.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Vr(o,s,p){var d=o&&o.options.selectionsMayTouch,h=s[p];s.sort(function(dt,rt){return fe(dt.from(),rt.from())}),p=It(s,h);for(var m=1;m<s.length;m++){var w=s[m],x=s[m-1],C=fe(x.to(),w.from());if(d&&!w.empty()?C>0:C>=0){var P=St(x.from(),w.from()),G=X(x.to(),w.to()),J=x.empty()?w.from()==w.head:x.from()==x.head;m<=p&&--p,s.splice(--m,2,new Me(J?G:P,J?P:G))}}return new xr(s,p)}function Oi(o,s){return new xr([new Me(o,s||o)],0)}function Ti(o){return o.text?Mt(o.from.line+o.text.length-1,ue(o.text).length+(o.text.length==1?o.from.ch:0)):o.to}function cf(o,s){if(fe(o,s.from)<0)return o;if(fe(o,s.to)<=0)return Ti(s);var p=o.line+s.text.length-(s.to.line-s.from.line)-1,d=o.ch;return o.line==s.to.line&&(d+=Ti(s).ch-s.to.ch),Mt(p,d)}function au(o,s){for(var p=[],d=0;d<o.sel.ranges.length;d++){var h=o.sel.ranges[d];p.push(new Me(cf(h.anchor,s),cf(h.head,s)))}return Vr(o.cm,p,o.sel.primIndex)}function ff(o,s,p){return o.line==s.line?Mt(p.line,o.ch-s.ch+p.ch):Mt(p.line+(o.line-s.line),o.ch)}function Iv(o,s,p){for(var d=[],h=Mt(o.first,0),m=h,w=0;w<s.length;w++){var x=s[w],C=ff(x.from,h,m),P=ff(Ti(x),h,m);if(h=x.to,m=P,p=="around"){var G=o.sel.ranges[w],J=fe(G.head,G.anchor)<0;d[w]=new Me(J?P:C,J?C:P)}else d[w]=new Me(C,C)}return new xr(d,o.sel.primIndex)}function su(o){o.doc.mode=Ae(o.options,o.doc.modeOption),fa(o)}function fa(o){o.doc.iter(function(s){s.stateAfter&&(s.stateAfter=null),s.styles&&(s.styles=null)}),o.doc.modeFrontier=o.doc.highlightFrontier=o.doc.first,ua(o,100),o.state.modeGen++,o.curOp&&Wn(o)}function df(o,s){return s.from.ch==0&&s.to.ch==0&&ue(s.text)==""&&(!o.cm||o.cm.options.wholeLineUpdateBefore)}function lu(o,s,p,d){function h(Qt){return p?p[Qt]:null}function m(Qt,Gt,ee){Ya(Qt,Gt,ee,d),Qe(Qt,"change",Qt,s)}function w(Qt,Gt){for(var ee=[],ce=Qt;ce<Gt;++ce)ee.push(new _n(P[ce],h(ce),d));return ee}var x=s.from,C=s.to,P=s.text,G=Zt(o,x.line),J=Zt(o,C.line),dt=ue(P),rt=h(P.length-1),Ct=C.line-x.line;if(s.full)o.insert(0,w(0,P.length)),o.remove(P.length,o.size-P.length);else if(df(o,s)){var kt=w(0,P.length-1);m(J,J.text,rt),Ct&&o.remove(x.line,Ct),kt.length&&o.insert(x.line,kt)}else if(G==J)if(P.length==1)m(G,G.text.slice(0,x.ch)+dt+G.text.slice(C.ch),rt);else{var Ft=w(1,P.length-1);Ft.push(new _n(dt+G.text.slice(C.ch),rt,d)),m(G,G.text.slice(0,x.ch)+P[0],h(0)),o.insert(x.line+1,Ft)}else if(P.length==1)m(G,G.text.slice(0,x.ch)+P[0]+J.text.slice(C.ch),h(0)),o.remove(x.line+1,Ct);else{m(G,G.text.slice(0,x.ch)+P[0],h(0)),m(J,dt+J.text.slice(C.ch),rt);var Kt=w(1,P.length-1);Ct>1&&o.remove(x.line+1,Ct-1),o.insert(x.line+1,Kt)}Qe(o,"change",o,s)}function Ei(o,s,p){function d(h,m,w){if(h.linked)for(var x=0;x<h.linked.length;++x){var C=h.linked[x];if(C.doc!=m){var P=w&&C.sharedHist;p&&!P||(s(C.doc,P),d(C.doc,h,P))}}}d(o,null,!0)}function pf(o,s){if(s.cm)throw new Error("This document is already in use.");o.doc=s,s.cm=o,Yl(o),su(o),hf(o),o.options.direction=s.direction,o.options.lineWrapping||vi(o),o.options.mode=s.modeOption,Wn(o)}function hf(o){(o.doc.direction=="rtl"?yt:lt)(o.display.lineDiv,"CodeMirror-rtl")}function Rv(o){ar(o,function(){hf(o),Wn(o)})}function ys(o){this.done=[],this.undone=[],this.undoDepth=o?o.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=o?o.maxGeneration:1}function uu(o,s){var p={from:L(s.from),to:Ti(s),text:dn(o,s.from,s.to)};return yf(o,p,s.from.line,s.to.line+1),Ei(o,function(d){return yf(d,p,s.from.line,s.to.line+1)},!0),p}function vf(o){for(;o.length;){var s=ue(o);if(s.ranges)o.pop();else break}}function Nv(o,s){if(s)return vf(o.done),ue(o.done);if(o.done.length&&!ue(o.done).ranges)return ue(o.done);if(o.done.length>1&&!o.done[o.done.length-2].ranges)return o.done.pop(),ue(o.done)}function gf(o,s,p,d){var h=o.history;h.undone.length=0;var m=+new Date,w,x;if((h.lastOp==d||h.lastOrigin==s.origin&&s.origin&&(s.origin.charAt(0)=="+"&&h.lastModTime>m-(o.cm?o.cm.options.historyEventDelay:500)||s.origin.charAt(0)=="*"))&&(w=Nv(h,h.lastOp==d)))x=ue(w.changes),fe(s.from,s.to)==0&&fe(s.from,x.to)==0?x.to=Ti(s):w.changes.push(uu(o,s));else{var C=ue(h.done);for((!C||!C.ranges)&&ms(o.sel,h.done),w={changes:[uu(o,s)],generation:h.generation},h.done.push(w);h.done.length>h.undoDepth;)h.done.shift(),h.done[0].ranges||h.done.shift()}h.done.push(p),h.generation=++h.maxGeneration,h.lastModTime=h.lastSelTime=m,h.lastOp=h.lastSelOp=d,h.lastOrigin=h.lastSelOrigin=s.origin,x||qt(o,"historyAdded")}function Fv(o,s,p,d){var h=s.charAt(0);return h=="*"||h=="+"&&p.ranges.length==d.ranges.length&&p.somethingSelected()==d.somethingSelected()&&new Date-o.history.lastSelTime<=(o.cm?o.cm.options.historyEventDelay:500)}function Vv(o,s,p,d){var h=o.history,m=d&&d.origin;p==h.lastSelOp||m&&h.lastSelOrigin==m&&(h.lastModTime==h.lastSelTime&&h.lastOrigin==m||Fv(o,m,ue(h.done),s))?h.done[h.done.length-1]=s:ms(s,h.done),h.lastSelTime=+new Date,h.lastSelOrigin=m,h.lastSelOp=p,d&&d.clearRedo!==!1&&vf(h.undone)}function ms(o,s){var p=ue(s);p&&p.ranges&&p.equals(o)||s.push(o)}function yf(o,s,p,d){var h=s["spans_"+o.id],m=0;o.iter(Math.max(o.first,p),Math.min(o.first+o.size,d),function(w){w.markedSpans&&((h||(h=s["spans_"+o.id]={}))[m]=w.markedSpans),++m})}function Hv(o){if(!o)return null;for(var s,p=0;p<o.length;++p)o[p].marker.explicitlyCleared?s||(s=o.slice(0,p)):s&&s.push(o[p]);return s?s.length?s:null:o}function Uv(o,s){var p=s["spans_"+o.id];if(!p)return null;for(var d=[],h=0;h<s.text.length;++h)d.push(Hv(p[h]));return d}function mf(o,s){var p=Uv(o,s),d=mr(o,s);if(!p)return d;if(!d)return p;for(var h=0;h<p.length;++h){var m=p[h],w=d[h];if(m&&w)t:for(var x=0;x<w.length;++x){for(var C=w[x],P=0;P<m.length;++P)if(m[P].marker==C.marker)continue t;m.push(C)}else w&&(p[h]=w)}return p}function wo(o,s,p){for(var d=[],h=0;h<o.length;++h){var m=o[h];if(m.ranges){d.push(p?xr.prototype.deepCopy.call(m):m);continue}var w=m.changes,x=[];d.push({changes:x});for(var C=0;C<w.length;++C){var P=w[C],G=void 0;if(x.push({from:P.from,to:P.to,text:P.text}),s)for(var J in P)(G=J.match(/^spans_(\d+)$/))&&It(s,Number(G[1]))>-1&&(ue(x)[J]=P[J],delete P[J])}}return d}function cu(o,s,p,d){if(d){var h=o.anchor;if(p){var m=fe(s,h)<0;m!=fe(p,h)<0?(h=s,s=p):m!=fe(s,p)<0&&(s=p)}return new Me(h,s)}else return new Me(p||s,s)}function _s(o,s,p,d,h){h==null&&(h=o.cm&&(o.cm.display.shift||o.extend)),Mn(o,new xr([cu(o.sel.primary(),s,p,h)],0),d)}function _f(o,s,p){for(var d=[],h=o.cm&&(o.cm.display.shift||o.extend),m=0;m<o.sel.ranges.length;m++)d[m]=cu(o.sel.ranges[m],s[m],null,h);var w=Vr(o.cm,d,o.sel.primIndex);Mn(o,w,p)}function fu(o,s,p,d){var h=o.sel.ranges.slice(0);h[s]=p,Mn(o,Vr(o.cm,h,o.sel.primIndex),d)}function wf(o,s,p,d){Mn(o,Oi(s,p),d)}function Bv(o,s,p){var d={ranges:s.ranges,update:function(h){this.ranges=[];for(var m=0;m<h.length;m++)this.ranges[m]=new Me(Rt(o,h[m].anchor),Rt(o,h[m].head))},origin:p&&p.origin};return qt(o,"beforeSelectionChange",o,d),o.cm&&qt(o.cm,"beforeSelectionChange",o.cm,d),d.ranges!=s.ranges?Vr(o.cm,d.ranges,d.ranges.length-1):s}function bf(o,s,p){var d=o.history.done,h=ue(d);h&&h.ranges?(d[d.length-1]=s,ws(o,s,p)):Mn(o,s,p)}function Mn(o,s,p){ws(o,s,p),Vv(o,o.sel,o.cm?o.cm.curOp.id:NaN,p)}function ws(o,s,p){(Ce(o,"beforeSelectionChange")||o.cm&&Ce(o.cm,"beforeSelectionChange"))&&(s=Bv(o,s,p));var d=p&&p.bias||(fe(s.primary().head,o.sel.primary().head)<0?-1:1);xf(o,Sf(o,s,d,!0)),!(p&&p.scroll===!1)&&o.cm&&o.cm.getOption("readOnly")!="nocursor"&&mo(o.cm)}function xf(o,s){s.equals(o.sel)||(o.sel=s,o.cm&&(o.cm.curOp.updateInput=1,o.cm.curOp.selectionChanged=!0,re(o.cm)),Qe(o,"cursorActivity",o))}function Cf(o){xf(o,Sf(o,o.sel,null,!1))}function Sf(o,s,p,d){for(var h,m=0;m<s.ranges.length;m++){var w=s.ranges[m],x=s.ranges.length==o.sel.ranges.length&&o.sel.ranges[m],C=bs(o,w.anchor,x&&x.anchor,p,d),P=bs(o,w.head,x&&x.head,p,d);(h||C!=w.anchor||P!=w.head)&&(h||(h=s.ranges.slice(0,m)),h[m]=new Me(C,P))}return h?Vr(o.cm,h,s.primIndex):s}function bo(o,s,p,d,h){var m=Zt(o,s.line);if(m.markedSpans)for(var w=0;w<m.markedSpans.length;++w){var x=m.markedSpans[w],C=x.marker,P="selectLeft"in C?!C.selectLeft:C.inclusiveLeft,G="selectRight"in C?!C.selectRight:C.inclusiveRight;if((x.from==null||(P?x.from<=s.ch:x.from<s.ch))&&(x.to==null||(G?x.to>=s.ch:x.to>s.ch))){if(h&&(qt(C,"beforeCursorEnter"),C.explicitlyCleared))if(m.markedSpans){--w;continue}else break;if(!C.atomic)continue;if(p){var J=C.find(d<0?1:-1),dt=void 0;if((d<0?G:P)&&(J=Of(o,J,-d,J&&J.line==s.line?m:null)),J&&J.line==s.line&&(dt=fe(J,p))&&(d<0?dt<0:dt>0))return bo(o,J,s,d,h)}var rt=C.find(d<0?-1:1);return(d<0?P:G)&&(rt=Of(o,rt,d,rt.line==s.line?m:null)),rt?bo(o,rt,s,d,h):null}}return s}function bs(o,s,p,d,h){var m=d||1,w=bo(o,s,p,m,h)||!h&&bo(o,s,p,m,!0)||bo(o,s,p,-m,h)||!h&&bo(o,s,p,-m,!0);return w||(o.cantEdit=!0,Mt(o.first,0))}function Of(o,s,p,d){return p<0&&s.ch==0?s.line>o.first?Rt(o,Mt(s.line-1)):null:p>0&&s.ch==(d||Zt(o,s.line)).text.length?s.line<o.first+o.size-1?Mt(s.line+1,0):null:new Mt(s.line,s.ch+p)}function Tf(o){o.setSelection(Mt(o.firstLine(),0),Mt(o.lastLine()),Ot)}function Ef(o,s,p){var d={canceled:!1,from:s.from,to:s.to,text:s.text,origin:s.origin,cancel:function(){return d.canceled=!0}};return p&&(d.update=function(h,m,w,x){h&&(d.from=Rt(o,h)),m&&(d.to=Rt(o,m)),w&&(d.text=w),x!==void 0&&(d.origin=x)}),qt(o,"beforeChange",o,d),o.cm&&qt(o.cm,"beforeChange",o.cm,d),d.canceled?(o.cm&&(o.cm.curOp.updateInput=2),null):{from:d.from,to:d.to,text:d.text,origin:d.origin}}function xo(o,s,p){if(o.cm){if(!o.cm.curOp)return wn(o.cm,xo)(o,s,p);if(o.cm.state.suppressEdits)return}if(!((Ce(o,"beforeChange")||o.cm&&Ce(o.cm,"beforeChange"))&&(s=Ef(o,s,!0),!s))){var d=an&&!p&&hi(o,s.from,s.to);if(d)for(var h=d.length-1;h>=0;--h)Pf(o,{from:d[h].from,to:d[h].to,text:h?[""]:s.text,origin:s.origin});else Pf(o,s)}}function Pf(o,s){if(!(s.text.length==1&&s.text[0]==""&&fe(s.from,s.to)==0)){var p=au(o,s);gf(o,s,p,o.cm?o.cm.curOp.id:NaN),da(o,s,p,mr(o,s));var d=[];Ei(o,function(h,m){!m&&It(d,h.history)==-1&&(Lf(h.history,s),d.push(h.history)),da(h,s,null,mr(h,s))})}}function xs(o,s,p){var d=o.cm&&o.cm.state.suppressEdits;if(!(d&&!p)){for(var h=o.history,m,w=o.sel,x=s=="undo"?h.done:h.undone,C=s=="undo"?h.undone:h.done,P=0;P<x.length&&(m=x[P],!(p?m.ranges&&!m.equals(o.sel):!m.ranges));P++);if(P!=x.length){for(h.lastOrigin=h.lastSelOrigin=null;;)if(m=x.pop(),m.ranges){if(ms(m,C),p&&!m.equals(o.sel)){Mn(o,m,{clearRedo:!1});return}w=m}else if(d){x.push(m);return}else break;var G=[];ms(w,C),C.push({changes:G,generation:h.generation}),h.generation=m.generation||++h.maxGeneration;for(var J=Ce(o,"beforeChange")||o.cm&&Ce(o.cm,"beforeChange"),dt=function(kt){var Ft=m.changes[kt];if(Ft.origin=s,J&&!Ef(o,Ft,!1))return x.length=0,{};G.push(uu(o,Ft));var Kt=kt?au(o,Ft):ue(x);da(o,Ft,Kt,mf(o,Ft)),!kt&&o.cm&&o.cm.scrollIntoView({from:Ft.from,to:Ti(Ft)});var Qt=[];Ei(o,function(Gt,ee){!ee&&It(Qt,Gt.history)==-1&&(Lf(Gt.history,Ft),Qt.push(Gt.history)),da(Gt,Ft,null,mf(Gt,Ft))})},rt=m.changes.length-1;rt>=0;--rt){var Ct=dt(rt);if(Ct)return Ct.v}}}}function Af(o,s){if(s!=0&&(o.first+=s,o.sel=new xr(Be(o.sel.ranges,function(h){return new Me(Mt(h.anchor.line+s,h.anchor.ch),Mt(h.head.line+s,h.head.ch))}),o.sel.primIndex),o.cm)){Wn(o.cm,o.first,o.first-s,s);for(var p=o.cm.display,d=p.viewFrom;d<p.viewTo;d++)Ci(o.cm,d,"gutter")}}function da(o,s,p,d){if(o.cm&&!o.cm.curOp)return wn(o.cm,da)(o,s,p,d);if(s.to.line<o.first){Af(o,s.text.length-1-(s.to.line-s.from.line));return}if(!(s.from.line>o.lastLine())){if(s.from.line<o.first){var h=s.text.length-1-(o.first-s.from.line);Af(o,h),s={from:Mt(o.first,0),to:Mt(s.to.line+h,s.to.ch),text:[ue(s.text)],origin:s.origin}}var m=o.lastLine();s.to.line>m&&(s={from:s.from,to:Mt(m,Zt(o,m).text.length),text:[s.text[0]],origin:s.origin}),s.removed=dn(o,s.from,s.to),p||(p=au(o,s)),o.cm?Wv(o.cm,s,d):lu(o,s,d),ws(o,p,Ot),o.cantEdit&&bs(o,Mt(o.firstLine(),0))&&(o.cantEdit=!1)}}function Wv(o,s,p){var d=o.doc,h=o.display,m=s.from,w=s.to,x=!1,C=m.line;o.options.lineWrapping||(C=_e(we(Zt(d,m.line))),d.iter(C,w.line+1,function(rt){if(rt==h.maxLine)return x=!0,!0})),d.sel.contains(s.from,s.to)>-1&&re(o),lu(d,s,p,Gc(o)),o.options.lineWrapping||(d.iter(C,m.line+s.text.length,function(rt){var Ct=Nr(rt);Ct>h.maxLineLength&&(h.maxLine=rt,h.maxLineLength=Ct,h.maxLineChanged=!0,x=!1)}),x&&(o.curOp.updateMaxLine=!0)),Xr(d,m.line),ua(o,400);var P=s.text.length-(w.line-m.line)-1;s.full?Wn(o):m.line==w.line&&s.text.length==1&&!df(o.doc,s)?Ci(o,m.line,"text"):Wn(o,m.line,w.line+1,P);var G=Ce(o,"changes"),J=Ce(o,"change");if(J||G){var dt={from:m,to:w,text:s.text,removed:s.removed,origin:s.origin};J&&Qe(o,"change",o,dt),G&&(o.curOp.changeObjs||(o.curOp.changeObjs=[])).push(dt)}o.display.selForContextMenu=null}function Co(o,s,p,d,h){var m;d||(d=p),fe(d,p)<0&&(m=[d,p],p=m[0],d=m[1]),typeof s=="string"&&(s=o.splitLines(s)),xo(o,{from:p,to:d,text:s,origin:h})}function kf(o,s,p,d){p<o.line?o.line+=d:s<o.line&&(o.line=s,o.ch=0)}function Mf(o,s,p,d){for(var h=0;h<o.length;++h){var m=o[h],w=!0;if(m.ranges){m.copied||(m=o[h]=m.deepCopy(),m.copied=!0);for(var x=0;x<m.ranges.length;x++)kf(m.ranges[x].anchor,s,p,d),kf(m.ranges[x].head,s,p,d);continue}for(var C=0;C<m.changes.length;++C){var P=m.changes[C];if(p<P.from.line)P.from=Mt(P.from.line+d,P.from.ch),P.to=Mt(P.to.line+d,P.to.ch);else if(s<=P.to.line){w=!1;break}}w||(o.splice(0,h+1),h=0)}}function Lf(o,s){var p=s.from.line,d=s.to.line,h=s.text.length-(d-p)-1;Mf(o.done,p,d,h),Mf(o.undone,p,d,h)}function pa(o,s,p,d){var h=s,m=s;return typeof s=="number"?m=Zt(o,Dt(o,s)):h=_e(s),h==null?null:(d(m,h)&&o.cm&&Ci(o.cm,h,p),m)}function ha(o){this.lines=o,this.parent=null;for(var s=0,p=0;p<o.length;++p)o[p].parent=this,s+=o[p].height;this.height=s}ha.prototype={chunkSize:function(){return this.lines.length},removeInner:function(o,s){for(var p=o,d=o+s;p<d;++p){var h=this.lines[p];this.height-=h.height,uo(h),Qe(h,"delete")}this.lines.splice(o,s)},collapse:function(o){o.push.apply(o,this.lines)},insertInner:function(o,s,p){this.height+=p,this.lines=this.lines.slice(0,o).concat(s).concat(this.lines.slice(o));for(var d=0;d<s.length;++d)s[d].parent=this},iterN:function(o,s,p){for(var d=o+s;o<d;++o)if(p(this.lines[o]))return!0}};function va(o){this.children=o;for(var s=0,p=0,d=0;d<o.length;++d){var h=o[d];s+=h.chunkSize(),p+=h.height,h.parent=this}this.size=s,this.height=p,this.parent=null}va.prototype={chunkSize:function(){return this.size},removeInner:function(o,s){this.size-=s;for(var p=0;p<this.children.length;++p){var d=this.children[p],h=d.chunkSize();if(o<h){var m=Math.min(s,h-o),w=d.height;if(d.removeInner(o,m),this.height-=w-d.height,h==m&&(this.children.splice(p--,1),d.parent=null),(s-=m)==0)break;o=0}else o-=h}if(this.size-s<25&&(this.children.length>1||!(this.children[0]instanceof ha))){var x=[];this.collapse(x),this.children=[new ha(x)],this.children[0].parent=this}},collapse:function(o){for(var s=0;s<this.children.length;++s)this.children[s].collapse(o)},insertInner:function(o,s,p){this.size+=s.length,this.height+=p;for(var d=0;d<this.children.length;++d){var h=this.children[d],m=h.chunkSize();if(o<=m){if(h.insertInner(o,s,p),h.lines&&h.lines.length>50){for(var w=h.lines.length%25+25,x=w;x<h.lines.length;){var C=new ha(h.lines.slice(x,x+=25));h.height-=C.height,this.children.splice(++d,0,C),C.parent=this}h.lines=h.lines.slice(0,w),this.maybeSpill()}break}o-=m}},maybeSpill:function(){if(!(this.children.length<=10)){var o=this;do{var s=o.children.splice(o.children.length-5,5),p=new va(s);if(o.parent){o.size-=p.size,o.height-=p.height;var h=It(o.parent.children,o);o.parent.children.splice(h+1,0,p)}else{var d=new va(o.children);d.parent=o,o.children=[d,p],o=d}p.parent=o.parent}while(o.children.length>10);o.parent.maybeSpill()}},iterN:function(o,s,p){for(var d=0;d<this.children.length;++d){var h=this.children[d],m=h.chunkSize();if(o<m){var w=Math.min(s,m-o);if(h.iterN(o,w,p))return!0;if((s-=w)==0)break;o=0}else o-=m}}};var ga=function(o,s,p){if(p)for(var d in p)p.hasOwnProperty(d)&&(this[d]=p[d]);this.doc=o,this.node=s};ga.prototype.clear=function(){var o=this.doc.cm,s=this.line.widgets,p=this.line,d=_e(p);if(!(d==null||!s)){for(var h=0;h<s.length;++h)s[h]==this&&s.splice(h--,1);s.length||(p.widgets=null);var m=bi(this);on(p,Math.max(0,p.height-m)),o&&(ar(o,function(){Df(o,p,-m),Ci(o,d,"widget")}),Qe(o,"lineWidgetCleared",o,this,d))}},ga.prototype.changed=function(){var o=this,s=this.height,p=this.doc.cm,d=this.line;this.height=null;var h=bi(this)-s;h&&(mn(this.doc,d)||on(d,d.height+h),p&&ar(p,function(){p.curOp.forceUpdate=!0,Df(p,d,h),Qe(p,"lineWidgetChanged",p,o,_e(d))}))},Pe(ga);function Df(o,s,p){ir(s)<(o.curOp&&o.curOp.scrollTop||o.doc.scrollTop)&&tu(o,p)}function zv(o,s,p,d){var h=new ga(o,p,d),m=o.cm;return m&&h.noHScroll&&(m.display.alignWidgets=!0),pa(o,s,"widget",function(w){var x=w.widgets||(w.widgets=[]);if(h.insertAt==null?x.push(h):x.splice(Math.min(x.length,Math.max(0,h.insertAt)),0,h),h.line=w,m&&!mn(o,w)){var C=ir(w)<o.scrollTop;on(w,w.height+bi(h)),C&&tu(m,h.height),m.curOp.forceUpdate=!0}return!0}),m&&Qe(m,"lineWidgetAdded",m,h,typeof s=="number"?s:_e(s)),h}var jf=0,Pi=function(o,s){this.lines=[],this.type=s,this.doc=o,this.id=++jf};Pi.prototype.clear=function(){if(!this.explicitlyCleared){var o=this.doc.cm,s=o&&!o.curOp;if(s&&qi(o),Ce(this,"clear")){var p=this.find();p&&Qe(this,"clear",p.from,p.to)}for(var d=null,h=null,m=0;m<this.lines.length;++m){var w=this.lines[m],x=An(w.markedSpans,this);o&&!this.collapsed?Ci(o,_e(w),"text"):o&&(x.to!=null&&(h=_e(w)),x.from!=null&&(d=_e(w))),w.markedSpans=Hi(w.markedSpans,x),x.from==null&&this.collapsed&&!mn(this.doc,w)&&o&&on(w,vo(o.display))}if(o&&this.collapsed&&!o.options.lineWrapping)for(var C=0;C<this.lines.length;++C){var P=we(this.lines[C]),G=Nr(P);G>o.display.maxLineLength&&(o.display.maxLine=P,o.display.maxLineLength=G,o.display.maxLineChanged=!0)}d!=null&&o&&this.collapsed&&Wn(o,d,h+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,o&&Cf(o.doc)),o&&Qe(o,"markerCleared",o,this,d,h),s&&Yi(o),this.parent&&this.parent.clear()}},Pi.prototype.find=function(o,s){o==null&&this.type=="bookmark"&&(o=1);for(var p,d,h=0;h<this.lines.length;++h){var m=this.lines[h],w=An(m.markedSpans,this);if(w.from!=null&&(p=Mt(s?m:_e(m),w.from),o==-1))return p;if(w.to!=null&&(d=Mt(s?m:_e(m),w.to),o==1))return d}return p&&{from:p,to:d}},Pi.prototype.changed=function(){var o=this,s=this.find(-1,!0),p=this,d=this.doc.cm;!s||!d||ar(d,function(){var h=s.line,m=_e(s.line),w=st(d,m);if(w&&(na(w),d.curOp.selectionChanged=d.curOp.forceUpdate=!0),d.curOp.updateMaxLine=!0,!mn(p.doc,h)&&p.height!=null){var x=p.height;p.height=null;var C=bi(p)-x;C&&on(h,h.height+C)}Qe(d,"markerChanged",d,o)})},Pi.prototype.attachLine=function(o){if(!this.lines.length&&this.doc.cm){var s=this.doc.cm.curOp;(!s.maybeHiddenMarkers||It(s.maybeHiddenMarkers,this)==-1)&&(s.maybeUnhiddenMarkers||(s.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(o)},Pi.prototype.detachLine=function(o){if(this.lines.splice(It(this.lines,o),1),!this.lines.length&&this.doc.cm){var s=this.doc.cm.curOp;(s.maybeHiddenMarkers||(s.maybeHiddenMarkers=[])).push(this)}},Pe(Pi);function So(o,s,p,d,h){if(d&&d.shared)return Kv(o,s,p,d,h);if(o.cm&&!o.cm.curOp)return wn(o.cm,So)(o,s,p,d,h);var m=new Pi(o,h),w=fe(s,p);if(d&&he(d,m,!1),w>0||w==0&&m.clearWhenEmpty!==!1)return m;if(m.replacedWith&&(m.collapsed=!0,m.widgetNode=U("span",[m.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||m.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(m.widgetNode.insertLeft=!0)),m.collapsed){if(oe(o,s.line,s,p,m)||s.line!=p.line&&oe(o,p.line,s,p,m))throw new Error("Inserting collapsed marker partially overlapping an existing one");Vi()}m.addToHistory&&gf(o,{from:s,to:p,origin:"markText"},o.sel,NaN);var x=s.line,C=o.cm,P;if(o.iter(x,p.line+1,function(J){C&&m.collapsed&&!C.options.lineWrapping&&we(J)==C.display.maxLine&&(P=!0),m.collapsed&&x!=s.line&&on(J,0),Er(J,new Ir(m,x==s.line?s.ch:null,x==p.line?p.ch:null),o.cm&&o.cm.curOp),++x}),m.collapsed&&o.iter(s.line,p.line+1,function(J){mn(o,J)&&on(J,0)}),m.clearOnEnter&&ht(m,"beforeCursorEnter",function(){return m.clear()}),m.readOnly&&(di(),(o.history.done.length||o.history.undone.length)&&o.clearHistory()),m.collapsed&&(m.id=++jf,m.atomic=!0),C){if(P&&(C.curOp.updateMaxLine=!0),m.collapsed)Wn(C,s.line,p.line+1);else if(m.className||m.startStyle||m.endStyle||m.css||m.attributes||m.title)for(var G=s.line;G<=p.line;G++)Ci(C,G,"text");m.atomic&&Cf(C.doc),Qe(C,"markerAdded",C,m)}return m}var ya=function(o,s){this.markers=o,this.primary=s;for(var p=0;p<o.length;++p)o[p].parent=this};ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var o=0;o<this.markers.length;++o)this.markers[o].clear();Qe(this,"clear")}},ya.prototype.find=function(o,s){return this.primary.find(o,s)},Pe(ya);function Kv(o,s,p,d,h){d=he(d),d.shared=!1;var m=[So(o,s,p,d,h)],w=m[0],x=d.widgetNode;return Ei(o,function(C){x&&(d.widgetNode=x.cloneNode(!0)),m.push(So(C,Rt(C,s),Rt(C,p),d,h));for(var P=0;P<C.linked.length;++P)if(C.linked[P].isParent)return;w=ue(m)}),new ya(m,w)}function If(o){return o.findMarks(Mt(o.first,0),o.clipPos(Mt(o.lastLine())),function(s){return s.parent})}function Gv(o,s){for(var p=0;p<s.length;p++){var d=s[p],h=d.find(),m=o.clipPos(h.from),w=o.clipPos(h.to);if(fe(m,w)){var x=So(o,m,w,d.primary,d.primary.type);d.markers.push(x),x.parent=d}}}function $v(o){for(var s=function(d){var h=o[d],m=[h.primary.doc];Ei(h.primary.doc,function(C){return m.push(C)});for(var w=0;w<h.markers.length;w++){var x=h.markers[w];It(m,x.doc)==-1&&(x.parent=null,h.markers.splice(w--,1))}},p=0;p<o.length;p++)s(p)}var qv=0,zn=function(o,s,p,d,h){if(!(this instanceof zn))return new zn(o,s,p,d,h);p==null&&(p=0),va.call(this,[new ha([new _n("",null)])]),this.first=p,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=p;var m=Mt(p,0);this.sel=Oi(m),this.history=new ys(null),this.id=++qv,this.modeOption=s,this.lineSep=d,this.direction=h=="rtl"?"rtl":"ltr",this.extend=!1,typeof o=="string"&&(o=this.splitLines(o)),lu(this,{from:m,to:m,text:o}),Mn(this,Oi(m),Ot)};zn.prototype=T(va.prototype,{constructor:zn,iter:function(o,s,p){p?this.iterN(o-this.first,s-o,p):this.iterN(this.first,this.first+this.size,o)},insert:function(o,s){for(var p=0,d=0;d<s.length;++d)p+=s[d].height;this.insertInner(o-this.first,s,p)},remove:function(o,s){this.removeInner(o-this.first,s)},getValue:function(o){var s=Pn(this,this.first,this.first+this.size);return o===!1?s:s.join(o||this.lineSeparator())},setValue:bn(function(o){var s=Mt(this.first,0),p=this.first+this.size-1;xo(this,{from:s,to:Mt(p,Zt(this,p).text.length),text:this.splitLines(o),origin:"setValue",full:!0},!0),this.cm&&oa(this.cm,0,0),Mn(this,Oi(s),Ot)}),replaceRange:function(o,s,p,d){s=Rt(this,s),p=p?Rt(this,p):s,Co(this,o,s,p,d)},getRange:function(o,s,p){var d=dn(this,Rt(this,o),Rt(this,s));return p===!1?d:p===""?d.join(""):d.join(p||this.lineSeparator())},getLine:function(o){var s=this.getLineHandle(o);return s&&s.text},getLineHandle:function(o){if(vr(this,o))return Zt(this,o)},getLineNumber:function(o){return _e(o)},getLineHandleVisualStart:function(o){return typeof o=="number"&&(o=Zt(this,o)),we(o)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(o){return Rt(this,o)},getCursor:function(o){var s=this.sel.primary(),p;return o==null||o=="head"?p=s.head:o=="anchor"?p=s.anchor:o=="end"||o=="to"||o===!1?p=s.to():p=s.from(),p},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:bn(function(o,s,p){wf(this,Rt(this,typeof o=="number"?Mt(o,s||0):o),null,p)}),setSelection:bn(function(o,s,p){wf(this,Rt(this,o),Rt(this,s||o),p)}),extendSelection:bn(function(o,s,p){_s(this,Rt(this,o),s&&Rt(this,s),p)}),extendSelections:bn(function(o,s){_f(this,Te(this,o),s)}),extendSelectionsBy:bn(function(o,s){var p=Be(this.sel.ranges,o);_f(this,Te(this,p),s)}),setSelections:bn(function(o,s,p){if(o.length){for(var d=[],h=0;h<o.length;h++)d[h]=new Me(Rt(this,o[h].anchor),Rt(this,o[h].head||o[h].anchor));s==null&&(s=Math.min(o.length-1,this.sel.primIndex)),Mn(this,Vr(this.cm,d,s),p)}}),addSelection:bn(function(o,s,p){var d=this.sel.ranges.slice(0);d.push(new Me(Rt(this,o),Rt(this,s||o))),Mn(this,Vr(this.cm,d,d.length-1),p)}),getSelection:function(o){for(var s=this.sel.ranges,p,d=0;d<s.length;d++){var h=dn(this,s[d].from(),s[d].to());p=p?p.concat(h):h}return o===!1?p:p.join(o||this.lineSeparator())},getSelections:function(o){for(var s=[],p=this.sel.ranges,d=0;d<p.length;d++){var h=dn(this,p[d].from(),p[d].to());o!==!1&&(h=h.join(o||this.lineSeparator())),s[d]=h}return s},replaceSelection:function(o,s,p){for(var d=[],h=0;h<this.sel.ranges.length;h++)d[h]=o;this.replaceSelections(d,s,p||"+input")},replaceSelections:bn(function(o,s,p){for(var d=[],h=this.sel,m=0;m<h.ranges.length;m++){var w=h.ranges[m];d[m]={from:w.from(),to:w.to(),text:this.splitLines(o[m]),origin:p}}for(var x=s&&s!="end"&&Iv(this,d,s),C=d.length-1;C>=0;C--)xo(this,d[C]);x?bf(this,x):this.cm&&mo(this.cm)}),undo:bn(function(){xs(this,"undo")}),redo:bn(function(){xs(this,"redo")}),undoSelection:bn(function(){xs(this,"undo",!0)}),redoSelection:bn(function(){xs(this,"redo",!0)}),setExtending:function(o){this.extend=o},getExtending:function(){return this.extend},historySize:function(){for(var o=this.history,s=0,p=0,d=0;d<o.done.length;d++)o.done[d].ranges||++s;for(var h=0;h<o.undone.length;h++)o.undone[h].ranges||++p;return{undo:s,redo:p}},clearHistory:function(){var o=this;this.history=new ys(this.history),Ei(this,function(s){return s.history=o.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(o){return o&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(o){return this.history.generation==(o||this.cleanGeneration)},getHistory:function(){return{done:wo(this.history.done),undone:wo(this.history.undone)}},setHistory:function(o){var s=this.history=new ys(this.history);s.done=wo(o.done.slice(0),null,!0),s.undone=wo(o.undone.slice(0),null,!0)},setGutterMarker:bn(function(o,s,p){return pa(this,o,"gutter",function(d){var h=d.gutterMarkers||(d.gutterMarkers={});return h[s]=p,!p&&vt(h)&&(d.gutterMarkers=null),!0})}),clearGutter:bn(function(o){var s=this;this.iter(function(p){p.gutterMarkers&&p.gutterMarkers[o]&&pa(s,p,"gutter",function(){return p.gutterMarkers[o]=null,vt(p.gutterMarkers)&&(p.gutterMarkers=null),!0})})}),lineInfo:function(o){var s;if(typeof o=="number"){if(!vr(this,o)||(s=o,o=Zt(this,o),!o))return null}else if(s=_e(o),s==null)return null;return{line:s,handle:o,text:o.text,gutterMarkers:o.gutterMarkers,textClass:o.textClass,bgClass:o.bgClass,wrapClass:o.wrapClass,widgets:o.widgets}},addLineClass:bn(function(o,s,p){return pa(this,o,s=="gutter"?"gutter":"class",function(d){var h=s=="text"?"textClass":s=="background"?"bgClass":s=="gutter"?"gutterClass":"wrapClass";if(!d[h])d[h]=p;else{if(q(p).test(d[h]))return!1;d[h]+=" "+p}return!0})}),removeLineClass:bn(function(o,s,p){return pa(this,o,s=="gutter"?"gutter":"class",function(d){var h=s=="text"?"textClass":s=="background"?"bgClass":s=="gutter"?"gutterClass":"wrapClass",m=d[h];if(m)if(p==null)d[h]=null;else{var w=m.match(q(p));if(!w)return!1;var x=w.index+w[0].length;d[h]=m.slice(0,w.index)+(!w.index||x==m.length?"":" ")+m.slice(x)||null}else return!1;return!0})}),addLineWidget:bn(function(o,s,p){return zv(this,o,s,p)}),removeLineWidget:function(o){o.clear()},markText:function(o,s,p){return So(this,Rt(this,o),Rt(this,s),p,p&&p.type||"range")},setBookmark:function(o,s){var p={replacedWith:s&&(s.nodeType==null?s.widget:s),insertLeft:s&&s.insertLeft,clearWhenEmpty:!1,shared:s&&s.shared,handleMouseEvents:s&&s.handleMouseEvents};return o=Rt(this,o),So(this,o,o,p,"bookmark")},findMarksAt:function(o){o=Rt(this,o);var s=[],p=Zt(this,o.line).markedSpans;if(p)for(var d=0;d<p.length;++d){var h=p[d];(h.from==null||h.from<=o.ch)&&(h.to==null||h.to>=o.ch)&&s.push(h.marker.parent||h.marker)}return s},findMarks:function(o,s,p){o=Rt(this,o),s=Rt(this,s);var d=[],h=o.line;return this.iter(o.line,s.line+1,function(m){var w=m.markedSpans;if(w)for(var x=0;x<w.length;x++){var C=w[x];!(C.to!=null&&h==o.line&&o.ch>=C.to||C.from==null&&h!=o.line||C.from!=null&&h==s.line&&C.from>=s.ch)&&(!p||p(C.marker))&&d.push(C.marker.parent||C.marker)}++h}),d},getAllMarks:function(){var o=[];return this.iter(function(s){var p=s.markedSpans;if(p)for(var d=0;d<p.length;++d)p[d].from!=null&&o.push(p[d].marker)}),o},posFromIndex:function(o){var s,p=this.first,d=this.lineSeparator().length;return this.iter(function(h){var m=h.text.length+d;if(m>o)return s=o,!0;o-=m,++p}),Rt(this,Mt(p,s))},indexFromPos:function(o){o=Rt(this,o);var s=o.ch;if(o.line<this.first||o.ch<0)return 0;var p=this.lineSeparator().length;return this.iter(this.first,o.line,function(d){s+=d.text.length+p}),s},copy:function(o){var s=new zn(Pn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return s.scrollTop=this.scrollTop,s.scrollLeft=this.scrollLeft,s.sel=this.sel,s.extend=!1,o&&(s.history.undoDepth=this.history.undoDepth,s.setHistory(this.getHistory())),s},linkedDoc:function(o){o||(o={});var s=this.first,p=this.first+this.size;o.from!=null&&o.from>s&&(s=o.from),o.to!=null&&o.to<p&&(p=o.to);var d=new zn(Pn(this,s,p),o.mode||this.modeOption,s,this.lineSep,this.direction);return o.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:o.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:o.sharedHist}],Gv(d,If(this)),d},unlinkDoc:function(o){if(o instanceof Ge&&(o=o.doc),this.linked)for(var s=0;s<this.linked.length;++s){var p=this.linked[s];if(p.doc==o){this.linked.splice(s,1),o.unlinkDoc(this),$v(If(this));break}}if(o.history==this.history){var d=[o.id];Ei(o,function(h){return d.push(h.id)},!0),o.history=new ys(null),o.history.done=wo(this.history.done,d),o.history.undone=wo(this.history.undone,d)}},iterLinkedDocs:function(o){Ei(this,o)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(o){return this.lineSep?o.split(this.lineSep):Fe(o)},lineSeparator:function(){return this.lineSep||` 13`},setDirection:bn(function(o){o!="rtl"&&(o="ltr"),o!=this.direction&&(this.direction=o,this.iter(function(s){return s.order=null}),this.cm&&Rv(this.cm))})}),zn.prototype.eachLine=zn.prototype.iter;var Rf=0;function Yv(o){var s=this;if(Nf(s),!(Bt(s,o)||Ar(s.display,o))){Oe(o),u&&(Rf=+new Date);var p=zi(s,o,!0),d=o.dataTransfer.files;if(!(!p||s.isReadOnly()))if(d&&d.length&&window.FileReader&&window.File)for(var h=d.length,m=Array(h),w=0,x=function(){++w==h&&wn(s,function(){p=Rt(s.doc,p);var rt={from:p,to:p,text:s.doc.splitLines(m.filter(function(Ct){return Ct!=null}).join(s.doc.lineSeparator())),origin:"paste"};xo(s.doc,rt),bf(s.doc,Oi(Rt(s.doc,p),Rt(s.doc,Ti(rt))))})()},C=function(rt,Ct){if(s.options.allowDropFileTypes&&It(s.options.allowDropFileTypes,rt.type)==-1){x();return}var kt=new FileReader;kt.onerror=function(){return x()},kt.onload=function(){var Ft=kt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ft)){x();return}m[Ct]=Ft,x()},kt.readAsText(rt)},P=0;P<d.length;P++)C(d[P],P);else{if(s.state.draggingText&&s.doc.sel.contains(p)>-1){s.state.draggingText(o),setTimeout(function(){return s.display.input.focus()},20);return}try{var G=o.dataTransfer.getData("Text");if(G){var J;if(s.state.draggingText&&!s.state.draggingText.copy&&(J=s.listSelections()),ws(s.doc,Oi(p,p)),J)for(var dt=0;dt<J.length;++dt)Co(s.doc,"",J[dt].anchor,J[dt].head,"drag");s.replaceSelection(G,"around","paste"),s.display.input.focus()}}catch(rt){}}}}function Xv(o,s){if(u&&(!o.state.draggingText||+new Date-Rf<100)){j(s);return}if(!(Bt(o,s)||Ar(o.display,s))&&(s.dataTransfer.setData("Text",o.getSelection()),s.dataTransfer.effectAllowed="copyMove",s.dataTransfer.setDragImage&&!_)){var p=B("img",null,null,"position: fixed; left: 0; top: 0;");p.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",y&&(p.width=p.height=1,o.display.wrapper.appendChild(p),p._top=p.offsetTop),s.dataTransfer.setDragImage(p,0,0),y&&p.parentNode.removeChild(p)}}function Jv(o,s){var p=zi(o,s);if(p){var d=document.createDocumentFragment();Yc(o,p,d),o.display.dragCursor||(o.display.dragCursor=B("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),o.display.lineSpace.insertBefore(o.display.dragCursor,o.display.cursorDiv)),I(o.display.dragCursor,d)}}function Nf(o){o.display.dragCursor&&(o.display.lineSpace.removeChild(o.display.dragCursor),o.display.dragCursor=null)}function Ff(o){if(document.getElementsByClassName){for(var s=document.getElementsByClassName("CodeMirror"),p=[],d=0;d<s.length;d++){var h=s[d].CodeMirror;h&&p.push(h)}p.length&&p[0].operation(function(){for(var m=0;m<p.length;m++)o(p[m])})}}var Vf=!1;function Zv(){Vf||(Qv(),Vf=!0)}function Qv(){var o;ht(window,"resize",function(){o==null&&(o=setTimeout(function(){o=null,Ff(tg)},100))}),ht(window,"blur",function(){return Ff(yo)})}function tg(o){var s=o.display;s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.scrollbarsClipped=!1,o.setSize()}for(var Ai={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ma=0;ma<10;ma++)Ai[ma+48]=Ai[ma+96]=String(ma);for(var Cs=65;Cs<=90;Cs++)Ai[Cs]=String.fromCharCode(Cs);for(var _a=1;_a<=12;_a++)Ai[_a+111]=Ai[_a+63235]="F"+_a;var ni={};ni.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"},ni.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"},ni.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"},ni.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"]},ni.default=R?ni.macDefault:ni.pcDefault;function eg(o){var s=o.split(/-(?!$)/);o=s[s.length-1];for(var p,d,h,m,w=0;w<s.length-1;w++){var x=s[w];if(/^(cmd|meta|m)$/i.test(x))m=!0;else if(/^a(lt)?$/i.test(x))p=!0;else if(/^(c|ctrl|control)$/i.test(x))d=!0;else if(/^s(hift)?$/i.test(x))h=!0;else throw new Error("Unrecognized modifier name: "+x)}return p&&(o="Alt-"+o),d&&(o="Ctrl-"+o),m&&(o="Cmd-"+o),h&&(o="Shift-"+o),o}function ng(o){var s={};for(var p in o)if(o.hasOwnProperty(p)){var d=o[p];if(/^(name|fallthrough|(de|at)tach)$/.test(p))continue;if(d=="..."){delete o[p];continue}for(var h=Be(p.split(" "),eg),m=0;m<h.length;m++){var w=void 0,x=void 0;m==h.length-1?(x=h.join(" "),w=d):(x=h.slice(0,m+1).join(" "),w="...");var C=s[x];if(!C)s[x]=w;else if(C!=w)throw new Error("Inconsistent bindings for "+x)}delete o[p]}for(var P in s)o[P]=s[P];return o}function Oo(o,s,p,d){s=Ss(s);var h=s.call?s.call(o,d):s[o];if(h===!1)return"nothing";if(h==="...")return"multi";if(h!=null&&p(h))return"handled";if(s.fallthrough){if(Object.prototype.toString.call(s.fallthrough)!="[object Array]")return Oo(o,s.fallthrough,p,d);for(var m=0;m<s.fallthrough.length;m++){var w=Oo(o,s.fallthrough[m],p,d);if(w)return w}}}function Hf(o){var s=typeof o=="string"?o:Ai[o.keyCode];return s=="Ctrl"||s=="Alt"||s=="Shift"||s=="Mod"}function Uf(o,s,p){var d=o;return s.altKey&&d!="Alt"&&(o="Alt-"+o),(xt?s.metaKey:s.ctrlKey)&&d!="Ctrl"&&(o="Ctrl-"+o),(xt?s.ctrlKey:s.metaKey)&&d!="Mod"&&(o="Cmd-"+o),!p&&s.shiftKey&&d!="Shift"&&(o="Shift-"+o),o}function Bf(o,s){if(y&&o.keyCode==34&&o.char)return!1;var p=Ai[o.keyCode];return p==null||o.altGraphKey?!1:(o.keyCode==3&&o.code&&(p=o.code),Uf(p,o,s))}function Ss(o){return typeof o=="string"?ni[o]:o}function To(o,s){for(var p=o.doc.sel.ranges,d=[],h=0;h<p.length;h++){for(var m=s(p[h]);d.length&&fe(m.from,ue(d).to)<=0;){var w=d.pop();if(fe(w.from,m.from)<0){m.from=w.from;break}}d.push(m)}ar(o,function(){for(var x=d.length-1;x>=0;x--)Co(o.doc,"",d[x].from,d[x].to,"+delete");mo(o)})}function du(o,s,p){var d=it(o.text,s+p,p);return d<0||d>o.text.length?null:d}function pu(o,s,p){var d=du(o,s.ch,p);return d==null?null:new Mt(s.line,d,p<0?"after":"before")}function hu(o,s,p,d,h){if(o){s.doc.direction=="rtl"&&(h=-h);var m=M(p,s.doc.direction);if(m){var w=h<0?ue(m):m[0],x=h<0==(w.level==1),C=x?"after":"before",P;if(w.level>0||s.doc.direction=="rtl"){var G=Et(s,p);P=h<0?p.text.length-1:0;var J=Ut(s,G,P).top;P=ne(function(dt){return Ut(s,G,dt).top==J},h<0==(w.level==1)?w.from:w.to-1,P),C=="before"&&(P=du(p,P,1))}else P=h<0?w.to:w.from;return new Mt(d,P,C)}}return new Mt(d,h<0?p.text.length:0,h<0?"before":"after")}function rg(o,s,p,d){var h=M(s,o.doc.direction);if(!h)return pu(s,p,d);p.ch>=s.text.length?(p.ch=s.text.length,p.sticky="before"):p.ch<=0&&(p.ch=0,p.sticky="after");var m=V(h,p.ch,p.sticky),w=h[m];if(o.doc.direction=="ltr"&&w.level%2==0&&(d>0?w.to>p.ch:w.from<p.ch))return pu(s,p,d);var x=function(Kt,Qt){return du(s,Kt instanceof Mt?Kt.ch:Kt,Qt)},C,P=function(Kt){return o.options.lineWrapping?(C=C||Et(o,s),Kc(o,s,C,Kt)):{begin:0,end:s.text.length}},G=P(p.sticky=="before"?x(p,-1):p.ch);if(o.doc.direction=="rtl"||w.level==1){var J=w.level==1==d<0,dt=x(p,J?1:-1);if(dt!=null&&(J?dt<=w.to&&dt<=G.end:dt>=w.from&&dt>=G.begin)){var rt=J?"before":"after";return new Mt(p.line,dt,rt)}}var Ct=function(Kt,Qt,Gt){for(var ee=function(He,xn){return xn?new Mt(p.line,x(He,1),"before"):new Mt(p.line,He,"after")};Kt>=0&&Kt<h.length;Kt+=Qt){var ce=h[Kt],se=Qt>0==(ce.level!=1),Se=se?Gt.begin:x(Gt.end,-1);if(ce.from<=Se&&Se<ce.to||(Se=se?ce.from:x(ce.to,-1),Gt.begin<=Se&&Se<Gt.end))return ee(Se,se)}},kt=Ct(m+d,d,G);if(kt)return kt;var Ft=d>0?G.end:x(G.begin,-1);return Ft!=null&&!(d>0&&Ft==s.text.length)&&(kt=Ct(d>0?0:h.length-1,d,P(Ft)),kt)?kt:null}var wa={selectAll:Tf,singleSelection:function(o){return o.setSelection(o.getCursor("anchor"),o.getCursor("head"),Ot)},killLine:function(o){return To(o,function(s){if(s.empty()){var p=Zt(o.doc,s.head.line).text.length;return s.head.ch==p&&s.head.line<o.lastLine()?{from:s.head,to:Mt(s.head.line+1,0)}:{from:s.head,to:Mt(s.head.line,p)}}else return{from:s.from(),to:s.to()}})},deleteLine:function(o){return To(o,function(s){return{from:Mt(s.from().line,0),to:Rt(o.doc,Mt(s.to().line+1,0))}})},delLineLeft:function(o){return To(o,function(s){return{from:Mt(s.from().line,0),to:s.from()}})},delWrappedLineLeft:function(o){return To(o,function(s){var p=o.charCoords(s.head,"div").top+5,d=o.coordsChar({left:0,top:p},"div");return{from:d,to:s.from()}})},delWrappedLineRight:function(o){return To(o,function(s){var p=o.charCoords(s.head,"div").top+5,d=o.coordsChar({left:o.display.lineDiv.offsetWidth+100,top:p},"div");return{from:s.from(),to:d}})},undo:function(o){return o.undo()},redo:function(o){return o.redo()},undoSelection:function(o){return o.undoSelection()},redoSelection:function(o){return o.redoSelection()},goDocStart:function(o){return o.extendSelection(Mt(o.firstLine(),0))},goDocEnd:function(o){return o.extendSelection(Mt(o.lastLine()))},goLineStart:function(o){return o.extendSelectionsBy(function(s){return Wf(o,s.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(o){return o.extendSelectionsBy(function(s){return zf(o,s.head)},{origin:"+move",bias:1})},goLineEnd:function(o){return o.extendSelectionsBy(function(s){return ig(o,s.head.line)},{origin:"+move",bias:-1})},goLineRight:function(o){return o.extendSelectionsBy(function(s){var p=o.cursorCoords(s.head,"div").top+5;return o.coordsChar({left:o.display.lineDiv.offsetWidth+100,top:p},"div")},Vt)},goLineLeft:function(o){return o.extendSelectionsBy(function(s){var p=o.cursorCoords(s.head,"div").top+5;return o.coordsChar({left:0,top:p},"div")},Vt)},goLineLeftSmart:function(o){return o.extendSelectionsBy(function(s){var p=o.cursorCoords(s.head,"div").top+5,d=o.coordsChar({left:0,top:p},"div");return d.ch<o.getLine(d.line).search(/\S/)?zf(o,s.head):d},Vt)},goLineUp:function(o){return o.moveV(-1,"line")},goLineDown:function(o){return o.moveV(1,"line")},goPageUp:function(o){return o.moveV(-1,"page")},goPageDown:function(o){return o.moveV(1,"page")},goCharLeft:function(o){return o.moveH(-1,"char")},goCharRight:function(o){return o.moveH(1,"char")},goColumnLeft:function(o){return o.moveH(-1,"column")},goColumnRight:function(o){return o.moveH(1,"column")},goWordLeft:function(o){return o.moveH(-1,"word")},goGroupRight:function(o){return o.moveH(1,"group")},goGroupLeft:function(o){return o.moveH(-1,"group")},goWordRight:function(o){return o.moveH(1,"word")},delCharBefore:function(o){return o.deleteH(-1,"codepoint")},delCharAfter:function(o){return o.deleteH(1,"char")},delWordBefore:function(o){return o.deleteH(-1,"word")},delWordAfter:function(o){return o.deleteH(1,"word")},delGroupBefore:function(o){return o.deleteH(-1,"group")},delGroupAfter:function(o){return o.deleteH(1,"group")},indentAuto:function(o){return o.indentSelection("smart")},indentMore:function(o){return o.indentSelection("add")},indentLess:function(o){return o.indentSelection("subtract")},insertTab:function(o){return o.replaceSelection(" ")},insertSoftTab:function(o){for(var s=[],p=o.listSelections(),d=o.options.tabSize,h=0;h<p.length;h++){var m=p[h].from(),w=mt(o.getLine(m.line),m.ch,d);s.push(Ee(d-w%d))}o.replaceSelections(s)},defaultTab:function(o){o.somethingSelected()?o.indentSelection("add"):o.execCommand("insertTab")},transposeChars:function(o){return ar(o,function(){for(var s=o.listSelections(),p=[],d=0;d<s.length;d++)if(s[d].empty()){var h=s[d].head,m=Zt(o.doc,h.line).text;if(m){if(h.ch==m.length&&(h=new Mt(h.line,h.ch-1)),h.ch>0)h=new Mt(h.line,h.ch+1),o.replaceRange(m.charAt(h.ch-1)+m.charAt(h.ch-2),Mt(h.line,h.ch-2),h,"+transpose");else if(h.line>o.doc.first){var w=Zt(o.doc,h.line-1).text;w&&(h=new Mt(h.line,1),o.replaceRange(m.charAt(0)+o.doc.lineSeparator()+w.charAt(w.length-1),Mt(h.line-1,w.length-1),h,"+transpose"))}}p.push(new Me(h,h))}o.setSelections(p)})},newlineAndIndent:function(o){return ar(o,function(){for(var s=o.listSelections(),p=s.length-1;p>=0;p--)o.replaceRange(o.doc.lineSeparator(),s[p].anchor,s[p].head,"+input");s=o.listSelections();for(var d=0;d<s.length;d++)o.indentLine(s[d].from().line,null,!0);mo(o)})},openLine:function(o){return o.replaceSelection(` 14`,"start")},toggleOverwrite:function(o){return o.toggleOverwrite()}};function Wf(o,s){var p=Zt(o.doc,s),d=we(p);return d!=p&&(s=_e(d)),hu(!0,o,d,s,1)}function ig(o,s){var p=Zt(o.doc,s),d=le(p);return d!=p&&(s=_e(d)),hu(!0,o,p,s,-1)}function zf(o,s){var p=Wf(o,s.line),d=Zt(o.doc,p.line),h=M(d,o.doc.direction);if(!h||h[0].level==0){var m=Math.max(p.ch,d.text.search(/\S/)),w=s.line==p.line&&s.ch<=m&&s.ch;return Mt(p.line,w?0:m,p.sticky)}return p}function Os(o,s,p){if(typeof s=="string"&&(s=wa[s],!s))return!1;o.display.input.ensurePolled();var d=o.display.shift,h=!1;try{o.isReadOnly()&&(o.state.suppressEdits=!0),p&&(o.display.shift=!1),h=s(o)!=wt}finally{o.display.shift=d,o.state.suppressEdits=!1}return h}function og(o,s,p){for(var d=0;d<o.state.keyMaps.length;d++){var h=Oo(s,o.state.keyMaps[d],p,o);if(h)return h}return o.options.extraKeys&&Oo(s,o.options.extraKeys,p,o)||Oo(s,o.options.keyMap,p,o)}var ag=new bt;function ba(o,s,p,d){var h=o.state.keySeq;if(h){if(Hf(s))return"handled";if(/\'$/.test(s)?o.state.keySeq=null:ag.set(50,function(){o.state.keySeq==h&&(o.state.keySeq=null,o.display.input.reset())}),Kf(o,h+" "+s,p,d))return!0}return Kf(o,s,p,d)}function Kf(o,s,p,d){var h=og(o,s,d);return h=="multi"&&(o.state.keySeq=s),h=="handled"&&Qe(o,"keyHandled",o,s,p),(h=="handled"||h=="multi")&&(Oe(p),Xl(o)),!!h}function Gf(o,s){var p=Bf(s,!0);return p?s.shiftKey&&!o.state.keySeq?ba(o,"Shift-"+p,s,function(d){return Os(o,d,!0)})||ba(o,p,s,function(d){if(typeof d=="string"?/^go[A-Z]/.test(d):d.motion)return Os(o,d)}):ba(o,p,s,function(d){return Os(o,d)}):!1}function sg(o,s,p){return ba(o,"'"+p+"'",s,function(d){return Os(o,d,!0)})}var vu=null;function $f(o){var s=this;if(!(o.target&&o.target!=s.display.input.getField())&&(s.curOp.focus=gt(),!Bt(s,o))){u&&c<11&&o.keyCode==27&&(o.returnValue=!1);var p=o.keyCode;s.display.shift=p==16||o.shiftKey;var d=Gf(s,o);y&&(vu=d?p:null,!d&&p==88&&!Qn&&(R?o.metaKey:o.ctrlKey)&&s.replaceSelection("",null,"cut")),e&&!R&&!d&&p==46&&o.shiftKey&&!o.ctrlKey&&document.execCommand&&document.execCommand("cut"),p==18&&!/\bCodeMirror-crosshair\b/.test(s.display.lineDiv.className)&&lg(s)}}function lg(o){var s=o.display.lineDiv;yt(s,"CodeMirror-crosshair");function p(d){(d.keyCode==18||!d.altKey)&&(lt(s,"CodeMirror-crosshair"),Yt(document,"keyup",p),Yt(document,"mouseover",p))}ht(document,"keyup",p),ht(document,"mouseover",p)}function qf(o){o.keyCode==16&&(this.doc.sel.shift=!1),Bt(this,o)}function Yf(o){var s=this;if(!(o.target&&o.target!=s.display.input.getField())&&!(Ar(s.display,o)||Bt(s,o)||o.ctrlKey&&!o.altKey||R&&o.metaKey)){var p=o.keyCode,d=o.charCode;if(y&&p==vu){vu=null,Oe(o);return}if(!(y&&(!o.which||o.which<10)&&Gf(s,o))){var h=String.fromCharCode(d??p);h!="\b"&&(sg(s,o,h)||s.display.input.onKeyPress(o))}}}var ug=400,gu=function(o,s,p){this.time=o,this.pos=s,this.button=p};gu.prototype.compare=function(o,s,p){return this.time+ug>o&&fe(s,this.pos)==0&&p==this.button};var xa,Ca;function cg(o,s){var p=+new Date;return Ca&&Ca.compare(p,o,s)?(xa=Ca=null,"triple"):xa&&xa.compare(p,o,s)?(Ca=new gu(p,o,s),xa=null,"double"):(xa=new gu(p,o,s),Ca=null,"single")}function Xf(o){var s=this,p=s.display;if(!(Bt(s,o)||p.activeTouch&&p.input.supportsTouch())){if(p.input.ensurePolled(),p.shift=o.shiftKey,Ar(p,o)){f||(p.scroller.draggable=!1,setTimeout(function(){return p.scroller.draggable=!0},100));return}if(!yu(s,o)){var d=zi(s,o),h=at(o),m=d?cg(d,h):"single";window.focus(),h==1&&s.state.selectingText&&s.state.selectingText(o),!(d&&fg(s,h,d,m,o))&&(h==1?d?pg(s,d,m,o):Z(o)==p.scroller&&Oe(o):h==2?(d&&_s(s.doc,d),setTimeout(function(){return p.input.focus()},20)):h==3&&(ut?s.display.input.onContextMenu(o):Jl(s)))}}}function fg(o,s,p,d,h){var m="Click";return d=="double"?m="Double"+m:d=="triple"&&(m="Triple"+m),m=(s==1?"Left":s==2?"Middle":"Right")+m,ba(o,Uf(m,h),h,function(w){if(typeof w=="string"&&(w=wa[w]),!w)return!1;var x=!1;try{o.isReadOnly()&&(o.state.suppressEdits=!0),x=w(o,p)!=wt}finally{o.state.suppressEdits=!1}return x})}function dg(o,s,p){var d=o.getOption("configureMouse"),h=d?d(o,s,p):{};if(h.unit==null){var m=W?p.shiftKey&&p.metaKey:p.altKey;h.unit=m?"rectangle":s=="single"?"char":s=="double"?"word":"line"}return(h.extend==null||o.doc.extend)&&(h.extend=o.doc.extend||p.shiftKey),h.addNew==null&&(h.addNew=R?p.metaKey:p.ctrlKey),h.moveOnDrag==null&&(h.moveOnDrag=!(R?p.altKey:p.ctrlKey)),h}function pg(o,s,p,d){u?setTimeout(Xt(Xc,o),0):o.curOp.focus=gt();var h=dg(o,p,d),m=o.doc.sel,w;o.options.dragDrop&&Pt&&!o.isReadOnly()&&p=="single"&&(w=m.contains(s))>-1&&(fe((w=m.ranges[w]).from(),s)<0||s.xRel>0)&&(fe(w.to(),s)>0||s.xRel<0)?hg(o,d,s,h):vg(o,d,s,h)}function hg(o,s,p,d){var h=o.display,m=!1,w=wn(o,function(P){f&&(h.scroller.draggable=!1),o.state.draggingText=!1,o.state.delayingBlurEvent&&(o.hasFocus()?o.state.delayingBlurEvent=!1:Jl(o)),Yt(h.wrapper.ownerDocument,"mouseup",w),Yt(h.wrapper.ownerDocument,"mousemove",x),Yt(h.scroller,"dragstart",C),Yt(h.scroller,"drop",w),m||(Oe(P),d.addNew||_s(o.doc,p,null,null,d.extend),f&&!_||u&&c==9?setTimeout(function(){h.wrapper.ownerDocument.body.focus({preventScroll:!0}),h.input.focus()},20):h.input.focus())}),x=function(P){m=m||Math.abs(s.clientX-P.clientX)+Math.abs(s.clientY-P.clientY)>=10},C=function(){return m=!0};f&&(h.scroller.draggable=!0),o.state.draggingText=w,w.copy=!d.moveOnDrag,ht(h.wrapper.ownerDocument,"mouseup",w),ht(h.wrapper.ownerDocument,"mousemove",x),ht(h.scroller,"dragstart",C),ht(h.scroller,"drop",w),o.state.delayingBlurEvent=!0,setTimeout(function(){return h.input.focus()},20),h.scroller.dragDrop&&h.scroller.dragDrop()}function Jf(o,s,p){if(p=="char")return new Me(s,s);if(p=="word")return o.findWordAt(s);if(p=="line")return new Me(Mt(s.line,0),Rt(o.doc,Mt(s.line+1,0)));var d=p(o,s);return new Me(d.from,d.to)}function vg(o,s,p,d){u&&Jl(o);var h=o.display,m=o.doc;Oe(s);var w,x,C=m.sel,P=C.ranges;if(d.addNew&&!d.extend?(x=m.sel.contains(p),x>-1?w=P[x]:w=new Me(p,p)):(w=m.sel.primary(),x=m.sel.primIndex),d.unit=="rectangle")d.addNew||(w=new Me(p,p)),p=zi(o,s,!0,!0),x=-1;else{var G=Jf(o,p,d.unit);d.extend?w=cu(w,G.anchor,G.head,d.extend):w=G}d.addNew?x==-1?(x=P.length,Mn(m,Vr(o,P.concat([w]),x),{scroll:!1,origin:"*mouse"})):P.length>1&&P[x].empty()&&d.unit=="char"&&!d.extend?(Mn(m,Vr(o,P.slice(0,x).concat(P.slice(x+1)),0),{scroll:!1,origin:"*mouse"}),C=m.sel):fu(m,x,w,Ht):(x=0,Mn(m,new xr([w],0),Ht),C=m.sel);var J=p;function dt(Gt){if(fe(J,Gt)!=0)if(J=Gt,d.unit=="rectangle"){for(var ee=[],ce=o.options.tabSize,se=mt(Zt(m,p.line).text,p.ch,ce),Se=mt(Zt(m,Gt.line).text,Gt.ch,ce),He=Math.min(se,Se),xn=Math.max(se,Se),Xe=Math.min(p.line,Gt.line),sr=Math.min(o.lastLine(),Math.max(p.line,Gt.line));Xe<=sr;Xe++){var Kn=Zt(m,Xe).text,sn=Nt(Kn,He,ce);He==xn?ee.push(new Me(Mt(Xe,sn),Mt(Xe,sn))):Kn.length>sn&&ee.push(new Me(Mt(Xe,sn),Mt(Xe,Nt(Kn,xn,ce))))}ee.length||ee.push(new Me(p,p)),Mn(m,Vr(o,C.ranges.slice(0,x).concat(ee),x),{origin:"*mouse",scroll:!1}),o.scrollIntoView(Gt)}else{var Gn=w,En=Jf(o,Gt,d.unit),gn=Gn.anchor,ln;fe(En.anchor,gn)>0?(ln=En.head,gn=St(Gn.from(),En.anchor)):(ln=En.anchor,gn=X(Gn.to(),En.head));var tn=C.ranges.slice(0);tn[x]=gg(o,new Me(Rt(m,gn),ln)),Mn(m,Vr(o,tn,x),Ht)}}var rt=h.wrapper.getBoundingClientRect(),Ct=0;function kt(Gt){var ee=++Ct,ce=zi(o,Gt,!0,d.unit=="rectangle");if(ce)if(fe(ce,J)!=0){o.curOp.focus=gt(),dt(ce);var se=ps(h,m);(ce.line>=se.to||ce.line<se.from)&&setTimeout(wn(o,function(){Ct==ee&&kt(Gt)}),150)}else{var Se=Gt.clientY<rt.top?-20:Gt.clientY>rt.bottom?20:0;Se&&setTimeout(wn(o,function(){Ct==ee&&(h.scroller.scrollTop+=Se,kt(Gt))}),50)}}function Ft(Gt){o.state.selectingText=!1,Ct=1/0,Gt&&(Oe(Gt),h.input.focus()),Yt(h.wrapper.ownerDocument,"mousemove",Kt),Yt(h.wrapper.ownerDocument,"mouseup",Qt),m.history.lastSelOrigin=null}var Kt=wn(o,function(Gt){Gt.buttons===0||!at(Gt)?Ft(Gt):kt(Gt)}),Qt=wn(o,Ft);o.state.selectingText=Qt,ht(h.wrapper.ownerDocument,"mousemove",Kt),ht(h.wrapper.ownerDocument,"mouseup",Qt)}function gg(o,s){var p=s.anchor,d=s.head,h=Zt(o.doc,p.line);if(fe(p,d)==0&&p.sticky==d.sticky)return s;var m=M(h);if(!m)return s;var w=V(m,p.ch,p.sticky),x=m[w];if(x.from!=p.ch&&x.to!=p.ch)return s;var C=w+(x.from==p.ch==(x.level!=1)?0:1);if(C==0||C==m.length)return s;var P;if(d.line!=p.line)P=(d.line-p.line)*(o.doc.direction=="ltr"?1:-1)>0;else{var G=V(m,d.ch,d.sticky),J=G-w||(d.ch-p.ch)*(x.level==1?-1:1);G==C-1||G==C?P=J<0:P=J>0}var dt=m[C+(P?-1:0)],rt=P==(dt.level==1),Ct=rt?dt.from:dt.to,kt=rt?"after":"before";return p.ch==Ct&&p.sticky==kt?s:new Me(new Mt(p.line,Ct,kt),d)}function Zf(o,s,p,d){var h,m;if(s.touches)h=s.touches[0].clientX,m=s.touches[0].clientY;else try{h=s.clientX,m=s.clientY}catch(dt){return!1}if(h>=Math.floor(o.display.gutters.getBoundingClientRect().right))return!1;d&&Oe(s);var w=o.display,x=w.lineDiv.getBoundingClientRect();if(m>x.bottom||!Ce(o,p))return cn(s);m-=x.top-w.viewOffset;for(var C=0;C<o.display.gutterSpecs.length;++C){var P=w.gutters.childNodes[C];if(P&&P.getBoundingClientRect().right>=h){var G=Ne(o.doc,m),J=o.display.gutterSpecs[C];return qt(o,p,o,G,J.className,s),cn(s)}}}function yu(o,s){return Zf(o,s,"gutterClick",!0)}function Qf(o,s){Ar(o.display,s)||yg(o,s)||Bt(o,s,"contextmenu")||ut||o.display.input.onContextMenu(s)}function yg(o,s){return Ce(o,"gutterContextMenu")?Zf(o,s,"gutterContextMenu",!1):!1}function td(o){o.display.wrapper.className=o.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+o.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ra(o)}var Eo={toString:function(){return"CodeMirror.Init"}},ed={},Ts={};function mg(o){var s=o.optionHandlers;function p(d,h,m,w){o.defaults[d]=h,m&&(s[d]=w?function(x,C,P){P!=Eo&&m(x,C,P)}:m)}o.defineOption=p,o.Init=Eo,p("value","",function(d,h){return d.setValue(h)},!0),p("mode",null,function(d,h){d.doc.modeOption=h,su(d)},!0),p("indentUnit",2,su,!0),p("indentWithTabs",!1),p("smartIndent",!0),p("tabSize",4,function(d){fa(d),ra(d),Wn(d)},!0),p("lineSeparator",null,function(d,h){if(d.doc.lineSep=h,!!h){var m=[],w=d.doc.first;d.doc.iter(function(C){for(var P=0;;){var G=C.text.indexOf(h,P);if(G==-1)break;P=G+h.length,m.push(Mt(w,G))}w++});for(var x=m.length-1;x>=0;x--)Co(d.doc,h,m[x],Mt(m[x].line,m[x].ch+h.length))}}),p("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(d,h,m){d.state.specialChars=new RegExp(h.source+(h.test(" ")?"":"| "),"g"),m!=Eo&&d.refresh()}),p("specialCharPlaceholder",Ja,function(d){return d.refresh()},!0),p("electricChars",!0),p("inputStyle",z?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),p("spellcheck",!1,function(d,h){return d.getInputField().spellcheck=h},!0),p("autocorrect",!1,function(d,h){return d.getInputField().autocorrect=h},!0),p("autocapitalize",!1,function(d,h){return d.getInputField().autocapitalize=h},!0),p("rtlMoveVisually",!ct),p("wholeLineUpdateBefore",!0),p("theme","default",function(d){td(d),ca(d)},!0),p("keyMap","default",function(d,h,m){var w=Ss(h),x=m!=Eo&&Ss(m);x&&x.detach&&x.detach(d,w),w.attach&&w.attach(d,x||null)}),p("extraKeys",null),p("configureMouse",null),p("lineWrapping",!1,wg,!0),p("gutters",[],function(d,h){d.display.gutterSpecs=ou(h,d.options.lineNumbers),ca(d)},!0),p("fixedGutter",!0,function(d,h){d.display.gutters.style.left=h?ql(d.display)+"px":"0",d.refresh()},!0),p("coverGutterNextToScrollbar",!1,function(d){return _o(d)},!0),p("scrollbarStyle","native",function(d){nf(d),_o(d),d.display.scrollbars.setScrollTop(d.doc.scrollTop),d.display.scrollbars.setScrollLeft(d.doc.scrollLeft)},!0),p("lineNumbers",!1,function(d,h){d.display.gutterSpecs=ou(d.options.gutters,h),ca(d)},!0),p("firstLineNumber",1,ca,!0),p("lineNumberFormatter",function(d){return d},ca,!0),p("showCursorWhenSelecting",!1,ia,!0),p("resetSelectionOnContextMenu",!0),p("lineWiseCopyCut",!0),p("pasteLinesPerSelection",!0),p("selectionsMayTouch",!1),p("readOnly",!1,function(d,h){h=="nocursor"&&(yo(d),d.display.input.blur()),d.display.input.readOnlyChanged(h)}),p("screenReaderLabel",null,function(d,h){h=h===""?null:h,d.display.input.screenReaderLabelChanged(h)}),p("disableInput",!1,function(d,h){h||d.display.input.reset()},!0),p("dragDrop",!0,_g),p("allowDropFileTypes",null),p("cursorBlinkRate",530),p("cursorScrollMargin",0),p("cursorHeight",1,ia,!0),p("singleCursorHeightPerLine",!0,ia,!0),p("workTime",100),p("workDelay",100),p("flattenSpans",!0,fa,!0),p("addModeClass",!1,fa,!0),p("pollInterval",100),p("und
14oDepth",200,function(d,h){return d.doc.history.undoDepth=h}),p("historyEventDelay",1250),p("viewportMargin",10,function(d){return d.refresh()},!0),p("maxHighlightLength",1e4,fa,!0),p("moveInputWithCursor",!0,function(d,h){h||d.display.input.resetPosition()}),p("tabindex",null,function(d,h){return d.display.input.getField().tabIndex=h||""}),p("autofocus",null),p("direction","ltr",function(d,h){return d.doc.setDirection(h)},!0),p("phrases",null)}function _g(o,s,p){var d=p&&p!=Eo;if(!s!=!d){var h=o.display.dragFunctions,m=s?ht:Yt;m(o.display.scroller,"dragstart",h.start),m(o.display.scroller,"dragenter",h.enter),m(o.display.scroller,"dragover",h.over),m(o.display.scroller,"dragleave",h.leave),m(o.display.scroller,"drop",h.drop)}}function wg(o){o.options.lineWrapping?(yt(o.display.wrapper,"CodeMirror-wrap"),o.display.sizer.style.minWidth="",o.display.sizerWidth=null):(lt(o.display.wrapper,"CodeMirror-wrap"),vi(o)),Yl(o),Wn(o),ra(o),setTimeout(function(){return _o(o)},100)}function Ge(o,s){var p=this;if(!(this instanceof Ge))return new Ge(o,s);this.options=s=s?he(s):{},he(ed,s,!1);var d=s.value;typeof d=="string"?d=new zn(d,s.mode,null,s.lineSeparator,s.direction):s.mode&&(d.modeOption=s.mode),this.doc=d;var h=new Ge.inputStyles[s.inputStyle](this),m=this.display=new Dv(o,d,h,s);m.wrapper.CodeMirror=this,td(this),s.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),nf(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 bt,keySeq:null,specialChars:null},s.autofocus&&!z&&m.input.focus(),u&&c<11&&setTimeout(function(){return p.display.input.reset(!0)},20),bg(this),Zv(),qi(this),this.curOp.forceUpdate=!0,pf(this,d),s.autofocus&&!z||this.hasFocus()?setTimeout(function(){p.hasFocus()&&!p.state.focused&&Zl(p)},20):yo(this);for(var w in Ts)Ts.hasOwnProperty(w)&&Ts[w](this,s[w],Eo);af(this),s.finishInit&&s.finishInit(this);for(var x=0;x<mu.length;++x)mu[x](this);Yi(this),f&&s.lineWrapping&&getComputedStyle(m.lineDiv).textRendering=="optimizelegibility"&&(m.lineDiv.style.textRendering="auto")}Ge.defaults=ed,Ge.optionHandlers=Ts;function bg(o){var s=o.display;ht(s.scroller,"mousedown",wn(o,Xf)),u&&c<11?ht(s.scroller,"dblclick",wn(o,function(C){if(!Bt(o,C)){var P=zi(o,C);if(!(!P||yu(o,C)||Ar(o.display,C))){Oe(C);var G=o.findWordAt(P);_s(o.doc,G.anchor,G.head)}}})):ht(s.scroller,"dblclick",function(C){return Bt(o,C)||Oe(C)}),ht(s.scroller,"contextmenu",function(C){return Qf(o,C)}),ht(s.input.getField(),"contextmenu",function(C){s.scroller.contains(C.target)||Qf(o,C)});var p,d={end:0};function h(){s.activeTouch&&(p=setTimeout(function(){return s.activeTouch=null},1e3),d=s.activeTouch,d.end=+new Date)}function m(C){if(C.touches.length!=1)return!1;var P=C.touches[0];return P.radiusX<=1&&P.radiusY<=1}function w(C,P){if(P.left==null)return!0;var G=P.left-C.left,J=P.top-C.top;return G*G+J*J>400}ht(s.scroller,"touchstart",function(C){if(!Bt(o,C)&&!m(C)&&!yu(o,C)){s.input.ensurePolled(),clearTimeout(p);var P=+new Date;s.activeTouch={start:P,moved:!1,prev:P-d.end<=300?d:null},C.touches.length==1&&(s.activeTouch.left=C.touches[0].pageX,s.activeTouch.top=C.touches[0].pageY)}}),ht(s.scroller,"touchmove",function(){s.activeTouch&&(s.activeTouch.moved=!0)}),ht(s.scroller,"touchend",function(C){var P=s.activeTouch;if(P&&!Ar(s,C)&&P.left!=null&&!P.moved&&new Date-P.start<300){var G=o.coordsChar(s.activeTouch,"page"),J;!P.prev||w(P,P.prev)?J=new Me(G,G):!P.prev.prev||w(P,P.prev.prev)?J=o.findWordAt(G):J=new Me(Mt(G.line,0),Rt(o.doc,Mt(G.line+1,0))),o.setSelection(J.anchor,J.head),o.focus(),Oe(C)}h()}),ht(s.scroller,"touchcancel",h),ht(s.scroller,"scroll",function(){s.scroller.clientHeight&&(aa(o,s.scroller.scrollTop),Gi(o,s.scroller.scrollLeft,!0),qt(o,"scroll",o))}),ht(s.scroller,"mousewheel",function(C){return uf(o,C)}),ht(s.scroller,"DOMMouseScroll",function(C){return uf(o,C)}),ht(s.wrapper,"scroll",function(){return s.wrapper.scrollTop=s.wrapper.scrollLeft=0}),s.dragFunctions={enter:function(C){Bt(o,C)||j(C)},over:function(C){Bt(o,C)||(Jv(o,C),j(C))},start:function(C){return Xv(o,C)},drop:wn(o,Yv),leave:function(C){Bt(o,C)||Nf(o)}};var x=s.input.getField();ht(x,"keyup",function(C){return qf.call(o,C)}),ht(x,"keydown",wn(o,$f)),ht(x,"keypress",wn(o,Yf)),ht(x,"focus",function(C){return Zl(o,C)}),ht(x,"blur",function(C){return yo(o,C)})}var mu=[];Ge.defineInitHook=function(o){return mu.push(o)};function Sa(o,s,p,d){var h=o.doc,m;p==null&&(p="add"),p=="smart"&&(h.mode.indent?m=Bn(o,s).state:p="prev");var w=o.options.tabSize,x=Zt(h,s),C=mt(x.text,null,w);x.stateAfter&&(x.stateAfter=null);var P=x.text.match(/^\s*/)[0],G;if(!d&&!/\S/.test(x.text))G=0,p="not";else if(p=="smart"&&(G=h.mode.indent(m,x.text.slice(P.length),x.text),G==wt||G>150)){if(!d)return;p="prev"}p=="prev"?s>h.first?G=mt(Zt(h,s-1).text,null,w):G=0:p=="add"?G=C+o.options.indentUnit:p=="subtract"?G=C-o.options.indentUnit:typeof p=="number"&&(G=C+p),G=Math.max(0,G);var J="",dt=0;if(o.options.indentWithTabs)for(var rt=Math.floor(G/w);rt;--rt)dt+=w,J+=" ";if(dt<G&&(J+=Ee(G-dt)),J!=P)return Co(h,J,Mt(s,0),Mt(s,P.length),"+input"),x.stateAfter=null,!0;for(var Ct=0;Ct<h.sel.ranges.length;Ct++){var kt=h.sel.ranges[Ct];if(kt.head.line==s&&kt.head.ch<P.length){var Ft=Mt(s,P.length);fu(h,Ct,new Me(Ft,Ft));break}}}var Hr=null;function Es(o){Hr=o}function _u(o,s,p,d,h){var m=o.doc;
vendor: 31,153 bytes, lines 14-26
14o.display.shift=!1,d||(d=m.sel);var w=+new Date-200,x=h=="paste"||o.state.pasteIncoming>w,C=Fe(s),P=null;if(x&&d.ranges.length>1)if(Hr&&Hr.text.join(` 15`)==s){if(d.ranges.length%Hr.text.length==0){P=[];for(var G=0;G<Hr.text.length;G++)P.push(m.splitLines(Hr.text[G]))}}else C.length==d.ranges.length&&o.options.pasteLinesPerSelection&&(P=Be(C,function(Kt){return[Kt]}));for(var J=o.curOp.updateInput,dt=d.ranges.length-1;dt>=0;dt--){var rt=d.ranges[dt],Ct=rt.from(),kt=rt.to();rt.empty()&&(p&&p>0?Ct=Mt(Ct.line,Ct.ch-p):o.state.overwrite&&!x?kt=Mt(kt.line,Math.min(Zt(m,kt.line).text.length,kt.ch+ue(C).length)):x&&Hr&&Hr.lineWise&&Hr.text.join(` 16`)==C.join(` 17`)&&(Ct=kt=Mt(Ct.line,0)));var Ft={from:Ct,to:kt,text:P?P[dt%P.length]:C,origin:h||(x?"paste":o.state.cutIncoming>w?"cut":"+input")};xo(o.doc,Ft),Qe(o,"inputRead",o,Ft)}s&&!x&&rd(o,s),mo(o),o.curOp.updateInput<2&&(o.curOp.updateInput=J),o.curOp.typing=!0,o.state.pasteIncoming=o.state.cutIncoming=-1}function nd(o,s){var p=o.clipboardData&&o.clipboardData.getData("Text");if(p)return o.preventDefault(),!s.isReadOnly()&&!s.options.disableInput&&ar(s,function(){return _u(s,p,0,null,"paste")}),!0}function rd(o,s){if(!(!o.options.electricChars||!o.options.smartIndent))for(var p=o.doc.sel,d=p.ranges.length-1;d>=0;d--){var h=p.ranges[d];if(!(h.head.ch>100||d&&p.ranges[d-1].head.line==h.head.line)){var m=o.getModeAt(h.head),w=!1;if(m.electricChars){for(var x=0;x<m.electricChars.length;x++)if(s.indexOf(m.electricChars.charAt(x))>-1){w=Sa(o,h.head.line,"smart");break}}else m.electricInput&&m.electricInput.test(Zt(o.doc,h.head.line).text.slice(0,h.head.ch))&&(w=Sa(o,h.head.line,"smart"));w&&Qe(o,"electricInput",o,h.head.line)}}}function id(o){for(var s=[],p=[],d=0;d<o.doc.sel.ranges.length;d++){var h=o.doc.sel.ranges[d].head.line,m={anchor:Mt(h,0),head:Mt(h+1,0)};p.push(m),s.push(o.getRange(m.anchor,m.head))}return{text:s,ranges:p}}function od(o,s,p,d){o.setAttribute("autocorrect",p?"":"off"),o.setAttribute("autocapitalize",d?"":"off"),o.setAttribute("spellcheck",!!s)}function ad(){var o=B("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),s=B("div",[o],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return f?o.style.width="1000px":o.setAttribute("wrap","off"),E&&(o.style.border="1px solid black"),od(o),s}function xg(o){var s=o.optionHandlers,p=o.helpers={};o.prototype={constructor:o,focus:function(){window.focus(),this.display.input.focus()},setOption:function(d,h){var m=this.options,w=m[d];m[d]==h&&d!="mode"||(m[d]=h,s.hasOwnProperty(d)&&wn(this,s[d])(this,h,w),qt(this,"optionChange",this,d))},getOption:function(d){return this.options[d]},getDoc:function(){return this.doc},addKeyMap:function(d,h){this.state.keyMaps[h?"push":"unshift"](Ss(d))},removeKeyMap:function(d){for(var h=this.state.keyMaps,m=0;m<h.length;++m)if(h[m]==d||h[m].name==d)return h.splice(m,1),!0},addOverlay:In(function(d,h){var m=d.token?d:o.getMode(this.options,d);if(m.startState)throw new Error("Overlays may not be stateful.");je(this.state.overlays,{mode:m,modeSpec:d,opaque:h&&h.opaque,priority:h&&h.priority||0},function(w){return w.priority}),this.state.modeGen++,Wn(this)}),removeOverlay:In(function(d){for(var h=this.state.overlays,m=0;m<h.length;++m){var w=h[m].modeSpec;if(w==d||typeof d=="string"&&w.name==d){h.splice(m,1),this.state.modeGen++,Wn(this);return}}}),indentLine:In(function(d,h,m){typeof h!="string"&&typeof h!="number"&&(h==null?h=this.options.smartIndent?"smart":"prev":h=h?"add":"subtract"),vr(this.doc,d)&&Sa(this,d,h,m)}),indentSelection:In(function(d){for(var h=this.doc.sel.ranges,m=-1,w=0;w<h.length;w++){var x=h[w];if(x.empty())x.head.line>m&&(Sa(this,x.head.line,d,!0),m=x.head.line,w==this.doc.sel.primIndex&&mo(this));else{var C=x.from(),P=x.to(),G=Math.max(m,C.line);m=Math.min(this.lastLine(),P.line-(P.ch?0:1))+1;for(var J=G;J<m;++J)Sa(this,J,d);var dt=this.doc.sel.ranges;C.ch==0&&h.length==dt.length&&dt[w].from().ch>0&&fu(this.doc,w,new Me(C,dt[w].to()),Ot)}}}),getTokenAt:function(d,h){return Fi(this,d,h)},getLineTokens:function(d,h){return Fi(this,Mt(d),h,!0)},getTokenTypeAt:function(d){d=Rt(this.doc,d);var h=yr(this,Zt(this.doc,d.line)),m=0,w=(h.length-1)/2,x=d.ch,C;if(x==0)C=h[2];else for(;;){var P=m+w>>1;if((P?h[P*2-1]:0)>=x)w=P;else if(h[P*2+1]<x)m=P+1;else{C=h[P*2+2];break}}var G=C?C.indexOf("overlay "):-1;return G<0?C:G==0?null:C.slice(0,G-1)},getModeAt:function(d){var h=this.doc.mode;return h.innerMode?o.innerMode(h,this.getTokenAt(d).state).mode:h},getHelper:function(d,h){return this.getHelpers(d,h)[0]},getHelpers:function(d,h){var m=[];if(!p.hasOwnProperty(h))return m;var w=p[h],x=this.getModeAt(d);if(typeof x[h]=="string")w[x[h]]&&m.push(w[x[h]]);else if(x[h])for(var C=0;C<x[h].length;C++){var P=w[x[h][C]];P&&m.push(P)}else x.helperType&&w[x.helperType]?m.push(w[x.helperType]):w[x.name]&&m.push(w[x.name]);for(var G=0;G<w._global.length;G++){var J=w._global[G];J.pred(x,this)&&It(m,J.val)==-1&&m.push(J.val)}return m},getStateAfter:function(d,h){var m=this.doc;return d=Dt(m,d??m.first+m.size-1),Bn(this,d+1,h).state},cursorCoords:function(d,h){var m,w=this.doc.sel.primary();return d==null?m=w.head:typeof d=="object"?m=Rt(this.doc,d):m=d?w.from():w.to(),Fr(this,m,h||"page")},charCoords:function(d,h){return us(this,Rt(this.doc,d),h||"page")},coordsChar:function(d,h){return d=Bc(this,d,h||"page"),Kl(this,d.left,d.top)},lineAtHeight:function(d,h){return d=Bc(this,{top:d,left:0},h||"page").top,Ne(this.doc,d+this.display.viewOffset)},heightAtLine:function(d,h,m){var w=!1,x;if(typeof d=="number"){var C=this.doc.first+this.doc.size-1;d<this.doc.first?d=this.doc.first:d>C&&(d=C,w=!0),x=Zt(this.doc,d)}else x=d;return ls(this,x,{top:0,left:0},h||"page",m||w).top+(w?this.doc.height-ir(x):0)},defaultTextHeight:function(){return vo(this.display)},defaultCharWidth:function(){return go(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(d,h,m,w,x){var C=this.display;d=Fr(this,Rt(this.doc,d));var P=d.bottom,G=d.left;if(h.style.position="absolute",h.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(h),C.sizer.appendChild(h),w=="over")P=d.top;else if(w=="above"||w=="near"){var J=Math.max(C.wrapper.clientHeight,this.doc.height),dt=Math.max(C.sizer.clientWidth,C.lineSpace.clientWidth);(w=="above"||d.bottom+h.offsetHeight>J)&&d.top>h.offsetHeight?P=d.top-h.offsetHeight:d.bottom+h.offsetHeight<=J&&(P=d.bottom),G+h.offsetWidth>dt&&(G=dt-h.offsetWidth)}h.style.top=P+"px",h.style.left=h.style.right="",x=="right"?(G=C.sizer.clientWidth-h.offsetWidth,h.style.right="0px"):(x=="left"?G=0:x=="middle"&&(G=(C.sizer.clientWidth-h.offsetWidth)/2),h.style.left=G+"px"),m&&_v(this,{left:G,top:P,right:G+h.offsetWidth,bottom:P+h.offsetHeight})},triggerOnKeyDown:In($f),triggerOnKeyPress:In(Yf),triggerOnKeyUp:qf,triggerOnMouseDown:In(Xf),execCommand:function(d){if(wa.hasOwnProperty(d))return wa[d].call(null,this)},triggerElectric:In(function(d){rd(this,d)}),findPosH:function(d,h,m,w){var x=1;h<0&&(x=-1,h=-h);for(var C=Rt(this.doc,d),P=0;P<h&&(C=wu(this.doc,C,x,m,w),!C.hitSide);++P);return C},moveH:In(function(d,h){var m=this;this.extendSelectionsBy(function(w){return m.display.shift||m.doc.extend||w.empty()?wu(m.doc,w.head,d,h,m.options.rtlMoveVisually):d<0?w.from():w.to()},Vt)}),deleteH:In(function(d,h){var m=this.doc.sel,w=this.doc;m.somethingSelected()?w.replaceSelection("",null,"+delete"):To(this,function(x){var C=wu(w,x.head,d,h,!1);return d<0?{from:C,to:x.head}:{from:x.head,to:C}})}),findPosV:function(d,h,m,w){var x=1,C=w;h<0&&(x=-1,h=-h);for(var P=Rt(this.doc,d),G=0;G<h;++G){var J=Fr(this,P,"div");if(C==null?C=J.left:J.left=C,P=sd(this,J,x,m),P.hitSide)break}return P},moveV:In(function(d,h){var m=this,w=this.doc,x=[],C=!this.display.shift&&!w.extend&&w.sel.somethingSelected();if(w.extendSelectionsBy(function(G){if(C)return d<0?G.from():G.to();var J=Fr(m,G.head,"div");G.goalColumn!=null&&(J.left=G.goalColumn),x.push(J.left);var dt=sd(m,J,d,h);return h=="page"&&G==w.sel.primary()&&tu(m,us(m,dt,"div").top-J.top),dt},Vt),x.length)for(var P=0;P<w.sel.ranges.length;P++)w.sel.ranges[P].goalColumn=x[P]}),findWordAt:function(d){var h=this.doc,m=Zt(h,d.line).text,w=d.ch,x=d.ch;if(m){var C=this.getHelper(d,"wordChars");(d.sticky=="before"||x==m.length)&&w?--w:++x;for(var P=m.charAt(w),G=ot(P,C)?function(J){return ot(J,C)}:/\s/.test(P)?function(J){return/\s/.test(J)}:function(J){return!/\s/.test(J)&&!ot(J)};w>0&&G(m.charAt(w-1));)--w;for(;x<m.length&&G(m.charAt(x));)++x}return new Me(Mt(d.line,w),Mt(d.line,x))},toggleOverwrite:function(d){d!=null&&d==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?yt(this.display.cursorDiv,"CodeMirror-overwrite"):lt(this.display.cursorDiv,"CodeMirror-overwrite"),qt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==gt()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:In(function(d,h){oa(this,d,h)}),getScrollInfo:function(){var d=this.display.scroller;return{left:d.scrollLeft,top:d.scrollTop,height:d.scrollHeight-or(this)-this.display.barHeight,width:d.scrollWidth-or(this)-this.display.barWidth,clientHeight:O(this),clientWidth:ei(this)}},scrollIntoView:In(function(d,h){d==null?(d={from:this.doc.sel.primary().head,to:null},h==null&&(h=this.options.cursorScrollMargin)):typeof d=="number"?d={from:Mt(d,0),to:null}:d.from==null&&(d={from:d,to:null}),d.to||(d.to=d.from),d.margin=h||0,d.from.line!=null?wv(this,d):Zc(this,d.from,d.to,d.margin)}),setSize:In(function(d,h){var m=this,w=function(C){return typeof C=="number"||/^\d+$/.test(String(C))?C+"px":C};d!=null&&(this.display.wrapper.style.width=w(d)),h!=null&&(this.display.wrapper.style.height=w(h)),this.options.lineWrapping&&Vc(this);var x=this.display.viewFrom;this.doc.iter(x,this.display.viewTo,function(C){if(C.widgets){for(var P=0;P<C.widgets.length;P++)if(C.widgets[P].noHScroll){Ci(m,x,"widget");break}}++x}),this.curOp.forceUpdate=!0,qt(this,"refresh",this)}),operation:function(d){return ar(this,d)},startOperation:function(){return qi(this)},endOperation:function(){return Yi(this)},refresh:In(function(){var d=this.display.cachedTextHeight;Wn(this),this.curOp.forceUpdate=!0,ra(this),oa(this,this.doc.scrollLeft,this.doc.scrollTop),ru(this.display),(d==null||Math.abs(d-vo(this.display))>.5||this.options.lineWrapping)&&Yl(this),qt(this,"refresh",this)}),swapDoc:In(function(d){var h=this.doc;return h.cm=null,this.state.selectingText&&this.state.selectingText(),pf(this,d),ra(this),this.display.input.reset(),oa(this,d.scrollLeft,d.scrollTop),this.curOp.forceScroll=!0,Qe(this,"swapDoc",this,h),h}),phrase:function(d){var h=this.options.phrases;return h&&Object.prototype.hasOwnProperty.call(h,d)?h[d]:d},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}},Pe(o),o.registerHelper=function(d,h,m){p.hasOwnProperty(d)||(p[d]=o[d]={_global:[]}),p[d][h]=m},o.registerGlobalHelper=function(d,h,m,w){o.registerHelper(d,h,w),p[d]._global.push({pred:m,val:w})}}function wu(o,s,p,d,h){var m=s,w=p,x=Zt(o,s.line),C=h&&o.direction=="rtl"?-p:p;function P(){var Qt=s.line+C;return Qt<o.first||Qt>=o.first+o.size?!1:(s=new Mt(Qt,s.ch,s.sticky),x=Zt(o,Qt))}function G(Qt){var Gt;if(d=="codepoint"){var ee=x.text.charCodeAt(s.ch+(p>0?0:-1));if(isNaN(ee))Gt=null;else{var ce=p>0?ee>=55296&&ee<56320:ee>=56320&&ee<57343;Gt=new Mt(s.line,Math.max(0,Math.min(x.text.length,s.ch+p*(ce?2:1))),-p)}}else h?Gt=rg(o.cm,x,s,p):Gt=pu(x,s,p);if(Gt==null)if(!Qt&&P())s=hu(h,o.cm,x,s.line,C);else return!1;else s=Gt;return!0}if(d=="char"||d=="codepoint")G();else if(d=="column")G(!0);else if(d=="word"||d=="group")for(var J=null,dt=d=="group",rt=o.cm&&o.cm.getHelper(s,"wordChars"),Ct=!0;!(p<0&&!G(!Ct));Ct=!1){var kt=x.text.charAt(s.ch)||` 18`,Ft=ot(kt,rt)?"w":dt&&kt==` 19`?"n":!dt||/\s/.test(kt)?null:"p";if(dt&&!Ct&&!Ft&&(Ft="s"),J&&J!=Ft){p<0&&(p=1,G(),s.sticky="after");break}if(Ft&&(J=Ft),p>0&&!G(!Ct))break}var Kt=bs(o,s,m,w,!0);return Un(m,Kt)&&(Kt.hitSide=!0),Kt}function sd(o,s,p,d){var h=o.doc,m=s.left,w;if(d=="page"){var x=Math.min(o.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),C=Math.max(x-.5*vo(o.display),3);w=(p>0?s.bottom:s.top)+p*C}else d=="line"&&(w=p>0?s.bottom+3:s.top-3);for(var P;P=Kl(o,m,w),!!P.outside;){if(p<0?w<=0:w>=h.height){P.hitSide=!0;break}w+=p*5}return P}var Re=function(o){this.cm=o,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new bt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Re.prototype.init=function(o){var s=this,p=this,d=p.cm,h=p.div=o.lineDiv;h.contentEditable=!0,od(h,d.options.spellcheck,d.options.autocorrect,d.options.autocapitalize);function m(x){for(var C=x.target;C;C=C.parentNode){if(C==h)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(C.className))break}return!1}ht(h,"paste",function(x){!m(x)||Bt(d,x)||nd(x,d)||c<=11&&setTimeout(wn(d,function(){return s.updateFromDOM()}),20)}),ht(h,"compositionstart",function(x){s.composing={data:x.data,done:!1}}),ht(h,"compositionupdate",function(x){s.composing||(s.composing={data:x.data,done:!1})}),ht(h,"compositionend",function(x){s.composing&&(x.data!=s.composing.data&&s.readFromDOMSoon(),s.composing.done=!0)}),ht(h,"touchstart",function(){return p.forceCompositionEnd()}),ht(h,"input",function(){s.composing||s.readFromDOMSoon()});function w(x){if(!(!m(x)||Bt(d,x))){if(d.somethingSelected())Es({lineWise:!1,text:d.getSelections()}),x.type=="cut"&&d.replaceSelection("",null,"cut");else if(d.options.lineWiseCopyCut){var C=id(d);Es({lineWise:!0,text:C.text}),x.type=="cut"&&d.operation(function(){d.setSelections(C.ranges,0,Ot),d.replaceSelection("",null,"cut")})}else return;if(x.clipboardData){x.clipboardData.clearData();var P=Hr.text.join(` 20`);if(x.clipboardData.setData("Text",P),x.clipboardData.getData("Text")==P){x.preventDefault();return}}var G=ad(),J=G.firstChild;d.display.lineSpace.insertBefore(G,d.display.lineSpace.firstChild),J.value=Hr.text.join(` 21`);var dt=gt();te(J),setTimeout(function(){d.display.lineSpace.removeChild(G),dt.focus(),dt==h&&p.showPrimarySelection()},50)}}ht(h,"copy",w),ht(h,"cut",w)},Re.prototype.screenReaderLabelChanged=function(o){o?this.div.setAttribute("aria-label",o):this.div.removeAttribute("aria-label")},Re.prototype.prepareSelection=function(){var o=qc(this.cm,!1);return o.focus=gt()==this.div,o},Re.prototype.showSelection=function(o,s){!o||!this.cm.display.view.length||((o.focus||s)&&this.showPrimarySelection(),this.showMultipleSelections(o))},Re.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Re.prototype.showPrimarySelection=function(){var o=this.getSelection(),s=this.cm,p=s.doc.sel.primary(),d=p.from(),h=p.to();if(s.display.viewTo==s.display.viewFrom||d.line>=s.display.viewTo||h.line<s.display.viewFrom){o.removeAllRanges();return}var m=Ps(s,o.anchorNode,o.anchorOffset),w=Ps(s,o.focusNode,o.focusOffset);if(!(m&&!m.bad&&w&&!w.bad&&fe(St(m,w),d)==0&&fe(X(m,w),h)==0)){var x=s.display.view,C=d.line>=s.display.viewFrom&&ld(s,d)||{node:x[0].measure.map[2],offset:0},P=h.line<s.display.viewTo&&ld(s,h);if(!P){var G=x[x.length-1].measure,J=G.maps?G.maps[G.maps.length-1]:G.map;P={node:J[J.length-1],offset:J[J.length-2]-J[J.length-3]}}if(!C||!P){o.removeAllRanges();return}var dt=o.rangeCount&&o.getRangeAt(0),rt;try{rt=et(C.node,C.offset,P.offset,P.node)}catch(Ct){}rt&&(!e&&s.state.focused?(o.collapse(C.node,C.offset),rt.collapsed||(o.removeAllRanges(),o.addRange(rt))):(o.removeAllRanges(),o.addRange(rt)),dt&&o.anchorNode==null?o.addRange(dt):e&&this.startGracePeriod()),this.rememberSelection()}},Re.prototype.startGracePeriod=function(){var o=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){o.gracePeriod=!1,o.selectionChanged()&&o.cm.operation(function(){return o.cm.curOp.selectionChanged=!0})},20)},Re.prototype.showMultipleSelections=function(o){I(this.cm.display.cursorDiv,o.cursors),I(this.cm.display.selectionDiv,o.selection)},Re.prototype.rememberSelection=function(){var o=this.getSelection();this.lastAnchorNode=o.anchorNode,this.lastAnchorOffset=o.anchorOffset,this.lastFocusNode=o.focusNode,this.lastFocusOffset=o.focusOffset},Re.prototype.selectionInEditor=function(){var o=this.getSelection();if(!o.rangeCount)return!1;var s=o.getRangeAt(0).commonAncestorContainer;return A(this.div,s)},Re.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||gt()!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Re.prototype.blur=function(){this.div.blur()},Re.prototype.getField=function(){return this.div},Re.prototype.supportsTouch=function(){return!0},Re.prototype.receivedFocus=function(){var o=this,s=this;this.selectionInEditor()?setTimeout(function(){return o.pollSelection()},20):ar(this.cm,function(){return s.cm.curOp.selectionChanged=!0});function p(){s.cm.state.focused&&(s.pollSelection(),s.polling.set(s.cm.options.pollInterval,p))}this.polling.set(this.cm.options.pollInterval,p)},Re.prototype.selectionChanged=function(){var o=this.getSelection();return o.anchorNode!=this.lastAnchorNode||o.anchorOffset!=this.lastAnchorOffset||o.focusNode!=this.lastFocusNode||o.focusOffset!=this.lastFocusOffset},Re.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var o=this.getSelection(),s=this.cm;if(N&&g&&this.cm.display.gutterSpecs.length&&Cg(o.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var p=Ps(s,o.anchorNode,o.anchorOffset),d=Ps(s,o.focusNode,o.focusOffset);p&&d&&ar(s,function(){Mn(s.doc,Oi(p,d),Ot),(p.bad||d.bad)&&(s.curOp.selectionChanged=!0)})}}},Re.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var o=this.cm,s=o.display,p=o.doc.sel.primary(),d=p.from(),h=p.to();if(d.ch==0&&d.line>o.firstLine()&&(d=Mt(d.line-1,Zt(o.doc,d.line-1).length)),h.ch==Zt(o.doc,h.line).text.length&&h.line<o.lastLine()&&(h=Mt(h.line+1,0)),d.line<s.viewFrom||h.line>s.viewTo-1)return!1;var m,w,x;d.line==s.viewFrom||(m=Ki(o,d.line))==0?(w=_e(s.view[0].line),x=s.view[0].node):(w=_e(s.view[m].line),x=s.view[m-1].node.nextSibling);var C=Ki(o,h.line),P,G;if(C==s.view.length-1?(P=s.viewTo-1,G=s.lineDiv.lastChild):(P=_e(s.view[C+1].line)-1,G=s.view[C+1].node.previousSibling),!x)return!1;for(var J=o.doc.splitLines(Sg(o,x,G,w,P)),dt=dn(o.doc,Mt(w,0),Mt(P,Zt(o.doc,P).text.length));J.length>1&&dt.length>1;)if(ue(J)==ue(dt))J.pop(),dt.pop(),P--;else if(J[0]==dt[0])J.shift(),dt.shift(),w++;else break;for(var rt=0,Ct=0,kt=J[0],Ft=dt[0],Kt=Math.min(kt.length,Ft.length);rt<Kt&&kt.charCodeAt(rt)==Ft.charCodeAt(rt);)++rt;for(var Qt=ue(J),Gt=ue(dt),ee=Math.min(Qt.length-(J.length==1?rt:0),Gt.length-(dt.length==1?rt:0));Ct<ee&&Qt.charCodeAt(Qt.length-Ct-1)==Gt.charCodeAt(Gt.length-Ct-1);)++Ct;if(J.length==1&&dt.length==1&&w==d.line)for(;rt&&rt>d.ch&&Qt.charCodeAt(Qt.length-Ct-1)==Gt.charCodeAt(Gt.length-Ct-1);)rt--,Ct++;J[J.length-1]=Qt.slice(0,Qt.length-Ct).replace(/^\u200b+/,""),J[0]=J[0].slice(rt).replace(/\u200b+$/,"");var ce=Mt(w,rt),se=Mt(P,dt.length?ue(dt).length-Ct:0);if(J.length>1||J[0]||fe(ce,se))return Co(o.doc,J,ce,se,"+input"),!0},Re.prototype.ensurePolled=function(){this.forceCompositionEnd()},Re.prototype.reset=function(){this.forceCompositionEnd()},Re.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Re.prototype.readFromDOMSoon=function(){var o=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(o.readDOMTimeout=null,o.composing)if(o.composing.done)o.composing=null;else return;o.updateFromDOM()},80))},Re.prototype.updateFromDOM=function(){var o=this;(this.cm.isReadOnly()||!this.pollContent())&&ar(this.cm,function(){return Wn(o.cm)})},Re.prototype.setUneditable=function(o){o.contentEditable="false"},Re.prototype.onKeyPress=function(o){o.charCode==0||this.composing||(o.preventDefault(),this.cm.isReadOnly()||wn(this.cm,_u)(this.cm,String.fromCharCode(o.charCode==null?o.keyCode:o.charCode),0))},Re.prototype.readOnlyChanged=function(o){this.div.contentEditable=String(o!="nocursor")},Re.prototype.onContextMenu=function(){},Re.prototype.resetPosition=function(){},Re.prototype.needsContentAttribute=!0;function ld(o,s){var p=st(o,s.line);if(!p||p.hidden)return null;var d=Zt(o.doc,s.line),h=Y(p,d,s.line),m=M(d,o.doc.direction),w="left";if(m){var x=V(m,s.ch);w=x%2?"right":"left"}var C=me(h.map,s.ch,w);return C.offset=C.collapse=="right"?C.end:C.start,C}function Cg(o){for(var s=o;s;s=s.parentNode)if(/CodeMirror-gutter-wrapper/.test(s.className))return!0;return!1}function Po(o,s){return s&&(o.bad=!0),o}function Sg(o,s,p,d,h){var m="",w=!1,x=o.doc.lineSeparator(),C=!1;function P(rt){return function(Ct){return Ct.id==rt}}function G(){w&&(m+=x,C&&(m+=x),w=C=!1)}function J(rt){rt&&(G(),m+=rt)}function dt(rt){if(rt.nodeType==1){var Ct=rt.getAttribute("cm-text");if(Ct){J(Ct);return}var kt=rt.getAttribute("cm-marker"),Ft;if(kt){var Kt=o.findMarks(Mt(d,0),Mt(h+1,0),P(+kt));Kt.length&&(Ft=Kt[0].find(0))&&J(dn(o.doc,Ft.from,Ft.to).join(x));return}if(rt.getAttribute("contenteditable")=="false")return;var Qt=/^(pre|div|p|li|table|br)$/i.test(rt.nodeName);if(!/^br$/i.test(rt.nodeName)&&rt.textContent.length==0)return;Qt&&G();for(var Gt=0;Gt<rt.childNodes.length;Gt++)dt(rt.childNodes[Gt]);/^(pre|p)$/i.test(rt.nodeName)&&(C=!0),Qt&&(w=!0)}else rt.nodeType==3&&J(rt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;dt(s),s!=p;)s=s.nextSibling,C=!1;return m}function Ps(o,s,p){var d;if(s==o.display.lineDiv){if(d=o.display.lineDiv.childNodes[p],!d)return Po(o.clipPos(Mt(o.display.viewTo-1)),!0);s=null,p=0}else for(d=s;;d=d.parentNode){if(!d||d==o.display.lineDiv)return null;if(d.parentNode&&d.parentNode==o.display.lineDiv)break}for(var h=0;h<o.display.view.length;h++){var m=o.display.view[h];if(m.node==d)return Og(m,s,p)}}function Og(o,s,p){var d=o.text.firstChild,h=!1;if(!s||!A(d,s))return Po(Mt(_e(o.line),0),!0);if(s==d&&(h=!0,s=d.childNodes[p],p=0,!s)){var m=o.rest?ue(o.rest):o.line;return Po(Mt(_e(m),m.text.length),h)}var w=s.nodeType==3?s:null,x=s;for(!w&&s.childNodes.length==1&&s.firstChild.nodeType==3&&(w=s.firstChild,p&&(p=w.nodeValue.length));x.parentNode!=d;)x=x.parentNode;var C=o.measure,P=C.maps;function G(Ft,Kt,Qt){for(var Gt=-1;Gt<(P?P.length:0);Gt++)for(var ee=Gt<0?C.map:P[Gt],ce=0;ce<ee.length;ce+=3){var se=ee[ce+2];if(se==Ft||se==Kt){var Se=_e(Gt<0?o.line:o.rest[Gt]),He=ee[ce]+Qt;return(Qt<0||se!=Ft)&&(He=ee[ce+(Qt?1:0)]),Mt(Se,He)}}}var J=G(w,x,p);if(J)return Po(J,h);for(var dt=x.nextSibling,rt=w?w.nodeValue.length-p:0;dt;dt=dt.nextSibling){if(J=G(dt,dt.firstChild,0),J)return Po(Mt(J.line,J.ch-rt),h);rt+=dt.textContent.length}for(var Ct=x.previousSibling,kt=p;Ct;Ct=Ct.previousSibling){if(J=G(Ct,Ct.firstChild,-1),J)return Po(Mt(J.line,J.ch+kt),h);kt+=Ct.textContent.length}}var nn=function(o){this.cm=o,this.prevInput="",this.pollingFast=!1,this.polling=new bt,this.hasSelection=!1,this.composing=null};nn.prototype.init=function(o){var s=this,p=this,d=this.cm;this.createField(o);var h=this.textarea;o.wrapper.insertBefore(this.wrapper,o.wrapper.firstChild),E&&(h.style.width="0px"),ht(h,"input",function(){u&&c>=9&&s.hasSelection&&(s.hasSelection=null),p.poll()}),ht(h,"paste",function(w){Bt(d,w)||nd(w,d)||(d.state.pasteIncoming=+new Date,p.fastPoll())});function m(w){if(!Bt(d,w)){if(d.somethingSelected())Es({lineWise:!1,text:d.getSelections()});else if(d.options.lineWiseCopyCut){var x=id(d);Es({lineWise:!0,text:x.text}),w.type=="cut"?d.setSelections(x.ranges,null,Ot):(p.prevInput="",h.value=x.text.join(` 22`),te(h))}else return;w.type=="cut"&&(d.state.cutIncoming=+new Date)}}ht(h,"cut",m),ht(h,"copy",m),ht(o.scroller,"paste",function(w){if(!(Ar(o,w)||Bt(d,w))){if(!h.dispatchEvent){d.state.pasteIncoming=+new Date,p.focus();return}var x=new Event("paste");x.clipboardData=w.clipboardData,h.dispatchEvent(x)}}),ht(o.lineSpace,"selectstart",function(w){Ar(o,w)||Oe(w)}),ht(h,"compositionstart",function(){var w=d.getCursor("from");p.composing&&p.composing.range.clear(),p.composing={start:w,range:d.markText(w,d.getCursor("to"),{className:"CodeMirror-composing"})}}),ht(h,"compositionend",function(){p.composing&&(p.poll(),p.composing.range.clear(),p.composing=null)})},nn.prototype.createField=function(o){this.wrapper=ad(),this.textarea=this.wrapper.firstChild},nn.prototype.screenReaderLabelChanged=function(o){o?this.textarea.setAttribute("aria-label",o):this.textarea.removeAttribute("aria-label")},nn.prototype.prepareSelection=function(){var o=this.cm,s=o.display,p=o.doc,d=qc(o);if(o.options.moveInputWithCursor){var h=Fr(o,p.sel.primary().head,"div"),m=s.wrapper.getBoundingClientRect(),w=s.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(s.wrapper.clientHeight-10,h.top+w.top-m.top)),d.teLeft=Math.max(0,Math.min(s.wrapper.clientWidth-10,h.left+w.left-m.left))}return d},nn.prototype.showSelection=function(o){var s=this.cm,p=s.display;I(p.cursorDiv,o.cursors),I(p.selectionDiv,o.selection),o.teTop!=null&&(this.wrapper.style.top=o.teTop+"px",this.wrapper.style.left=o.teLeft+"px")},nn.prototype.reset=function(o){if(!(this.contextMenuPending||this.composing)){var s=this.cm;if(s.somethingSelected()){this.prevInput="";var p=s.getSelection();this.textarea.value=p,s.state.focused&&te(this.textarea),u&&c>=9&&(this.hasSelection=p)}else o||(this.prevInput=this.textarea.value="",u&&c>=9&&(this.hasSelection=null))}},nn.prototype.getField=function(){return this.textarea},nn.prototype.supportsTouch=function(){return!1},nn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!z||gt()!=this.textarea))try{this.textarea.focus()}catch(o){}},nn.prototype.blur=function(){this.textarea.blur()},nn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},nn.prototype.receivedFocus=function(){this.slowPoll()},nn.prototype.slowPoll=function(){var o=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){o.poll(),o.cm.state.focused&&o.slowPoll()})},nn.prototype.fastPoll=function(){var o=!1,s=this;s.pollingFast=!0;function p(){var d=s.poll();!d&&!o?(o=!0,s.polling.set(60,p)):(s.pollingFast=!1,s.slowPoll())}s.polling.set(20,p)},nn.prototype.poll=function(){var o=this,s=this.cm,p=this.textarea,d=this.prevInput;if(this.contextMenuPending||!s.state.focused||We(p)&&!d&&!this.composing||s.isReadOnly()||s.options.disableInput||s.state.keySeq)return!1;var h=p.value;if(h==d&&!s.somethingSelected())return!1;if(u&&c>=9&&this.hasSelection===h||R&&/[\uf700-\uf7ff]/.test(h))return s.display.input.reset(),!1;if(s.doc.sel==s.display.selForContextMenu){var m=h.charCodeAt(0);if(m==8203&&!d&&(d="\u200B"),m==8666)return this.reset(),this.cm.execCommand("undo")}for(var w=0,x=Math.min(d.length,h.length);w<x&&d.charCodeAt(w)==h.charCodeAt(w);)++w;return ar(s,function(){_u(s,h.slice(w),d.length-w,null,o.composing?"*compose":null),h.length>1e3||h.indexOf(` 23`)>-1?p.value=o.prevInput="":o.prevInput=h,o.composing&&(o.composing.range.clear(),o.composing.range=s.markText(o.composing.start,s.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},nn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},nn.prototype.onKeyPress=function(){u&&c>=9&&(this.hasSelection=null),this.fastPoll()},nn.prototype.onContextMenu=function(o){var s=this,p=s.cm,d=p.display,h=s.textarea;s.contextMenuPending&&s.contextMenuPending();var m=zi(p,o),w=d.scroller.scrollTop;if(!m||y)return;var x=p.options.resetSelectionOnContextMenu;x&&p.doc.sel.contains(m)==-1&&wn(p,Mn)(p.doc,Oi(m),Ot);var C=h.style.cssText,P=s.wrapper.style.cssText,G=s.wrapper.offsetParent.getBoundingClientRect();s.wrapper.style.cssText="position: static",h.style.cssText=`position: absolute; width: 30px; height: 30px; 24 top: `+(o.clientY-G.top-5)+"px; left: "+(o.clientX-G.left-5)+`px; 25 z-index: 1000; background: `+(u?"rgba(255, 255, 255, .05)":"transparent")+`; 26 outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var J;f&&(J=window.scrollY),d.input.focus(),f&&window.scrollTo(null,J),d.input.reset(),p.somethingSelected()||(h.value=s.prevInput=" "),s.contextMenuPending=rt,d.selForContextMenu=p.doc.sel,clearTimeout(d.detectingSelectAll);function dt(){if(h.selectionStart!=null){var kt=p.somethingSelected(),Ft="\u200B"+(kt?h.value:"");h.value="\u21DA",h.value=Ft,s.prevInput=kt?"":"\u200B",h.selectionStart=1,h.selectionEnd=Ft.length,d.selForContextMenu=p.doc.sel}}function rt(){if(s.contextMenuPending==rt&&(s.contextMenuPending=!1,s.wrapper.style.cssText=P,h.style.cssText=C,u&&c<9&&d.scrollbars.setScrollTop(d.scroller.scrollTop=w),h.selectionStart!=null)){(!u||u&&c<9)&&dt();var kt=0,Ft=function(){d.selForContextMenu==p.doc.sel&&h.selectionStart==0&&h.selectionEnd>0&&s.prevInput=="\u200B"?wn(p,Tf)(p):kt++<10?d.detectingSelectAll=setTimeout(Ft,500):(d.selForContextMenu=null,d.input.reset())};d.detectingSelectAll=setTimeout(Ft,200)}}if(u&&c>=9&&dt(),ut){j(o);var Ct=function(){Yt(window,"mouseup",Ct),setTimeout(rt,20)};ht(window,"mouseup",Ct)}else setTimeout(rt,50)},nn.prototype.readOnlyChanged=function(o){o||this.reset(),this.textarea.disabled=o=="nocursor",this.textarea.readOnly=!!o},nn.prototype.setUneditable=function(){},nn.prototype.needsContentAttribute=!1;function Tg(o,s){if(s=s?he(s):{},s.value=o.value,!s.tabindex&&o.tabIndex&&(s.tabindex=o.tabIndex),!s.placeholder&&o.placeholder&&(s.placeholder=o.placeholder),s.autofocus==null){var p=gt();s.autofocus=p==o||o.getAttribute("autofocus")!=null&&p==document.body}function d(){o.value=x.getValue()}var h;if(o.form&&(ht(o.form,"submit",d),!s.leaveSubmitMethodAlone)){var m=o.form;h=m.submit;try{var w=m.submit=function(){d(),m.submit=h,m.submit(),m.submit=w}}catch(C){}}s.finishInit=function(C){C.save=d,C.getTextArea=function(){return o},C.toTextArea=function(){C.toTextArea=isNaN,d(),o.parentNode.removeChild(C.getWrapperElement()),o.style.display="",o.form&&(Yt(o.form,"submit",d),!s.leaveSubmitMethodAlone&&typeof o.form.submit=="function"&&(o.form.submit=h))}},o.style.display="none";var x=Ge(function(C){return o.parentNode.insertBefore(C,o.nextSibling)},s);return x}function Eg(o){o.off=Yt,o.on=ht,o.wheelEventPixels=jv,o.Doc=zn,o.splitLines=Fe,o.countColumn=mt,o.findColumn=Nt,o.isWordChar=$,o.Pass=wt,o.signal=qt,o.Line=_n,o.changeEnd=Ti,o.scrollbarModel=ef,o.Pos=Mt,o.cmpPos=fe,o.modes=hr,o.mimeModes=Ve,o.resolveMode=tr,o.getMode=Ae,o.modeExtensions=Dn,o.extendMode=ve,o.copyState=On,o.startState=jn,o.innerMode=en,o.commands=wa,o.keyMap=ni,o.keyName=Bf,o.isModifierKey=Hf,o.lookupKey=Oo,o.normalizeKeyMap=ng,o.Str
26ingStream=ke,o.SharedTextMarker=ya,o.TextMarker=Pi,o.LineWidget=ga,o.e_preventDefault=Oe,o.e_stopPropagation=qe,o.e_stop=j,o.addClass=yt,o.contains=A,o.rmClass=lt,o.keyNames=Ai}mg(Ge),xg(Ge);var Pg="iter insert remove copy getEditor constructor".split(" ");for(var As in zn.prototype)zn.prototype.hasOwnProperty(As)&&It(Pg,As)<0&&(Ge.prototype[As]=(function(o){return function(){return o.apply(this.doc,arguments)}})(zn.prototype[As]));return Pe(zn),Ge.inputStyles={textarea:nn,contenteditable:Re},Ge.defineMode=function(o){!Ge.defaults.mode&&o!="null"&&(Ge.defaults.mode=o),Ke.apply(this,arguments)},Ge.defineMIME=Ye,Ge.defineMode("null",function(){return{token:function(o){return o.skipToEnd()}}}),Ge.defineMIME("text/plain","null"),Ge.defineExtension=function(o,s){Ge.prototype[o]=s},Ge.defineDocExtension=function(o,s){zn.prototype[o]=s},Ge.fromTextArea=Tg,Eg(Ge),Ge.version="5.63.0",Ge})}),656:((a,r,t)=>{(function(e){e(t(237))})(function(e){"use strict";e.defineMode("css",function(H,I){var B=I.inline;I.propertyKeywords||(I=e.resolveMode("text/css"));var U=H.indentUnit,et=I.tokenHooks,A=I.documentTypes||{},gt=I.mediaTypes||{},yt=I.mediaFeatures||{},jt=I.mediaValueKeywords||{},te=I.propertyKeywords||{},Xt=I.nonStandardPropertyKeywords||{},he=I.fontProperties||{},mt=I.counterDescriptors||{},bt=I.colorKeywords||{},It=I.valueKeywords||{},nt=I.allowNested,wt=I.lineComment,Ot=I.supportsAtComponent===!0,Ht=H.highlightNonStandardPropertyKeywords!==!1,Vt,Nt;function Jt(K,ft){return Vt=ft,K}function Ee(K,ft){var it=K.next();if(et[it]){var ne=et[it](K,ft);if(ne!==!1)return ne}if(it=="@")return K.eatWhile(/[\w\\\-]/),Jt("def",K.current());if(it=="="||(it=="~"||it=="|")&&K.eat("="))return Jt(null,"compare");if(it=='"'||it=="'")return ft.tokenize=ue(it),ft.tokenize(K,ft);if(it=="#")return K.eatWhile(/[\w\\\-]/),Jt("atom","hash");if(it=="!")return K.match(/^\s*\w*/),Jt("keyword","important");if(/\d/.test(it)||it=="."&&K.eat(/\d/))return K.eatWhile(/[\w.%]/),Jt("number","unit");if(it==="-"){if(/[\d.]/.test(K.peek()))return K.eatWhile(/[\w.%]/),Jt("number","unit");if(K.match(/^-[\w\\\-]*/))return K.eatWhile(/[\w\\\-]/),K.match(/^\s*:/,!1)?Jt("variable-2","variable-definition"):Jt("variable-2","variable");if(K.match(/^\w+-/))return Jt("meta","meta")}else return/[,+>*\/]/.test(it)?Jt(null,"select-op"):it=="."&&K.match(/^-?[_a-z][_a-z0-9-]*/i)?Jt("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(it)?Jt(null,it):K.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(K.current())&&(ft.tokenize=Be),Jt("variable callee","variable")):/[\w\\\-]/.test(it)?(K.eatWhile(/[\w\\\-]/),Jt("property","word")):Jt(null,null)}function ue(K){return function(ft,it){for(var ne=!1,ye;(ye=ft.next())!=null;){if(ye==K&&!ne){K==")"&&ft.backUp(1);break}ne=!ne&&ye=="\\"}return(ye==K||!ne&&K!=")")&&(it.tokenize=null),Jt("string","string")}}function Be(K,ft){return K.next(),K.match(/^\s*[\"\')]/,!1)?ft.tokenize=null:ft.tokenize=ue(")"),Jt(null,"(")}function je(K,ft,it){this.type=K,this.indent=ft,this.prev=it}function pe(K,ft,it,ne){return K.context=new je(it,ft.indentation()+(ne===!1?0:U),K.context),it}function T(K){return K.context.prev&&(K.context=K.context.prev),K.context.type}function F(K,ft,it){return vt[it.context.type](K,ft,it)}function $(K,ft,it,ne){for(var ye=ne||1;ye>0;ye--)it.context=it.context.prev;return F(K,ft,it)}function ot(K){var ft=K.current().toLowerCase();It.hasOwnProperty(ft)?Nt="atom":bt.hasOwnProperty(ft)?Nt="keyword":Nt="variable"}var vt={};return vt.top=function(K,ft,it){if(K=="{")return pe(it,ft,"block");if(K=="}"&&it.context.prev)return T(it);if(Ot&&/@component/i.test(K))return pe(it,ft,"atComponentBlock");if(/^@(-moz-)?document$/i.test(K))return pe(it,ft,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(K))return pe(it,ft,"atBlock");if(/^@(font-face|counter-style)/i.test(K))return it.stateArg=K,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(K))return"keyframes";if(K&&K.charAt(0)=="@")return pe(it,ft,"at");if(K=="hash")Nt="builtin";else if(K=="word")Nt="tag";else{if(K=="variable-definition")return"maybeprop";if(K=="interpolation")return pe(it,ft,"interpolation");if(K==":")return"pseudo";if(nt&&K=="(")return pe(it,ft,"parens")}return it.context.type},vt.block=function(K,ft,it){if(K=="word"){var ne=ft.current().toLowerCase();return te.hasOwnProperty(ne)?(Nt="property","maybeprop"):Xt.hasOwnProperty(ne)?(Nt=Ht?"string-2":"property","maybeprop"):nt?(Nt=ft.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(Nt+=" error","maybeprop")}else return K=="meta"?"block":!nt&&(K=="hash"||K=="qualifier")?(Nt="error","block"):vt.top(K,ft,it)},vt.maybeprop=function(K,ft,it){return K==":"?pe(it,ft,"prop"):F(K,ft,it)},vt.prop=function(K,ft,it){if(K==";")return T(it);if(K=="{"&&nt)return pe(it,ft,"propBlock");if(K=="}"||K=="{")return $(K,ft,it);if(K=="(")return pe(it,ft,"parens");if(K=="hash"&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(ft.current()))Nt+=" error";else if(K=="word")ot(ft);else if(K=="interpolation")return pe(it,ft,"interpolation");return"prop"},vt.propBlock=function(K,ft,it){return K=="}"?T(it):K=="word"?(Nt="property","maybeprop"):it.context.type},vt.parens=function(K,ft,it){return K=="{"||K=="}"?$(K,ft,it):K==")"?T(it):K=="("?pe(it,ft,"parens"):K=="interpolation"?pe(it,ft,"interpolation"):(K=="word"&&ot(ft),"parens")},vt.pseudo=function(K,ft,it){return K=="meta"?"pseudo":K=="word"?(Nt="variable-3",it.context.type):F(K,ft,it)},vt.documentTypes=function(K,ft,it){return K=="word"&&A.hasOwnProperty(ft.current())?(Nt="tag",it.context.type):vt.atBlock(K,ft,it)},vt.atBlock=function(K,ft,it){if(K=="(")return pe(it,ft,"atBlock_parens");if(K=="}"||K==";")return $(K,ft,it);if(K=="{")return T(it)&&pe(it,ft,nt?"block":"top");if(K=="interpolation")return pe(it,ft,"interpolation");if(K=="word"){var ne=ft.current().toLowerCase();ne=="only"||ne=="not"||ne=="and"||ne=="or"?Nt="keyword":gt.hasOwnProperty(ne)?Nt="attribute":yt.hasOwnProperty(ne)?Nt="property":jt.hasOwnProperty(ne)?Nt="keyword":te.hasOwnProperty(ne)?Nt="property":Xt.hasOwnProperty(ne)?Nt=Ht?"string-2":"property":It.hasOwnProperty(ne)?Nt="atom":bt.hasOwnProperty(ne)?Nt="keyword":Nt="error"}return it.context.type},vt.atComponentBlock=function(K,ft,it){return K=="}"?$(K,ft,it):K=="{"?T(it)&&pe(it,ft,nt?"block":"top",!1):(K=="word"&&(Nt="error"),it.context.type)},vt.atBlock_parens=function(K,ft,it){return K==")"?T(it):K=="{"||K=="}"?$(K,ft,it,2):vt.atBlock(K,ft,it)},vt.restricted_atBlock_before=function(K,ft,it){return K=="{"?pe(it,ft,"restricted_atBlock"):K=="word"&&it.stateArg=="@counter-style"?(Nt="variable","restricted_atBlock_before"):F(K,ft,it)},vt.restricted_atBlock=function(K,ft,it){return K=="}"?(it.stateArg=null,T(it)):K=="word"?(it.stateArg=="@font-face"&&!he.hasOwnProperty(ft.current().toLowerCase())||it.
vendor: 6,241 bytes, line 26
26stateArg=="@counter-style"&&!mt.hasOwnProperty(ft.current().toLowerCase())?Nt="error":Nt="property","maybeprop"):"restricted_atBlock"},vt.keyframes=function(K,ft,it){return K=="word"?(Nt="variable","keyframes"):K=="{"?pe(it,ft,"top"):F(K,ft,it)},vt.at=function(K,ft,it){return K==";"?T(it):K=="{"||K=="}"?$(K,ft,it):(K=="word"?Nt="tag":K=="hash"&&(Nt="builtin"),"at")},vt.interpolation=function(K,ft,it){return K=="}"?T(it):K=="{"||K==";"?$(K,ft,it):(K=="word"?Nt="variable":K!="variable"&&K!="("&&K!=")"&&(Nt="error"),"interpolation")},{startState:function(K){return{tokenize:null,state:B?"block":"top",stateArg:null,context:new je(B?"block":"top",K||0,null)}},token:function(K,ft){if(!ft.tokenize&&K.eatSpace())return null;var it=(ft.tokenize||Ee)(K,ft);return it&&typeof it=="object"&&(Vt=it[1],it=it[0]),Nt=it,Vt!="comment"&&(ft.state=vt[ft.state](Vt,K,ft)),Nt},indent:function(K,ft){var it=K.context,ne=ft&&ft.charAt(0),ye=it.indent;return it.type=="prop"&&(ne=="}"||ne==")")&&(it=it.prev),it.prev&&(ne=="}"&&(it.type=="block"||it.type=="top"||it.type=="interpolation"||it.type=="restricted_atBlock")?(it=it.prev,ye=it.indent):(ne==")"&&(it.type=="parens"||it.type=="atBlock_parens")||ne=="{"&&(it.type=="at"||it.type=="atBlock"))&&(ye=Math.max(0,it.indent-U))),ye},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:wt,fold:"brace"}});function n(H){for(var I={},B=0;B<H.length;++B)I[H[B].toLowerCase()]=!0;return I}var i=["domain","regexp","url","url-prefix"],l=n(i),u=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],c=n(u),f=["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"],v=n(f),g=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light"],y=n(g),_=["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","
26nav-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"],b=n(_),S=["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"],E=n(S),N=["font-display","font-family","src","unicode
26-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],z=n(N),R=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],W=n(R),ct=["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"],_t=n(ct),xt=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","
26initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],ut=n(xt),q=i.concat(u).
26concat(f).concat(g).concat(_).concat(S).concat(ct).concat(xt);e.registerHelper("hintWords","css",q);function lt(H,I){for(var B=!1,U;(U=H.next())!=null;){if(B&&U=="/"){I.tokenize=null;break}B=U=="*"}return["comment","comment"]}e.defineMIME("text/css",{documentTypes:l,mediaTypes:c,mediaFeatures:v,mediaValueKeywords:y,propertyKeywords:b,nonStandardPropertyKeywords:E,fontProperties:z,counterDescriptors:W,colorKeywords:_t,valueKeywords:ut,tokenHooks:{"/":function(H,I){return H.eat("*")?(I.tokenize=lt,lt(H,I)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:c,mediaFeatures:v,mediaValueKeywords:y,propertyKeywords:b,nonStandardPropertyKeywords:E,colorKeywords:_t,valueKeywords:ut,fontProperties:z,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(H,I){return H.eat("/")?(H.skipToEnd(),["comment","comment"]):H.eat("*")?(I.tokenize=lt,lt(H,I)):["operator","operator"]},":":function(H){return H.match(/^\s*\{/,!1)?[null,null]:!1},$:function(H){return H.match(/^[\w-]+/),H.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(H){return H.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:c,mediaFeatures:v,mediaValueKeywords:y,propertyKeywords:b,nonStandardPropertyKeywords:E,colorKeywords:_t,valueKeywords:ut,fontProperties:z,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(H,I){return H.eat("/")?(H.skipToEnd(),["comment","comment"]):H.eat("*")?(I.tokenize=lt,lt(H,I)):["operator","operator"]},"@":function(H){return H.eat("{")?[null,"interpolation"]:H.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(H.eatWhile(/[\w\\\-]/),H.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:l,mediaTypes:c,mediaFeatures:v,propertyKeywords:b,nonStandardPropertyKeywords:E,fontProperties:z,counterDescriptors:W,colorKeywords:_t,valueKeywords:ut,supportsAtComponent:!0,tokenHooks:{"/":function(H,I){return H.eat("*")?(I.tokenize=lt,lt(H,I)):!1}},name:"css",helperType:"gss"})})}),520:((a,r,t)=>{(function(e){e(t(237),t(576),t(792),t(656))})(function(e){"use strict";var n={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 i(y,_,b){var S=y.current(),E=S.search(_);return E>-1?y.backUp(S.length-E):S.match(/<\/?$/)&&(y.backUp(S.length),y.match(_,!1)||y.match(S)),b}var l={};function u(y){var _=l[y];return _||(l[y]=new RegExp("\\s+"+y+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function c(y,_){var b=y.match(u(_));return b?/^\s*(.*?)\s*$/.exec(b[2])[1]:""}function f(y,_){return new RegExp((_?"^":"")+"</s*"+y+"s*>","i")}function v(y,_){for(var b in y)for(var S=_[b]||(_[b]=[]),E=y[b],N=E.length-1;N>=0;N--)S.unshift(E[N])}function g(y,_){for(var b=0;b<y.length;b++){var S=y[b];if(!S[0]||S[1].test(c(_,S[0])))return S[2]}}e.defineMode("htmlmixed",function(y,_){var b=e.getMode(y,{name:"xml",htmlMode:!0,multilineTagIndentFactor:_.multilineTagIndentFactor,multilineTagIndentPastTag:_.multilineTagIndentPastTag,allowMissingTagName:_.allowMissingTagName}),S={},E=_&&_.tags,N=_&&_.scriptTypes;if(v(n,S),E&&v(E,S),N)for(var z=N.length-1;z>=0;z--)S.script.unshift(["type",N[z].matches,N[z].mode]);function R(W,ct){var _t=b.token(W,ct.htmlState),xt=/\btag\b/.test(_t),ut;if(xt&&!/[<>\s\/]/.test(W.current())&&(ut=ct.htmlState.tagName&&ct.htmlState.tagName.toLowerCase())&&S.hasOwnProperty(ut))ct.inTag=ut+" ";else if(ct.inTag&&xt&&/>$/.test(W.current())){var q=/^([\S]+) (.*)/.exec(ct.inTag);ct.inTag=null;var lt=W.current()==">"&&g(S[q[1]],q[2]),H=e.getMode(y,lt),I=f(q[1],!0),B=f(q[1],!1);ct.token=function(U,et){return U.match(I,!1)?(et.token=R,et.localState=et.localMode=null,null):i(U,B,et.localMode.token(U,et.localState))},ct.localMode=H,ct.localState=e.startState(H,b.indent(ct.htmlState,"",""))}else ct.inTag&&(ct.inTag+=W.current(),W.eol()&&(ct.inTag+=" "));return _t}return{startState:function(){var W=e.startState(b);return{token:R,inTag:null,localMode:null,localState:null,htmlState:W}},copyState:function(W){var ct;return W.localState&&(ct=e.copyState(W.localMode,W.localState)),{token:W.token,inTag:W.inTag,localMode:W.localMode,localState:ct,htmlState:e.copyState(b,W.htmlState)}},token:function(W,ct){return ct.token(W,ct)},indent:function(W,ct,_t){return!W.localMode||/^\s*<\//.test(ct)?b.indent(W.htmlState,ct,_t):W.localMode.indent?W.localMode.indent(W.localState,ct,_t):e.Pass},innerMode:function(W){return{state:W.localState||W.htmlState,mode:W.localMode||b}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")})}),792:((a,r,t)=>
vendor: 7,485 bytes, line 26
26{(function(e){e(t(237))})(function(e){"use strict";e.defineMode("javascript",function(n,i){var l=n.indentUnit,u=i.statementIndent,c=i.jsonld,f=i.json||c,v=i.trackScope!==!1,g=i.typescript,y=i.wordCharacters||/[\w$\xa1-\uffff]/,_=(function(){function L(Le){return{type:Le,style:"keyword"}}var X=L("keyword a"),St=L("keyword b"),Dt=L("keyword c"),Rt=L("keyword d"),xe=L("operator"),Te={type:"atom",style:"atom"};return{if:L("if"),while:X,with:X,else:St,do:St,try:St,finally:St,return:Rt,break:Rt,continue:Rt,new:L("new"),delete:Dt,void:Dt,throw:Dt,debugger:L("debugger"),var:L("var"),const:L("var"),let:L("var"),function:L("function"),catch:L("catch"),for:L("for"),switch:L("switch"),case:L("case"),default:L("default"),in:xe,typeof:xe,instanceof:xe,true:Te,false:Te,null:Te,undefined:Te,NaN:Te,Infinity:Te,this:L("this"),class:L("class"),super:L("atom"),yield:Dt,export:L("export"),import:L("import"),extends:Dt,await:Dt}})(),b=/[+\-*&%=<>!?|~^@]/,S=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function E(L){for(var X=!1,St,Dt=!1;(St=L.next())!=null;){if(!X){if(St=="/"&&!Dt)return;St=="["?Dt=!0:Dt&&St=="]"&&(Dt=!1)}X=!X&&St=="\\"}}var N,z;function R(L,X,St){return N=L,z=St,X}function W(L,X){var St=L.next();if(St=='"'||St=="'")return X.tokenize=ct(St),X.tokenize(L,X);if(St=="."&&L.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return R("number","number");if(St=="."&&L.match(".."))return R("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(St))return R(St);if(St=="="&&L.eat(">"))return R("=>","operator");if(St=="0"&&L.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return R("number","number");if(/\d/.test(St))return L.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),R("number","number");if(St=="/")return L.eat("*")?(X.tokenize=_t,_t(L,X)):L.eat("/")?(L.skipToEnd(),R("comment","comment")):Un(L,X,1)?(E(L),L.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),R("regexp","string-2")):(L.eat("="),R("operator","operator",L.current()));if(St=="`")return X.tokenize=xt,xt(L,X);if(St=="#"&&L.peek()=="!")return L.skipToEnd(),R("meta","meta");if(St=="#"&&L.eatWhile(y))return R("variable","property");if(St=="<"&&L.match("!--")||St=="-"&&L.match("->")&&!/\S/.test(L.string.slice(0,L.start)))return L.skipToEnd(),R("comment","comment");if(b.test(St))return(St!=">"||!X.lexical||X.lexical.type!=">")&&(L.eat("=")?(St=="!"||St=="=")&&L.eat("="):/[<>*+\-|&?]/.test(St)&&(L.eat(St),St==">"&&L.eat(St))),St=="?"&&L.eat(".")?R("."):R("operator","operator",L.current());if(y.test(St)){L.eatWhile(y);var Dt=L.current();if(X.lastType!="."){if(_.propertyIsEnumerable(Dt)){var Rt=_[Dt];return R(Rt.type,Rt.style,Dt)}if(Dt=="async"&&L.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return R("async","keyword",Dt)}return R("variable","variable",Dt)}}function ct(L){return function(X,St){var Dt=!1,Rt;if(c&&X.peek()=="@"&&X.match(S))return St.tokenize=W,R("jsonld-keyword","meta");for(;(Rt=X.next())!=null&&!(Rt==L&&!Dt);)Dt=!Dt&&Rt=="\\";return Dt||(St.tokenize=W),R("string","string")}}function _t(L,X){for(var St=!1,Dt;Dt=L.next();){if(Dt=="/"&&St){X.tokenize=W;break}St=Dt=="*"}return R("comment","comment")}function xt(L,X){for(var St=!1,Dt;(Dt=L.next())!=null;){if(!St&&(Dt=="`"||Dt=="$"&&L.eat("{"))){X.tokenize=W;break}St=!St&&Dt=="\\"}return R("quasi","string-2",L.current())}var ut="([{}])";function q(L,X){X.fatArrowAt&&(X.fatArrowAt=null);var St=L.string.indexOf("=>",L.start);if(!(St<0)){if(g){var Dt=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(L.string.slice(L.start,St));Dt&&(St=Dt.index)}for(var Rt=0,xe=!1,Te=St-1;Te>=0;--Te){var Le=L.string.charAt(Te),Ie=ut.indexOf(Le);if(Ie>=0&&Ie<3){if(!Rt){++Te;break}if(--Rt==0){Le=="("&&(xe=!0);break}}else if(Ie>=3&&Ie<6)++Rt;else if(y.test(Le))xe=!0;else if(/["'\/`]/.test(Le))for(;;--Te){if(Te==0)return;var ui=L.string.charAt(Te-1);if(ui==Le&&L.string.charAt(Te-2)!="\\"){Te--;break}}else if(xe&&!Rt){++Te;break}}xe&&!Rt&&(X.fatArrowAt=Te)}}var lt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function H(L,X,St,Dt,Rt,xe){this.indented=L,this.column=X,this.type=St,this.prev=Rt,this.info=xe,Dt!=null&&(this.align=Dt)}function I(L,X){if(!v)return!1;for(var St=L.localVars;St;St=St.next)if(St.name==X)return!0;for(var Dt=L.context;Dt;Dt=Dt.prev)for(var St=Dt.vars;St;St=St.next)if(St.name==X)return!0}function B(L,X,St,Dt,Rt){var xe=L.cc;for(U.state=L,U.stream=Rt,U.marked=null,U.cc=xe,U.style=X,L.lexical.hasOwnProperty("align")||(L.lexical.align=!0);;){var Te=xe.length?xe.pop():f?Jt:Vt;if(Te(St,Dt)){for(;xe.length&&xe[xe.length-1].lex;)xe.pop()();return U.marked?U.marked:St=="variable"&&I(L,Dt)?"variable-2":X}}}var U={state:null,column:null,marked:null,cc:null};function et(){for(var L=arguments.length-1;L>=0;L--)U.cc.push(arguments[L])}function A(){return et.apply(null,arguments),!0}function gt(L,X){for(var St=X;St;St=St.next)if(St.name==L)return!0;return!1}function yt(L){var X=U.state;if(U.marked="def",!!v){if(X.context){if(X.lexical.info=="var"&&X.context&&X.context.block){var St=jt(L,X.context);if(St!=null){X.context=St;return}}else if(!gt(L,X.localVars)){X.localVars=new he(L,X.localVars);return}}i.globalVars&&!gt(L,X.globalVars)&&(X.globalVars=new he(L,X.globalVars))}}function jt(L,X){if(X)if(X.block){var St=jt(L,X.prev);return St?St==X.prev?X:new Xt(St,X.vars,!0):null}else return gt(L,X.vars)?X:new Xt(X.prev,new he(L,X.vars),!1);else return null}function te(L){return L=="public"||L=="private"||L=="protected"||L=="abstract"||L=="readonly"}function Xt(L,X,St){this.prev=L,this.vars=X,this.block=St}function he(L,X){this.name=L,this.next=X}var mt=new he("this",new he("arguments",null));function bt(){U.state.context=new Xt(U.state.context,U.state.localVars,!1),U.state.localVars=mt}function It(){U.state.context=new Xt(U.state.context,U.state.localVars,!0),U.state.localVars=null}function nt(){U.state.localVars=U.state.context.vars,U.state.context=U.state.context.prev}nt.lex=!0;function wt(L,X){var St=function(){var Dt=U.state,Rt=Dt.indented;if(Dt.lexical.type=="stat")Rt=Dt.lexical.indented;else for(var xe=Dt.lexical;xe&&xe.type==")"&&xe.align;xe=xe.prev)Rt=xe.indented;Dt.lexical=new H(Rt,U.stream.column(),L,null,Dt.lexical,X)};return St.lex=!0,St}function Ot(){var L=U.state;L.lexical.prev&&(L.lexical.type==")"&&(L.indented=L.lexical.indented),L.lexical=L.lexical.prev)}Ot.lex=!0;function Ht(L){function X(St){return St==L?A():L==";"||St=="}"||St==")"||St=="]"?et():A(X)}return X}function Vt(L,X){return L=="var"?A(wt("vardef",X),ie,Ht(";"),Ot):L=="keyword a"?A(wt("form"),ue,Vt,Ot):L=="keyword b"?A(wt("form"),Vt,Ot):L=="keyword d"?U.stream.match(/^\s*$/,!1)?A():A(wt("stat"),je,Ht(";"),Ot):L=="debugger"?A(Ht(";")):L=="{"?A(wt("}"),It,ht,Ot,nt):L==";"?A():L=="if"?(U.state.lexical.info=="else"&&U.state.cc[U.state.cc.length-1]==Ot&&U.state.cc.pop()(),A(wt("form"),ue,Vt,Ot,fn)):L=="function"?A(Ke):L=="for"?A(wt("form"),It,ze,Vt,nt,Ot):L=="class"||g&&X=="interface"?(U.marked="keyword",A(wt("form",L=="class"?L:X),ve,Ot)):L=="variable"?g&&X=="declare"?(U.marked="keyword",A(Vt)):g&&(X=="module"||X=="enum"||X=="type")&&U.stream.match(/^\s*\w/,!1)?(U.marked="keyword",X=="enum"?A(gr):X=="type"?A(tr,Ht("operator"),re,Ht(";")):A(wt("form"),ge,Ht("{"),wt("}"),ht,Ot,Ot)):g&&X=="namespace"?(U.marked="keyword",A(wt("form"),Jt,Vt,Ot)):g&&X=="abstract"?(U.marked="keyword",A(Vt)):A(wt("stat"),ne):L=="switch"?A(wt("form"),ue,Ht("{"),wt("}","switch"),It,ht,Ot,Ot,nt):L=="case"?A(Jt,Ht(":")):L=="default"?A(Ht(":")):L=="c
26atch"?A(wt("form"),bt,Nt,Vt,Ot,nt):L=="export"?A(wt("stat"),ke,Ot):L=="import"?A(wt("stat"),dn,Ot):L=="async"?A(Vt):X=="@"?A(Jt,Vt):et(wt("stat"),Jt,Ht(";"),Ot)}function Nt(L){if(L=="(")return A(Ae,Ht(")"))}function Jt(L,X){return Be(L,X,!1)}function Ee(L,X){return Be(L,X,!0)}function ue(L){return L!="("?et():A(wt(")"),je,Ht(")"),Ot)}function Be(L,X,St){if(U.state.fatArrowAt==U.stream.start){var Dt=St?vt:ot;if(L=="(")return A(bt,wt(")"),M(Ae,")"),Ot,Ht("=>"),Dt,nt);if(L=="variable")return et(bt,ge,Ht("=>"),Dt,nt)}var Rt=St?T:pe;return lt.hasOwnProperty(L)?A(Rt):L=="function"?A(Ke,Rt):L=="class"||g&&X=="interface"?(U.marked="keyword",A(wt("form"),Dn,Ot)):L=="keyword c"||L=="async"?A(St?Ee:Jt):L=="("?A(wt(")"),je,Ht(")"),Ot,Rt):L=="operator"||L=="spread"?A(St?Ee:Jt):L=="["?A(wt("]"),vr,Ot,Rt):L=="{"?Tt(de,"}",null,Rt):L=="quasi"?et(F,Rt):L=="new"?A(K(St)):A()}function je(L){return L.match(/[;\}\)\],]/)?et():et(Jt)}function pe(L,X){return L==","?A(je):T(L,X,!1)}function T(L,X,St){var Dt=St==!1?pe:T,Rt=St==!1?Jt:Ee;if(L=="=>")return A(bt,St?vt:ot,nt);if(L=="operator")return/\+\+|--/.test(X)||g&&X=="!"?A(Dt):g&&X=="<"&&U.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?A(wt(">"),M(re,">"),Ot,Dt):X=="?"?A(Jt,Ht(":"),Rt):A(Rt);if(L=="quasi")return et(F,Dt);if(L!=";"){if(L=="(")return Tt(Ee,")","call",Dt);if(L==".")return A(ye,Dt);if(L=="[")return A(wt("]"),je,Ht("]"),Ot,Dt);if(g&&X=="as")return U.marked="keyword",A(re,Dt);if(L=="regexp")return U.state.lastType=U.marked="operator",U.stream.backUp(U.stream.pos-U.stream.start-1),A(Rt)}}function F(L,X){return L!="quasi"?et():X.slice(X.length-2)!="${"?A(F):A(je,$)}function $(L){if(L=="}")return U.marked="string-2",U.state.tokenize=xt,A(F)}function ot(L){return q(U.stream,U.state),et(L=="{"?Vt:Jt)}function vt(L){return q(U.stream,U.state),et(L=="{"?Vt:Ee)}function K(L){return function(X){return X=="."?A(L?it:ft):X=="variable"&&g?A(at,L?T:pe):et(L?Ee:Jt)}}function ft(L,X){if(X=="target")return U.marked="keyword",A(pe)}function it(L,X){if(X=="target")return U.marked="keyword",A(T)}function ne(L){return L==":"?A(Ot,Vt):et(pe,Ht(";"),Ot)}function ye(L){if(L=="variable")return U.marked="property",A()}function de(L,X){if(L=="async")return U.marked="property",A(de);if(L=="variable"||U.style=="keyword"){if(U.marked="property",X=="get"||X=="set")return A(V);var St;return g&&U.state.fatArrowAt==U.stream.start&&(St=U.stream.match(/^\s*:\s*/,!1))&&(U.state.fatArrowAt=U.stream.pos+St[0].length),A(tt)}else{if(L=="number"||L=="string")return U.marked=c?"property":U.style+" property",A(tt);if(L=="jsonld-keyword")return A(tt);if(g&&te(X))return U.marked="keyword",A(de);if(L=="[")return A(Jt,Lt,Ht("]"),tt);if(L=="spread")return A(Ee,tt);if(X=="*")return U.marked="keyword",A(de);if(L==":")return et(tt)}}function V(L){return L!="variable"?et(tt):(U.marked="property",A(Ke))}function tt(L){if(L==":")return A(Ee);if(L=="(")return et(Ke)}function M(L,X,St){function Dt(Rt,xe){if(St?St.indexOf(Rt)>-1:Rt==","){var Te=U.state.lexical;return Te.info=="call"&&(Te.pos=(Te.pos||0)+1),A(function(Le,Ie){return Le==X||Ie==X?et():et(L)},Dt)}return Rt==X||xe==X?A():St&&St.indexOf(";")>-1?et(L):A(Ht(X))}return function(Rt,xe){return Rt==X||xe==X?A():et(L,Dt)}}function Tt(L,X,St){for(var Dt=3;Dt<arguments.length;Dt++)U.cc.push(arguments[Dt]);return A(wt(X,St),M(L,X),Ot)}function ht(L){return L=="}"?A():et(Vt,ht)}function Lt(L,X){if(g){if(L==":")return A(re);if(X=="?")return A(Lt)}}function Yt(L,X){if(g&&(L==":"||X=="in"))return A(re)}function qt(L){if(g&&L==":")return U.stream.match(/^\s*\w+\s+is\b/,!1)?A(Jt,Bt,re):A(re)}function Bt(L,X){if(X=="is")return U.marked="keyword",A()}function re(L,X){if(X=="keyof"||X=="typeof"||X=="infer"||X=="readonly")return U.marked="keyword",A(X=="typeof"?Ee:re);if(L=="variable"||X=="void")return U.marked="type",A(Z);if(X=="|"||X=="&")return A(re);if(L=="string"||L=="number"||L=="atom")return A(Z);if(L=="[")return A(wt("]"),M(re,"]",","),Ot,Z);if(L=="{")return A(wt("}"),Pe,Ot,Z);if(L=="(")return A(M(j,")"),Ce,Z);if(L=="<")return A(M(re,">"),re);if(L=="quasi")return et(qe,Z)}function Ce(L){if(L=="=>")return A(re)}function Pe(L){return L.match(/[\}\)\]]/)?A():L==","||L==";"?A(Pe):et(Oe,Pe)}function Oe(L,X){if(L=="variable"||U.style=="keyword")return U.marked="property",A(Oe);
vendor: 6,827 bytes, line 26
26if(X=="?"||L=="number"||L=="string")return A(Oe);if(L==":")return A(re);if(L=="[")return A(Ht("variable"),Yt,Ht("]"),Oe);if(L=="(")return et(Ye,Oe);if(!L.match(/[;\}\)\],]/))return A()}function qe(L,X){return L!="quasi"?et():X.slice(X.length-2)!="${"?A(qe):A(re,cn)}function cn(L){if(L=="}")return U.marked="string-2",U.state.tokenize=xt,A(qe)}function j(L,X){return L=="variable"&&U.stream.match(/^\s*[?:]/,!1)||X=="?"?A(j):L==":"?A(re):L=="spread"?A(j):et(re)}function Z(L,X){if(X=="<")return A(wt(">"),M(re,">"),Ot,Z);if(X=="|"||L=="."||X=="&")return A(re);if(L=="[")return A(re,Ht("]"),Z);if(X=="extends"||X=="implements")return U.marked="keyword",A(re);if(X=="?")return A(re,Ht(":"),re)}function at(L,X){if(X=="<")return A(wt(">"),M(re,">"),Ot,Z)}function Pt(){return et(re,zt)}function zt(L,X){if(X=="=")return A(re)}function ie(L,X){return X=="enum"?(U.marked="keyword",A(gr)):et(ge,Lt,We,Qn)}function ge(L,X){if(g&&te(X))return U.marked="keyword",A(ge);if(L=="variable")return yt(X),A();if(L=="spread")return A(ge);if(L=="[")return Tt(Fe,"]");if(L=="{")return Tt(rn,"}")}function rn(L,X){return L=="variable"&&!U.stream.match(/^\s*:/,!1)?(yt(X),A(We)):(L=="variable"&&(U.marked="property"),L=="spread"?A(ge):L=="}"?et():L=="["?A(Jt,Ht("]"),Ht(":"),rn):A(Ht(":"),ge,We))}function Fe(){return et(ge,We)}function We(L,X){if(X=="=")return A(Ee)}function Qn(L){if(L==",")return A(ie)}function fn(L,X){if(L=="keyword b"&&X=="else")return A(wt("form","else"),Vt,Ot)}function ze(L,X){if(X=="await")return A(ze);if(L=="(")return A(wt(")"),hr,Ot)}function hr(L){return L=="var"?A(ie,Ve):L=="variable"?A(Ve):et(Ve)}function Ve(L,X){return L==")"?A():L==";"?A(Ve):X=="in"||X=="of"?(U.marked="keyword",A(Jt,Ve)):et(Jt,Ve)}function Ke(L,X){if(X=="*")return U.marked="keyword",A(Ke);if(L=="variable")return yt(X),A(Ke);if(L=="(")return A(bt,wt(")"),M(Ae,")"),Ot,qt,Vt,nt);if(g&&X=="<")return A(wt(">"),M(Pt,">"),Ot,Ke)}function Ye(L,X){if(X=="*")return U.marked="keyword",A(Ye);if(L=="variable")return yt(X),A(Ye);if(L=="(")return A(bt,wt(")"),M(Ae,")"),Ot,qt,nt);if(g&&X=="<")return A(wt(">"),M(Pt,">"),Ot,Ye)}function tr(L,X){if(L=="keyword"||L=="variable")return U.marked="type",A(tr);if(X=="<")return A(wt(">"),M(Pt,">"),Ot)}function Ae(L,X){return X=="@"&&A(Jt,Ae),L=="spread"?A(Ae):g&&te(X)?(U.marked="keyword",A(Ae)):g&&L=="this"?A(Lt,We):et(ge,Lt,We)}function Dn(L,X){return L=="variable"?ve(L,X):On(L,X)}function ve(L,X){if(L=="variable")return yt(X),A(On)}function On(L,X){if(X=="<")return A(wt(">"),M(Pt,">"),Ot,On);if(X=="extends"||X=="implements"||g&&L==",")return X=="implements"&&(U.marked="keyword"),A(g?re:Jt,On);if(L=="{")return A(wt("}"),en,Ot)}function en(L,X){if(L=="async"||L=="variable"&&(X=="static"||X=="get"||X=="set"||g&&te(X))&&U.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return U.marked="keyword",A(en);if(L=="variable"||U.style=="keyword")return U.marked="property",A(jn,en);if(L=="number"||L=="string")return A(jn,en);if(L=="[")return A(Jt,Lt,Ht("]"),jn,en);if(X=="*")return U.marked="keyword",A(en);if(g&&L=="(")return et(Ye,en);if(L==";"||L==",")return A(en);if(L=="}")return A();if(X=="@")return A(Jt,en)}function jn(L,X){if(X=="!"||X=="?")return A(jn);if(L==":")return A(re,We);if(X=="=")return A(Ee);var St=U.state.lexical.prev,Dt=St&&St.info=="interface";return et(Dt?Ye:Ke)}function ke(L,X){return X=="*"?(U.marked="keyword",A(Ne,Ht(";"))):X=="default"?(U.marked="keyword",A(Jt,Ht(";"))):L=="{"?A(M(Zt,"}"),Ne,Ht(";")):et(Vt)}function Zt(L,X){if(X=="as")return U.marked="keyword",A(Ht("variable"));if(L=="variable")return et(Ee,Zt)}function dn(L){return L=="string"?A():L=="("?et(Jt):L=="."?et(pe):et(Pn,on,Ne)}function Pn(L,X){return L=="{"?Tt(Pn,"}"):(L=="variable"&&yt(X),X=="*"&&(U.marked="keyword"),A(_e))}function on(L){if(L==",")return A(Pn,on)}function _e(L,X){if(X=="as")return U.marked="keyword",A(Pn)}function Ne(L,X){if(X=="from")return U.marked="keyword",A(Jt)}function vr(L){return L=="]"?A():et(M(Ee,"]"))}function gr(){return et(wt("form"),ge,Ht("{"),wt("}"),M(Mt,"}"),Ot,Ot)}function Mt(){return et(ge,We)}function fe(L,X){return L.lastType=="operator"||L.lastType==","||b.test(X.charAt(0))||/[,.]/.test(X.charAt(0))}function Un(L,X,St){return X.tokenize==W&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(X.lastType)||X.lastType=="quasi"&&/\{\s*$/.test(L.string.slice(0,L.pos-(St||0)))}return{startState:function(L){var X={tokenize:W,lastType:"sof",cc:[],lexical:new H((L||0)-l,0,"block",!1),localVars:i.localVars,context:i.localVars&&new Xt(null,null,!1),indented:L||0};return i.globalVars&&typeof i.globalVars=="object"&&(X.globalVars=i.globalVars),X},token:function(L,X){if(L.sol()&&(X.lexical.hasOwnProperty("align")||(X.lexical.align=!1),X.indented=L.indentation(),q(L,X)),X.tokenize!=_t&&L.eatSpace())return null;var St=X.tokenize(L,X);return N=="comment"?St:(X.lastType=N=="operator"&&(z=="++"||z=="--")?"incdec":N,B(X,St,N,z,L))},indent:function(L,X){if(L.tokenize==_t||L.tokenize==xt)return e.Pass;if(L.tokenize!=W)return 0;var St=X&&X.charAt(0),Dt=L.lexical,Rt;if(!/^\s*else\b/.test(X))for(var xe=L.cc.length-1;xe>=0;--xe){var Te=L.cc[xe];if(Te==Ot)Dt=Dt.prev;else if(Te!=fn&&Te!=nt)break}for(;(Dt.type=="stat"||Dt.type=="form")&&(St=="}"||(Rt=L.cc[L.cc.length-1])&&(Rt==pe||Rt==T)&&!/^[,\.=+\-*:?[\(]/.test(X));)Dt=Dt.prev;u&&Dt.type==")"&&Dt.prev.type=="stat"&&(Dt=Dt.prev);var Le=Dt.type,Ie=St==Le;return Le=="vardef"?Dt.indented+(L.lastType=="operator"||L.lastType==","?Dt.info.length+1:0):Le=="form"&&St=="{"?Dt.indented:Le=="form"?Dt.indented+l:Le=="stat"?Dt.indented+(fe(L,X)?u||l:0):Dt.info=="switch"&&!Ie&&i.doubleIndentSwitch!=!1?Dt.indented+(/^(?:case|default)\b/.test(X)?l:2*l):Dt.align?Dt.column+(Ie?0:1):Dt.indented+(Ie?0:l)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:f?null:"/*",blockCommentEnd:f?null:"*/",blockCommentContinue:f?null:" * ",lineComment:f?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:f?"json":"javascript",jsonldMode:c,jsonMode:f,expressionAllowed:Un,skipExpression:function(L){B(L,"atom","atom","true",new e.StringStream("",2,null))}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}),576:((a,r,t)=>
26{(function(e){e(t(237))})(function(e){"use strict";var n={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},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(l,u){var c=l.indentUnit,f={},v=u.htmlMode?n:i;for(var g in v)f[g]=v[g];for(var g in u)f[g]=u[g];var y,_;function b(A,gt){function yt(Xt){return gt.tokenize=Xt,Xt(A,gt)}var jt=A.next();if(jt=="<")return A.eat("!")?A.eat("[")?A.match("CDATA[")?yt(N("atom","]]>")):null:A.match("--")?yt(N("comment","-->")):A.match("DOCTYPE",!0,!0)?(A.eatWhile(/[\w\._\-]/),yt(z(1))):null:A.eat("?")?(A.eatWhile(/[\w\._\-]/),gt.tokenize=N("meta","?>"),"meta"):(y=A.eat("/")?"closeTag":"openTag",gt.tokenize=S,"tag bracket");if(jt=="&"){var te;return A.eat("#")?A.eat("x")?te=A.eatWhile(/[a-fA-F\d]/)&&A.eat(";"):te=A.eatWhile(/[\d]/)&&A.eat(";"):te=A.eatWhile(/[\w\.\-:]/)&&A.eat(";"),te?"atom":"error"}else return A.eatWhile(/[^&<]/),null}b.isInText=!0;function S(A,gt){var yt=A.next();if(yt==">"||yt=="/"&&A.eat(">"))return gt.tokenize=b,y=yt==">"?"endTag":"selfcloseTag","tag bracket";if(yt=="=")return y="equals",null;if(yt=="<"){gt.tokenize=b,gt.state=xt,gt.tagName=gt.tagStart=null;var jt=gt.tokenize(A,gt);return jt?jt+" tag error":"tag error"}else return/[\'\"]/.test(yt)?(gt.tokenize=E(yt),gt.stringStartCol=A.column(),gt.tokenize(A,gt)):(A.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function E(A){var gt=function(yt,jt){for(;!yt.eol();)if(yt.next()==A){jt.tokenize=S;break}return"string"};return gt.isInAttribute=!0,gt}function N(A,gt){return function(yt,jt){for(;!yt.eol();){if(yt.match(gt)){jt.tokenize=b;break}yt.next()}return A}}function z(A){return function(gt,yt){for(var jt;(jt=gt.next())!=null;){if(jt=="<")return yt.tokenize=z(A+1),yt.tokenize(gt,yt);if(jt==">")if(A==1){yt.tokenize=b;break}else return yt.tokenize=z(A-1),yt.tokenize(gt,yt)}return"meta"}}function R(A){return A&&A.toLowerCase()}function W(A,gt,yt){this.prev=A.context,this.tagName=gt||"",this.indent=A.indented,this.startOfLine=yt,(f.doNotIndent.hasOwnProperty(gt)||A.context&&A.context.noIndent)&&(this.noIndent=!0)}function ct(A){A.context&&(A.context=A.context.prev)}function _t(A,gt){for(var yt;;){if(!A.context||(yt=A.context.tagName,!f.contextGrabbers.hasOwnProperty(R(yt))||!f.contextGrabbers[R(yt)].hasOwnProperty(R(gt))))return;ct(A)}}function xt(A,gt,yt){return A=="openTag"?(yt.tagStart=gt.column(),ut):A=="closeTag"?q:xt}function ut(A,gt,yt){return A=="word"?(yt.tagName=gt.current(),_="tag",I):f.allowMissingTagName&&A=="endTag"?(_="tag bracket",I(A,gt,yt)):(_="error",ut)}function q(A,gt,yt){if(A=="word"){var jt=gt.current();return yt.context&&yt.context.tagName!=jt&&f.implicitlyClosed.hasOwnProperty(R(yt.context.tagName))&&ct(yt),yt.context&&yt.context.tagName==jt||f.matchClosing===!1?(_="tag",lt):(_="tag error",H)}else return f.allowMissingTagName&&A=="endTag"?(_="tag bracket",lt(A,gt,yt)):(_="error",H)}function lt(A,gt,yt){return A!="endTag"?(_="error",lt):(ct(yt),xt)}function H(A,gt,yt){return _="error",lt(A,gt,yt)}function I(A,gt,yt){if(A=="word")return _="attribute",B;if(A=="endTag"||A=="selfcloseTag"){var jt=yt.tagName,te=yt.tagStart;return yt.tagName=yt.tagStart=null,A=="selfcloseTag"||f.autoSelfClosers.hasOwnProperty(R(jt))?_t(yt,jt):(_t(yt,jt),yt.context=new W(yt,jt,te==yt.indented)),xt}return _="error",I}function B(A,gt,yt){return A=="equals"?U:(f.allowMissing||(_="error"),I(A,gt,yt))}function U(A,gt,yt){return A=="string"?et:A=="word"&&f.allowUnquoted?(_="string",I):(_="error",I(A,gt,yt))}function et(A,gt,yt){return A=="string"?et:I(A,gt,yt)}return{startState:function(A){var gt={tokenize:b,state:xt,indented:A||0,tagName:null,tagStart:null,context:null};return A!=null&&(gt.baseIndent=A),gt},token:function(A,gt){if(!gt.tagName&&A.sol()&&(gt.indented=A.indentation()),A.eatSpace())return null;y=null;var yt=gt.tokenize(A,gt);return(yt||y)&&yt!="comment"&&(_=null,gt.state=gt.state(y||yt,A,gt),_&&(yt=_=="error"?yt+" error":_)),yt},indent:function(A,gt,yt){var jt=A.context;
26if(A.tokenize.isInAttribute)return A.tagStart==A.indented?A.stringStartCol+1:A.indented+c;if(jt&&jt.noIndent)return e.Pass;if(A.tokenize!=S&&A.tokenize!=b)return yt?yt.match(/^(\s*)/)[0].length:0;if(A.tagName)return f.multilineTagIndentPastTag!==!1?A.tagStart+A.tagName.length+2:A.tagStart+c*(f.multilineTagIndentFactor||1);if(f.alignCDATA&&/<!\[CDATA\[/.test(gt))return 0;var te=gt&&/^<(\/)?([\w_:\.-]*)/.exec(gt);if(te&&te[1])for(;jt;)if(jt.tagName==te[2]){jt=jt.prev;break}else if(f.implicitlyClosed.hasOwnProperty(R(jt.tagName)))jt=jt.prev;else break;else if(te)for(;jt;){var Xt=f.contextGrabbers[R(jt.tagName)];if(Xt&&Xt.hasOwnProperty(R(te[2])))jt=jt.prev;else break}for(;jt&&jt.prev&&!jt.startOfLine;)jt=jt.prev;return jt?jt.indent+c:A.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:f.htmlMode?"html":"xml",helperType:f.htmlMode?"html":"xml",skipAttribute:function(A){A.state==U&&(A.state=I)},xmlCurrentTag:function(A){return A.tagName?{name:A.tagName,close:A.type=="closeTag"}:null},xmlCurrentContext:function(A){for(var gt=[],yt=A.context;yt;yt=yt.prev)gt.push(yt.tagName);return gt.reverse()}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})}),578:((a,r,t)=>{t.d(r,{A:()=>l});var e=t(268),n=(function(){var u=function(c,f){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var y in g)Object.prototype.hasOwnProperty.call(g,y)&&(v[y]=g[y])},u(c,f)};return function(c,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");u(c,f);function v(){this.constructor=c}c.prototype=f===null?Object.create(f):(v.prototype=f.prototype,new v)}})(),i=(function(u){n(c,u);function c(f,v,g){var y=u.call(this,v,g)||this;return y._module=f,y}return Object.defineProperty(c.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),c})(e.Kx);let l=i}),683:((a,r,t)=>{t.d(r,{A:()=>u,F:()=>i});var e=t(578),n=(function(){var c=function(f,v){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,y){g.__proto__=y}||function(g,y){for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(g[_]=y[_])},c(f,v)};return function(f,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");c(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}})(),i=(function(c){return c.Select="select",c.Hover="hover",c.Spacing="spacing",c.Target="target",c.Resize="resize",c})(i||{}),l=(function(c){n(f,c);function f(){return c!==null&&c.apply(this,arguments)||this}return f.prototype.defaults=function(){return{id:"",type:""}},Object.defineProperty(f.prototype,"type",{get:function(){return this.get("type")||""},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"component",{get:function(){var v,g=this.get("component");return g||((v=this.get("componentView"))===null||v===void 0?void 0:v.model)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"componentView",{get:function(){var v,g=this.get("componentView");return g||((v=this.get("component"))===null||v===void 0?void 0:v.getView())},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"el",{get:function(){var v;return(v=this.componentView)===null||v===void 0?void 0:v.el},enumerable:!1,configurable:!0}),f.prototype.getBoxRect=function(v){var g=this,y=g.el,_=g.em,b=_.Canvas.getCanvasView(),S=this.get("boxRect");return S||(y&&b?b.getElBoxRect(y,v):{x:0,y:0,width:0,height:0})},f.prototype.getStyle=function(v){v===void 0&&(v={});var g=v.boxRect||this.getBoxRect(v),y=g.width,_=g.height,b=g.x,S=g.y;return{width:"".concat(y,"px"),height:"".concat(_,"px"),top:"0",left:"0",position:"absolute",translate:"".concat(b,"px ").concat(S,"px")}},f.prototype.isType=function(v){return this.type===v},f})(e.A);let u=l}),242:((a,r,t)=>
26{t.d(r,{A:()=>n});var e=(function(i){return i.run="command:run",i._run="run",i.runCommand="command:run:",i._runCommand="run:",i.runBeforeCommand="command:run:before:",i.abort="command:abort:",i._abort="abort:",i.stop="command:stop",i._stop="stop",i.stopCommand="command:stop:",i._stopCommand="stop:",i.stopBeforeCommand="command:stop:before:",i})(e||{});let n=e}),404:((a,r,t)=>{t.r(r),t.d(r,{default:()=>e});let e={run:function(n){n.Components.clear(),n.Css.clear()}}}),228:((a,r,t)=>{t.r(r),t.d(r,{default:()=>l});var e=t(523),n=t(14),i=t(926);let l={run:function(u){(0,e.bindAll)(this,"onKeyUp","enableDragger","disableDragger"),this.editor=u,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(u){this.toggleMove(),this.disableDragger()},onKeyUp:function(u){(0,i.Ch)(u)===" "&&this.editor.stopCommand(this.id)},enableDragger:function(u){this.toggleDragger(1,u)},disableDragger:function(u){this.toggleDragger(0,u)},toggleDragger:function(u,c){var f=this,v=f.canvasModel,g=f.em,y=this.dragger,_=u?"add":"remove";this.getCanvas().classList[_]("".concat(this.ppfx,"is__grabbing")),y||(y=new n.A({getPosition:function(){return{x:v.get("x"),y:v.get("y")}},setPosition:function(b){var S=b.x,E=b.y;v.set({x:S,y:E})},onStart:function(b,S){g.trigger("canvas:move:start",S)},onDrag:function(b,S){g.trigger("canvas:move",S)},onEnd:function(b,S){g.trigger("canvas:move:end",S)}}),this.dragger=y),u?y.start(c):y.stop()},toggleMove:function(u){var c=this.ppfx,f=u?"add":"remove",v=u?"on":"off",g={on:i.on,off:i.AU},y=this.getCanvas(),_=["".concat(c,"is__grab")];!u&&_.push("".concat(c,"is__grabbing")),_.forEach(function(b){return y.classList[f](b)}),g[v](document,"keyup",this.onKeyUp),g[v](y,"mousedown",this.enableDragger),g[v](document,"mouseup",this.disableDragger)}}}),570:((a,r,t)=>{t.r(r),t.d(r,{default:()=>c,defineCommand:()=>l});var e=t(268),n=t(242),i=(function(){var f=function(v,g){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,_){y.__proto__=_}||function(y,_){for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(y[b]=_[b])},f(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");f(v,g);function y(){this.constructor=v}v.prototype=g===null?Object.create(g):(y.prototype=g.prototype,new y)}})();function l(f){return f}var u=(function(f){i(v,f);function v(g){var y=f.call(this,0)||this;y.config=g||{},y.em=y.config.em||{};var _=y.config.stylePrefix;return y.pfx=_,y.ppfx=y.config.pStylePrefix,y.hoverClass="".concat(_,"hover"),y.badgeClass="".concat(_,"badge"),y.plhClass="".concat(_,"placeholder"),y.freezClass="".concat(y.ppfx,"freezed"),y.canvas=y.em.Canvas,y.init(y.config),y}return v.prototype.onFrameScroll=function(g){},v.prototype.getCanvas=function(){return this.canvas.getElement()},v.prototype.getCanvasBody=function(){return this.canvas.getBody()},v.prototype.getCanvasTools=function(){return this.canvas.getToolsEl()},v.prototype.offset=function(g){var y=g.getBoundingClientRect();return{top:y.top+g.ownerDocument.body.scrollTop,left:y.left+g.ownerDocument.body.scrollLeft}},v.prototype.init=function(g){},v.prototype.callRun=function(g,y){y===void 0&&(y={});var _=this.id;if(g.trigger("".concat(n.A.runBeforeCommand).concat(_),{options:y}),g.trigger("".concat(n.A._runCommand).concat(_,":before"),y),y.abort){g.trigger("".concat(n.A.abort).concat(_),{options:y}),g.trigger("".concat(n.A._abort).concat(_),y);return}var b=y.sender||g,S=this.run(g,b,y),E={id:_,result:S,options:y};return g.trigger("".concat(n.A.runCommand).concat(_),E),g.trigger(n.A.run,E),g.trigger("".concat(n.A._runCommand).concat(_),S,y),g.trigger(n.A._run,_,S,y),S},v.prototype.callStop=function(g,y){y===void 0&&(y={});var _=this.id,b=y.sender||g;g.trigger("".concat(n.A.stopBeforeCommand).concat(_),{options:y}),g.trigger("".concat(n.A._stopCommand).concat(_,":before"),y);var S=this.stop(g,b,y),E={id:_,result:S,options:y};return g.trigger("".concat(n.A.stopCommand).concat(_),E),g.trigger(n.A.stop,E),g.trigger("".concat(n.A._stopCommand).concat(_),S,y),g.trigger(n.A._stop,_,S,y),S},v.prototype.stopCommand=function(g){this.em.Commands.stop(this.id,g)},v.prototype.run=function(g,y,_){},v.prototype.stop=function(g,y,_){},v})(e.Kx);let c=u}),377:((a,r,t)=>
26{t.r(r),t.d(r,{default:()=>l});var e=t(523),n=function(u,c,f){if(f||arguments.length===2)for(var v=0,g=c.length,y;v<g;v++)(y||!(v in c))&&(y||(y=Array.prototype.slice.call(c,0,v)),y[v]=c[v]);return u.concat(y||Array.prototype.slice.call(c))},i={run:function(u,c,f){var v=this;f===void 0&&(f={});var g=[],y=f.component||u.getSelectedAll();return y=(0,e.isArray)(y)?n([],y,!0):[y],y.filter(Boolean).forEach(function(_){var b,S;if(!_.get("removable"))return v.em.logWarning("The element is not removable",{component:_});g.push(_);var E=((S=(b=_.delegate)===null||b===void 0?void 0:b.remove)===null||S===void 0?void 0:S.call(b,_))||_;E.remove()}),u.selectRemove(g),g}};let l=i}),728:((a,r,t)=>{t.r(r),t.d(r,{default:()=>u});var e=t(523),n=t(14),i=function(){return i=Object.assign||function(c){for(var f,v=1,g=arguments.length;v<g;v++){f=arguments[v];for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(c[y]=f[y])}return c},i.apply(this,arguments)},l="dmode";let u={run:function(c,f,v){var g=this;v===void 0&&(v={}),(0,e.bindAll)(this,"setPosition","onStart","onDrag","onEnd","getPosition","getGuidesStatic","renderGuide","getGuidesTarget");var y=v.target,_=v.event,b=v.mode,S=v.dragger,E=S===void 0?{}:S,N=y.getEl(),z=i({doc:N.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return g.guidesStatic},guidesTarget:function(){return g.guidesTarget}},E);this.setupGuides(),this.opts=v,this.editor=c,this.em=c.getModel(),this.target=y,this.isTran=b=="translate",this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var R=this.dragger;return R?R.setOptions(z):(R=new n.A(z),this.dragger=R),_&&R.start(_),this.toggleDrag(1),this.em.trigger("".concat(l,":start"),this.getEventOpts()),R},getEventOpts:function(){return{mode:this.opts.mode,target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach(function(c){var f=c.guide;f&&f.parentNode.removeChild(f)}),this.guides=[]},getGuidesContainer:function(){var c=this,f=this.guidesEl;if(!f){var v=this,g=v.editor,y=v.em,_=v.opts,b=g.getConfig().stylePrefix,S=document.createElement("div"),E=document.createElement("div"),N='<div class="'.concat(b,"guide-info__line ").concat(b,`danger-bg"> 27 <div class="`).concat(b,"guide-info__content ").concat(b,`danger-color"></div> 28 </div>`);f=document.createElement("div"),f.className="".concat(b,"guides"),S.className="".concat(b,"guide-info ").concat(b,"guide-info__x"),E.className="".concat(b,"guide-info ").concat(b,"guide-info__y"),S.innerHTML=N,E.innerHTML=N,f.appendChild(S),f.appendChild(E),g.Canvas.getGlobalToolsEl().appendChild(f),this.guidesEl=f,this.elGuideInfoX=S,this.elGuideInfoY=E,this.elGuideInfoContentX=S.querySelector(".".concat(b,"guide-info__content")),this.elGuideInfoContentY=E.querySelector(".".concat(b,"guide-info__content")),y.on("canvas:update frame:scroll",(0,e.debounce)(function(){var z;c.updateGuides(),_.debug&&((z=c.guides)===null||z===void 0||z.forEach(function(R){return c.renderGuide(R)}))},200))}return f},getGuidesStatic:function(){var c=this,f=[],v=this.target.getEl(),g=v.parentNode,y=g===void 0?{}:g;return(0,e.each)(y.children,function(_){return f=f.concat(v!==_?c.getElementGuides(_):[])}),f.concat(this.getElementGuides(y))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(c){var f=this,v,g;(c||this.guides).forEach(function(y){var _=y.origin,b=v===_?g:f.getElementPos(_);v=_,g=b,(0,e.each)(f.getGuidePosUpdate(y,b),function(S,E){return y[E]=S}),y.originRect=b})},getGuidePosUpdate:function(c,f){var v={},g=f.top,y=f.height,_=f.left,b=f.width;switch(c.type){case"t":v.y=g;break;case"b":v.y=g+y;break;case"l":v.x=_;break;case"r":v.x=_+b;break;case"x":v.x=_+b/2;break;case"y":v.y=g+y/2;break}return v},renderGuide:function(c){c===void 0&&(c={});var f=c.guide||document.createElement("div"),v="px",g=c.active?2:1,y=f.children[0];return f.style="position: absolute; background-color: ".concat(c.active?"green":"red",";"),f.children.length||(y=document.createElement("div"),y.style="position: absolute; color: red; padding: 5px; top: 0; left: 0;",f.appendChild(y)),c.y?(f.style.width="100%",f.style.height="".concat(g).concat(v),f.style.top="".concat(c.y).concat(v),f.style.left=0):(f.style.width="".concat(g).concat(v),f.style.height="100%",f.style.left="".concat(c.x).concat(v),f.style.top="0".concat(v)),!c.guide&&this.guidesContainer.appendChild(f),f},getElementPos:function(c){return this.editor.Canvas.getElementPos(c,{noScroll:1})},getElementGuides:function(c){var f=this,v=this.opts,g=this.getElementPos(c),y=g.to
28p,_=g.height,b=g.left,S=g.width,E=[{type:"t",y},{type:"b",y:y+_},{type:"l",x:b},{type:"r",x:b+S},{type:"x",x:b+S/2},{type:"y",y:y+_/2}].map(function(N){return i(i({},N),{origin:c,originRect:g,guide:v.debug&&f.renderGuide(N)})});return E.forEach(function(N){var z;return(z=f.guides)===null||z===void 0?void 0:z.push(N)}),E},getTranslate:function(c,f){f===void 0&&(f="x");var v=0;return(c||"").split(" ").forEach(function(g){var y=g.trim(),_="translate".concat(f.toUpperCase(),"(");y.indexOf(_)===0&&(v=parseFloat(y.replace(_,"")))}),v},setTranslate:function(c,f,v){var g="translate".concat(f.toUpperCase(),"("),y="".concat(g).concat(v,")"),_=(c||"").split(" ").map(function(b){var S=b.trim();return S.indexOf(g)===0&&(b=y),b}).join(" ");return _.indexOf(g)<0&&(_+=" ".concat(y)),_},getPosition:function(){var c=this,f=c.target,v=c.isTran,g=f.getStyle(),y=g.left,_=g.top,b=g.transform,S=0,E=0;return v?(S=this.getTranslate(b),E=this.getTranslate(b,"y")):(S=parseFloat(y||0),E=parseFloat(_||0)),{x:S,y:E}},setPosition:function(c){var f=c.x,v=c.y,g=c.end,y=c.position,_=c.width,b=c.height,S=this,E=S.target,N=S.isTran,z=S.em,R="px",W=!g,ct="".concat(parseInt(f,10)).concat(R),_t="".concat(parseInt(v,10)).concat(R),xt={};if(N){var ut=E.getStyle().transform||"";ut=this.setTranslate(ut,"x",ct),ut=this.setTranslate(ut,"y",_t),xt={transform:ut,__p:W},E.addStyle(xt,{avoidStore:!g})}else{var q={position:y,width:_,height:b},lt={left:ct,top:_t,__p:W};(0,e.keys)(q).forEach(function(H){var I=q[H];I&&(lt[H]=I)}),xt=lt,E.addStyle(xt,{avoidStore:!g})}z?.Styles.__emitCmpStyleUpdate(xt,{components:z.getSelected()})},_getDragData:function(){var c=this.target;return{target:c,parent:c.parent(),index:c.index()}},onStart:function(c){var f=this,v=f.target,g=f.editor,y=f.isTran,_=f.opts,b=_.center,S=_.onStart,E=g.Canvas,N=v.getStyle(),z="absolute",R=[z,"relative"];if(S&&S(this._getDragData()),!y&&N.position!==z){var W=E.offset(v.getEl()),ct=W.left,_t=W.top,xt=W.width,ut=W.height,q=v.parent(),lt=void 0;do{var H=q.getStyle();lt=R.indexOf(H.position)>=0?q:null,q=q.parent()}while(q&&!lt);if(b){var I=E.getMouseRelativeCanvas(c),B=I.x,U=I.y;ct=B,_t=U}else if(lt){var et=E.offset(lt.getEl());ct=ct-et.left,_t=_t-et.top}this.setPosition({x:ct,y:_t,width:"".concat(xt,"px"),height:"".concat(ut,"px"),position:z})}},onDrag:function(){for(var c=this,f=[],v=0;v<arguments.length;v++)f[v]=arguments[v];var g=this,y=g.guidesTarget,_=g.opts,b=_.onDrag;this.updateGuides(y),_.debug&&y.forEach(function(S){return c.renderGuide(S)}),_.guidesInfo&&this.renderGuideInfo(y.filter(function(S){return S.active})),b&&b(this._getDragData())},onEnd:function(c,f,v){v===void 0&&(v={});var g=this,y=g.editor,_=g.opts,b=g.id,S=_.onEnd;S&&S(c,v,i(i({event:c},v),this._getDragData())),y.stopCommand(b),this.hideGuidesInfo(),this.em.trigger("".concat(l,":end"),this.getEventOpts())},hideGuidesInfo:function(){var c=this;["X","Y"].forEach(function(f){var v=c["elGuideInfo".concat(f)];v&&(v.style.display="none")})},renderGuideInfo:function(c){var f=this;c===void 0&&(c=[]);var v=this.guidesStatic;this.hideGuidesInfo(),c.forEach(function(g){var y=g.origin,_=g.x,b=f.getElementPos(y),S=(0,e.isUndefined)(_)?"y":"x",E=S==="y",N=b[E?"left":"top"],z=b.rect[E?"left":"top"],R=E?N+b.width:N+b.height,W=E?z+b.rect.width:z+b.rect.height,ct=f["elGuideInfo".concat(S.toUpperCase())],_t=f["elGuideInfoContent".concat(S.toUpperCase())],xt=ct.style,ut=v?.filter(function(It){return It.type===g.type}).map(function(It){var nt=It.originRect,wt=nt.left,Ot=nt.width,Ht=nt.top,Vt=nt.height,Nt=E?wt:Ht,Jt=E?wt+Ot:Ht+Vt;return{gap:Jt<N?N-Jt:Nt-R,guide:It}}).filter(function(It){return It.gap>0}).sort(function(It,nt){return It.gap-nt.gap}).map(function(It){return It.guide})[0];if(ut){var q=ut.originRect,lt=q.left,H=q.width,I=q.top,B=q.height,U=q.rect,et=E?lt<b.left:I<b.top,A=E?lt:I,gt=E?U.left:U.top,yt=E?lt+H:I+B,jt=E?U.left+U.width:U.top+U.height,te=E?g.y:g.x,Xt=et?yt:R,he="".concat(te,"px"),mt=et?N-yt:A-R,bt=et?z-jt:gt-W;xt.display="",xt[E?"top":"left"]=he,xt[E?"left":"top"]="".concat(Xt,"px"),xt[E?"width":"height"]="".concat(mt,"px"),_t.innerHTML="".concat(Math.round(bt),"px"),f.em.trigger("".concat(l,":active"),i(i({},f.getEventOpts()),{guide:g,guidesStatic:v,matched:ut,posFirst:te,posSecond:Xt,size:mt,sizeRaw:bt,elGuideInfo:ct,elGuideInfoCnt:_t}))}})},toggleDrag:function(c){var f=this,v=f.ppfx,g=f.editor,y=c?"add":"remove",_=["".concat(v,"is__grabbing")],b=g.Canvas,S=b.getBody();_.forEach(function(E){return S.classList[y](E)}),b[c?"startAutoscroll":"stopAutoscroll"]()}}}),462:((a,r,t)=>
28{t.r(r),t.d(r,{default:()=>e});let e={run:function(n){if(n.Canvas.hasFocus()){var i=[];n.getSelectedAll().forEach(function(l){var u=l.components(),c=u&&u.filter(function(f){return f.get("selectable")})[0];c&&i.push(c)}),i.length&&n.select(i)}}}}),658:((a,r,t)=>{t.r(r),t.d(r,{default:()=>e});let e={run:function(n,i,l){if(l===void 0&&(l={}),!(!n.Canvas.hasFocus()&&!l.force)){var u=[];n.getSelectedAll().forEach(function(c){for(var f=c.parent();f&&!f.get("selectable");)f=f.parent();f&&u.push(f)}),u.length&&n.select(u)}}}}),619:((a,r,t)=>{t.r(r),t.d(r,{default:()=>e});let e={run:function(n){if(n.Canvas.hasFocus()){var i=[];n.getSelectedAll().forEach(function(l){var u=l.parent();if(u){var c=u.components().length,f=0,v=0,g;do f++,v=l.index()+f,g=v<=c?u.getChildAt(v):null;while(g&&!g.get("selectable"));i.push(g||l)}}),i.length&&n.select(i)}}}}),935:((a,r,t)=>{t.r(r),t.d(r,{default:()=>e});let e={run:function(n){if(n.Canvas.hasFocus()){var i=[];n.getSelectedAll().forEach(function(l){var u=l.parent();if(u){var c=0,f=0,v;do c++,f=l.index()-c,v=f>=0?u.getChildAt(f):null;while(v&&!v.get("selectable"));i.push(v||l)}}),i.length&&n.select(i)}}}}),536:((a,r,t)=>
28{t.r(r),t.d(r,{default:()=>n});var e=t(523);let n={run:function(i,l,u){u===void 0&&(u={});var c=u.target,f=[];if(!c.get("styles"))return f;var v=c.get("type"),g=i.Pages.getAllWrappers(),y=(0,e.flatten)(g.map(function(b){return b.findType(v)})).length;if(!y){var _=i.CssComposer.getAll();f=_.filter(function(b){return b.get("group")==="cmp:".concat(v)}),_.remove(f)}return f}}}),957:((a,r,t)=>{t.r(r),t.d(r,{default:()=>n});var e=function(i,l,u){if(u||arguments.length===2)for(var c=0,f=l.length,v;c<f;c++)(v||!(c in l))&&(v||(v=Array.prototype.slice.call(l,0,c)),v[c]=l[c]);return i.concat(v||Array.prototype.slice.call(l))};let n={run:function(i){var l=i.getModel(),u=e([],i.getSelectedAll(),!0).map(function(c){var f,v;return((v=(f=c.delegate)===null||f===void 0?void 0:f.copy)===null||v===void 0?void 0:v.call(f,c))||c}).filter(Boolean);u.length&&l.set("clipboard",u)}}}),413:((a,r,t)=>{t.r(r),t.d(r,{default:()=>n});var e=t(926);let n={run:function(i,l,u){var c=this;u===void 0&&(u={}),l&&l.set&&l.set("active",0);var f=i.getConfig(),v=i.Modal,g=f.stylePrefix;if(this.cm=i.CodeManager||null,!this.editors){var y=this.buildEditor("htmlmixed","hopscotch","HTML"),_=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=y.model,this.cssEditor=_.model;var b=(0,e.a_)("div",{class:"".concat(g,"export-dl")});b.appendChild(y.el),b.appendChild(_.el),this.editors=b}v.open({title:f.textViewCode,content:this.editors}).getModel().once("change:open",function(){return i.stopCommand("".concat(c.id))}),this.htmlEditor.setContent(i.getHtml(u.optsHtml)),this.cssEditor.setContent(i.getCss(u.optsCss))},stop:function(i){var l=i.Modal;l&&l.close()},buildEditor:function(i,l,u){var c=this.em.CodeManager,f=c.createViewer({label:u,codeName:i,theme:l}),v=new c.EditorView({model:f,config:c.getConfig()}).render().el;return{model:f,el:v}}}}),516:((a,r,t)=>{t.r(r),t.d(r,{default:()=>n});var e=t(523);let n={isEnabled:function(){var i=document;return!!(i.fullscreenElement||i.webkitFullscreenElement||i.mozFullScreenElement)},enable:function(i){var l="";return i.requestFullscreen?i.requestFullscreen():i.webkitRequestFullscreen?(l="webkit",i.webkitRequestFullscreen()):i.mozRequestFullScreen?(l="moz",i.mozRequestFullScreen()):i.msRequestFullscreen&&i.msRequestFullscreen(),l},disable:function(){var i=document;this.isEnabled()&&(i.exitFullscreen?i.exitFullscreen():i.webkitExitFullscreen?i.webkitExitFullscreen():i.mozCancelFullScreen?i.mozCancelFullScreen():i.msExitFullscreen&&i.msExitFullscreen())},fsChanged:function(i){this.isEnabled()||(this.stopCommand({sender:this.sender}),document.removeEventListener("".concat(i||"","fullscreenchange"),this.fsChanged))},run:function(i,l,u){u===void 0&&(u={}),this.sender=l;var c=u.target,f=(0,e.isElement)(c)?c:document.querySelector(c),v=this.enable(f||i.getContainer());this.fsChanged=this.fsChanged.bind(this,v),document.addEventListener(v+"fullscreenchange",this.fsChanged)},stop:function(i,l){l&&l.set&&l.set("active",!1),this.disable()}}}),13:((a,r,t)=>{t.r(r),t.d(r,{default:()=>c});var e=t(523),n=t(694),i=t(926),l=t(194),u=t(582);let c=(0,e.extend)({},u.default,l.default,{init:function(f){l.default.init.apply(this,arguments),(0,e.bindAll)(this,"initSorter","rollback","onEndMove"),this.opt=f,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var f=[],v=0;v<arguments.length;v++)f[v]=arguments[v];l.default.enable.apply(this,f),this.getBadgeEl().addClass(this.badgeClass),this.getHighlighterEl().addClass(this.hoverClass);var g=this.$wrapper;g.css("cursor","move"),g.on("mousedown",this.initSorter),g.addClass(this.noSelClass)},toggleClipboard:function(){},initSorter:function(f){var v=(0,n.default)(f.target).data("model"),g=v.get("draggable");g&&(this.cacheEl=null,this.startSelectPosition(f.target,this.frameEl.contentDocument),this.sorter.draggable=g,this.sorter.onEndMove=this.onEndMove.bind(this),this.stopSelectComponent(),this.$wrapper.off("mousedown",this.initSorter),(0,i.on)(this.getContentWindow(),"keydown",this.rollback))},initSorterFromModel:function(f){var v=f.get("draggable");if(v){this.cacheEl=null;var g=f.view.el;this.startSelectPosition(g,this.frameEl.contentDocument),this.sorter.draggable=v,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,i.on)(this.getContentWindow(),"keydown",this.rollback)}},initSorterFromModels:function(f){this.cacheEl=null;var v=f[f.length-1],g=this.em.getCurrentFrame(),y=v.getEl(g?.model),_=y.ownerDocument;this.startSelectPosition(y,_,{onStart:this.onStart}),this.sorter.draggable=v.get("draggable"),this.sorter.toMove=f,this.sorter.onMoveClb=this.onDrag,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,i.on)(this.getContentWindow(),"keydown",this.rollback)},onEndMoveFromModel:function(){(0,i.AU)(this.getContentWindow(),"keydown",this.rollback)},onEndMove:function(){this.enable(),(0,i.AU)(this.getContentWindow(),"keydown",this.rollback)},onSelect:function(f,v){},rollback:function(f,v){var g=f.which||f.keyCode;(g==27||v)&&(this.sorter.moved=!1,this.sorter.endMove())},getBadgeEl:function(){return this.$badge||(this.$badge=(0,n.default)(this.getBadge())),this.$badge},getHighlighterEl:function(){return this.$hl||(this.$hl=(0,n.default)(this.canvas.getHighlighter())),this.$hl},stop:function(){for(var f=[],v=0;v<arguments.length;v++)f[v]=arguments[v];l.default.stop.apply(this,f),this.getBadgeEl().removeClass(this.badgeClass),this.getHighlighterEl().removeClass(this.hoverClass);var g=this.$wrapper;g.css("cursor","").unbind().removeClass(this.noSelClass)}})}),204:((a,r,t)=>
28{t.r(r),t.d(r,{default:()=>i});var e=t(523),n=t(926);let i={open:function(l){var u=this,c=this,f=c.editor,v=c.title,g=c.config,y=c.am,_=g.custom;if((0,e.isFunction)(_.open))return _.open(y.__customData());var b=f.Modal;b.open({title:v,content:l}).onceClose(function(){return f.stopCommand(u.id)})},close:function(){var l=this.config.custom;if((0,e.isFunction)(l.close))return l.close(this.am.__customData());var u=this.editor.Modal;u&&u.close()},run:function(l,u,c){c===void 0&&(c={});var f=l.AssetManager,v=f.getConfig(),g=c.types,y=g===void 0?[]:g,_=c.accept,b=c.select;if(this.title=c.modalTitle||l.t("assetManager.modalTitle")||"",this.editor=l,this.config=v,this.am=f,f.setTarget(c.target),f.onClick(c.onClick),f.onDblClick(c.onDblClick),f.onSelect(c.onSelect),f.__behaviour({select:b,types:y,options:c}),v.custom)this.rendered=this.rendered||(0,n.a_)("div"),this.rendered.className="".concat(v.stylePrefix,"custom-wrp"),f.__behaviour({container:this.rendered}),f.__trgCustom();else{if(!this.rendered||y){var S=f.getAll().filter(function(N){return N});y&&y.length&&(S=S.filter(function(N){return y.indexOf(N.get("type"))!==-1})),f.render(S),this.rendered=f.getContainer()}if(_){var E=this.rendered.querySelector("input#".concat(v.stylePrefix,"uploadFile"));E&&E.setAttribute("accept",_)}}return this.open(this.rendered),this},stop:function(l){this.editor=l,this.close(this.rendered)}}}),195:((a,r,t)=>{t.r(r),t.d(r,{default:()=>i});var e=t(523),n=t(926);let i={open:function(){var l=this,u=l.container,c=l.editor,f=l.bm,v=l.config,g=v.custom,y=v.appendTo;if((0,e.isFunction)(g.open))return g.open(f.__customData());if(this.firstRender&&!y){var _="views-container",b=c.Panels,S=b.getPanel(_)||b.addPanel({id:_});S.set("appendContent",u).trigger("change:appendContent"),g||u.appendChild(f.render())}u&&(u.style.display="block")},close:function(){var l=this,u=l.container,c=l.config,f=c.custom;if((0,e.isFunction)(f.close))return f.close(this.bm.__customData());u&&(u.style.display="none")},run:function(l){var u=l.Blocks;this.config=u.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,n.a_)("div"),this.editor=l,this.bm=u;var c=this.container;u.__behaviour({container:c}),this.config.custom&&u.__trgCustom(),this.open()},stop:function(){this.close()}}}),671:((a,r,t)=>{t.r(r),t.d(r,{default:()=>e});let e={run:function(n){var i=n.LayerManager,l=n.Panels,u=i.getConfig();if(!u.appendTo){if(!this.layers){var c="views-container",f=document.createElement("div"),v=l.getPanel(c)||l.addPanel({id:c});u.custom?i.__trgCustom({container:f}):f.appendChild(i.render()),v.set("appendContent",f).trigger("change:appendContent"),this.layers=f}this.layers.style.display="block"}},stop:function(){var n=this.layers;n&&(n.style.display="none")}}}),49:((a,r,t)=>{t.r(r),t.d(r,{default:()=>n});var e=t(694);let n={run:function(i,l){if(this.sender=l,!this.$cnt){var u=i.getConfig(),c=i.Panels,f=i.DeviceManager,v=i.SelectorManager,g=i.StyleManager,y="change:appendContent",_=(0,e.default)("<div></div>"),b=(0,e.default)("<div></div>"),S=(0,e.default)("<div></div>"),E=(0,e.default)("<div></div>");if(this.$cnt=_,this.$cntInner=b,b.append(S),b.append(E),_.append(b),f&&u.showDevices){var N=c.addPanel({id:"devices-c"}),z=f.render();N.set("appendContent",z).trigger(y)}var R=v.getConfig();R.custom?v.__trgCustom({container:S.get(0)}):R.appendTo||S.append(v.render([])),this.sm=g;var W=g.getConfig(),ct=W.stylePrefix;this.$header=(0,e.default)('<div class="'.concat(ct,'header">').concat(i.t("styleManager.empty"),"</div>")),_.append(this.$header),W.custom?g.__trgCustom({container:E.get(0)}):W.appendTo||E.append(g.render());var _t="views-container",xt=c.getPanel(_t)||c.addPanel({id:_t});xt.set("appendContent",_).trigger(y);var ut=i.getModel();this.listenTo(ut,g.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var i=this,l=i.sender,u=i.sm,c=i.$cntInner,f=i.$header;l&&l.get&&!l.get("active")||!u||(u.getSelected()?(c?.show(),f?.hide()):(c?.hide(),f?.show()))},stop:function(){var i,l;(i=this.$cntInner)===null||i===void 0||i.hide(),(l=this.$header)===null||l===void 0||l.hide()}}}),590:((a,r,t)=>
28{t.r(r),t.d(r,{default:()=>n});var e=t(694);let n={run:function(i,l){this.sender=l;var u=i.getModel(),c=i.Config,f=c.stylePrefix,v=i.TraitManager,g=v.getConfig(),y;if(!g.appendTo){if(!this.$cn){this.$cn=(0,e.default)("<div></div>"),this.$cn2=(0,e.default)("<div></div>"),this.$cn.append(this.$cn2),this.$header=(0,e.default)("<div>").append('<div class="'.concat(g.stylePrefix,'header">').concat(u.t("traitManager.empty"),"</div>")),this.$cn.append(this.$header),g.custom?v.__trgCustom({container:this.$cn2.get(0)}):(this.$cn2.append('<div class="'.concat(f,'traits-label">').concat(u.t("traitManager.label"),"</div>")),this.$cn2.append(v.render()));var _=i.Panels;_.getPanel("views-container")?y=_.getPanel("views-container"):y=_.addPanel({id:"views-container"}),y?.set("appendContent",this.$cn.get(0)).trigger("change:appendContent"),this.target=i.getModel(),this.listenTo(this.target,"component:toggled",this.toggleTm)}this.toggleTm()}},toggleTm:function(){var i=this.sender;i&&i.get&&!i.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()}}}),483:((a,r,t)=>{t.r(r),t.d(r,{default:()=>n});var e=t(523);let n={run:function(l,u,c){c===void 0&&(c={});var f=l.getModel(),v=f.get("clipboard"),g=l.getSelected();v?.length&&g&&(l.getSelectedAll().forEach(function(y){var _,b,S,E=((b=(_=y.delegate)===null||_===void 0?void 0:_.copy)===null||b===void 0?void 0:b.call(_,y))||y,N=E.collection,z;if(N){var R=E.index()+1,W={at:R,action:c.action||"paste-component"};(0,e.contains)(v,E)&&E.get("copyable")?z=N.add(E.clone(),W):z=i(l,v,E.parent(),W)}else{var ct=(S=f.Pages.getSelected())===null||S===void 0?void 0:S.getMainComponent(),W={at:ct?.components().length||0,action:c.action||"paste-component"};z=i(l,v,ct,W)}z=(0,e.isArray)(z)?z:[z],z.forEach(function(_t){return l.trigger("component:paste",_t)})}),g.emitUpdate())}};function i(l,u,c,f){var v=u.filter(function(y){return y.get("copyable")}),g=v.filter(function(y){return l.Components.canMove(c,y).result});return c.components().add(g.map(function(y){return y.clone()}),f)}}),857:((a,r,t)=>{t.r(r),t.d(r,{default:()=>l});var e=t(523),n=function(u,c,f){if(f||arguments.length===2)for(var v=0,g=c.length,y;v<g;v++)(y||!(v in c))&&(y||(y=Array.prototype.slice.call(c,0,v)),y[v]=c[v]);return u.concat(y||Array.prototype.slice.call(c))},i="core:component-outline";let l={getPanels:function(u){return this.panels||(this.panels=u.Panels.getPanels()),this.panels},preventDrag:function(u){u.abort=1},tglEffects:function(u){var c=this.em,f=u?"on":"off";if(c){var v=c.Canvas,g=v.getBody(),y=v.getToolbarEl();y&&(y.style.display=u?"none":"");var _=g.querySelectorAll(".".concat(this.ppfx,"no-pointer"));(0,e.each)(_,function(b){return b.style.pointerEvents=u?"all":""}),c[f]("run:tlb-move:before",this.preventDrag)}},run:function(u,c){var f=this;this.sender=c,this.selected=n([],u.getSelectedAll(),!0),u.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=u.Commands.isActive(i)),this.shouldRunSwVisibility&&u.stopCommand(i),u.getModel().stopDefault();var v=this.getPanels(u),g=u.Canvas.getElement(),y=u.getEl(),_=u.Config.stylePrefix;if(!this.helper){var b=document.createElement("span");b.className="".concat(_,"off-prv fa fa-eye-slash"),y.appendChild(b),b.onclick=function(){return f.stopCommand()},this.helper=b}this.helper.style.display="inline-block",v.forEach(function(E){return E.set("visible",!1)});var S=g.style;S.width="100%",S.height="100%",S.top="0",S.left="0",S.padding="0",S.margin="0",u.refresh(),this.tglEffects(1)},stop:function(u){var c=this,f=c.sender,v=f===void 0?{}:f,g=c.selected;v.set&&v.set("active",0);var y=this.getPanels(u);this.shouldRunSwVisibility&&(u.runCommand(i),this.shouldRunSwVisibility=!1),u.getModel().runDefault(),y.forEach(function(b){return b.set("visible",!0)});var _=u.Canvas.getElement();_.setAttribute("style",""),g&&u.select(g),delete this.selected,this.helper&&(this.helper.style.display="none"),u.refresh(),this.tglEffects()}}}),869:((a,r,t)=>
28{t.r(r),t.d(r,{default:()=>n});var e=function(){return e=Object.assign||function(i){for(var l,u=1,c=arguments.length;u<c;u++){l=arguments[u];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(i[f]=l[f])}return i},e.apply(this,arguments)};let n={run:function(i,l,u){var c=u||{},f=i.Canvas,v=f.getCanvasView(),g=e({appendTo:f.getResizerEl(),prefix:i.getConfig().stylePrefix,posFetcher:v.getElementPos.bind(v),mousePosFetcher:f.getMouseRelativePos.bind(f)},c.options||{}),y=this.canvasResizer;return(!y||c.forceNew)&&(this.canvasResizer=new i.Utils.Resizer(g),y=this.canvasResizer),y.setOptions(g,!0),y.blur(),y.focus(c.el),y},stop:function(){var i;(i=this.canvasResizer)===null||i===void 0||i.blur()}}}),194:((a,r,t)=>{t.r(r),t.d(r,{default:()=>lt});var e=t(523),n=t(268),i=(function(){var H=function(I,B){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,et){U.__proto__=et}||function(U,et){for(var A in et)Object.prototype.hasOwnProperty.call(et,A)&&(U[A]=et[A])},H(I,B)};return function(I,B){if(typeof B!="function"&&B!==null)throw new TypeError("Class extends value "+String(B)+" is not a constructor or null");H(I,B);function U(){this.constructor=I}I.prototype=B===null?Object.create(B):(U.prototype=B.prototype,new U)}})(),l=(function(H){i(I,H);function I(){return H!==null&&H.apply(this,arguments)||this}return I.prototype.defaults=function(){return{command:"",attributes:{}}},I})(n.Kx);let u=l;var c=(function(){var H=function(I,B){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,et){U.__proto__=et}||function(U,et){for(var A in et)Object.prototype.hasOwnProperty.call(et,A)&&(U[A]=et[A])},H(I,B)};return function(I,B){if(typeof B!="function"&&B!==null)throw new TypeError("Class extends value "+String(B)+" is not a constructor or null");H(I,B);function U(){this.constructor=I}I.prototype=B===null?Object.create(B):(U.prototype=B.prototype,new U)}})(),f=(function(H){c(I,H);function I(){return H!==null&&H.apply(this,arguments)||this}return I})(n.pM);let v=f;f.prototype.model=u;var g=t(754),y=(function(){var H=function(I,B){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,et){U.__proto__=et}||function(U,et){for(var A in et)Object.prototype.hasOwnProperty.call(et,A)&&(U[A]=et[A])},H(I,B)};return function(I,B){if(typeof B!="function"&&B!==null)throw new TypeError("Class extends value "+String(B)+" is not a constructor or null");H(I,B);function U(){this.constructor=I}I.prototype=B===null?Object.create(B):(U.prototype=B.prototype,new U)}})(),_=function(){return _=Object.assign||function(H){for(var I,B=1,U=arguments.length;B<U;B++){I=arguments[B];for(var et in I)Object.prototype.hasOwnProperty.call(I,et)&&(H[et]=I[et])}return H},_.apply(this,arguments)},b=(function(H){y(I,H);function I(B){var U=H.call(this,B)||this;return U.em=B.config.em,U}return I.prototype.events=function(){return this.model.get("events")||{mousedown:"handleClick"}},I.prototype.attributes=function(){return this.model.get("attributes")},I.prototype.handleClick=function(B){B.preventDefault(),B.stopPropagation();var U=this.em,et=U.Canvas.getFrameEl().getBoundingClientRect(),A=et.left,gt=et.top,yt=_(_({},B),{clientX:B.clientX-A,clientY:B.clientY-gt});U.trigger("toolbar:run:before",{event:yt}),this.execCommand(yt)},I.prototype.execCommand=function(B){var U=this,et=U.em,A=U.model,gt={event:B},yt=A.get("command"),jt=et.Editor;(0,e.isFunction)(yt)&&yt(jt,null,gt),(0,e.isString)(yt)&&jt.runCommand(yt,gt)},I.prototype.render=function(){var B=this,U=B.em,et=B.$el,A=B.model,gt=A.get("id"),yt=A.get("label"),jt=U.getConfig().stylePrefix;return et.addClass("".concat(jt,"toolbar-item")),gt&&et.addClass("".concat(jt,"toolbar-item__").concat(gt)),yt&&et.append(yt),this},I})(n.Ss);let S=b;var E=(function(){var H=function(I,B){return H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,et){U.__proto__=et}||function(U,et){for(var A in et)Object.prototype.hasOwnProperty.call(et,A)&&(U[A]=et[A])},H(I,B)};return function(I,B){if(typeof B!="function"&&B!==null)throw new TypeError("Class extends value "+String(B)+" is not a constructor or null");H(I,B);function U(){this.constructor=I}
28I.prototype=B===null?Object.create(B):(U.prototype=B.prototype,new U)}})(),N=(function(H){E(I,H);function I(B){var U=H.call(this,B)||this,et=B.em;return U.em=et,U.config={em:et},U.listenTo(U.collection,"reset",U.render),U}return I.prototype.onRender=function(){var B=this.em.config.stylePrefix;this.el.className="".concat(B,"toolbar-items")},I})(g.A);let z=N;N.prototype.itemView=S;var R=t(926),W=t(342),ct=t(683),_t=t(249),xt=function(){return xt=Object.assign||function(H){for(var I,B=1,U=arguments.length;B<U;B++){I=arguments[B];for(var et in I)Object.prototype.hasOwnProperty.call(I,et)&&(H[et]=I[et])}return H},xt.apply(this,arguments)},ut=function(H,I){var B={};for(var U in H)Object.prototype.hasOwnProperty.call(H,U)&&I.indexOf(U)<0&&(B[U]=H[U]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function")for(var et=0,U=Object.getOwnPropertySymbols(H);et<U.length;et++)I.indexOf(U[et])<0&&Object.prototype.propertyIsEnumerable.call(H,U[et])&&(B[U[et]]=H[U[et]]);return B},q;let lt={activeResizer:!1,init:function(){this.onSelect=(0,e.debounce)(this.onSelect,0),(0,e.bindAll)(this,"onHover","onOut","onClick","onFrameScroll","onFrameResize","onFrameUpdated","onContainerChange")},enable:function(){this.frameOff=this.canvasOff=this.adjScroll=null,this.startSelectComponent(),q=!0},startSelectComponent:function(){this.toggleSelectComponent(1),this.em.getSelected()&&this.onSelect()},stopSelectComponent:function(){this.toggleSelectComponent()},toggleSelectComponent:function(H){var I=this,B=this.em,U=B.getConfig().listenToEl,et=B.getContainer().parentNode,A=H?"on":"off",gt={on:R.on,off:R.AU},yt=_t.I.update;!U.length&&et&&U.push(et);var jt=function(te,Xt){gt[A](Xt,"mouseover",I.onHover),gt[A](Xt,"mouseleave",I.onOut),gt[A](Xt,"click",I.onClick),gt[A](te,"scroll",I.onFrameScroll,!0),gt[A](te,"resize",I.onFrameResize)};gt[A](window,"resize",this.onFrameUpdated),gt[A](U,"scroll",this.onContainerChange),B[A]("component:toggled ".concat(yt," undo redo"),this.onSelect,this),B[A]("change:componentHovered",this.onHovered,this),B[A]("component:resize styleable:change component:input",this.updateGlobalPos,this),B[A]("".concat(yt,":toolbar"),this._upToolbar,this),B[A]("frame:updated",this.onFrameUpdated,this),B[A]("canvas:updateTools",this.onFrameUpdated,this),B[A](B.Canvas.events.refresh,this.updateAttached,this),B.Canvas.getFrames().forEach(function(te){var Xt=te.view,he=Xt?.getWindow();he&&jt(he,Xt?.getBody())})},onHover:function(H){H.stopPropagation();var I=this.em,B=H.target,U=(0,W.getComponentView)(B),et=U?.frameView,A=U?.model;if(!A)for(var gt=B.parentNode;!A&>&&!(0,R.ZQ)(gt);)A=(0,W.getComponentModel)(gt),gt=gt.parentNode;this.currentDoc=B.ownerDocument,I.setHovered(A,{useValid:!0}),et&&I.setCurrentFrame(et)},onFrameUpdated:function(){this.updateLocalPos(),this.updateGlobalPos()},onHovered:function(H,I){var B=this,U,et={};
28I?(U=I.views)===null||U===void 0||U.forEach(function(A){var gt=A.el,yt=B.getElementPos(gt);et={el:gt,pos:yt,component:I,view:(0,W.getViewEl)(gt)},gt.ownerDocument===B.currentDoc&&(B.elHovered=et),B.updateToolsLocal(et)}):(this.currentDoc=null,this.elHovered=0,this.updateToolsLocal(),this.canvas.getFrames().forEach(function(A){var gt=A.view,yt=gt&>.getToolsEl();yt&&B.toggleToolsEl(0,0,{el:yt})}))},onSelect:function(){var H=this.em,I=H.getSelected(),B=H.getCurrentFrame(),U=I&&I.getView(B?.model),et=U&&U.el,A={};if(et&&(0,R.zN)(et)){var gt=this.getElementPos(et);A={el:et,pos:gt,component:I,view:(0,W.getViewEl)(et)}}this.elSelected=A,this.updateToolsGlobal(),this.updateLocalPos(A),this.initResize(I)},updateGlobalPos:function(){var H=this.getElSelected();H.el&&(H.pos=this.getElementPos(H.el),this.updateToolsGlobal())},updateLocalPos:function(H){var I=this.getElHovered();I.el&&(I.pos=this.getElementPos(I.el),this.updateToolsLocal(H))},getElHovered:function(){return this.elHovered||{}},getElSelected:function(){return this.elSelected||{}},onOut:function(){this.em.setHovered()},toggleToolsEl:function(H,I,B){B===void 0&&(B={});var U=B.el||this.canvas.getToolsEl(I);return U&&(U.style.display=H?"":"none"),U||{}},showElementOffset:function(H,I,B){B===void 0&&(B={}),q&&this.editor.runCommand("show-offset",{el:H,elPos:I,view:B.view,force:1,top:0,left:0})},hideElementOffset:function(H){this.editor.stopCommand("show-offset",{view:H})},showFixedElementOffset:function(H,I){this.editor.runCommand("show-offset",{el:H,elPos:I,state:"Fixed"})},hideFixedElementOffset:function(){this.editor&&this.editor.stopCommand("show-offset",{state:"Fixed"})},hideHighlighter:function(H){this.canvas.getHighlighter(H).style.opacity=0},onClick:function(H){H.stopPropagation(),H.preventDefault();var I=this.em;if(I.get("_cmpDrag"))return I.set("_cmpDrag");var B=H.target,U=(0,W.getComponentModel)(B);if(!U)for(var et=B.parentNode;!U&&et&&!(0,R.ZQ)(et);)U=(0,W.getComponentModel)(et),et=et.parentNode;if(U){if(I.isEditing()&&(!U.get("textable")&&U.isChildOf("text")||I.getEditing()!==U))return;this.select(U,H)}},select:function(H,I){I===void 0&&(I={}),H&&(this.editor.select(H,{event:I,useValid:!0}),this.initResize(H))},updateBadge:function(H,I,B){B===void 0&&(B={});var U=this.canvas,et=(0,W.getComponentModel)(H),A=this.getBadge(B),gt=A.style;if(!et||!et.get("badgable")){gt.display="none";return}if(!B.posOnly){var yt=this.canvas.getConfig(),jt=et.getIcon(),te=yt.pStylePrefix||"",Xt="".concat(te,"badge"),he=yt.customBadgeLabel,mt="".concat(jt?'<div class="'.concat(Xt,'__icon">').concat(jt,"</div>"):"",` 29 <div class="`).concat(Xt,'__name">').concat(et.getName(),"</div>");A.innerHTML=he?he(et):mt}var bt="px";gt.display="block";var It=U.getTargetToElementFixed(H,A,{pos:I}),nt=It.top,wt=B.leftOff<0?-B.leftOff:0;gt.top=nt+bt,gt.left=wt+bt},showHighlighter:function(H){this.canvas.getHighlighter(H).style.opacity=""},initResize:function(H){var I=this,B=I.em,U=I.canvas,et=B.Editor,A=!(0,e.isElement)(H)&&(0,R.GW)(H)?H:B.getSelected(),gt=A?.get("resizable"),yt=ct.F.Resize,jt=U.hasCustomSpot(yt);if(U.removeSpots({type:yt}),A&>){U.addSpot({type:yt,component:A});var te=(0,e.isElement)(H)?H:A.getEl(),Xt=(0,W.isObject)(gt)?gt:{},he=Xt.onStart,mt=he===void 0?function(){}:he,bt=Xt.onMove,It=bt===void 0?function(){}:bt,nt=Xt.onEnd,wt=nt===void 0?function(){}:nt,Ot=Xt.updateTarget,Ht=Ot===void 0?function(){}:Ot,Vt=ut(Xt,["onStart","onMove","onEnd","updateTarget"]);if(jt||!te||this.activeResizer)return;var Nt,Jt=B.config,Ee=Jt.stylePrefix||"",ue="".concat(Ee,"resizing"),Be=this,je={component:A,el:te},pe=function(F,$,ot){var vt=ot.docs;vt&&vt.forEach(function(K){var ft=K.body,it=ft.className||"";ft.className=(F=="add"?"".concat(it," ").concat(ue):it.replace(ue,"")).trim()})},T=xt({onStart:function(F,$){mt(F,$);var ot=$.el,vt=$.config,K=$.resizer,ft=vt.keyHeight,it=vt.keyWidth,ne=vt.currentUnit,ye=vt.keepAutoHeight,de=vt.keepAutoWidth;pe("add",F,$),Nt=B.Styles.getModelToStyle(A),U.toggleFramesEvents(!1);var V=getComputedStyle(ot),tt=Nt.getStyle(),M=tt[it];
29vt.autoWidth=de&&M==="auto",isNaN(parseFloat(M))&&(M=V[it]);var Tt=tt[ft];vt.autoHeight=ye&&Tt==="auto",isNaN(parseFloat(Tt))&&(Tt=V[ft]),K.startDim.w=parseFloat(M),K.startDim.h=parseFloat(Tt),q=!1,ne&&(vt.unitHeight=(0,W.getUnitFromValue)(Tt),vt.unitWidth=(0,W.getUnitFromValue)(M)),Be.activeResizer=!0,et.trigger("component:resize",xt(xt({},je),{type:"start"}))},onMove:function(F){It(F),et.trigger("component:resize",xt(xt({},je),{type:"move"}))},onEnd:function(F,$){wt(F,$),pe("remove",F,$),et.trigger("component:resize",xt(xt({},je),{type:"end"})),U.toggleFramesEvents(!0),q=!0,Be.activeResizer=!1},updateTarget:function(F,$,ot){if(Ht(F,$,ot),!!Nt){var vt=ot.store,K=ot.selectedHandler,ft=ot.config,it=ft.keyHeight,ne=ft.keyWidth,ye=ft.autoHeight,de=ft.autoWidth,V=ft.unitWidth,tt=ft.unitHeight,M=["tc","bc"].indexOf(K)>=0,Tt=["cl","cr"].indexOf(K)>=0,ht={};if(!M){var Lt=U.getBody().offsetWidth,Yt=$.w<Lt?$.w:Lt;ht[ne]=de?"auto":"".concat(Yt).concat(V)}Tt||(ht[it]=ye?"auto":"".concat($.h).concat(tt)),B.getDragMode(A)&&(ht.top="".concat($.t).concat(tt),ht.left="".concat($.l).concat(V));var qt=xt(xt({},ht),{__p:!vt});Nt.addStyle(qt,{avoidStore:!vt}),B.Styles.__emitCmpStyleUpdate(qt,{components:B.getSelected()})}}},Vt);this.resizer=et.runCommand("resize",{el:te,options:T,force:1})}else{if(jt)return;et.stopCommand("resize"),this.resizer=null}},updateToolbar:function(H){var I=this.canvas,B=this.config.em,U=H===B?B.getSelected():H,et=I.getToolbarEl(),A=et.style,gt=U.get("toolbar"),yt=B.config.showToolbar,jt=!I.hasCustomSpot(ct.F.Select);if(U&&yt&>&>.length&&jt){if(A.display="",!this.toolbar){et.innerHTML="",this.toolbar=new v(gt);var te=new z({collection:this.toolbar,em:B});et.appendChild(te.render().el)}this.toolbar.reset(gt),A.top="-100px",A.left="0"}else A.display="none"},updateToolbarPos:function(H){var I="px",B=this.canvas.getToolbarEl().style;
29B.top="".concat(H.top).concat(I),B.left="".concat(H.left).concat(I),B.opacity=""},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},getBadge:function(H){return H===void 0&&(H={}),this.canvas.getBadgeEl(H.view)},onFrameScroll:function(){this.updateTools(),this.canvas.refreshSpots()},onFrameResize:function(){this.canvas.refresh({all:!0})},updateTools:function(){this.updateLocalPos(),this.updateGlobalPos()},isCompSelected:function(H){return H&&H.get("status")==="selected"},updateToolsLocal:function(H){var I=this.em.getConfig(),B=H||this.getElHovered(),U=B.el,et=B.pos,A=B.view,gt=B.component;if(!U){this.lastHovered=0;return}var yt=gt.get("hoverable"),jt=this.lastHovered!==U,te=jt?{}:{posOnly:1},Xt=this.canvas.hasCustomSpot(ct.F.Hover);jt&&yt&&(this.lastHovered=U,Xt?this.hideHighlighter(A):this.showHighlighter(A),this.showElementOffset(U,et,{view:A})),this.isCompSelected(gt)&&(this.hideHighlighter(A),!I.showOffsetsSelected&&this.hideElementOffset(A));var he="px",mt=this.toggleToolsEl(1,A),bt=mt.style,It=this.canvas.canvasRectOffset(U,et),nt=It.top,wt=It.left;!Xt&&this.updateBadge(U,et,xt(xt({},te),{view:A,topOff:nt,leftOff:wt})),bt.top=nt+he,bt.left=wt+he,bt.width=et.width+he,bt.height=et.height+he,this._trgToolUp("local",{component:gt,el:mt,top:nt,left:wt,width:et.width,height:et.height})},_upToolbar:(0,e.debounce)(function(){this.updateToolsGlobal({force:1})},0),_trgToolUp:function(H,I){I===void 0&&(I={}),this.em.trigger("canvas:tools:update",xt({type:H},I))},updateToolsGlobal:function(H){H===void 0&&(H={});var I=this.getElSelected(),B=I.el,U=I.pos,et=I.component;if(!B){this.toggleToolsEl(),this.lastSelected=0;return}var A=this.canvas,gt=this.lastSelected!==B;(gt||H.force)&&(this.lastSelected=B,this.updateToolbar(et));var yt="px",jt=this.toggleToolsEl(1),te=jt.style,Xt=A.getTargetToElementFixed(B,A.getToolbarEl(),{pos:U}),he=Xt.canvasOffsetTop,mt=Xt.canvasOffsetLeft;te.top=he+yt,te.left=mt+yt,te.width=U.width+yt,te.height=U.height+yt,this.updateToolbarPos({top:Xt.top,left:Xt.left}),this._trgToolUp("global",{component:et,el:jt,top:he,left:mt,width:U.width,height:U.height})},updateAttached:(0,e.debounce)(function(){this.updateGlobalPos()},0),onContainerChange:(0,e.debounce)(function(){this.em.refreshCanvas()},150),getElementPos:function(H){return this.canvas.getCanvasView().getElementPos(H,{noScroll:!0})},hideBadge:function(){this.getBadge().style.display="none"},cleanPrevious:function(H){H&&H.set({status:"",state:""})},getContentWindow:function(){return this.canvas.getWindow()},run:function(H){(0,W.hasWin)()&&(this.editor=H&&H.get("Editor"),this.enable())},stop:function(H,I,B){if(B===void 0&&(B={}),!!(0,W.hasWin)()){var U=this,et=U.em,A=U.editor;this.onHovered(),this.stopSelectComponent(),!B.preserveSelected&&et.setSelected(),this.toggleToolsEl(),A&&A.stopCommand("resize")}}}}),582:((a,r,t)=>{t.r(r),t.d(r,{default:()=>n});var e=t(694);let n={startSelectPosition:function(i,l,u){var c=this;u===void 0&&(u={}),this.isPointed=!1;var f=this.em.Utils,v=i.ownerDocument.body;f&&!this.sorter&&(this.sorter=new f.Sorter({container:v,placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:l,wmargin:1,nested:1,em:this.em,canvasRelative:1,scale:function(){return c.em.getZoomDecimal()}})),u.onStart&&(this.sorter.onStart=u.onStart),i&&this.sorter.startSort(i,{container:v})},getOffsetDim:function(){var i=this.offset(this.canvas.getFrameEl()),l=this.offset(this.canvas.getElement()),u=i.top-l.top,c=i.left-l.left;return{top:u,left:c}},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,e.default)(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?(0,e.default)(this.cDim[this.posIndex][5]).parent():(0,e.default)(this.outsideElem),this.posTargetModel=this.posTargetEl.data("model"),this.posTargetCollection=this.posTargetEl.data("model-comp"))},enable:function(){this.startSelectPosition()},nearFloat:function(i,l,u){var c=i||0,f=l||"before",v=u.length,g=v!==0&&f=="after"&&c==v;return v!==0&&(!g&&!u[c][4]||u[c-1]&&!u[c-1][4]||g&&!u[c-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}}),131:((a,r,t)=>
29{t.r(r),t.d(r,{default:()=>u});var e=t(523),n=t(683),i=t(694),l=function(){return l=Object.assign||function(c){for(var f,v=1,g=arguments.length;v<g;v++){f=arguments[v];for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(c[y]=f[y])}return c},l.apply(this,arguments)};let u={getOffsetMethod:function(c){var f=c||"";return"get"+f+"OffsetViewerEl"},run:function(c,f,v){var g=this.canvas,y=v||{},_=y.state||"",b=c.getConfig(),S=this.em.getZoomDecimal(),E=y.el;if(!b.showOffsets||!(E instanceof HTMLElement)||!b.showOffsetsSelected&&_=="Fixed"){c.stopCommand("".concat(this.id),v);return}if(!g.hasCustomSpot(n.F.Spacing)){var N=l({},y.elPos||g.getElementPos(E));(0,e.isUndefined)(y.top)||(N.top=y.top),(0,e.isUndefined)(y.left)||(N.left=y.left);var z=window.getComputedStyle(E),R=this.ppfx,W=_+"State",ct=this.getOffsetMethod(_),_t=g[ct](v.view);_t.style.opacity="";var xt=this["marginT"+_],ut=this["marginB"+_],q=this["marginL"+_],lt=this["marginR"+_],H=this["padT"+_],I=this["padB"+_],B=this["padL"+_],U=this["padR"+_];if(_t.childNodes.length&&(this[W]="1",xt=_t.querySelector("[data-offset-m-t]"),ut=_t.querySelector("[data-offset-m-b]"),q=_t.querySelector("[data-offset-m-l]"),lt=_t.querySelector("[data-offset-m-r]"),H=_t.querySelector("[data-offset-p-t]"),I=_t.querySelector("[data-offset-p-b]"),B=_t.querySelector("[data-offset-p-l]"),U=_t.querySelector("[data-offset-p-r]")),!this[W]){var et=_.toLowerCase(),A=et+"margin-v",gt=et+"padding-v",yt=(0,i.default)('<div class="'.concat(R,'marginName">')).get(0),jt=(0,i.default)('<div class="'.concat(R,'paddingName">')).get(0),te=R+A+"-el",Xt=R+gt+"-el",he="".concat(te," ").concat(R+A),mt="".concat(Xt," ").concat(R+gt);xt=(0,i.default)('<div class="'.concat(he,'-top"></div>')).get(0),ut=(0,i.default)('<div class="'.concat(he,'-bottom"></div>')).get(0),q=(0,i.default)('<div class="'.concat(he,'-left"></div>')).get(0),lt=(0,i.default)('<div class="'.concat(he,'-right"></div>')).get(0),H=(0,i.default)('<div class="'.concat(mt,'-top"></div>')).get(0),I=(0,i.default)('<div class="'.concat(mt,'-bottom"></div>')).get(0),B=(0,i.default)('<div class="'.concat(mt,'-left"></div>')).get(0),U=(0,i.default)('<div class="'.concat(mt,'-right"></div>')).get(0),this["marginT"+_]=xt,this["marginB"+_]=ut,this["marginL"+_]=q,this["marginR"+_]=lt,this["padT"+_]=H,this["padB"+_]=I,this["padL"+_]=B,this["padR"+_]=U,yt.appendChild(xt),yt.appendChild(ut),yt.appendChild(q),yt.appendChild(lt),jt.appendChild(H),jt.appendChild(I),jt.appendChild(B),jt.appendChild(U),_t.appendChild(yt),_t.appendChild(jt),this[W]="1"}var bt="px",It=parseFloat(z.marginLeft.replace(bt,""))*S,nt=parseFloat(z.marginRight.replace(bt,""))*S,wt=parseFloat(z.marginTop.replace(bt,""))*S,Ot=parseFloat(z.marginBottom.replace(bt,""))*S,Ht=xt.style,Vt=ut.style,Nt=q.style,Jt=lt.style,Ee=H.style,ue=I.style,Be=B.style,je=U.style,pe=parseFloat(N.left),T=parseFloat(z.width)*S+bt;Ht.height=wt+bt,Ht.width=T,Ht.top=N.top-wt+bt,Ht.left=pe+bt,Vt.height=Ot+bt,Vt.width=T,Vt.top=N.top+N.height+bt,Vt.left=pe+bt;var F=N.height+wt+Ot+bt,$=N.top-wt+bt;Nt.height=F,Nt.width=It+bt,Nt.top=$,Nt.left=pe-It+bt,Jt.height=F,Jt.width=nt+bt,Jt.top=$,Jt.left=pe+N.width+bt;var ot=parseFloat(z.paddingTop)*S;Ee.height=ot+bt;var vt=parseFloat(z.paddingBottom)*S;ue.height=vt+bt;var K=N.height-vt-ot+bt,ft=N.top+ot+bt;Be.height=K,Be.width=parseFloat(z.paddingLeft)*S+bt,Be.top=ft;var it=parseFloat(z.paddingRight)*S;je.height=K,je.width=it+bt,je.top=ft}},stop:function(c,f,v){v===void 0&&(v={});var g=v||{},y=g.state||"",_=this.getOffsetMethod(y),b=v.view,S=this.canvas,E=S[_](b);E.style.opacity=0}}}),229:((a,r,t)=>{t.r(r),t.d(r,{default:()=>i});var e=t(523),n=t(342);let i={init:function(){(0,e.bindAll)(this,"_onFramesChange")},run:function(l){this.toggleVis(l,!0)},stop:function(l){this.toggleVis(l,!1)},toggleVis:function(l,u){if(u===void 0&&(u=!0),!l.Commands.isActive("preview")){var c=l.Canvas,f=u?"on":"off",v=c.getModel();v[f]("change:frames",this._onFramesChange),this.handleFrames(c.getFrames(),u)}},handleFrames:function(l,u){var c=this;l.forEach(function(f){var v;!((v=f.view)===null||v===void 0)&&v.loaded&&c._upFrame(f,u),f.__ol||(f.on("loaded",function(){return c._upFrame(f)}),f.__ol=!0)})},_onFramesChange:function(l,u){this.handleFrames(u)},_upFrame:function(l,u){var c,f=this,v=f.ppfx,g=f.em,y=f.id,_=(0,n.isDef)(u)?u:g.Commands.isActive(y),b=_?"add":"remove",S="".concat(v,"dashed");(c=l.view)===null||c===void 0||c.getBody().classList[b](S)}}}),268:((a,r,t)=>
29{t.d(r,{Kx:()=>u,Ss:()=>f,lK:()=>g,pM:()=>c,x2:()=>v});var e=t(391),n=t.n(e),i=(function(){var _=function(b,S){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,N){E.__proto__=N}||function(E,N){for(var z in N)Object.prototype.hasOwnProperty.call(N,z)&&(E[z]=N[z])},_(b,S)};return function(b,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");_(b,S);function E(){this.constructor=b}b.prototype=S===null?Object.create(S):(E.prototype=S.prototype,new E)}})(),l=function(){return l=Object.assign||function(_){for(var b,S=1,E=arguments.length;S<E;S++){b=arguments[S];for(var N in b)Object.prototype.hasOwnProperty.call(b,N)&&(_[N]=b[N])}return _},l.apply(this,arguments)},u=(function(_){i(b,_);function b(){return _!==null&&_.apply(this,arguments)||this}return b})(n().Model),c=(function(_){i(b,_);function b(){return _!==null&&_.apply(this,arguments)||this}return b})(n().Collection),f=(function(_){i(b,_);function b(){return _!==null&&_.apply(this,arguments)||this}return b})(n().View),v=(function(_){return _.Screen="screen",_.World="world",_})(v||{}),g={x:0,y:0},y=l(l({},g),{width:0,height:0})}),249:((a,r,t)=>{t.d(r,{I:()=>n,t:()=>e});var e=(function(i){return i.remove="component:remove",i.add="component:add",i.move="component:move",i})(e||{}),n=(function(i){return i.add="component:add",i.remove="component:remove",i.removeBefore="component:remove:before",i.create="component:create",i.update="component:update",i.updateInside="component:update-inside",i.symbolMainAdd="symbol:main:add",i.symbolMainUpdate="symbol:main:update",i.symbolMainUpdateDeep="symbol:main:update-deep",i.symbolMainRemove="symbol:main:remove",i.symbolMain="symbol:main",i.symbolInstanceAdd="symbol:instance:add",i.symbolInstanceRemove="symbol:instance:remove",i.symbolInstance="symbol:instance",i.symbol="symbol",i})(n||{})}),754:((a,r,t)=>{t.d(r,{A:()=>u});var e=t(523),n=t(268),i=(function(){var c=function(f,v){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,y){g.__proto__=y}||function(g,y){for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(g[_]=y[_])},c(f,v)};return function(f,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");c(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}})(),l=(function(c){i(f,c);function f(v,g,y){v===void 0&&(v={}),y===void 0&&(y=!1);var _=c.call(this,v)||this;return _.itemsView="",_.itemType="type",_.reuseView=!1,_.config=g||v.config||{},y&&_.listenTo(_.collection,"add",_.addTo),_.items=[],_}return f.prototype.addTo=function(v){this.add(v)},f.prototype.itemViewNotFound=function(v){var g=this,y=g.config,_=g.ns,b=y.em,S="".concat(_?"[".concat(_,"]: "):"","'").concat(v,"' type not found");b&&b.logWarning(S)},f.prototype.add=function(v,g){var y=this,_=y.config,b=y.reuseView,S=y.items,E=this.itemsView||{},N=["button","checkbox","color","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"],z=g||null,R=this.itemView,W=v.get(this.itemType),ct;E[W]?R=E[W]:W&&!E[W]&&!(0,e.includes)(N,W)&&this.itemViewNotFound(W),v.view&&b?ct=v.view:ct=new R({model:v,config:_},_),S&&S.push(ct);var _t=ct.render().el;z?z.appendChild(_t):this.$el.append(_t)},f.prototype.render=function(){var v=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each(function(g){this.add(g,v)},this),this.$el.append(v),this.onRender(),this},f.prototype.onRender=function(){},f.prototype.onRemoveBefore=function(v,g){},f.prototype.onRemove=function(v,g){},f.prototype.remove=function(v){v===void 0&&(v={});var g=this.items;return this.onRemoveBefore(g,v),this.clearItems(),c.prototype.remove.call(this),this.onRemove(g,v),this},f.prototype.clearItems=function(){var v=this.items||[]},f})(n.Ss);let u=l;l.prototype.itemView=""}),14:((a,r,t)=>{t.d(r,{A:()=>f});var e=t(523),n=t(926),i=function(){return i=Object.assign||function(v){for(var g,y=1,_=arguments.length;y<_;y++){g=arguments[y];for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&(v[b]=g[b])}return v},i.apply(this,arguments)},l=function(){return{x:0,y:0}},u=["x","y"],c=(function(){function v(g){return g===void 0&&(g={}),this.opts={snapOffset:5,scale:1},(0,e.bindAll)(this,"drag","stop","keyHandle","handleScroll"),this.setOptions(g),this.delta=l(),this.lastScroll=l(),this.lastScrollDiff=l(),this.startPointer=l(),this.startPosition=l(),this.globScrollDiff=l(),this.currentPointer=l(),this.position=l(),this.guidesStatic=[],this.guidesTarget=[],this.docs=[],this}return v.prototype.setOptions=function(g){g===void 0&&(g={}),this.opts=i(i({},this.opts),g)},v.prototype.toggleDrag=function(g){var y=this.getDocumentEl(),_=this.getContainerEl(),b=this.getWindowEl(),S=g?"on":"off",E={on:n.on,off:n.AU};E[S](_,"mousemove dragover",this.drag),E[S](y,"mouseup dragend touchend",this.stop),E[S](y,"keydown",this.keyHandle),E[S](b,"scroll",this.handleScroll)},v.prototype.handleScroll=function(){var g=this,y=g.lastScroll,_=g.delta,b=this.getScrollInfo(),S={x:b.x-y.x,y:b.y-y.y};this.move(_.x+S.x,_.y+S.y),this.lastScrollDiff=S},v.prototype.start=function(g){var y=this.opts,_=y.onStart;this.toggleDrag(!0),this.startPointer=this.getPointerPos(g),this.guidesStatic=(0,e.result)(y,"guidesStatic")||[],this.guidesTarget=(0,e.result)(y,"guidesTarget")||[],(0,e.isFunction)(_)&&_(g,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff=l(),this.globScrollDiff=l(),this.drag(g)},v.prototype.drag=function(g){var y=this,_=this,b=_.opts,S=_.lastScrollDiff,E=_.globScrollDiff,N=b.onDrag,z=this.startPointer,R=this.getPointerPos(g),W={x:E.x+S.x,y:E.y+S.y};this.globScrollDiff=W;var ct={x:R.x-z.x+W.x,y:R.y-z.y+W.y};this.lastScrollDiff=l();var _t=this.lockedAxis;g.shiftKey?_t=!_t&&this.detectAxisLock(ct.x,ct.y):_t=null,_t==="x"?ct.x=z.x:_t==="y"&&(ct.y=z.y);var xt=function(B){u.forEach(function(U){return B[U]=B[U]*(0,e.result)(b,"scale")}),y.delta=B,y.move(B.x,B.y),(0,e.isFunction)(N)&&N(g,y)},ut=i({},ct);if(this.currentPointer=R,this.lockedAxis=_t,this.lastScroll=this.getScrollInfo(),xt(ct),this.guidesTarget.length){var q=this.snapGuides(ut),lt=q.newDelta,H=q.trgX,I=q.trgY;(H||I)&&xt(lt)}g.which===0&&this.stop(g)},v.prototype.snapGuides=function(g){var y=this,_=g,b=this,S=b.trgX,E=b.trgY;return this.guidesTarget.forEach(function(N){N.x&&y.trgX||N.y&&y.trgY||(N.active=!1,y.guidesStatic.forEach(function(z){if(!(N.y&&z.x||N.x&&z.y)){var R=N.y&&z.y,W=R?"y":"x",ct=N[W],_t=z[W],xt=g[W],ut=R?E:S;if(y.isPointIn(ct,_t)&&(0,e.isUndefined)(ut)){var q=xt-(ct-_t);y.setGuideLock(N,q)}}}))}),S=this.trgX,E=this.trgY,u.forEach(function(N){var z=N.toUpperCase(),R=y["trg".concat(z)];R&&!y.isPointIn(g[N],R.lock)&&(y.setGuideLock(R,null),R=null),R&&!(0,e.isUndefined)(R.lock)&&(_[N]=R.lock)}),{newDelta:_,trgX:this.trgX,trgY:this.trgY}},v.prototype.isPointIn=function(g,y,_){var b=_===void 0?{}:_,S=b.offset,E=S||this.opts.snapOffset||0;return g>=y&&g<=y+E||g<=y&&g>=y-E},v.prototype.setGuideLock=function(g,y){var _=(0,e.isUndefined)(g.x)?"Y":"X",b="trg".concat(_);return y!==null?(g.active=!0,g.lock=y,this[b]=g):(delete g.active,delete g.lock,delete this[b]),g},v.prototype.stop=function(g,y){y===void 0&&(y={});var _=this.delta,b=!!y.cancel,S=b?0:_.x,E=b?0:_.y;this.toggleDrag(),this.lockedAxis=null,this.move(S,E,!0);var N=this.opts.onEnd;(0,e.isFunction)(N)&&N(g,this,{cancelled:b})}
29,v.prototype.keyHandle=function(g){(0,n.v$)(g)&&this.stop(g,{cancel:!0})},v.prototype.move=function(g,y,_){var b=this,S=b.el,E=b.opts,N=this.startPosition;if(N){var z=E.setPosition,R=N.x+g,W=N.y+y;this.position={x:R,y:W,end:_},(0,e.isFunction)(z)&&z(this.position),S&&(S.style.left="".concat(R,"px"),S.style.top="".concat(W,"px"))}},v.prototype.getContainerEl=function(){var g=this.opts.container;return g?[g]:this.getDocumentEl()},v.prototype.getWindowEl=function(){var g=this.getContainerEl();return g.map(function(y){var _=y.ownerDocument||y;return _.defaultView||_.parentWindow})},v.prototype.getDocumentEl=function(g){var y=this.opts.doc;if(g=g||this.el,!this.docs.length){var _=[document];g&&_.push(g.ownerDocument),y&&_.push(y),this.docs=_}return this.docs},v.prototype.getPointerPos=function(g){var y=this.opts.getPointerPosition,_=(0,n.G2)(g);return y?y(g):{x:_.clientX,y:_.clientY}},v.prototype.getStartPosition=function(){var g=this,y=g.el,_=g.opts,b=_.getPosition,S=l();return(0,e.isFunction)(b)?S=b():y&&(S={x:parseFloat(y.style.left),y:parseFloat(y.style.top)}),S},v.prototype.getScrollInfo=function(){var g=this.opts.doc,y=g&&g.body;return{y:y?y.scrollTop:0,x:y?y.scrollLeft:0}},v.prototype.detectAxisLock=function(g,y){var _=g,b=y,S=Math.abs(_),E=Math.abs(b);if(b>=S||b<=-S)return"x";if(_>E||_<-E)return"y"},v})();let f=c}),694:((a,r,t)=>{t.r(r),t.d(r,{default:()=>cn});var e=typeof document<"u"?document:null,n=typeof window<"u"?window:null,i=Array.prototype,l=i.filter,u=i.indexOf,c=i.map,f=i.push,v=i.reverse,g=i.slice,y=i.splice,_=/^#[\w-]*$/,b=/^\.[\w-]*$/,S=/<.+>/,E=/^\w+$/;function N(j,Z){return Z===void 0&&(Z=e),b.test(j)?Z.getElementsByClassName(j.slice(1)):E.test(j)?Z.getElementsByTagName(j):Z.querySelectorAll(j)}function z(j,Z){if(Z===void 0&&(Z=e),!!j){if(j.__cash)return j;var at=j;if(B(j)){if(Z.__cash&&(Z=Z[0]),at=_.test(j)?Z.getElementById(j.slice(1)):S.test(j)?Ce(j):N(j,Z),!at)return}else if(I(j))return this.ready(j);(at.nodeType||at===n)&&(at=[at]),this.length=at.length;for(var Pt=0,zt=this.length;Pt<zt;Pt++)this[Pt]=at[Pt]}}function R(j,Z){return new z(j,Z)}var W=R.fn=R.prototype=z.prototype={constructor:R,__cash:!0,length:0,splice:y};W.get=function(j){return j===void 0?g.call(this):this[j<0?j+this.length:j]},W.eq=function(j){return R(this.get(j))},W.first=function(){return this.eq(0)},W.last=function(){return this.eq(-1)},W.map=function(j){return R(c.call(this,function(Z,at){return j.call(Z,at,Z)}))},W.slice=function(){return R(g.apply(this,arguments))};var ct=/(?:^\w|[A-Z]|\b\w)/g,_t=/[\s-_]+/g;function xt(j){return j.replace(ct,function(Z,at){return Z[at?"toUpperCase":"toLowerCase"]()}).replace(_t,"")}R.camelCase=xt;function ut(j,Z){for(var at=0,Pt=j.length;at<Pt&&Z.call(j[at],j[at],at,j)!==!1;at++);}R.each=ut,W.each=function(j){return ut(this,function(Z,at){return j.call(Z,at,Z)}),this},W.removeProp=function(j){return this.each(function(Z,at){delete at[j]})};function q(j){j===void 0&&(j=this);for(var Z=arguments,at=Z.length,Pt=at<2?0:1;Pt<at;Pt++)for(var zt in Z[Pt])j[zt]=Z[Pt][zt];return j}R.extend=W.extend=q;var lt=1;R.guid=lt;function H(j,Z){var at=j&&(j.matches||j.webkitMatchesSelector||j.mozMatchesSelector||j.msMatchesSelector||j.oMatchesSelector);return!!at&&at.call(j,Z)}R.matches=H;function I(j){return typeof j=="function"}R.isFunction=I;function B(j){return typeof j=="string"}R.isString=B;function U(j){return!isNaN(parseFloat(j))&&isFinite(j)}R.isNumeric=U;var et=Array.isArray;R.isArray=et,W.prop=function(j,Z){if(j){if(B(j))return arguments.length<2?this[0]&&this[0][j]:this.each(function(Pt,zt){zt[j]=Z});for(var at in j)this.prop(at,j[at]);return this}};function A(j){return B(j)?function(Z,at){return H(at,j)}:j.__cash?function(Z,at){return j.is(at)}:function(Z,at,Pt){return at===Pt}}W.filter=function(j){if(!j)return R();var Z=I(j)?j:A(j);return R(l.call(this,function(at,Pt){return Z.call(at,Pt,at,j)}))};var gt=/\S+/g;function yt(j){return B(j)?j.match(gt)||[]:[]}W.hasClass=function(j){var Z=yt(j),at=!1;return Z.length&&this.each(function(Pt,zt){return at=zt.classList.contains(Z[0]),!at}),at},W.removeAttr=function(j){var Z=yt(j);return Z.length?this.each(function(at,Pt){ut(Z,function(zt){Pt.removeAttribute(zt)})}):this},W.attr=function(j,Z){if(j){if(B(j)){if(arguments.length<2){if(!this[0])return;var at=this[0].getAttribute(j);return at===null?void 0:at}return Z===null?this.removeAttr(j):this.each(function(zt,ie){ie.setAttribute(j,Z)})}for(var Pt in j)this.attr(Pt,j[Pt]);return this}},W.toggleClass=function(j,Z){var at=yt(j),Pt=Z!==void 0;return at.length?this.each(function(zt,ie){ut(at,function(ge){Pt?Z?ie.classList.add(ge):ie.classList.remove(ge):ie.classList.toggle(ge)})}):this},W.addClass=function(j){return this.toggleClass(j,!0)},W.removeClass=function(j){return arguments.length?this.toggleClass(j,!1):this.attr("class","")};function jt(j){return j.filter(function(Z,at,Pt){return Pt.indexOf(Z)===at})}R.unique=jt,W.add=function(j,Z){return R(jt(this.get().concat(R(j,Z).get())))};function te(j,Z,at){if(j.nodeType===1){var Pt=n.getComputedStyle(j,null);return Z?at?Pt.getPropertyValue(Z):Pt[Z]:Pt}}function Xt(j,Z){return parseInt(te(j,Z),10)||0}var he=/^--/;function mt(j){return he.test(j)}var bt={},It=e&&e.createElement("div"),nt=It?It.style:{},wt=["webkit","moz","ms","o"];function Ot(j,Z){if(Z===void 0&&(Z=mt(j)),Z)return j;if(!bt[j]){var at=xt(j),Pt=""+at.charAt(0).toUpperCase()+at.slice(1),zt=(at+" "+wt.join(Pt+" ")+Pt).split(" ");ut(zt,function(ie){if(ie in nt)return bt[j]=ie,!1})}return bt[j]}R.prefixedProp=Ot;var Ht={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};
29function Vt(j,Z,at){return at===void 0&&(at=mt(j)),!at&&!Ht[j]&&U(Z)?Z+"px":Z}W.css=function(j,Z){if(B(j)){var at=mt(j);return j=Ot(j,at),arguments.length<2?this[0]&&te(this[0],j,at):j?(Z=Vt(j,Z,at),this.each(function(zt,ie){ie.nodeType===1&&(at?ie.style.setProperty(j,Z):ie.style[j]=Z)})):this}for(var Pt in j)this.css(Pt,j[Pt]);return this};var Nt="__cashData",Jt=/^data-(.*)/;R.hasData=function(j){return Nt in j};function Ee(j){return j[Nt]=j[Nt]||{}}function ue(j,Z){var at=Ee(j);if(Z){if(!(Z in at)){var Pt=j.dataset?j.dataset[Z]||j.dataset[xt(Z)]:R(j).attr("data-"+Z);if(Pt!==void 0){try{Pt=JSON.parse(Pt)}catch(zt){}at[Z]=Pt}}return at[Z]}return at}function Be(j,Z){Z===void 0?delete j[Nt]:delete Ee(j)[Z]}function je(j,Z,at){Ee(j)[Z]=at}W.data=function(j,Z){var at=this;if(!j)return this[0]?(ut(this[0].attributes,function(zt){var ie=zt.name.match(Jt);ie&&at.data(ie[1])}),ue(this[0])):void 0;if(B(j))return Z===void 0?this[0]&&ue(this[0],j):this.each(function(zt,ie){return je(ie,j,Z)});for(var Pt in j)this.data(Pt,j[Pt]);return this},W.removeData=function(j){return this.each(function(Z,at){return Be(at,j)})};function pe(j,Z){return Xt(j,"border"+(Z?"Left":"Top")+"Width")+Xt(j,"padding"+(Z?"Left":"Top"))+Xt(j,"padding"+(Z?"Right":"Bottom"))+Xt(j,"border"+(Z?"Right":"Bottom")+"Width")}ut(["Width","Height"],function(j){W["inner"+j]=function(){if(this[0])return this[0]===n?n["inner"+j]:this[0]["client"+j]}}),ut(["width","height"],function(j,Z){W[j]=function(at){return this[0]?arguments.length?(at=parseInt(at,10),this.each(function(Pt,zt){if(zt.nodeType===1){var ie=te(zt,"boxSizing");zt.style[j]=Vt(j,at+(ie==="border-box"?pe(zt,!Z):0))}})):this[0]===n?this[0][xt("outer-"+j)]:this[0].getBoundingClientRect()[j]-pe(this[0],!Z):at===void 0?void 0:this}}),ut(["Width","Height"],function(j,Z){W["outer"+j]=function(at){if(this[0])return this[0]===n?n["outer"+j]:this[0]["offset"+j]+(at?Xt(this[0],"margin"+(Z?"Top":"Left"))+Xt(this[0],"margin"+(Z?"Bottom":"Right")):0)}});function T(j,Z){for(var at=0,Pt=Z.length;at<Pt;at++)if(j.indexOf(Z[at])<0)return!1;return!0}function F(j,Z,at){ut(j[at],function(Pt){var zt=Pt[0],ie=Pt[1];Z.removeEventListener(at,ie)}),delete j[at]}var $="__cashEvents",ot=".";function vt(j){return j[$]=j[$]||{}}function K(j,Z,at,Pt){Pt.guid=Pt.guid||lt++;var zt=vt(j);zt[Z]=zt[Z]||[],zt[Z].push([at,Pt]),j.addEventListener(Z,Pt)}function ft(j){var Z=j.split(ot);return[Z[0],Z.slice(1).sort()]}function it(j,Z,at,Pt){var zt=vt(j);if(Z){var ie=zt[Z];if(!ie)return;Pt&&(Pt.guid=Pt.guid||lt++),zt[Z]=ie.filter(function(ge){var rn=ge[0],Fe=ge[1];if(Pt&&Fe.guid!==Pt.guid||!T(rn,at))return!0;j.removeEventListener(Z,Fe)})}else if(!at||!at.length)for(Z in zt)F(zt,j,Z);else for(Z in zt)it(j,Z,at,Pt)}W.off=function(j,Z){var at=this;return j===void 0?this.each(function(Pt,zt){return it(zt)}):ut(yt(j),function(Pt){var zt=ft(Pt),ie=zt[0],ge=zt[1];at.each(function(rn,Fe){return it(Fe,ie,ge,Z)})}),this},W.on=function(j,Z,at,Pt){var zt=this;if(!B(j)){for(var ie in j)this.on(ie,Z,j[ie]);return this}return I(Z)&&(at=Z,Z=!1),ut(yt(j),function(ge){var rn=ft(ge),Fe=rn[0],We=rn[1];zt.each(function(Qn,fn){var ze=function hr(Ve){if(!(Ve.namespace&&!T(We,Ve.namespace.split(ot)))){var Ke=fn;if(Z){for(var Ye=Ve.target;!H(Ye,Z);)if(Ye===fn||(Ye=Ye.parentNode,!Ye))return;Ke=Ye}Ve.namespace=Ve.namespace||"";var tr=at.call(Ke,Ve,Ve.data);Pt&&it(fn,Fe,We,hr),tr===!1&&(Ve.preventDefault(),Ve.stopPropagation())}};ze.guid=at.guid=at.guid||lt++,K(fn,Fe,We,ze)})}),this},W.one=function(j,Z,at){return this.on(j,Z,at,!0)},W.ready=function(j){var Z=function(){return j(R)};return e.readyState!=="loading"?setTimeout(Z):e.addEventListener("DOMContentLoaded",Z),this},W.trigger=function(j,Z){var at=j;if(B(j)){var Pt=ft(j),zt=Pt[0],ie=Pt[1];at=e.createEvent("HTMLEvents"),at.initEvent(zt,!0,!0),at.namespace=ie.join(ot)}return at.data=Z,this.each(function(ge,rn){rn.dispatchEvent(at)})};function ne(j){var Z=[];return ut(j.options,function(at){at.selected&&!at.disabled&&!at.parentNode.disabled&&Z.push(at.value)}),Z}function ye(j){return j.selectedIndex<0?null:j.options[j.selectedIndex].value}var de=/select-one/i,V=/select-multiple/i;
29function tt(j){var Z=j.type;return de.test(Z)?ye(j):V.test(Z)?ne(j):j.value}var M=/%20/g;function Tt(j,Z){return"&"+encodeURIComponent(j)+"="+encodeURIComponent(Z).replace(M,"+")}var ht=/file|reset|submit|button|image/i,Lt=/radio|checkbox/i;W.serialize=function(){var j="";return this.each(function(Z,at){ut(at.elements||[at],function(Pt){if(!(Pt.disabled||!Pt.name||Pt.tagName==="FIELDSET")&&!ht.test(Pt.type)&&!(Lt.test(Pt.type)&&!Pt.checked)){var zt=tt(Pt);if(zt!==void 0){var ie=et(zt)?zt:[zt];ut(ie,function(ge){j+=Tt(Pt.name,ge)})}}})}),j.substr(1)},W.val=function(j){return j===void 0?this[0]&&tt(this[0]):this.each(function(Z,at){var Pt=V.test(at.type),zt=j===null?Pt?[]:"":j;Pt&&et(zt)?ut(at.options,function(ie){ie.selected=zt.indexOf(ie.value)>=0}):at.value=zt})},W.clone=function(){return this.map(function(j,Z){return Z.cloneNode(!0)})},W.detach=function(){return this.each(function(j,Z){Z.parentNode&&Z.parentNode.removeChild(Z)})};var Yt=/^\s*<(\w+)[^>]*>/,qt=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/,Bt;function re(){if(!Bt){var j=e.createElement("table"),Z=e.createElement("tr");Bt={"*":e.createElement("div"),tr:e.createElement("tbody"),td:Z,th:Z,thead:j,tbody:j,tfoot:j}}}function Ce(j){if(re(),!B(j))return[];if(qt.test(j))return[e.createElement(RegExp.$1)];var Z=Yt.test(j)&&RegExp.$1,at=Bt[Z]||Bt["*"];return at.innerHTML=j,R(at.childNodes).detach().get()}R.parseHTML=Ce,W.empty=function(){var j=this[0];if(j)for(;j.firstChild;)j.removeChild(j.firstChild);return this};function Pe(j,Z,at){at?j.insertBefore(Z,j.childNodes[0]):j.appendChild(Z)}function Oe(j,Z,at){if(Z!==void 0){var Pt=B(Z);!Pt&&Z.length?ut(Z,function(zt){return Oe(j,zt,at)}):ut(j,Pt?function(zt){zt.insertAdjacentHTML(at?"afterbegin":"beforeend",Z)}:function(zt,ie){return Pe(zt,ie?Z.cloneNode(!0):Z,at)})}}W.append=function(){var j=this;return ut(arguments,function(Z){Oe(j,Z)}),this},W.appendTo=function(j){return Oe(R(j),this),this},W.html=function(j){if(j===void 0)return this[0]&&this[0].innerHTML;var Z=j.nodeType?j[0].outerHTML:j;return this.each(function(at,Pt){Pt.innerHTML=Z})},W.insertAfter=function(j){var Z=this;return R(j).each(function(at,Pt){var zt=Pt.parentNode;Z.each(function(ie,ge){zt.insertBefore(at?ge.cloneNode(!0):ge,Pt.nextSibling)})}),this},W.after=function(){var j=this;return ut(v.apply(arguments),function(Z){v.apply(R(Z).slice()).insertAfter(j)}),this},W.insertBefore=function(j){var Z=this;return R(j).each(function(at,Pt){var zt=Pt.parentNode;Z.each(function(ie,ge){zt.insertBefore(at?ge.cloneNode(!0):ge,Pt)})}),this},W.before=function(){var j=this;return ut(arguments,function(Z){R(Z).insertBefore(j)}),this},W.prepend=function(){var j=this;return ut(arguments,function(Z){Oe(j,Z,!0)}),this},W.prependTo=function(j){return Oe(R(j),v.apply(this.slice()),!0),this},W.remove=function(){return this.detach().off()},W.replaceWith=function(j){var Z=this;return this.each(function(at,Pt){var zt=Pt.parentNode;if(zt){var ie=at?R(j).clone():R(j);if(!ie[0])return Z.remove(),!1;zt.replaceChild(ie[0],Pt),R(ie[0]).after(ie.slice(1))}})},W.replaceAll=function(j){return R(j).replaceWith(this),this},W.text=function(j){return j===void 0?this[0]?this[0].textContent:"":this.each(function(Z,at){at.textContent=j})};var qe=e&&e.documentElement;W.offset=function(){var j=this[0];if(j){var Z=j.getBoundingClientRect();return{top:Z.top+n.pageYOffset-qe.clientTop,left:Z.left+n.pageXOffset-qe.clientLeft}}},W.offsetParent=function(){return R(this[0]&&this[0].offsetParent)},W.position=function(){var j=this[0];if(j)return{left:j.offsetLeft,top:j.offsetTop}},W.children=function(j){var Z=[];return this.each(function(at,Pt){f.apply(Z,Pt.children)}),Z=R(jt(Z)),j?Z.filter(function(at,Pt){return H(Pt,j)}):Z},W.contents=function(){var j=[];return this.each(function(Z,at){f.apply(j,at.tagName==="IFRAME"?[at.contentDocument]:at.childNodes)}),R(j.length&&jt(j))},W.find=function(j){for(var Z=[],at=0,Pt=this.length;at<Pt;at++){var zt=N(j,this[at]);zt.length&&f.apply(Z,zt)}return R(Z.length&&jt(Z))},W.has=function(j){var Z=B(j)?function(at,Pt){return!!N(j,Pt).length}:function(at,Pt){return Pt.contains(j)};return this.filter(Z)},W.is=function(j){if(!j||!this[0])return!1;var Z=A(j),at=!1;return this.each(function(Pt,zt){return at=Z(Pt,zt,j),!at}),at},W.next=function(){return R(this[0]&&this[0].nextElementSibling)},W.not=function(j){if(!j||!this[0])return this;var Z=A(j);return this.filter(function(at,Pt){return!Z(at,Pt,j)})},W.parent=function(){var j=[];return this.each(function(Z,at){at&&at.parentNode&&j.push(at.parentNode)}),R(jt(j))},W.index=function(j){var Z=j?R(j)[0]:this[0],at=j?this:R(Z).parent().children();return u.call(at,Z)},W.closest=function(j){return!j||!this[0]?R():this.is(j)?this.filter(j):this.parent().closest(j)},W.parents=function(j){var Z=[],at;return this.each(function(Pt,zt){for(at=zt;at&&at.parentNode&&at!==e.body.parentNode;)at=at.parentNode,(!j||j&&H(at,j))&&Z.push(at)}),R(jt(Z))},W.prev=function(){return R(this[0]&&this[0].previousElementSibling)},W.siblings=function(){var j=this[0];return this.parent().children().filter(function(Z,at){return at!==j})};let cn=R}),926:((a,r,t)=>
29{t.d(r,{AU:()=>he,BC:()=>z,C8:()=>lt,Ch:()=>B,Ci:()=>A,D8:()=>c,G2:()=>U,GW:()=>q,GZ:()=>W,I6:()=>y,LJ:()=>jt,Sc:()=>N,X6:()=>_,Xy:()=>H,YZ:()=>v,ZQ:()=>f,a_:()=>R,af:()=>_t,bG:()=>E,cx:()=>g,ir:()=>xt,kk:()=>te,on:()=>Xt,rp:()=>yt,v$:()=>et,yL:()=>ct,zN:()=>b});var e=t(523),n=function(mt,bt,It){if(It||arguments.length===2)for(var nt=0,wt=bt.length,Ot;nt<wt;nt++)(Ot||!(nt in bt))&&(Ot||(Ot=Array.prototype.slice.call(bt,0,nt)),Ot[nt]=bt[nt]);return mt.concat(Ot||Array.prototype.slice.call(bt))},i="tag",l="attributes",u="children",c="transitionend oTransitionEnd transitionend webkitTransitionEnd",f=function(mt){return mt?.nodeType===Node.DOCUMENT_NODE},v=function(mt){var bt=mt&&mt.parentNode;bt&&bt.removeChild(mt)};function g(){for(var mt=[],bt=0;bt<arguments.length;bt++)mt[bt]=arguments[bt];var It=Array.isArray(mt[0])?mt[0]:n([],mt,!0);return It.filter(Boolean).join(" ")}var y=function(mt,bt){return mt.querySelectorAll(bt)},_=function(mt,bt){return bt===void 0&&(bt={}),mt&&mt.setAttribute&&(0,e.each)(bt,function(It,nt){return mt.setAttribute(nt,It)})},b=function(mt){var bt;return mt&&!!(mt.offsetWidth||mt.offsetHeight||!((bt=mt.getClientRects)===null||bt===void 0)&&bt.call(mt).length)},S=function(mt){for(;mt.firstChild;)mt.removeChild(mt.firstChild)},E=function(mt,bt){var It;(It=mt.parentNode)===null||It===void 0||It.replaceChild(bt,mt)},N=function(mt,bt,It){var nt=mt.childNodes,wt=nt.length,Ot=(0,e.isUndefined)(It)?wt:It;(0,e.isString)(bt)&&(mt.insertAdjacentHTML("beforeEnd",bt),bt=mt.lastChild,mt.removeChild(bt)),Ot>=wt?mt.appendChild(bt):mt.insertBefore(bt,nt[Ot])},z=function(mt,bt){return N(mt,bt)},R=function(mt,bt,It){bt===void 0&&(bt={});var nt=document.createElement(mt);return bt&&(0,e.each)(bt,function(wt,Ot){return nt.setAttribute(Ot,wt)}),It&&((0,e.isString)(It)?nt.innerHTML=It:nt.appendChild(It)),nt},W=function(mt){return document.createTextNode(mt)},ct=function(mt,bt){var It,nt=mt.type;try{It=new window[bt](nt,mt)}catch(wt){It=document.createEvent(bt),It.initEvent(nt,!0,!0)}return It._parentEvent=mt,nt.indexOf("key")===0&&(It.keyCodeVal=mt.keyCode,["keyCode","which"].forEach(function(wt){Object.defineProperty(It,wt,{get:function(){return this.keyCodeVal}})})),It},_t=function(mt,bt){bt===void 0&&(bt=[]);var It=Array.isArray(bt)?bt:[bt];It.forEach(function(nt){var wt=nt[i]||"div",Ot=nt[l]||{},Ht=document.createElement(wt);(0,e.each)(Ot,function(Vt,Nt){Ht.setAttribute(Nt,Vt)}),mt.appendChild(Ht)})},xt=function(mt){return mt?.nodeType===Node.TEXT_NODE},ut=function(mt){return mt?.nodeType===Node.COMMENT_NODE},q=function(mt){return mt&&!xt(mt)&&!ut(mt)},lt=function(mt){var bt={top:0,left:0,width:0,height:0};if(!mt)return bt;var It;if(xt(mt)){var nt=document.createRange();nt.selectNode(mt),It=nt.getBoundingClientRect(),nt.detach()}return It||(mt.getBoundingClientRect?mt.getBoundingClientRect():bt)},H=function(mt){var bt=mt?.ownerDocument||document,It=bt.documentElement,nt=bt.defaultView||window;return{x:(nt.pageXOffset||It.scrollLeft||0)-(It.clientLeft||0),y:(nt.pageYOffset||It.scrollTop||0)-(It.clientTop||0)}},I=function(mt){return mt.which||mt.keyCode},B=function(mt){return String.fromCharCode(I(mt))},U=function(mt){return mt.touches&&mt.touches[0]?mt.touches[0]:mt},et=function(mt){return I(mt)===27},A=function(mt){return I(mt)===13},gt=function(mt){return mt.ctrlKey},yt=function(mt){return gt(mt)||mt.metaKey},jt=function(mt){if(!mt)return"";var bt=mt.name,It=mt.publicId,nt=mt.systemId,wt=It?' PUBLIC "'.concat(It,'"'):"",Ot=!It&&nt?' SYSTEM "'.concat(nt,'"'):"";return"<!DOCTYPE ".concat(bt).concat(wt).concat(Ot,">")},te=function(mt){mt===void 0&&(mt={});var bt=[];return(0,e.each)(mt,function(It,nt){return bt.push("".concat(nt,'="').concat(It,'"'))}),bt.join(" ")},Xt=function(mt,bt,It,nt){var wt=bt.split(/\s+/),Ot=(0,e.isArray)(mt)?mt:[mt];wt.forEach(function(Ht){Ot.forEach(function(Vt){return Vt?.addEventListener(Ht,It,nt)})})},he=function(mt,bt,It,nt){var wt=bt.split(/\s+/),Ot=(0,e.isArray)(mt)?mt:[mt];wt.forEach(function(Ht){Ot.forEach(function(Vt){return Vt?.removeEventListener(Ht,It,nt)})})}}),342:((a,r,t)=>{t.r(r),t.d(r,{appendStyles:()=>z,buildBase64UrlFromSvg:()=>It,camelCase:()=>_t,capitalize:()=>gt,createId:()=>bt,deepMerge:()=>B,escape:()=>H,escapeNodeContent:()=>I,find:()=>lt,getComponentModel:()=>he,getComponentView:()=>Xt,getElement:()=>q,getGlobal:()=>_,getModel:()=>U,getUiClass:()=>N,getUnitFromValue:()=>W,getViewEl:()=>jt,hasDnd:()=>ut,hasWin:()=>y,isBultInMethod:()=>c,isComponent:()=>te,isDef:()=>g,isEmptyObj:()=>A,isObject:()=>et,isRule:()=>yt,matches:()=>E,normalizeFloat:()=>xt,normalizeKey:()=>f,setViewEl:()=>mt,shallowDiff:()=>R,toLowerCase:()=>b,upFirst:()=>ct,wait:()=>v});var e=t(523),n=t(926),i=function(){return i=Object.assign||function(nt){for(var wt,Ot=1,Ht=arguments.length;Ot<Ht;Ot++){wt=arguments[Ot];
29for(var Vt in wt)Object.prototype.hasOwnProperty.call(wt,Vt)&&(nt[Vt]=wt[Vt])}return nt},i.apply(this,arguments)},l=function(nt,wt,Ot){if(Ot||arguments.length===2)for(var Ht=0,Vt=wt.length,Nt;Ht<Vt;Ht++)(Nt||!(Ht in wt))&&(Nt||(Nt=Array.prototype.slice.call(wt,0,Ht)),Nt[Ht]=wt[Ht]);return nt.concat(Nt||Array.prototype.slice.call(wt))},u={},c=function(nt){return(0,e.isFunction)(u[nt])},f=function(nt){return c(nt)?"_".concat(nt):nt},v=function(nt){return nt===void 0&&(nt=0),new Promise(function(wt){return setTimeout(wt,nt)})},g=function(nt){return typeof nt<"u"},y=function(){return typeof window<"u"},_=function(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:t.g},b=function(nt){return(nt||"").toLowerCase()},S=y()?window.Element.prototype:{},E=S.matches||S.webkitMatchesSelector||S.mozMatchesSelector||S.msMatchesSelector,N=function(nt,wt){var Ot=nt.getConfig(),Ht=Ot.stylePrefix,Vt=Ot.customUI;return[Vt&&"".concat(Ht,"cui"),wt].filter(function(Nt){return Nt}).join(" ")},z=function(nt,wt){wt===void 0&&(wt={});var Ot=(0,e.isArray)(nt)?l([],nt,!0):[nt];if(Ot.length){var Ht=Ot.shift();if(Ht&&(!wt.unique||!document.querySelector('link[href="'.concat(Ht,'"]')))){var Vt=document.head,Nt=document.createElement("link");Nt.href=Ht,Nt.rel="stylesheet",wt.prepand?Vt.insertBefore(Nt,Vt.firstChild):Vt.appendChild(Nt)}z(Ot)}},R=function(nt,wt){var Ot={},Ht=(0,e.keys)(wt);for(var Vt in nt)if(nt.hasOwnProperty(Vt)){var Nt=nt[Vt],Jt=wt[Vt];Ht.indexOf(Vt)>=0?Nt!==Jt&&(Ot[Vt]=Jt):Ot[Vt]=null}for(var Vt in wt)wt.hasOwnProperty(Vt)&&(0,e.isUndefined)(nt[Vt])&&(Ot[Vt]=wt[Vt]);return Ot},W=function(nt){return nt.replace(parseFloat(nt),"")},ct=function(nt){return nt[0].toUpperCase()+nt.toLowerCase().slice(1)},_t=function(nt){return nt.replace(/-./g,function(wt){return wt[1].toUpperCase()})},xt=function(nt,wt,Ot){wt===void 0&&(wt=1),Ot===void 0&&(Ot=0);var Ht=0;if(isNaN(nt))return Ot;if(nt=parseFloat(nt),Math.floor(nt)!==nt){var Vt=wt.toString().split(".")[1];Ht=Vt?Vt.length:0}return Ht?parseFloat(nt.toFixed(Ht)):nt},ut=function(nt){return"draggable"in document.createElement("i")&&(nt?nt.config.nativeDnD:!0)},q=function(nt){if((0,e.isElement)(nt)||(0,n.ir)(nt))return nt;if(nt&&nt.getEl)return nt.getEl()},lt=function(nt,wt){var Ot=null;return nt.some(function(Ht,Vt){return wt(Ht,Vt,nt)?(Ot=Ht,1):0}),Ot},H=function(nt){return nt===void 0&&(nt=""),"".concat(nt).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")},I=function(nt){return nt===void 0&&(nt=""),"".concat(nt).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},B=function(){for(var nt=[],wt=0;wt<arguments.length;wt++)nt[wt]=arguments[wt];for(var Ot=i({},nt[0]),Ht=1;Ht<nt.length;Ht++){var Vt=i({},nt[Ht]);for(var Nt in Vt){var Jt=Ot[Nt],Ee=Vt[Nt];et(Jt)&&et(Ee)?Ot[Nt]=B(Jt,Ee):Ot[Nt]=Ee}}return Ot},U=function(nt,wt){var Ot;return!wt&&nt&&nt.__cashData?Ot=nt.__cashData.model:wt&&(0,e.isElement)(nt)&&(Ot=wt(nt).data("model")),Ot},et=function(nt){return nt&&!Array.isArray(nt)&&typeof nt=="object"},A=function(nt){return Object.keys(nt).length<=0},gt=function(nt){return nt===void 0&&(nt=""),nt&&nt.charAt(0).toUpperCase()+nt.substring(1)},yt=function(nt){return nt&&nt.toCSS},jt=function(nt){return nt?.__gjsv},te=function(nt){return!!nt?.toHTML},Xt=function(nt){return jt(nt)},he=function(nt){var wt;return(wt=Xt(nt))===null||wt===void 0?void 0:wt.model},mt=function(nt,wt){nt.__gjsv=wt},bt=function(nt){nt===void 0&&(nt=16);for(var wt="",Ot="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Ht=Ot.length,Vt=0;Vt<nt;Vt++)wt+=Ot.charAt(Math.floor(Math.random()*Ht));return wt},It=function(nt){if(nt&&nt.substr(0,4)==="<svg"){var wt="";return y()?wt=window.btoa(nt):typeof Buffer<"u"&&(wt=Buffer.from(nt,"utf8").toString("base64")),wt?"data:image/svg+xml;base64,".concat(wt):nt}return nt}}),585:((a,r,t)=>{var e={"./CanvasClear":404,"./CanvasClear.ts":404,"./CanvasMove":228,"./CanvasMove.ts":228,"./CommandAbstract":570,"./CommandAbstract.ts":570,"./ComponentDelete":377,"./ComponentDelete.ts":377,"./ComponentDrag":728,"./ComponentDrag.ts":728,"./ComponentEnter":462,"./ComponentEnter.t
29s":462,"./ComponentExit":658,"./ComponentExit.ts":658,"./ComponentNext":619,"./ComponentNext.ts":619,"./ComponentPrev":935,"./ComponentPrev.ts":935,"./ComponentStyleClear":536,"./ComponentStyleClear.ts":536,"./CopyComponent":957,"./CopyComponent.ts":957,"./ExportTemplate":413,"./ExportTemplate.ts":413,"./Fullscreen":516,"./Fullscreen.ts":516,"./MoveComponent":13,"./MoveComponent.ts":13,"./OpenAssets":204,"./OpenAssets.ts":204,"./OpenBlocks":195,"./OpenBlocks.ts":195,"./OpenLayers":671,"./OpenLayers.ts":671,"./OpenStyleManager":49,"./OpenStyleManager.ts":49,"./OpenTraitManager":590,"./OpenTraitManager.ts":590,"./PasteComponent":483,"./PasteComponent.ts":483,"./Preview":857,"./Preview.ts":857,"./Resize":869,"./Resize.ts":869,"./SelectComponent":194,"./SelectComponent.ts":194,"./SelectPosition":582,"./SelectPosition.ts":582,"./ShowOffset":131,"./ShowOffset.ts":131,"./SwitchVisibility":229,"./SwitchVisibility.ts":229};function n(l){var u=i(l);return t(u)}function i(l){if(!t.o(e,l)){var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}return e[l]}n.keys=function(){return Object.keys(e)},n.resolve=i,a.exports=n,n.id=585}),523:((a,r,t)=>{t.r(r),t.d(r,{VERSION:()=>n,after:()=>Pr,all:()=>Nr,allKeys:()=>Bt,any:()=>vi,assign:()=>ze,before:()=>hi,bind:()=>Xr,bindAll:()=>di,chain:()=>Fi,chunk:()=>Ar,clone:()=>tr,collect:()=>Ze,compact:()=>ns,compose:()=>mr,constant:()=>pe,contains:()=>_n,countBy:()=>ts,create:()=>Ye,debounce:()=>Er,default:()=>ei,defaults:()=>hr,defer:()=>An,delay:()=>Ir,detect:()=>oe,difference:()=>ta,drop:()=>zr,each:()=>le,escape:()=>Dt,every:()=>Nr,extend:()=>fn,extendOwn:()=>ze,filter:()=>Tn,find:()=>oe,findIndex:()=>Rr,findKey:()=>er,findLastIndex:()=>Zr,findWhere:()=>we,first:()=>yi,flatten:()=>Qo,foldl:()=>rr,foldr:()=>mn,forEach:()=>le,functions:()=>We,get:()=>en,groupBy:()=>Qa,has:()=>jn,head:()=>yi,identity:()=>ke,include:()=>_n,includes:()=>_n,indexBy:()=>Xo,indexOf:()=>wr,initial:()=>Qe,inject:()=>rr,intersection:()=>is,invert:()=>Fe,invoke:()=>Ya,isArguments:()=>ue,isArray:()=>Nt,isArrayBuffer:()=>Xt,isBoolean:()=>I,isDataView:()=>Vt,isDate:()=>gt,isElement:()=>B,isEmpty:()=>V,isEqual:()=>qt,isError:()=>jt,isFinite:()=>Be,isFunction:()=>bt,isMap:()=>at,isMatch:()=>tt,isNaN:()=>je,isNull:()=>lt,isNumber:()=>A,isObject:()=>q,isRegExp:()=>yt,isSet:()=>zt,isString:()=>et,isSymbol:()=>te,isTypedArray:()=>ft,isUndefined:()=>H,isWeakMap:()=>Pt,isWeakSet:()=>ie,iteratee:()=>_e,keys:()=>de,last:()=>mi,lastIndexOf:()=>ae,map:()=>Ze,mapObject:()=>vr,matcher:()=>Zt,matches:()=>Zt,max:()=>qo,memoize:()=>Vi,methods:()=>We,min:()=>Yo,mixin:()=>Bi,negate:()=>pi,noop:()=>gr,now:()=>L,object:()=>os,omit:()=>gi,once:()=>_r,pairs:()=>rn,partial:()=>jr,partition:()=>Jo,pick:()=>Zo,pluck:()=>uo,property:()=>dn,propertyOf:()=>Mt,random:()=>Un,range:()=>bi,reduce:()=>rr,reduceRight:()=>mn,reject:()=>ir,rest:()=>zr,restArguments:()=>ut,result:()=>Ni,sample:()=>co,select:()=>Tn,shuffle:()=>Ja,size:()=>es,some:()=>vi,sortBy:()=>Za,sortedIndex:()=>Qr,tail:()=>zr,take:()=>yi,tap:()=>Ae,template:()=>Wr,templateSettings:()=>Te,throttle:()=>Hi,times:()=>fe,toArray:()=>ti,toPath:()=>Dn,transpose:()=>wi,unescape:()=>xe,union:()=>rs,uniq:()=>_i,unique:()=>_i,uniqueId:()=>qr,unzip:()=>wi,values:()=>ge,where:()=>Xa,without:()=>ho,wrap:()=>hn,zip:()=>ea});var e={};t.r(e),t.d(e,{VERSION:()=>n,after:()=>Pr,all:()=>Nr,allKeys:()=>Bt,any:()=>vi,assign:()=>ze,before:()=>hi,bind:()=>Xr,bindAll:()=>di,chain:()=>Fi,chunk:()=>Ar,clone:()=>tr,collect:()=>Ze,compact:()=>ns,compose:()=>mr,constant:()=>pe,contains:()=>_n,countBy:()=>ts,create:()=>Ye,debounce:()=>Er,default:()=>as,defaults:()=>hr,defer:()=>An,delay:()=>Ir,detect:()=>oe,difference:()=>ta,drop:()=>zr,each:()=>le,escape:()=>Dt,every:()=>Nr,extend:()=>fn,extendOwn:()=>ze,filter:()=>Tn,find:()=>oe,findIndex:()=>Rr,findKey:()=>er,findLastIndex:()=>Zr,findWhere:()=>we,first:()=>yi,flatten:()=>Qo,foldl:()=>rr,foldr:()=>mn,forEach:()=>le,functions:()=>We,get:()=>en,groupBy:()=>Qa,has:()=>jn,head:()=>yi,identity:()=>ke,include:()=>_n,includes:()=>_n,indexBy:()=>Xo,indexOf:()=>wr,initial:()=>Qe,inject:()=>rr,intersection:()=>is,invert:()=>Fe,invoke:()=>Ya,isArguments:()=>ue,isArray:()=>Nt,isArrayBuffer:()=>Xt,isBoolean:()=>I,isDataView:()=>Vt,isDate:()=>gt,isElement:()=>B,isEmpty:()=>V,isEqual:()=>qt,isError:()=>jt,isFinite:()=>Be,isFunction:()=>bt,isMap:()=>at,isMatch:()=>tt,isNaN:()=>je,isNull:()=>lt,isNumber:()=>A,isObject:()=>q,isRegExp:()=>yt,isSet:()=>zt,isString:()=>et,isSymbol:()=>te,isTypedArray:()=>ft,isUndefined:()=>H,isWeakMap:()=>Pt,isWeakSet:()=>ie,iteratee:()=>_e,keys:()=>de,last:()=>mi,lastIndexOf:()=>ae,map:()=>Ze,mapObject:()=>vr,matcher:()=>Zt,matches:()=>Zt,max:()=>qo,memoize:()=>Vi,methods:()=>We,min:()=>Yo,mixin:()=>Bi,negate:()=>pi,noop:()=>gr,now:()=>L,object:()=>os,omit:()=>gi,once:()=>_r,pairs:()=>rn,partial:()=>jr,partition:()=>Jo,pick:()=>Zo,pluck:()=>uo,property:()=>dn,propertyOf:()=>Mt,random:()=>Un,range:()=>bi,reduce:()=>rr,reduceRight:()=>mn,reject:()=>ir,rest:()=>zr,restArguments:()=>ut,result:()=>Ni,sample:()=>co,select:()=>Tn,shuffle:()=>Ja,size:()=>es,some:()=>vi,sortBy:()=>Za,sortedIndex:()=>Qr,tail:()=>zr,take:()=>yi,tap:()=>Ae,template:()=>Wr,templateSettings:()=>Te,throttle:()=>Hi,times:()=>fe,toArray:()=>ti,toPath:()=>Dn,transpose:()=>wi,unescape:()=>xe,union:()=>rs,uniq:()=>_i,unique:()=>_i,uniqueId:()=>qr,unzip:()=>wi,values:()=>ge,where:()=>Xa,without:()=>ho,wrap:()=>hn,zip:()=>ea});var n="1.13.1",i=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},l=Array.prototype,u=Object.prototype,c=typeof Symbol<"u"?Symbol.prototype:null,f=l.push,v=l.slice,g=u.toString,y=u.hasOwnProperty,_=typeof ArrayBuffer<"u",b=typeof DataView<"u",S=Array.isArray,E=Object.keys,N=Object.create,z=_&&ArrayBuffer.isView,R=isNaN,W=isFinite,ct=!{toString:null}.propertyIsEnumerable("toString"),_t=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleStr
29ing"],xt=Math.pow(2,53)-1;function ut(O,D){return D=D==null?O.length-1:+D,function(){for(var Y=Math.max(arguments.length-D,0),Q=Array(Y),pt=0;pt<Y;pt++)Q[pt]=arguments[pt+D];switch(D){case 0:return O.call(this,Q);case 1:return O.call(this,arguments[0],Q);case 2:return O.call(this,arguments[0],arguments[1],Q)}var st=Array(D+1);for(pt=0;pt<D;pt++)st[pt]=arguments[pt];return st[D]=Q,O.apply(this,st)}}function q(O){var D=typeof O;return D==="function"||D==="object"&&!!O}function lt(O){return O===null}function H(O){return O===void 0}function I(O){return O===!0||O===!1||g.call(O)==="[object Boolean]"}function B(O){return!!(O&&O.nodeType===1)}function U(O){var D="[object "+O+"]";return function(Y){return g.call(Y)===D}}let et=U("String"),A=U("Number"),gt=U("Date"),yt=U("RegExp"),jt=U("Error"),te=U("Symbol"),Xt=U("ArrayBuffer");var he=U("Function"),mt=i.document&&i.document.childNodes;typeof Int8Array!="object"&&typeof mt!="function"&&(he=function(O){return typeof O=="function"||!1});let bt=he,It=U("Object");var nt=b&&It(new DataView(new ArrayBuffer(8))),wt=typeof Map<"u"&&It(new Map),Ot=U("DataView");function Ht(O){return O!=null&&bt(O.getInt8)&&Xt(O.buffer)}let Vt=nt?Ht:Ot,Nt=S||U("Array");function Jt(O,D){return O!=null&&y.call(O,D)}var Ee=U("Arguments");(function(){Ee(arguments)||(Ee=function(O){return Jt(O,"callee")})})();let ue=Ee;function Be(O){return!te(O)&&W(O)&&!isNaN(parseFloat(O))}function je(O){return A(O)&&R(O)}function pe(O){return function(){return O}}function T(O){return function(D){var Y=O(D);return typeof Y=="number"&&Y>=0&&Y<=xt}}function F(O){return function(D){return D?.[O]}}let $=F("byteLength"),ot=T($);var vt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function K(O){return z?z(O)&&!Vt(O):ot(O)&&vt.test(g.call(O))}let ft=_?K:pe(!1),it=F("length");function ne(O){for(var D={},Y=O.length,Q=0;Q<Y;++Q)D[O[Q]]=!0;return{contains:function(pt){return D[pt]},push:function(pt){return D[pt]=!0,O.push(pt)}}}function ye(O,D){D=ne(D);var Y=_t.length,Q=O.constructor,pt=bt(Q)&&Q.prototype||u,st="constructor";for(Jt(O,st)&&!D.contains(st)&&D.push(st);Y--;)st=_t[Y],st in O&&O[st]!==pt[st]&&!D.contains(st)&&D.push(st)}function de(O){if(!q(O))return[];if(E)return E(O);var D=[];for(var Y in O)Jt(O,Y)&&D.push(Y);return ct&&ye(O,D),D}function V(O){if(O==null)return!0;var D=it(O);return typeof D=="number"&&(Nt(O)||et(O)||ue(O))?D===0:it(de(O))===0}function tt(O,D){var Y=de(D),Q=Y.length;if(O==null)return!Q;for(var pt=Object(O),st=0;st<Q;st++){var Et=Y[st];if(D[Et]!==pt[Et]||!(Et in pt))return!1}return!0}function M(O){if(O instanceof M)return O;if(!(this instanceof M))return new M(O);this._wrapped=O}M.VERSION=n,M.prototype.value=function(){return this._wrapped},M.prototype.valueOf=M.prototype.toJSON=M.prototype.value,M.prototype.toString=function(){return String(this._wrapped)};function Tt(O){return new Uint8Array(O.buffer||O,O.byteOffset||0,$(O))}var ht="[object DataView]";function Lt(O,D,Y,Q){if(O===D)return O!==0||1/O===1/D;if(O==null||D==null)return!1;if(O!==O)return D!==D;var pt=typeof O;return pt!=="function"&&pt!=="object"&&typeof D!="object"?!1:Yt(O,D,Y,Q)}function Yt(O,D,Y,Q){O instanceof M&&(O=O._wrapped),D instanceof M&&(D=D._wrapped);var pt=g.call(O);if(pt!==g.call(D))return!1;if(nt&&pt=="[object Object]"&&Vt(O)){if(!Vt(D))return!1;pt=ht}switch(pt){case"[object RegExp]":case"[object String]":return""+O==""+D;case"[object Number]":return+O!=+O?+D!=+D:+O==0?1/+O===1/D:+O==+D;case"[object Date]":case"[object Boolean]":return+O==+D;case"[object Symbol]":return c.valueOf.call(O)===c.valueOf.call(D);case"[object ArrayBuffer]":case ht:return Yt(Tt(O),Tt(D),Y,Q)}var st=pt==="[object Array]";if(!st&&ft(O)){var Et=$(O);if(Et!==$(D))return!1;if(O.buffer===D.buffer&&O.byteOffset===D.byteOffset)return!0;st=!0}if(!st){if(typeof O!="object"||typeof D!="object")return!1;var Ut=O.constructor,be=D.constructor;if(Ut!==be&&!(bt(Ut)&&Ut instanceof Ut&&bt(be)&&be instanceof be)&&"constructor"in O&&"constructor"in D)return!1}Y=Y||[],Q=Q||[];for(var me=Y.length;me--;)if(Y[me]===O)return Q[me]===D;if(Y.push(O),Q.push(D),st){if(me=O.length,me!==D.length)return!1;for(;me--;)if(!Lt(O[me],D[me],Y,Q))return!1}else{var vn=de(O),kn;if(me=vn.length,de(D).length!==me)return!1;for(;me--;)if(kn=vn[me],!(Jt(D,kn)&&Lt(O[kn],D[kn],Y,Q)))return!1}return Y.pop(),Q.pop(),!0}function qt(O,D){return Lt(O,D)}function Bt(O){if(!q(O))return[];var D=[];for(var Y in O)D.push(Y);return ct&&ye(O,D),D}function re(O){var D=it(O);return function(Y){if(Y==null)return!1;var Q=Bt(Y);if(it(Q))return!1;for(var pt=0;pt<D;pt++)if(!bt(Y[O[pt]]))return!1;return O!==j||!bt(Y[Ce])}}var Ce="forEach",Pe="has",Oe=["clear","delete"],qe=["get",Pe,"set"],cn=Oe.concat(Ce,qe),j=Oe.concat(qe),Z=["add"].concat(Oe,Ce,Pe);let at=wt?re(cn):U("Map"),Pt=wt?re(j):U("WeakMap"),zt=wt?re(Z):U("Set"),ie=U("WeakSet");function ge(O){for(var D=de(O),Y=D.length,Q=Array(Y),pt=0;pt<Y;pt++)Q[pt]=O[D[pt]];return Q}function rn(O){for(var D=de(O),Y=D.length,Q=Array(Y),pt=0;pt<Y;pt++)Q[pt]=[D[pt],O[D[pt]]];return Q}function Fe(O){for(var D={},Y=de(O),Q=0,pt=Y.length;Q<pt;Q++)D[O[Y[Q]]]=Y[Q];return D}function We(O){var D=[];for(var Y in O)bt(O[Y])&&D.push(Y);return D.sort()}function Qn(O,D){return function(Y){var Q=arguments.length;if(D&&(Y=Object(Y)),Q<2||Y==null)return Y;for(var pt=1;pt<Q;pt++)for(var st=arguments[pt],Et=O(st),Ut=Et.length,be=0;be<Ut;be++){var me=Et[be];(!D||Y[me]===void 0)&&(Y[me]=st[me])}return Y}}let fn=Qn(Bt),ze=Qn(de),hr=Qn(Bt,!0);function Ve(){return function(){}}function Ke(O){if(!q(O))return{};if(N)return N(O);var D=Ve();D.prototype=O;var Y=new D;return D.prototype=null,Y}function Ye(O,D){var Y=Ke(O);return D&&ze(Y,D),Y}function tr(O){return q(O)?Nt(O)?O.slice():fn({},O):O}function Ae(O,D){return D(O),O}function Dn(O){return Nt(O)?O:[O]}M.toPath=Dn;function ve(O){return M.toPath(O)}function On(O,D){for(var Y=D.length,Q=0;Q<Y;Q++){if(O==null)return;O=O[D[Q]]}return Y?O:void 0}
29function en(O,D,Y){var Q=On(O,ve(D));return H(Q)?Y:Q}function jn(O,D){D=ve(D);for(var Y=D.length,Q=0;Q<Y;Q++){var pt=D[Q];if(!Jt(O,pt))return!1;O=O[pt]}return!!Y}function ke(O){return O}function Zt(O){return O=ze({},O),function(D){return tt(D,O)}}function dn(O){return O=ve(O),function(D){return On(D,O)}}function Pn(O,D,Y){if(D===void 0)return O;switch(Y??3){case 1:return function(Q){return O.call(D,Q)};case 3:return function(Q,pt,st){return O.call(D,Q,pt,st)};case 4:return function(Q,pt,st,Et){return O.call(D,Q,pt,st,Et)}}return function(){return O.apply(D,arguments)}}function on(O,D,Y){return O==null?ke:bt(O)?Pn(O,D,Y):q(O)&&!Nt(O)?Zt(O):dn(O)}function _e(O,D){return on(O,D,1/0)}M.iteratee=_e;function Ne(O,D,Y){return M.iteratee!==_e?M.iteratee(O,D):on(O,D,Y)}function vr(O,D,Y){D=Ne(D,Y);for(var Q=de(O),pt=Q.length,st={},Et=0;Et<pt;Et++){var Ut=Q[Et];st[Ut]=D(O[Ut],Ut,O)}return st}function gr(){}function Mt(O){return O==null?gr:function(D){return en(O,D)}}function fe(O,D,Y){var Q=Array(Math.max(0,O));D=Pn(D,Y,1);for(var pt=0;pt<O;pt++)Q[pt]=D(pt);return Q}function Un(O,D){return D==null&&(D=O,O=0),O+Math.floor(Math.random()*(D-O+1))}let L=Date.now||function(){return new Date().getTime()};function X(O){var D=function(st){return O[st]},Y="(?:"+de(O).join("|")+")",Q=RegExp(Y),pt=RegExp(Y,"g");return function(st){return st=st==null?"":""+st,Q.test(st)?st.replace(pt,D):st}}let St={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Dt=X(St),Rt=Fe(St),xe=X(Rt),Te=M.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Le=/(.)^/,Ie={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},ui=/\\|'|\r|\n|\u2028|\u2029/g;function yr(O){return"\\"+Ie[O]}var Bn=/^\s*(\w|\$)+\s*$/;function Wr(O,D,Y){!D&&Y&&(D=Y),D=hr({},D,M.templateSettings);var Q=RegExp([(D.escape||Le).source,(D.interpolate||Le).source,(D.evaluate||Le).source].join("|")+"|$","g"),pt=0,st="__p+='";O.replace(Q,function(me,vn,kn,ss,na){return st+=O.slice(pt,na).replace(ui,yr),pt=na+me.length,vn?st+=`'+ 30((__t=(`+vn+`))==null?'':_.escape(__t))+ 31'`:kn?st+=`'+ 32((__t=(`+kn+`))==null?'':__t)+ 33'`:ss&&(st+=`'; 34`+ss+` 35__p+='`),me}),st+=`'; 36`;var Et=D.variable;if(Et){if(!Bn.test(Et))throw new Error("variable is not a bare identifier: "+Et)}else st=`with(obj||{}){ 37`+st+`} 38`,Et="obj";st=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');}; 39`+st+`return __p; 40`;var Ut;try{Ut=new Function(Et,"_",st)}catch(me){throw me.source=st,me}var be=function(me){return Ut.call(this,me,M)};return be.source="function("+Et+`){ 41`+st+"}",be}function Ni(O,D,Y){D=ve(D);var Q=D.length;if(!Q)return bt(Y)?Y.call(O):Y;for(var pt=0;pt<Q;pt++){var st=O?.[D[pt]];st===void 0&&(st=Y,pt=Q),O=bt(st)?st.call(O):st}return O}var ci=0;function qr(O){var D=++ci+"";return O?O+D:D}function Fi(O){var D=M(O);return D._chain=!0,D}function fi(O,D,Y,Q,pt){if(!(Q instanceof D))return O.apply(Y,pt);var st=Ke(O.prototype),Et=O.apply(st,pt);return q(Et)?Et:st}var Yr=ut(function(O,D){var Y=Yr.placeholder,Q=function(){for(var pt=0,st=D.length,Et=Array(st),Ut=0;Ut<st;Ut++)Et[Ut]=D[Ut]===Y?arguments[pt++]:D[Ut];for(;pt<arguments.length;)Et.push(arguments[pt++]);return fi(O,Q,this,this,Et)};return Q});Yr.placeholder=M;let jr=Yr,Xr=ut(function(O,D,Y){if(!bt(O))throw new TypeError("Bind must be called on a function");var Q=ut(function(pt){return fi(O,Q,D,this,Y.concat(pt))});return Q}),an=T(it);function pn(O,D,Y,Q){if(Q=Q||[],!D&&D!==0)D=1/0;else if(D<=0)return Q.concat(O);for(var pt=Q.length,st=0,Et=it(O);st<Et;st++){var Ut=O[st];if(an(Ut)&&(Nt(Ut)||ue(Ut)))if(D>1)pn(Ut,D-1,Y,Q),pt=Q.length;else for(var be=0,me=Ut.length;be<me;)Q[pt++]=Ut[be++];else Y||(Q[pt++]=Ut)}return Q}let di=ut(function(O,D){D=pn(D,!1,!1);var Y=D.length;if(Y<1)throw new Error("bindAll must be passed function names");for(;Y--;){var Q=D[Y];O[Q]=Xr(O[Q],O)}return O});function Vi(O,D){var Y=function(Q){var pt=Y.cache,st=""+(D?D.apply(this,arguments):Q);return Jt(pt,st)||(pt[st]=O.apply(this,arguments)),pt[st]};return Y.cache={},Y}let Ir=ut(function(O,D,Y){return setTimeout(function(){return O.apply(null,Y)},D)}),An=jr(Ir,M,1);function Hi(O,D,Y){var Q,pt,st,Et,Ut=0;Y||(Y={});var be=function(){Ut=Y.leading===!1?0:L(),Q=null,Et=O.apply(pt,st),Q||(pt=st=null)},me=function(){var vn=L();!Ut&&Y.leading===!1&&(Ut=vn);var kn=D-(vn-Ut);return pt=this,st=arguments,kn<=0||kn>D?(Q&&(clearTimeout(Q),Q=null),Ut=vn,Et=O.apply(pt,st),Q||(pt=st=null)):!Q&&Y.trailing!==!1&&(Q=setTimeout(be,kn)),Et};return me.cancel=function(){clearTimeout(Q),Ut=0,Q=pt=st=null},me}function Er(O,D,Y){var Q,pt,st,Et,Ut,be=function(){var vn=L()-pt;D>vn?Q=setTimeout(be,D-vn):(Q=null,Y||(Et=O.apply(Ut,st)),Q||(st=Ut=null))},me=ut(function(vn){return Ut=this,st=vn,pt=L(),Q||(Q=setTimeout(be,D),Y&&(Et=O.apply(Ut,st))),Et});return me.cancel=function(){clearTimeout(Q),Q=st=Ut=null},me}function hn(O,D){return jr(D,O)}function pi(O){return function(){return!O.apply(this,arguments)}}function mr(){var O=arguments,D=O.length-1;return function(){for(var Y=D,Q=O[D].apply(this,arguments);Y--;)Q=O[Y].call(this,Q);return Q}}function Pr(O,D){return function(){if(--O<1)return D.apply(this,arguments)}}function hi(O,D){var Y;return function(){return--O>0&&(Y=D.apply(this,arguments)),O<=1&&(D=null),Y}}let _r=jr(hi,2);function er(O,D,Y){D=Ne(D,Y);for(var Q=de(O),pt,st=0,Et=Q.length;
41st<Et;st++)if(pt=Q[st],D(O[pt],pt,O))return pt}function Jr(O){return function(D,Y,Q){Y=Ne(Y,Q);for(var pt=it(D),st=O>0?0:pt-1;st>=0&&st<pt;st+=O)if(Y(D[st],st,D))return st;return-1}}let Rr=Jr(1),Zr=Jr(-1);function Qr(O,D,Y,Q){Y=Ne(Y,Q,1);for(var pt=Y(D),st=0,Et=it(O);st<Et;){var Ut=Math.floor((st+Et)/2);Y(O[Ut])<pt?st=Ut+1:Et=Ut}return st}function Ui(O,D,Y){return function(Q,pt,st){var Et=0,Ut=it(Q);if(typeof st=="number")O>0?Et=st>=0?st:Math.max(st+Ut,Et):Ut=st>=0?Math.min(st+1,Ut):st+Ut+1;else if(Y&&st&&Ut)return st=Y(Q,pt),Q[st]===pt?st:-1;if(pt!==pt)return st=D(v.call(Q,Et,Ut),je),st>=0?st+Et:-1;for(st=O>0?Et:Ut-1;st>=0&&st<Ut;st+=O)if(Q[st]===pt)return st;return-1}}let wr=Ui(1,Rr,Qr),ae=Ui(-1,Zr);function oe(O,D,Y){var Q=an(O)?Rr:er,pt=Q(O,D,Y);if(pt!==void 0&&pt!==-1)return O[pt]}function we(O,D){return oe(O,Zt(D))}function le(O,D,Y){D=Pn(D,Y);var Q,pt;if(an(O))for(Q=0,pt=O.length;Q<pt;Q++)D(O[Q],Q,O);else{var st=de(O);for(Q=0,pt=st.length;Q<pt;Q++)D(O[st[Q]],st[Q],O)}return O}function Ze(O,D,Y){D=Ne(D,Y);for(var Q=!an(O)&&de(O),pt=(Q||O).length,st=Array(pt),Et=0;Et<pt;Et++){var Ut=Q?Q[Et]:Et;st[Et]=D(O[Ut],Ut,O)}return st}function nr(O){var D=function(Y,Q,pt,st){var Et=!an(Y)&&de(Y),Ut=(Et||Y).length,be=O>0?0:Ut-1;for(st||(pt=Y[Et?Et[be]:be],be+=O);be>=0&&be<Ut;be+=O){var me=Et?Et[be]:be;pt=Q(pt,Y[me],me,Y)}return pt};return function(Y,Q,pt,st){var Et=arguments.length>=3;return D(Y,Pn(Q,st,4),pt,Et)}}let rr=nr(1),mn=nr(-1);function Tn(O,D,Y){var Q=[];return D=Ne(D,Y),le(O,function(pt,st,Et){D(pt,st,Et)&&Q.push(pt)}),Q}function ir(O,D,Y){return Tn(O,pi(Ne(D)),Y)}function Nr(O,D,Y){D=Ne(D,Y);for(var Q=!an(O)&&de(O),pt=(Q||O).length,st=0;st<pt;st++){var Et=Q?Q[st]:st;if(!D(O[Et],Et,O))return!1}return!0}function vi(O,D,Y){D=Ne(D,Y);for(var Q=!an(O)&&de(O),pt=(Q||O).length,st=0;st<pt;st++){var Et=Q?Q[st]:st;if(D(O[Et],Et,O))return!0}return!1}function _n(O,D,Y,Q){return an(O)||(O=ge(O)),(typeof Y!="number"||Q)&&(Y=0),wr(O,D,Y)>=0}let Ya=ut(function(O,D,Y){var Q,pt;return bt(D)?pt=D:(D=ve(D),Q=D.slice(0,-1),D=D[D.length-1]),Ze(O,function(st){var Et=pt;if(!Et){if(Q&&Q.length&&(st=On(st,Q)),st==null)return;Et=st[D]}return Et==null?Et:Et.apply(st,Y)})});function uo(O,D){return Ze(O,dn(D))}function Xa(O,D){return Tn(O,Zt(D))}function qo(O,D,Y){var Q=-1/0,pt=-1/0,st,Et;if(D==null||typeof D=="number"&&typeof O[0]!="object"&&O!=null){O=an(O)?O:ge(O);for(var Ut=0,be=O.length;Ut<be;Ut++)st=O[Ut],st!=null&&st>Q&&(Q=st)}else D=Ne(D,Y),le(O,function(me,vn,kn){Et=D(me,vn,kn),(Et>pt||Et===-1/0&&Q===-1/0)&&(Q=me,pt=Et)});return Q}function Yo(O,D,Y){var Q=1/0,pt=1/0,st,Et;if(D==null||typeof D=="number"&&typeof O[0]!="object"&&O!=null){O=an(O)?O:ge(O);for(var Ut=0,be=O.length;Ut<be;Ut++)st=O[Ut],st!=null&&st<Q&&(Q=st)}else D=Ne(D,Y),le(O,function(me,vn,kn){Et=D(me,vn,kn),(Et<pt||Et===1/0&&Q===1/0)&&(Q=me,pt=Et)});return Q}function co(O,D,Y){if(D==null||Y)return an(O)||(O=ge(O)),O[Un(O.length-1)];var Q=an(O)?tr(O):ge(O),pt=it(Q);D=Math.max(Math.min(D,pt),0);for(var st=pt-1,Et=0;Et<D;Et++){var Ut=Un(Et,st),be=Q[Et];Q[Et]=Q[Ut],Q[Ut]=be}return Q.slice(0,D)}function Ja(O){return co(O,1/0)}function Za(O,D,Y){var Q=0;return D=Ne(D,Y),uo(Ze(O,function(pt,st,Et){return{value:pt,index:Q++,criteria:D(pt,st,Et)}}).sort(function(pt,st){var Et=pt.criteria,Ut=st.criteria;if(Et!==Ut){if(Et>Ut||Et===void 0)return 1;if(Et<Ut||Ut===void 0)return-1}return pt.index-st.index}),"value")}function fo(O,D){return function(Y,Q,pt){var st=D?[[],[]]:{};return Q=Ne(Q,pt),le(Y,function(Et,Ut){var be=Q(Et,Ut,Y);O(st,Et,be)}),st}}let Qa=fo(function(O,D,Y){Jt(O,Y)?O[Y].push(D):O[Y]=[D]}),Xo=fo(function(O,D,Y){O[Y]=D}),ts=fo(function(O,D,Y){Jt(O,Y)?O[Y]++:O[Y]=1}),Jo=fo(function(O,D,Y){O[Y?0:1].push(D)},!0);var po=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function ti(O){return O?Nt(O)?v.call(O):et(O)?O.match(po):an(O)?Ze(O,ke):ge(O):[]}function es(O){return O==null?0:an(O)?O.length:de(O).length}function Bl(O,D,Y){return D in Y}let Zo=ut(function(O,D){var Y={},Q=D[0];if(O==null)return Y;bt(Q)?(D.length>1&&(Q=Pn(Q,D[1])),D=Bt(O)):(Q=Bl,D=pn(D,!1,!1),O=Object(O));for(var pt=0,st=D.length;pt<st;pt++){var Et=D[pt],Ut=O[Et];Q(Ut,Et,O)&&(Y[Et]=Ut)}return Y}),gi=ut(function(O,D){var Y=D[0],Q;return bt(Y)?(Y=pi(Y),D.length>1&&(Q=D[1])):(D=Ze(pn(D,!1,!1),String),Y=function(pt,st){return!_n(D,st)}),Zo(O,Y,Q)});function Qe(O,D,Y){return v.call(O,0,Math.max(0,O.length-(D==null||Y?1:D)))}function yi(O,D,Y){return O==null||O.length<1?D==null||Y?void 0:[]:D==null||Y?O[0]:Qe(O,O.length-D)}function zr(O,D,Y){return v.call(O,D==null||Y?1:D)}function mi(O,D,Y){return O==null||O.length<1?D==null||Y?void 0:[]:D==null||Y?O[O.length-1]:zr(O,Math.max(0,O.length-D))}function ns(O){return Tn(O,Boolean)}function Qo(O,D){return pn(O,D,!1)}
41let ta=ut(function(O,D){return D=pn(D,!0,!0),Tn(O,function(Y){return!_n(D,Y)})}),ho=ut(function(O,D){return ta(O,D)});function _i(O,D,Y,Q){I(D)||(Q=Y,Y=D,D=!1),Y!=null&&(Y=Ne(Y,Q));for(var pt=[],st=[],Et=0,Ut=it(O);Et<Ut;Et++){var be=O[Et],me=Y?Y(be,Et,O):be;D&&!Y?((!Et||st!==me)&&pt.push(be),st=me):Y?_n(st,me)||(st.push(me),pt.push(be)):_n(pt,be)||pt.push(be)}return pt}let rs=ut(function(O){return _i(pn(O,!0,!0))});function is(O){for(var D=[],Y=arguments.length,Q=0,pt=it(O);Q<pt;Q++){var st=O[Q];if(!_n(D,st)){var Et;for(Et=1;Et<Y&&_n(arguments[Et],st);Et++);Et===Y&&D.push(st)}}return D}function wi(O){for(var D=O&&qo(O,it).length||0,Y=Array(D),Q=0;Q<D;Q++)Y[Q]=uo(O,Q);return Y}let ea=ut(wi);function os(O,D){for(var Y={},Q=0,pt=it(O);Q<pt;Q++)D?Y[O[Q]]=D[Q]:Y[O[Q][0]]=O[Q][1];return Y}function bi(O,D,Y){D==null&&(D=O||0,O=0),Y||(Y=D<O?-1:1);for(var Q=Math.max(Math.ceil((D-O)/Y),0),pt=Array(Q),st=0;st<Q;st++,O+=Y)pt[st]=O;return pt}function Ar(O,D){if(D==null||D<1)return[];for(var Y=[],Q=0,pt=O.length;Q<pt;)Y.push(v.call(O,Q,Q+=D));return Y}function xi(O,D){return O._chain?M(D).chain():D}function Bi(O){return le(We(O),function(D){var Y=M[D]=O[D];M.prototype[D]=function(){var Q=[this._wrapped];return f.apply(Q,arguments),xi(this,Y.apply(M,Q))}}),M}le(["pop","push","reverse","shift","sort","splice","unshift"],function(O){var D=l[O];M.prototype[O]=function(){var Y=this._wrapped;return Y!=null&&(D.apply(Y,arguments),(O==="shift"||O==="splice")&&Y.length===0&&delete Y[0]),xi(this,Y)}}),le(["concat","join","slice"],function(O){var D=l[O];M.prototype[O]=function(){var Y=this._wrapped;return Y!=null&&(Y=D.apply(Y,arguments)),xi(this,Y)}});let as=M;var or=Bi(e);or._=or;let ei=or})},ud={};function De(a){var r=ud[a];if(r!==void 0)return r.exports;var t=ud[a]={exports:{}};return Ag[a].call(t.exports,t,t.exports,De),t.exports}De.n=a=>{var r=a&&a.__esModule?()=>a.default:()=>a;return De.d(r,{a:r}),r};De.d=(a,r)=>{for(var t in r)De.o(r,t)&&!De.o(a,t)&&Object.defineProperty(a,t,{enumerable:!0,get:r[t]})};De.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(a){if(typeof window=="object")return window}})();De.o=(a,r)=>Object.prototype.hasOwnProperty.call(a,r);De.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var Vl={};De.d(Vl,{Ay:()=>CT,I0:()=>fv,nu:()=>cv});var k=De(523),At=De(342);function fr(a){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var e=a.raw;return e.reduce(function(n,i,l){var u=r[l-1],c=e[l-1];return Array.isArray(u)?u=u.join(""):c&&c.slice(-1)==="$"?n=n.slice(0,-1):u=(0,At.escape)(u),n+u+i})}var kg={stylePrefix:"gjs-",components:"",style:"",fromElement:!1,projectData:void 0,noticeOnUnload:!0,showOffsets:!1,showOffsetsSelected:!1,forceClass:!0,height:"900px",width:"100%",log:["warning","error"],baseCss:"",protectedCss:"* { box-sizing: border-box; } body {margin: 0;}",canvasCss:"",defaultCommand:"select-comp",showToolbar:!0,showDevices:!0,devicePreviewMode:!1,mediaCondition:"max-width",tagVarStart:"{[ ",tagVarEnd:" ]}",keepEmptyTextNodes:!1,jsInHtml:!0,nativeDnD:!0,multipleSelection:!0,optsHtml:{},optsCss:{},avoidInlineStyle:!0,avoidDefaults:!0,clearStyles:!1,listenToEl:[],cssIcons:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css",icons:{close:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',move:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,6V11H18V7.75L22.25,12L18,16.25V13H13V18H16.25L12,22.25L7.75,18H11V13H6V16.25L1.75,12L6,7.75V11H11V6H7.75L12,1.75L16.25,6H13Z"/></svg>',plus:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /></svg>',caret:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7,10L12,15L17,10H7Z" /></svg>',delete:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z" /></svg>',copy:'<svg viewBox="0 0 24 24">
41<path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" /></svg>',arrowUp:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z" /></svg>',chevron:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z" /></svg>',eye:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" /></svg>',eyeOff:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z" /></svg>'},i18n:{},undoManager:{},assetManager:{},canvas:{},layerManager:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:"Code",keepUnusedStyles:!1,customUI:!1},cd=kg,Qu=De(391),Mg=De.n(Qu),Je=De(694),Lg=function(a){var r=a.$;if(r&&r.prototype&&r.prototype.constructor.name!=="jQuery"){var t=r.fn;t.hide=function(){return this.css("display","none")},t.show=function(){return this.css("display","block")},t.focus=function(){var i=this.get(0);return i&&i.focus(),this},t.bind=function(i,l){return this.on(i,l)},t.unbind=function(i,l){if((0,k.isObject)(i)){for(var u in i)i.hasOwnProperty(u)&&this.off(u,i[u]);return this}else return this.off(i,l)},t.click=function(i){return i?this.on("click",i):this.trigger("click")},t.change=function(i){return i?this.on("change",i):this.trigger("change")},t.keydown=function(i){return i?this.on("keydown",i):this.trigger("keydown")},t.delegate=function(i,l,u,c){return c||(c=u),this.on(l,i,function(f){f.data=u,c(f)})},t.scrollLeft=function(){var i=this.get(0);i=i.nodeType==9?i.defaultView:i;var l=i instanceof Window?i:null;return l?l.pageXOffset:i.scrollLeft||0},t.scrollTop=function(){var i=this.get(0);i=i.nodeType==9?i.defaultView:i;var l=i instanceof Window?i:null;return l?l.pageYOffset:i.scrollTop||0};var e=r.prototype.offset;t.offset=function(i){var l,u;return i&&(l=i.top,u=i.left),typeof l<"u"&&this.css("top","".concat(l,"px")),typeof u<"u"&&this.css("left","".concat(u,"px")),e.call(this)},r.map=function(i,l){for(var u=[],c=0;c<i.length;c++)u.push(l(i[c],c));return u};var n=Array.prototype.indexOf;r.inArray=function(i,l,u){return l==null?-1:n.call(l,i,u)},r.Event=function(i,l){if(!(this instanceof r.Event))return new r.Event(i,l);this.type=i,this.isDefaultPrevented=function(){return!1}}}},Wt=De(268),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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Dg=(function(a){Ap(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r})(Wt.Kx),jg=(function(a){Ap(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return 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,k.isArray)(t)?t:[t]).filter(function(l){return!n.hasComponent(l)}).map(function(l){return new Dg({component:l})})[0];return this.push(i,e)}
41,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,k.isArray)(t)?t:[t]).map(function(l){return n.getByComponent(l)});return this.remove(i,e)},r})(Wt.pM),Ig=jg,Rg=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),tc=function(){return tc=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},tc.apply(this,arguments)},Ng=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},kp=(function(){function a(r,t,e){this.debounced=[],this.collections=[],this.cls=[],this._em=r,this._name=t;var n=this.name.charAt(0).toLowerCase()+this.name.slice(1),i=(0,k.isUndefined)(r.config[n])?r.config[this.name]:r.config[n],l=i===!0?{}:i||{};l.pStylePrefix=r.config.pStylePrefix||"",!(0,k.isUndefined)(i)&&!i&&(l._disable=1),l.em=r,this._config=(0,At.deepMerge)(e||{},l)}return Object.defineProperty(a.prototype,"em",{get:function(){return this._em},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"config",{get:function(){return this._config},enumerable:!1,configurable:!0}),a.prototype.render=function(r){},a.prototype.postLoad=function(r){},Object.defineProperty(a.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),a.prototype.getConfig=function(r){return r?this.config[r]:this.config},a.prototype.__logWarn=function(r,t){t===void 0&&(t={}),this.em.logWarning("[".concat(this.name,"]: ").concat(r),t)},a.prototype.destroy=function(){this.__destroy()},a.prototype.__destroy=function(){var r,t,e;(r=this.view)===null||r===void 0||r.remove(),(t=this.state)===null||t===void 0||t.stopListening(),(e=this.state)===null||e===void 0||e.clear(),this.debounced.forEach(function(n){return n.cancel()}),this.collections.forEach(function(n){n.stopListening(),n.reset()})},a.prototype.__appendTo=function(){var r=this.getConfig().appendTo;if(r){var t=(0,k.isElement)(r)?r:document.querySelector(r);if(!t)return this.__logWarn('"appendTo" element not found');t.appendChild(this.render())}},a})(),pr=kp,Ri=(function(a){Rg(r,a);function r(t,e,n,i,l,u){u===void 0&&(u={});var c=a.call(this,t,e,l)||this;return c.cls=[],c.private=!1,c.all=n,c.events=i,!u.skipListen&&c.__initListen(),c}return r.prototype.postLoad=function(t){},r.prototype.render=function(t){},r.prototype.getProjectData=function(t){var e={},n=this.storageKey;return n&&(e[n]=t||this.getAll()),e},r.prototype.loadProjectData=function(t,e){t===void 0&&(t={}),e===void 0&&(e={});var n=e.all,i=e.onResult,l=e.reset,u=this.storageKey,c={action:"load"},f=n||this.all,v=t[u];if(typeof v=="string")try{v=JSON.parse(v)}catch(g){this.__logWarn("Data parsing failed",{input:v})}return l&&v&&f.reset(void 0,c),i?v&&i(v,c):v&&(0,At.isDef)(v.length)&&f.reset(v,c),v},r.prototype.clear=function(t){t===void 0&&(t={});var e=this.all;return e&&e.reset(void 0,t),this},r.prototype.getAll=function(){return Ng([],this.all.models,!0)},r.prototype.getAllMap=function(){return this.getAll().reduce(function(t,e){return t[e.get(e.idAttribute)]=e,t},{})},r.prototype.__initListen=function(t){t===void 0&&(t={});var e=this,n=e.all,i=e.em,l=e.events;n&&i&&n.on("add",function(u,c,f){return i.trigger(l.add,u,f)}).on("remove",function(u,c,f){return i.trigger(l.remove,u,f)}).on("change",function(u,c){return i.trigger(l.update,u,u.changedAttributes(),c)}).on("all",this.__catchAllEvent,this),this.cls=[n].concat(t.collections||[]),(t.propagate||[]).forEac
41h(function(u){var c=u.entity,f=u.event;c.on("all",function(v,g,y,_){var b=_||y,S=tc({event:v},b);[i,n].map(function(E){return E.trigger(f,g,S)})})})},r.prototype.__remove=function(t,e){var n=this;e===void 0&&(e={});var i=this.em,l=(0,k.isString)(t)?this.get(t):t,u=function(){return l&&n.all.remove(l,e),l};return!e.silent&&i?.trigger(this.events.removeBefore,l,u,e),!e.abort&&u()},r.prototype.__catchAllEvent=function(t,e,n,i){var l=this,u=l.em,c=l.events,f=i||n;u&&c.all&&u.trigger(c.all,{event:t,model:e,options:f}),this.__onAllEvent()},r.prototype.__appendTo=function(t){var e=this.config.appendTo;if(e){var n=(0,k.isElement)(e)?e:document.querySelector(e);if(!n)return this.__logWarn('"appendTo" element not found');n.appendChild(this.render(t))}},r.prototype.__onAllEvent=function(){},r.prototype._createId=function(t){t===void 0&&(t=16);var e=this.getAll(),n=e.length+t,i=this.getAllMap(),l;do l=(0,At.createId)(n);while(i[l]);return l},r.prototype.__listenAdd=function(t,e){var n=this;t.on("add",function(i,l,u){return n.em.trigger(e,i,u)})},r.prototype.__listenRemove=function(t,e){var n=this;t.on("remove",function(i,l,u){return n.em.trigger(e,i,u)})},r.prototype.__listenUpdate=function(t,e){var n=this;t.on("change",function(i,l){return n.em.trigger(e,i,i.changedAttributes(),l)})},r.prototype.__destroy=function(){var t;this.cls.forEach(function(e){e.stopListening(),e.reset()}),(t=this.view)===null||t===void 0||t.remove(),this.view=void 0},r})(kp),Fg={stylePrefix:"cv-",scripts:[],styles:[],customBadgeLabel:void 0,autoscrollLimit:50,extHl:!1,frameContent:"<!DOCTYPE html>",frameStyle:` 42 body { background-color: #fff } 43 * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) } 44 * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) } 45 * ::-webkit-scrollbar { width: 10px } 46 `,notTextable:["button","a","input[type=checkbox]","input[type=radio]"],allowExternalDrop:!0},Vg=Fg,Ii=De(578),Hg={default:"",devices:[{id:"desktop",name:"Desktop",width:""},{id:"tablet",name:"Tablet",width:"770px",widthMedia:"992px"},{id:"mobileLandscape",name:"Mobile landscape",width:"568px",widthMedia:"768px"},{id:"mobilePortrait",name:"Mobile portrait",width:"320px",widthMedia:"480px"}]},Ug=Hg,Bg=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Wg=(function(a){Bg(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return{name:"",width:null,height:"",widthMedia:null,priority:null}},r.prototype.initialize=function(){var t=this;this.get("widthMedia")===null&&this.set("widthMedia",this.get("width")),this.get("width")===null&&this.set("width",this.get("widthMedia")),!this.get("priority")&&this.set("priority",parseFloat(this.get("widthMedia"))||0);var e=["width","height","widthMedia"];e.forEach(function(n){return t.checkUnit(n)})},r.prototype.checkUnit=function(t){var e=this.get(t)||"",n=(parseFloat(e)||0).toString()===e.toString();n&&this.set(t,"".concat(e,"px"))},r.prototype.getName=function(){return this.get("name")||this.get("id")},r.prototype.getWidthMedia=function(){return this.get("widthMedia")||""},r})(Wt.Kx),Mp=Wg,zg=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Lp=(function(a){zg(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r})(Wt.pM),fd=Lp;Lp.prototype.model=Mp;
46var Kg=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Gg=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},$g=(function(a){Kg(r,a);function r(t){var e=a.call(this,t)||this;return e.config=t.config||{},e.em=e.config.em,e.ppfx=e.config.pStylePrefix||"",e.listenTo(e.em,"change:device",e.updateSelect),e}return r.prototype.template=function(t){var e=t.ppfx,n=t.label;return fr(dd||(dd=Gg([` 47 <div class="`,'device-label">',`</div> 48 <div class="`,"field ",`select"> 49 <span id="`,`input-holder"> 50 <select class="`,`devices"></select> 51 </span> 52 <div class="`,`sel-arrow"> 53 <div class="`,`d-s-arrow"></div> 54 </div> 55 </div> 56 <button style="display:none" class="`,`add-trasp" data-add-trasp>+</button> 57 `],[` 58 <div class="`,'device-label">',`</div> 59 <div class="`,"field ",`select"> 60 <span id="`,`input-holder"> 61 <select class="`,`devices"></select> 62 </span> 63 <div class="`,`sel-arrow"> 64 <div class="`,`d-s-arrow"></div> 65 </div> 66 </div> 67 <button style="display:none" class="`,`add-trasp" data-add-trasp>+</button> 68 `])),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,e=t.em,n=t.devicesEl;if(e&&e.getDeviceModel&&n){var i=e.getDeviceModel();n.val(i?i.get("id"):"")}},r.prototype.getOptions=function(){var t=this,e=t.collection,n=t.em,i="";return e.forEach(function(l){var u=l.attributes,c=u.name,f=u.id,v=n&&n.t&&n.t("deviceManager.devices.".concat(f))||c;i+='<option value="'.concat(f||c,'">').concat(v,"</option>")}),i},r.prototype.render=function(){var t=this,e=t.em,n=t.ppfx,i=t.$el,l=t.el,u=e&&e.t&&e.t("deviceManager.device");return i.html(this.template({ppfx:n,label:u})),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})(Wt.Ss),qg=$g,dd,Yg=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),La=function(){return La=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},La.apply(this,arguments)},Dp="device",Hl="".concat(Dp,":"),jp="".concat(Hl,"select"),ST="".concat(jp,":before"),Ip="".concat(Hl,"update"),Rp="".concat(Hl,"add"),OT="".concat(Rp,":before"),Np="".concat(Hl,"remove"),Xg="".concat(Np,":before"),Jg="change:device",Zg={all:Dp,select:jp,update:Ip,add:Rp,remove:Np,removeBefore:Xg},Qg=(function(a){Yg(r,a);function r(t){var e,n=a.call(this,t,"DeviceManager",new fd,Zg,Ug)||this;return n.Device=Mp,n.Devices=fd,n.storageKey="",n.devices=n.all,(e=n.config.devices)===null||e===void 0||e.forEach(function(i){return n.add(i,{silent:!0})}),n.select(n.config.default||n.devices.at(0)),t.on(Jg,n._onSelect,n),n}return r.prototype._onSelect=function(t,e,n){var i=this,l=i.em,u=i.events,c=t.previous("device"),f=this.get(e),v=u.select;l.trigger(v,f,this.get(c)),this.__catchAllEvent(v,f,n)},r.prototype.add=function(t,e){e===void 0&&(e={});var n,i=e;if((0,k.isString)(t)){var l=e;i=arguments[2]||{},n=La(La({},i),{id:t,name:i.name||t,width:l})}else n=t;return n.id||(n.id=n.name||this._createId()),this.devices.add(n,i)},r.prototype.get=function(t){var e=this.getAll().filter(function(n){return n.get("name")===t})[0];return e||this.devices.get(t)||null},r.prototype.remove=function(t,e){return e===void 0&&(e={}),this.__remove(t,e)},r.prototype.getDevices=function(){return this.devices.models},r.prototype.select=function(t,e){e===void 0&&(e={});var n=(0,k.isString)(t)?this.get(t):t;return n&&this.em.set("device",n.get("id"),e),this},r.prototype.getSelected=function(){return this.get(this.em.get("device"))},r.prototype.getAll=function(){return this.devices},r.prototype.render=function(){var t,e=this.em;return(t=this.view)===null||t===void 0||t.remove(),this.view=new qg({collection:this.devices,config:La({em:e},this.config)}),this.view.render().el},r.prototype.destroy=function(){this.__destroy()},r})(Ri),ty=Qg,Fp=(function(a){return a.add="page:add",a.addBefore="page:add:before",a.remove="page:remove",a.removeBefore="page:remove:before",a.select="page:select",a.selectBefore="page:select:before",a.update="page:update",a.all="page",a})(Fp||{}
68),ec=Fp,ey=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ny=(function(a){ey(r,a);function r(t,e,n){return a.call(this,e,{module:t,modelConstructor:n})||this}return r.prototype.add=function(t,e){var n=this,i,l=(0,k.isArray)(t)?t:(0,k.isUndefined)(t)?void 0:[t];return l=(i=l?.map(function(u){return u instanceof n.newModel?u:new n.newModel(n.module,u)}))!==null&&i!==void 0?i:[void 0],a.prototype.add.call(this,(0,k.isArray)(t)?l:l[0],e)},r.prototype.preinitialize=function(t,e){this.newModel=e.modelConstructor,this.module=e.module},r})(Wt.pM),Ul=ny,ry=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),nc=function(){return nc=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},nc.apply(this,arguments)},pd=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},hd="__aw",vd="__ah",gd=function(a,r){var t,e=a.get(r),n=(t=a.view)===null||t===void 0?void 0:t.el[r==="width"?"offsetWidth":"offsetHeight"];return(0,k.isNumber)(e)?e:(0,k.isString)(e)&&e.endsWith("px")?parseFloat(e):n||0},iy=(function(a){ry(r,a);function r(t,e){var n=a.call(this,t,e)||this,i=n.em,l=n.attributes,u=l.styles,c=l.component,f=i.Components,v=f.getConfig(),g=i.Css.getAll(),y={},_={em:i,config:v,frame:n,idMap:y};if(!(0,At.isComponent)(c)){var b=(0,At.isObject)(c)?c:{components:c};!b.type&&(b.type="wrapper");var S=f.getType("wrapper").model;n.set("component",new S(b,_))}if(!u)n.set("styles",g);else if(!(0,At.isObject)(u)){var E=u;(0,k.keys)(y).length&&(E=(0,k.isString)(E)?i.Parser.parseCss(E):E,i.Css.checkId(E,{idMap:y})),g.add(E),n.set("styles",g)}return!e.width&&n.set(hd,1),!e.height&&n.set(vd,1),!n.id&&n.set("id",(0,At.createId)()),n}return r.prototype.defaults=function(){return{x:0,y:0,changesCount:0,attributes:{},width:null,height:null,head:[],component:"",styles:"",refFrame:null,_undo:!0,_undoexc:["changesCount"]}},Object.defineProperty(r.prototype,"width",{get:function(){return gd(this,"width")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return gd(this,"height")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"head",{get:function(){return this.get("head")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"refFrame",{get:function(){return this.get("refFrame")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){var t=this.refFrame;return t?.getComponent()||this.getComponent()},enumerable:!1,configurable:!0}),r.prototype.initRefs=function(){var t=this.refFrame;if((0,k.isString)(t)){var e=this.module.framesById[t];e&&this.set({refFrame:e},{silent:!0})}},r.prototype.getBoxRect=function(){var t=this.attributes,e=t.x,n=t.y,i=this,l=i.width,u=i.height;return{x:e,y:n,width:l,height:u}},r.prototype.onRemove=function(){!this.refFrame&&this.getComponent().remove({root:1})},r.prototype.changesUp=function(t){t===void 0&&(t={}),!(t.temporary||t.noCount||t.avoidStore)&&this.set("changesCount",this.get("changesCount")+1)},r.prototype.getComponent=function(){return this.get("component")},r.prototype.getStyles=function(){return this.get("styles")},r.prototype.disable=function(){this.trigger("disable")},r.prototype.remove=function(){var t;(t=this.view)===null||t===void 0||t.remove(),this.view=void 0;var e=this.collection;return e&&e.remove(this)},r.prototype.getHead=function(){return pd([],this.head,!0)},r.prototype.setHead=function(t){return this.set("head",pd([],t,!0))}
68,r.prototype.addHeadItem=function(t){this.head.push(t)},r.prototype.getHeadByAttr=function(t,e,n){return this.head.filter(function(i){return i.attributes&&i.attributes[t]==e&&(!n||n===i.tag)})[0]},r.prototype.removeHeadByAttr=function(t,e,n){var i=this.getHeadByAttr(t,e,n),l=this.head.indexOf(i);l>=0&&this.head.splice(l,1)},r.prototype.addLink=function(t){var e="link";!this.getHeadByAttr("href",t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:"stylesheet"}})},r.prototype.removeLink=function(t){this.removeHeadByAttr("href",t,"link")},r.prototype.addScript=function(t){var e="script";!this.getHeadByAttr("src",t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},r.prototype.removeScript=function(t){this.removeHeadByAttr("src",t,"script")},r.prototype.getPage=function(){var t;return(t=this.collection)===null||t===void 0?void 0:t.page},r.prototype._emitUpdated=function(t){t===void 0&&(t={}),this.em.trigger("frame:updated",nc({frame:this},t))},r.prototype.hasAutoHeight=function(){var t=this.attributes.height;return!!(t==="auto"||this.config.infiniteCanvas)},r.prototype.toJSON=function(t){t===void 0&&(t={});var e=Ii.A.prototype.toJSON.call(this,t),n=(0,k.result)(this,"defaults");return t.fromUndo&&delete e.component,delete e.styles,delete e.changesCount,e[hd]&&delete e.width,e[vd]&&delete e.height,e.refFrame&&(e.refFrame=e.refFrame.i
68d,delete e.component),(0,k.forEach)(e,function(i,l){l.indexOf("_")===0&&delete e[l]}),(0,k.forEach)(n,function(i,l){e[l]===i&&delete e[l]}),(0,k.forEach)(["attributes","head"],function(i){(0,k.isEmpty)(e[i])&&delete e[i]}),e},r})(Ii.A),Vp=iy,oy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ay=(function(a){oy(r,a);function r(t,e){e===void 0&&(e=[]);var n=a.call(this,t,e,Vp)||this;return n.loadedItems=0,n.itemsToLoad=0,(0,k.bindAll)(n,"itemLoaded"),n.on("add",n.onAdd),n.on("reset",n.onReset),n.on("remove",n.onRemove),n.forEach(function(i){return n.onAdd(i)}),n}return r.prototype.onAdd=function(t){this.module.framesById[t.id]=t},r.prototype.onReset=function(t,e){var n=this,i=e?.previousModels||[];i.map(function(l){return n.onRemove(l)})},r.prototype.onRemove=function(t){t.onRemove(),delete this.module.framesById[t.id]},r.prototype.initRefs=function(){this.forEach(function(t){return t.initRefs()})},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})(Ul),Hp=ay,sy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ly=(function(a){sy(r,a);function r(t){var e=this,n=t.em,i=t.config,l=i.scripts,u=i.styles;return e=a.call(this,t,{scripts:l,styles:u})||this,e.set("frames",new Hp(t)),e.on("change:zoom",e.onZoomChange),e.on("change:x change:y",e.onCoordsChange),e.on("change:pointer change:pointerScreen",e.onPointerChange),e.listenTo(n,"change:device ".concat(Ip),e.updateDevice),e.listenTo(n,ec.select,e._pageUpdated),e}return r.prototype.defaults=function(){return{frame:"",frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[],pointer:Wt.lK,pointerScreen:Wt.lK}},Object.defineProperty(r.prototype,"frames",{get:function(){return this.get("frames")},enumerable:!1,configurable:!0}),r.prototype.init=function(){var t=this.em,e=t.Pages._initPage();this.set("frames",e.getFrames()),this.updateDevice({frame:e.getMainFrame()})},r.prototype._pageUpdated=function(t,e){var n=this.em;n.setSelected(),n.get("readyCanvas")&&n.stopDefault(),e?.getFrames().map(function(i){return i.disable()}),this.set("frames",t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},r.prototype.updateDevice=function(t){t===void 0&&(t={});var e=this.em,n=e.getDeviceModel(),i=t.frame||e.getCurrentFrameModel();if(i&&n){var l=n.attributes,u=l.width,c=l.height;i.set({width:u,height:c},{noUndo:1})}},r.prototype.onZoomChange=function(){var t=this,e=t.em,n=t.module,i=this.get("zoom");i<1&&this.set("zoom",1),e.trigger(n.events.zoom)},r.prototype.onCoordsChange=function(){var t=this,e=t.em,n=t.module;e.trigger(n.events.coords)},r.prototype.onPointerChange=function(){var t=this,e=t.em,n=t.module;e.trigger(n.events.pointer)},r.prototype.getPointerCoords=function(t){t===void 0&&(t=Wt.x2.World);var e=this.attributes,n=e.pointer,i=e.pointerScreen;return t===Wt.x2.World?n:i},r})(Ii.A),uy=ly,Lr=De(683),Vn=De(249),cy=(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");a(r,t);function e(){this.constructor=r}
68r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),fy=(function(a){cy(r,a);function r(t,e){e===void 0&&(e=[]);var n=a.call(this,t,e,Lr.A)||this;n.on("add",n.onAdd),n.on("change",n.onChange),n.on("remove",n.onRemove);var i=n.em;n.refreshDbn=(0,k.debounce)(function(){return n.refresh()},0);var l="component:resize styleable:change component:input ".concat(Vn.I.update," frame:updated undo redo");return n.listenTo(i,l,function(){return n.refreshDbn()}),n}return Object.defineProperty(r.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"events",{get:function(){return this.module.events},enumerable:!1,configurable:!0}),r.prototype.refresh=function(){var t=this,e=t.em,n=t.events;e.trigger(n.spot)},r.prototype.onAdd=function(t){this.__trgEvent(this.events.spotAdd,{spot:t})},r.prototype.onChange=function(t){this.__trgEvent(this.events.spotUpdate,{spot:t})},r.prototype.onRemove=function(t){this.__trgEvent(this.events.spotRemove,{spot:t})},r.prototype.__trgEvent=function(t,e){var n=this.module,i=n.em;i.trigger(t,e),this.refreshDbn()},r})(Ul),dy=fy,xc=(function(a){return a.dragEnter="canvas:dragenter",a.dragOver="canvas:dragover",a.dragEnd="canvas:dragend",a.dragData="canvas:dragdata",a.drop="canvas:drop",a.spot="canvas:spot",a.spotAdd="canvas:spot:add",a.spotUpdate="canvas:spot:update",a.spotRemove="canvas:spot:remove",a.coords="canvas:coords",a.zoom="canvas:zoom",a.pointer="canvas:pointer",a.refresh="canvas:refresh",a.frameLoad="canvas:frame:load",a.frameLoadHead="canvas:frame:load:head",a.frameLoadBody="canvas:frame:load:body",a})(xc||{}),Vs=xc,py=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),hy=(function(a){py(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"pfx",{get:function(){return this.ppfx+this.config.stylePrefix||""},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ppfx",{get:function(){return this.em.config.stylePrefix||""},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"module",{get:function(){var t,e;return(e=(t=this.model)===null||t===void 0?void 0:t.module)!==null&&e!==void 0?e:this.collection.module},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"config",{get:function(){return this.module.config},enumerable:!1,configurable:!0}),r.prototype.preinitialize=function(t){this.className=""},r})(Wt.Ss),Dr=hy,$t=De(926),vy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),gy=(function(a){vy(r,a);function r(t,e){t===void 0&&(t={}),e===void 0&&(e=!1);var n=a.call(this,t)||this;return n.itemsView="",n.itemType="type",n.reuseView=!1,n.viewCollection=[],e&&n.listenTo(n.collection,"add",n.addTo),n}return r.prototype.addTo=function(t){this.add(t)},r.prototype.itemViewNotFound=function(t){},r.prototype.add=function(t,e){var n=this,i=n.reuseView,l=n.viewCollection,u=e||null,c=t.get(this.itemType),f;t.view&&i?f=t.view:f=this.renderView(t,c),l.push(f);var v=f.render().el;u?u.appendChild(v):this.$el.append(v)},r.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each(function(n){return t.add(n,e)}),this.$el.append(e),this.onRender(),this},r.prototype.onRender=function(){},r.prototype.onRemoveBefore=function(t,e){},r.prototype.onRemove=function(t,e){},r.prototype.remove=function(t){t===void 0&&(t={});var e=this.viewCollection;return this.onRemoveBefore(e,t),this.clearItems(),Wt.Ss.prototype.remove.apply(this,t),this.onRemove(e,t),this},r.prototype.clearItems=function(){var t=this.viewCollection||[]},r}
68)(Dr),yy=gy,my=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),_y=(function(a){my(r,a);function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;e.config=t.config||{};var n=e.model;return e.listenTo(n,"change",e.render),e.listenTo(n,"destroy remove",e.remove),e.listenTo(n.get("selectors"),"change",e.render),e}return r.prototype.tagName=function(){return"style"},r.prototype.render=function(){var t=this,e=t.model,n=t.el,i=e.get("important");return n.innerHTML=e.toCSS({important:i}),this},r})(Wt.Ss),Up=_y,wy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),by=(function(a){wy(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype._createElement=function(){return document.createTextNode("")},r.prototype.render=function(){var t=this.model,e=t.get("important");return this.el.textContent=t.getDeclaration({important:e}),this},r})(Up),xy=by,Cy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Cu=function(a,r){return"".concat(a).concat(r?"-".concat(parseFloat(r)):"")},Sy=(function(a){Cy(r,a);function r(t){var e=a.call(this,t)||this;(0,k.bindAll)(e,"sortRules");var n=t.config||{};e.atRules={},e.config=n,e.em=n.em,e.pfx=n.stylePrefix||"",e.className=e.pfx+"rules";var i=e.collection;return e.listenTo(i,"add",e.addTo),e.listenTo(i,"reset",e.render),e}return r.prototype.addTo=function(t){this.addToCollection(t)},r.prototype.addToCollection=function(t,e){if(this.renderStarted){var n=e||null,i=this.config,l={model:t,config:i},u,c;if(t.get("atRuleType")==="keyframes"){var f=t.getAtRule(),v=this.atRules[f];if(!v){var g=document.createElement("style");v=document.createTextNode(""),g.appendChild(document.createTextNode("".concat(f,"{"))),g.appendChild(v),g.appendChild(document.createTextNode("}")),this.atRules[f]=v,u=g}c=new xy(l),v.appendData(c.render().el.textContent)}else c=new Up(l),u=c.render().el;var y=this.className,_=t.get("mediaText"),b=Cu(y),S=b;if(_&&(S=Cu(y,this.getMediaWidth(_))),u){var E=n||this.el,N=void 0;try{N=E.querySelector("#".concat(S))}catch(z){}N||(N=E.querySelector("#".concat(b))),N?.appendChild(u)}return u}},r.prototype.getMediaWidth=function(t){return t&&t.replace("(".concat(this.em.getConfig().mediaCondition,": "),"").replace(")","")},r.prototype.sortRules=function(t,e){var n=this.em,i=(n.getConfig().mediaCondition||"").indexOf("min-width")!==-1;if(!i)return 0;var l=i?t:e,u=i?e:t;return l-u},r.prototype.render=function(){var t=this;this.renderStarted=!0,this.atRules={};var e=this,n=e.em,i=e.$el,l=e.collection,u=this.className,c=document.createDocumentFragment();i.empty();var f=n.Devices.getAll().pluck("priority").sort(this.sortRules);return f.every(function(v){return v})&&f.unshift(0),f.forEach(function(v){return c.appendChild((0,$t.a_)("div",{id:Cu(u,v)}))}),l.each(function(v){return t.addToCollection(v,c)}),i.append(c),i.attr("class",u),this},r})(Wt.Ss),Bp=Sy,Wp="text/html",Oy=Wp,Ty=function(a,r){r===void 0&&(r={});var t=new DOMParser,e=r.htmlType||Oy,n=e===Wp,i=n?a:"<div>".concat(a,"</div>"),l=t.parseFromString(i,e),u;if(n){if(r.asDocument)return l;var c=l.head,f=l.body,v=c.querySelectorAll("script");(0,k.each)(v,function(y){return f.appendChild(y)});var g=[];(0,k.each)(c.children,function(y){return g.push(y)}),(0,k.each)(g,function(y,_){return f.insertBefore(y,f.children[_])}),u=f}else u=l.firstChild;return u},ii=function(){return ii=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];
68for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},ii.apply(this,arguments)},Ey="data-gjs-",yd="parse:html",Py=function(a,r){return r===void 0&&(r={}),{compTypes:[],modelAttrStart:Ey,getPropAttribute:function(t,e){var n=t.replace(this.modelAttrStart,""),i=e?.length||0,l=e?.substring(0,1),u=e?.substring(i-1),c=e==="true"?!0:e==="false"?!1:e;try{c=l=="{"&&u=="}"||l=="["&&u=="]"?JSON.parse(c):c}catch(f){}return{name:n,value:c}},splitPropsFromAttr:function(t){var e=this;t===void 0&&(t={});var n={},i={};return(0,k.each)(t,function(l,u){if(u.indexOf(e.modelAttrStart)===0){var c=e.getPropAttribute(u,l);n[c.name]=c.value}else i[u]=l}),{props:n,attrs:i}},parseStyle:function(t){for(var e={};t.indexOf("/*")>=0;){var n=t.indexOf("/*"),i=t.indexOf("*/")+2;t=t.replace(t.slice(n,i),"")}for(var l=t.split(";"),u=0,c=l.length;u<c;u++){var f=l[u].trim();if(f){var v=f.split(":"),g=v[0].trim(),y=v.slice(1).join(":").trim();e[g]?((0,k.isArray)(e[g])||(e[g]=[e[g]]),e[g].push(y)):e[g]=y}}return e},parseClass:function(t){for(var e=[],n=t.split(" "),i=0,l=n.length;i<l;i++){var u=n[i].trim();u&&e.push(u)}return e},parseNodeAttr:function(t,e){for(var n=e||{},i=t.attributes||[],l=i.length,u=0;u<l;u++){var c=i[u].nodeName,f=i[u].nodeValue;if(c=="style")n.style=this.parseStyle(f);else if(c=="class")n.classes=this.parseClass(f);else{if(c=="contenteditable")continue;if(c.indexOf(this.modelAttrStart)===0){var v=this.getPropAttribute(c,f);n[v.name]=v.value}else f===""&&t[c]===!0&&(f=!0),n.attributes||(n.attributes={}),n.attributes[c]=f}}return n},detectNode:function(t,e){var n;e===void 0&&(e={});var i=this.compTypes,l={};if(i){var u=(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"".concat(this.modelAttrStart,"type"));if(u)l={type:u};else for(var c=0;c<i.length;c++){var f=i[c],v=f.model.isComponent(t,e);if(v){typeof v!="object"&&(v={type:f.id}),l=v;break}}}return l},parseNode:function(t,e){var n;e===void 0&&(e={});var i=((n=t.content)===null||n===void 0?void 0:n.childNodes)||t.childNodes,l=i.length,u=this.detectNode(t,e);if(!u.tagName){var c=t.tagName||"",f=t.namespaceURI||"";u.tagName=c&&f==="http://www.w3.org/1999/xhtml"?c.toLowerCase():c}if(u=this.parseNodeAttr(t,u),!l&&"".concat(t.outerHTML).slice(-2)==="/>"&&(u.void=!0),l&&!u.components&&!e.skipChildren){var v=i[0];l===1&&v.nodeType===3?(!u.type&&(u.type="text"),u.components={type:"textnode",content:v.nodeValue}):u.components=this.parseNodes(t,ii(ii({},e),{inSvg:e.inSvg||u.type==="svg"}))}var g=u.components;if(!u.type&&g?.length){for(var y=r.textTypes,_=y===void 0?[]:y,b=r.textTags,S=b===void 0?[]:b,E=!0,N=!1,z=0;z<g.length;z++){var R=g[z],W=R.type;if(!_.includes(W)&&!S.includes(R.tagName)){E=!1;break}W==="textnode"&&(N=!0)}E&&N&&(u.type="text")}return u},parseNodes:function(t,e){var n;e===void 0&&(e={});for(var i=[],l=((n=t.content)===null||n===void 0?void 0:n.childNodes)||t.childNodes,u=l.length,c=0;c<u;c++){var f=l[c],v=i[i.length-1],g=this.parseNode(f,e);if(g.type==="textnode"){if(v?.type==="textnode"){v.content+=g.content;continue}if(!e.keepEmptyTextNodes){var y=f.nodeValue||"",_=c===0||c===u-1,b=y.includes(` 69`);if(y!=" "&&!y.trim()&&(_||b))continue}}!g.tagName&&(0,k.isUndefined)(g.content)||i.push(g)}return i},parse:function(t,e,n){var i,l,u;n===void 0&&(n={});var c=a?.get("Config")||{},f={html:[]},v=ii(ii({},r),n),g=ii(ii(ii({},r.optionsHtml),{htmlType:((i=r.optionsHtml)===null||i===void 0?void 0:i.htmlType)||r.htmlType}),n),y=g.preParser,_=g.asDocument,b=(0,k.isFunction)(y)?y(t,{editor:a?.getEditor()}):t,S=(0,k.isFunction)(v.parserHtml)?v.parserHtml(b,g):Ty(b,g),E=S,N=S;_&&(E=N.documentElement,f.doctype=(0,$t.LJ)(N.doctype));var z=E.querySelectorAll("script"),R=z.length,W=(0,k.isUndefined)(c.allowScripts)?g.allowScripts:c.allowScripts;if(!W)for(;R--;)(l=z[R].parentNode)===null||l===void 0||l.removeChild(z[R]);if((!g.allowUnsafeAttr||!g.allowUnsafeAttrValue)&&this.__sanitizeNode(E,g),e){for(var ct=E.querySelectorAll("style"),_t=ct.length,xt="";_t--;)xt=ct[_t].innerHTML+xt,(u=ct[_t].parentNode)===null||u===void 0||u.removeChild(ct[_t]);xt&&(f.css=e.parse(xt))}a?.trigger("".concat(yd,":root"),{input:b,root:E});var ut=[];if(_)f.head=this.parseNode(N.head,v),f.root=this.parseNodeAttr(E),ut=this.parseNode(N.body,v);else{var q=this.parseNodes(E,v);ut=q.length===1&&!v.returnArray?q[0]:q}return f.html=ut,a?.trigger(yd,{input:b,output:f}),f},__sanitizeNode:function(t,e){var n=this,i=t.attributes||[],l=t.childNodes||[],u=[];(0,k.each)(i,function(c){var f=c.nodeName||"",v=c.nodeValue||"";!e.allowUnsafeAttr&&f.startsWith("on")&&u.push(f),!e.allowUnsafeAttrValue&&v.startsWith("javascript:")&&u.push(f)}),u.map(function(c){return t.removeAttribute(c)}),(0,k.each)(l,function(c){return n.__sanitizeNode(c,e)})}}}
69,zp=Py,Ay=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Qi=function(){return Qi=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Qi.apply(this,arguments)},ky=zp(),rc=function(a){return(0,k.isArray)(a)?a[a.length-1]:a},My=(function(a){Ay(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.parseStyle=function(t){return ky.parseStyle(t)},r.prototype.extendStyle=function(t){return Qi(Qi({},this.getStyle()),t)},r.prototype.getStyle=function(t){var e=this.get("style")||{},n=Qi({},e);return t&&(0,k.isString)(t)?n[t]:n},r.prototype.setStyle=function(t,e){var n=this;t===void 0&&(t={}),e===void 0&&(e={}),(0,k.isString)(t)&&(t=this.parseStyle(t));var i=this.getStyle(e);e.partial||e.avoidStore?(e.avoidStore=!0,t.__p=!0):delete t.__p;var l=Qi({},t),u=Qi({},l);(0,k.keys)(u).forEach(function(f){u[f]===""&&delete u[f]}),this.set("style",u,e);var c=(0,At.shallowDiff)(i,l);return delete c.__p,(0,k.keys)(c).forEach(function(f){var v=n.em;e.noEvent||(n.trigger("change:style:".concat(f)),v&&(v.trigger("styleable:change",n,f,e),v.trigger("styleable:change:".concat(f),n,f,e)))}),l},r.prototype.addStyle=function(t,e,n){var i;e===void 0&&(e=""),n===void 0&&(n={}),typeof t=="string"?t=(i={},i[t]=e,i):n=e||{},n.addStyle=t,t=this.extendStyle(t),this.setStyle(t,n)},r.prototype.removeStyle=function(t){var e=this.getStyle();delete e[t],this.setStyle(e)},r.prototype.styleToString=function(t){t===void 0&&(t={});var e=[],n=this.getStyle(t),i=t.important,l=function(c){var f=(0,k.isArray)(i)?i.indexOf(c)>=0:i,v=c.substring(0,2),g=v==="__";if(g)return"continue";var y=n[c],_=(0,k.isArray)(y)?y:[y];_.forEach(function(b){var S="".concat(b).concat(f?" !important":"");S&&e.push("".concat(c,":").concat(S,";"))})};for(var u in n)l(u);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})(Wt.Kx),Kp=My,ur=function(){return ur=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},ur.apply(this,arguments)},Gp=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},zs=function(a){return(0,k.isArray)(a.get(cr))},Ks=function(a){return!!a.get(Mr)},Ko=function(a){return!!(zs(a)||Ks(a))},ao=function(a){var r=a.parent();return Ko(a)&&(!r||!Ko(r))};var Oa=function(a){a.__symbReady||(a.on("change",a.__upSymbProps),a.__symbReady=!0)},so=function(a){var r=a.get(Mr);if(r&&(0,k.isString)(r)){var t=a.__getAllById()[r];t?(r=t,a.set(Mr,t)):r=0}return r||void 0},Or=function(a){var r=a?.get(cr);return r&&(0,k.isArray)(r)&&(r.forEach(function(t,e){t&&(0,k.isString)(t)&&(r[e]=a.__getAllById()[t])}),r=r.filter(function(t){return t&&!(0,k.isString)(t)})),r||void 0},Go=function(a,r){r===void 0&&(r="");var t=a?.get(ja),e=r.split(":")[0],n=r!==e?[r,e]:[r];return t===!0||(0,k.isArray)(t)&&n.some(function(i){return t.indexOf(i)>=0})},io=function(a,r){r===void 0&&(r={});var t=[],e=r.changed;if(r.fromInstance||r.noPropagate||r.fromUndo||e&&Go(a,e))return t;var n=Or(a)||[],i=so(a),l=i?Gp([i],Or(i)||[],!0):n;return t=l.filter(function(u){return u!==a}).filter(function(u){return!(e&&Go(u,e))}),t},md=function(a,r){for(var t=a,e=a.parent(r);e&&Ko(e);)t=e,e=e.parent(r);return t},Cc=function(a,r){r===void 0&&(r={});var t=so(a),e=t&&Or(t);!r.skipRefs&&e&&t.set(cr,e.filter(function(n){return n!==a}
69)),a.set(Mr,0),a.components().forEach(function(n){return Cc(n,r)})},Da=function(a,r,t,e){e===void 0&&(e={});var n=so(a),i=Or(a);!n&&!i||a.em.log(r,{model:a,toUp:t,context:"symbols",opts:e})},Ly=function(a,r){r===void 0&&(r={});var t=a.changedAttributes()||{},e=t.attributes||{};if(delete t.status,delete t.open,delete t[cr],delete t[Mr],delete t[ja],delete t.attributes,delete e.id,(0,At.isEmptyObj)(e)||(t.attributes=e),!(0,At.isEmptyObj)(t)){var n=io(a,r);(0,k.keys)(t).map(function(i){Go(a,i)&&delete t[i]}),Da(a,"props",n,{opts:r,changed:t}),n.forEach(function(i){var l=ur({},t);(0,k.keys)(l).map(function(u){Go(i,u)&&delete l[u]}),i.set(l,ur({fromInstance:a},r))})}},Dy=function(a,r){r===void 0&&(r={});var t=io(a,r);Da(a,"classes",t,{opts:r}),t.forEach(function(e){e.set("classes",a.get("classes"),{fromInstance:a})}),a.__changesUp(r)},$p=function(a,r,t,e){var n=e||t||{},i=n.fromInstance,l=n.fromUndo,u={fromInstance:i,fromUndo:l},c=r.opt.temporary;if(e)if(e.add){var _=[],b=!!Or(a),v=io(a,ur(ur({},u),{changed:"components:add"}));if(v.length){var S=so(r);_=Or(S||r)||[],_=Gp([],_,!0),_.push(S||r)}!c&&Da(a,"add",v,{opts:e,addedInstances:_.map(function(ut){return ut.cid}),added:r.cid}),v.forEach(function(ut){var q=md(ut),lt=_.filter(function(I){var B=md(I,{prev:1});return q&&B&&B===q})[0],H=lt||r.clone({symbol:!0,symbolInv:b});ut.append(H,ur({fromInstance:a},e))})}else{var E=so(r);if(E&&!e.temporary&&E.set(cr,Or(E).filter(function(xt){return xt!==r})),!ao(r)&&!e.skipRefsUp){var N="components:remove",z=e.index,R=r.parent(),W=ur({fromInstance:r},e),ct=ao(r),_t=function(ut){var q=ut.parent();q&&!Go(q,N)&&ut.remove(W)},v=Go(R,N)?[]:io(r,u);ct&&(v=R&&io(R,ur(ur({},u),{changed:N})),_t=function(ut){var q=ut.components().at(z);q&&q.remove(ur({fromInstance:R},W))}),!c&&Da(a,"remove",v,{opts:e,removed:r.cid,isSymbNested:ct}),v.forEach(_t)}}else{var f=r,v=io(a,ur(ur({},u),{changed:"components:reset"})),g=f.models,y=new Set;Da(a,"reset",v,{components:g}),v.forEach(function(xt){var ut=xt.components(),q=g.map(function(lt,H){return!Ko(lt)||y.has(lt)?(y.add(lt),lt.clone({symbol:!0})):ut.at(H)});ut.reset(q,ur({fromInstance:a},t))})}a.__changesUp(n)},jy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Sr=function(){return Sr=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Sr.apply(this,arguments)},Hs=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},_d=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Io=function(a,r){if(r===void 0&&(r=[]),!a)return[];var t=(0,k.isArray)(a)||(0,k.isFunction)(a.map)?a:[a];return t.map(function(e){r.push(e.getId()),Io(e.components().models,r)}),r},qp=function(a,r,t){r===void 0&&(r={}),t===void 0&&(t={}),t.visitedCmps=t.visitedCmps||{};var e=t.visitedCmps,n=(0,k.isArray)(a)?a:[a];return n.map(function(i){var l=i.attributes,u=l===void 0?{}:l,c=i.components,f=i.tagName,v=i.style,g=u.id,y=u.draggable,_=Hs(u,["id","draggable"]),b=i;if(g){if(e[g])e[g].push(b),g=Hn.getNewId(r),b.attributes.id=g;else if(e[g]=[],r[g]){b=r[g];var S=b;f&&S.set({tagName:f},Sr(Sr({},t),{silent:!0})),(0,k.keys)(_).length&&S.addAttributes(_,Sr({},t)),(0,k.keys)(v).length&&S.addStyle(v,t)}}if(c){var E=qp(c,r);if((0,k.isFunction)(b.components)){var N=b.components();N.length>0&&N.reset(E,t)}else b.components=E}return b})},Iy=(function(a){jy(r,a);function r(t,e){var n=a.call(this,t,e)||this;n.opt=e,n.listenTo(n,"add",n.onAdd),n.listenTo(n,"remove",n.removeChildren),n.listenTo(n,"reset",n.resetChildren);var i=e.em,l=e.config;return n.config=l,n.em=i,n.domc=e.domc||i?.Components,n}return Object.defineProperty(r.prototype,"events",{get:function(){var t;return(t=this.domc)===null||t===void 0?void 0:t.events}
69,enumerable:!1,configurable:!0}),r.prototype.resetChildren=function(t,e){var n=this;e===void 0&&(e={});var i=this,l=e.previousModels||[],u=l.filter(function(v){return!t.get(v.cid)}),c=Io(t),f=Io(l).filter(function(v){return c.indexOf(v)>=0});e.keepIds=(e.keepIds||[]).concat(f),u.forEach(function(v){return n.removeChildren(v,i,e)}),t.each(function(v){return n.onAdd(v)})},r.prototype.resetFromString=function(t,e){var n,i;t===void 0&&(t=""),e===void 0&&(e={}),e.keepIds=Io(this);var l=this,u=l.domc,c=l.em,f=l.parent,v=c?.Css,g=u?.allById()||{},y=this.parseString(t,e),_=qp(y,g,e),b=e.visitedCmps,S=b===void 0?{}:b;Object.keys(S).forEach(function(E){var N=S[E];if(N.length){var z=v?.getRules("#".concat(E))||[];z.length&&N.forEach(function(R){z.forEach(function(W){var ct=W.clone();ct.set("selectors",["#".concat(R.attributes.id)]),v.getAll().add(ct)})})}}),this.reset(_,e),c?.trigger("component:content",f,e,t),(i=(n=f).__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,u=l.domc,c=l.em,f=n.temporary||n.fromUndo;if(t.prevColl=this,!f){var v=t.getId(),g=c.Selectors.getAll(),y=c.Css.getAll(),_=(n.keepIds||[]).indexOf(v)<0,b=u?u.allById():{};delete b[v];var S=_?y.remove(y.filter(function(z){return z.getSelectors().getFullString()==="#".concat(v)}),n):[];g.remove(S.map(function(z){return z.getSelectors().at(0)})),t.opt.temporary||(c.Commands.run("core:component-style-clear",{target:t}),t.removed(),t.trigger("removed"),c.trigger(Vn.I.remove,t),u&&Ks(t)&&ao(t)&&u.symbols.__trgEvent(u.events.symbolInstanceRemove,{component:t},!0));var E=t.components();E.forEach(function(z){$p(z,z,E,Sr(Sr({},n),{skipRefsUp:!0})),i.removeChildren(z,e,n)})}var N=t.components();c.stopListening(N),c.stopListening(t),c.stopListening(t.get("classes")),t.__postRemove()}},r.prototype.model=function(t,e){var n=e.collection.opt,i=n.em,l,u=i.Components.componentTypes;e.em=i,e.config=n.config,e.componentTypes=u,e.domc=n.domc;for(var c=0;c<u.length;c++){var f=u[c].id;if(f==t.type){l=u[c].model;break}}return l||(l=u[u.length-1].model,i&&t.type&&i.logWarning("Component type '".concat(t.type,"' not found"),{attrs:t,options:e})),new l(t,e)},r.prototype.parseString=function(t,e){e===void 0&&(e={});var n=this,i=n.em,l=n.domc,u=n.parent,c=e.asDocument&&u?.is("wrapper"),f=i.Css,v=i.Parser.parseHtml(t,Sr({asDocument:c},e.parserOptions)),g=v.html;if(c){var y=u,_=v.html||{},b=_.components,S=Hs(_,["components"]),E=v.head||{},N=E.components,z=Hs(E,["components"]);g=b,y.set(S,e),y.head.set(z,e),y.head.components(N,e),y.docEl.set(v.root,e),y.set({doctype:v.doctype})}if(Hn.checkId(g,v.css,l.componentsById,e),v.css&&f&&!e.temporary){var R=e.at,W=Hs(e,["at"]);f.addCollection(v.css,Sr(Sr({},W),{extend:1}))}return g},r.prototype.add=function(t,e){var n=this;if(e===void 0&&(e={}),t!=null){e.keepIds=_d(_d([],e.keepIds||[],!0),Io(e.previousModels),!0),(0,k.isString)(t)?t=this.parseString(t,e):(0,k.isArray)(t)&&t.forEach(function(l,u){if((0,k.isString)(l)){var c=n.parseString(l,e);t[u]=(0,k.isArray)(c)&&!c.length?null:c}});var i=((0,k.isArray)(t)?t:[t]).filter(Boolean).map(function(l){return n.processDef(l)});return t=(0,k.isArray)(t)?(0,k.flatten)(i,1):i[0],a.prototype.add.call(this,t,e)}},r.prototype.processDef=function(t){if(t.cid&&t.ccid)return t;var e=this,n=e.em,i=e.config,l=i===void 0?{}:i,u=l.processor,c=t;if(u){c=Sr({},c);var f=u(c);f&&((0,k.each)(c,function(E,N){return delete c[N]}),(0,k.extend)(c,f))}if(c.$$typeof&&typeof c.props=="object"){c=Sr({},c),c.props=Sr({},c.props);var v=n.Components,g=n.Parser,y=g.parserHtml;(0,k.each)(c,function(E,N){(0,k.includes)(["props","type"],N)||delete c[N]});var _=c.props,b=_.children;delete _.children,delete c.props;var S=y.splitPropsFromAttr(_);c.attributes=S.attrs,b&&(c.components=b),c.type?v.getType(c.type)||(c.tagName=c.type,delete c.type):c.type="textnode",(0,k.extend)(c,S.props)}return c},r.prototype.onAdd=function(t,e,n){n===void 0&&(n={});var i=this,l=i.domc,u=i.em,c=t.getStyle(),f=u&&u.getConfig().avoidInlineStyle;if(l&&l.Component.ensureInList(t),!(0,k.isEmpty)(c)&&!f&&u&&u.getConfig().forceClass&&!n.temporary){var v=t.cid;u.Css.setClassRule(v,c),t.setStyle({}),t.addClass(v)}if(t.__postAdd({recursive:!0}),u&&!n.temporary){var g=function(y){u.trigger(Vn.I.add,y,n),y.components().forEac
69h(function(_){return g(_)})};g(t),l&&Ks(t)&&ao(t)&&l.symbols.__trgEvent(l.events.symbolInstanceAdd,{component:t},!0)}},r})(Wt.pM),Wa=Iy,Ry=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ks=1,Su=2,Yp=(function(a){Ry(r,a);function r(t,e){e===void 0&&(e={});var n=a.call(this,t,e)||this,i=e.config,l=i===void 0?{}:i,u=n.get("name"),c=n.get("label");u?c||n.set("label",u):n.set("name",c);var f=n.get("name"),v=l.escapeName,g=v?v(f):r.escapeName(f);return n.set("name",g),n.em=e.em,n}return r.prototype.defaults=function(){return{name:"",label:"",type:ks,active:!0,private:!1,protected:!1,_undo:!0}},r.prototype.isId=function(){return this.get("type")===Su},r.prototype.isClass=function(){return this.get("type")===ks},r.prototype.getFullName=function(t){t===void 0&&(t={});var e=t.escape,n=this.get("name"),i="";switch(this.get("type")){case ks:i=".";break;case Su:i="#";break}return i+(e?e(n):n)},r.prototype.toString=function(){return this.getFullName()},r.prototype.getName=function(){return this.get("name")||""},r.prototype.getLabel=function(){return this.get("label")||""},r.prototype.setLabel=function(t){return this.set("label",t)},r.prototype.getActive=function(){return!!this.get("active")},r.prototype.setActive=function(t){return this.set("active",t)},r.prototype.toJSON=function(t){t===void 0&&(t={});var e=this.em,n=Wt.Kx.prototype.toJSON.call(this,[t]),i=(0,k.result)(this,"defaults");if(e?.getConfig().avoidDefaults){(0,k.forEach)(i,function(u,c){n[c]===u&&delete n[c]}),n.label===n.name&&delete n.label;var l=(0,k.keys)(n).length;l===1&&n.name&&(n=n.name),l===2&&n.name&&n.type&&(n=this.getFullName())}return n},r.escapeName=function(t){return"".concat(t).trim().replace(/\s+/g,"-")},r.TYPE_CLASS=ks,r.TYPE_ID=Su,r})(Wt.Kx),Jn=Yp;Yp.prototype.idAttribute="name";var Ny=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Xp=function(a,r){return a.reduce(function(t,e,n){return t.concat(Xp(a.slice(n+1),"".concat(r).concat(e)))},[r])},Jp=(function(a){Ny(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.modelId=function(t){return"".concat(t.name,"_").concat(t.type||Jn.TYPE_CLASS)},r.prototype.getStyleable=function(){return(0,k.filter)(this.models,function(t){return t.getActive()&&!t.get("private")})},r.prototype.getValid=function(t){var e=t===void 0?{}:t,n=e.noDisabled;return(0,k.filter)(this.models,function(i){return!i.get("private")}).filter(function(i){return n?i.get("active"):1})},r.prototype.getFullString=function(t,e){e===void 0&&(e={});var n=[],i=t||this;return i.forEach(function(l){return n.push(l.getFullName(e))}),e.sort&&n.sort(),n.join("").trim()},r.prototype.getFullName=function(t){t===void 0&&(t={});var e=t.combination,n=t.array,i=[],l=this.map(function(u){return u.getFullName(t)}).sort();return e?l.forEach(function(u,c){i=i.concat(Xp(l.slice(c+1),u))}):i=l,n?i:e?i.join(","):i.join("")},r})(Wt.pM),ji=Jp;Jp.prototype.model=Jn;var Fy=(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");a(r,t);function e(){this.constructor=r}
69r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),wd=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Vy=(function(a){Fy(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return{id:"",label:"",open:!0,attributes:{}}},r.prototype.getId=function(){return this.get("id")},r.prototype.getLabel=function(){return this.get("label")},r})(Wt.Kx),Ga=Vy;function Zp(a){var r=new Set,t=new Map,e={items:[]};a.forEach(function(i){var l=i.category;if(l){r.add(l);var u=t.get(l);u?u.push(i):t.set(l,[i])}else e.items.push(i)});var n=Array.from(r).map(function(i){return{category:i,items:t.get(i)||[]}});return wd(wd([],n,!0),[e],!1)}var Hy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),bd="category",Qp=(function(a){Hy(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.initCategory=function(t){var e=t.get(bd),n=e instanceof Ga;if(e&&!n){(0,k.isString)(e)?e={id:e,label:e}:(0,At.isObject)(e)&&!e.id&&(e.id=e.label);var i=this.getCategories().add(e);return t.set(bd,i,{silent:!0}),i}else if(n){var i=e;return this.getCategories().add(i),i}},r})(Wt.pM),Uy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),th=(function(a){Uy(r,a);function r(t,e){e===void 0&&(e={});var n=a.call(this,t,e)||this,i=e.events,l=e.em,u=i?.update;return l&&u&&n.on("change",function(c,f){return l.trigger(u,{category:c,changes:c.changedAttributes(),options:f})}),n}return r.prototype.add=function(t,e){var n=(0,k.isArray)(t)?t:[t];return n.forEach(function(i){return i&&(i.id=(0,At.normalizeKey)("".concat(i.id)))}),a.prototype.add.call(this,t,e)},r.prototype.get=function(t){return a.prototype.get.call(this,(0,k.isString)(t)?(0,At.normalizeKey)(t):t)},r})(Wt.pM),Gs=th;th.prototype.model=Ga;var Sc=(function(a){return a.select="trait:select",a.value="trait:value",a.categoryUpdate="trait:category:update",a.custom="trait:custom",a.all="trait",a})(Sc||{}),ic=Sc,By=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),$s=function(){return $s=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},$s.apply(this,arguments)},Wy=(function(a){By(r,a);function r(t,e){var n=a.call(this,t)||this,i=n.attributes,l=i.target,u=i.name;return!n.get("id")&&n.set("id",u),l&&n.setTarget(l),n.em=e,n}return r.prototype.defaults=function(){return{type:"text",label:"",name:"",unit:"",step:1,value:"",default:"",placeholder:"",category:"",changeProp:!1,options:[]}},Object.defineProperty(r.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"category",{get:function(){var t=this.get("category");return t instanceof Ga?t:void 0}
69,enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"component",{get:function(){return this.target},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"changeProp",{get:function(){return!!this.get("changeProp")},enumerable:!1,configurable:!0}),r.prototype.setTarget=function(t){if(t){var e=this.attributes,n=e.name,i=e.changeProp,l=e.value,u=e.getValue;this.target=t,this.unset("target");var c=i?"change:".concat(n):"change:attributes:".concat(n);this.listenTo(t,c,this.targetUpdated);var f=l||(u?void 0:this.getValue());!(0,k.isUndefined)(f)&&this.set({value:f},{silent:!0})}},r.prototype.getId=function(){return this.get("id")},r.prototype.getType=function(){return this.get("type")},r.prototype.getName=function(){return this.get("name")},r.prototype.getLabel=function(t){var e;t===void 0&&(t={});var n=t.locale,i=n===void 0?!0:n,l=this.getId(),u=this.get("label")||this.getName();return i&&((e=this.em)===null||e===void 0?void 0:e.t("traitManager.traits.labels.".concat(l)))||u},r.prototype.getValue=function(t){return this.getTargetValue(t)},r.prototype.setValue=function(t,e){var n=this;e===void 0&&(e={});var i=this,l=i.component,u=i.em,c=e.partial,f={},v=this.attributes.setValue;if(v){v({value:t,component:l,editor:u?.getEditor(),trait:this,partial:!!c,options:e,emitUpdate:function(){return n.targetUpdated()}});return}c&&(f.avoidStore=!0),this.setTargetValue(t,f)},r.prototype.getDefault=function(){return this.get("default")},r.prototype.getOptions=function(){return this.get("options")||[]},r.prototype.getOption=function(t){var e=this,n=(0,At.isDef)(t)?t:this.getValue();return this.getOptions().filter(function(i){return e.getOptionId(i)===n})[0]},r.prototype.getOptionId=function(t){return t.id||t.value},r.prototype.getOptionLabel=function(t,e){var n;e===void 0&&(e={});var i=e.locale,l=i===void 0?!0:i,u=(0,k.isString)(t)?this.getOption(t):t,c=this.getOptionId(u),f=u.label||u.name||c,v=this.getName();return l&&((n=this.em)===null||n===void 0?void 0:n.t("traitManager.traits.options.".concat(v,".").concat(c)))||f},r.prototype.getCategoryLabel=function(t){t===void 0&&(t={});var e=this,n=e.em,i=e.category,l=t.locale,u=l===void 0?!0:l,c=i?.getId(),f=i?.getLabel();return u&&n?.t("traitManager.categories.".concat(c))||f||""},r.prototype.runCommand=function(){var t=this.em,e=this.attributes.command;if(e&&t)return(0,k.isString)(e)?t.Commands.run(e):e(t.Editor,this)},r.prototype.props=function(){return this.attributes},r.prototype.targetUpdated=function(){var t=this,e=t.component,n=t.em,i=this.getTargetValue({useType:!0});this.set({value:i},{fromTarget:1});var l={trait:this,component:e,value:i};e.trigger(ic.value,l),n?.trigger(ic.value,l),n?.trigger("trait:update",l)},r.prototype.getTargetValue=function(t){t===void 0&&(t={});var e=this,n=e.component,i=e.em,l=this.getName(),u=this.get("getValue"),c;if(u?c=u({editor:i?.getEditor(),trait:this,component:n}):this.changeProp?c=n.get(l):c=n.getAttributes()[l],t.useType){var f=this.getType();if(f==="checkbox"){var v=this.attributes,g=v.valueTrue,y=v.valueFalse;!(0,k.isUndefined)(g)&&g===c?c=!0:!(0,k.isUndefined)(y)&&y===c&&(c=!1)}}return(0,k.isUndefined)(c)?"":c},r.prototype.setTargetValue=function(t,e){var n;e===void 0&&(e={});var i=this,l=i.component,u=i.attributes,c=this.getName();if(!(0,k.isUndefined)(t)){var f=t;if(t==="false"?f=!1:t==="true"&&(f=!0),this.getType()==="checkbox"){var v=u.valueTrue,g=u.valueFalse;f&&!(0,k.isUndefined)(v)&&(f=v),!f&&!(0,k.isUndefined)(g)&&(f=g)}var y=(n={},n[c]=f,n);y.__p=e.avoidStore?null:void 0,this.changeProp?l.set(y,e):l.addAttributes(y,e)}},r.prototype.setValueFromInput=function(t,e,n){e===void 0&&(e=!0),n===void 0&&(n={});var i={value:t};this.set(i,$s($s({},n),{avoidStore:1}
69)),e&&(this.set("value","",n),this.set(i,n))},r.prototype.getInitValue=function(){var t=this.component,e=this.getName(),n;if(t){var i=t.get("attributes");n=this.changeProp?t.get(e):i[e]}return n||this.get("value")||this.get("default")},r})(Wt.Kx),qs=Wy,zy=(function(){function a(r){r===void 0&&(r={}),this.config=r}return a.prototype.build=function(r,t){return(0,k.isString)(r)?this.buildFromString(r,t):new qs(r,t)},a.prototype.buildFromString=function(r,t){var e={name:r,type:"text"};return r==="target"&&(e.type="select",e.default=!1,e.options=this.config.optionsTarget),new qs(e,t)},a})(),Ky=zy,Gy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),$y=(function(a){Gy(r,a);function r(t,e){var n=a.call(this,t)||this;n.categories=new Gs;var i=e.em;n.em=i,n.categories=new Gs([],{em:i,events:{update:ic.categoryUpdate}}),n.on("add",n.handleAdd),n.on("reset",n.handleReset);var l=n.module,u=l?.getConfig();return n.tf=new Ky(u),n}return Object.defineProperty(r.prototype,"module",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),r.prototype.getCategories=function(){return this.categories},r.prototype.handleReset=function(t,e){var n=e===void 0?{}:e,i=n.previousModels,l=i===void 0?[]:i;l.forEach(function(u){return u.trigger("remove")})},r.prototype.handleAdd=function(t){t.em=this.em;var e=this.target;e&&(t.target=e),this.initCategory(t)},r.prototype.setTarget=function(t){this.target=t,this.models.forEach(function(e){return e.setTarget(t)})},r.prototype.add=function(t,e){if(t!=null){var n=this,i=n.target,l=n.em;if((0,k.isArray)(t)){for(var u=[],c=0,f=t.length;c<f;c++){var v=t[c];u[c]=v instanceof qs?v:this.tf.build(v,l),u[c].setTarget(i)}return a.prototype.add.call(this,u,e)}var g=t instanceof qs?t:this.tf.build(t,l);return g.setTarget(i),a.prototype.add.call(this,g,e)}},r})(Qp),Ys=$y,qy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ue=function(){return Ue=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Ue.apply(this,arguments)},Yy=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},Ur=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},xd=function(a){return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},Aa=function(a){return!!a?.getConfig().avoidInlineStyle},Oc="component:drag",cr="__symbols",Mr="__symbol",ja="__symbol_ovrd",Us=Vn.I.update,oc=Vn.I.updateInside,Xy=(function(a){qy(r,a);function r(t,e){t===void 0&&(t={});var n=a.call(this,t,e)||this;(0,k.bindAll)(n,"__upSymbProps","__upSymbCls","__upSymbComps");var i=e.em,l=n.parent(),u=l?.attributes,c=n.get("propagate");if(c&&n.set("propagate",(0,k.isArray)(c)?c:[c]),u&&u.propagate&&!c){var f={},v=u.propagate;v.forEach(function(S){return f[S]=l.get(S)}),f.propagate=v,n.set(Ue(Ue({},f),t))}if(e&&e.config&&e.config.voidElements.indexOf(n.get("tagName"))>=0&&n.set("void",!0),e.em=i,n.opt=e,n.em=i,n.frame=e.frame,n.config=e.config||{},n.set("attributes",Ue(Ue({},(0,k.result)(n,"defaults").attributes||{}),n.get("attributes")||{})),n.ccid=r.createId(n,e),n.initClasses(),n.initComponents(),n.initTraits(),n.initToolbar(),n.initScriptProps(),n.listenTo(n,"change:script",n.scriptUpdated),n.listenTo(n,"change:tagName",n.tagUpdated),n.listenTo(n,"change:attributes",n.attrUpd
69ated),n.listenTo(n,"change:attributes:id",n._idUpdated),n.on("change:toolbar",n.__emitUpdateTlb),n.on("change",n.__onChange),n.on(oc,n.__propToParent),n.set("status",""),n.views=[],["classes","traits","components"].forEach(function(S){var E="add remove ".concat(S!=="components"?"change":"");n.listenTo(n.get(S),E.trim(),function(){for(var N=[],z=0;z<arguments.length;z++)N[z]=arguments[z];return n.emitUpdate.apply(n,Ur([S],N,!1))})}),!e.temporary){var g=i&&i.Css,y=n.attributes,_=y.styles,b=y.type;_&&g&&g.addCollection(_,{avoidUpdateStyle:!0},{group:"cmp:".concat(b)}),n.__postAdd(),n.init(),Ko(n)&&Oa(n),i?.trigger(Vn.I.create,n,e)}return n}return Object.defineProperty(r.prototype,"defaults",{get:function(){var t;return t={tagName:"div",type:"",name:"",removable:!0,draggable:!0,droppable:!0,badgable:!0,stylable:!0,"stylable-require":"","style-signature":"",unstylable:"",highlightable:!0,copyable:!0,resizable:!1,editable:!1,layerable:!0,selectable:!0,hoverable:!0,void:!1,state:"",status:"",content:"",icon:"",style:"",styles:"",classes:"",script:"","script-props":"","script-export":"",attributes:{},traits:["id","title"],propagate:"",dmode:"",toolbar:null,delegate:null},t[Mr]=0,t[cr]=0,t[ja]=0,t._undo=!0,t._undoexc=["status","open"],t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tagName",{get:function(){return this.get("tagName")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"classes",{get:function(){return this.get("classes")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"traits",{get:function(){return this.get("traits")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"content",{get:function(){var t;return(t=this.get("content"))!==null&&t!==void 0?t:""},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"toolbar",{get:function(){return this.get("toolbar")||[]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"resizable",{get:function(){return this.get("resizable")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"delegate",{get:function(){return this.get("delegate")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"locked",{get:function(){return this.get("locked")},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.updated=function(t,e,n){},r.prototype.removed=function(){},r.prototype.__postAdd=function(t){t===void 0&&(t={});var e=this.em,n=e?.UndoManager,i=this.components();n&&!this.__hasUm&&(n.add(i),n.add(this.getSelectors()),this.__hasUm=!0),t.recursive&&i.map(function(l){return l.__postAdd(t)})},r.prototype.__postRemove=function(){var t=this.em,e=t?.UndoManager;e&&(e.remove(this.components()),e.remove(this.getSelectors()),delete this.__hasUm)},r.prototype.__onChange=function(t,e){var n=this,i=this.changedAttributes()||{};(0,k.keys)(i).forEach(function(l){return n.emitUpdate(l)}),["status","open","toolbar","traits"].forEach(function(l){return delete i[l]}),(0,At.isEmptyObj)(i)||(this.__changesUp(e),this.__propSelfToParent({component:this,changed:i,options:e}))},r.prototype.__onStyleChange=function(t){var e=this,n=this.em;if(n){var i="component:styleUpdate",l=(0,k.keys)(t),u={style:t};n.trigger(i,this,u),l.forEach(function(c){return n.trigger("".concat(i,":").concat(c),e,u)})}},r.prototype.__changesUp=function(t){var e=this,n=e.em,i=e.frame;[i,n].forEach(function(l){return l&&l.changesUp(t)})},r.prototype.__propSelfToParent=function(t){this.trigger(Us,t),this.__propToParent(t)},r.prototype.__propToParent=function(t){var e=this.parent();e&&e.trigger(oc,t)},r.prototype.__emitUpdateTlb=function(){this.emitUpdate("toolbar")},r.prototype.__getAllById=function(){var t=this.em;return t?t.Components.allById():{}},r.prototype.__upSymbProps=function(t,e){e===void 0&&(e={}),Ly(this,e)},r.prototype.__upSymbCls=function(t,e,n){n===void 0&&(n={}),Dy(this,n)},r.prototype.__upSymbComps=function(t,e,n){$p(this,t,e,n)},r.prototype.is=function(t){return this.get("type")==t},r.prototype.props=function(){return this.attributes},r.prototype.index=function(){var t=this.collection;return t?t.indexOf(this):0},r.prototype.setDragMode=function(t){return this.set("dmode",t)},r.prototype.getDragMode=function(){return this.get("dmode")||""},r.prototype.setSymbolOverride=function(t){var e;this.set(ja,(e=(0,k.isString)(t)?[t]:t)!==null&&e!==void 0?e:0)},r.prototype.getSymbolOverride=function(){return this.get(ja)},r.prototype.find=function(t){var e,n=[],i=(e=this.view)===null||e===void 0?void 0:e.$el.find(t);return i?.each(function(l){var u=i.eq(l),c=u.data("model");c&&n.push(c)}),n},r.prototype.findType=function(t){var e=[],n=function(i){return i.forEac
69h(function(l){l.is(t)&&e.push(l),n(l.components())})};return n(this.components()),e},r.prototype.findFirstType=function(t){return this.findType(t).at(0)},r.prototype.closest=function(t){var e,n=(e=this.view)===null||e===void 0?void 0:e.$el.closest(t);return n?.length?n.data("model"):void 0},r.prototype.closestType=function(t){for(var e=this.parent();e&&!e.is(t);)e=e.parent();return e},r.prototype.contains=function(t){var e=!1;if(!t)return e;var n=function(i){!e&&i.forEach(function(l){l===t&&(e=!0),!e&&n(l.components())})};return n(this.components()),e},r.prototype.tagUpdated=function(){this.trigger("rerender")},r.prototype.replaceWith=function(t,e){e===void 0&&(e={});var n=this.collection,i=n.indexOf(this);n.remove(this);var l=n.add(t,Ue(Ue({},e),{at:i}));return(0,k.isArray)(l)?l:[l]},r.prototype.attrUpdated=function(t,e,n){var i=this;n===void 0&&(n={});var l=this.get("attributes"),u=l.class;u&&this.setClass(u),delete l.class;var c=l.style;c&&this.setStyle(c,n),delete l.style;var f=Ue({},this.previous("attributes")),v=(0,At.shallowDiff)(f,this.get("attributes"));(0,k.keys)(v).forEach(function(g){var y,_="attributes:".concat(g);i.trigger("change:".concat(_),i,v[g],n),(y=i.em)===null||y===void 0||y.trigger("".concat(Us,":").concat(_),i,v[g],n)})},r.prototype.setAttributes=function(t,e){return e===void 0&&(e={}),this.set("attributes",Ue({},t),e),this},r.prototype.addAttributes=function(t,e){return e===void 0&&(e={}),this.setAttributes(Ue(Ue({},this.getAttributes({noClass:!0})),t),e)},r.prototype.removeAttributes=function(t,e){t===void 0&&(t=[]),e===void 0&&(e={});var n=Array.isArray(t)?t:[t],i=this.getAttributes();return n.map(function(l){return delete i[l]}),this.setAttributes(i,e)},r.prototype.getStyle=function(t,e){t===void 0&&(t={}),e===void 0&&(e={});var n=this.em,i=(0,k.isString)(t)?t:"",l=i?e:t;if(Aa(n)&&!l.inline){var u=n.get("state"),c=n.Css,f=c.getIdRule(this.getId(),Ue({state:u},l));return this.rule=f,f?f.getStyle(i):{}}return a.prototype.getStyle.call(this,i)},r.prototype.setStyle=function(t,e){var n=this;t===void 0&&(t={}),e===void 0&&(e={});var i=this,l=i.opt,u=i.em;if(Aa(u)&&!l.temporary&&!e.inline){var c=this.get("style")||{};t=(0,k.isString)(t)?this.parseStyle(t):t,t=Ue(Ue({},t),c);var f=u.get("state"),v=u.Css,g=this.getStyle(e);this.rule=v.setIdRule(this.getId(),t,Ue({state:f},e));var y=(0,At.shallowDiff)(g,t);this.set("style","",{silent:!0}
69),(0,k.keys)(y).forEach(function(_){return n.trigger("change:style:".concat(_))})}else t=a.prototype.setStyle.apply(this,arguments);return l.temporary||this.__onStyleChange(e.addStyle||t),t},r.prototype.getAttributes=function(t){t===void 0&&(t={});var e=this.em,n=[],i=Ue({},this.get("attributes")),l=e?.Selectors,u=this.getId();if(t.noClass?delete i.class:(this.classes.forEach(function(v){return n.push((0,k.isString)(v)?v:v.getName())}),n.length&&(i.class=n.join(" "))),!t.noStyle){var c=this.getStyle({inline:!0});(0,At.isObject)(c)&&!(0,At.isEmptyObj)(c)&&(i.style=this.styleToString({inline:!0}))}if(!(0,k.has)(i,"id")){var f=!1;(Aa(e)||!(0,k.isEmpty)(this.getStyle()))&&(f=!!l?.get(u,l.Selector.TYPE_ID)),(Ko(this)||this.get("script-export")||this.get("script"))&&(f=!0),f&&(i.id=u)}return i},r.prototype.addClass=function(t){var e=this.em.Selectors.addClass(t);return this.classes.add(e)},r.prototype.setClass=function(t){return this.classes.reset(),this.addClass(t)},r.prototype.removeClass=function(t){var e=[];t=(0,k.isArray)(t)?t:[t];var n=this.classes,i=Jn.TYPE_CLASS;return t.forEach(function(l){var u=l.split(" ");u.forEach(function(c){var f=n.where({name:c,type:i})[0];f&&e.push(n.remove(f))})}),e},r.prototype.getClasses=function(){var t=this.getAttributes(),e=t.class;return e?e.split(" "):[]},r.prototype.initClasses=function(t,e,n){n===void 0&&(n={});var i="change:classes",l=this.get("attributes")||{},u=l.class,c=Yy(l,["class"]),f=[this,i,this.initClasses],v=this.get("classes")||u||[],g=(0,k.isString)(v)?v.split(" "):v;this.stopListening.apply(this,f);var y=this.normalizeClasses(g),_=new ji([]);return this.set("classes",_,n),_.add(y),_.on("add remove reset",this.__upSymbCls),u&&y.length&&this.set("attributes",c),this.listenTo.apply(this,f),this},r.prototype.initComponents=function(){var t="change:components",e=[this,t,this.initComponents];this.stopListening.apply(this,e);var n=new Wa([],this.opt);n.parent=this;var i=this.get("components"),l=!this.opt.avoidChildren;return this.set("components",n),l&&i&&n.add((0,k.isFunction)(i)?i(this):i,this.opt),n.on("add remove reset",this.__upSymbComps),this.listenTo.apply(this,e),this},r.prototype.initTraits=function(t){var e=this.em,n="change:traits";this.off(n,this.initTraits),this.__loadTraits();var i=Ue({},this.get("attributes")),l=this.traits;return l.each(function(u){if(!u.changeProp){var c=u.getName(),f=u.getInitValue();c&&f&&(i[c]=f)}}),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(c){return"change:".concat(c)}).join(" "),u=i.map(function(c){return"change:".concat(c)}).join(" ");l&&this.off(l,this.__scriptPropsChange),u&&this.on(u,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,k.isArray)(t)?Ur([],t,!0):[t],i=n.map(function(u){return(0,k.isString)(u)||u.collection&&u.collection.remove(u,{temporary:!0}),u}),l=this.components().add(i,Ue({action:Vn.t.add},e));return(0,k.isArray)(l)?l:[l]},r.prototype.components=function(t,e){e===void 0&&(e={});var n=this.get("components");return(0,k.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 Ys)){n=(0,k.isFunction)(n)?n(this):n;var i=new Ys([],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(),Ur([],this.traits.models,!0)},r.prototype.setTraits=function(t){var e=(0,k.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=this,n,i=(0,k.isArray)(t)?t:[t],l=i.map(function(f){return e.getTrait(f)}),u=this.traits,c=l.length?u.remove(l):[];return(n=this.em)===null||n===void 0||n.trigger("component:toggled"),(0,k.isArray)(c)?c:[c]},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,k.isArray)(i)?i:[i]},r.prototype.normalizeClasses=function(t){var e=[],n=this.em,i=n?.Selectors;return i?t.models?Ur([],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=Ue({},this.attributes),i=Ue({},this.opt),l=this.getId(),u=e?.Css;n.attributes=Ue({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],ao(this)&&(t.symbol=!0),this.get("components").each(function(b,S){
69n.components[S]=b.clone(Ue(Ue({},t),{_inner:1}))}),this.get("traits").each(function(b,S){n.traits[S]=b.clone()}),this.get("classes").each(function(b,S){n.classes[S]=b.get("name")}),n.status="",i.collection=null;var c=new this.constructor(n,i),f="#".concat(c.getId()),v=u?u.getRules("#".concat(l)):[];v.forEach(function(b){var S=b.clone();S.set("selectors",[f]),u.getAll().add(S)}),c.set(cr,0);var g=so(this),y=Or(this);!t.symbol&&(g||y)?(c.set(Mr,0),c.set(cr,0)):g?(g.set(cr,Ur(Ur([],Or(g),!0),[c],!1)),Oa(c)):t.symbol&&(zs(this)?(this.set(cr,Ur(Ur([],y,!0),[c],!1)),c.set(Mr,this),Oa(c)):t.symbolInv?(this.set(cr,[c]),c.set(Mr,this),[this,c].map(function(b){return Oa(b)})):(c.set(cr,[this]),[this,c].map(function(b){return Oa(b)}),this.set(Mr,c)));var _="component:clone";return e&&e.trigger(_,c),this.trigger(_,c),c},r.prototype.getName=function(t){t===void 0&&(t={});var e=this.em,n=this.attributes,i=n.type,l=n.tagName,u=n.name,c=i||l,f=i?"":l,v="domComponents.names.",g=u&&e?.t("".concat(v).concat(u)),y=f&&e?.t("".concat(v).concat(f)),_=e&&(e.t("".concat(v).concat(i))||e.t("".concat(v).concat(l))),b=this.get("custom-name");return(t.noCustom?"":b)||g||u||y||(0,At.capitalize)(f)||_||(0,At.capitalize)(c)},r.prototype.setName=function(t,e){e===void 0&&(e={}),this.set("custom-name",t,e)},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,l=i||e.get("tagName"),u=e.get("void"),c=t.attributes,f=this.getAttrToHTML(t);if(delete t.tag,c&&((0,k.isFunction)(c)?f=c(e,f)||{}:(0,At.isObject)(c)&&(f=c)),t.withProps){var v=this.toJSON();(0,k.forEach)(v,function(z,R){var W=["classes","attributes","components"];R[0]!=="_"&&W.indexOf(R)<0&&(f["data-gjs-".concat(R)]=(0,k.isArray)(z)||(0,At.isObject)(z)?JSON.stringify(z):(0,k.isBoolean)(z)?"".concat(z):z)})}for(var g in f){var y=f[g];if(!(0,k.isUndefined)(y)&&y!==null)if((0,k.isBoolean)(y))y&&n.push(g);else{var _="";if(t.altQuoteAttr&&(0,k.isString)(y)&&y.indexOf('"')>=0)_="'".concat(y.replace(/'/g,"'"),"'");else{var b=(0,k.isString)(y)?y.replace(/"/g,"""):y;_='"'.concat(b,'"')}n.push("".concat(g,"=").concat(_))}}var S=n.length?" ".concat(n.join(" ")):"",E=e.getInnerHTML(t),N="<".concat(l).concat(S).concat(u?"/":"",">").concat(E);return!u&&(N+="</".concat(l,">")),N},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.content},r.prototype.getAttrToHTML=function(t){var e=this.getAttributes();return Aa(this.em)&&t?.keepInlineStyle!==!0&&delete e.style,e},r.prototype.toJSON=function(t){t===void 0&&(t={});var e=Qu.Model.prototype.toJSON.call(this,t);if(e.attributes=this.getAttributes(),delete e.attributes.class,delete e.toolbar,delete e.traits,delete e.status,delete e.open,delete e._undoexc,delete e.delegate,!t.fromUndo){var n=e[Mr],i=e[cr];i&&(0,k.isArray)(i)&&(e[cr]=i.filter(function(l){return l}).map(function(l){return l.getId?l.getId():l})),n&&!(0,k.isString)(n)&&(e[Mr]=n.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(e),e},r.prototype.getChangedProps=function(t){var e=t||Qu.Model.prototype.toJSON.apply(this),n=(0,k.result)(this,"defaults");return(0,k.forEach)(n,function(i,l){["type"].indexOf(l)===-1&&e[l]===i&&delete e[l]}),(0,k.isEmpty)(e.type)&&delete e.type,(0,k.forEach)(["attributes","style"],function(i){(0,k.isEmpty)(n[i])&&(0,k.isEmpty)(e[i])&&delete e[i]}),(0,k.forEach)(["classes","components"],function(i){(!e[i]||(0,k.isEmpty)(n[i])&&!e[i].length)&&delete e[i]}),e},r.prototype.getId=function(){var t=this.get("attributes")||{};return t.id||this.ccid||this.cid},r.prototype.setId=function(t,e){var n=Ue({},this.get("attributes"));return n.id=t,this.set("attributes",n,e),this},r.prototype.getEl=function(t){var e=this.getView(t);return e&&e.el},r.prototype.getView=function(t){var e=this,n=e.view,i=e.views,l=e.em,u=t||l?.getCurrentFrameModel();return u&&(n=i.filter(function(c){return c.frameView===u.view})[0]),n},r.prototype.getCurrentView=function(){var t=this.em.getCurrentFrame(),e=t?.model;return this.getView(e)},r.prototype.__getScriptProps=function(){var t=this.props(),e=this.get("script-props")||[];return e.reduce(function(n,i){return n[i]=t[i],n},{})},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((0,k.isFunction)(n)){var i=n.toString().trim();i=i.slice(i.indexOf("{")+1,i.lastIndexOf("}")),n=i.trim()}var l=this.em.getConfig(),u=xd(l.tagVarStart||"{[ "),c=xd(l.tagVarEnd||" ]}"),f=new RegExp("".concat(u,"([\\w\\d-]*)").concat(c),"g");n=n.replace(f,function(v,g){e.scriptUpdated();var y=e.attributes[g]||"";return(0,k.isArray)(y)||typeof y=="object"?JSON.stringify(y):y})}return n},r.prototype.emitUpdate=function(t){for(var e,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var l=this.em,u=Us+(t?":".concat(t):""),c=t&&this.get(t);t&&this.updated.apply(this,Ur([t,c,t&&this.previous(t)],n,!1)),this.trigger.apply(this,Ur([u],n,!1)),l&&l.trigger.apply(l,Ur([u,this],n,!1)),["components","classes"].indexOf(t)>=0&&this.__propSelfToParent({component:this,changed:(e={},e[t]=c,e),options:n[2]||n[1]||{}})},r.prototype.onAll=function(t){return(0,k.isFunction)(t)&&(t(this),this.components().forEac
69h(function(e){return e.onAll(t)})),this},r.prototype.forEachChild=function(t){(0,k.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,Ue({action:Vn.t.remove},t)),i||(e.components("",t),e.components().removeChildren(e,void 0,t))},u=Ue({},t);return[this,n].map(function(c){return c.trigger(Vn.I.removeBefore,e,l,u)}),!u.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(),u=i===n||i===n-1;if(!l||!u){l&&n&&n>i&&(e.at=n-1);var c=Vn.t.move;this.remove({action:c,temporary:1}),t.append(this,Ue({action:c},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;if(!i)return!1;var l=this.constructor.typeExtends;return this instanceof i||l.has(t)},r.prototype.isChildOf=function(t){for(var e=(0,k.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){t===void 0&&(t={});var e=this.em,n=this.getId();if(!n)return this;var i=r.createId(this);this.setId(i);var l=e?.Css.getIdRule(n),u=l?.get("selectors").at(0);return u?.set("name",i),this},r.prototype._getStyleRule=function(t){var e=t===void 0?{}:t,n=e.id,i=this.em,l=n||this.getId();return i?.Css.getIdRule(l)},r.prototype._getStyleSelector=function(t){var e=this._getStyleRule(t);return 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,u=(this.previous("attributes")||{}).id||i,c=r.getList(this);if(c[l]||!l&&u)return this.setId(u,{idUpdate:!0});delete c[u],c[l]=this,this.ccid=l;var f=this._getStyleSelector({id:u});f&&f.set({name:l,label:l})}},r.getDefaults=function(){return(0,k.result)(this.prototype,"defaults")},r.isComponent=function(t,e){return{tagName:(0,At.toLowerCase)(t.tagName)}},r.ensureInList=function(t){var e=r.getList(t),n=t.getId(),i=e[n];if(!i)e[n]=t;else if(i!==t){var l=r.getIncrementId(n,e);t.setId(l),e[l]=t}t.components().forEach(function(u){return r.ensureInList(u)})},r.createId=function(t,e){e===void 0&&(e={});var n=r.getList(t),i=e.idMap,l=i===void 0?{}:i,u=t.get("attributes").id,c;return u?(c=r.getIncrementId(u,n,e),t.setId(c),u!==c&&(l[u]=c)):c=r.getNewId(n),n[c]=t,c},r.getNewId=function(t){for(var e=Object.keys(t).length,n=e.toString().length+2,i=(Math.random()+1.1).toString(36).slice(-n),l="i".concat(i);t[l];)l=r.getNewId(t);return l},r.getIncrementId=function(t,e,n){n===void 0&&(n={});var i=n.keepIds,l=i===void 0?[]:i,u=1,c=t;if(l.indexOf(t)<0)for(;e[c];)u++,c="".concat(t,"-").concat(u);return c},r.getList=function(t){var e,n=t.em,i=n?.Components;return(e=i?.componentsById)!==null&&e!==void 0?e:{}},r.checkId=function(t,e,n,i){e===void 0&&(e=[]),n===void 0&&(n={}),i===void 0&&(i={});var l=(0,k.isArray)(t)?t:[t],u=i.keepIds,c=u===void 0?[]:u,f=i.idMap,v=f===void 0?{}:f;l.forEach(function(g){g.attributes;var y=g.attributes,_=y===void 0?{}:y,b=g.components,S=_.id;if(S&&n[S]&&c.indexOf(S)<0){var E=r.getIncrementId(S,n);v[S]=E,_.id=E,(0,k.isArray)(e)&&e.forEach(function(N){var z=N.selectors;z.forEach(function(R,W){R==="#".concat(S)&&(z[W]="#".concat(E))})})}b&&r.checkId(b,e,n,i)})},r.typeExtends=new Set,r})(Kp),Hn=Xy,Jy=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Xs=function(){return Xs=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Xs.apply(this,arguments)},Wo="head",Zy=["title","style","base","link","meta","script","noscript"],Qy=(function(a){Jy(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return Xs(Xs({},a.prototype.defaults),{type:Wo,tagName:Wo,draggable:!1,highlightable:!1,droppable:function(t){var e=t.tagName;return!e||Zy.includes((0,At.toLowerCase)(e))}})}
69,enumerable:!1,configurable:!0}),r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===Wo},r})(Hn),tm=Qy,ac=function(){return ac=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},ac.apply(this,arguments)},em=(function(){function a(r,t){var e=this;this.em=r,this.canvas=r.Canvas;var n=t||this.canvas.getFrames().map(function(l){return l.getComponent().getEl()}),i=Array.isArray(n)?n:[n];this.el=i[0],this.counter=0,(0,k.bindAll)(this,"handleDragEnter","handleDragOver","handleDrop","handleDragLeave"),i.forEach(function(l){return e.toggleEffects(l,!0)})}return a.prototype.toggleEffects=function(r,t){var e={on:$t.on,off:$t.AU},n=t?"on":"off";e[n](r,"dragenter",this.handleDragEnter),e[n](r,"dragover",this.handleDragOver),e[n](r,"drop",this.handleDrop),e[n](r,"dragleave",this.handleDragLeave)},a.prototype.__customTglEff=function(r){var t,e=r?$t.on:$t.AU,n=this.el.ownerDocument,i=(t=n.defaultView)===null||t===void 0?void 0:t.frameElement;this.sortOpts=r?{onStart:function(l){var u=l.sorter;(0,$t.on)(i,"pointermove",u.onMove)},onEnd:function(l){var u=l.sorter;(0,$t.AU)(i,"pointermove",u.onMove)},customTarget:function(l){var u=l.event;return n.elementFromPoint(u.clientX,u.clientY)}}:null,e(i,"pointerenter",this.handleDragEnter),e(i,"pointermove",this.handleDragOver),e(document,"pointerup",this.handleDrop),e(i,"pointerout",this.handleDragLeave)},a.prototype.startCustom=function(){this.__customTglEff(!0)},a.prototype.endCustom=function(r){this.over?this.endDrop(r):this.__customTglEff(!1)},a.prototype.endDrop=function(r,t){var e=this,n=e.em,i=e.dragStop;this.counter=0,i&&i(r||!this.over),this.__customTglEff(!1),n.trigger("canvas:dragend",t)},a.prototype.handleDragLeave=function(r){this.updateCounter(-1,r)},a.prototype.updateCounter=function(r,t){this.counter+=r,this.counter===0&&this.endDrop(!0,t)},a.prototype.handleDragEnter=function(r){var t=this,e=this,n=e.em,i=e.canvas,l=r.dataTransfer,u=n.get("dragContent");if(!(!u&&!i.getConfig().allowExternalDrop)&&(this.updateCounter(1,r),!this.over)){this.over=!0;var c=n.Utils,f=u||"<br>",v,g;if(n.stopDefault(),n.inAbsoluteMode()){var y=n.Components.getWrapper(),_=y.append({})[0],b=n.Commands.run("core:component-drag",{event:r,guidesInfo:1,center:1,target:_,onEnd:function(E,N,z){var R=z.cancelled,W;if(!R){W=y.append(f)[0];var ct=i.getOffset(),_t=_.getStyle(),xt=_t.top,ut=_t.left,q=_t.position,lt=(0,$t.Xy)(E.target),H=parseInt("".concat(parseFloat(ut)+lt.x-ct.left),10),I=parseInt("".concat(parseFloat(xt)+lt.y-ct.top),10);W.addStyle({left:H+"px",top:I+"px",position:q})}t.handleDragEnd(W,l),_.remove()}});v=function(E){return b.stop(r,{cancel:E})},g=function(E){return f=E}}else{var S=new c.Sorter(ac({em:n,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:this.el,placer:i.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:"gjs-",onEndMove:function(E){return t.handleDragEnd(E,l)},document:this.el.ownerDocument},this.sortOpts||{}));S.setDropContent(f),S.startSort(),this.sorter=S,v=function(E){E&&(S.moved=!1),S.endMove()},g=function(E){return S.setDropContent(E)}}this.dragStop=v,this.dragContent=g,n.trigger("canvas:dragenter",l,f)}},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;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 u=0;u<n.length;u++){var c=n[u],f=c.type.split("/")[0];f=="image"&&l.push({type:f,file:c,attributes:{alt:c.name}})}}else if(i)l=i;else if((0,k.indexOf)(e,"text/html")>=0)l=r&&r.getData("text/html").replace(/<\/?meta[^>]*>/g,"");
69else if((0,k.indexOf)(e,"text/uri-list")>=0)l={type:"link",attributes:{href:l},content:l};else if((0,k.indexOf)(e,"text/json")>=0){var v=r&&r.getData("text/json");v&&(l=JSON.parse(v))}else e.length===1&&e[0]==="text/plain"&&(l="<div>".concat(l,"</div>"));var g={content:l};return t.trigger("canvas:dragdata",r,g),g},a})(),nm=em,rm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),kr=function(){return kr=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},kr.apply(this,arguments)},im=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},om=(function(a){rm(r,a);function r(t,e){var n=a.call(this,{model:t})||this;n.dragging=!1,n.loaded=!1,n.lastMaxHeight=0,n.tools={},(0,k.bindAll)(n,"updateClientY","stopAutoscroll","autoscroll","_emitUpdate");var i=n.el;n.module._config=kr(kr({},n.config||{}),{frameView:n}),n.frameWrapView=e,n.showGlobalTools=(0,k.debounce)(n.showGlobalTools.bind(n),50);var l=n.getCanvasModel();return n.listenTo(t,"change:head",n.updateHead),n.listenTo(l,"change:styles",n.renderStyles),t.view=n,(0,At.setViewEl)(i,n),n}return Object.defineProperty(r.prototype,"tagName",{get:function(){return"iframe"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"attributes",{get:function(){return{allowfullscreen:"allowfullscreen"}},enumerable:!1,configurable:!0}),r.prototype.getBoxRect=function(){var t=this,e=t.el,n=t.module,i=n.getCanvasView(),l=n.getCoords(),u=e.getBoundingClientRect(),c=i.getCanvasOffset(),f=i.getViewportDelta(),v=n.getZoomMultiplier(),g=(u.x-c.left-f.x-l.x)*v,y=(u.y-c.top-f.y-l.y)*v,_=u.width*v,b=u.height*v;return{x:g,y,width:_,height:b}},r.prototype.updateHead=function(){var t=this.model,e=this.getHead(),n=[],i=[],l=t.head,u=t.previous("head"),c=function(v){return v===void 0&&(v={}),Object.keys(v).sort().map(function(g){return"[".concat(g,'="').concat(v[g],'"]')}).join("")},f=function(v,g,y){v.forEach(function(_){var b=_.tag,S=_.attributes,E=g.some(function(N){return N.tag===b&&c(N.attributes)===c(S)});!E&&y.push(_)})};f(l,u,i),f(u,l,n),n.forEach(function(v){var g,y=e.querySelector("".concat(v.tag).concat(c(v.attributes)));(g=y?.parentNode)===null||g===void 0||g.removeChild(y)}),(0,$t.af)(e,i)},r.prototype.getEl=function(){return this.el},r.prototype.getCanvasModel=function(){var t;return(t=this===null||this===void 0?void 0:this.em.Canvas)===null||t===void 0?void 0:t.getModel()},r.prototype.getWindow=function(){return this.getEl().contentWindow},r.prototype.getDoc=function(){return this.getEl().contentDocument},r.prototype.getHead=function(){return this.getDoc().querySelector("head")},r.prototype.getBody=function(){return this.getDoc().querySelector("body")},r.prototype.getWrapper=function(){return this.getBody().querySelector("[data-gjs-type=wrapper]")},r.prototype.getJsContainer=function(){return this.jsContainer||(this.jsContainer=(0,$t.a_)("div",{class:"".concat(this.ppfx,"js-cont")})),this.jsContainer},r.prototype.getToolsEl=function(){var t;return(t=this.frameWrapView)===null||t===void 0?void 0:t.elTools},r.prototype.getGlobalToolsEl=function(){return this.em.Canvas.getGlobalToolsEl()},r.prototype.getHighlighter=function(){return this._getTool("[data-hl]")},r.prototype.getBadgeEl=function(){return this._getTool("[data-badge]")},r.prototype.getOffsetViewerEl=function(){return this._getTool("[data-offset]")},r.prototype.getRect=function(){return this.rect||(this.rect=this.el.getBoundingClientRect()),this.rect},r.prototype.getOffsetRect=function(){var t=this.el,e=this.getBody(),n=e.scrollTop,i=e.scrollLeft,l=t.offsetHeight,u=t.offsetWidth;return{top:t.offsetTop,left:t.offsetLeft,height:l,width:u,scrollTop:n,scrollLeft:i,scrollBottom:n+l,scrollRight:i+u}},r.prototype._getTool=function(t){var e=this.tools,n=this.getToolsEl();return e[t]||(e[t]=n.querySelector(t)),e[t]},r.prototype.remove=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._toggleEffects(!1),this.tools={},(t=this.wrapper)===null||t===void 0||t.remove(),Dr.prototype.remove.apply(this,e),this},r.prototype.startAutoscroll=function(){var t=this;this.lastMaxHeight=this.getWrapper().offsetHeight-this.el.offsetHeight,setTimeout(function(){t._toggleAutoscrollFx(!0),requestAnimationFrame(t.autoscroll)},0)},r.prototype.autoscroll=function(){if(this.dragging){var t=this.lastClientY,e=this.em.Canvas,n=this.getWindow(),i=n.pageYOffset,l=t||0,u=e.getConfig().autoscrollLimit,c=this.getRect().height-u,f=i;if(l<u&&(f-=u-l),l>c&&(f+=l-c),!(0,k.isUndefined)(t)&&f!==i&&f>0&&f<this.lastMaxHeight){var v=this.getGlobalToolsEl();v.style.opacity="0",this.showGlobalTools(),n.scrollTo(0,f),e.spots.refreshDbn()}requestAnimationFrame(this.autoscroll)}},r.prototype.updateClientY=function(t){t.preventDefault(),this.lastClientY=(0,$t.G2)(t).clientY*this.em.getZoomDecimal()},r.prototype.showGlobalTools=function(){this.getGlobalToolsEl().style.opacity=""},r.prototype.stopAutoscroll=function(){this.dragging&&this._toggleAutoscrollFx(!1)},r.prototype._toggleAutoscrollFx=function(t){this.dragging=t;var e=this.getWindow(),n=t?"on":"off",i={on:$t.on,off:$t.AU};i[n](e,"mousemove dragover",this.updateClientY),i[n](e,"mouseup",this.stopAutoscroll)},r.prototype.render=function(){var t=this,e=t.$el,n=t.ppfx,i=t.em;return e.attr({class:"".concat(n,"frame")}),this.renderScripts(),i.trigger("frame:render",this),this},r.prototype.renderScripts=function(){var t=this,e=this,n=e.el,i=e.model,l=e.em,u="frame:load",c={el:n,model:i,view:this},f=this.getCanvasModel(),v=function(g){var y;if(g.length>0){var _=g.shift(),b=(0,$t.a_)("script",kr({type:"text/javascript"},(0,k.isString)(_)?{src:_}:_));(y=n.contentDocument)===null||y===void 0||y.head.appendChild(b),b.hasAttribute("nomodule")&&"noModule"in HTMLScriptElement.prototype?v(g):b.onerror=b.onload=v.bind(null,g)}else l?.trigger(Vs.frameLoadHead,c),t.renderBody(),l?.trigger(Vs.frameLoadBody,c),l?.trigger(u,c)};n.onload=function(){var g=t.config.frameContent;if(g){var y=t.getDoc();y.open(),y.write(g),y.close()}c.window=t.getWindow(),l?.trigger("".concat(u,":before"),c),l?.trigger(Vs.frameLoad,c),t.renderHead(),v(im([],f.get("scripts"),!0))}},r.prototype.renderStyles=function(t){t===void 0&&(t={});var e=this.getHead(),n=this.getCanvasModel(),i=function(g){return g===void 0&&(g=[]),g.map(function(y){return{tag:"link",attributes:kr({rel:"stylesheet"},(0,k.isString)(y)?{href:y}:y)}})},l=i(t.prev||n.previous("styles")),u=i(n?.get("styles")),c=[],f=[],v=function(g,y,_){g.forEach(function(b){var S=b.attributes.href,E=y.some(function(N){return N.attributes.href===S});!E&&_.push(b)})};
69v(u,l,f),v(l,u,c),c.forEach(function(g){var y,_=e.querySelector('link[href="'.concat(g.attributes.href,'"]'));(y=_?.parentNode)===null||y===void 0||y.removeChild(_)}),(0,$t.af)(e,f)},r.prototype.renderHead=function(){var t,e=this,n=e.model,i=e.em,l=n.root,u=(t=i?.Components)===null||t===void 0?void 0:t.getType(Wo).view;u&&(this.headView=new u({el:this.getHead(),model:l.head,config:kr(kr({},l.config),{frameView:this})}).render())},r.prototype.renderBody=function(){var t=this,e,n,i,l=this,u=l.config,c=l.em,f=l.model,v=l.ppfx,g=this.getDoc(),y=this.getBody(),_=this.getWindow(),b=f.hasAutoHeight(),S=c.config;_._isEditor=!0,this.renderStyles({prev:[]});var E="#ffca6f";(0,$t.BC)(y,`<style> 70 `.concat(S.baseCss||u.frameStyle||"",` 71 72 `).concat(b?"body { overflow: hidden }":"",` 73 74 [data-gjs-type="wrapper"] { 75 `).concat(b?"":"min-height: 100vh;",` 76 padding-top: 0.001em; 77 } 78 79 .`).concat(v,`dashed *[data-gjs-highlightable] { 80 outline: 1px dashed rgba(170,170,170,0.7); 81 outline-offset: -2px; 82 } 83 84 .`).concat(v,`selected { 85 outline: 2px solid #3b97e3 !important; 86 outline-offset: -2px; 87 } 88 89 .`).concat(v,`selected-parent { 90 outline: 2px solid `).concat(E,` !important 91 } 92 93 .`).concat(v,`no-select { 94 user-select: none; 95 -webkit-user-select:none; 96 -moz-user-select: none; 97 } 98 99 .`).concat(v,`freezed { 100 opacity: 0.5; 101 pointer-events: none; 102 } 103 104 .`).concat(v,`no-pointer { 105 pointer-events: none; 106 } 107 108 .`).concat(v,`pointer-init { 109 pointer-events: initial; 110 } 111 112 .`).concat(v,`plh-image { 113 background: #f5f5f5; 114 border: none; 115 height: 100px; 116 width: 100px; 117 display: block; 118 outline: 3px solid #ffca6f; 119 cursor: pointer; 120 outline-offset: -2px 121 } 122 123 .`).concat(v,`grabbing { 124 cursor: grabbing; 125 cursor: -webkit-grabbing; 126 } 127 128 .`).concat(v,`is__grabbing { 129 overflow-x: hidden; 130 } 131 132 .`).concat(v,`is__grabbing, 133 .`).concat(v,`is__grabbing * { 134 cursor: grabbing !important; 135 } 136 137 `).concat(S.canvasCss||"",` 138 `).concat(S.protectedCss||"",` 139 </style>`));var N=f.root,z=(((e=c?.Components)===null||e===void 0?void 0:e.getType("wrapper"))||{}).view;z&&(this.wrapper=new z({model:N,config:kr(kr({},N.config),{em:c,frameView:this})}).render(),(0,$t.BC)(y,(n=this.wrapper)===null||n===void 0?void 0:n.el),(0,$t.BC)(y,new Bp({collection:f.getStyles(),config:kr(kr({},c.Css.getConfig()),{frameView:this})}).render().el),(0,$t.BC)(y,this.getJsContainer()),(0,$t.on)(y,"click",function(R){var W;return R&&((W=R.target)===null||W===void 0?void 0:W.tagName)=="A"&&R.preventDefault()}),(0,$t.on)(y,"submit",function(R){return R&&R.preventDefault()}),[{event:"keydown keyup keypress",class:"KeyboardEvent"},{event:"mousedown mousemove mouseup",class:"MouseEvent"},{event:"pointerdown pointermove pointerup",class:"PointerEvent"},{event:"wheel",class:"WheelEvent",opts:{passive:!u.infiniteCanvas}}].forEach(function(R){return R.event.split(" ").forEach(function(W){g.addEventListener(W,function(ct){return t.el.dispatchEvent((0,$t.yL)(ct,R.class))},R.opts)})}),this._toggleEffects(!0),(0,At.hasDnd)(c)&&(this.droppable=new nm(c,(i=this.wrapper)===null||i===void 0?void 0:i.el)),this.loaded=!0,f.trigger("loaded"))},r.prototype._toggleEffects=function(t){var e=t?$t.on:$t.AU,n=this.getWindow();n&&e(n,"".concat($t.D8," resize"),this._emitUpdate)},r.prototype._emitUpdate=function(){this.model._emitUpdated()},r})(Dr),am=om,eh=De(14),sm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ro=function(){return Ro=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];
139for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Ro.apply(this,arguments)},lm=(function(a){sm(r,a);function r(t,e){var n=a.call(this,{model:t})||this;(0,k.bindAll)(n,"onScroll","frameLoaded","updateOffset","remove","startDrag");var i=Ro(Ro({},t.config),{frameWrapView:n});return n.cv=e,n.frame=new am(t,n),n.classAnim="".concat(n.ppfx,"frame-wrapper--anim"),n.updateOffset=(0,k.debounce)(n.updateOffset.bind(n),0),n.updateSize=(0,k.debounce)(n.updateSize.bind(n),0),n.listenTo(t,"loaded",n.frameLoaded),n.listenTo(t,"change:x change:y",n.updatePos),n.listenTo(t,"change:width change:height",n.updateSize),n.listenTo(t,"destroy remove",n.remove),n.updatePos(),n.setupDragger(),n}return r.prototype.events=function(){return{"click [data-action-remove]":"remove","mousedown [data-action-move]":"startDrag"}},r.prototype.setupDragger=function(){var t=this,e=this,n=e.module,i=e.model,l,u,c,f=function(v){n.toggleFramesEvents(v)};this.dragger=new eh.A({onStart:function(){var v=i.attributes,g=v.x,y=v.y;c=t.em.getZoomMultiplier(),l=g,u=y,f(!1)},onEnd:function(){return f(!0)},setPosition:function(v){i.set({x:l+v.x*c,y:u+v.y*c})}})},r.prototype.startDrag=function(t){var e;t&&((e=this.dragger)===null||e===void 0||e.start(t))},r.prototype.__clear=function(t){var e=this.frame;e&&e.remove(t),(0,$t.YZ)(this.elTools)},r.prototype.remove=function(t){var e=this;return this.__clear(t),Dr.prototype.remove.apply(this,t),["frame","dragger","cv","elTools"].forEach(function(n){return e[n]=0}),this},r.prototype.updateOffset=function(){var t,e=this,n=e.em,i=e.$el,l=e.frame;!n||n.destroyed||(n.runDefault({preserveSelected:1}),i.removeClass(this.classAnim),(t=l?.model)===null||t===void 0||t._emitUpdated())},r.prototype.updatePos=function(t){var e=this,n=e.model,i=e.el,l=n.attributes,u=l.x,c=l.y,f=i.style;this.frame.rect=void 0,f.left=isNaN(u)?u:"".concat(u,"px"),f.top=isNaN(c)?c:"".concat(c,"px"),t&&this.updateOffset()},r.prototype.updateSize=function(){this.updateDim()},r.prototype.updateDim=function(){var t=this,e=t.em,n=t.el,i=t.$el,l=t.model,u=t.classAnim,c=t.frame;if(c){c.rect=void 0,i.addClass(u);var f=this.__handleSize(),v=f.noChanges,g=f.width,y=f.height;((0,k.isNull)(g)||(0,k.isNull)(y))&&l.set(Ro(Ro({},g?{}:{width:n.offsetWidth}),y?{}:{height:n.offsetHeight}),{silent:1}),e.stopDefault({preserveSelected:1}),v?this.updateOffset():setTimeout(this.updateOffset,350)}},r.prototype.onScroll=function(){var t=this,e=t.frame,n=t.em;n.trigger("frame:scroll",{frame:e,body:e.getBody(),target:e.getWindow()})},r.prototype.frameLoaded=function(){var t=this,e=t.frame,n=t.config;e.getWindow().onscroll=this.onScroll,this.updateDim()},r.prototype.__handleSize=function(){var t,e,n="px",i=this,l=i.model,u=i.el,c=u.style,f=l.attributes,v=f.width,g=f.height,y=c.width||"",_=c.height||"",b=v||"",S=g||"",E=y==b&&_==S,N=(0,k.isNumber)(b)?"".concat(b).concat(n):b,z=(0,k.isNumber)(S)?"".concat(S).concat(n):S;if(c.width=N,l.hasAutoHeight()){var R=this.frame.el;if(R.contentDocument){var W=R.contentDocument,ct=new ResizeObserver(function(){c.height="".concat(W.body.scrollHeight,"px")});ct.observe(W.body),(t=this.sizeObserver)===null||t===void 0||t.disconnect(),this.sizeObserver=ct}}else c.height=z,(e=this.sizeObserver)===null||e===void 0||e.disconnect(),delete this.sizeObserver;return{noChanges:E,width:v,height:g,newW:b,newH:S}},r.prototype.render=function(){var t=this,e=t.frame,n=t.$el,i=t.ppfx,l=t.cv,u=t.model,c=t.el,f=u.attributes.onRender;this.__clear(),this.__handleSize(),e.render(),n.empty().attr({class:"".concat(i,"frame-wrapper")}).append(` 140 <div class="`.concat(i,`frame-wrapper__top gjs-two-color" data-frame-top> 141 <div class="`).concat(i,`frame-wrapper__name" data-action-move> 142 `).concat(u.get("name")||"",` 143 </div> 144 <div class="`).concat(i,`frame-wrapper__top-r"> 145 <div class="`).concat(i,`frame-wrapper__icon" data-action-remove style="display: none"> 146 <svg viewBox="0 0 24 24"><path d="M19 4h-3.5l-1-1h-5l-1 1H5v2h14M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12z"></path></svg> 147 </div> 148 </div> 149 </div> 150 <div class="`).concat(i,`frame-wrapper__right" data-frame-right></div> 151 <div class="`).concat(i,`frame-wrapper__left" data-frame-left></div> 152 <div class="`).concat(i,`frame-wrapper__bottom" data-frame-bottom></div> 153 `)).append(e.el);var v=(0,$t.a_)("div",{class:"".concat(i,"tools"),style:"pointer-events:none; display: none"},` 154 <div class="`.concat(i,`highlighter" data-hl></div> 155 <div class="`).concat(i,`badge" data-badge></div> 156 <div class="`).concat(i,`placeholder"> 157 <div class="`).concat(i,`placeholder-int"></div> 158 </div> 159 <div class="`).concat(i,`ghost"></div> 160 <div class="`).concat(i,`toolbar" style="pointer-events:all"></div> 161 <div class="`).concat(i,`resizer"></div> 162 <div class="`).concat(i,`offset-v" data-offset> 163 <div class="gjs-marginName" data-offset-m> 164 <div class="gjs-margin-v-el gjs-margin-v-top" data-offset-m-t></div> 165 <div class="gjs-margin-v-el gjs-margin-v-bottom" data-offset-m-b></div> 166 <div class="gjs-margin-v-el gjs-margin-v-left" data-offset-m-l></div> 167 <div class="gjs-margin-v-el gjs-margin-v-right" data-offset-m-r></div> 168 </div>
169 <div class="gjs-paddingName" data-offset-m> 170 <div class="gjs-padding-v-el gjs-padding-v-top" data-offset-p-t></div> 171 <div class="gjs-padding-v-el gjs-padding-v-bottom" data-offset-p-b></div> 172 <div class="gjs-padding-v-el gjs-padding-v-left" data-offset-p-l></div> 173 <div class="gjs-padding-v-el gjs-padding-v-right" data-offset-p-r></div> 174 </div> 175 </div> 176 <div class="`).concat(i,`offset-fixed-v"></div> 177 `));this.elTools=v;var g=l?.toolsWrapper;return g&&g.appendChild(v),f&&f({el:c,elTop:c.querySelector("[data-frame-top]"),elRight:c.querySelector("[data-frame-right]"),elBottom:c.querySelector("[data-frame-bottom]"),elLeft:c.querySelector("[data-frame-left]"),frame:u,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},r})(Dr),um=lm,cm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),fm=(function(a){cm(r,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 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,e=t.$el,n=t.ppfx;e.attr({class:"".concat(n,"frames")})},r.prototype.clearItems=function(){var t=this.viewCollection||[];t.forEach(function(e){return e.remove()}),this.viewCollection=[]},r.prototype.renderView=function(t,e){return new um(t,this.canvasView)},r})(yy),dm=fm,pm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Js=function(){return Js=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Js.apply(this,arguments)},hm=(function(a){pm(r,a);function r(t){var e=a.call(this,{model:t})||this;e.ready=!1,(0,k.bindAll)(e,"clearOff","onKeyPress","onWheel","onPointer");var n=e,i=n.em,l=n.pfx,u=n.ppfx,c=e.module.events;return e.className="".concat(l,"canvas ").concat(u,"no-touch-actions").concat(i.config.customUI?"":" ".concat(l,"canvas-bg")),e.clsUnscale="".concat(l,"unscale"),e._initFrames(),e.listenTo(i,c.refresh,e.clearOff),e.listenTo(i,"component:selected",e.checkSelected),e.listenTo(i,"".concat(c.coords," ").concat(c.zoom),e.updateFrames),e.listenTo(t,"change:frames",e._onFramesUpdate),e.toggleListeners(!0),e}return r.prototype.template=function(){var t=this.pfx;return` 178 <div class="`.concat(t,`canvas__frames" data-frames> 179 <div class="`).concat(t,`canvas__spots" data-spots></div> 180 </div> 181 <div id="`).concat(t,'tools" class="').concat(t,`canvas__tools" data-tools></div> 182 <style data-canvas-style></style> 183 `)},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,u=n.frames;l.set("readyCanvas",0),u.once("loaded:all",function(){return l.set("readyCanvas",1)}),e?.remove(),this.frames=new dm({collection:u},Js(Js({},i),{canvasView:this}))},r.prototype.checkSelected=function(t,e){var n;e===void 0&&(e={});var i=e.scroll,l=this.em.getCurrentFrame();i&&((n=t.views)===null||n===void 0||n.forEach(function(u){u.frameView===l&&u.scrollIntoView(i)}))},r.prototype.remove=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.frames)===null||t===void 0||t.remove(),this.frames=void 0,Dr.prototype.remove.apply(this,e),this.toggleListeners(!1),this},r.prototype.preventDefault=function(t){var e;t&&(t.preventDefault(),(e=t._parentEvent)===null||e===void 0||e.preventDefault())},r.prototype.toggleListeners=function(t){var e=this,n=e.el,i=e.config,l=t?$t.on:$t.AU;l(document,"keypress",this.onKeyPress),l(window,"scroll resize",this.clearOff),l(n,"wheel",this.onWheel,{passive:!i.infiniteCanvas}),l(n,"pointermove",this.onPointer)},r.prototype.screenToWorld=function(t,e){var n=this.module,i=n.getCoords(),l=n.getZoomMultiplier(),u=this.getViewportDelta();return{x:(t-i.x-u.x)*l,y:(e-i.y-u.y)*l}},r.prototype.onPointer=function(t){if(this.config.infiniteCanvas){var e=this.getCanvasOffset(),n=(0,$t.Xy)(),i={x:t.clientX-e.left+n.x,y:t.clientY-e.top+n.y};if(t._parentEvent){var l=t.target.getBoundingClientRect(),u=this.module.getZoomDecimal();i.x=l.left-e.left+n.x+t.clientX*u,i.y=l.top-e.top+n.y+t.clientY*u}this.model.set({pointerScreen:i,pointer:this.screenToWorld(i.x,i.y)})}},r.prototype.onKeyPress=function(t){var e=this.em,n=(0,$t.Ch)(t);n===" "&&e.getZoomDecimal()!==1&&!e.Canvas.isInputFocused()&&(this.preventDefault(t),e.Editor.runCommand("core:canvas-move"))},r.prototype.onWheel=function(t){var e=this,n=e.module,i=e.config;if(i.infiniteCanvas){this.preventDefault(t);var l=t.deltaX,u=t.deltaY,c=n.getZoomDecimal(),f=(0,$t.rp)(t),v=n.getCoords();if(f){var g=c-u*c*.01;
183n.setZoom(g*100);var y=this.model.getPointerCoords(Wt.x2.Screen),_=this.getCanvasOffset(),b=y.x-_.width/2,S=y.y-_.height/2,E=g/c,N=b-(b-v.x)*E,z=S-(S-v.y)*E;n.setCoords(N,z)}else this.onPointer(t),n.setCoords(v.x-l,v.y-u)}},r.prototype.updateFrames=function(t){var e=this.em,n=this.toolsWrapper,i={preserveSelected:1};this.updateFramesArea(),this.clearOff(),n.style.display="none",e.trigger("canvas:update",t),this.timerZoom&&clearTimeout(this.timerZoom),this.timerZoom=setTimeout(function(){e.stopDefault(i),e.runDefault(i),n.style.display=""},300)},r.prototype.updateFramesArea=function(){var t=this,e=t.framesArea,n=t.model,i=t.module,l=t.cvStyle,u=t.clsUnscale,c=i.getZoomMultiplier();if(e){var f=n.attributes,v=f.x,g=f.y,y=i.getZoomDecimal();e.style.transform="scale(".concat(y,") translate(").concat(v*c,"px, ").concat(g*c,"px)")}l&&(l.innerHTML=` 184 .`.concat(u," { scale: ").concat(c,` } 185 `))},r.prototype.fitViewport=function(t){var e,n;t===void 0&&(t={});var i=this,l=i.em,u=i.module,c=i.model,f=this.getCanvasOffset(),v=t.el,g=v&&((e=(0,At.getComponentView)(v))===null||e===void 0?void 0:e.frameView),y=g?g.model:t.frame||l.getCurrentFrameModel()||c.frames.at(0),_=y.attributes,b=_.x,S=_.y,E={x:b??0,y:S??0,width:y.width,height:y.height};if(v){var N=this.getElBoxRect(v);E.x=E.x+N.x,E.y=E.y+N.y,E.width=N.width,E.height=N.height}var z=t.ignoreHeight,R=(n=t.gap)!==null&&n!==void 0?n:0,W=(0,k.isNumber)(R),ct=W?R:R.x,_t=W?R:R.y,xt=E.width+ct*2,ut=E.height+_t*2,q=f.width,lt=f.height,H=q/xt,I=lt/ut,B=z?H:Math.min(H,I),U=B*100;u.setZoom(U);var et=-E.x+(y.width>=q?q/2-xt/2:-ct),A=-E.y+lt/2-ut/2,gt={x:(et+ct)*B,y:(A+_t)*B};if(z){var yt=u.getZoomMultiplier(),jt=lt*yt,te=jt-lt,Xt=te/2;gt.y=(-E.y+_t)*B-Xt/yt}u.setCoords(gt.x,gt.y)},r.prototype.isElInViewport=function(t){var e=(0,At.getElement)(t),n=(0,$t.C8)(e),i=this.getFrameOffset(e),l=n.top,u=n.left;return l>=0&&u>=0&&l<=i.height&&u<=i.width},r.prototype.offset=function(t,e){e===void 0&&(e={});var n=e.noScroll,i=(0,$t.C8)(t),l=n?{x:0,y:0}:(0,$t.Xy)(t);return{top:i.top+l.y,left:i.left+l.x,width:i.width,height:i.height}},r.prototype.getRectToScreen=function(t){var e,n,i,l,u=this.module.getZoomDecimal(),c=this.module.getCoords(),f=this.getViewportDelta(),v=((e=t.x)!==null&&e!==void 0?e:0)*u+c.x+f.x||0,g=((n=t.y)!==null&&n!==void 0?n:0)*u+c.y+f.y||0;return{x:v,y:g,width:((i=t.width)!==null&&i!==void 0?i:0)*u,height:((l=t.height)!==null&&l!==void 0?l:0)*u}},r.prototype.getElBoxRect=function(t,e){var n,i,l;e===void 0&&(e={});var u=this.module,c=(0,$t.C8)(t),f=c.width,v=c.height,g=c.left,y=c.top,_=(n=(0,At.getComponentView)(t))===null||n===void 0?void 0:n.frameView,b=_?.getBoxRect(),S=u.getZoomMultiplier(),E=(i=b?.x)!==null&&i!==void 0?i:0,N=(l=b?.y)!==null&&l!==void 0?l:0,z=this.el,R=(0,$t.Xy)(),W=g+E+(z.scrollLeft+R.x)*S,ct=y+N+(z.scrollTop+R.y)*S,_t={x:W,y:ct,width:f,height:v};return e.local&&(_t.x=g,_t.y=y),e.toScreen?this.getRectToScreen(_t):_t},r.prototype.getViewportRect=function(t){t===void 0&&(t={});var e=this.getCanvasOffset(),n=e.top,i=e.left,l=e.width,u=e.height,c=this.module;if(t.toWorld){var f=c.getZoomMultiplier(),v=c.getCoords(),g=this.getViewportDelta(),y=-v.x-g.x||0,_=-v.y-g.y||0;return{x:y*f,y:_*f,width:l*f,height:u*f}}else return{x:i,y:n,width:l,height:u}},r.prototype.getViewportDelta=function(t){t===void 0&&(t={});var e=this.module.getZoomMultiplier(),n=this.getCanvasOffset(),i=n.width,l=n.height,u=i*e,c=l*e,f=u-i,v=c-l;return{x:f/2/e,y:v/2/e}},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?.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.module.getZoomDecimal(),i=this.getFrameOffset(t),l=this.el,u=this.getCanvasOffset(),c=this.offset(t,e),f=e.avoidFrameOffset?0:i.top,v=e.avoidFrameOffset?0:i.left,g=e.avoidFrameZoom?c.top:c.top*n,y=e.avoidFrameZoom?c.left:c.left*n,_=e.avoidFrameOffset?g:g+f-u.top+l.scrollTop,b=e.avoidFrameOffset?y:y+v-u.left+l.scrollLeft,S=e.avoidFrameZoom?c.height:c.height*n,E=e.avoidFrameZoom?c.width:c.width*n;return{top:_,left:b,height:S,width:E,zoom:n,rect:c}},r.prototype.getElementOffsets=function(t){if(!t||(0,$t.ir)(t))return{};var e={},n=window.getComputedStyle(t),i=this.module.getZoomDecimal(),l=["marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"];return l.forEach(function(u){e[u]=parseFloat(n[u])*i}),e},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.module.getZoomDecimal(),u=this.getFrameOffset(),c=this.getCanvasOffset(),f=t.noScroll;
185return{top:u.top+(f?0:i.scrollTop)*l-c.top,left:u.left+(f?0:i.scrollLeft)*l-c.left,width:c.width,height:c.height}},r.prototype.updateScript=function(t){var e=t.model,n=e.getId();if(!t.scriptContainer){t.scriptContainer=(0,$t.a_)("div",{"data-id":n});var i=this.getJsContainer();i?.appendChild(t.scriptContainer)}t.el.id=n,t.scriptContainer.innerHTML="";var l=document.createElement("script"),u=e.getScriptString(),c=e.get("script-props")?u:`function(){ 186`.concat(u,` 187;}`),f=JSON.stringify(e.__getScriptProps());l.innerHTML=` 188 setTimeout(function() { 189 var item = document.getElementById('`.concat(n,`'); 190 if (!item) return; 191 (`).concat(c,".bind(item))(").concat(f,`) 192 }, 1);`),setTimeout(function(){var v=t.scriptContainer;v?.appendChild(l)},0)},r.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return e?.getJsContainer()},r.prototype.getFrameView=function(t){return t?.frameView||this.em.getCurrentFrame()},r.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,i=t.em,l=t.framesArea,u=e.frames;u.listenToLoad(),n.render();var c=u.at(0),f=c?.view;i.setCurrentFrame(f),l?.appendChild(n.el),this.frame=f,this.updateFramesArea()}},r.prototype.renderFrames=function(){this._renderFrames()},r.prototype.render=function(){var t=this,e=t.el,n=t.$el,i=t.ppfx,l=t.config,u=t.em;n.html(this.template());var c=n.find("[data-frames]");this.framesArea=c.get(0);var f=n.find("[data-tools]");return this.toolsWrapper=f.get(0),f.append(` 193 <div class="`.concat(i,"tools ").concat(i,`tools-gl" style="pointer-events:none"> 194 <div class="`).concat(i,`placeholder"> 195 <div class="`).concat(i,`placeholder-int"></div> 196 </div> 197 </div> 198 <div id="`).concat(i,`tools" style="pointer-events:none"> 199 `).concat(l.extHl?'<div class="'.concat(i,'highlighter-sel"></div>'):"",` 200 <div class="`).concat(i,`badge"></div> 201 <div class="`).concat(i,`ghost"></div> 202 <div class="`).concat(i,`toolbar" style="pointer-events:all"></div> 203 <div class="`).concat(i,`resizer"></div> 204 <div class="`).concat(i,`offset-v"></div> 205 <div class="`).concat(i,`offset-fixed-v"></div> 206 </div> 207 `)),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.spotsEl=e.querySelector("[data-spots]"),this.cvStyle=e.querySelector("[data-canvas-style]"),this.el.className=(0,At.getUiClass)(u,this.className),this.ready=!0,this._renderFrames(),this},r})(Dr),vm=hm,gm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),to=function(){return to=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},to.apply(this,arguments)},ym=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},mm=(function(a){gm(r,a);function r(t){var e=a.call(this,t,"Canvas",Vg)||this;return e.events=xc,e.framesById={},e.canvas=new uy(e),e.spots=new dy(e),e.model=e.canvas,e.startAutoscroll=e.startAutoscroll.bind(e),e.stopAutoscroll=e.stopAutoscroll.bind(e),e}return r.prototype.getCanvasView=function(){return this.canvasView},r.prototype.postLoad=function(){this.model.init()},r.prototype.getModel=function(){return this.canvas},r.prototype.getElement=function(){return this.getCanvasView().el},r.prototype.getFrame=function(t){return this.getFrames()[t||0]},r.prototype.getFrameEl=function(){var t=(this.canvasView||{}).frame;return t?.el},r.prototype.getFramesEl=function(){var t;return(t=this.canvasView)===null||t===void 0?void 0:t.framesArea},r.prototype.getWindow=function(){var t=(this.canvasView||{}).frame;return t?.getWindow()},r.prototype.getDocument=function(){var t=this.getFrameEl();return t?.contentDocument},r.prototype.getBody=function(){var t=this.getDocument();return t?.body},r.prototype._getLocalEl=function(t,e,n){var i=t,l=e?.frameView;return i=l?l[n]():i,i},r.prototype.getGlobalToolsEl=function(){var t;return(t=this.canvasView)===null||t===void 0?void 0:t.toolsGlobEl},r.prototype.getToolsEl=function(t){return this._getLocalEl(this.getCanvasView().toolsEl,t,"getToolsEl")},r.prototype.getHighlighter=function(t){return this._getLocalEl(this.getCanvasView().hlEl,t,"getHighlighter")},r.prototype.getBadgeEl=function(t){return this._getLocalEl(this.getCanvasView().badgeEl,t,"getBadgeEl")},r.prototype.getPlacerEl=function(){return this.getCanvasView().placerEl},r.prototype.getGhostEl=function(){return this.getCanvasView().ghostEl},r.prototype.getToolbarEl=function(){return this.getCanvasView().toolbarEl},r.prototype.getResizerEl=function(){return this.getCanvasView().resizerEl},r.prototype.getOffsetViewerEl=function(t){return this._getLocalEl(this.getCanvasView().offsetEl,t,"getOffsetViewerEl")},r.prototype.getFixedOffsetViewerEl=function(){return this.getCanvasView().fixedOffsetEl},r.prototype.getSpotsEl=function(){var t;return(t=this.canvasView)===null||t===void 0?void 0:t.spotsEl},r.prototype.render=function(){var t;return(t=this.canvasView)===null||t===void 0||t.remove(),this.canvasView=new vm(this.canvas),this.canvasView.render().el},r.prototype.getOffset=function(){var t=this.offset(this.getFrameEl()),e=this.offset(this.getElement());
207return{top:t.top-e.top,left:t.left-e.left}},r.prototype.offset=function(t){return this.getCanvasView().offset(t)},r.prototype.setCustomBadgeLabel=function(t){this.config.customBadgeLabel=t},r.prototype.getElementPos=function(t,e){return this.getCanvasView().getElementPos(t,e)},r.prototype.getElementOffsets=function(t){return this.getCanvasView().getElementOffsets(t)},r.prototype.getRect=function(){var t,e=(t=this.getCanvasView().getPosition())!==null&&t!==void 0?t:{},n=e.top,i=n===void 0?0:n,l=e.left,u=l===void 0?0:l;return to(to({},this.getCanvasView().getCanvasOffset()),{topScroll:i,leftScroll:u})},r.prototype.getTargetToElementDim=function(t,e,n){n===void 0&&(n={});var i=n||{},l=this.getCanvasView().getPosition();if(l){var u=i.elPos||this.getCanvasView().getElementPos(e),c=n.toRight||0,f=i.targetHeight||t.offsetHeight,v=i.targetWidth||t.offsetWidth,g=i.event||null,y=u.top-f,_=u.left;_+=c?u.width:0,_=c?_-v:_;var b=_<l.left?l.left:_,S=y<l.top?l.top:y;S=S>u.top+u.height?u.top+u.height:S;var E={top:S,left:b,elementTop:u.top,elementLeft:u.left,elementWidth:u.width,elementHeight:u.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:l.top,canvasLeft:l.left,canvasWidth:l.width,canvasHeight:l.height};return g&&this.em&&this.em.trigger(g,E),E}},r.prototype.canvasRectOffset=function(t,e,n){var i=this;n===void 0&&(n={});var l=function(c){var f=c.defaultView;return f?.frameElement},u=function(c,f,v){f===void 0&&(f=1);var g=i.em.getZoomDecimal(),y=f?"top":"left",_=c.ownerDocument,b=n.offset?l(_):{},S=b.offsetTop,E=S===void 0?0:S,N=b.offsetLeft,z=N===void 0?0:N,R=_.body||{},W=R.scrollTop,ct=W===void 0?0:W,_t=R.scrollLeft,xt=_t===void 0?0:_t,ut=f?ct:xt,q=f?E:z;return v[y]-(ut-q)*g};return{top:u(t,1,e),left:u(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),u=e.offsetHeight||0,c=e.offsetWidth||0,f=i.left+i.width,v=this.getCanvasView(),g=v.getPosition(),y=v.getFrameOffset(t),_=n.event,b=-u,S=(0,k.isUndefined)(n.left)?i.width-c:n.left;if(S=i.left<-S?-i.left:S,S=f>g.width?S-(f-g.width):S,l.top<u){var E=i.height+u,N=E<y.height;N?b=b+E:b=-l.top<i.height?-l.top:i.height}var z={top:b,left:S,canvasOffsetTop:l.top,canvasOffsetLeft:l.left,elRect:i,canvasOffset:l,canvasRect:g,targetWidth:c,targetHeight:u};return _&&this.em.trigger(_,z),z},r.prototype.getMouseRelativePos=function(t,e){e===void 0&&(e={});var n=e.subWinOffset,i=t.target.ownerDocument,l=i.defaultView||i.parentWindow,u=l.frameElement,c=n?l.pageYOffset:0,f=n?l.pageXOffset:0,v=this.getZoomMultiplier(),g=0,y=0;if(u){var _=u.getBoundingClientRect();g=_.top||0,y=_.left||0}return{y:(t.clientY+g-c)*v,x:(t.clientX+y-f)*v}},r.prototype.getMouseRelativeCanvas=function(t,e){var n,i=this.getZoomDecimal(),l=(n=this.getCanvasView().getPosition(e))!==null&&n!==void 0?n:{},u=l.top,c=u===void 0?0:u,f=l.left,v=f===void 0?0:f;return{y:t.clientY*i+c,x:t.clientX*i+v}},r.prototype.hasFocus=function(){return this.getDocument().hasFocus()},r.prototype.isInputFocused=function(){var t=this.getDocument(),e=this.getFrameEl(),n=ym(["body"],this.config.notTextable,!0),i=e&&document.activeElement===e,l=i?t&&t.activeElement:document.activeElement;return l&&!n.some(function(u){return l.matches(u)})},r.prototype.scrollTo=function(t,e){e===void 0&&(e={});var n=(0,At.getElement)(t),i=n&&(0,At.getViewEl)(n);i&&i.scrollIntoView(e)},r.prototype.startAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.startAutoscroll()},r.prototype.stopAutoscroll=function(t){var e=t&&t.view||this.em.getCurrentFrame();e&&e.stopAutoscroll()},r.prototype.setZoom=function(t){return this.canvas.set("zoom",typeof t=="string"?parseFloat(t):t),this},r.prototype.getZoom=function(){return parseFloat(this.canvas.get("zoom"))},r.prototype.setCoords=function(t,e,n){var i;n===void 0&&(n={});var l=t||t===0,u=e||e===0,c={x:this.canvas.get("x"),y:this.canvas.get("y")};if(l&&(c.x=parseFloat("".concat(t))),u&&(c.y=parseFloat("".concat(e))),n.toWorld){var f=(i=this.canvasView)===null||i===void 0?void 0:i.getViewportDelta();f&&(l&&(c.x=c.x-f.x),u&&(c.y=c.y-f.y))}return this.canvas.set(c),this},r.prototype.getCoords=function(){var t=this.canvas.attributes,e=t.x,n=t.y;return{x:e,y:n}},r.prototype.getPointer=function(t){var e=this.canvas.attributes,n=e.pointer,i=e.pointerScreen;return t?i:n},r.prototype.getZoomDecimal=function(){return this.getZoom()/100},r.prototype.getZoomMultiplier=function(){var t=this.getZoomDecimal();return t?1/t:1},r.prototype.fitViewport=function(t){var e;(e=this.canvasView)===null||e===void 0||e.fitViewport(t)},r.prototype.toggleFramesEvents=function(t){var e=this.getFramesEl().style;e.pointerEvents=t?"":"none"},r.prototype.getFrames=function(){return this.canvas.frames.map(function(t){return t})},r.prototype.addFrame=function(t,e){return t===void 0&&(t={}),e===void 0&&(e={}),this.canvas.frames.add(new Vp(this,to({},t)),e)},r.prototype.getLastDragResult=function(){return this.em.get("dragResult")},r.prototype.addSpot=function(t,e){var n;e===void 0&&(e={});var i=t,l=this.getSpots(i);if(l.length){var u=l[0];return u.set(i),u}var c=i.componentView||((n=i.component)===null||n===void 0?void 0:n.view),f=new Lr.A(this,to(to({},i),{id:i.id||"cs_".concat(i.type,"_").concat(c?.cid),type:i.type||""}));return this.spots.add(f,e),f},r.prototype.getSpots=function(t){return t===void 0&&(t={}),this.spots.where(t.id?{id:t.id}:t)},r.prototype.removeSpots=function(t){t===void 0&&(t={});var e=(0,k.isArray)(t)?t:this.getSpots(t),n=this.spots.remove(e);return n}
207,r.prototype.hasCustomSpot=function(t){var e=this.config.customSpots;return!!(e===!0||e&&t&&e[t])},r.prototype.getWorldRectToScreen=function(t){var e;return(e=this.canvasView)===null||e===void 0?void 0:e.getRectToScreen(t)},r.prototype.refresh=function(t){t===void 0&&(t={});var e=this,n=e.em,i=e.events,l=e.canvasView;l?.clearOff(),(t.spots||t.all)&&(this.refreshSpots(),n.trigger("canvas:updateTools")),n.set("canvasOffset",this.getOffset()),n.trigger(i.refresh,t)},r.prototype.refreshSpots=function(){this.spots.refresh()},r.prototype.destroy=function(){var t=this,e;this.canvas.stopListening(),(e=this.canvasView)===null||e===void 0||e.remove(),["model","droppable"].forEach(function(n){return t[n]={}})},r})(pr),_m=mm,Cd={stylePrefix:"comp-",components:[],draggableComponents:!0,disableTextInnerChilds:!1,processor:void 0,useFrameDoc:!1,voidElements:["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]},wm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Zs=function(){return Zs=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Zs.apply(this,arguments)},bm=(function(a){wm(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return Zs(Zs({},a.prototype.defaults),{tagName:"",droppable:!1,layerable:!1,selectable:!1,editable:!0})},enumerable:!1,configurable:!0}),r.prototype.toHTML=function(){var t=this.content,e=this.parent();return e?.is("script")?t:this.__escapeContent(t)},r.prototype.__escapeContent=function(t){return(0,At.escapeNodeContent)(t)},r.isComponent=function(t){var e;if(t.nodeType===3)return{type:"textnode",content:(e=t.textContent)!==null&&e!==void 0?e:""}},r})(Hn),nh=bm,xm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),sc=function(){return sc=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},sc.apply(this,arguments)},Cm=(function(a){xm(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return sc({},a.prototype.defaults)},enumerable:!1,configurable:!0}),r.prototype.toHTML=function(){return"<!--".concat(this.content,"-->")},r.isComponent=function(t){var e;if(t.nodeType==8)return{type:"comment",content:(e=t.textContent)!==null&&e!==void 0?e:""}},r})(nh),Sm=Cm,Om=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Qs=function(){return Qs=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Qs.apply(this,arguments)},Ou="iframe",Tm=(function(a){Om(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return Qs(Qs({},a.prototype.defaults),{type:Ou,tagName:Ou,droppable:!1,resizable:!0,traits:["id","title","src"],attributes:{frameborder:"0"}})}
207,enumerable:!1,configurable:!0}),r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===Ou},r})(Hn),Em=Tm,Pm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),tl=function(){return tl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},tl.apply(this,arguments)},Sd='xmlns="http://www.w3.org/2000/svg" width="100" viewBox="0 0 24 24" style="fill: rgba(0,0,0,0.15); transform: scale(0.75)"',Am=(function(a){Pm(r,a);function r(t,e){t===void 0&&(t={});var n=a.call(this,t,e)||this,i=n.get("attributes").src;return i&&(0,At.buildBase64UrlFromSvg)((0,k.result)(n,"defaults").src)!==i&&n.set("src",i,{silent:!0}),n}return Object.defineProperty(r.prototype,"defaults",{get:function(){return tl(tl({},a.prototype.defaults),{type:"image",tagName:"img",void:!0,droppable:0,editable:1,highlightable:0,resizable:{ratioDefault:1},traits:["alt"],src:"<svg ".concat(Sd,`> 208 <path d="M8.5 13.5l2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2z"></path> 209 </svg>`),fallback:"<svg ".concat(Sd,`> 210 <path d="M2.28 3L1 4.27l2 2V19c0 1.1.9 2 2 2h12.73l2 2L21 21.72 2.28 3m2.55 0L21 19.17V5a2 2 0 0 0-2-2H4.83M8.5 13.5l2.5 3 1-1.25L14.73 18H5l3.5-4.5z"></path> 211 </svg>`),file:""})},enumerable:!1,configurable:!0}),r.prototype.initToolbar=function(){a.prototype.initToolbar.call(this);var t=this.em;if(t){var e=t.Commands,n="image-editor";if(e.has(n)){for(var i=!1,l=this.get("toolbar"),u=0;u<l.length;u++)if(l[u].command==="image-editor"){i=!0;break}i||(l.push({attributes:{class:"fa fa-pencil"},command:n}),this.set("toolbar",l))}}},r.prototype.getAttrToHTML=function(){var t=a.prototype.getAttrToHTML.call(this),e=this.getSrcResult();return e&&(t.src=e),t},r.prototype.getSrcResult=function(t){t===void 0&&(t={});var e=this.get(t.fallback?"fallback":"src")||"",n=e;return e&&e.substr(0,4)==="<svg"&&(n=(0,At.buildBase64UrlFromSvg)(e)),n},r.prototype.isDefaultSrc=function(){var t=this.get("src"),e=(0,k.result)(this,"defaults").src;return t===e||t===(0,At.buildBase64UrlFromSvg)(e)},r.prototype.toJSON=function(t){var e=a.prototype.toJSON.call(this,t),n=e.attributes;return n&&e.src===n.src&&delete e.src,e},r.prototype.parseUri=function(t){var e={},n=function(i){i===void 0&&(i="");for(var l={},u=i.substring(1).split("&"),c=0;c<u.length;c++){var f=u[c].split("="),v=decodeURIComponent(f[0]);v&&(l[v]=decodeURIComponent(f[1]||""))}return l};if((0,At.hasWin)())e=document.createElement("a"),e.href=t;else if(typeof URL<"u")try{e=new URL(t)}catch(i){}return{hostname:e.hostname||"",pathname:e.pathname||"",protocol:e.protocol||"",search:e.search||"",hash:e.hash||"",port:e.port||"",query:n(e.search)}},r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)==="img"},r})(Hn),Tc=Am,km=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),el=function(){return el=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},el.apply(this,arguments)},Mm=(function(a){km(r,a);function r(t,e){t===void 0&&(t={});var n=a.call(this,t,e)||this;return n.__checkInnerChilds(),n}return Object.defineProperty(r.prototype,"defaults",{get:function(){return el(el({},a.prototype.defaults),{type:"text",droppable:!1,editable:!0})}
211,enumerable:!1,configurable:!0}),r.prototype.__checkInnerChilds=function(){var t=this.em.Components.config.disableTextInnerChilds;if(t){var e=function(n){n.isInstanceOf("textnode")||n.set({locked:!0,layerable:!1})};(0,k.isFunction)(t)?this.forEachChild(function(n){t(n)&&e(n)}):this.forEachChild(e)}},r})(Hn),Ec=Mm,Lm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),nl=function(){return nl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},nl.apply(this,arguments)},Tu="label",Dm=(function(a){Lm(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return nl(nl({},a.prototype.defaults),{type:Tu,tagName:Tu,traits:["id","title","for"]})},enumerable:!1,configurable:!0}),r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===Tu},r})(Ec),jm=Dm,Im=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),rl=function(){return rl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},rl.apply(this,arguments)},Od="link",Rm=(function(a){Im(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return rl(rl({},a.prototype.defaults),{type:Od,tagName:"a",traits:["title","href","target"]})},enumerable:!1,configurable:!0}),r.isComponent=function(t,e){e===void 0&&(e={});var n;if((0,At.toLowerCase)(t.tagName)==="a"){var i=e.textTags||[];n={type:Od,editable:!1};var l=t.childNodes,u=l.length;u||delete n.editable,(0,k.forEach)(l,function(c){var f=c.tagName;(c.nodeType==3&&c.textContent.trim()!==""||f&&i.indexOf((0,At.toLowerCase)(f))>=0)&&delete n.editable})}return n},r})(Ec),Nm=Rm,Fm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),il=function(){return il=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},il.apply(this,arguments)},Vm=(function(a){Fm(r,a);function r(t,e){t===void 0&&(t={});var n=a.call(this,t,e)||this;return n.get("src")?n.parseFromSrc():n.updateSrc(),n.listenTo(n,"change:address change:zoom change:mapType",n.updateSrc),n}return Object.defineProperty(r.prototype,"defaults",{get:function(){var t=a.prototype.defaults;return il(il({},t),{type:"map",src:"",void:!1,mapUrl:"https://maps.google.com/maps",tagName:"iframe",mapType:"q",address:"",zoom:"1",attributes:{frameborder:0},toolbar:t.toolbar,traits:[{label:"Address",name:"address",placeholder:"eg. London, UK",changeProp:!0},{type:"select",label:"Map type",name:"mapType",changeProp:!0,options:[{id:"q",label:"Roadmap"},{id:"w",label:"Satellite"}]},{label:"Zoom",name:"zoom",type:"range",min:1,max:20,changeProp:!0}]})}
211,enumerable:!1,configurable:!0}),r.prototype.updateSrc=function(){this.set("src",this.getMapUrl())},r.prototype.getMapUrl=function(){var t=this.get("address"),e=this.get("zoom"),n=this.get("mapType");t=t?"&q="+t:"",e=e?"&z="+e:"",n=n?"&t="+n:"";var i=this.get("mapUrl")+"?"+t+e+n;return i+="&output=embed",i},r.prototype.parseFromSrc=function(){var t=this.parseUri(this.get("src")),e=t.query;e.q&&this.set("address",e.q),e.z&&this.set("zoom",e.z),e.t&&this.set("mapType",e.t)},r.isComponent=function(t){if((0,At.toLowerCase)(t.tagName)=="iframe"&&/maps\.google\.com/.test(t.src))return{type:"map",src:t.src}},r})(Tc),Hm=Vm,Um=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ol=function(){return ol=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},ol.apply(this,arguments)},Eu="script",Bm=(function(a){Um(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return ol(ol({},a.prototype.defaults),{type:Eu,tagName:Eu,droppable:!1,draggable:!1,layerable:!1,highlightable:!1})},enumerable:!1,configurable:!0}),r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===Eu},r})(Hn),Wm=Bm,zm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),al=function(){return al=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},al.apply(this,arguments)},Pu="svg",Km=(function(a){zm(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return al(al({},a.prototype.defaults),{type:Pu,tagName:Pu,highlightable:!1,resizable:{ratioDefault:!0}})},enumerable:!1,configurable:!0}),r.prototype.getName=function(){var t=this.get("tagName"),e=this.get("custom-name");return t=t.charAt(0).toUpperCase()+t.slice(1),e||t},r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===Pu},r})(Hn),rh=Km,Gm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),sl=function(){return sl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},sl.apply(this,arguments)},$m=(function(a){Gm(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return sl(sl({},a.prototype.defaults),{selectable:!1,hoverable:!1,layerable:!1})},enumerable:!1,configurable:!0}),r.isComponent=function(t,e){return e===void 0&&(e={}),!!e.inSvg},r})(rh),qm=$m,Ym=(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");a(r,t);function e(){this.constructor=r}
211r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ll=function(){return ll=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},ll.apply(this,arguments)},Au="table",Xm=(function(a){Ym(r,a);function r(t,e){t===void 0&&(t={});var n=a.call(this,t,e)||this,i=n.get("components");return!i.length&&i.add({type:"tbody"}),n}return Object.defineProperty(r.prototype,"defaults",{get:function(){return ll(ll({},a.prototype.defaults),{type:Au,tagName:Au,droppable:["tbody","thead","tfoot"]})},enumerable:!1,configurable:!0}),r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===Au},r})(Hn),Jm=Xm,Zm=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ul=function(){return ul=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},ul.apply(this,arguments)},ku="tbody",Qm=(function(a){Zm(r,a);function r(t,e){t===void 0&&(t={});var n=a.call(this,t,e)||this,i=n.get("components"),l=n.get("columns"),u=n.get("rows");if(!i.length){for(var c=[];u--;){for(var f=[],v=l;v--;)f.push({type:"cell",classes:["cell"]});c.push({type:"row",classes:["row"],components:f})}i.add(c)}return n}return Object.defineProperty(r.prototype,"defaults",{get:function(){return ul(ul({},a.prototype.defaults),{type:ku,tagName:ku,draggable:["table"],droppable:["tr"],columns:1,rows:1})},enumerable:!1,configurable:!0}),r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===ku},r})(Hn),Pc=Qm,t0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),cl=function(){return cl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},cl.apply(this,arguments)},e0=(function(a){t0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return cl(cl({},a.prototype.defaults),{type:"cell",tagName:"td",draggable:["tr"]})},enumerable:!1,configurable:!0}),r.isComponent=function(t){return["td","th"].indexOf((0,At.toLowerCase)(t.tagName))>=0},r})(Hn),n0=e0,r0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),fl=function(){return fl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},fl.apply(this,arguments)},Mu="tfoot",i0=(function(a){r0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return fl(fl({},a.prototype.defaults),{type:Mu,tagName:Mu})},enumerable:!1,configurable:!0}),r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===Mu},r}
211)(Pc),o0=i0,a0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),dl=function(){return dl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},dl.apply(this,arguments)},Lu="thead",s0=(function(a){a0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return dl(dl({},a.prototype.defaults),{type:Lu,tagName:Lu})},enumerable:!1,configurable:!0}),r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===Lu},r})(Pc),l0=s0,u0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),pl=function(){return pl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},pl.apply(this,arguments)},Td="tr",c0=(function(a){u0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"defaults",{get:function(){return pl(pl({},a.prototype.defaults),{tagName:Td,draggable:["thead","tbody","tfoot"],droppable:["th","td"]})},enumerable:!1,configurable:!0}),r.isComponent=function(t){return(0,At.toLowerCase)(t.tagName)===Td},r})(Hn),f0=c0,d0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),hl=function(){return hl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},hl.apply(this,arguments)},Du="video",Mo="yt",Lo="vi",Do="ytnc",Ed="so",ju=function(a){return a&&a!=="0"},p0=(function(a){d0(r,a);function r(t,e){t===void 0&&(t={});var n=a.call(this,t,e)||this;return n.get("src")&&n.parseFromSrc(),n.updatePropsFromAttr(),n.updateTraits(),n.on("change:provider",n.updateTraits),n.on("change:videoId change:provider",n.updateSrc),n}return Object.defineProperty(r.prototype,"defaults",{get:function(){return hl(hl({},a.prototype.defaults),{type:Du,tagName:Du,videoId:"",void:!1,provider:Ed,ytUrl:"https://www.youtube.com/embed/",ytncUrl:"https://www.youtube-nocookie.com/embed/",viUrl:"https://player.vimeo.com/video/",loop:!1,poster:"",muted:0,autoplay:!1,controls:!0,color:"",list:"",src:"",rel:1,modestbranding:0,sources:[],attributes:{allowfullscreen:"allowfullscreen"}})},enumerable:!1,configurable:!0}),r.prototype.updatePropsFromAttr=function(){if(this.get("provider")===Ed){var t=this.get("attributes"),e=t.controls,n=t.autoplay,i=t.loop,l={};(0,At.isDef)(e)&&(l.controls=!!e),(0,At.isDef)(n)&&(l.autoplay=!!n),(0,At.isDef)(i)&&(l.loop=!!i),(0,At.isEmptyObj)(l)||this.set(l)}},r.prototype.updateTraits=function(){var t=this.em,e=this.get("provider"),n="iframe",i;switch(e){case Mo:case Do:i=this.getYoutubeTraits();break;case Lo:i=this.getVimeoTraits();break;default:n="video",i=this.getSourceTraits()}this.set({tagName:n},{silent:!0}),this.set({traits:i}),t.get("ready")&&t.trigger("component:toggled")},r.prototype.parseFromSrc=function(){var t=this.get("provider"),e=this.parseUri(this.get("src")),n=e.query;switch(t){case Mo:case Do:case Lo:this.set("videoId",e.pathname.split("/").pop()),n.list&&this.set("list",n.list),ju(n.autoplay)&&this.set("autoplay",!0),ju(n.loop)&&this.set("loop",!0),parseInt(n.controls)===0&&this.set("controls",!1),ju(n.color)&&this.set("color",n.color),n.rel==="0"&&this.set("rel",0),n.modestbranding==="1"&&this.set("modestbranding",1);break;default:}},r.prototype.updateSrc=function(){var t=this.get("provider"),e="";switch(t){case Mo:e=this.getYoutubeSrc();break;case Do:e=this.getYoutubeNoCookieSrc();break;case Lo:e=this.getVimeoSrc();break}this.set({src:e})},r.prototype.getAttrToHTML=function(){var t=a.prototype.getAttrToHTML.call(this),e=this.get("provider");switch(e){case Mo:case Do:case Lo:break;default:t.loop=!!this.get("loop"),t.autoplay=!!this.get("autoplay"),t.controls=!!this.get("controls")}return t},r.prototype.getProviderTrait=function(){return{type:"select",label:"Provider",name:"provider",changeProp:!0,options:[{value:"so",name:"HTML5 Source"},{value:Mo,name:"Youtube"},{value:Do,name:"Youtube (no cookie)"},{value:Lo,name:"Vimeo"}]}},r.prototype.getSourceTraits=function(){return[this.getProviderTrait(),{label:"Source",name:"src",placeholder:"eg. ./media/video.mp4",changeProp:!0},{label:"Poster",name:"poster",placeholder:"eg. ./media/image.jpg"},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait()]},r.prototype.getYoutubeTraits=function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. jNQXAC9IVRw",changeProp:!0},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait(),{type:"checkbox",label:"Related",name:"rel",changeProp:!0},{type:"checkbox",label:"Modest",name:"modestbranding",changeProp:!0}]},r.prototype.getVimeoTraits=function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. 123456789",changeProp:!0},{label:"Color",name:"color",placeholder:"eg. FF0000",changeProp:!0},this.getAutoplayTrait(),this.getLoopTrait()]},r.prototype.getAutoplayTrait=function(){return{type:"checkbox",label:"Autoplay",name:"autoplay",changeProp:!0}},r.prototype.getLoopTrait=function(){return{type:"checkbox",label:"Loop",name:"loop",changeProp:!0}},r.prototype.getControlsTrait=function(){return{type:"checkbox",label:"Controls",name:"controls",changeProp:!0}},r.prototype.getYoutubeSrc=function(){var t=this.get("videoId"),e=this.get("ytUrl"),n=this.get("list");return e+=t+(t.indexOf("?")<0?"?":""),e+=n?"&list=".concat(n):"",e+=this.get("autoplay")?"&autoplay=1&mute=1":"",e+=this.get("controls")?"":"&controls=0&showinfo=0",e+=this.get("loop")?"&loop=1&playlist=".concat(t):"",e+=this.get("rel")?"":"&rel=0",e+=this.get("modestbranding")?"&modestbranding=1":"",e},r.prototype.getYoutubeNoCookieSrc=function(){var t=this.getYoutubeSrc();return t=t.replace(this.get("ytUrl"),this.get("ytncUrl")),t},r.prototype.getVimeoSrc=function(){var t=this.get("viUrl");return t+=this.get("videoId")+"?",t+=this.get("autoplay")?"&autoplay=1&muted=1":"",t+=this.get("loop")?"&loop=1":"",t+=this.get("controls")?"":"&title=0&portrait=0&badge=0",t+=this.get("color")?"&color="+this.get("color"):"",t},r.isComponent=function(t){var e=t.tagName,n=t.src,i=/youtube\.com\/embed/.test(n),l=/youtube-nocookie\.com\/embed/.test(n),u=/player\.vimeo\.com\/video/.test(n),c=i||l||u;if((0,At.toLowerCase)(e)==Du||(0,At.toLowerCase)(e)=="iframe"&&c){var f={type:"video"};return n&&(f.src=n),c&&(i?f.provider=Mo:l?f.provider=Do:u&&(f.provider=Lo)),f}},r}
211)(Tc),h0=p0,v0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),vl=function(){return vl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},vl.apply(this,arguments)},g0=(function(a){v0(r,a);function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,i,l=a.apply(this,t)||this,u=t[1],c=(n=u?.em)===null||n===void 0?void 0:n.Components,f=(i=c?.getType(Wo))===null||i===void 0?void 0:i.model,v=c?.getType("default").model;return f&&l.set({head:new f({},u),docEl:new v({tagName:"html"},u)},{silent:!0}),l}return Object.defineProperty(r.prototype,"defaults",{get:function(){return vl(vl({},a.prototype.defaults),{tagName:"body",removable:!1,copyable:!1,draggable:!1,components:[],traits:[],doctype:"",head:null,docEl:null,stylable:["background","background-color","background-image","background-repeat","background-attachment","background-position","background-size"]})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"head",{get:function(){return this.get("head")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"docEl",{get:function(){return this.get("docEl")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"doctype",{get:function(){return this.attributes.doctype||""},enumerable:!1,configurable:!0}),r.prototype.toHTML=function(t){t===void 0&&(t={});var e=this.doctype,n=(0,k.isUndefined)(t.asDocument)?!!e:t.asDocument,i=this,l=i.head,u=i.docEl,c=a.prototype.toHTML.call(this,t),f=n&&l?.toHTML(t)||"",v=n&&(0,$t.kk)(u?.getAttrToHTML())||"",g=v?" ".concat(v):"";return n?"".concat(e,"<html").concat(g,">").concat(f).concat(c,"</html>"):c},r.prototype.__postAdd=function(){var t,e=(t=this.em)===null||t===void 0?void 0:t.UndoManager;return!this.__hasUm&&e?.add(this),a.prototype.__postAdd.call(this)},r.prototype.__postRemove=function(){var t,e=(t=this.em)===null||t===void 0?void 0:t.UndoManager;return e?.remove(this),a.prototype.__postRemove.call(this)},r.isComponent=function(){return!1},r})(Hn),y0=g0,m0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),_0=(function(a){m0(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.compView=yn,t}return 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(u){if(u){var c=u.childrenView,f=u.scriptContainer;c&&c.stopListening(),(0,$t.YZ)(f),u.remove.apply(u)}});var l=t.components();l.forEach(function(u){return i.removeChildren(u,e,n)})},r.prototype.addTo=function(t){this.addToCollection(t,null,this.collection.indexOf(t))},r.prototype.addToCollection=function(t,e,n){for(var i=this,l=i.config,u=i.opts,c=i.em,f=l.frameView,v=f?.model&&t.getView(f.model),g=u.componentTypes||c?.Components.getTypes(),y=t.get("type")||"default",_=this.compView,b=0;b<g.length;b++)if(g[b].id==y){_=g[b].view;break}var S=v||new _({model:t,config:l,componentTypes:g}),E;try{E=S.render().el}catch(W){E=document.createTextNode(""),c.logError(W)}if(e)e.appendChild(E);else{var N=this.parentEl,z=N.childNodes;if((0,k.isUndefined)(n))N.appendChild(E);else{var R=z.length==n;R&&n--,R||!z.length?N.appendChild(E):N.insertBefore(E,z[n])}}return t.opt.temporary||c?.trigger("component:mount",t),E},r.prototype.resetChildren=function(t,e){var n=this,i=e===void 0?{}:e,l=i.previousModels,u=l===void 0?[]:l;this.parentEl.innerHTML="",u.forEach(function(c){return n.removeChildren(c,n.collection)}),t.each(function(c){return n.addToCollection(c)})},r.prototype.render=function(t){var e=this,n=this.el,i=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each(function(l){return e.addToCollection(l,i)}),n.innerHTML="",n.appendChild(i),this},r})(Wt.Ss),ih=_0,w0=(function(){var a=function(r,t){return a=Object.
211setPrototypeOf||{__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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Gr=function(){return Gr=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Gr.apply(this,arguments)},b0=(function(a){w0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.className=function(){return this.getClasses()},r.prototype.tagName=function(){return this.model.get("tagName")},r.prototype.preinitialize=function(t){t===void 0&&(t={}),this.opts=t},r.prototype.initialize=function(t){t===void 0&&(t={});var e=this.model,n=t.config||{},i=n.em,l=e.opt||{},u=this,c=u.$el,f=u.el;this.opts=t,this.modelOpt=l,this.config=n,this.em=i,this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.attr=e.get("attributes"),this.classe=this.attr.class||[],this.listenTo(e,"change:style",this.updateStyle),this.listenTo(e,"change:attributes",this.renderAttributes),this.listenTo(e,"change:highlightable",this.updateHighlight),this.listenTo(e,"change:status change:locked",this.updateStatus),this.listenTo(e,"change:script rerender",this.reset),this.listenTo(e,"change:content",this.updateContent),this.listenTo(e,"change",this.handleChange),this.listenTo(e,"active",this.onActive),this.listenTo(e,"disable",this.onDisable),c.data("model",e),(0,At.setViewEl)(f,this),e.view=this,this.frameView&&e.views.push(this),this.initClasses(),this.initComponents({avoidRender:!0}),this.events=Gr(Gr({},this.constructor.getEvents()),{dragstart:"handleDragStart"}),this.delegateEvents(),!l.temporary&&this.init(this._clbObj())},Object.defineProperty(r.prototype,"__cmpStyleOpts",{get:function(){return{state:"",mediaText:""}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"frameView",{get:function(){return this.opts.config.frameView},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"createDoc",{get:function(){var t,e,n=((t=this.frameView)===null||t===void 0?void 0:t.getDoc())||document;return!((e=this.opts.config)===null||e===void 0)&&e.useFrameDoc?n:document},enumerable:!1,configurable:!0}),r.prototype.__isDraggable=function(){var t=this,e=t.model,n=t.config,i=e.attributes.draggable;return n.draggableComponents&&i},r.prototype._clbObj=function(){var t=this,e=t.em,n=t.model,i=t.el;return{editor:e?.getEditor(),model:n,el:i}},r.prototype.init=function(t){},r.prototype.removed=function(t){},r.prototype.onRender=function(t){},r.prototype.onActive=function(t){},r.prototype.onDisable=function(t){},r.prototype.remove=function(){var t;a.prototype.remove.call(this);var e=this,n=e.model,i=e.$el,l=n.views,u=this.frameView||{};return n.components().forEach(function(c){var f=c.getView(u.model);f?.remove()}),(t=this.childrenView)===null||t===void 0||t.remove(),l.splice(l.indexOf(this),1),this.removed(this._clbObj()),i.data({model:"",collection:"",view:""}),this},r.prototype.handleDragStart=function(t){if(!this.__isDraggable())return!1;t.stopPropagation(),t.preventDefault(),this.em.Commands.run("tlb-move",{target:this.model,event:t})},r.prototype.initClasses=function(){var t=this.model,e=t.classes,n="change:classes";e instanceof ji&&(this.stopListening(t,n,this.initClasses),this.listenTo(t,n,this.initClasses),this.listenTo(e,"add remove change reset",this.updateClasses),e.length&&this.importClasses())},r.prototype.initComponents=function(t){t===void 0&&(t={});var e=this,n=e.model,i=e.$el,l=e.childrenView,u="change:components",c=n.get("components"),f=[n,u,this.initComponents];c instanceof Wa&&(i.data("collection",c),l&&l.remove(),this.stopListening.apply(this,f),!t.avoidRender&&this.renderChildren(),this.listenTo.apply(this,f))},r.prototype.handleChange=function(){var t=this.model,e=(0,k.keys)(t.changed);if(!(e.length===1&&e[0]==="status")){t.emitUpdate();for(var n in t.changed)t.emitUpdate(n)}},r.prototype.importClasses=function(){var t=this,e=t.em,n=t.model,i=e.Selectors;
211i&&n.classes.forEach(function(l){return i.add(l.getName())})},r.prototype.updateStatus=function(t){t===void 0&&(t={});var e=this,n=e.em,i=e.el,l=e.ppfx,u=e.model,c=n?.Canvas,f=c?.config.extHl,v=u.get("status"),g="".concat(l,"selected"),y="".concat(g,"-parent"),_="".concat(l,"freezed"),b="".concat(l,"hovered"),S="".concat(l,"no-pointer"),E="".concat(l,"pointer-init"),N=[g,y,_,b,S],z=f&&!t.noExtHl?"":g;this.$el.removeClass(N.join(" "));var R=i.getAttribute("class")||"",W=[R],ct=!c?.hasCustomSpot(Lr.F.Select),_t=!c?.hasCustomSpot(Lr.F.Target);switch(v){case"selected":ct&&W.push(z);break;case"selected-parent":_t&&W.push(y);break;case"freezed":W.push(_);break;case"freezed-selected":W.push(_),ct&&W.push(z);break;case"hovered":!t.avoidHover&&W.push(b);break}(0,k.isBoolean)(u.locked)&&W.push(u.locked?S:E);var xt=W.filter(Boolean).join(" ");xt&&i.setAttribute("class",xt)},r.prototype.updateHighlight=function(){var t=this.model,e=t.get("textable"),n=t.get("highlightable")&&(e||!t.isChildOf("text"));this.setAttribute("data-gjs-highlightable",n?!0:"")},r.prototype.updateStyle=function(t,e,n){n===void 0&&(n={});var i=this,l=i.model,u=i.em;if(Aa(u)&&!n.inline){var c=this.__cmpStyleOpts,f=l.getStyle(Gr({inline:!0},c));!(0,k.isEmpty)(f)&&l.setStyle(f,c)}else this.setAttribute("style",l.styleToString(n))},r.prototype.updateClasses=function(){var t=this.model.classes.pluck("name").join(" ");this.setAttribute("class",t),this.updateStatus(),this.onAttrUpdate()},r.prototype.setAttribute=function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)},r.prototype.getClasses=function(){return this.model.getClasses().join(" ")},r.prototype.updateAttributes=function(){var t=[],e=this,n=e.model,i=e.$el,l=e.el,u=n.attributes,c=u.textable,f=u.type,v=Gr(Gr({id:n.getId(),"data-gjs-type":f||"default"},this.__isDraggable()&&{draggable:!0}),c&&{contenteditable:"false"});(0,k.each)(l.attributes,function(y){return t.push(y.nodeName)}),t.forEach(function(y){return i.removeAttr(y)}),this.updateStyle(),this.updateHighlight();var g=Gr(Gr({},v),n.getAttributes());(0,k.keys)(g).forEach(function(y){return g[y]===!1&&delete g[y]}),i.attr(g)},r.prototype.updateContent=function(){var t=this.model.content,e=this.model.components().length;this.getChildrenContainer().innerHTML=e?"":t},r.prototype.prevDef=function(t){t.preventDefault()},r.prototype.updateScript=function(){var t=this,e=t.model,n=t.em;e.get("script")&&n?.Canvas.getCanvasView().updateScript(this)},r.prototype.getChildrenContainer=function(){var t=this.el;return typeof this.getChildrenSelector=="function"?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t},r.prototype.getOffsetRect=function(){var t={top:0,left:0,bottom:0,right:0},e=this.el,n=0,i=0,l=function(u){var c=u.offsetParent;c?(n+=c.offsetTop,i+=c.offsetLeft,l(c)):(t.top=e.offsetTop+n,t.left=e.offsetLeft+i,t.bottom=t.top+e.offsetHeight,t.right=t.left+e.offsetWidth)};return l(e),t},r.prototype.isInViewport=function(){var t=this,e=t.el,n=t.em,i=t.frameView,l=n.Canvas.getCanvasView(),u=l.getElBoxRect(e,{local:!0}),c=i.el,f=c.clientHeight,v=c.clientWidth,g=u.y,y=u.x,_=g+u.height,b=y+u.width,S=g>=0&&g<f,E=_>0&&_<f,N=b>=0&&b<v,z=y>0&&y<=v,R=(S||E)&&(N||z);return R},r.prototype.scrollIntoView=function(t){var e;t===void 0&&(t={});var n=this.isInViewport();if(!n||t.force){var i=this.el;if(t.behavior!=="smooth"){var l=this.getOffsetRect();(e=i.ownerDocument.defaultView)===null||e===void 0||e.scrollTo(0,l.top)}else i.scrollIntoView(Gr({behavior:"smooth",block:"nearest"},t))}},r.prototype.reset=function(){var t=this.el;this.el="",this._ensureElement(),this._setData(),(0,$t.bG)(t,this.el),this.render()},r.prototype._setData=function(){var t=this.model,e=t.components(),n=this;this.$el.data({model:t,collection:e,view:n})},r.prototype._createElement=function(t){return this.createDoc.createElement(t)},r.prototype.renderChildren=function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new ih({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),i=0,l=n.length;i<l;i++)t.appendChild(n.shift())},r.prototype.renderAttributes=function(){this.updateAttributes(),this.updateClasses()},r.prototype.onAttrUpdate=function(){},r.prototype.render=function(){return this.renderAttributes(),this.modelOpt.temporary?this:(this.renderChildren(),this.updateScript(),(0,At.setViewEl)(this.el,this),this.postRender(),this)},r.prototype.postRender=function(){this.modelOpt.temporary||this.onRender(this._clbObj())},r.getEvents=function(){return(0,k.result)(this.prototype,"events")},r})(Wt.Ss),yn=b0,x0=(function(){var a=function(r,t){return a=Object.
211setPrototypeOf||{__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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),C0=(function(a){x0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return 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,e=t.model,n=t.el;return e.opt.temporary?this:(n.textContent=e.content,this)},r})(yn),oh=C0,S0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),O0=(function(a){S0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype._createElement=function(){return document.createComment(this.model.content)},r})(oh),T0=O0,E0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),P0=(function(a){E0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.tagName=function(){return"div"},r.prototype.initialize=function(t){a.prototype.initialize.call(this,t),this.listenTo(this.model,"change:attributes:src",this.updateSrc)},r.prototype.updateSrc=function(){var t=(0,$t.I6)(this.el,"iframe")[0];t&&(0,$t.X6)(t,{src:this.__getSrc()})},r.prototype.render=function(){a.prototype.render.call(this);var t=(0,$t.a_)("iframe",{class:"".concat(this.ppfx,"no-pointer"),style:"width: 100%; height: 100%; border: none",src:this.__getSrc()});return this.el.appendChild(t),this},r.prototype.__getSrc=function(){return this.model.getAttributes().src||""},r})(yn),A0=P0,k0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),M0=(function(a){k0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.tagName=function(){return"img"},r.prototype.events=function(){return{dblclick:"onActive",click:"initResize",error:"onError",load:"onLoad",dragstart:"noDrag"}},r.prototype.initialize=function(t){a.prototype.initialize.call(this,t),this.listenTo(this.model,"change:src",this.updateSrc),this.classEmpty="".concat(this.ppfx,"plh-image"),this.fetchFile()},r.prototype.fetchFile=function(){if(!this.modelOpt.temporary){var t=this,e=t.model,n=t.em,i=e.get("file");if(i&&n){var l=n.Assets.FileUploader();l?.uploadFile({dataTransfer:{files:[i]}},function(u){var c=u&&u.data&&u.data[0],f=c&&((0,k.isString)(c)?c:c.src);f&&e.set({src:f})}),e.set("file","")}}},r.prototype.updateSrc=function(){var t=this.model;t.addAttributes({src:t.getSrcResult()}),this.updateClasses()},r.prototype.updateClasses=function(){a.prototype.updateClasses.call(this);var t=this,e=t.el,n=t.classEmpty,i=t.model,l=i.getSrcResult()&&!i.isDefaultSrc(),u=l?"remove":"add";e.classList[u](n)},r.prototype.onActive=function(t){t?.stopPropagation();var e=this,n=e.em,i=e.model,l=n?.Assets;l&&i.get("editable")&&l.open({select:function(u,c){i.set({src:u.getSrc()}),c&&l.close()},target:i,types:["image"],accept:"image/*"})},r.prototype.onError=function(){var t=this.model.getSrcResult({fallback:!0});t&&(this.el.src=t)},r.prototype.onLoad=function(){this.em.Canvas.refresh({all:!0})},r.prototype.noDrag=function(t){return t.preventDefault(),!1},r.prototype.render=function(){if(this.renderAttributes(),this.modelOpt.temporary)return this;this.updateSrc();var t=this,e=t.$el,n=t.model,i=e.attr("class")||"";return!n.get("src")&&e.attr("class","".concat(i," ").concat(this.classEmpty).trim()),this.postRender(),this},r}
211)(yn),Ac=M0,L0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ia=function(){return Ia=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Ia.apply(this,arguments)},Ms=function(a,r,t,e){function n(i){return i instanceof t?i:new t(function(l){l(i)})}return new(t||(t=Promise))(function(i,l){function u(v){try{f(e.next(v))}catch(g){l(g)}}function c(v){try{f(e.throw(v))}catch(g){l(g)}}function f(v){v.done?i(v.value):n(v.value).then(u,c)}f((e=e.apply(a,r||[])).next())})},Ls=function(a,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,n,i,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(f){return function(v){return c([f,v])}}function c(f){if(e)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(t=0)),t;)try{if(e=1,n&&(i=f[0]&2?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,n=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=r.call(a,t)}catch(v){f=[6,v],n=0}finally{e=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},D0=(function(a){L0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.events=function(){return{dblclick:"onActive",input:"onInput"}},r.prototype.initialize=function(t){a.prototype.initialize.call(this,t),(0,k.bindAll)(this,"disableEditing","onDisable");var e=this.model,n=this.em;this.listenTo(e,"focus",this.onActive),this.listenTo(e,"change:content",this.updateContentText),this.listenTo(e,"sync:content",this.syncContent),this.rte=n?.RichTextEditor},r.prototype.updateContentText=function(t,e,n){n===void 0&&(n={}),!n.fromDisable&&this.disableEditing()},r.prototype.canActivate=function(){var t=this,e=t.model,n=t.rteEnabled,i=t.em,l=i?.getEditing(),u=l===e,c=!0,f=!1,v;if((n||!e.get("editable")||u||(f=e.isChildOf("text")))&&(c=!1,f&&!e.get("textable"))){for(var g=e.parent();g&&!g.isInstanceOf("text");)g=g.parent();g&&g.get("editable")?v=g:c=!0}return{result:c,delegate:v}},r.prototype.onActive=function(t){return Ms(this,void 0,void 0,function(){var e,n,i,l,u,c,f,v,g,y,_;return Ls(this,function(b){switch(b.label){case 0:return e=this,n=e.rte,i=e.em,l=this.canActivate(),u=l.result,c=l.delegate,u?((_=t?.stopPropagation)===null||_===void 0||_.call(t),f=this,[4,this.getContent()]):(c&&((y=t?.stopPropagation)===null||y===void 0||y.call(t),i.setSelected(c),c.trigger("active",t)),[2]);case 1:if(f.lastContent=b.sent(),!n)return[3,5];b.label=2;case 2:return b.trys.push([2,4,,5]),v=this,[4,n.enable(this,this.activeRte,{event:t})];case 3:return v.activeRte=b.sent(),[3,5];case 4:return g=b.sent(),i.logError(g),[3,5];case 5:return this.toggleEvents(!0),[2]}})})},r.prototype.onDisable=function(t){this.disableEditing(t)},r.prototype.disableEditing=function(){return Ms(this,arguments,void 0,function(t){var e,n,i,l,u,c,f,v;return t===void 0&&(t={}),Ls(this,function(g){switch(g.label){case 0:if(e=this,n=e.model,i=e.rte,l=e.activeRte,u=e.em,c=n&&n.get("editable"),!i)return[3,8];g.label=1;case 1:return g.trys.push([1,3,,4]),[4,i.disable(this,l,t)];case 2:return g.sent(),[3,4];case 3:return f=g.sent(),u.logError(f),[3,4];case 4:return v=c,v?[4,this.getContent()]:[3,6];case 5:v=g.sent()!==this.lastContent,g.label=6;case 6:return v?[4,this.syncContent(t)]:[3,8];case 7:g.sent(),this.lastContent="",g.label=8;case 8:return this.toggleEvents(),[2]}})})},r.prototype.getContent=function(){return Ms(this,void 0,void 0,function(){var t,e,n,i;return Ls(this,function(l){switch(l.label){case 0:return t=this,e=t.rte,n=t.activeRte,i="",e?[4,e.getContent(this,n)]:[3,2];case 1:i=l.sent(),l.label=2;case 2:return[2,i]}})})},r.prototype.syncContent=function(){return Ms(this,arguments,void 0,function(t){var e,n,i,l,u,c,f;return t===void 0&&(t={}),Ls(this,function(v){switch(v.label){case 0:return e=this,n=e.model,i=e.rte,l=e.rteEnabled,!l&&!t.force?[2]:[4,this.getContent()];case 1:return u=v.sent(),c=n.components(),f=Ia({fromDisable:1},t),n.set("content","",f),i?.customRte&&!i.customRte.parseContent?(c.length&&c.reset(void 0,Ia(Ia({},t),{keepIds:Io(c)})),n.set("content",u,f)):c.resetFromString(u,t),[2]}})})},r.prototype.insertComponent=function(t,e){var n;e===void 0&&(e={});
211var i=this,l=i.model,u=i.el,c=u.ownerDocument,f=c.getSelection();if(f?.rangeCount){var v=f.getRangeAt(0),g=v.startContainer,y=v.startOffset,_=(0,At.getComponentModel)(g),b=[];if(_&&(!((n=_.is)===null||n===void 0)&&n.call(_,"textnode"))){var S=_.collection;S.forEach(function(z){if(z===_){var R="textnode",W=e.useDomContent?g.textContent||"":z.content;b.push({type:R,content:W.slice(0,y)}),b.push(t),b.push({type:R,content:W.slice(y)})}else b.push(z)});var E=b.filter(Boolean),N=E.indexOf(t);return S.reset(E,e),S.at(N)}}return l.append(t,e)},r.prototype.onInput=function(){var t=this.em,e="component",n=["".concat(e,":update"),"".concat(e,":input")].join(" ");t&&t.trigger(n,this.model)},r.prototype.disablePropagation=function(t){t.stopPropagation()},r.prototype.toggleEvents=function(t){var e=this,n=e.em,i=e.model,l=e.$el,u={on:$t.on,off:$t.AU},c=t?"on":"off";n.setEditing(t?this:!1),this.rteEnabled=!!t;var f=[this.el.ownerDocument,document];if(u.off(f,"mousedown",this.onDisable),u[c](f,"mousedown",this.onDisable),n[c]("toolbar:run:before",this.onDisable),i&&(i[c]("removed",this.onDisable),i.trigger("rte:".concat(t?"enable":"disable"))),l?.off("mousedown",this.disablePropagation),l&&l[c]("mousedown",this.disablePropagation),this.config.draggableComponents)for(var v=this.el;v;)v.draggable=!t,v=v.parentNode,v&&v.tagName=="BODY"&&(v=0)},r})(yn),ah=D0,j0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),I0=(function(a){j0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.render=function(){return a.prototype.render.call(this),this.el.addEventListener("click",this.prevDef,!0),this},r})(ah),sh=I0,R0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),N0=(function(a){R0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r})(sh),F0=N0,V0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),H0=(function(a){V0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.tagName=function(){return"div"},r.prototype.events=function(){return{}},r.prototype.initialize=function(t){a.prototype.initialize.call(this,t),this.classEmpty=this.ppfx+"plh-map"},r.prototype.updateSrc=function(){this.getIframe().src=this.model.get("src")},r.prototype.getIframe=function(){if(!this.iframe){var t=document.createElement("iframe");t.src=this.model.get("src"),t.frameBorder="0",t.style.height="100%",t.style.width="100%",t.className=this.ppfx+"no-pointer",this.iframe=t}return this.iframe},r.prototype.render=function(){return a.prototype.render.call(this),this.updateClasses(),this.el.appendChild(this.getIframe()),this},r})(Ac),U0=H0,B0=(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");a(r,t);function e(){this.constructor=r}
211r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),W0=(function(a){B0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.tagName=function(){return"script"},r.prototype.events=function(){return{}},r})(yn),z0=W0,K0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),G0=(function(a){K0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype._createElement=function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},r})(yn),Pd=G0,$0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),q0=(function(a){$0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r})(yn),Y0=q0,X0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),J0=(function(a){X0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r})(yn),Z0=J0,Q0=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),t_=(function(a){Q0(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r})(yn),e_=t_,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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),r_=(function(a){n_(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r})(yn),i_=r_,o_=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),a_=(function(a){o_(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r})(yn),s_=a_,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");a(r,t);function e(){this.constructor=r}
211r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),u_=(function(a){l_(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.events=function(){return{}},r})(yn),c_=u_,f_=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),d_=(function(a){f_(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.tagName=function(){return"div"},r.prototype.events=function(){return{}},r.prototype.initialize=function(){yn.prototype.initialize.apply(this,arguments);var t=this.model,e=["loop","autoplay","controls","color","rel","modestbranding","poster"],n=e.map(function(i){return"change:".concat(i)}).join(" ");this.listenTo(t,"change:provider",this.updateProvider),this.listenTo(t,"change:src",this.updateSrc),this.listenTo(t,n,this.updateVideo)},r.prototype.updateProvider=function(){var t=this.model.get("provider");this.el.innerHTML="",this.el.appendChild(this.renderByProvider(t))},r.prototype.updateSrc=function(){var t=this,e=t.model,n=t.videoEl;if(n){var i=e.get("provider"),l=e.get("src");switch(i){case"yt":l=e.getYoutubeSrc();break;case"ytnc":l=e.getYoutubeNoCookieSrc();break;case"vi":l=e.getVimeoSrc();break}n.src=l}},r.prototype.updateVideo=function(){var t=this,e=t.model,n=t.videoEl,i=e.get("provider");switch(i){case"yt":case"ytnc":case"vi":e.trigger("change:videoId");break;default:if(n){var l=n;l.loop=e.get("loop"),l.autoplay=e.get("autoplay"),l.controls=e.get("controls"),l.poster=e.get("poster")}}},r.prototype.renderByProvider=function(t){var e;switch(t){case"yt":e=this.renderYoutube();break;case"ytnc":e=this.renderYoutubeNoCookie();break;case"vi":e=this.renderVimeo();break;default:e=this.renderSource()}return this.videoEl=e,e},r.prototype.renderSource=function(){var t=document.createElement("video");return t.src=this.model.get("src"),this.initVideoEl(t),t},r.prototype.renderYoutube=function(){var t=document.createElement("iframe");return t.src=this.model.getYoutubeSrc(),t.frameBorder="0",t.setAttribute("allowfullscreen","true"),this.initVideoEl(t),t},r.prototype.renderYoutubeNoCookie=function(){var t=document.createElement("iframe");return t.src=this.model.getYoutubeNoCookieSrc(),t.frameBorder="0",t.setAttribute("allowfullscreen","true"),this.initVideoEl(t),t},r.prototype.renderVimeo=function(){var t=document.createElement("iframe");return t.src=this.model.getVimeoSrc(),t.frameBorder="0",t.setAttribute("allowfullscreen","true"),this.initVideoEl(t),t},r.prototype.initVideoEl=function(t){t.className=this.ppfx+"no-pointer",t.style.height="100%",t.style.width="100%"},r.prototype.render=function(){yn.prototype.render.apply(this),this.updateClasses();var t=this.model.get("provider");return this.el.appendChild(this.renderByProvider(t)),this.updateVideo(),this},r})(Ac),p_=d_,h_=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),v_=(function(a){h_(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.tagName=function(){return"div"},r})(yn),g_=v_,y_=(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");a(r,t);function e(){this.constructor=r}
211r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),gl=function(){return gl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},gl.apply(this,arguments)},m_=(function(a){y_(r,a);function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=a.apply(this,t)||this;n.refreshDbn=(0,k.debounce)(function(){return n.refresh()},0);var i=n.events;return n.on(i.update,n.onUpdate),n.on(i.updateInside,n.onUpdateDeep),n}return r.prototype.removeChildren=function(t,e,n){var i;n===void 0&&(n={}),a.prototype.removeChildren.call(this,t,e,n),(i=Or(t))===null||i===void 0||i.forEach(function(l){return Cc(l,{skipRefs:!0})}),this.__trgEvent(this.events.symbolMainRemove,{component:t})},r.prototype.onAdd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a.prototype.onAdd.apply(this,t);var n=t[0];this.__trgEvent(this.events.symbolMainAdd,{component:n})},r.prototype.onUpdate=function(t){this.__trgEvent(this.events.symbolMainUpdate,t)},r.prototype.onUpdateDeep=function(t){this.__trgEvent(this.events.symbolMainUpdateDeep,t)},r.prototype.refresh=function(){var t=this,e=t.em,n=t.events;e.trigger(n.symbol)},r.prototype.__trgEvent=function(t,e,n){n===void 0&&(n=!1);var i=this,l=i.em,u=i.events,c=n?u.symbolInstance:u.symbolMain;l.trigger(t,e),l.trigger(c,gl(gl({},e),{event:t})),this.refreshDbn()},r})(Wa),__=m_,w_=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Nn=function(){return Nn=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Nn.apply(this,arguments)},b_=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},x_=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Bs=(function(a){return a[a.InvalidSource=0]="InvalidSource",a[a.SourceReject=1]="SourceReject",a[a.TargetReject=2]="TargetReject",a})(Bs||{}),C_=(function(a){w_(r,a);function r(t){var e=a.call(this,t,"DomComponents",new Wa(void 0,{em:t}))||this;e.componentTypes=[{id:"cell",model:n0,view:Z0},{id:"row",model:f0,view:s_},{id:"table",model:Jm,view:c_},{id:"thead",model:l0,view:i_},{id:"tbody",model:Pc,view:Y0},{id:"tfoot",model:o0,view:e_},{id:"map",model:Hm,view:U0},{id:"link",model:Nm,view:sh},{id:"label",model:jm,view:F0},{id:"video",model:h0,view:p_},{id:"image",model:Tc,view:Ac},{id:"script",model:Wm,view:z0},{id:"svg-in",model:qm,view:Pd},{id:"svg",model:rh,view:Pd},{id:"iframe",model:Em,view:A0},{id:"comment",model:Sm,view:T0},{id:"textnode",model:nh,view:oh},{id:Wo,model:tm,view:yn},{id:"wrapper",model:y0,view:g_},{id:"text",model:Ec,view:ah},{id:"default",model:Hn,view:yn}],e.componentsById={},e.Component=Hn,e.Components=Wa,e.ComponentView=yn,e.ComponentsView=ih,e.storageKey="components",e.keySymbols="symbols",e.events=Vn.I;var n=e.config;e.symbols=new __([],{em:t,config:n,domc:e}),t&&(e.config.components=t.config.components||e.config.components);for(var i in Cd)i in e.config||(e.config[i]=Cd[i]);var l=e.config.pStylePrefix;if(l&&(e.config.stylePrefix=l+e.config.stylePrefix),t){t.get("Parser").compTypes=e.componentTypes,t.on("change:componentHovered",e.componentHovered,e);var u=t.get("selected");t.listenTo(u,"add",function(c,f,v){return e.selectAdd(u.getComponent(c),v)}),t.listenTo(u,"remove",function(c,f,v){return e.selectRemove(u.getComponent(c),v)})}return e}return r.prototype.postLoad=function(){var t=this,e=t.em,n=t.symbols,i=e.UndoManager;i.add(n)},r.prototype.load=function(t){var e=this,n=this.loadProjectData(t,{onResult:function(i){var l=e.getWrapper();if(l||(e.em.Pages.add({},{select:!0}),l=e.getWrapper()),(0,k.isArray)(i))i.length&&l.components(i);else{var u=i.components,c=u===void 0?[]:u,f=b_(i,["components"]);l.set(f),l.components(c)}}});return this.symbols.reset(t[this.keySymbols]||[]),n},r.prototype.store=function(){var t;return t={},t[this.keySymbols]=this.symbols,t},r.prototype.getComponent=function(){var t=this.em.Pages.getSelected(),e=t?.getMainFrame();return e?.getComponent()},r.prototype.getWrapper=function(){return this.getComponent()},r.prototype.getComponents=function(){var t=this.getWrapper();return t?.components()},r.prototype.addComponent=function(t,e){return e===void 0&&(e={}),this.getComponents().add(t,e)},r.prototype.render=function(){var t;return(t=this.componentView)===null||t===void 0?void 0:t.render().el},r.prototype.clear=function(t){t===void 0&&(t={});var e=this.getComponents();
211return e?.filter(Boolean).forEach(function(n){return n.remove(t)}),this},r.prototype.setComponents=function(t,e){e===void 0&&(e={}),this.clear(e).addComponent(t,e)},r.prototype.addType=function(t,e){var n=this.em,i=e.model,l=i===void 0?{}:i,u=e.view,c=u===void 0?{}:u,f=e.isComponent,v=e.extend,g=e.extendView,y=e.extendFn,_=y===void 0?[]:y,b=e.extendFnView,S=b===void 0?[]:b,E=e.block,N=this.getType(t),z=this.getType(v),R=this.getType(g),W=z||N||this.getType("default"),ct=W.model,_t=R?R.view:W.view,xt=function(B,U,et){return B.reduce(function(A,gt){var yt=U[gt],jt=et.prototype[gt];return yt&&jt&&(A[gt]=function(){for(var te=[],Xt=0;Xt<arguments.length;Xt++)te[Xt]=arguments[Xt];jt.bind(this).apply(void 0,te),yt.bind(this).apply(void 0,te)}),A},{})};if(typeof l=="object"){var ut={defaults:l.defaults};delete l.defaults;var q=new Set(ct.typeExtends);q.add(ct.getDefaults().type),e.model=ct.extend(Nn(Nn({},l),xt(_,l,ct)),{typeExtends:q,isComponent:N&&!z&&!f?ct.isComponent:f||function(){return 0}}),Object.defineProperty(e.model.prototype,"defaults",{get:function(){return Nn(Nn({},(0,k.result)(ct.prototype,"defaults")||{}),(0,k.result)(ut,"defaults")||{})}})}if(typeof c=="object"&&(e.view=_t.extend(Nn(Nn({},c),xt(S,c,_t)))),N?(N.model=e.model,N.view=e.view):(e.id=t,this.componentTypes.unshift(e)),E){var lt={id:t,label:t,content:{type:t}},H=E===!0?lt:Nn(Nn({},lt),E);n.Blocks.add(H.id||t,H)}var I="component:type:".concat(N?"update":"add");return n?.trigger(I,N||e),this},r.prototype.getType=function(t){for(var e=this.componentTypes,n=0;n<e.length;n++){var i=e[n].id;if(i==t)return e[n]}},r.prototype.removeType=function(t){var e=this.componentTypes,n=this.getType(t);if(n){var i=e.indexOf(n);return e.splice(i,1),n}},r.prototype.getTypes=function(){return this.componentTypes},r.prototype.selectAdd=function(t,e){var n=this;e===void 0&&(e={}),t&&(t.set({status:"selected"}),["component:selected","component:toggled"].forEach(function(i){return n.em.trigger(i,t,e)}))},r.prototype.selectRemove=function(t,e){var n=this;if(e===void 0&&(e={}),t){var i=this.em;t.set({status:"",state:""}),["component:deselected","component:toggled"].forEach(function(l){return n.em.trigger(l,t,e)})}},r.prototype.componentHovered=function(){var t=this.em,e=t.get("componentHovered"),n=t.previous("componentHovered"),i="hovered";n&&n.get("status")==i&&n.set({status:"",state:""}),e&&(0,k.isEmpty)(e.get("status"))&&e.set("status",i)},r.prototype.getShallowWrapper=function(){var t=this,e=t.shallow,n=t.em;if(!e&&n){var i=n.shallow;if(!i)return;var l=i.Components;if(l.componentTypes=this.componentTypes,e=l.getWrapper(),e){var u=[Us,oc].join(" ");e.on(u,(0,k.debounce)(function(){return e?.components("")},100))}this.shallow=e}return e},r.prototype.isComponent=function(t){return(0,At.isComponent)(t)},r.prototype.addSymbol=function(t){if(!((0,k.isSymbol)(t)&&!ao(t))){var e=t.clone({symbol:!0});return zs(e)&&this.symbols.add(e),this.em.trigger("component:toggled"),e}},r.prototype.getSymbols=function(){return x_([],this.symbols.models,!0)},r.prototype.detachSymbol=function(t){Ks(t)&&Cc(t)},r.prototype.getSymbolInfo=function(t,e){e===void 0&&(e={});var n=zs(t),i=so(t),l=!!i,u=Or(n?t:i)||[],c=i||(n?t:void 0),f=io(t,{changed:e.withChanges}),v=n||l,g=v&&ao(t);return{isSymbol:v,isMain:n,isInstance:l,isRoot:g,main:c,instances:u,relatives:f||[]}},r.prototype.canMove=function(t,e,n){var i={result:!1,reason:Bs.InvalidSource,target:t,source:null};if(!e||!t)return i;var l=(0,At.isComponent)(e)?e:null;if(!l){var u=this.getShallowWrapper();l=u?.append(e)[0]||null}if(i.source=l,!l)return i;var c=l.get("draggable");if((0,k.isFunction)(c))c=!!c(l,t,n);else{var f=t.getEl();c=(0,k.isArray)(c)?c.join(","):c,c=(0,k.isString)(c)?f?.matches(c):c}if(!c)return Nn(Nn({},i),{reason:Bs.SourceReject});var v=t.get("droppable");if((0,k.isFunction)(v))v=!!v(l,t,n);else if(v===!1&&t.isInstanceOf("text")&&l.get("textable"))v=!0;else{var f=l.getEl();v=(0,k.isArray)(v)?v.join(","):v,v=(0,k.isString)(v)?f?.matches(v):v}var g=[t].concat(t.parents()).indexOf(l)>-1;return!v||g?Nn(Nn({},i),{reason:Bs.TargetReject}):Nn(Nn({},i),{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].forEac
211h(function(n){return n={}})},r})(Ri),S_=C_,O_={stylePrefix:"css-",rules:[]},T_=O_,E_=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),P_=Number.MAX_VALUE,A_=function(a){var r=/(-?\d*\.?\d+)\w{0,}/.exec(a);return r?r[0]:""},k_=(function(a){E_(r,a);function r(){var t=a.call(this)||this;return(0,k.bindAll)(t,"sortRules"),t.compCls=[],t.ids=[],t}return r.prototype.buildFromModel=function(t,e){var n=this;e===void 0&&(e={});var i="",l=this.em,u=l&&l.getConfig().avoidInlineStyle,c=t.styleToString(),f=t.classes;this.ids.push("#".concat(t.getId())),f.forEach(function(g){return n.compCls.push(g.getFullName())}),!u&&c&&(i="#".concat(t.getId(),"{").concat(c,"}"));var v=t.components();return v.forEach(function(g){return i+=n.buildFromModel(g,e)}),i},r.prototype.build=function(t,e){var n=this;e===void 0&&(e={});var i=e.json,l=e.em,u=e.cssc||l?.Css;this.em=l,this.compCls=[],this.ids=[],this.model=t;var c=[],f=t?this.buildFromModel(t,e):"",v=(0,k.isUndefined)(e.clearStyles)&&l?l.getConfig().clearStyles:e.clearStyles;if(u){var g=e.rules||u.getAll(),y={},_=[];e.onlyMatched&&t&&(0,At.hasWin)()&&(g=this.matchedRules(t,g)),g.forEach(function(b){var S=b.getAtRule();if(S){var E=y[S];E?E.push(b):y[S]=[b];return}var N=n.buildFromRule(b,_,e);i?c.push(N):f+=N}),this.sortMediaObject(y).forEach(function(b){var S="",E=b.key,N=b.value;N.forEach(function(z){var R=n.buildFromRule(z,_,e);z.get("singleAtRule")?f+="".concat(E,"{").concat(R,"}"):S+=R,i&&c.push(R)}),S&&(f+="".concat(E,"{").concat(S,"}"))}),l&&v&&g.remove&&g.remove(_)}return i?c.filter(function(b){return b}):f},r.prototype.buildFromRule=function(t,e,n){var i=this,l;n===void 0&&(n={});var u="",c=this.model,f=t.selectorsToString({skipAdd:1}),v=t.get("selectorsAdd"),g=t.get("singleAtRule"),y;if((l=t.get("selectors"))===null||l===void 0||l.forEach(function(b){var S=b.getFullName();(i.compCls.indexOf(S)>=0||i.ids.indexOf(S)>=0||n.keepUnusedStyles)&&(y=1)}),f&&y||v||g||!c){var _=t.getDeclaration({body:1});_&&(n.json?u=t:u+=_)}else e.push(t);return u},r.prototype.matchedRules=function(t,e){var n=this,i=t.getEl(),l=[];return e.forEach(function(u){try{u.selectorsToString().split(",").some(function(c){return i?.matches(n.__cleanSelector(c))})&&l.push(u)}catch(c){}}),t.components().forEach(function(u){l=l.concat(n.matchedRules(u,e))}),l=l.filter(function(u,c){return l.indexOf(u)===c}),l},r.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):P_},r.prototype.sortMediaObject=function(t){var e=this;t===void 0&&(t={});var n=[];return(0,k.each)(t,function(i,l){return n.push({key:l,value:i})}),n.sort(function(i,l){var u=[i.key,l.key].every(function(v){return v.indexOf("min-width")!==-1}),c=u?i.key:l.key,f=u?l.key:i.key;return e.getQueryLength(c)-e.getQueryLength(f)})},r.prototype.sortRules=function(t,e){var n=function(c){return c.get("mediaText")||""},i=[n(t),n(e)].every(function(c){return c.indexOf("min-width")!==-1}),l=n(i?t:e),u=n(i?e:t);return this.getQueryLength(l)-this.getQueryLength(u)},r.prototype.__cleanSelector=function(t){return t.split(" ").map(function(e){return e.split(":")[0]}).join(" ")},r})(Wt.Kx),M_=k_,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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ra=function(){return Ra=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];
211for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Ra.apply(this,arguments)},D_=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Iu=((0,At.hasWin)()?window:{}).CSS,j_=(function(a){L_(r,a);function r(t,e){e===void 0&&(e={});var n=a.call(this,t)||this;return n.config=t||{},n.opt=e,n.em=e.em,n.ensureSelectors(null,null,{}),n.on("change",n.__onChange),n}return r.prototype.defaults=function(){return{selectors:[],selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:!1,important:!1,group:"",shallow:!1,_undo:!0}},r.prototype.__onChange=function(t,e){var n=this.em,i=this.changedAttributes();i&&!(0,At.isEmptyObj)(i)&&n?.changesUp(e)},r.prototype.clone=function(){var t=Ra({},this.opt),e=Ra({},this.attributes);return e.selectors=this.get("selectors").map(function(n){return n.clone()}),new this.constructor(e,t)},r.prototype.ensureSelectors=function(t,e,n){var i=this.em,l=i?.Selectors,u=[this,"change:selectors",this.ensureSelectors],c=this.getSelectors();if(this.stopListening.apply(this,u),c.models&&(c=D_([],c.models,!0)),c=(0,k.isString)(c)?[c]:c,Array.isArray(c)){var f=c.filter(function(v){return v}).map(function(v){return l?l.add(v):v});c=new ji(f)}this.set("selectors",c,n),this.listenTo.apply(this,u)},r.prototype.getAtRule=function(){var t=this.get("atRuleType"),e=this.get("mediaText"),n=t?"@".concat(t):e?"@media":"";return n+(e&&n?" ".concat(e):"")},r.prototype.selectorsToString=function(t){t===void 0&&(t={});var e=[],n=this.get("state"),i=this.get("selectorsAdd"),l={escape:function(f){return Iu&&Iu.escape?Iu.escape(f):f}},u=this.getSelectors().getFullString(0,l),c=n&&!t.skipState?":".concat(n):"";return u&&e.push("".concat(u).concat(c)),i&&!t.skipAdd&&e.push(i),e.join(", ")},r.prototype.getDeclaration=function(t){t===void 0&&(t={});var e="",n=this.attributes.important,i=this.selectorsToString(t),l=this.styleToString(Ra({important:n},t)),u=this.get("singleAtRule");return(i||u)&&(l||t.allowEmpty)&&(e=u?l:"".concat(i,"{").concat(l,"}")),e},r.prototype.getDevice=function(){var t=this.em,e=this.attributes,n=e.atRuleType,i=e.mediaText,l=t?.Devices.getDevices()||[],u=l.filter(function(c){return c.getWidthMedia()===""})[0];return n!=="media"||!i?u||null:l.filter(function(c){return c.getWidthMedia()===A_(i)})[0]||null},r.prototype.getState=function(){var t=this.em,e=this.get("state"),n=t?.Selectors.getStates()||[];return n.filter(function(i){return i.getName()===e})[0]||null},r.prototype.getComponent=function(){var t,e=this.getSelectors(),n=e.length==1&&e.at(0),i=n&&n.isId()&&n.get("name");return i&&((t=this.em)===null||t===void 0?void 0:t.Components.getById(i))||null},r.prototype.toCSS=function(t){t===void 0&&(t={});var e="",n=this.getAtRule(),i=this.getDeclaration(t);return(i||t.allowEmpty)&&(e=i),n&&e&&(e="".concat(n,"{").concat(e,"}")),e},r.prototype.toJSON=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=Wt.Kx.prototype.toJSON.apply(this,e);if(!((t=this.em)===null||t===void 0)&&t.getConfig().avoidDefaults){var l=this.defaults();(0,k.forEach)(l,function(u,c){i[c]===u&&delete i[c]}),delete i.style.__p,(0,k.isEmpty)(i.selectors)&&delete i.selectors,(0,k.isEmpty)(i.style)&&delete i.style}return i},r.prototype.compare=function(t,e,n,i){var l;i===void 0&&(i={});var u=e||"",c=n||"",f=i.selectorsAdd||"",v=i.atRuleType||"",g=!(0,k.isArray)(t)&&!t.models?[t]:t.models||t;c&&!v&&(v="media");var y=g.map(function(E){return E.getFullName()}),_=(l=this.get("selectors"))===null||l===void 0?void 0:l.map(function(E){return E.getFullName()}),b=y.slice().sort(),S=_.slice().sort();return!(y.length!==_.length||!b.every(function(E,N){return E===S[N]})||this.get("state")!==u||this.get("mediaText")!==c||this.get("selectorsAdd")!==f||this.get("atRuleType")!==v)},r})(Kp),lh=j_,I_=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}
211r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),uh=(function(a){I_(r,a);function r(t,e){var n=a.call(this,t)||this;return n.editor=e?.em,setTimeout(function(){n.on("remove",n.onRemove),n.on("add",n.onAdd)}),n}return r.prototype.toJSON=function(t){var e=Wt.pM.prototype.toJSON.call(this,t);return e.filter(function(n){return n.style&&!n.shallow})},r.prototype.onAdd=function(t,e,n){t.ensureSelectors(t,e,n)},r.prototype.onRemove=function(t){var e=this.editor;e.stopListening(t),e.UndoManager.remove(t)},r.prototype.add=function(t,e){return e===void 0&&(e={}),typeof t=="string"&&(t=this.editor.get("Parser").parseCss(t)),e.em=this.editor,Wt.pM.prototype.add.apply(this,[t,e])},r})(Wt.pM),R_=uh;uh.prototype.model=lh;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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),eo=function(){return eo=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},eo.apply(this,arguments)},F_=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},V_=(function(a){N_(r,a);function r(t){var e=a.call(this,t,"CssComposer",null,{},T_)||this;e.Selectors=ji,e.storageKey="styles";var n=e.config,i=n.pStylePrefix;return i&&(n.stylePrefix=i+n.stylePrefix),n.rules=e.em.config.style||n.rules||"",e.rules=new R_([],n),e}return r.prototype.onLoad=function(){this.rules.add(this.config.rules,{silent:!0})},r.prototype.postLoad=function(){var t,e=(t=this.em)===null||t===void 0?void 0:t.get("UndoManager");e&&e.add(this.getAll())},r.prototype.store=function(){return this.getProjectData()},r.prototype.load=function(t){return this.loadProjectData(t,{all:this.rules})},r.prototype.add=function(t,e,n,i,l){i===void 0&&(i={}),l===void 0&&(l={});var u=e||"",c=n||"",f=eo({},i),v=this.get(t,u,c,f);return v&&v.config&&!v.config.singleAtRule||(f.state=u,f.mediaText=c,f.selectors=[],c&&!f.atRuleType&&(f.atRuleType="media"),v=new lh(f,this.config),v.get("selectors").add(t,l),this.rules.add(v,l)),v},r.prototype.get=function(t,e,n,i){var l=t;if((0,k.isString)(t)){var u=this.em.Selectors,c=t.split(",")[0].trim(),f=this.em.Parser.parserCss.checkNode({selectors:c})[0];l=u.get(f.selectors)}return this.rules.find(function(v){return v.compare(l,e,n,i)})||null},r.prototype.getAll=function(){return this.rules},r.prototype.addCollection=function(t,e,n){e===void 0&&(e={}),n===void 0&&(n={});var i=this.em,l=[];(0,k.isString)(t)&&(t=i.Parser.parseCss(t));for(var u=t instanceof Array?t:[t],c=0,f=u.length;c<f;c++){var v=u[c]||{};if(v.selectors){var g=i?.Selectors;g||console.warn("Selector Manager not found");for(var y=v.selectors,_=y instanceof Array?y:[y],b=[],S=0,E=_.length;S<E;S++){var N=g.add(_[S]);b.push(N)}var z=this.get(b,v.state,v.mediaText,v),R=this.add(b,v.state,v.mediaText,v,e),W=!z||!e.avoidUpdateStyle,ct=v.style||{};if((0,At.isObject)(n)&&R.set(n,e),W){var _t=e.extend?eo(eo({},R.get("style")),ct):ct;R.set("style",_t,e)}l.push(R)}}return l},r.prototype.addRules=function(t){return this.addCollection(t)},r.prototype.setRule=function(t,e,n){e===void 0&&(e={}),n===void 0&&(n={});var i=n.atRuleType,l=n.atRuleParams,u=this.em.Parser.parserCss.checkNode({selectors:t,style:e})[0],c=u.state,f=u.selectorsAdd,v=this.em.Selectors,g=v.add(u.selectors),y=this.add(g,c,l,{selectorsAdd:f,atRule:i});return n.addStyles?y.addStyle(e,n):y.setStyle(e,n),y},r.prototype.getRule=function(t,e){e===void 0&&(e={});var n=this.em,i=n.Selectors,l=n.Parser.parserCss.checkNode({selectors:t})[0],u=i.get(l.selectors),c=l.state,f=l.selectorsAdd,v=e.atRuleType,g=e.atRuleParams;return u?this.get(u,c,g,{selectorsAdd:f,atRuleType:v}):void 0},r.prototype.getRules=function(t){var e=this.getAll();if(!t)return F_([],e.models,!0);var n={sort:!0},i=(0,k.isString)(t)?t.split(",").map(function(u){return u.trim()}):t,l=e.filter(function(u){return i.indexOf(u.getSelectors().getFullString(null,n))>=0});return l},r.prototype.setIdRule=function(t,e,n){e===void 0&&(e={}),n===void 0&&(n={});var i=n.addOpts,l=i===void 0?{}:i,u=n.mediaText,c=n.state||"",f=(0,k.isUndefined)(u)?this.em.getCurrentMedia():u,v=this.em.Selectors,g=v.add({name:t,type:Jn.TYPE_ID},l),y=this.add(g,c,f,{},l);return y.setStyle(e,eo(eo({},n),l)),y},r.prototype.getIdRule=function(t,e){e===void 0&&(e={});var n=e.mediaText,i=e.state||"",l=(0,k.isUndefined)(n)?this.em.getCurrentMedia():n,u=this.em.Selectors.get(t,Jn.TYPE_ID);return u&&this.get(u,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(),u=this.em.Selectors,c=u.add({name:t,type:Jn.TYPE_CLASS}),f=this.add(c,i,l);return f.setStyle(e,n),f},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,k.isString)(t)?this.getRules(t):t,i=this.getAll().remove(n,e);return(0,k.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,l=e.current;l&&(n=this.em.get("state")||"",i=this.em.getCurrentMedia());var u=t.getId(),c=this.getAll().filter(function(f){return!(0,k.isUndefined)(n)&&f.get("state")!==n||!(0,k.isUndefined)(i)&&f.get("mediaText")!==i?!1:f.getSelectorsString()==="#".concat(u)});return c},r.prototype.render=function(){var t;return(t=this.rulesView)===null||t===void 0||t.remove(),this.rulesView=new Bp({collection:this.rules,config:this.config}),this.rulesView.render().el},r.prototype.checkId=function(t,e){e===void 0&&(e={});var n=e.idMap,i=n===void 0?{}:n,l=[];
211if(!Object.keys(i).length)return l;var u=Array.isArray(t)?t:[t];return u.forEach(function(c){var f=c.selectors;if(f&&f.length==1){var v=f[0];if((0,k.isString)(v)){if(v[0]==="#"){var g=v.substring(1),y=i[g];g&&y&&(f[0]="#".concat(y),l.push(c))}}else if(v.name&&v.type===Jn.TYPE_ID){var y=i[v.name];y&&(v.name=y,l.push(c))}}}),l},r.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),(t=this.rulesView)===null||t===void 0||t.remove()},r})(Ri),H_=V_,U_={appendTo:"",blocks:[],appendOnClick:!1,custom:!1},B_=U_,W_=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),z_=(function(a){W_(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return{label:"",content:"",media:"",category:"",activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{}}},Object.defineProperty(r.prototype,"category",{get:function(){var t=this.get("category");return t instanceof Ga?t:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),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,k.isFunction)(t?.get)?t.get("label"):t?.label?t?.label:t},r})(Wt.Kx),ch=z_,K_=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),fh=(function(a){K_(r,a);function r(t,e){var n=a.call(this,t)||this;return n.em=e.em,n.on("add",n.handleAdd),n}return r.prototype.getCategories=function(){return this.em.Blocks.getCategories()},r.prototype.handleAdd=function(t){this.initCategory(t)},r})(Qp),Ds=fh;fh.prototype.model=ch;var Ws=(function(a){return a.add="block:add",a.remove="block:remove",a.removeBefore="block:remove:before",a.update="block:update",a.dragStart="block:drag:start",a.drag="block:drag",a.dragEnd="block:drag:stop",a.categoryUpdate="block:category:update",a.custom="block:custom",a.all="block",a})(Ws||{});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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),$_=(function(a){G_(r,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 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,u=i.get("onClick")||n.appendOnClick;if(l.trigger("block:click",i,t),u){if((0,k.isFunction)(u))return u(i,l?.getEditor(),{event:t})}else return;var c=n.getSorter(),f=i.get("content"),v=l.getSelected();c.setDropContent(f);var g,y,_;
211if(v)if(y=c.validTarget(v.getEl(),f),y.valid)g=v;else{var b=v.parent();b&&(y=c.validTarget(b.getEl(),f),y.valid&&(g=b,_=b.components().indexOf(v)+1))}if(!g){var S=l.getWrapper();y=c.validTarget(S.getEl(),f),y.valid&&(g=S)}var E=g&&g.append(f,{at:_})[0];E&&l.setSelected(E,{scroll:1})},r.prototype.startDrag=function(t){var e=this,n=e.config,i=e.em,l=e.model,u=l.get("disable");if(!(t.button!==0||!n.getSorter||this.el.draggable||u)){i.refreshCanvas();var c=n.getSorter();c.__currentBlock=l,c.setDragHelper(this.el,t),c.setDropContent(this.model.get("content")),c.startSort(this.el),(0,$t.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,$t.AU)(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,u=e.ppfx,c=e.model,f=c.get("disable"),v=c.get("attributes")||{},g=v.class||"",y="".concat(u,"block"),_=n&&n.t("blockManager.labels.".concat(c.id))||c.get("label"),b=c.get("render"),S=c.get("media"),E=f?"".concat(y,"--disable"):"".concat(u,"four-color-h");l.attr(v),i.className="".concat(g," ").concat(y," ").concat(u,"one-bg ").concat(E).trim(),i.innerHTML=` 212 `.concat(S?'<div class="'.concat(y,'__media">').concat(S,"</div>"):"",` 213 <div class="`).concat(y,'-label">').concat(_,`</div> 214 `),i.title=v.title||((t=i.textContent)===null||t===void 0?void 0:t.trim()),i.setAttribute("draggable","".concat(!!((0,At.hasDnd)(n)&&!f)));var N=b&&b({el:i,model:c,className:y,prefix:u});return N&&(i.innerHTML=N),this},r})(Wt.Ss),q_=$_,Y_=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),X_=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},J_=(function(a){Y_(r,a);function r(t,e,n){var i=a.call(this,t)||this;i.config=e;var l=e.pStylePrefix||"";return i.em=e.em,i.catName=n,i.pfx=l,i.caretR="fa fa-caret-right",i.caretD="fa fa-caret-down",i.iconClass="".concat(l,"caret-icon"),i.activeClass="".concat(l,"open"),i.className="".concat(l).concat(n,"-category"),i.listenTo(i.model,"change:open",i.updateVisibility),i.model.view=i,i}return r.prototype.events=function(){return{"click [data-title]":"toggle"}},r.prototype.template=function(t){var e=t.pfx,n=t.label,i=t.catName;return fr(Ad||(Ad=X_([` 215 <div class="`,`title" data-title> 216 <i class="`,`caret-icon"></i> 217 `,` 218 </div> 219 <div class="`,"",`s-c"></div> 220 `],[` 221 <div class="`,`title" data-title> 222 <i class="`,`caret-icon"></i> 223 `,` 224 </div> 225 <div class="`,"",`s-c"></div> 226 `])),e,e,n,e,i)},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.getTypeEl().style.display=""},r.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getTypeEl().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.getTypeEl=function(){return this.typeEl||(this.typeEl=this.el.querySelector(".".concat(this.pfx).concat(this.catName,"s-c"))),this.typeEl},r.prototype.append=function(t){this.getTypeEl().appendChild(t)},r.prototype.render=function(){var t=this,e=t.em,n=t.el,i=t.$el,l=t.model,u=t.pfx,c=t.catName,f=e.t("".concat(c,"Manager.categories.").concat(l.id))||l.get("label");return n.innerHTML=this.template({pfx:u,label:f,catName:c}),i.addClass(this.className),i.css({order:l.get("order")}),this.updateVisibility(),this},r})(Wt.Ss),dh=J_,Ad,Z_=(function(){var a=function(r,t){return a=Object.
226setPrototypeOf||{__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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),yl=function(){return yl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},yl.apply(this,arguments)},Q_=(function(a){Z_(r,a);function r(t,e){var n=a.call(this,t)||this;n.renderedCategories=new Map,(0,k.bindAll)(n,"getSorter","onDrag","onDrop","onMove"),n.config=e||{},n.categories=t.categories||"";var i=n.config.pStylePrefix||"";n.ppfx=i,n.noCatClass="".concat(i,"blocks-no-cat"),n.blockContClass="".concat(i,"blocks-c"),n.catsClass="".concat(i,"block-categories");var l=n.collection;return n.listenTo(l,"add",n.addTo),n.listenTo(l,"reset",n.render),n.em=n.config.em,n.em&&(n.config.getSorter=n.getSorter),n}return r.prototype.__getModule=function(){return this.em.Blocks},r.prototype.updateConfig=function(t){t===void 0&&(t={}),this.config=yl(yl({},this.config),t)},r.prototype.getSorter=function(){var t=this.em;if(t){if(!this.sorter){var e=t.Utils,n=t.Canvas;this.sorter=new e.Sorter({container:n.getBody(),placer:n.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,onMove:this.onMove,document:n.getFrameEl().contentDocument,direction:"a",wmargin:1,nested:1,em:t,canvasRelative:1})}return this.sorter}},r.prototype.onDrag=function(t){this.em.stopDefault(),this.__getModule().__startDrag(this.sorter.__currentBlock,t)},r.prototype.onMove=function(t){this.__getModule().__drag(t)},r.prototype.onDrop=function(t){this.em.runDefault(),this.__getModule().__endDrag({component:t}),delete this.sorter.__currentBlock},r.prototype.addTo=function(t){this.add(t)},r.prototype.add=function(t,e){var n=this,i=n.config,l=n.renderedCategories,u=t.get("attributes"),c=new q_({model:t,attributes:u},i),f=c.render().el,v=t.parent.initCategory(t);if(v&&this.categories&&!i.ignoreCategories){var g=v.getId(),y=this.getCategoriesEl(),_=l.get(g);!_&&y&&(_=new dh({model:v},i,"block").render(),l.set(g,_),y.appendChild(_.el)),_?.append(f);return}e?e.appendChild(f):this.append(f)},r.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector(".".concat(this.catsClass))),this.catsEl},r.prototype.getBlocksEl=function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.noCatClass," .").concat(this.blockContClass))),this.blocksEl},r.prototype.append=function(t){var e=this.getBlocksEl();e&&e.appendChild(t)},r.prototype.render=function(){var t=this,e=this.ppfx,n=document.createDocumentFragment();delete this.catsEl,delete this.blocksEl,this.renderedCategories=new Map,this.el.innerHTML=` 227 <div class="`.concat(this.catsClass,`"></div> 228 <div class="`).concat(this.noCatClass,`"> 229 <div class="`).concat(this.blockContClass,`"></div> 230 </div> 231 `),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})(Wt.Ss),kd=Q_,tw=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Mi=function(){return Mi=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Mi.apply(this,arguments)},ew=(function(a){tw(r,a);function r(t){var e,n=a.call(this,t,"BlockManager",new Ds(((e=t.config.blockManager)===null||e===void 0?void 0:e.blocks)||[],{em:t}),Ws,B_)||this;return n.events=Ws,n.Block=ch,n.Blocks=Ds,n.Category=Ga,n.Categories=Gs,n.storageKey="",n.blocks=n.all,n.blocksVisible=new Ds(n.blocks.models,{em:t}),n.categories=new Gs([],{em:t,events:{update:Ws.categoryUpdate}}),n.blocks.on("add",function(i){return n.blocksVisible.add(i)}),n.blocks.on("remove",function(i){return n.blocksVisible.remove(i)}),n.blocks.on("reset",function(i){return n.blocksVisible.reset(i.models)}),n.__onAllEvent=(0,k.debounce)(function(){return n.__trgCustom()},0),n}return r.prototype.__trgCustom=function(){this.em.trigger(this.events.custom,this.__customData())},r.prototype.__customData=function(){var t=this,e=this.__getBehaviour();return{bm:this,blocks:this.getAll().models,container:e.container,dragStart:function(n,i){return t.startDrag(n,i)},drag:function(n){return t.__drag(n)},dragStop:function(n){return t.endDrag(n)}}},r.prototype.__startDrag=function(t,e){var n=this,i=n.em,l=n.events,u=n.blocks,c=t.getContent?t.getContent():t;this._dragBlock=t,i.set({dragResult:null,dragContent:c}),[i,u].map(function(f){return f.trigger(l.dragStart,t,e)})},r.prototype.__drag=function(t){var e=this,n=e.em,i=e.events,l=e.blocks,u=this._dragBlock;[n,l].map(function(c){return c.trigger(i.drag,u,t)})},r.prototype.__endDrag=function(t){t===void 0&&(t={});var e=this,n=e.em,i=e.events,l=e.blocks,u=this._dragBlock,c=t.component||n.get("dragResult");if(delete this._dragBlock,c&&u){var f="activeOnRender",v=c.get&&c.get(f),g=u.get("activate")||v,y=u.get("select"),_=(0,k.isArray)(c)?c[0]:c;(y||g&&y!==!1)&&n.setSelected(_),g&&(_.trigger("active"),v&&_.unset(f)),u.get("resetId")&&_.onAll(function(b){return b.resetId()})}n.set({dragResult:null,dragContent:null}),u&&[n,l].map(function(b){return b.trigger(i.dragEnd,c,u)})},r.prototype.__getFrameViews=function(){return this.em.Canvas.getFrames().map(function(t){return t.view}
231).filter(Boolean)},r.prototype.__behaviour=function(t){return t===void 0&&(t={}),this._bhv=Mi(Mi({},this._bhv||{}),t)},r.prototype.__getBehaviour=function(){return this._bhv||{}},r.prototype.startDrag=function(t,e){this.__startDrag(t,e),this.__getFrameViews().forEach(function(n){var i;return(i=n.droppable)===null||i===void 0?void 0:i.startCustom()})},r.prototype.endDrag=function(t){this.__getFrameViews().forEach(function(e){var n;return(n=e.droppable)===null||n===void 0?void 0:n.endCustom(t)}),this.__endDrag()},r.prototype.postRender=function(){var t=this,e=t.categories,n=t.config,i=t.em,l=this.blocksVisible;this.blocksView=new kd({collection:l,categories:e},Mi(Mi({},n),{em:i})),this.__appendTo(l.models),this.__trgCustom()},r.prototype.add=function(t,e,n){n===void 0&&(n={});var i=e||{};return i.id=t,this.blocks.add(i,n)},r.prototype.get=function(t){return this.blocks.get(t)},r.prototype.getAll=function(){return this.blocks},r.prototype.getAllVisible=function(){return this.blocksVisible},r.prototype.remove=function(t,e){return e===void 0&&(e={}),this.__remove(t,e)},r.prototype.getCategories=function(){return this.categories},r.prototype.getContainer=function(){var t;return(t=this.blocksView)===null||t===void 0?void 0:t.el},r.prototype.getDragBlock=function(){return this._dragBlock},r.prototype.getBlocksByCategory=function(t){return Zp(t||this.getAll().models)},r.prototype.render=function(t,e){e===void 0&&(e={});var n=this,i=n.categories,l=n.config,u=n.em,c=t||this.getAll().models;if(e.external){var f=new Ds(c,{em:u});return new kd({collection:f,categories:i},Mi(Mi({em:u},l),e)).render().el}return this.blocksView&&(this.blocksView.updateConfig(e),this.blocksView.collection.reset(c),this.blocksView.rendered||(this.blocksView.render(),this.blocksView.rendered=!0)),this.getContainer()},r.prototype.destroy=function(){var t,e=[this.blocks,this.blocksVisible,this.categories];e.map(function(n){return n.stopListening()}),e.map(function(n){return n.reset()}),(t=this.blocksView)===null||t===void 0||t.remove()},r})(Ri),nw=ew,rw={stylePrefix:"clm-",appendTo:"",selectors:[],states:[{name:"hover"},{name:"active"},{name:"nth-of-type(2n)"}],iconAdd:'<svg viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></svg>',iconSync:'<svg viewBox="0 0 24 24"><path d="M12 18c-3.31 0-6-2.69-6-6 0-1 .25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 0 0 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4m0-11V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0 0 20 12c0-4.42-3.58-8-8-8z"></path></svg>',iconTagOn:'<svg viewBox="0 0 24 24"><path d="M19 19H5V5h10V3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8h-2m-11.09-.92L6.5 11.5 11 16 21 6l-1.41-1.42L11 13.17l-3.09-3.09z"></path></svg>',iconTagOff:'<svg viewBox="0 0 24 24"><path d="M19 3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2m0 2v14H5V5h14z"></path></svg>',iconTagRemove:'<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg>',componentFirst:!1,custom:!1},iw=rw,ow=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ph=(function(a){ow(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return 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})(Wt.Kx),Ru=ph;ph.prototype.idAttribute="name";var aw=(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");a(r,t);function e(){this.constructor=r}
231r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),sw=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},Md="contentEditable",lw=(function(a){aw(r,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 r.prototype.template=function(){var t=this,e=t.pfx,n=t.model,i=t.config,l=n.get("label")||"";return fr(Ld||(Ld=sw([` 232 <span id="`,'checkbox" class="',`tag-status" data-tag-status></span> 233 <span id="`,'tag-label" data-tag-name>',`</span> 234 <span id="`,'close" class="','tag-close" data-tag-remove> $',` </span> 235 `],[` 236 <span id="`,'checkbox" class="',`tag-status" data-tag-status></span> 237 <span id="`,'tag-label" data-tag-name>',`</span> 238 <span id="`,'close" class="','tag-close" data-tag-remove> $',` </span> 239 `])),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[Md]="true",e.focus(),t?.setEditing(!0)},r.prototype.endEditTag=function(){var t=this,e=t.model,n=t.em,i=this.getInputEl(),l=i.textContent||"",u=n?.Selectors;i[Md]="false",n?.setEditing(!1),u&&u.rename(e,l)!==e&&(i.innerText=e.getLabel())},r.prototype.changeStatus=function(){var t=this.model;t.set("active",!t.getActive())},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,u=i.iconTagOff,c=n.find("[data-tag-status]");e.get("active")?(c.html(l),n.removeClass("opac50")):(c.html(u),n.addClass("opac50"))},r.prototype.render=function(){var t=this,e=t.pfx,n=t.ppfx,i=t.$el,l=t.model,u="".concat(e,"tag"),c=["".concat(u," ").concat(n,"three-bg")];return l.get("protected")&&c.push("".concat(u,"-protected")),i.html(this.template()),i.attr("class",c.join(" ")),this.updateStatus(),this},r})(Wt.Ss),uw=lw,Ld,cw=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ta=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},fw=(function(a){cw(r,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;e.module=l,e.em=n,e.componentChanged=(0,k.debounce)(e.componentChanged.bind(e),0),e.checkSync=(0,k.debounce)(e.checkSync.bind(e),0);var u=Vn.I.update,c="".concat(u,":classes"),f="component:toggled ".concat(c),v="".concat(c," ").concat(u,":attributes:id change:state");return e.listenTo(n,f,e.componentChanged),e.listenTo(n,"styleManager:update",e.componentChanged),e.listenTo(n,v,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,k.debounce)(function(){return e.renderStates()},0)),e.delegateEvents(),e}return r.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,i=t.iconSync,l=t.iconAdd,u=t.pfx,c=t.ppfx;return fr(Dd||(Dd=Ta([' <div id="','up" class="',`header"> 240 <div id="`,'label" class="','header-label">',`</div> 241 <div id="`,'status-c" class="',`header-status">
242 <span id="`,`input-c" data-states-c> 243 <div class="`,"field ",`select"> 244 <span id="`,`input-holder"> 245 <select id="`,`states" data-states></select> 246 </span> 247 <div class="`,`sel-arrow"> 248 <div class="`,`d-s-arrow"></div> 249 </div> 250 </div> 251 </span> 252 </div> 253 </div> 254 <div id="`,'tags-field" class="',`field"> 255 <div id="`,`tags-c" data-selectors></div> 256 <input id="`,`new" data-input /> 257 <span id="`,'add-tag" class="',"tags-btn ",'tags-btn__add" data-add> $',` </span> 258 <span class="`,"tags-btn ",'tags-btn__sync" style="display: none" data-sync-style> $',` </span> 259 </div> 260 <div class="`,`sels-info"> 261 <div class="`,'label-sel">',`:</div> 262 <div class="`,`sels" data-selected></div> 263 </div>`],[' <div id="','up" class="',`header"> 264 <div id="`,'label" class="','header-label">',`</div> 265 <div id="`,'status-c" class="',`header-status"> 266 <span id="`,`input-c" data-states-c> 267 <div class="`,"field ",`select"> 268 <span id="`,`input-holder"> 269 <select id="`,`states" data-states></select> 270 </span> 271 <div class="`,`sel-arrow"> 272 <div class="`,`d-s-arrow"></div> 273 </div> 274 </div> 275 </span> 276 </div> 277 </div> 278 <div id="`,'tags-field" class="',`field"> 279 <div id="`,`tags-c" data-selectors></div> 280 <input id="`,`new" data-input /> 281 <span id="`,'add-tag" class="',"tags-btn ",'tags-btn__add" data-add> $',` </span> 282 <span class="`,"tags-btn ",'tags-btn__sync" style="display: none" data-sync-style> $',` </span> 283 </div> 284 <div class="`,`sels-info"> 285 <div class="`,'label-sel">',`:</div> 286 <div class="`,`sels" data-selected></div> 287 </div>`])),u,u,u,u,n,u,u,u,c,c,c,u,c,c,u,c,u,u,u,u,u,l,u,u,i,u,u,e,u)},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=this.em,e=this.getTarget(),n=t.Css,i={noDisabled:1},l=this.getCommonSelectors({opts:i}),u=t.get("state"),c=t.getCurrentMedia(),f=[],v=n.get(l,u,c)||n.add(l,u,c),g;this.getTargets().forEach(function(y){var _=n.getIdRule(y.getId(),{state:u,mediaText:c});g=_.getStyle(),_.setStyle({}),f.push(_)}),g&&v.addStyle(g),t.trigger("component:toggled"),t.trigger("component:sync-style",{component:e,selectors:l,mediaText:c,rule:v,ruleComponents:f,state:u})},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,n=e.targets;this.updateSelection(n)},r.prototype.updateSelection=function(t){var e=t||this.getTargets();e=(0,k.isArray)(e)?e:[e];var n=[];return 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,u=n||this.getTargets();return this.module.__getCommonSelectors(u,l)},r.prototype._commonSelectors=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.module).__common.apply(t,e)},r.prototype.checkSync=function(){var t=this,e=t.$btnSyncEl,n=t.config,i=t.collection,l=this.getTarget(),u;if(l&&n.componentFirst&&i.length){var c=l.getStyle();u=!(0,k.isEmpty)(c)}e&&e[u?"show":"hide"]()},r.prototype.getTarget=function(){return this.target.getSelected()},r.prototype.getTargets=function(){return this.target.getSelectedAll()},r.prototype.updateStateVis=function(t){var e=this.em,n=e&&e.getConfig().avoidInlineStyle,i=this.collection.length||n?"":"none";
287this.getStatesC().css("display",i),this.updateSelector(t)},r.prototype.__handleStateChange=function(){this.updateSelector(this.getTargets())},r.prototype.updateSelector=function(t){var e=this,n=this.el.querySelector("[data-selected]"),i=[],l=t||this.getTargets();l=(0,k.isArray)(l)?l:[l],l.forEach(function(u){return i.push(e.__getName(u))}),n&&(n.innerHTML=i.join(", ")),this.checkStates()},r.prototype.__getName=function(t){var e=this,n=e.pfx,i=e.config,l=e.em,u=i.selectedName,c=i.componentFirst,f;if((0,k.isString)(t))f=fr(jd||(jd=Ta(['<span class="','sel-gen">',"</span>"],['<span class="','sel-gen">',"</span>"])),n,t);else{var v=t?.getSelectors();if(!v)return"";var g=v.getStyleable(),y=l.get("state"),_=t.getId?fr(Id||(Id=Ta(['<span class="','sel-cmp">',`</span> 288 <span class="`,'sel-id">#',"</span>"],['<span class="','sel-cmp">',`</span> 289 <span class="`,'sel-id">#',"</span>"])),n,t.getName(),n,t.getId()):"";f=this.collection.getFullString(g),f=f?fr(Rd||(Rd=Ta(['<span class="','sel-rule">',"</span>"],['<span class="','sel-rule">',"</span>"])),n,f):t.get("selectorsAdd")||_,f=c&&_?_:f,f+=y?fr(Nd||(Nd=Ta(['<span class="','sel-state">:',"</span>"],['<span class="','sel-state">:',"</span>"])),n,y):"",f=u?u({result:f,state:y,target:t}):f}return f&&'<span class="'.concat(n,'sel">').concat(f,"</span>")},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 uw({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,e=t.module,n=t.em,i=n.t("selectorManager.emptyState"),l=e.getStates().map(function(c){var f=n.t("selectorManager.states.".concat(c.id))||c.getLabel()||c.id;return'<option value="'.concat(c.id,'">').concat(f,"</option>")}).join(""),u=this.getStates();u&&u.html('<option value="">'.concat(i,"</option>").concat(l)),this.checkStates()},r.prototype.render=function(){var t=this,e=t.em,n=t.pfx,i=t.ppfx,l=t.config,u=t.$el,c=t.el,f=l.render,v=l.iconSync,g=l.iconAdd,y={iconSync:v,iconAdd:g,labelHead:e.t("selectorManager.label"),labelInfo:e.t("selectorManager.selected"),ppfx:i,pfx:n,el:c};u.html(this.template(y));var _=f&&f(y);return _&&_!==c&&u.empty().append(_),this.$input=u.find("[data-input]"),this.$addBtn=u.find("[data-add]"),this.$classes=u.find("#"+n+"tags-c"),this.$btnSyncEl=u.find("[data-sync-style]"),this.$input.hide(),this.renderStates(),this.renderClasses(),u.attr("class","".concat(this.className," ").concat(i,"one-bg ").concat(i,"two-color")),this},r})(Wt.Ss),dw=fw,Dd,jd,Id,Rd,Nd,pw=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Na=function(){return Na=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Na.apply(this,arguments)},Nu=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Fd=function(a){return(0,k.isString)(a)&&a[0]=="#"},Vd=function(a){return(0,k.isString)(a)&&a[0]=="."},hh="selector",$a="".concat(hh,":"),hw="".concat($a,"add"),vw="".concat($a,"update"),vh="".concat($a,"remove"),gw="".concat(vh,":before"),yw="".concat($a,"custom"),gh="".concat($a,"state"),mw={all:hh,update:vw,add:hw,remove:vh,removeBefore:gw,state:gh,custom:yw},_w=(function(a){pw(r,a);function r(t){var e=a.call(this,t,"SelectorManager",new ji([]),mw,iw,{skipListen:!0})||this;e.Selector=Jn,e.Selectors=ji,e.storageKey="",(0,k.bindAll)(e,"__updateSelectedByComponents");var n=e.config,i=n.pStylePrefix;i&&(n.stylePrefix=i+n.stylePrefix),e.all=new ji(n.selectors),e.selected=new ji([],{em:t,config:n}),e.states=new Wt.pM(n.states.map(function(c){return new Ru(c)}),{model:Ru}),e.model=new Wt.Kx({cFirst:n.componentFirst,_undo:!0}),e.__update=(0,k.debounce)(function(){return e.__trgCustom()},0),e.__initListen({collections:[e.states,e.selected],propagate:[{entity:e.states,event:e.events.state}]}),t.on("change:state",function(c,f){return t.trigger(gh,f)}),e.model.on("change:cFirst",function(c,f){return t.trigger("selector:type",f)});var l="".concat(Vn.I.update,":classes");t.on("component:toggled ".concat(l),e.__updateSelectedByComponents);var u="component:toggled ".concat(l," change:device styleManager:update selector:state selector:type style:target");return e.model.listenTo(t,u,function(){return e.__update()}),e}return r.prototype.__trgCustom=function(t){this.em.trigger(this.events.custom,this.__customData(t))},r.prototype.getAll=function(t){return t===void 0&&(t={}),this.all?t.array?Nu([],this.all.models,!0):this.all:[]},r.prototype.__customData=function(t){return t===void 0&&(t={}),this.__ctn=this.__ctn||t.container,{states:this.getStates(),selected:this.getSelected(),container:this.__ctn}},r.prototype.postRender=function(){this.__appendTo(),this.__trgCustom()},r.prototype.select=function(t,e){e===void 0&&(e={});var n=Array.isArray(t)?t:[t],i=this.em.Styles.select(n,e);this.selected.reset(this.__getCommonSelectors(i));var l=this.selectorTags,u=i.filter(function(c){return c}).map(function(c){return(0,At.isComponent)(c)||(0,At.isRule)(c)&&!c.get("selectorsAdd")?c:c.getSelectorsString()});return l&&l.componentChanged({targets:u}),this},r.prototype.addSelector=function(t,e,n){e===void 0&&(e={}),n===void 0&&(n={});var i=Na({},e);(0,k.isObject)(t)?i=t:i.name=t,Fd(i.name)?(i.name=i.name.substr(1),i.type=Jn.TYPE_ID):Vd(i.name)&&(i.name=i.name.substr(1)),i.label&&!i.name&&(i.name=this.escapeName(i.label));var l=i.name,u=this.getConfig(),c=this,f=c.all,v=c.em,g=l?this.get(l,i.type):f.where(i)[0];if(!g){var y=i instanceof Jn?i:new Jn(i,Na(Na({}
289,n),{config:u,em:v}));return f.add(y,n)}return g},r.prototype.getSelector=function(t,e){return e===void 0&&(e=Jn.TYPE_CLASS),Fd(t)?(t=t.substr(1),e=Jn.TYPE_ID):Vd(t)&&(t=t.substr(1)),this.all.where({name:t,type:e})[0]},r.prototype.add=function(t,e){var n=this;e===void 0&&(e={});var i=(0,k.isString)(t)?{}:e;return(0,k.isArray)(t)?t.map(function(l){return n.addSelector(l,e,i)}):this.addSelector(t,e,i)},r.prototype.addClass=function(t){var e=this,n=[];return(0,k.isString)(t)&&(t=t.trim().split(" ")),t.forEach(function(i){return n.push(e.addSelector(i))}),n},r.prototype.get=function(t,e){var n=this;if((0,k.isArray)(t)){var i=[],l=t.map(function(u){return n.getSelector(u)}).filter(Boolean);return l.forEach(function(u){return i.indexOf(u)<0&&i.push(u)}),i}else return this.getSelector(t,e)},r.prototype.remove=function(t,e){return this.__remove(t,e)},r.prototype.rename=function(t,e,n){var i=this.escapeName(e),l=this.get(i);return l||t.set({name:i,label:e},n)},r.prototype.setState=function(t){return this.em.setState(t),this},r.prototype.getState=function(){return this.em.getState()},r.prototype.getStates=function(){return Nu([],this.states.models,!0)},r.prototype.setStates=function(t,e){return this.states.reset(t.map(function(n){return new Ru(n)}),e)},r.prototype.getSelected=function(){return this.__getCommon()},r.prototype.getSelectedAll=function(){return Nu([],this.selected.models,!0)},r.prototype.addSelected=function(t){var e=this.add(t);this.em.getSelectedAll().forEach(function(n){n.getSelectors().add(e)})},r.prototype.removeSelected=function(t){this.em.getSelectedAll().forEach(function(e){!t.get("protected")&&e&&e.getSelectors().remove(t)})},r.prototype.duplicateSelected=function(t,e){var n=this;e===void 0&&(e={});var i=this.em,l=this.getSelected();if(!(l.indexOf(t)<0)){var u=this.getState(),c=i.getCurrentMedia(),f=i.Css.get(l,u,c),v=f?.getStyle();if(i.getSelectedAll().forEach(function(y){var _=y.getSelectors();if(_.includes(t)){var b=e.suffix||" copy",S=t.getLabel(),E=n.addSelector("".concat(S).concat(b)),N=_.indexOf(t);_.remove(t),_.add(E,{at:N})}}),v){var g=i.Css.add(this.getSelected(),u,c);g.setStyle(v)}}},r.prototype.getSelectedTargets=function(){return this.em.Styles.getSelectedAll()},r.prototype.setComponentFirst=function(t){this.getConfig().componentFirst=t,this.model.set({cFirst:t})},r.prototype.getComponentFirst=function(){return this.getConfig().componentFirst},r.prototype.escapeName=function(t){var e=this.getConfig().escapeName;return e?e(t):Jn.escapeName(t)},r.prototype.render=function(t){var e=this.selectorTags,n=this.getConfig(),i=e?.el;return this.selected.reset(t),this.selectorTags=new dw({el:i,collection:this.selected,module:this,config:n}),this.selectorTags.render().el},r.prototype.destroy=function(){var t=this,e=t.selectorTags,n=t.model;n.stopListening(),this.__update.cancel(),this.__destroy(),e?.remove(),this.selectorTags=void 0},r.prototype.__getCommon=function(){return this.__getCommonSelectors(this.em.getSelectedAll())},r.prototype.__getCommonSelectors=function(t,e){e===void 0&&(e={});var n=t.map(function(i){return i.getSelectors&&i.getSelectors().getValid(e)}).filter(Boolean);return this.__common.apply(this,n)},r.prototype.__common=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.length?e.length===1?e[0]:e.length===2?e[0].filter(function(i){return e[1].indexOf(i)>=0}):e.slice(1).reduce(function(i,l){return t.__common(i,l)},e[0]):[]},r.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},r})(Ri),ww=_w,bw={textTags:["br","b","i","u","a","ul","ol"],textTypes:["text","textnode","comment"],parserCss:void 0,parserHtml:void 0,optionsHtml:{htmlType:"text/html",allowScripts:!1,allowUnsafeAttr:!1,allowUnsafeAttrValue:!1,keepEmptyTextNodes:!1}},xw=bw,Br,Cr={STYLE_RULE:1,CHARSET_RULE:2,IMPORT_RULE:3,MEDIA_RULE:4,FONT_FACE_RULE:5,PAGE_RULE:6,KEYFRAMES_RULE:7,KEYFRAME_RULE:8,NAMESPACE_RULE:10,COUNTER_STYLE_RULE:11,SUPPORTS_RULE:12,DOCUMENT_RULE:13,FONT_FEATURE_VALUES_RULE:14,VIEWPORT_RULE:15,REGION_STYLE_RULE:16},zo=(Br={},Br[Cr.MEDIA_RULE]="media",Br[Cr.FONT_FACE_RULE]="font-face",Br[Cr.PAGE_RULE]="page",Br[Cr.KEYFRAMES_RULE]="keyframes",Br[Cr.COUNTER_STYLE_RULE]="counter-style",Br[Cr.SUPPORTS_RULE]="supports",Br[Cr.DOCUMENT_RULE]="document",Br[Cr.FONT_FEATURE_VALUES_RULE]="font-feature-values",Br[Cr.VIEWPORT_RULE]="viewport",Br),yh=(0,k.
289keys)(zo),kc=[Cr.FONT_FACE_RULE,Cr.PAGE_RULE,Cr.COUNTER_STYLE_RULE,Cr.VIEWPORT_RULE],Cw=yh.filter(function(a){return kc.indexOf(Number(a))<0}).map(function(a){return zo[a]}).concat(["container","layer"]),Sw=kc.map(function(a){return zo[a]}),mh=function(a){a===void 0&&(a="");for(var r=[],t=[],e=a.split(","),n=0,i=e.length;n<i;n++){var l=e[n].trim();if(/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(l)||/^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(l)){var u=l.split(".").filter(Boolean);t.push(u)}else r.push(l)}return{result:t,add:r}},Ow=function(a){for(var r=a.style,t={},e=0,n=r.length;e<n;e++){var i=r[e],l=r.getPropertyValue(i),u=r.getPropertyPriority(i);t[i]="".concat(l).concat(u?" !".concat(u):"")}return t},Hd=function(a){var r=a.conditionText||a.media&&a.media.mediaText||a.name||a.selectorText||"";return r.trim()},lc=function(a,r,t){r===void 0&&(r={}),t===void 0&&(t={});var e={},n=a.length,i=a[n-1],l=i?i.split(/:(.+)/):[],u=l[1],c=t.atRule,f=t.selectorsAdd,v=t.mediaText,g=Sw.indexOf(c)>=0;return g&&(e.singleAtRule=!0),c&&(e.atRuleType=c),f&&(e.selectorsAdd=f),v&&(e.mediaText=v),u&&(a[n-1]=l[0],e.state=u,l.splice(l.length-1,1)),e.selectors=a,e.style=r,e},Ud=function(a){var r=a.cssText,t=r===void 0?"":r;return Cw.find(function(e){return t.indexOf("@".concat(e))===0})},_h=function(a){for(var r=[],t=a.cssRules||[],e=0,n=t.length;e<n;e++){var i=t[e],l=i.type,u=!1,c="",f="",v=i.selectorText||i.keyText||"",g=kc.indexOf(l)>=0;if(g)u=!0,c=zo[l],f=Hd(i);else if(yh.indexOf("".concat(l))>=0||!l&&Ud(i)){var y=_h(i),_=zo[l]||Ud(i);f=Hd(i);for(var b=0,S=y.length;b<S;b++){var E=y[b];f&&(E.mediaText=f),E.atRuleType=_}r=r.concat(y)}if(!(!v&&!g)){for(var N=Ow(i),z=mh(v),R=z.add,W=z.result,ct=void 0,_t=0,xt=W.length;_t<xt;_t++){var ut=lc(W[_t],N,{atRule:zo[l]});r.push(ut),ct=ut}if(R.length){var q=R.join(", ");if(ct)ct.selectorsAdd=q;else{var ut={selectors:[],selectorsAdd:q,style:N};u&&(ut.singleAtRule=u),c&&(ut.atRuleType=c),f&&(ut.mediaText=f),r.push(ut)}}}}return r},Tw=function(a){var r=document.createElement("style");r.innerHTML=a,document.head.appendChild(r);var t=r.sheet;return document.head.removeChild(r),t?_h(t):[]},Ew=function(a,r){return r===void 0&&(r={}),{parse:function(t){var e=this,n=[],i=r.parserCss,l=a?.Editor,u=i?i(t,l):Tw(t);return u.forEach(function(c){return n=n.concat(e.checkNode(c))}),a?.trigger("parse:css",{input:t,output:n,nodes:u}),n},checkNode:function(t){var e=t.selectors,n=t.style,i=[t];if((0,k.isString)(e)){var l=[],u=t,c=mh(e),f=c.result,v=c.add.join(", "),g={atRule:u.atRule,mediaText:u.params};if(f.length?f.forEach(function(_){l.push(lc(_,n,g))}):l.push(lc([],n,g)),v){var y=l[l.length-1];y.selectorsAdd=v}i=l}return i}}},Pw=Ew,Aw=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),kw=(function(a){Aw(r,a);function r(t){var e=a.call(this,t,"Parser",xw)||this,n=e.config;return e.parserCss=Pw(t,n),e.parserHtml=zp(t,n),e}return r.prototype.parseHtml=function(t,e){e===void 0&&(e={});var n=this,i=n.em,l=n.parserHtml;return l.compTypes=i.Components.getTypes()||[],l.parse(t,this.parserCss,e)},r.prototype.parseCss=function(t){return this.parserCss.parse(t)},r.prototype.destroy=function(){},r})(pr),Mw=kw,Lw={id:"gjs-",type:"local",autosave:!0,autoload:!0,stepsBeforeSave:1,recovery:!1,onStore:function(a){return a},onLoad:function(a){return a},options:{local:{key:"gjsProject",checkLocal:!0},remote:{headers:{},urlStore:"",urlLoad:"",contentTypeJson:!0,fetchOptions:"",credentials:"include",onStore:function(a){return a},onLoad:function(a){return a}}}},Dw=Lw,Bd=function(a,r,t,e){function n(i){return i instanceof t?i:new t(function(l){l(i)})}return new(t||(t=Promise))(function(i,l){function u(v){try{f(e.next(v))}catch(g){l(g)}}function c(v){try{f(e.throw(v))}catch(g){l(g)}}function f(v){v.done?i(v.value):n(v.value).then(u,c)}f((e=e.apply(a,r||[])).next())})},Wd=function(a,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,n,i,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(f){return function(v){return c([f,v])}}function c(f){if(e)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(t=0)),t;)try{if(e=1,n&&(i=f[0]&2?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,n=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=r.call(a,t)}catch(v){f=[6,v],n=0}finally{e=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},jw=(function(){function a(){}return a.prototype.store=function(r){return Bd(this,arguments,void 0,function(t,e){return e===void 0&&(e={}),Wd(this,function(n){return this.hasLocal(e,!0)&&localStorage.setItem(e.key,JSON.stringify(t)),[2,t]})})},a.prototype.load=function(){return Bd(this,arguments,void 0,function(r){var t;return r===void 0&&(r={}),Wd(this,function(e){return t={},this.hasLocal(r,!0)&&(t=JSON.parse(localStorage.getItem(r.key)||"{}")),[2,t]})})},a.prototype.hasLocal=function(r,t){if(r===void 0&&(r={}),r.checkLocal&&(!(0,At.hasWin)()||!localStorage)){if(t)throw new Error("localStorage not available");return!1}return!0},a})(),Iw=jw;function za(a){"@babel/helpers - typeof";return za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},za(a)}function Rw(a){var r=this.constructor;return this.then(function(t){return r.resolve(a()).then(function(){return t})},function(t){return r.resolve(a()).then(function(){return r.reject(t)})})}var Nw=Rw,Fw=setTimeout;function wh(a){return!!(a&&typeof a.length<"u")}function Vw(){}function Hw(a,r){return function(){a.apply(r,arguments)}}function un(a){if(!(this instanceof un))throw new TypeError("Promises must be constructed via new");if(typeof a!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],xh(a,this)}function bh(a,r){for(;a._state===3;)a=a._value;if(a._state===0){a._deferreds.push(r);return}a._handled=!0,un._immediateFn(function(){var t=a._state===1?r.onFulfilled:r.onRejected;if(t===null){(a._state===1?uc:Ka)(r.promise,a._value);return}var e;try{e=t(a._value)}catch(n){Ka(r.promise,n);return}uc(r.promise,e)})}function uc(a,r){try{if(r===a)throw new TypeError("A promise cannot be resolved with itself.");if(r&&(za(r)==="object"||typeof r=="function")){var t=r.then;if(r instanceof un){a._state=3,a._value=r,cc(a);return}else if(typeof t=="function"){xh(Hw(t,r),a);return}}a._state=1,a._value=r,cc(a)}catch(e){Ka(a,e)}}function Ka(a,r){a._state=2,a._value=r,cc(a)}function cc(a){a._state===2&&a._deferreds.length===0&&un._immediateFn(function(){a._handled||un._unhandledRejectionFn(a._value)});for(var r=0,t=a._deferreds.length;r<t;r++)bh(a,a._deferreds[r]);a._deferreds=null}function Uw(a,r,t){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof r=="function"?r:null,this.promise=t}function xh(a,r){var t=!1;try{a(function(e){t||(t=!0,uc(r,e))},function(e){t||(t=!0,Ka(r,e))})}catch(e){if(t)return;t=!0,Ka(r,e)}}un.prototype.catch=function(a){return this.then(null,a)};un.prototype.then=function(a,r){var t=new this.constructor(Vw);return bh(this,new Uw(a,r,t)),t};un.prototype.finally=Nw;un.all=function(a){return new un(function(r,t){if(!wh(a))return t(new TypeError("Promise.all accepts an array"));var e=Array.prototype.slice.call(a);if(e.length===0)return r([]);var n=e.length;function i(u,c){try{if(c&&(za(c)==="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(v){i(u,v)},t);return}}e[u]=c,--n===0&&r(e)}catch(v){t(v)}}for(var l=0;l<e.length;l++)i(l,e[l])})};un.resolve=function(a){return a&&za(a)==="object"&&a.constructor===un?a:new un(function(r){r(a)})};un.reject=function(a){return new un(function(r,t){t(a)})};un.race=function(a){return new un(function(r,t){if(!wh(a))return t(new TypeError("Promise.race accepts an array"));for(var e=0,n=a.length;e<n;e++)un.resolve(a[e]).then(r,t)})};un._immediateFn=typeof setImmediate=="function"&&function(a){setImmediate(a)}||function(a){Fw(a,0)};un._unhandledRejectionFn=function(r){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",r)};var fc=un;(0,At.hasWin)()&&(window.Promise=window.Promise||fc);var Ch=typeof fetch=="function"?fetch.bind():function(a,r){return new fc(function(t,e){var n=new XMLHttpRequest;n.open(r.method||"get",a),n.withCredentials=r.credentials=="include";for(var i in r.headers||{})n.setRequestHeader(i,r.headers[i]);n.onload=function(l){return t({status:n.status,statusText:n.statusText,text:function(){return fc.resolve(n.responseText)}})},n.onerror=e,n.upload&&r.onProgress&&(n.upload.onprogress=r.onProgress),r.body?n.send(r.body):n.send()})},ml=function(){return ml=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];
289for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},ml.apply(this,arguments)},zd=function(a,r,t,e){function n(i){return i instanceof t?i:new t(function(l){l(i)})}return new(t||(t=Promise))(function(i,l){function u(v){try{f(e.next(v))}catch(g){l(g)}}function c(v){try{f(e.throw(v))}catch(g){l(g)}}function f(v){v.done?i(v.value):n(v.value).then(u,c)}f((e=e.apply(a,r||[])).next())})},Kd=function(a,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,n,i,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(f){return function(v){return c([f,v])}}function c(f){if(e)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(t=0)),t;)try{if(e=1,n&&(i=f[0]&2?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,n=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=r.call(a,t)}catch(v){f=[6,v],n=0}finally{e=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},Bw=(function(){function a(){}return a.prototype.store=function(r){return zd(this,arguments,void 0,function(t,e){return e===void 0&&(e={}),Kd(this,function(n){switch(n.label){case 0:return[4,this.request(e.urlStore,this.__props(e,t),e)];case 1:return[2,n.sent()]}})})},a.prototype.load=function(){return zd(this,arguments,void 0,function(r){return r===void 0&&(r={}),Kd(this,function(t){switch(t.label){case 0:return[4,this.request(r.urlLoad,this.__props(r),r)];case 1:return[2,t.sent()]}})})},a.prototype.request=function(r,t,e){return t===void 0&&(t={}),e===void 0&&(e={}),Ch(r,t).then(function(n){var i=n.text(),l=(n.status/200|0)===1;return l?i:i.then(Promise.reject)}).then(function(n){var i=n&&(0,k.isString)(n);return e.contentTypeJson&&i?JSON.parse(n):n})},a.prototype.__props=function(r,t){r===void 0&&(r={});var e=r.contentTypeJson,n=r.headers||{},i=r.fetchOptions||{},l="X-Requested-With",u="Content-Type",c;if((0,k.isUndefined)(n[l])&&(n[l]="XMLHttpRequest"),(0,k.isUndefined)(n[u])&&e&&(n[u]="application/json; charset=utf-8"),t)if(e)c=JSON.stringify(t);else{c=new FormData;for(var f in t)c.append(f,t[f])}var v={method:c?"POST":"GET",credentials:r.credentials,headers:n,body:c};return ml(ml({},v),(0,k.isFunction)(i)?i(v):i)},a})(),Ww=Bw,Sh=(function(a){return a.start="storage:start",a.startStore="storage:start:store",a.startLoad="storage:start:load",a.load="storage:load",a.store="storage:store",a.after="storage:after",a.afterStore="storage:after:store",a.afterLoad="storage:after:load",a.end="storage:end",a.endStore="storage:end:store",a.endLoad="storage:end:load",a.error="storage:error",a.errorStore="storage:error:store",a.errorLoad="storage:error:load",a})(Sh||{}),qn=Sh,zw=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),No=function(){return No=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},No.apply(this,arguments)},Fu=function(a,r,t,e){function n(i){return i instanceof t?i:new t(function(l){l(i)})}return new(t||(t=Promise))(function(i,l){function u(v){try{f(e.next(v))}catch(g){l(g)}}function c(v){try{f(e.throw(v))}catch(g){l(g)}}function f(v){v.done?i(v.value):n(v.value).then(u,c)}f((e=e.apply(a,r||[])).next())})},Vu=function(a,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,n,i,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(f){return function(v){return c([f,v])}}function c(f){if(e)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(t=0)),t;)try{if(e=1,n&&(i=f[0]&2?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,n=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=r.call(a,t)}catch(v){f=[6,v],n=0}finally{e=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},js="local",Gd="remote",Kw=(function(a){zw(r,a);function r(t){var e=a.call(this,t,"StorageManager",Dw)||this;e.storages={},e.events=qn;var n=e.config;return n._disable&&(n.type=void 0),e.storages={},e.add(js,new Iw),e.add(Gd,new Ww),e.setCurrent(n.type),e}return r.prototype.isAutosave=function(){return!!this.config.autosave},r.prototype.setAutosave=function(t){return this.config.autosave=!!t,this},r.prototype.getStepsBeforeSave=function(){return this.config.stepsBeforeSave},r.prototype.setStepsBeforeSave=function(t){return this.config.stepsBeforeSave=t,this},r.prototype.add=function(t,e){return this.storages[t]=e,this},r.prototype.get=function(t){return this.storages[t]},r.prototype.getStorages=function(){return this.storages},r.prototype.getCurrent=function(){return this.config.currentStorage},r.prototype.setCurrent=function(t){return this.getConfig().currentStorage=t,this},r.prototype.getCurrentStorage=function(){return this.get(this.getCurrent())},r.prototype.getStorageOptions=function(t){return this.getCurrentOptions(t)},r.prototype.store=function(t){return Fu(this,arguments,void 0,function(e,n){var i,l,u,c,f,v;return n===void 0&&(n={}),Vu(this,function(g){switch(g.label){case 0:i=this.getCurrentStorage(),l=No(No({},this.getCurrentOptions()),n),u=this.getRecoveryStorage(),c=this.getCurrentOptions(js),g.label=1;case 1:return g.trys.push([1,5,,9]),[4,this.__exec(i,l,e)];case 2:return g.sent(),f=u,f?[4,this.__exec(u,c,{})]:[3,4];case 3:f=g.sent(),g.label=4;case 4:return[3,9];case 5:return v=g.sent(),u?[4,this.__exec(u,c,e)]:[3,7];case 6:return g.sent(),[3,8];case 7:throw v;case 8:return[3,9];case 9:return[2,e]}})})},r.prototype.load=function(){return Fu(this,arguments,void 0,function(t){var e,n,i,l,u,c;return t===void 0&&(t={}),Vu(this,function(f){switch(f.label){case 0:return e=this.getCurrentStorage(),n=No(No({},this.getCurrentOptions()),t),i=this.getRecoveryStorage(),i?[4,this.__exec(i,this.getCurrentOptions(js))]:[3,5];case 1:if(u=f.sent(),(0,k.isEmpty)(u))return[3,5];f.label=2;case 2:return f.trys.push([2,4,,5]),[4,this.__askRecovery()];case 3:return f.sent(),l=u,[3,5];case 4:return c=f.sent(),[3,5];case 5:return l?[3,7]:[4,this.__exec(e,n)];case 6:l=f.sent(),f.label=7;case 7:return[2,l||{}]}})})},r.prototype.__askRecovery=function(){var t=this.em,e=this.getRecovery();return new Promise(function(n,i){(0,k.isFunction)(e)?e(n,i,t?.getEditor()):confirm(t?.t("storageManager.recover"))?n(null):i()})},r.prototype.getRecovery=function(){return this.config.recovery},r.prototype.getRecoveryStorage=function(){var t=this.getRecovery();return t&&this.getCurrent()===Gd&&this.get(js)},r.prototype.__exec=function(t,e,n){return Fu(this,void 0,void 0,function(){var i,l,u,c,f,v,g,y,_,b,S,E,N,z;return Vu(this,function(R){switch(R.label){case 0:if(i=n?"store":"load",l=this.getConfig(),u=l.onStore,c=l.onLoad,!t)return[2,n||{}];this.onStart(i,n),R.label=1;case 1:return R.trys.push([1,14,,15]),v=(z=this.em)===null||z===void 0?void 0:z.getEditor(),g=void 0,n?(_=u,_?[4,u(n,v)]:[3,3]):[3,7];case 2:_=R.sent(),R.label=3;case 3:return y=_||n,b=e.onStore,b?[4,e.onStore(y,v)]:[3,5];case 4:b=R.sent(),R.label=5;case 5:return y=b||y,[4,t.store(y,e)];case 6:return g=R.sent(),f=n,[3,13];case 7:return[4,t.load(e)];case 8:return g=R.sent(),f=this.__clearKeys(g),S=e.onLoad,S?[4,e.onLoad(f,v)]:[3,10];case 9:S=R.sent(),R.label=10;case 10:return f=S||f,E=c,E?[4,c(f,v)]:[3,12];case 11:E=R.sent(),R.label=12;case 12:f=E||f,R.label=13;case 13:return this.onAfter(i,f,g),this.onEnd(i,f,g),[3,15];case 14:throw N=R.sent(),this.onError(i,N),N;case 15:return[2,f]}})})},r.prototype.__clearKeys=function(t){t===void 0&&(t={});var e=this.getConfig(),n=new RegExp("^".concat(e.id)),i={};for(var l in t){var u=l.replace(n,"");i[u]=t[l]}return i},r.prototype.getCurrentOptions=function(t){var e=this.getConfig(),n=t||this.getCurrent();return e.options[n]||{}},r.prototype.onStart=function(t,e){var n=this.em;if(n){var i=t==="load"?qn.startLoad:qn.startStore;n.trigger(qn.start,t,e),n.trigger(i,e)}},r.prototype.onAfter=function(t,e,n){var i=this.em;if(i){var l=t==="load"?qn.afterLoad:qn.afterStore;i.trigger(qn.after),i.trigger(l,e,n);var u=t==="load"?qn.load:qn.store;i.trigger(u,e,n)}},r.prototype.onEnd=function(t,e,n){var i=this.em;if(i){var l=t==="load"?qn.endLoad:qn.endStore;i.trigger(qn.end,t,e,n),i.trigger(l,e,n)}},r.prototype.onError=function(t,e){var n=this.em;if(n){var i=t==="load"?qn.errorLoad:qn.errorStore;n.trigger(qn.error,e,t),n.trigger(i,e),this.onEnd(t,e)}},r.prototype.canAutoload=function(){var t=this.getCurrentStorage();return!!t&&!!this.config.autoload},r.prototype.destroy=function(){this.storages={}},r})(pr),Gw=Kw,$w={stylePrefix:"trt-",appendTo:"",optionsTarget:[{value:!1},{value:"_blank"}],custom:!1}
289,qw=$w,Yw=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Fa=function(){return Fa=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Fa.apply(this,arguments)},Oh=(function(a){Yw(r,a);function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;e.events={},e.appendInput=!0;var n=t.config,i=n===void 0?{}:n,l=e,u=l.model,c=l.eventCapture,f=u.target,v=u.attributes.type;e.config=i,e.em=i.em,e.pfx=i.stylePrefix||"",e.ppfx=i.pStylePrefix||"",e.target=f,e.className=e.pfx+"trait",e.clsField="".concat(e.ppfx,"field ").concat(e.ppfx,"field-").concat(v);var g=[["change:value",e.onValueChange],["remove",e.removeView]];return g.forEach(function(y){var _=y[0],b=y[1];u.off(_,b),e.listenTo(u,_,b)}),u.view=e,e.listenTo(u,"change:label",e.render),e.listenTo(u,"change:placeholder",e.rerender),e.events={},c.forEach(function(y){return e.events[y]="onChange"}),e.delegateEvents(),e.init(),e}return r.prototype.attributes=function(){return this.model.get("attributes")||{}},r.prototype.templateLabel=function(t){var e=this.ppfx,n=this.getLabel();return'<div class="'.concat(e,'label" title="').concat(n,'">').concat(n,"</div>")},r.prototype.templateInput=function(t){var e=this.clsField;return'<div class="'.concat(e,'" data-input></div>')},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,k.isUndefined)(e.value)&&this.model.set("value",e.value),this.onEvent(Fa(Fa({},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,e=t.$el,n=t.target,i=this.getLabel(),l=this.templateLabel(n);this.createLabel&&(l=this.createLabel({label:i,component:n,trait:this})||""),e.find("[data-label]").append(l)},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,At.capitalize)(n||i).replace(/-/g," ")},r.prototype.getComponent=function(){return this.target},r.prototype.getInputEl=function(){if(!this.$input){var t=this,e=t.em,n=t.model,i=n,l=n.attributes.name,u=i.get("placeholder")||i.get("default")||"",c=i.get("type")||"text",f=i.get("min"),v=i.get("max"),g=this.getModelValue(),y=(0,Je.default)('<input type="'.concat(c,'">')),_=e.t("traitManager.traits.attributes.".concat(l))||{};y.attr(Fa({placeholder:u},_)),(0,k.isUndefined)(g)||(i.set({value:g},{silent:!0}),y.prop("value",g)),f&&y.prop("min",f),v&&y.prop("max",v),this.$input=y}return this.$input.get(0)},r.prototype.getInputElem=function(){var t=this,e=t.input,n=t.$input;return e||n&&n.get&&n.get(0)||this.getElInput()},r.prototype.getModelValue=function(){return this.model.getValue()},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]"),u=l[l.length-1],c=i.el;c||(c=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,k.isString)(c)?(u.innerHTML=c,this.elInput=u.firstChild):(n?u.appendChild(c):u.insertBefore(c,u.firstChild),this.elInput=c),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,u=l.attributes,c=u.type,f=u.id,v=this.hasLabel&&this.hasLabel(),g="".concat(n,"trait");delete this.$input;var y='<div class="'.concat(g," ").concat(g,"--").concat(c,`"> 290 `).concat(v?'<div class="'.concat(i,'label-wrp" data-label></div>'):"",` 291 <div class="`).concat(i,"field-wrp ").concat(i,"field-wrp--").concat(c,`" data-input> 292 `).concat(this.templateInput?(0,k.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:"",` 293 </div> 294 </div>`);return e.empty().append(y),v&&this.renderLabel(),this.renderField(),this.el.className="".concat(g,"__wrp ").concat(g,"__wrp-").concat(f),this.postUpdate(),this.onRender(this.getClbOpts()),this},r})(Wt.Ss),li=Oh;Oh.prototype.eventCapture=["change"];
294var Xw=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Th=(function(a){Xw(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.templateInput=function(){return""},r.prototype.onChange=function(){this.handleClick()},r.prototype.handleClick=function(){this.model.runCommand()},r.prototype.renderLabel=function(){this.model.get("label")&&li.prototype.renderLabel.apply(this)},r.prototype.getInputEl=function(){var t=this,e=t.model,n=t.ppfx,i=e.props(),l=i.labelButton,u=i.text,c=i.full,f=l||u,v="".concat(n,"btn"),g='<button type="button" class="'.concat(v,"-prim").concat(c?" ".concat(v,"--full"):"",'">').concat(f,"</button>");return g},r})(li),Jw=Th;Th.prototype.eventCapture=["click button"];var Zw=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Qw=(function(a){Zw(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;return t.appendInput=!1,t}return r.prototype.templateInput=function(){var t=this,e=t.ppfx,n=t.clsField;return'<label class="'.concat(n,`" data-input> 295 <i class="`).concat(e,`chk-icon"></i> 296 </label>`)},r.prototype.onChange=function(){this.model.set("value",this.getInputElem().checked)},r.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.checked=!!t)},r.prototype.getInputEl=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!this.$input,i=li.prototype.getInputEl.apply(this,t);if(n){var l=void 0,u=void 0,c=this,f=c.model,v=c.target,g=f.attributes.valueFalse,y=f.getName();f.changeProp?(l=v.get(y),u=l):(u=v.get("attributes")[y],l=!!(u||u==="")),!(0,k.isUndefined)(g)&&u===g&&(l=!1),i.checked=l}return i},r})(li),tb=Qw;function eb(a,r){"use strict";if(!(0,At.hasWin)())return;var t={beforeShow:_,move:_,change:_,show:_,hide:_,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},e=[],n=!!/msie/i.exec(window.navigator.userAgent),i=(function(){function V(Tt,ht){return!!~(""+Tt).indexOf(ht)}var tt=document.createElement("div"),M=tt.style;return M.cssText="background-color:rgba(0,0,0,.5)",V(M.backgroundColor,"rgba")||V(M.backgroundColor,"hsla")})(),l=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>▼</div>","</div>"].join(""),u=(function(){var V="";if(n)for(var tt=1;tt<=6;tt++)V+="<div class='sp-"+tt+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",V,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")})();function c(V,tt,M,Tt){for(var ht=[],Lt=0;Lt<V.length;Lt++){var Yt=V[Lt];if(Yt){var qt=I(Yt),Bt=qt.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";Bt+=I.equals(tt,Yt)?" sp-thumb-active":"";var re=qt.toString(Tt.preferredFormat||"rgb"),Ce=i?"background-color:"+qt.toRgbString():"filter:"+qt.toFilter();ht.push('<span title="'+re+'" data-color="'+qt.toRgbString()+'" class="'+Bt+'"><span class="sp-thumb-inner" style="'+Ce+';"></span></span>')}else{var Pe="sp-clear-display";ht.push(a("<div />").append(a('<span data-color="" style="background-color:transparent;" class="'+Pe+'"></span>').attr("title",Tt.noColorSelectedText)).html())}}return"<div class='sp-cf "+M+"'>"+ht.join("")+"</div>"}function f(){for(var V=0;V<e.length;V++)e[V]&&e[V].hide()}function v(V,tt){var M=a.extend({},t,V);return M.callbacks={move:S(M.move,tt),change:S(M.change,tt),show:S(M.show,tt),hide:S(M.hide,tt),beforeShow:S(M.beforeShow,tt)},M}function g(V,tt){var M=v(tt,V),Tt=M.flat,ht=M.showSelectionPalette,Lt=M.localStorageKey,Yt=M.theme,qt=M.callbacks,Bt=N(er,10),re=!1,Ce=!1,Pe=!0,Oe=0,qe=0,cn=0,j=0,Z=0,at=0,Pt=0,zt=0,ie=0,ge=0,rn=0,Fe=1,We=[],Qn=[],fn={},ze=M.selectionPalette.slice(0),hr=M.maxSelectionSize,Ve="sp-dragging",Ke=null,Ye=V.ownerDocument,tr=Ye.body,Ae=a(V),Dn=!1,ve=a(u,Ye).addClass(Yt),On=ve.find(".sp-picker-container"),en=ve.find(".sp-color"),jn=ve.find(".sp-dragger"),ke=ve.find(".sp-hue"),Zt=ve.find(".sp-slider"),dn=ve.find(".sp-alpha-inner"),Pn=ve.find(".sp-alpha"),on=ve.find(".sp-alpha-handle"),_e=ve.find(".sp-input"),Ne=ve.find(".sp-palette"),vr=ve.find(".sp-initial"),gr=ve.find(".sp-cancel"),Mt=ve.find(".sp-clear"),fe=ve.find(".sp-choose"),Un=ve.find(".sp-palette-toggle"),L=Ae.is("input"),X=L&&Ae.attr("type")==="color"&&z(),St=L&&!Tt,Dt=St?a(l).addClass(Yt).addClass(M.className).addClass(M.replacerClassName):a([]),Rt=St?Dt:Ae,xe=Dt.find(".sp-preview-inner"),Te=M.color||L&&Ae.val(),Le=!1,Ie=M.preferredFormat,ui=!M.showButtons||M.clickoutFiresChange,yr=!Te,Bn=M.allowEmpty&&!X;function Wr(){if(M.showPaletteOnly&&(M.showPalette=!0),Un.text(M.showPaletteOnly?M.togglePaletteMoreText:M.togglePaletteLessText),M.palette){We=M.palette.slice(0),Qn=a.isArray(We[0])?We:[We],fn={};for(var ae=0;ae<Qn.length;ae++)for(var oe=0;oe<Qn[ae].length;oe++){var we=I(Qn[ae][oe]).toRgbString();fn[we]=!0}}ve.toggleClass("sp-flat",Tt),ve.toggleClass("sp-input-disabled",!M.showInput),ve.toggleClass("sp-alpha-enabled",M.showAlpha),ve.toggleClass("sp-clear-enabled",Bn),ve.toggleClass("sp-buttons-disabled",!M.showButtons),ve.toggleClass("sp-palette-buttons-disabled",!M.togglePaletteOnly),ve.toggleClass("sp-palette-disabled",!M.showPalette),ve.toggleClass("sp-palette-only",M.showPaletteOnly),ve.toggleClass("sp-initial-disabled",!M.showInitial),ve.addClass(M.className).addClass(M.containerClassName),er()}function Ni(){if(n&&ve.find("*:not(input)").attr("unselectable","on"),Wr(),St&&Ae.after(Dt).hide(),Bn||Mt.hide(),Tt)Ae.after(ve).hide();else{var ae=M.appendTo==="parent"?Ae.parent():a(M.appendTo);ae.length!==1&&(ae=a("body")),ae.append(ve)}ci(),Rt.bind("click.spectrum touchstart.spectrum",function(le){Dn||pn(),le.stopPropagation(),a(le.target).is("input")||le.preventDefault()}),(Ae.is(":disabled")||M.disabled===!0)&&Qr(),ve.click(b),_e.change(an),_e.bind("paste",function(){setTimeout(an,1)}),_e.keydown(function(le){le.keyCode==13&&an()}),gr.text(M.cancelText),gr.bind("click.spectrum",function(le){le.stopPropagation(),le.preventDefault(),Hi(),An()}),Mt.attr("title",M.clearText),Mt.bind("click.spectrum",function(le){le.stopPropagation(),le.preventDefault(),yr=!0,mr(),Tt&&_r(!0)}
296),fe.text(M.chooseText),fe.bind("click.spectrum",function(le){le.stopPropagation(),le.preventDefault(),n&&_e.is(":focus")&&_e.trigger("change"),pi()&&(_r(!0),An())}),Un.text(M.showPaletteOnly?M.togglePaletteMoreText:M.togglePaletteLessText),Un.bind("click.spectrum",function(le){le.stopPropagation(),le.preventDefault(),M.showPaletteOnly=!M.showPaletteOnly,!M.showPaletteOnly&&!Tt&&ve.css("left","-="+(On.outerWidth(!0)+5)),Wr()}),E(Pn,function(le,Ze,nr){Fe=le/at,yr=!1,nr.shiftKey&&(Fe=Math.round(Fe*10)/10),mr()},jr,Xr),E(ke,function(le,Ze){ie=parseFloat(Ze/j),yr=!1,M.showAlpha||(Fe=1),mr()},jr,Xr),E(en,function(le,Ze,nr){if(!nr.shiftKey)Ke=null;else if(!Ke){var rr=ge*Oe,mn=qe-rn*qe,Tn=Math.abs(le-rr)>Math.abs(Ze-mn);Ke=Tn?"x":"y"}var ir=!Ke||Ke==="x",Nr=!Ke||Ke==="y";ir&&(ge=parseFloat(le/Oe)),Nr&&(rn=parseFloat((qe-Ze)/qe)),yr=!1,M.showAlpha||(Fe=1),mr()},jr,Xr),Te?(Er(Te),Pr(),Ie=M.preferredFormat||I(Te).getFormat(),qr(Te)):Pr(),Tt&&di();function oe(le){return le.data&&le.data.ignore?(Er(a(le.target).closest(".sp-thumb-el").data("color")),mr()):(Er(a(le.target).closest(".sp-thumb-el").data("color")),mr(),M.hideAfterPaletteSelect&&(_r(!0),An())),!1}var we=n?"mousedown.spectrum":"click.spectrum touchstart.spectrum";Ne.delegate(".sp-thumb-el",we,oe),vr.delegate(".sp-thumb-el:nth-child(1)",we,{ignore:!0},oe)}function ci(){if(Lt&&window.localStorage){try{var ae=window.localStorage[Lt].split(",#");ae.length>1&&(delete window.localStorage[Lt],a.each(ae,function(oe,we){qr(we)}))}catch(oe){}try{ze=window.localStorage[Lt].split(";")}catch(oe){}}}function qr(ae){if(ht){var oe=I(ae).toRgbString();if(!fn[oe]&&a.inArray(oe,ze)===-1)for(ze.push(oe);ze.length>hr;)ze.shift();if(Lt&&window.localStorage)try{window.localStorage[Lt]=ze.join(";")}catch(we){}}}function Fi(){var ae=[];if(M.showPalette)for(var oe=0;oe<ze.length;oe++){var we=I(ze[oe]).toRgbString();fn[we]||ae.push(ze[oe])}return ae.reverse().slice(0,M.maxSelectionSize)}function fi(){var ae=hn(),oe=a.map(Qn,function(we,le){return c(we,ae,"sp-palette-row sp-palette-row-"+le,M)});ci(),ze&&oe.push(c(Fi(),ae,"sp-palette-row sp-palette-row-selection",M)),Ne.html(oe.join(""))}function Yr(){if(M.showInitial){var ae=Le,oe=hn();vr.html(c([ae,oe],oe,"sp-palette-row-initial",M))}}function jr(){(qe<=0||Oe<=0||j<=0)&&er(),Ce=!0,ve.addClass(Ve),Ke=null,Ae.trigger("dragstart.spectrum",[hn()])}function Xr(){Ce=!1,ve.removeClass(Ve),Ae.trigger("dragstop.spectrum",[hn()])}function an(){var ae=_e.val();if((ae===null||ae==="")&&Bn)Er(null),_r(!0);else{var oe=I(ae);oe.isValid()?(Er(oe),_r(!0)):_e.addClass("sp-validation-error")}}function pn(){re?An():di()}function di(){var ae=a.Event("beforeShow.spectrum");if(re){er();return}if(Ae.trigger("beforeShow.spectrum",[hn()]),!(qt.beforeShow(hn())===!1||ae.isDefaultPrevented())){f(),re=!0;var oe=a(Ye);oe.bind("keydown.spectrum",Vi),oe.bind("click.spectrum",Ir),a(window).bind("resize.spectrum",Bt),Dt.addClass("sp-active"),ve.removeClass("sp-hidden"),er(),Pr(),Le=hn(),Yr(),qt.show(Le),Ae.trigger("show.spectrum",[Le])}}function Vi(ae){ae.keyCode===27&&An()}function Ir(ae){ae.button!=2&&(Ce||(ui?_r(!0):Hi(),An()))}function An(){!re||Tt||(re=!1,a(Ye).unbind("keydown.spectrum",Vi),a(Ye).unbind("click.spectrum",Ir),a(window).unbind("resize.spectrum",Bt),Dt.removeClass("sp-active"),ve.addClass("sp-hidden"),qt.hide(hn()),Ae.trigger("hide.spectrum",[hn()]))}function Hi(){Er(Le,!0)}function Er(ae,oe){if(I.equals(ae,hn())){Pr();return}var we,le;!ae&&Bn?yr=!0:(yr=!1,Pe=!ae,we=I(ae),le=we.toHsv(),ie=le.h%360/360,ge=le.s,rn=le.v,Fe=le.a),Pr(),we&&we.isValid()&&!oe&&(Ie=M.preferredFormat||we.getFormat())}function hn(ae){return ae=ae||{},Bn&&yr?null:I.fromRatio({h:ie,s:ge,v:rn,a:Math.round(Fe*100)/100},{format:ae.format||Ie})}function pi(){return!_e.hasClass("sp-validation-error")}function mr(){Pr(),qt.move(hn()),Ae.trigger("move.spectrum",[hn()])}function Pr(){_e.removeClass("sp-validation-error"),hi();var ae=I.fromRatio({h:ie,s:1,v:1});en.css("background-color",ae.toHexString());var oe=Ie;Fe<1&&!(Fe===0&&oe==="name")&&(oe==="hex"||oe==="hex3"||oe==="hex6"||oe==="name")&&(oe="rgb");var we=hn({format:oe}),le="";if(xe.removeClass("sp-clear-display"),xe.css("background-color","transparent"),!we&&Bn)xe.addClass("sp-clear-display");else{var Ze=we.toHexString(),nr=we.toRgbString();if(i||we.alpha===1?xe.css("background-color",nr):(xe.css("background-color","transparent"),xe.css("filter",we.toFilter())),M.showAlpha){var rr=we.toRgb();rr.a=0;var mn=I(rr).toRgbString(),Tn="linear-gradient(left, "+mn+", "+Ze+")";n?dn.css("filter",I(mn).toFilter({gradientType:1},Ze)):(dn.css("background","-webkit-"+Tn),dn.css("background","-moz-"+Tn),dn.css("background","-ms-"+Tn),dn.css("background","linear-gradient(to right, "+mn+", "+Ze+")"))}le=we.toString(oe)}M.showInput&&_e.val(le),M.showPalette&&fi(),Yr()}function hi(){var ae=ge,oe=rn;if(Bn&&yr)on.hide(),Zt.hide(),jn.hide();else{on.show(),Zt.show(),jn.show();var we=ae*Oe,le=qe-oe*qe;we=Math.max(-cn,Math.min(Oe-cn,we-cn)),le=Math.max(-cn,Math.min(qe-cn,le-cn)),jn.css({top:le+"px",left:we+"px"});var Ze=Fe*at;on.css({left:Ze-Pt/2+"px"});var nr=ie*j;Zt.css({top:nr-zt+"px"})}}function _r(ae){var oe=hn(),we="",le=Pe?!0:!I.equals(oe,Le);oe&&(we=oe.toString(Ie),!re&&qr(oe)),L&&Ae.val(we),ae&&le&&(qt.change(oe),Ae.trigger("change",[oe]))}function er(){re&&(Oe=en.width(),qe=en.height(),cn=jn.height(),Z=ke.width(),j=ke.height(),zt=Zt.height(),at=Pn.width(),Pt=on.width(),Tt||(ve.css("position","absolute"),M.offset?ve.offset(M.offset):ve.offset(y(ve,Rt))),hi(),M.showPalette&&fi(),Ae.trigger("reflow.spectrum"))}function Jr(){Ae.show(),Rt.unbind("click.spectrum touchstart.spectrum"),ve.remove(),Dt.remove(),e[wr.id]=null}function Rr(ae,oe){if(ae===r)return a.extend({},M);if(oe===r)return M[ae];M[ae]=oe,ae==="preferredFormat"&&(Ie=M.preferredFormat),Wr()}function Zr(){Dn=!1,Ae.attr("disabled",!1),Rt.removeClass("sp-disabled")}function Qr(){An(),Dn=!0,Ae.attr("disabled",!0),Rt.addClass("sp-disabled")}function Ui(ae){M.offset=ae,er()}Ni();var wr={show:di,hide:An,toggle:pn,reflow:er,option:Rr,enable:Zr,disable:Qr,offset:Ui,set:function(ae){Er(ae),_r()},get:hn,destroy:Jr,container:ve};return wr.id=e.push(wr)-1,wr}function y(V,tt){for(var M=tt[0],Tt=V[0],ht=Tt.parentElement,Lt=M.getBoundingClientRect(),Yt=Tt.offsetWidth,qt=Tt.offsetHeight,Bt={top:0,left:0,width:M.offsetWidth,height:M.offsetHeight};M&&(Bt.top+=M.offsetTop-M.scrollTop,Bt.left+=M.offsetLeft-M.scrollLeft,!(M===ht||!ht.contains(M.offsetParent)));)M=M.offsetParent;return Lt.right+Yt>window.innerWidth-window.scrollX&&Lt.right-Yt>0&&(Bt.left-=Yt-Bt.width),Lt.bottom+qt<window.innerHeight-window.scrollY?Bt.top+=Bt.height:Bt.top-=qt,Bt}function _(){}function b(V){V.stopPropagation()}function S(V,tt){var M=Array.prototype.slice,Tt=M.call(arguments,2);return function(){return V.apply(tt,Tt.concat(M.call(arguments)))}}function E(V,tt,M,Tt){tt=tt||function(){},M=M||function(){},Tt=Tt||function(){};var ht=document,Lt=!1,Yt={},qt=0,Bt=0,re="ontouchstart"in window,Ce={};Ce.selectstart=Pe,Ce.dragstart=Pe,Ce["touchmove mousemove"]=Oe,Ce["touchend mouseup"]=cn;function Pe(j){j.stopPropagation&&j.stopPropagation(),j.preventDefault&&j.preventDefault(),j.returnValue=!1}function Oe(j){if(Lt){if(n&&ht.documentMode<9&&!j.button)return cn();var Z=j&&j.touches&&j.touches[0],at=Z&&Z.pageX||j.pageX,Pt=Z&&Z.pageY||j.pageY,zt=Math.max(0,Math.min(at-Yt.left,Bt)),ie=Math.max(0,Math.min(Pt-Yt.top,qt));re&&Pe(j),tt.apply(V,[zt,ie,j])}}function qe(j){var Z=j.which?j.which==3:j.button==2;!Z&&!Lt&&M.apply(V,arguments)!==!1&&(Lt=!0,qt=a(V).height(),Bt=a(V).width(),Yt=a(V).offset(),a(ht).bind(Ce),a(ht.body).addClass("sp-dragging"),Oe(j),Pe(j))}function cn(){Lt&&(a(ht).unbind(Ce),a(ht.body).removeClass("sp-dragging"),setTimeout(function(){Tt.apply(V,arguments)}
296,0)),Lt=!1}a(V).bind("touchstart mousedown",qe)}function N(V,tt,M){var Tt;return function(){var ht=this,Lt=arguments,Yt=function(){Tt=null,V.apply(ht,Lt)};M&&clearTimeout(Tt),(M||!Tt)&&(Tt=setTimeout(Yt,tt))}}function z(){return a.fn.spectrum.inputTypeColorSupport()}var R="spectrum.id";a.fn.spectrum=function(V,tt){if(typeof V=="string"){var M=this,Tt=Array.prototype.slice.call(arguments,1);return this.each(function(){var ht=e[a(this).data(R)];if(ht){var Lt=ht[V];if(!Lt)throw new Error("Spectrum: no such method: '"+V+"'");V=="get"?M=ht.get():V=="container"?M=ht.container:V=="option"?M=ht.option.apply(ht,Tt):V=="destroy"?(ht.destroy(),a(this).removeData(R)):Lt.apply(ht,Tt)}}),M}return this.spectrum("destroy").each(function(){var ht=a.extend({},V,a(this).data()),Lt=g(this,ht);a(this).data(R,Lt.id)})},a.fn.spectrum.load=!0,a.fn.spectrum.loadOpts={},a.fn.spectrum.draggable=E,a.fn.spectrum.defaults=t,a.fn.spectrum.inputTypeColorSupport=function V(){if(typeof V._cachedResult>"u"){var tt=a("<input type='color'/>")[0];V._cachedResult=tt.type==="color"&&tt.value!==""}return V._cachedResult},a.spectrum={},a.spectrum.localization={},a.spectrum.palettes={},a.fn.spectrum.processNativeColorInputs=function(){var V=a("input[type=color]");V.length&&!z()&&V.spectrum({preferredFormat:"hex6"})};var W=/^[\s,#]+/,ct=/\s+$/,_t=0,xt=Math,ut=xt.round,q=xt.min,lt=xt.max,H=xt.random,I=function(V,tt){if(V=V||"",tt=tt||{},V instanceof I)return V;if(!(this instanceof I))return new I(V,tt);var M=B(V);this._originalInput=V,this._r=M.r,this._g=M.g,this._b=M.b,this._a=M.a,this._roundA=ut(100*this._a)/100,this._format=tt.format||M.format,this._gradientType=tt.gradientType,this._r<1&&(this._r=ut(this._r)),this._g<1&&(this._g=ut(this._g)),this._b<1&&(this._b=ut(this._b)),this._ok=M.ok,this._tc_id=_t++};I.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 V=this.toRgb();return(V.r*299+V.g*587+V.b*114)/1e3},setAlpha:function(V){return this._a=pe(V),this._roundA=ut(100*this._a)/100,this},toHsv:function(){var V=gt(this._r,this._g,this._b);return{h:V.h*360,s:V.s,v:V.v,a:this._a}},toHsvString:function(){var V=gt(this._r,this._g,this._b),tt=ut(V.h*360),M=ut(V.s*100),Tt=ut(V.v*100);return this._a==1?"hsv("+tt+", "+M+"%, "+Tt+"%)":"hsva("+tt+", "+M+"%, "+Tt+"%, "+this._roundA+")"},toHsl:function(){var V=et(this._r,this._g,this._b);return{h:V.h*360,s:V.s,l:V.l,a:this._a}},toHslString:function(){var V=et(this._r,this._g,this._b),tt=ut(V.h*360),M=ut(V.s*100),Tt=ut(V.l*100);return this._a==1?"hsl("+tt+", "+M+"%, "+Tt+"%)":"hsla("+tt+", "+M+"%, "+Tt+"%, "+this._roundA+")"},toHex:function(V){return jt(this._r,this._g,this._b,V)},toHexString:function(V){return"#"+this.toHex(V)},toHex8:function(){return te(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:ut(this._r),g:ut(this._g),b:ut(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+ut(this._r)+", "+ut(this._g)+", "+ut(this._b)+")":"rgba("+ut(this._r)+", "+ut(this._g)+", "+ut(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:ut(T(this._r,255)*100)+"%",g:ut(T(this._g,255)*100)+"%",b:ut(T(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+ut(T(this._r,255)*100)+"%, "+ut(T(this._g,255)*100)+"%, "+ut(T(this._b,255)*100)+"%)":"rgba("+ut(T(this._r,255)*100)+"%, "+ut(T(this._g,255)*100)+"%, "+ut(T(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Be[jt(this._r,this._g,this._b,!0)]||!1},toFilter:function(V){var tt="#"+te(this._r,this._g,this._b,this._a),M=tt,Tt=this._gradientType?"GradientType = 1, ":"";if(V){var ht=I(V);M=ht.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+Tt+"startColorstr="+tt+",endColorstr="+M+")"},toString:function(V){var tt=!!V;V=V||this._format;var M=!1,Tt=this._a<1&&this._a>=0,ht=!tt&&Tt&&(V==="hex"||V==="hex6"||V==="hex3"||V==="name");return ht?V==="name"&&this._a===0?this.toName():this.toRgbString():(V==="rgb"&&(M=this.toRgbString()),V==="prgb"&&(M=this.toPercentageRgbString()),(V==="hex"||V==="hex6")&&(M=this.toHexString()),V==="hex3"&&(M=this.toHexString(!0)),V==="hex8"&&(M=this.toHex8String()),V==="name"&&(M=this.toName()),V==="hsl"&&(M=this.toHslString()),V==="hsv"&&(M=this.toHsvString()),M||this.toHexString())},_applyModification:function(V,tt){var M=V.apply(null,[this].concat([].slice.call(tt)));return this._r=M._r,this._g=M._g,this._b=M._b,this.setAlpha(M._a),this},lighten:function(){return this._applyModification(bt,arguments)},brighten:function(){return this._applyModification(It,arguments)},darken:function(){return this._applyModification(nt,arguments)},desaturate:function(){return this._applyModification(Xt,arguments)},saturate:function(){return this._applyModification(he,arguments)},greyscale:function(){return this._applyModification(mt,arguments)},spin:function(){return this._applyModification(wt,arguments)},_applyCombination:function(V,tt){return V.apply(null,[this].concat([].slice.call(tt)))},analogous:function(){return this._applyCombination(Jt,arguments)},complement:function(){return this._applyCombination(Ot,arguments)},monochromatic:function(){return this._applyCombination(Ee,arguments)},splitcomplement:function(){return this._applyCombination(Nt,arguments)},triad:function(){return this._applyCombination(Ht,arguments)},tetrad:function(){return this._applyCombination(Vt,arguments)}},I.fromRatio=function(V,tt){if(typeof V=="object"){var M={};for(var Tt in V)V.hasOwnProperty(Tt)&&(Tt==="a"?M[Tt]=V[Tt]:M[Tt]=ft(V[Tt]));V=M}return I(V,tt)};function B(V){var tt={r:0,g:0,b:0},M=1,Tt=!1,ht=!1;return typeof V=="string"&&(V=de(V)),typeof V=="object"&&(V.hasOwnProperty("r")&&V.hasOwnProperty("g")&&V.hasOwnProperty("b")?(tt=U(V.r,V.g,V.b),Tt=!0,ht=String(V.r).substr(-1)==="%"?"prgb":"rgb"):V.hasOwnProperty("h")&&V.hasOwnProperty("s")&&V.hasOwnProperty("v")?(V.s=ft(V.s),V.v=ft(V.v),tt=yt(V.h,V.s,V.v),Tt=!0,ht="hsv"):V.hasOwnProperty("h")&&V.hasOwnProperty("s")&&V.hasOwnProperty("l")&&(V.s=ft(V.s),V.l=ft(V.l),tt=A(V.h,V.s,V.l),Tt=!0,ht="hsl"),V.hasOwnProperty("a")&&(M=V.a)),M=pe(M),{ok:Tt,format:V.format||ht,r:q(255,lt(tt.r,0)),g:q(255,lt(tt.g,0)),b:q(255,lt(tt.b,0)),a:M}}function U(V,tt,M){return{r:T(V,255)*255,g:T(tt,255)*255,b:T(M,255)*255}}function et(V,tt,M){V=T(V,255),tt=T(tt,255),M=T(M,255);var Tt=lt(V,tt,M),ht=q(V,tt,M),Lt,Yt,qt=(Tt+ht)/2;if(Tt==ht)Lt=Yt=0;else{var Bt=Tt-ht;switch(Yt=qt>.5?Bt/(2-Tt-ht):Bt/(Tt+ht),Tt){case V:Lt=(tt-M)/Bt+(tt<M?6:0);break;case tt:Lt=(M-V)/Bt+2;break;case M:Lt=(V-tt)/Bt+4;break}Lt/=6}return{h:Lt,s:Yt,l:qt}}function A(V,tt,M){var Tt,ht,Lt;V=T(V,360),tt=T(tt,100),M=T(M,100);function Yt(re,Ce,Pe){return Pe<0&&(Pe+=1),Pe>1&&(Pe-=1),Pe<1/6?re+(Ce-re)*6*Pe:Pe<1/2?Ce:Pe<2/3?re+(Ce-re)*(2/3-Pe)*6:re}if(tt===0)Tt=ht=Lt=M;else{var qt=M<.5?M*(1+tt):M+tt-M*tt,Bt=2*M-qt;Tt=Yt(Bt,qt,V+1/3),ht=Yt(Bt,qt,V),Lt=Yt(Bt,qt,V-1/3)}return{r:Tt*255,g:ht*255,b:Lt*255}}function gt(V,tt,M){V=T(V,255),tt=T(tt,255),M=T(M,255);var Tt=lt(V,tt,M),ht=q(V,tt,M),Lt,Yt,qt=Tt,Bt=Tt-ht;if(Yt=Tt===0?0:Bt/Tt,Tt==ht)Lt=0;else{switch(Tt){case V:Lt=(tt-M)/Bt+(tt<M?6:0);break;case tt:Lt=(M-V)/Bt+2;break;case M:Lt=(V-tt)/Bt+4;break}Lt/=6}return{h:Lt,s:Yt,v:qt}}function yt(V,tt,M){V=T(V,360)*6,tt=T(tt,100),M=T(M,100);var Tt=xt.floor(V),ht=V-Tt,Lt=M*(1-tt),Yt=M*(1-ht*tt),qt=M*(1-(1-ht)*tt),Bt=Tt%6,re=[M,Yt,Lt,Lt,qt,M][Bt],Ce=[qt,M,M,Yt,Lt,Lt][Bt],Pe=[Lt,Lt,qt,M,M,Yt][Bt];return{r:re*255,g:Ce*255,b:Pe*255}}function jt(V,tt,M,Tt){var ht=[K(ut(V).toString(16)),K(ut(tt).toString(16)),K(ut(M).toString(16))];return Tt&&ht[0].charAt(0)==ht[0].charAt(1)&&ht[1].charAt(0)==ht[1].charAt(1)&&ht[2].charAt(0)==ht[2].charAt(1)?ht[0].charAt(0)+ht[1].charAt(0)+ht[2].charAt(0):ht.join("")}function te(V,tt,M,Tt){var ht=[K(it(Tt)),K(ut(V).toString(16)),K(ut(tt).toString(16)),K(ut(M).toString(16))];return ht.join("")}I.equals=function(V,tt){return!V||!tt?!1:I(V).toRgbString()==I(tt).toRgbString()},I.random=function(){return I.fromRatio({r:H(),g:H(),b:H()})};function Xt(V,tt){tt=tt===0?0:tt||10;var M=I(V).toHsl();return M.s-=tt/100,M.s=F(M.s),I(M)}function he(V,tt){tt=tt===0?0:tt||10;var M=I(V).toHsl();return M.s+=tt/100,M.s=F(M.s),I(M)}function mt(V){return I(V).desaturate(100)}function bt(V,tt){tt=tt===0?0:tt||10;var M=I(V).toHsl();return M.l+=tt/100,M.l=F(M.l),I(M)}function It(V,tt){tt=tt===0?0:tt||10;var M=I(V).toRgb();return M.r=lt(0,q(255,M.r-ut(255*-(tt/100)))),M.g=lt(0,q(255,M.g-ut(255*-(tt/100)))),M.b=lt(0,q(255,M.b-ut(255*-(tt/100)))),I(M)}function nt(V,tt){tt=tt===0?0:tt||10;var M=I(V).toHsl();return M.l-=tt/100,M.l=F(M.l),I(M)}function wt(V,tt){var M=I(V).toHsl(),Tt=(ut(M.h)+tt)%360;return M.h=Tt<0?360+Tt:Tt,I(M)}function Ot(V){var tt=I(V).toHsl();return tt.h=(tt.h+180)%360,I(tt)}function Ht(V){var tt=I(V).toHsl(),M=tt.h;return[I(V),I({h:(M+120)%360,s:tt.s,l:tt.l}),I({h:(M+240)%360,s:tt.s,l:tt.l})]}function Vt(V){var tt=I(V).toHsl(),M=tt.h;return[I(V),I({h:(M+90)%360,s:tt.s,l:tt.l}),I({h:(M+180)%360,s:tt.s,l:tt.l}),I({h:(M+270)%360,s:tt.s,l:tt.l})]}function Nt(V){var tt=I(V).toHsl(),M=tt.h;
296return[I(V),I({h:(M+72)%360,s:tt.s,l:tt.l}),I({h:(M+216)%360,s:tt.s,l:tt.l})]}function Jt(V,tt,M){tt=tt||6,M=M||30;var Tt=I(V).toHsl(),ht=360/M,Lt=[I(V)];for(Tt.h=(Tt.h-(ht*tt>>1)+720)%360;--tt;)Tt.h=(Tt.h+ht)%360,Lt.push(I(Tt));return Lt}function Ee(V,tt){tt=tt||6;for(var M=I(V).toHsv(),Tt=M.h,ht=M.s,Lt=M.v,Yt=[],qt=1/tt;tt--;)Yt.push(I({h:Tt,s:ht,v:Lt})),Lt=(Lt+qt)%1;return Yt}I.mix=function(V,tt,M){M=M===0?0:M||50;var Tt=I(V).toRgb(),ht=I(tt).toRgb(),Lt=M/100,Yt=Lt*2-1,qt=ht.a-Tt.a,Bt;Yt*qt==-1?Bt=Yt:Bt=(Yt+qt)/(1+Yt*qt),Bt=(Bt+1)/2;var re=1-Bt,Ce={r:ht.r*Bt+Tt.r*re,g:ht.g*Bt+Tt.g*re,b:ht.b*Bt+Tt.b*re,a:ht.a*Lt+Tt.a*(1-Lt)};return I(Ce)},I.readability=function(V,tt){var M=I(V),Tt=I(tt),ht=M.toRgb(),Lt=Tt.toRgb(),Yt=M.getBrightness(),qt=Tt.getBrightness(),Bt=Math.max(ht.r,Lt.r)-Math.min(ht.r,Lt.r)+Math.max(ht.g,Lt.g)-Math.min(ht.g,Lt.g)+Math.max(ht.b,Lt.b)-Math.min(ht.b,Lt.b);return{brightness:Math.abs(Yt-qt),color:Bt}},I.isReadable=function(V,tt){var M=I.readability(V,tt);return M.brightness>125&&M.color>500},I.mostReadable=function(V,tt){for(var M=null,Tt=0,ht=!1,Lt=0;Lt<tt.length;Lt++){var Yt=I.readability(V,tt[Lt]),qt=Yt.brightness>125&&Yt.color>500,Bt=3*(Yt.brightness/125)+Yt.color/500;(qt&&!ht||qt&&ht&&Bt>Tt||!qt&&!ht&&Bt>Tt)&&(ht=qt,Tt=Bt,M=I(tt[Lt]))}return M};var ue=I.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:"90ee9
2960",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"},Be=I.hexNames=je(ue);function je(V){var tt={};for(var M in V)V.hasOwnProperty(M)&&(tt[V[M]]=M);return tt}function pe(V){return V=parseFloat(V),(isNaN(V)||V<0||V>1)&&(V=1),V}function T(V,tt){ot(V)&&(V="100%");var M=vt(V);return V=q(tt,lt(0,parseFloat(V))),M&&(V=parseInt(V*tt,10)/100),xt.abs(V-tt)<1e-6?1:V%tt/parseFloat(tt)}function F(V){return q(1,lt(0,V))}function $(V){return parseInt(V,16)}function ot(V){return typeof V=="string"&&V.indexOf(".")!=-1&&parseFloat(V)===1}function vt(V){return typeof V=="string"&&V.indexOf("%")!=-1}function K(V){return V.length==1?"0"+V:""+V}function ft(V){return V<=1&&(V=V*100+"%"),V}function it(V){return Math.round(parseFloat(V)*255).toString(16)}function ne(V){return $(V)/255}var ye=(function(){var V="[-\\+]?\\d+%?",tt="[-\\+]?\\d*\\.\\d+%?",M="(?:"+tt+")|(?:"+V+")",Tt="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",ht="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?";return{rgb:new RegExp("rgb"+Tt),rgba:new RegExp("rgba"+ht),hsl:new RegExp("hsl"+Tt),hsla:new RegExp("hsla"+ht),hsv:new RegExp("hsv"+Tt),hsva:new RegExp("hsva"
296+ht),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})$/}})();function de(V){V=V.replace(W,"").replace(ct,"").toLowerCase();var tt=!1;if(ue[V])V=ue[V],tt=!0;else if(V=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var M;return(M=ye.rgb.exec(V))?{r:M[1],g:M[2],b:M[3]}:(M=ye.rgba.exec(V))?{r:M[1],g:M[2],b:M[3],a:M[4]}:(M=ye.hsl.exec(V))?{h:M[1],s:M[2],l:M[3]}:(M=ye.hsla.exec(V))?{h:M[1],s:M[2],l:M[3],a:M[4]}:(M=ye.hsv.exec(V))?{h:M[1],s:M[2],v:M[3]}:(M=ye.hsva.exec(V))?{h:M[1],s:M[2],v:M[3],a:M[4]}:(M=ye.hex8.exec(V))?{a:ne(M[1]),r:$(M[2]),g:$(M[3]),b:$(M[4]),format:tt?"name":"hex8"}:(M=ye.hex6.exec(V))?{r:$(M[1]),g:$(M[2]),b:$(M[3]),format:tt?"name":"hex"}:(M=ye.hex3.exec(V))?{r:$(M[1]+""+M[1]),g:$(M[2]+""+M[2]),b:$(M[3]+""+M[3]),format:tt?"name":"hex"}:!1}window.tinycolor=I,a(function(){a.fn.spectrum.load&&a.fn.spectrum.processNativeColorInputs()})}var nb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Eh=(function(a){nb(r,a);function r(t){t===void 0&&(t={});var e=a.call(this,t)||this,n=t.ppfx||"";return e.opts=t,e.ppfx=n,e.em=t.target||{},!t.onChange&&e.listenTo(e.model,"change:value",e.handleModelChange),e}return r.prototype.template=function(){return'<span class="'.concat(this.holderClass(),'"></span>')},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,e=t.model,n=t.opts,i=n.type||"text",l=e.get("placeholder")||e.get("defaults")||e.get("default")||"";this.inputEl=(0,Je.default)('<input type="'.concat(i,'" placeholder="').concat(l,'">'))}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})(Wt.Ss),_l=Eh;Eh.prototype.events={change:"handleChange"};var rb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Va=function(){return Va=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Va.apply(this,arguments)};Je.default&&eb(Je.default);var Is=function(a){var r=a.getFormat()==="name"&&a.toName(),t=a.getAlpha()==1?a.toHexString():a.toRgbString();return r||t.replace(/ /g,"")},ib=(function(a){rb(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.template=function(){var t=this.ppfx;return` 297 <div class="`.concat(this.holderClass(),`"></div> 298 <div class="`).concat(t,`field-colorp"> 299 <div class="`).concat(t,`field-colorp-c" data-colorp-c> 300 <div class="`).concat(t,`checker-bg"></div> 301 </div> 302 </div> 303 `)},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,k.isUndefined)(e)||this.__onInputChange(e)},r.prototype.__onInputChange=function(t){var e=this,n=e.model,i=e.opts,l=i.onChange,u=t,c=this.getColorEl();if(c){c.spectrum("set",u);var f=c.spectrum("get"),v=u&&Is(f);v&&(u=v)}l?l(u):n.set({value:u},{fromInput:1})},r.prototype.setValue=function(t,e){e===void 0&&(e={});var n=this.model,i=(0,k.isUndefined)(e.def)?n.get("defaults"):e.def,l=(0,k.isUndefined)(t)?(0,k.isUndefined)(i)?"":i:t,u=this.getInputEl(),c=this.getColorEl(),f=l!="none"?l:"";u.value=l,c.get(0).style.backgroundColor=f,(e.fromTarget||e.fromInput&&!e.avoidStore)&&(c.spectrum("set",f),this.noneColor=l=="none",this.movedColor=f)},r.prototype.getColorEl=function(){var t=this;if(!this.colorEl){var e=this,n=e.em,i=e.model,l=e.opts,u=this.ppfx,c=l.onCh
303ange,f=(0,Je.default)('<div class="'.concat(this.ppfx,'field-color-picker"></div>')),v=f.get(0).style,g=n&&n.getConfig&&n.getConfig().colorPicker||{};this.movedColor="";var y=!1,_;this.$el.find("[data-colorp-c]").append(f);var b=function(S,E){E===void 0&&(E=!0),c?c(S,!E):(E&&i.setValueFromInput(0,!1),i.setValueFromInput(S,E))};f.spectrum(Va(Va(Va({color:i.getValue()||!1,containerClassName:"".concat(u,"one-bg ").concat(u,"two-color ").concat(u,"editor-sp"),maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"\u2A2F",palette:[]},g),i.get("colorPicker")||{}),{move:function(S){var E=Is(S);t.movedColor=E,v.backgroundColor=E,b(E,!1)},change:function(S){y=!0;var E=Is(S);v.backgroundColor=E,b(E),t.noneColor=!1},show:function(S){y=!1,t.movedColor="",_=c?i.getValue({noDefault:!0}):Is(S)},hide:function(){!y&&(_||c)&&(t.noneColor&&(_=""),v.backgroundColor=_,f.spectrum("set",_),b(_,!1))}})),n&&n.on&&this.listenTo(n,"component:selected",function(){t.movedColor&&b(t.movedColor),y=!0,t.movedColor="",f.spectrum("hide")}),this.colorEl=f}return this.colorEl},r.prototype.render=function(){return _l.prototype.render.call(this),this.getColorEl(),this},r})(_l),Ph=ib,ob=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ab=(function(a){ob(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.templateInput=function(){return""},r.prototype.getInputEl=function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new Ph({model:t,target:this.config.em,contClass:this.ppfx+"field-color",ppfx:this.ppfx}),i=n.render();i.setValue(e,{fromTarget:1}),this.input=i.el}return this.input},r})(li),sb=ab,lb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ah=(function(a){lb(r,a);function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;return(0,k.bindAll)(e,"moveIncrement","upIncrement"),e.doc=document,e.listenTo(e.model,"change:unit",e.handleModelChange),e}return r.prototype.template=function(){var t=this.ppfx;return`
304 <span class="`.concat(t,`input-holder"></span> 305 <span class="`).concat(t,`field-units"></span> 306 <div class="`).concat(t,`field-arrows" data-arrows> 307 <div class="`).concat(t,`field-arrow-u" data-arrow-up></div> 308 <div class="`).concat(t,`field-arrow-d" data-arrow-down></div> 309 </div> 310 `)},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=['<option value="" disabled hidden>-</option>'];e.forEach(function(l){var u=l==t.get("unit")?"selected":"";n.push("<option ".concat(u,">").concat(l,"</option>"))});var i=document.createElement("div");i.innerHTML='<select class="'.concat(this.ppfx,'input-unit">').concat(n.join(""),"</select>"),this.unitEl=i.firstChild}}return this.unitEl},r.prototype.upArrowClick=function(){var t=this.model,e=t.get("step"),n=parseFloat(this.getInputEl().value);this.setValue(this.normalizeValue(n+e)),this.elementUpdated()},r.prototype.downArrowClick=function(){var t=this.model,e=t.get("step"),n=parseFloat(this.getInputEl().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,$t.on)(this.doc,"mousemove",this.moveIncrement),(0,$t.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),u=this.validateInputValue(l),c=u.value,f=u.unit;return this.prValue=c,e.set({value:c,unit:f},{avoidStore:1}),!1},r.prototype.upIncrement=function(){var t=this.model,e=t.get("step");if((0,$t.AU)(this.doc,"mouseup",this.upIncrement),(0,$t.AU)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set("value",n,{avoidStore:1}).set("value",n+e),this.elementUpdated()}},r.prototype.normalizeValue=function(t,e){e===void 0&&(e=0);var n=this.model,i=n.get("step"),l=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var u=i.toString().split(".")[1];l=u?u.length:0}return l?parseFloat(t.toFixed(l)):t},r.prototype.validateInputValue=function(t,e){e===void 0&&(e={});var n=0,i=e||{},l=this.model,u="",c=(0,k.isUndefined)(t)?u:t,f=e.units||l.get("units")||[],v=l.get("unit")||f.length&&f[0]||"",g=(0,k.isUndefined)(e.max)?l.get("max"):e.max,y=(0,k.isUndefined)(e.min)?l.get("min"):e.min,_=!!l.get("limitlessMax"),b=!!l.get("limitlessMin");if(i.deepCheck){var S=l.get("fixedValues")||[];if(c===""&&(v=""),c){var E=new RegExp("^"+S.join("|"),"g");if(S.length&&E.test(c))c=c.match(E)[0],v="",n=1;else{var N=c+"";c+="",c=parseFloat(c.replace(",",".")),c=isNaN(c)?u:c;var z=N.replace(c,"");(0,k.indexOf)(f,z)>=0&&(v=z)}}}return!_&&!(0,k.isUndefined)(g)&&g!==""&&(c=c>g?g:c),!b&&!(0,k.isUndefined)(y)&&y!==""&&(c=c<y?y:c),{force:n,value:c,unit:v}},r.prototype.render=function(){_l.prototype.render.call(this),this.unitEl=null;var t=this.getUnitEl();return t&&this.$el.find(".".concat(this.ppfx,"field-units")).get(0).appendChild(t),this},r})(_l),kh=Ah;Ah.prototype.events={"change input":"handleChange","change select":"handleUnit
310Change","click [data-arrow-up]":"upArrowClick","click [data-arrow-down]":"downArrowClick","mousedown [data-arrows]":"downIncrement",keydown:"handleKeyDown"};var ub=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),cb=(function(a){ub(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.getValueForTarget=function(){var t=this.model,e=t.attributes,n=e.value,i=e.unit;return!(0,k.isUndefined)(n)&&n!==""?n+i:t.get("default")},r.prototype.getInputEl=function(){if(!this.input){var t=this,e=t.ppfx,n=t.model,i=this.getModelValue(),l=new kh({contClass:"".concat(e,"field-int"),type:"number",model:n,ppfx:e});l.render(),this.$input=l.inputEl,this.$unit=l.unitEl,n.set("value",i,{fromTarget:!0}),this.$input.val(i),this.input=l.el}return this.input},r})(li),fb=cb,db=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),pb=(function(a){db(r,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 r.prototype.templateInput=function(){var t=this,e=t.ppfx,n=t.clsField;return'<div class="'.concat(n,`"> 311 <div data-input></div> 312 <div class="`).concat(e,`sel-arrow"> 313 <div class="`).concat(e,`d-s-arrow"></div> 314 </div> 315 </div>`)},r.prototype.getInputEl=function(){if(!this.$input){var t=this,e=t.model,n=t.em,i=e.get("name"),l=e.get("options")||[],u=[],c="<select>";l.forEach(function(g){var y="",_,b,S;(0,k.isString)(g)?(_=g,b=g):(_=g.name||g.label||g.value,b="".concat((0,k.isUndefined)(g.value)?g.id:g.value).replace(/"/g,"""),S=g.style?g.style.replace(/"/g,"""):"",y+=S?' style="'.concat(S,'"'):"");var E=n.t("traitManager.traits.options.".concat(i,".").concat(b))||_;c+='<option value="'.concat(b,'"').concat(y,">").concat(E,"</option>"),u.push(b)}),c+="</select>",this.$input=(0,Je.default)(c);var f=e.getTargetValue(),v=u.indexOf(f)>=0?f:e.get("default");!(0,k.isUndefined)(v)&&this.$input.val(v)}return this.$input.get(0)},r})(li),hb=pb,vb=De(754),gb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),$d="data-categories",qd="data-no-categories",Mh=(function(a){gb(r,a);function r(t,e){var n=a.call(this,t)||this;n.reuseView=!0,n.renderedCategories=new Map,n.itemsView=e;var i=t.config||{};n.config=i;var l=t.editor;n.em=l;var u=i.pStylePrefix||"";return n.ppfx=u,n.pfx=u+i.stylePrefix||"",n.className="".concat(n.pfx,"traits"),n.traitContClass="".concat(u,"traits-c"),n.classNoCat="".concat(u,"traits-empty-c"),n.catsClass="".concat(u,"trait-categories"),n.collection=new Ys([],{em:l}),n.listenTo(l,"component:toggled",n.updatedCollection),n.updatedCollection(),n}return r.prototype.updatedCollection=function(){var t=this,e=t.ppfx,n=t.em,i=n.getSelected();this.el.className="".concat(this.traitContClass,"s ").concat(e,"one-bg ").concat(e,"two-color"),this.collection=i?.traits||new Ys([],{em:n}),this.render()},r.prototype.add=function(t,e){var n=this,i=n.config,l=n.renderedCategories,u=this.itemView,c=t.get(this.itemType);this.itemsView&&this.itemsView[c]&&(u=this.itemsView[c]);var f=new u({config:i,model:t,attributes:t.get("attributes")}),v=f.render().el,g=t.parent.initCategory(t);if(g){var y=g.getId(),_=this.getCategoriesEl(),b=l.get(y);
315!b&&_&&(b=new dh({model:g},i,"trait").render(),l.set(y,b),_.appendChild(b.el)),b?.append(v);return}e?e.appendChild(v):this.append(v)},r.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector("[".concat($d,"]"))),this.catsEl},r.prototype.getTraitsEl=function(){return this.traitsEl||(this.traitsEl=this.el.querySelector("[".concat(qd,"]"))),this.traitsEl},r.prototype.append=function(t){var e=this.getTraitsEl();e?.appendChild(t)},r.prototype.render=function(){var t=this,e=this,n=e.el,i=e.ppfx,l=e.catsClass,u=e.traitContClass,c=e.classNoCat,f=document.createDocumentFragment();delete this.catsEl,delete this.traitsEl,this.renderedCategories=new Map,n.innerHTML=` 316 <div class="`.concat(l,'" ').concat($d,`></div> 317 <div class="`).concat(c," ").concat(u,'" ').concat(qd,`></div> 318 `),this.collection.forEach(function(g){return t.add(g,f)}),this.append(f);var v="".concat(u,"s ").concat(i,"one-bg ").concat(i,"two-color");return this.$el.addClass(v),this.rendered=!0,this},r})(vb.A),Yd=Mh;Mh.prototype.itemView=li;var yb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),mb=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},_b=(function(a){yb(r,a);function r(t){var e=a.call(this,t,"TraitManager",qw)||this;e.TraitsView=Yd,e.events=Sc,e.state=new Wt.Kx({traits:[]}),e.types={text:li,number:fb,select:hb,checkbox:tb,color:sb,button:Jw};var n=e,i=n.state,l=n.config,u=n.events,c=l.pStylePrefix;c&&(l.stylePrefix="".concat(c).concat(l.stylePrefix)),(0,k.bindAll)(e,"__onSelect");var f=(0,k.debounce)(function(){return e.__upSel()},0),v=(0,k.debounce)(function(){return e.__onUp()},0);return i.listenTo(t,"component:toggled",f),i.listenTo(t,u.value,v),i.on("change:traits",e.__onSelect),e.debounced=[f,v],e}return r.prototype.select=function(t){var e=t?.getTraits()||[];this.state.set({component:t,traits:e}),this.__trgCustom()},r.prototype.getCategories=function(){var t,e=this.getComponent(),n=((t=e?.traits.categories)===null||t===void 0?void 0:t.models)||[];return mb([],n,!0)},r.prototype.getTraits=function(){return this.getCurrent()},r.prototype.getTraitsByCategory=function(t){return Zp(t||this.getTraits())},r.prototype.getComponent=function(){return this.state.attributes.component},r.prototype.addType=function(t,e){var n=this.getType("text");this.types[t]=n.extend(e)},r.prototype.getType=function(t){return this.getTypes()[t]},r.prototype.getTypes=function(){return this.types},r.prototype.getTraitsViewer=function(){return this.view},r.prototype.getCurrent=function(){return this.state.get("traits")||[]},r.prototype.render=function(){var t=this.view,e=this.em;return t=new Yd({el:t?.el,collection:[],editor:e,config:this.getConfig()},this.getTypes()),this.view=t,t.el},r.prototype.postRender=function(){this.__appendTo()},r.prototype.__onSelect=function(){var t=this,e=t.em,n=t.events,i=t.state,l=i.attributes,u=l.component,c=l.traits;e.trigger(n.select,{component:u,traits:c})},r.prototype.__trgCustom=function(t){t===void 0&&(t={});var e=this,n=e.em,i=e.events,l=e.__ctn;this.__ctn=l||t.container,n.trigger(i.custom,this.__customData())},r.prototype.__customData=function(){return{container:this.__ctn}},r.prototype.__upSel=function(){this.select(this.em.getSelected())},r.prototype.__onUp=function(){this.select(this.getComponent())},r})(pr),wb=_b,bb={stylePrefix:"",appendTo:"",sortable:!0,hidable:!0,hideTextnode:!0,root:"",showWrapper:!0,showHover:!0,scrollCanvas:{behavior:"smooth",block:"nearest"},scrollLayers:{behavior:"auto",block:"nearest"},highlightHover:!0,custom:!1,onInit:function(){},onRender:function(){},extend:{}}
318,xb=bb,Cb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Sb=(function(a){Cb(r,a);function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;e.items=[],e.opt=t;var n=t.config||{};e.config=n,e.module=t.module,e.parentView=t.parentView;var i=n.stylePrefix||"",l=n.pStylePrefix||"",u=e.collection;e.listenTo(u,"add",e.addTo),e.listenTo(u,"reset resetNavigator",e.render),e.listenTo(u,"remove",e.removeChildren),e.className="".concat(i,"layers");var c=n.em;if(n.sortable&&!e.opt.sorter){var f=c.Utils;e.opt.sorter=new f.Sorter({container:n.sortContainer||e.el,containerSel:".".concat(e.className),itemSel:".".concat(i,"layer"),ignoreViewChildren:1,avoidSelectOnEnd:1,nested:1,ppfx:l,pfx:i,em:c})}return e.$el.data("collection",u),t.parent&&e.$el.data("model",t.parent),e}return r.prototype.removeChildren=function(t){var e=t.viewLayer;e&&(e.remove(),delete t.viewLayer)},r.prototype.addTo=function(t){this.addToCollection(t,null,this.collection.indexOf(t))},r.prototype.addToCollection=function(t,e,n){var i=this,l=i.parentView,u=i.opt,c=i.config,f=i.el,v=u.ItemView,g=u.opened,y=u.module,_=u.level,b=u.sorter,S=t.viewLayer||new v({ItemView:v,level:_,model:t,parentView:l,config:c,sorter:b,opened:g,module:y}),E=S.render().el;if(e)e.appendChild(E);else{var N=f,z=N.childNodes;if((0,k.isUndefined)(n))N.appendChild(E);else{var R=z.length==n;R&&n--,R||!z.length?N.appendChild(E):N.insertBefore(E,z[n])}}return this.items.push(S),E},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Wt.Ss.prototype.remove.apply(this,t),this.items.map(function(n){return n.remove()}),this},r.prototype.render=function(){var t=this,e=this,n=e.el,i=e.module,l=document.createDocumentFragment();return n.innerHTML="",this.collection.map(function(u){return i.__getLayerFromComponent(u)}).forEach(function(u){return t.addToCollection(u,l)}),n.appendChild(l),n.className=this.className,this},r})(Wt.Ss),Ob=Sb,Hu=De(570),Tb={stylePrefix:"com-",defaults:{},strict:!0},Eb=Tb,Pb=De(242),Ab=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),wl=function(){return wl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},wl.apply(this,arguments)},Xd=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Jd=[["preview","Preview","preview"],["resize","Resize","resize"],["fullscreen","Fullscreen","fullscreen"],["copy","CopyComponent"],["paste","PasteComponent"],["canvas-move","CanvasMove"],["canvas-clear","CanvasClear"],["open-code","ExportTemplate","export-template"],["open-layers","OpenLayers","open-layers"],["open-styles","OpenStyleManager","open-sm"],["open-traits","OpenTraitManager","open-tm"],["open-blocks","OpenBlocks","open-blocks"],["open-assets","OpenAssets","open-assets"],["component-select","SelectComponent","select-comp"],["component-outline","SwitchVisibility","sw-visibility"],["component-offset","ShowOffset","show-offset"],["component-move","MoveComponent","move-comp"],["component-next","ComponentNext"],["component-prev","ComponentPrev"],["component-enter","ComponentEnter"],["component-exit","ComponentExit","select-parent"],["component-delete","ComponentDelete"],["component-style-clear","ComponentStyleClear"],["component-drag","ComponentDrag"]],Lh={preserveSelected:1},Dh=function(a){return function(r){return a.trigger("".concat(Oc,":start"),r)}},jh=function(a){return function(r){return a.trigger(Oc,r)}},Ih=function(a,r,t){return t===void 0&&(t={}),function(e,n,i){r.forEach(function(l){return l.set("status",l.get("selectable")?"selected":"")}
318),a.setSelected(r),r[0].emitUpdate(),a.trigger("".concat(Oc,":end"),i),setTimeout(function(){return a.runDefault(Lh)}),(t.altMode||i.cancelled)&&a.set("_cmpDrag",1)}},kb=(function(a){Ab(r,a);function r(t){var e=a.call(this,t,"Commands",Eb)||this;e.CommandAbstract=Hu.default,e.defaultCommands={},e.commands={},e.active={},e.events=Pb.A;var n=e.config,i=n.pStylePrefix,l=e.defaultCommands;i&&(n.stylePrefix=i+n.stylePrefix),Object.keys(n.defaults).forEach(function(c){var f=n.defaults[c];f.id&&e.add(f.id,f)}),l["tlb-delete"]={run:function(c){return c.runCommand("core:component-delete")}},l["tlb-clone"]={run:function(c){c.runCommand("core:copy"),c.runCommand("core:paste",{action:"clone-component"})}},l["tlb-move"]={run:function(c,f,v){var g;v===void 0&&(v={});var y,_=c.getModel(),b=v.event,S=v.target,E=S?[S]:Xd([],c.getSelectedAll(),!0),N=E.map(function(I){var B,U;return((U=(B=I.delegate)===null||B===void 0?void 0:B.move)===null||U===void 0?void 0:U.call(B,I))||I}).filter(Boolean),z=N[N.length-1],R=b?.type==="dragstart",W=["absolute","translate"];if(!z?.get("draggable"))return _.logWarning("The element is not draggable");var ct=z.get("dmode")||_.get("dmode"),_t=function(){return _.stopDefault(Lh)},xt=(0,k.includes)(W,ct);N.forEach(function(I){return I.trigger("disable",{fromMove:!0})}),R?setTimeout(_t,0):_t();var ut=Dh(_),q=jh(_),lt=Ih(_,N,{altMode:xt});if(xt)y=c.runCommand("core:component-drag",{guidesInfo:1,mode:ct,target:z,onStart:ut,onDrag:q,onEnd:lt,event:b});else{R&&b.dataTransfer.setDragImage((g=z.view)===null||g===void 0?void 0:g.el,0,0);var H=c.Commands.get("move-comp");H.onStart=ut,H.onDrag=q,H.onEndMoveFromModel=lt,H.initSorterFromModels(N)}N.filter(function(I){return I.get("selectable")}).forEach(function(I){return I.set("status","freezed-selected")})}},l["core:undo"]=function(c){return c.UndoManager.undo()},l["core:redo"]=function(c){return c.UndoManager.redo()},Jd.forEach(function(c){var f=c[2],v=De(585)("./".concat(c[1])).default,g="core:".concat(c[0]);l[g]=v,f&&(l[f]=v,["run","stop"].forEach(function(y){t.on("".concat(y,":").concat(f),function(){for(var _=[],b=0;b<arguments.length;b++)_[b]=arguments[b];return t.trigger.apply(t,Xd(["".concat(y,":").concat(g)],_,!1))})}))}),n.model=t.Canvas;for(var u in l)e.add(u,l[u]);return e}return r.prototype.add=function(t,e){var n=(0,k.isFunction)(e)?{run:e}:e;return n.stop||(n.noStop=!0),delete n.initialize,n.id=t,this.commands[t]=Hu.default.extend(n),this},r.prototype.get=function(t){var e=this.commands[t];return(0,k.isFunction)(e)?(e=new e(this.config),this.commands[t]=e):e||this.em.logWarning("'".concat(t,"' command not found")),e},r.prototype.extend=function(t,e){e===void 0&&(e={});var n=this.get(t);if(n){var i=wl(wl({},n.constructor.prototype),e);this.add(t,i);var l=Jd.filter(function(u){return"core:".concat(u[0])===t&&u[2]})[0];l&&this.add(l[2],i)}return this},r.prototype.has=function(t){return!!this.commands[t]},r.prototype.getAll=function(){return this.commands},r.prototype.run=function(t,e){return e===void 0&&(e={}),this.runCommand(this.get(t),e)},r.prototype.stop=function(t,e){return e===void 0&&(e={}),this.stopCommand(this.get(t),e)},r.prototype.isActive=function(t){return this.getActive().hasOwnProperty(t)},r.prototype.getActive=function(){return this.active},r.prototype.runCommand=function(t,e){e===void 0&&(e={});var n;if(t&&t.run){var i=this,l=i.em,u=i.config,c=t.id,f=l.Editor;(!this.isActive(c)||e.force||!u.strict)&&(n=f&&t.callRun(f,e),c&&t.stop&&!t.noStop&&!e.abort&&(this.active[c]=n))}return n},r.prototype.stopCommand=function(t,e){e===void 0&&(e={});var n;if(t&&t.run){var i=this,l=i.em,u=i.config,c=t.id,f=l.Editor;(this.isActive(c)||e.force||!u.strict)&&(c&&delete this.active[c],n=t.callStop(f,e))}return n},r.prototype.create=function(t){t.stop||(t.noStop=!0);var e=Hu.default.extend(t);return new e(this.config)},r.prototype.__onRun=function(t,e){var n=this,i=n.em,l=n.events;i.on("".concat(l.runCommand).concat(t),e)},r.prototype.__onStop=function(t,e){var n=this,i=n.em,l=n.events;i.on("".concat(l.stopCommand).concat(t),e)},r.prototype.destroy=function(){this.defaultCommands={},this.commands={},this.active={}},r}
318)(pr),Mb=kb,Lb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Zd="contentEditable",Rs="data-toggle-move",Db=(function(a){Lb(r,a);function r(t){var e=a.call(this,t)||this;(0,k.bindAll)(e,"__render"),e.opt=t,e.module=t.module,e.config=t.config||{},e.sorter=t.sorter||"",e.parentView=t.parentView;var n=e,i=n.model,l=n.pfx,u=n.ppfx,c=i.get("type")||"default";return e.className="".concat(l,"layer ").concat(l,"layer__t-").concat(c," no-select ").concat(u,"two-color"),e.inputNameCls="".concat(u,"layer-name"),e.clsTitleC="".concat(l,"layer-title-c"),e.clsTitle="".concat(l,"layer-title"),e.clsCaret="".concat(l,"layer-caret"),e.clsCount="".concat(l,"layer-count"),e.clsMove="".concat(l,"layer-move"),e.clsChildren="".concat(l,"layer-children"),e.clsNoChild="".concat(l,"layer-no-chld"),e.clsEdit="".concat(e.inputNameCls,"--edit"),e.clsNoEdit="".concat(e.inputNameCls,"--no-edit"),e.initComponent(),e}return r.prototype.events=function(){var t;return t={},t["mousedown [".concat(Rs,"]")]="startSort",t["touchstart [".concat(Rs,"]")]="startSort",t["click [data-toggle-visible]"]="toggleVisibility",t["click [data-toggle-open]"]="toggleOpening",t["click [data-toggle-select]"]="handleSelect",t["mouseover [data-toggle-select]"]="handleHover",t["mouseout [data-toggle-select]"]="handleHoverOut",t["dblclick [data-name]"]="handleEdit",t["keydown [data-name]"]="handleEditKey",t["focusout [data-name]"]="handleEditEnd",t},r.prototype.template=function(t){var e=this,n=e.pfx,i=e.ppfx,l=e.config,u=e.clsNoEdit,c=e.module,f=e.opt,v=e.em,g=l.hidable,y=c.getComponents(t).length,_=y?"":this.clsNoChild,b="".concat(this.clsTitle," ").concat(_),S="".concat(this.clsTitleC),E="".concat(this.inputNameCls," ").concat(u," ").concat(i,"no-app"),N=f.level||0,z="".concat(N*10,"px"),R=t.getName(),W=t.getIcon(),ct="".concat(n,"layer"),_t=(v?.getConfig()).icons,xt=_t,ut=xt.move,q=xt.eye,lt=xt.eyeOff,H=xt.chevron;return` 319 <div class="`.concat(n,"layer-item ").concat(i,`one-bg" data-toggle-select> 320 <div class="`).concat(n,`layer-item-left"> 321 `).concat(g?'<i class="'.concat(n,`layer-vis" data-toggle-visible> 322 <i class="`).concat(n,'layer-vis-on">').concat(q,`</i> 323 <i class="`).concat(n,'layer-vis-off">').concat(lt,`</i> 324 </i>`):"",` 325 <div class="`).concat(S,`"> 326 <div class="`).concat(b,'" style="padding-left: ').concat(z,`"> 327 <div class="`).concat(n,'layer-title-inn" title="').concat(R,`"> 328 <i class="`).concat(this.clsCaret,'" data-toggle-open>').concat(H,`</i> 329 `).concat(W?'<span class="'.concat(ct,'__icon">').concat(W,"</span>"):"",` 330 <span class="`).concat(E,'" data-name>').concat(R,`</span> 331 </div> 332 </div> 333 </div> 334 </div> 335 <div class="`).concat(n,`layer-item-right"> 336 <div class="`).concat(this.clsCount,'" data-count>').concat(y||"",`</div> 337 <div class="`).concat(this.clsMove,'" ').concat(Rs,">").concat(ut||"",`</div> 338 </div> 339 </div> 340 <div class="`).concat(this.clsChildren,`"></div> 341 `)},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,n=e.model,i=e.config,l=i.onInit,u=n.components();this.listenTo(u,"remove add reset",this.checkChildren),[["change:status",this.updateStatus],["change:open",this.updateOpening],["change:layerable",this.updateLayerable],["change:style:display",this.updateVisibility],["change:draggable",this.updateMove],["rerender:layer",this.render],["change:name change:custom-name",this.updateName]].forEac
341h(function(c){return t.listenTo(n,c[0],c[1])}),this.$el.data("model",n),this.$el.data("collection",u),n.viewLayer=this,l.bind(this)({component:n,render:this.__render,listenTo:this.listenTo})},r.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},r.prototype.getVisibilityEl=function(){return this.getItemContainer().find("[data-toggle-visible]")},r.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,i=t.module,l="".concat(e,"layer-hidden"),u=!i.isVisible(n),c=u?"addClass":"removeClass";this.$el[c](l),this.getVisibilityEl()[c]("".concat(e,"layer-off"))},r.prototype.updateMove=function(){var t=this,e=t.model,n=t.config,i=this.getItemContainer().find("[".concat(Rs,"]"))[0];if(i){var l=e.get("draggable")&&n.sortable;i.style.display=l?"":"none"}},r.prototype.toggleVisibility=function(t){t?.stopImmediatePropagation();var e=this,n=e.module,i=e.model;n.setVisible(i,!n.isVisible(i))},r.prototype.handleEdit=function(t){t?.stopPropagation();var e=this,n=e.em,i=e.$el,l=e.clsNoEdit,u=e.clsEdit,c=this.getInputName();c[Zd]="true",c.focus(),document.execCommand("selectAll",!1),n.setEditing(!0),i.find(".".concat(this.inputNameCls)).removeClass(l).addClass(u)},r.prototype.handleEditKey=function(t){t.stopPropagation(),((0,$t.v$)(t)||(0,$t.Ci)(t))&&this.handleEditEnd(t)},r.prototype.handleEditEnd=function(t){t?.stopPropagation();var e=this,n=e.em,i=e.$el,l=e.clsNoEdit,u=e.clsEdit,c=e.model,f=this.getInputName(),v=f.textContent;f.scrollLeft=0,f[Zd]="false",c.setName(v),n.setEditing(!1),i.find(".".concat(this.inputNameCls)).addClass(l).removeClass(u),this.updateName()},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",u="".concat(i,"layer-open"),c=this.getCaret();this.module.isOpen(n)?(e.addClass(l),c.addClass(u)):(e.removeClass(l),c.removeClass(u))},r.prototype.toggleOpening=function(t){var e=this,n=e.model,i=e.module;t?.stopImmediatePropagation(),n.get("components").length&&i.setOpen(n,!i.isOpen(n))},r.prototype.handleSelect=function(t){t?.stopPropagation();var e=this,n=e.module,i=e.model;n.setLayerData(i,{selected:!0},{event:t})},r.prototype.handleHover=function(t){t?.stopPropagation();var e=this,n=e.module,i=e.model;n.setLayerData(i,{hovered:!0})},r.prototype.handleHoverOut=function(t){t?.stopPropagation();var e=this,n=e.module,i=e.model;n.setLayerData(i,{hovered:!1})},r.prototype.startSort=function(t){var e,n,i;t.stopPropagation();var l=this,u=l.em,c=l.sorter,f=l.model;if(!(t.button&&t.button!==0)&&c){var v=((n=(e=f.delegate)===null||e===void 0?void 0:e.move)===null||n===void 0?void 0:n.call(e,f))||f;c.onStart=Dh(u),c.onMoveClb=jh(u),c.onEndMove=Ih(u,[v]);var g=((i=v.viewLayer)===null||i===void 0?void 0:i.el)||t.target;c.startSort(g)}},r.prototype.updateStatus=function(){yn.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:!0}])},r.prototype.getItemContainer=function(){return this.$el.children("[data-toggle-select]")},r.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,i=t.module,l=i.getComponents(e).length,u=this.getItemContainer(),c=u.find(".".concat(this.clsTitle)),f=u.find("[data-count]");c[l?"removeClass":"addClass"](n),f.html("".concat(l||"")),!l&&i.setOpen(e,!1)},r.prototype.getCaret=function(){return(!this.caret||!this.caret.length)&&(this.caret=this.getItemContainer().find(".".concat(this.clsCaret))),this.caret},r.prototype.setRoot=function(t){var e,n=(0,k.isString)(t)?(e=this.em.getWrapper())===null||e===void 0?void 0:e.find(t)[0]:t;n&&(this.stopListening(),this.model=n,this.initComponent(),this._rendered&&this.render())},r.prototype.updateLayerable=function(){var t=this.parentView,e=t||this;e.render()},r.prototype.__clearItems=function(){var t;(t=this.items)===null||t===void 0||t.remove()},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Wt.Ss.prototype.remove.apply(this,t),delete this.model.viewLayer,this.__clearItems(),this},r.prototype.render=function(){var t=this,e=t.model,n=t.config,i=t.pfx,l=t.ppfx,u=t.opt,c=t.sorter;this.__clearItems();var f=u.opened,v=u.module,g=u.ItemView,y=!v.__isLayerable(e),_=this.$el.empty(),b=u.level+1;delete this.inputName,this.items=new Ob({ItemView:g,collection:e.get("
341components"),config:n,sorter:c,opened:f,parentView:this,parent:e,level:b,module:v});var S=this.items.render().$el;return!n.showWrapper&&b===1?_.append(S):(_.html(this.template(e)),_.find(".".concat(this.clsChildren)).append(S)),!v.isVisible(e)&&(this.className+=" ".concat(i,"hide")),y&&(this.className+=" ".concat(l,"hidden")),_.attr("class",this.className),this.updateStatus(),this.updateOpening(),this.updateVisibility(),this.updateMove(),this.__render(),this._rendered=!0,this},r.prototype.__render=function(){var t=this,e=t.model,n=t.config,i=t.el,l=n.onRender,u={component:e,el:i};l.bind(this)(u),this.em.trigger("layer:render",u)},r})(Wt.Ss),jb=Db,Ib=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),dc=function(){return dc=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},dc.apply(this,arguments)},Rh="layer",Mc="".concat(Rh,":"),Nh="".concat(Mc,"root"),Fh="".concat(Mc,"component"),Rb="".concat(Mc,"custom"),Nb={all:Rh,root:Nh,component:Fh,custom:Rb},Uu={mediaText:""},Fb=["open","status","locked","custom-name","components","classes"].map(function(a){return"".concat(Vn.I.update,":").concat(a)}).join(" "),Vb=function(a){return a===void 0&&(a={}),(a.display||"").trim().indexOf("none")===0},Hb=(function(a){Ib(r,a);function r(t){var e=a.call(this,t,"LayerManager",xb)||this;return e.events=Nb,(0,k.bindAll)(e,"componentChanged","__onRootChange","__onComponent"),e.model=new Ii.A(e,{opened:{}}),e.config.stylePrefix=e.config.pStylePrefix,e}return r.prototype.onLoad=function(){var t=this,e=this,n=e.em,i=e.config,l=e.model;l.listenTo(n,"component:selected",this.componentChanged),l.on("change:root",this.__onRootChange),l.listenTo(n,Fb,this.__onComponent),this.componentChanged(),l.listenToOnce(n,"load",function(){t.setRoot(i.root),t.__appendTo()})},r.prototype.setRoot=function(t){var e=this.em.getWrapper(),n=(0,At.isComponent)(t)?t:e;t&&(0,k.isString)(t)&&(0,At.hasWin)()&&(n=e.find(t)[0]||e);var i=this.__getLayerFromComponent(n);return this.model.set("root",i),i},r.prototype.getRoot=function(){return this.model.get("root")},r.prototype.getComponents=function(t){var e=this;return t.components().map(function(n){return e.__getLayerFromComponent(n)}).filter(function(n){return e.__isLayerable(n)})},r.prototype.setOpen=function(t,e){t.set("open",e)},r.prototype.isOpen=function(t){return!!t.get("open")},r.prototype.setVisible=function(t,e){var n="__prev-display",i=t.getStyle(Uu),l=i.display;if(e){var u=t.get(n);delete i.display,u&&(i.display=u,t.unset(n))}else l&&t.set(n,l),i.display="none";t.setStyle(i,Uu),this.updateLayer(t),this.em.trigger("component:toggled")},r.prototype.isVisible=function(t){return!Vb(t.getStyle(Uu))},r.prototype.setLocked=function(t,e){t.set("locked",e)},r.prototype.isLocked=function(t){return!!t.get("locked")},r.prototype.setName=function(t,e){t.set("custom-name",e)},r.prototype.getName=function(t){return t.getName()},r.prototype.getLayerData=function(t){var e=t.get("status");return{name:t.getName(),open:this.isOpen(t),selected:e==="selected",hovered:e==="hovered",visible:this.isVisible(t),locked:this.isLocked(t),components:this.getComponents(t)}},r.prototype.setLayerData=function(t,e,n){var i;n===void 0&&(n={});var l=this,u=l.em,c=l.config,f=e.open,v=e.selected,g=e.hovered,y=e.visible,_=e.locked,b=e.name,S=dc({fromLayers:!0},n);if((0,At.isDef)(f)&&this.setOpen(t,f),(0,At.isDef)(v))if(v){u.setSelected(t,S);var E=c.scrollCanvas;E&&((i=t.views)===null||i===void 0||i.forEach(function(N){return N.scrollIntoView(E)}))}else u.removeSelected(t,S);(0,At.isDef)(g)&&c.showHover&&(g?u.setHovered(t,S):u.setHovered(null,S)),(0,At.isDef)(y)&&y!==this.isVisible(t)&&this.setVisible(t,y),(0,At.isDef)(_)&&this.setLocked(t,_),(0,At.isDef)(b)&&this.setName(t,b)},r.prototype.componentChanged=function(t,e){var n;if(e===void 0&&(e={}),!e.fromLayers){var i=this,l=i.em,u=i.config,c=u.scrollLayers,f=this.model.get("opened"),v=l.getSelected(),g=v?.parent();for(var y in f)f[y].set("open",!1),delete f[y];for(;g;)g.set("open",!0),f[g.cid]=g,g=g.parent();if(v&&c){var _=(n=v.viewLayer)===null||n===void 0?void 0:n.el;_?.scrollIntoView(c)}}},r.prototype.getAll=function(){return this.view},r.prototype.render=function(){var t,e,n=this,i=n.config,l=n.model,u=jb.extend(i.extend);return this.view=new u({el:(t=this.view)===null||t===void 0?void 0:t.el,ItemView:u,level:0,config:i,opened:l.get("opened"),model:this.getRoot(),module:this}),(e=this.view)===null||e===void 0?void 0:e.render().el},r.prototype.destroy=function(){var t;(t=this.view)===null||t===void 0||t.remove()},r.prototype.__onRootChange=function(){var t,e=this.getRoot();(t=this.view)===null||t===void 0||t.setRoot(e),this.em.trigger(Nh,e),this.__trgCustom()},r.prototype.__getLayerFromComponent=function(t){var e,n;return((n=(e=t.delegate)===null||e===void 0?void 0:e.layer)===null||n===void 0?void 0:n.call(e,t))||t},r.prototype.__onComponent=function(t){this.updateLayer(t)},r.prototype.__isLayerable=function(t){var e=t.tagName,n=this.config.hideTextnode,i=!n||!t.isInstanceOf("textnode")&&e!=="br";return i&&t.get("layerable")},r.prototype.__trgCustom=function(t){var e=this,n=e.__ctn,i=e.em,l=e.events;this.__ctn=n||t?.container,i.trigger(l.custom,{container:this.__ctn,root:this.getRoot()})},r.prototype.updateLayer=function(t,e){this.em.trigger(Fh,t,e)},r})(pr),Ub=Hb,Bb={assets:[],noAssets:"",stylePrefix:"am-",upload:"",uploadName:"files",headers:{},params:{},credentials:"include",multiUpload:!0,multiUploadSuffix:"[]",autoAdd:!0,customFetch:void 0,uploadFile:void 0,embedAsBase64:!0,handleAdd:void 0,beforeUpload:void 0,showUrlInput:!0,custom:!1,dropzone:!1,openAssetsOnDrop:!0,dropzoneContent:""}
341,Wb=Bb,zb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Vh=(function(a){zb(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.getDefaults=function(){return(0,k.result)(this.prototype,"defaults")},r.prototype.defaults=function(){return{type:"",src:""}},r.prototype.getType=function(){return this.get("type")},r.prototype.getSrc=function(){return this.get("src")},r.prototype.getFilename=function(){return this.get("src").split("/").pop().split("?").shift()},r.prototype.getExtension=function(){return this.getFilename().split(".").pop()},r})(Wt.Kx),pc=Vh;Vh.prototype.idAttribute="src";var Kb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),bl=function(){return bl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},bl.apply(this,arguments)},Gb=(function(a){Kb(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return bl(bl({},pc.getDefaults()),{type:"image",unitDim:"px",height:0,width:0})},r})(pc),$b=Gb,qb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Yb=(function(a){qb(r,a);function r(t){var e=a.call(this,t)||this;e.options=t,e.collection=t.collection;var n=t.config||{};e.config=n,e.pfx=n.stylePrefix||"",e.ppfx=n.pStylePrefix||"",e.em=n.em,e.className=e.pfx+"asset",e.listenTo(e.model,"destroy remove",e.remove),e.model.view=e;var i=e.init&&e.init.bind(e);return i&&i(t),e}return r.prototype.__getBhv=function(){var t=this.em,e=t?.Assets;return e?.__getBehaviour()||{}},r.prototype.template=function(t,e){var n=this.pfx;return` 342 <div class="`.concat(n,`preview-cont"> 343 `).concat(this.getPreview(),` 344 </div> 345 <div class="`).concat(n,`meta"> 346 `).concat(this.getInfo(),` 347 </div> 348 <div class="`).concat(n,`close" data-toggle="asset-remove"> 349 ⨯ 350 </div> 351 `)},r.prototype.updateTarget=function(t){t&&t.set&&(t.set("attributes",(0,k.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})(Wt.Ss),Xb=Yb,Jb=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Qd=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},Hh=(function(a){Jb(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.getPreview=function(){var t=this,e=t.pfx,n=t.ppfx,i=t.model,l=i.get("src");return fr(tp||(tp=Qd([` 352 <div class="`,`preview" style="background-image: url('`,`');"></div> 353 <div class="`,"preview-bg ",`checker-bg"></div> 354 `],[` 355 <div class="`,`preview" style="background-image: url('`,`');"></div> 356 <div class="`,"preview-bg ",`checker-bg"></div> 357 `])),e,l,e,n)},r.prototype.getInfo=function(){var t=this,e=t.pfx,n=t.model,i=n.get("name"),l=n.get("width"),u=n.get("height"),c=n.get("unitDim"),f=l&&u?"".concat(l,"x").concat(u).
357concat(c):"";return i=i||n.getFilename(),fr(ep||(ep=Qd([` 358 <div class="`,'name">',`</div> 359 <div class="`,'dimensions">',`</div> 360 `],[` 361 <div class="`,'name">',`</div> 362 <div class="`,'dimensions">',`</div> 363 `])),e,i,e,f)},r.prototype.init=function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},r.prototype.onClick=function(){var t=this,e=t.model,n=t.pfx,i=this.__getBhv().select,l=this.config.onClick,u=this.collection;u.trigger("deselectAll"),this.$el.addClass(n+"highlight"),(0,k.isFunction)(i)?i(e,!1):(0,k.isFunction)(l)?l(e):this.updateTarget(u.target)},r.prototype.onDblClick=function(){var t=this,e=t.em,n=t.model,i=this.__getBhv().select,l=this.config.onDblClick,u=this.collection,c=u.target,f=u.onSelect;(0,k.isFunction)(i)?i(n,!0):(0,k.isFunction)(l)?l(n):(this.updateTarget(c),e?.Modal.close()),(0,k.isFunction)(f)&&f(n)},r.prototype.onRemove=function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)},r})(Xb),Zb=Hh;Hh.prototype.events={"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"};var tp,ep,xl=function(){return xl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},xl.apply(this,arguments)},Qb={types:[],initialize:function(a,r){var t=this;r===void 0&&(r={});var e=r.em;this.em=e,this.opts=r,this.model=function(i,l){i===void 0&&(i={}),l===void 0&&(l={});var u,c,f;if(i&&i.type){var v=t.getBaseType();f=t.getType(i.type),u=f?f.model:v.model,c=f?f.view:v.view}else{var g=t.recognizeType(i);f=g.type,u=f.model,c=f.view,i=g.attributes}var y=new u(i,xl(xl({},l),{em:e}));return y.typeView=c,t.model.prototype=u.prototype,y};var n=this.init&&this.init.bind(this);n&&n()},recognizeType:function(a){for(var r=this.getTypes(),t=0;t<r.length;t++){var e=r[t],n=e.isType(a);if(n=typeof n=="boolean"&&n?{type:e.id}:n,n)return{type:e,attributes:n}}return{type:this.getBaseType(),attributes:a}},getBaseType:function(){var a=this.getTypes();return a[a.length-1]},getTypes:function(){return this.types},getType:function(a){for(var r=this.getTypes(),t=0;t<r.length;t++){var e=r[t];if(e.id===a)return e}},addType:function(a,r){var t=this.getType(a),e=this.getBaseType(),n=t?t.model:e.model,i=t?t.view:e.view,l=r.model,u=r.view,c=r.isType;l=l instanceof Wt.Kx||(0,k.isFunction)(l)?l:n.extend(l||{}),u=u instanceof Wt.Ss||(0,k.isFunction)(u)?u:i.extend(u||{}),this.extendViewApi&&!r.model&&!r.view&&(u=u.extend(r)),t?(t.model=l,t.view=u,t.isType=c||t.isType):(r.id=a,r.model=l,r.view=u,r.isType=c||function(f){if(f&&f.type==a)return!0},this.getTypes().unshift(r))}},Uh=Qb,tx=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ex=Wt.pM.extend(Uh),Bh=(function(a){tx(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r})(ex),Bu=Bh;Bh.prototype.types=[{id:"image",model:$b,view:Zb,isType:function(a){return typeof a=="string"?{type:"image",src:a}:a}}];var Wh=(function(a){return a.add="asset:add",a.remove="asset:remove",a.removeBefore="asset:remove:before",a.update="asset:update",a.open="asset:open",a.close="asset:close",a.uploadStart="asset:upload:start",a.uploadEnd="asset:upload:end",a.uploadError="asset:upload:error",a.uploadResponse="asset:upload:response",a.custom="asset:custom",a.all="asset",a})(Wh||{}),np=Wh,nx=(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");a(r,t);function e(){this.constructor=r}
363r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),zh=(function(a){nx(r,a);function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;e.options=t,e.config=t.config,e.pfx=e.config.stylePrefix||"",e.ppfx=e.config.pStylePrefix||"",e.em=e.config.em;var n=e.collection;return e.listenTo(n,"reset",e.renderAssets),e.listenTo(n,"add",e.addToAsset),e.listenTo(n,"remove",e.removedAsset),e.listenTo(n,"deselectAll",e.deselectAll),e}return r.prototype.template=function(t){var e=t.pfx,n=t.ppfx,i=t.em,l="";return this.config.showUrlInput&&(l=` 364 <form class="`.concat(e,`add-asset"> 365 <div class="`).concat(n,"field ").concat(e,`add-field"> 366 <input placeholder="`).concat(i?.t("assetManager.inputPlh"),`"/> 367 </div> 368 <button class="`).concat(n,'btn-prim">').concat(i?.t("assetManager.addButton"),`</button> 369 <div style="clear:both"></div> 370 </form> 371 `)),` 372 <div class="`.concat(e,`assets-cont"> 373 <div class="`).concat(e,`assets-header"> 374 `).concat(l,` 375 </div> 376 <div class="`).concat(e,`assets" data-el="assets"></div> 377 <div style="clear:both"></div> 378 </div> 379 `)},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,u=new t.typeView({model:t,collection:i,config:l}).render().el;if(n)n.appendChild(u);else{var c=this.getAssetsEl();c&&c.insertBefore(u,c.firstChild)}return u},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})(Wt.Ss),rx=zh;zh.prototype.events={submit:"handleSubmit"};var ix=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ox=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},ax=(function(a){ix(r,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:!0;var i=n.uploadFile;return i?e.uploadFile=i.bind(e):!n.upload&&n.embedAsBase64&&(e.uploadFile=r.embedAsBase64),e.delegateEvents(),e}return r.prototype.template=function(t){var e=t.pfx,n=t.title,i=t.uploadId,l=t.disabled,u=t.multiUpload;return fr(rp||(rp=ox([` 380 <form> 381 <div id="`,'title">',`</div> 382 <input 383 data-input 384 type="file" 385 id="`,`" 386 name="file" 387 accept="*/*" 388 `,` 389 `,` 390 /> 391 <div style="clear:both;"></div> 392 </form> 393 `],[` 394 <form> 395 <div id="`,'title">',`</div> 396 <input 397 data-input 398 type="file" 399 id="`,`" 400 name="file" 401 accept="*/*" 402 `,` 403 `,` 404 /> 405 <div style="clear:both;"></div> 406 </form> 407 `])),e,n,i,l?"disabled":"",u?"multiple":"")},r.prototype.events=function(){return{"change [data-input]":"uploadFile"}},r.prototype.onUploadStart=function(){var t=this.module;t?.__propEv(t.events.uploadStart)},r.prototype.onUploadEnd=function(t){var e=this,n=e.$el,i=e.module;i?.__propEv(i.events.uploadEnd,t);var l=n.find("input");l&&l.val("")},r.prototype.onUploadError=function(t){var e=this.module;console.error(t),this.onUploadEnd(t),e?.__propEv(e.events.uploadError,t)},r.prototype.onUploadResponse=function(t,e){var n=this,i=n.module,l=n.config,u=n.target,c;try{c=typeof t=="string"?JSON.parse(t):t}catch(f){c=t}i?.__propEv(i.events.uploadResponse,c),l.autoAdd&&u&&u.add(c.data,{at:0}),this.onUploadEnd(t),e?.(c)},r.prototype.uploadFile=function(t,e){var n=this,i=t.dataTransfer?t.dataTransfer.files:t.target.files,l=this.config,u=l.beforeUpload,c=u&&u(i);if(c!==!1){var f=new FormData,v=l.params,g=l.customFetch,y=l.fetchOptions;for(var _ in v)f.append(_,v[_]);if(this.multiUpload)for(var b=0;b<i.length;b++)f.append("".concat(l.uploadName).concat(l.multiUploadSuffix),i[b]);else i.length&&f.append(l.uploadName,i[0]);var S=l.upload,E=l.headers,N="X-Requested-With";if(typeof E[N]>"u"&&(E[N]="XMLHttpRequest"),S){this.onUploadStart();var z={method:"post",credentials:l.credentials||"include",headers:E,body:f},R=y?.(z)||z,W=g?g(S,R):Ch(S,R).then(function(ct){return(ct.status/200|0)==1?ct.text():ct.text().then(function(_t){return Promise.reject(_t)})});return W.then(function(ct){return n.onUploadResponse(ct,e)}).catch(function(ct){return n.onUploadError(ct)})}}},r.prototype.initDrop=function(){var t=this;if(!this.uploadForm){this.uploadForm=this.$el.find("form").get(0);var e=this.uploadForm;"draggable"in e&&(this.uploadForm.ondragover=function(){return e.className=t.pfx+"hover",!1},this.uploadForm.ondragleave=function(){return e.className="",!1},this.uploadForm.ondrop=function(n){e.className="",n.preventDefault(),t.uploadFile(n)})}},r.prototype.initDropzone=function(t){var e=this,n=0,i=this.config,l=t.model,u=t.el,c=l.Editor,f=l.Canvas.getBody(),v=this.ppfx,g="".concat(v,"dropzone-active"),y="".concat(v,"dropzone"),_=function(){u.className=u.className.replace(g,"").trim(),n=0},b=function(){return n||(u.className+=" ".concat(g),n=1),!1},S=function(){return _(),!1},E=function(N){if(_(),N.preventDefault(),N.stopPropagation(),e.uploadFile(N),i.openAssetsOnDrop&&c){var z=c.getSelected();c.runCommand("open-assets",{target:z,onSelect:function(){c.Modal.close(),c.AssetManager.setTarget(null)}})}return!1};t.$el.append('<div class="'.concat(y,'">').concat(i.dropzoneContent,"</div>")),_(),"draggable"in u&&[u,f].forEach(function(N){N.ondragover=b,N.ondragleave=S,N.ondrop=E})},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){this.onUploadError(new Error("Unsupported platform, FileReader is not defined"));return}for(var u=[],c=/^(.+)\/(.+)$/,f=function(_){var b=new Promise(function(S,E){var N=new FileReader;N.addEventListener("load",function(z){var R,W=_.name,ct=c.exec(_.type);if(ct?R=ct[1]:R=_.type,R==="image"){var _t={src:N.result,name:W,type:R,height:0,width:0},xt=new Image;xt.addEventListener("error",function(ut){E(ut)}),xt.addEventListener("load",function(){_t.height=xt.height,_t.width=xt.width,S(_t)}),xt.src=_t.src}else S(R?{src:N.result,name:W,type:R}:N.result)}),N.addEventListener("error",function(z){E(z)}),N.addEventListener("abort",function(z){E("Aborted")}),N.readAsDataURL(_)});u.push(b)},v=0,g=i;v<g.length;v++){var y=g[v];f(y)}return Promise.all(u).then(function(_){l.data=_,n.onUploadResponse(l,e)},function(_){n.onUploadError(_)})},r})(Wt.Ss),sx=ax,rp,lx=(function(){var a=function(r,t){return a=Object.
407setPrototypeOf||{__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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Fo=function(){return Fo=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Fo.apply(this,arguments)},ip=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Ea="open-assets",ux=(function(a){lx(r,a);function r(t){var e=a.call(this,t,"AssetManager",new Bu([],t),np,Wb)||this;e.storageKey="assets",e.Asset=pc,e.Assets=Bu,e.events=np;var n=e,i=n.all,l=n.config;e.assetsVis=new Bu([]);var u=l.pStylePrefix;return u&&(l.stylePrefix="".concat(u).concat(l.stylePrefix)),i.on("add",function(c){return e.getAllVisible().add(c)}),i.on("remove",function(c){return e.getAllVisible().remove(c)}),e.__onAllEvent=(0,k.debounce)(function(){return e.__trgCustom()},0),e}return r.prototype.open=function(t){t===void 0&&(t={});var e=this.em.Commands;e.run(Ea,Fo({types:["image"],select:function(){}},t))},r.prototype.close=function(){var t=this.em.Commands;t.stop(Ea)},r.prototype.isOpen=function(){var t=this.em.Commands;return!!t?.isActive(Ea)},r.prototype.add=function(t,e){return e===void 0&&(e={}),typeof e.at>"u"&&(e.at=0),this.all.add(t,e)},r.prototype.get=function(t){return this.all.where({src:t})[0]||null},r.prototype.getAll=function(){return this.all},r.prototype.getAllVisible=function(){return this.assetsVis},r.prototype.remove=function(t,e){return this.__remove(t,e)},r.prototype.store=function(){return this.getProjectData()},r.prototype.load=function(t){return this.loadProjectData(t)},r.prototype.getContainer=function(){var t,e=this.__getBehaviour();return e.container||((t=this.am)===null||t===void 0?void 0:t.el)},r.prototype.getAssetsEl=function(){var t;return(t=this.am)===null||t===void 0?void 0:t.el.querySelector("[data-el=assets]")},r.prototype.render=function(t){if(!this.getConfig().custom){var e=t||this.getAll().models;if(!this.am){var n=this.__viewParams();n.fu=this.FileUploader(),this.am=new rx(Fo({},n)),this.am.render()}return this.assetsVis.reset(e),this.getContainer()}},r.prototype.__viewParams=function(){return{collection:this.assetsVis,globalCollection:this.all,config:this.config,module:this,fu:void 0}},r.prototype.addType=function(t,e){this.getAll().addType(t,e)},r.prototype.getType=function(t){return this.getAll().getType(t)},r.prototype.getTypes=function(){return this.getAll().getTypes()},r.prototype.AssetsView=function(){return this.am},r.prototype.FileUploader=function(){return this.fu||(this.fu=new sx(this.__viewParams())),this.fu},r.prototype.onLoad=function(){var t=this;this.getAll().reset(this.config.assets);var e=this,n=e.em,i=e.events;n.Commands.__onRun(Ea,function(){return t.__propEv(i.open)}),n.Commands.__onStop(Ea,function(){return t.__propEv(i.close)})},r.prototype.postRender=function(t){var e;this.config.dropzone&&((e=this.fu)===null||e===void 0||e.initDropzone(t))},r.prototype.setTarget=function(t){this.assetsVis.target=t},r.prototype.onSelect=function(t){this.assetsVis.onSelect=t},r.prototype.onClick=function(t){this.config.onClick=t},r.prototype.onDblClick=function(t){this.config.onDblClick=t},r.prototype.__propEv=function(t){for(var e,n,i=[],l=1;l<arguments.length;l++)i[l-1]=arguments[l];(e=this.em).trigger.apply(e,ip([t],i,!1)),(n=this.getAll()).trigger.apply(n,ip([t],i,!1))},r.prototype.__trgCustom=function(){var t=this.__getBehaviour(),e=this.getConfig().custom;!t.container&&!e.open||this.em.trigger(this.events.custom,this.__customData())},r.prototype.__customData=function(){var t=this,e=this.__getBehaviour();return{am:this,open:this.isOpen(),assets:this.getAll().models,types:e.types||[],container:e.container,close:function(){return t.close()},remove:function(n,i){return t.remove(n,i)},select:function(n,i){var l=t.add(n);(0,k.isFunction)(e.select)&&e.select(l,i)},options:e.options||{}}},r.prototype.__behaviour=function(t){return t===void 0&&(t={}),this._bhv=Fo(Fo({},this._bhv||{}),t)},r.prototype.__getBehaviour=function(t){return t===void 0&&(t={}),this._bhv||{}},r.prototype.destroy=function(){var t,e;this.all.stopListening(),this.all.reset(),this.assetsVis.stopListening(),this.assetsVis.reset(),(t=this.fu)===null||t===void 0||t.remove(),(e=this.am)===null||e===void 0||e.remove(),this._bhv={}},r}
407)(Ri),cx=ux,fx=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),dx=(function(a){fx(r,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(f){return n.unset(f)}));var u=t.frames||[l],c=new Hp(i.Canvas,u);return c.page=n,n.set("frames",c),!n.getId()&&n.set("id",i?.Pages._createId()),i?.UndoManager.add(c),n}return r.prototype.defaults=function(){return{name:"",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?.getComponent()},r.prototype.toJSON=function(t){t===void 0&&(t={});var e=Wt.Kx.prototype.toJSON.call(this,t),n=(0,k.result)(this,"defaults");return(0,k.forEach)(e,function(i,l){l.indexOf("_")===0&&delete e[l]}),(0,k.forEach)(n,function(i,l){e[l]===i&&delete e[l]}),e},r})(Wt.Kx),hc=dx,px=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Cl=function(){return Cl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Cl.apply(this,arguments)},hx=(function(a){px(r,a);function r(t,e){var n=a.call(this,t)||this;return n.on("reset",n.onReset),n.on("remove",n.onRemove),n.model=function(i,l){return l===void 0&&(l={}),new hc(i,Cl(Cl({},l),{em:e}))},n}return r.prototype.onReset=function(t,e){var n=this,i;(i=e?.previousModels)===null||i===void 0||i.map(function(l){return n.onRemove(l)})},r.prototype.onRemove=function(t){t?.onRemove()},r})(Wt.pM),vx=hx,gx=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),yx=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},op="change:selected",ap="main",mx=(function(a){gx(r,a);function r(t){var e=a.call(this,t,"PageManager",new vx([],t),ec)||this;e.events=ec,e.storageKey="pages",(0,k.bindAll)(e,"_onPageChange");var n=new Ii.A({_undo:!0});return e.model=n,e.pages.on("reset",function(i){return i.at(0)&&e.select(i.at(0))}),e.pages.on("all",e.__onChange,e),n.on(op,e._onPageChange),e}return Object.defineProperty(r.prototype,"pages",{get:function(){return this.all},enumerable:!1,configurable:!0}),r.prototype.getAll=function(){return yx([],this.all.models,!0)},r.prototype.__onChange=function(t,e,n,i){var l=this,u=l.em,c=l.events,f=i||n;u.trigger(c.all,{event:t,page:e,options:f})},r.prototype.onLoad=function(){var t,e=this,n=e.pages,i=e.config,l=e.em,u={silent:!0},c=((t=i.pages)===null||t===void 0?void 0:t.map(function(v){return new hc(v,{em:l,config:i})}
407))||[];n.add(c,u);var f=n.length?this._initPage():this.add({type:ap},u);f&&this.select(f,u)},r.prototype._onPageChange=function(t,e,n){var i=this,l=i.em,u=i.events,c=l.Layers,f=e.getMainComponent();c&&f&&c.setRoot(f),l.trigger(u.select,e,t.previous("selected")),this.__onChange(op,e,n)},r.prototype.postLoad=function(){var t=this,e=t.em,n=t.model,i=t.pages,l=e.UndoManager;l.add(n),l.add(i),i.on("add remove reset change",function(u,c,f){return e.changesUp(f||c)})},r.prototype.add=function(t,e){var n=this;e===void 0&&(e={});var i=this,l=i.em,u=i.events;t.id=t.id||this._createId();var c=function(){var f=n.pages.add(new hc(t,{em:n.em,config:n.config}),e);return e.select&&n.select(f),f};return!e.silent&&l.trigger(u.addBefore,t,c,e),e.abort?void 0:c()},r.prototype.remove=function(t,e){var n=this;e===void 0&&(e={});var i=this,l=i.em,u=i.events,c=(0,k.isString)(t)?this.get(t):t,f=function(){return c&&n.pages.remove(c,e),c};return!e.silent&&l.trigger(u.removeBefore,c,f,e),!e.abort&&f()},r.prototype.get=function(t){return this.pages.filter(function(e){return e.get(e.idAttribute)===t})[0]},r.prototype.getMain=function(){var t=this.pages;return t.filter(function(e){return e.get("type")===ap})[0]||t.at(0)},r.prototype.getAllWrappers=function(){var t=this.getAll();return(0,k.unique)((0,k.flatten)(t.map(function(e){return e.getAllFrames().map(function(n){return n.getComponent()})})))},r.prototype.select=function(t,e){e===void 0&&(e={});var n=this,i=n.em,l=n.model,u=n.events,c=(0,k.isString)(t)?this.get(t):t;return c&&(i.trigger(u.selectBefore,c,e),l.set("selected",c,e)),this},r.prototype.getSelected=function(){return this.model.get("selected")},r.prototype.destroy=function(){var t=this;this.pages.off().reset(),this.model.stopListening(),this.model.clear({silent:!0}),["selected","model"].map(function(e){return t[e]=0})},r.prototype.store=function(){return this.getProjectData()},r.prototype.load=function(t){var e=this.loadProjectData(t,{all:this.pages,reset:!0});return this.pages.forEach(function(n){return n.getFrames().initRefs()}),e},r.prototype._initPage=function(){return this.get(this.config.selected)||this.getMain()},r.prototype._createId=function(){var t=this.getAll(),e=t.length+16,n=this.getAllMap(),i;do i=(0,At.createId)(e);while(n[i]);return i},r})(Ri),_x=mx,Wu={placeholder:"eg. Text here"},wx={assetManager:{addButton:"Add image",inputPlh:"http://path/to/the/image.jpg",modalTitle:"Select Image",uploadTitle:"Drop files here or click to upload"},blockManager:{labels:{},categories:{}},domComponents:{names:{"":"Box",wrapper:"Body",text:"Text",comment:"Comment",image:"Image",video:"Video",label:"Label",link:"Link",map:"Map",tfoot:"Table foot",tbody:"Table body",thead:"Table head",table:"Table",row:"Table row",cell:"Table cell"}},deviceManager:{device:"Device",devices:{desktop:"Desktop",tablet:"Tablet",mobileLandscape:"Mobile Landscape",mobilePortrait:"Mobile Portrait"}},panels:{buttons:{titles:{preview:"Preview",fullscreen:"Fullscreen","sw-visibility":"View components","export-template":"View code","open-sm":"Open Style Manager","open-tm":"Settings","open-layers":"Open Layer Manager","open-blocks":"Open Blocks"}}},selectorManager:{label:"Classes",selected:"Selected",emptyState:"- State -",states:{hover:"Hover",active:"Click","nth-of-type(2n)":"Even/Odd"}},styleManager:{empty:"Select an element before using Style Manager",layer:"Layer",fileButton:"Images",sectors:{general:"General",layout:"Layout",typography:"Typography",decorations:"Decorations",extra:"Extra",flex:"Flex",dimension:"Dimension"},properties:{"text-shadow-h":"X","text-shadow-v":"Y","text-shadow-blur":"Blur","text-shadow-color":"Color","box-shadow-h":"X","box-shadow-v":"Y","box-shadow-blur":"Blur","box-shadow-spread":"Spread","box-shadow-color":"Color","box-shadow-type":"Type","margin-top-sub":"Top","margin-right-sub":"Right","margin-bottom-sub":"Bottom","margin-left-sub":"Left","padding-top-sub":"Top","padding-right-sub":"Right","padding-bottom-sub":"Bottom","padding-left-sub":"Left","border-width-sub":"Width","border-style-sub":"Style","border-color-sub":"Color","border-top-left-radius-sub":"Top Left","border-top-right-radius-sub":"Top Right","border-bottom-right-radius-sub":"Bottom Right","border-bottom-left-radius-sub":"Bottom Left","transform-rotate-x":"Rotate X","transform-rotate-y":"Rotate Y","transform-rotate-z":"Rotate Z","transform-scale-x":"Scale X","transform-scale-y":"Scale Y","transform-scale-z":"Scale Z","transition-property-sub":"Property","transition-duration-sub":"Duration","transition-timing-function-sub":"Timing","background-image-sub"
407:"Image","background-repeat-sub":"Repeat","background-position-sub":"Position","background-attachment-sub":"Attachment","background-size-sub":"Size"}},traitManager:{empty:"Select an element before using Trait Manager",label:"Component settings",categories:{},traits:{labels:{},attributes:{id:Wu,alt:Wu,title:Wu,href:{placeholder:"eg. https://google.com"}},options:{target:{false:"This window",_blank:"New window"}}}},storageManager:{recover:"Do you want to recover unsaved changes?"}},bx={locale:"en",localeFallback:"en",detectLocale:!0,debug:!1,messages:{en:wx},messagesAdd:void 0},xx=bx,Kh=(function(a){return a.add="i18n:add",a.update="i18n:update",a.locale="i18n:locale",a})(Kh||{}),Cx=Kh,Sx=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ox=(function(a){Sx(r,a);function r(t){var e=a.call(this,t,"I18n",xx)||this;e.events=Cx;var n=e.config.messagesAdd;return n&&e.addMessages(n),e.config.detectLocale&&(e.config.locale=e._localLang()),e}return r.prototype.setLocale=function(t){var e=this,n=e.em,i=e.config,l=e.events;return n.trigger(l.locale,{value:t,valuePrev:i.locale}),i.locale=t,this},r.prototype.getLocale=function(){return this.config.locale},r.prototype.getMessages=function(t,e){e===void 0&&(e={});var n=this.config.messages;return t&&!n[t]&&this._debug("'".concat(t,"' i18n lang not found"),e),t?n[t]:n},r.prototype.setMessages=function(t){var e=this,n=e.em,i=e.config,l=e.events;return i.messages=t,n.trigger(l.update,t),this},r.prototype.addMessages=function(t){var e=this,n=e.em,i=e.events,l=e.config,u=l.messages;return n.trigger(i.add,t),this.setMessages((0,At.deepMerge)(u,t)),this},r.prototype.t=function(t,e){e===void 0&&(e={});var n=this.config,i=e.params||{},l=e.l||this.getLocale(),u=e.lFlb||n.localeFallback,c=this._getMsg(t,l,e);return c||(c=this._getMsg(t,u,e)),!c&&this._debug("'".concat(t,"' i18n key not found in '").concat(l,"' lang"),e),c=c&&(0,k.isString)(c)?this._addParams(c,i):c,c},r.prototype._localLang=function(){var t=(0,At.hasWin)()&&window.navigator||{},e=t.language||t.userLanguage;return e?e.split("-")[0]:"en"},r.prototype._addParams=function(t,e){var n=new RegExp("{([\\w\\d-]*)}","g");return t.replace(n,function(i,l){return e[l]||""}).trim()},r.prototype._getMsg=function(t,e,n){n===void 0&&(n={});var i=this.getMessages(e,n);if(i){var l=i[t];return!l&&t.indexOf(".")>0&&(l=t.split(".").reduce(function(u,c){if(!(0,k.isUndefined)(u))return u[c]},i)),l}},r.prototype._debug=function(t,e){e===void 0&&(e={});var n=this,i=n.em,l=n.config;(e.debug||l.debug)&&i&&i.logWarning(t)},r.prototype.destroy=function(){},r})(pr),Tx=Ox,Ex=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),$r=function(){return $r=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},$r.apply(this,arguments)},Px=function(){},Ax=Lr.F.Target,sp={id:"sorter-target",type:Ax},kx=(function(a){Ex(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.initialize=function(t){t===void 0&&(t={}),this.opt=t||{},(0,k.bindAll)(this,"startSort","onMove","endMove","rollback","updateOffset","moveDragHelper");var e=t||{};this.elT=0,this.elL=0,this.borderOffset=e.borderOffset||10;var n=e.container;this.el=typeof n=="string"?document.querySelector(n):n,this.$el=(0,Je.default)(this.el),this.containerSel=e.containerSel||"div",this.itemSel=e.itemSel||"div",this.draggable=e.draggable||!0,this.nested=!!e.nested,this.pfx=e.pfx||"",this.ppfx=e.ppfx||"",this.freezeClass=e.freezeClass||this.pfx+"freezed",this.onStart=e.onStart||Px,this.onEndMove=e.onEndMove,this.customTarget=e.customTarget,this.onEnd=e.onEnd,this.direction=e.direction||"v",this.onMoveClb=e.onMove,this.relative=e.relative||!1,this.ignoreViewChildren=!!e.ignoreViewChildren,this.plh=e.placer,this.wmargin=e.wmargin||0,this.offTop=e.offsetTop||0,this.offLeft=e.offsetLeft||0,this.document=e.document||document,this.em=e.em,this.canvasRelative=!!e.canvasRelative,this.selectOnEnd=!e.avoidSelectOnEnd,this.scale=e.scale;var i=this.em;i?.on&&(i.on(i.Canvas.events.refresh,this.updateOffset),this.updateOffset())},r.prototype.getScale=function(){return(0,k.result)(this,"scale")||1},r.prototype.getContainerEl=function(t){if(t&&(this.el=t),!this.el){var e=this.opt.container;this.el=typeof e=="string"?document.querySelector(e):e,this.$el=(0,Je.default)(this.el)}return this.el},r.prototype.getDocuments=function(t){var e=this.em,n=t?t.ownerDocument:e?.Canvas.getBody().ownerDocument,i=[document];return n&&i.push(n),i},r.prototype.updateOffset=function(){var t,e=((t=this.em)===null||t===void 0?void 0:t.get("canvasOffset"))||{};this.offTop=e.top,this.offLeft=e.left},r.prototype.setDropContent=function(t){delete this.dropModel,this.dropContent=t},r.prototype.updateTextViewCursorPosition=function(t){var e=this.em;if(e){var n=e.Canvas,i=n.getDocument(),l=null;if(i.caretRangeFromPoint){var u=(0,$t.G2)(t);l=i.caretRangeFromPoint(u.clientX,u.clientY)}else t.rangeParent&&(l=i.createRange(),l.setStart(t.rangeParent,t.rangeOffset));var c=n.getWindow().getSelection();n.getFrameEl().focus(),c?.removeAllRanges(),l&&c?.addRange(l),this.setContentEditable(this.activeTextModel,!0)}},r.prototype.setContentEditable=function(t,e){if(t){var n=t.getEl();n.contentEditable!=e&&(n.contentEditable=e)}},r.prototype.toggleSortCursor=function(t){var e=this.em,n=e?.Canvas;n&&(t?n.startAutoscroll():n.stopAutoscroll())},r.prototype.setDragHelper=function(t,e){for(var n=e||"",i=t.cloneNode(!0),l=t.getBoundingClientRect(),u=getComputedStyle(t),c="",f=0;f<u.length;f++){var v=u[f];c+="".concat(v,":").concat(u.getPropertyValue(v),";")}if(document.body.appendChild(i),i.className+=" ".concat(this.pfx,"bdrag"),i.setAttribute("style",c),this.dragHelper=i,i.style.width="".concat(l.width,"px"),i.style.height="".concat(l.height,"px"),n&&this.moveDragHelper(n),this.em){var g=(0,Je.default)(this.em.Canvas.getBody().ownerDocument);g.off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper)}(0,Je.default)(document).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper)},r.prototype.moveDragHelper=function(t){var e=t.target.ownerDocument;if(!(!this.dragHelper||!e)){var n=t.pageY,i=t.pageX,l=0,u=0,c=e.defaultView||e.parentWindow,f=c.frameElement,v=this.dragHelper.style;if(f){var g=f.getBoundingClientRect();l=g.top+document.documentElement.scrollTop,u=g.left+document.documentElement.scrollLeft,n=t.clientY,i=t.clientX}v.top=n+l+"px",v.left=i+u+"px"}},r.prototype.matches=function(t,e){return At.matches.call(t,e)},r.prototype.closest=function(t,e){if(t)for(var n=t.parentNode;n&&n.nodeType===1;){if(this.matches(n,e))return n;n=n.parentNode}},r.prototype.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},r.prototype.createPlaceholder=function(){var t=this.pfx,e=document.createElement("div"),n=document.createElement("div");return e.className=t+"placeholder",e.style.display="none",e.style.pointerEvents="none",n.className=t+"placeholder-int",e.appendChild(n),e},r.prototype.startSort=function(t,e){var n,i;e===void 0&&(e={});var l=this,u=l.em,c=l.itemSel,f=l.containerSel,v=l.plh,g=this.getContainerEl(e.container),y=this.getDocuments(t),_;delete this.dropModel,delete this.target,delete this.prevTarget,this.moved=!1,t&&!this.matches(t,"".concat(c,", ").concat(f))&&(t=this.closest(t,c)),this.sourceEl=t,v||(this.plh=this.createPlaceholder(),g.appendChild(this.plh)),t&&(_=this.getSourceModel(t),_?.set&&_.set("status","freezed"),this.srcM
407odel=_),(0,$t.on)(g,"mousemove dragover",this.onMove),(0,$t.on)(y,"mouseup dragend touchend",this.endMove),(0,$t.on)(y,"keydown",this.rollback),this.onStart({sorter:this,target:_,parent:_&&((n=_.parent)===null||n===void 0?void 0:n.call(_)),index:_&&((i=_.index)===null||i===void 0?void 0:i.call(_))}),u?.clearSelection(),this.toggleSortCursor(!0),u?.trigger("sorter:drag:start",t,_)},r.prototype.getTargetModel=function(t){var e=t||this.target;return(0,Je.default)(e).data("model")},r.prototype.getSourceModel=function(t,e){var n=this,i=e===void 0?{}:e,l=i.target,u=i.avoidChildren,c=u===void 0?1:u,f=this,v=f.em,g=f.sourceEl,y=t||g,_=this,b=_.dropModel,S=_.dropContent,E=function(W){return W&&l&&W.opt&&W.opt.avoidChildren&&n.isTextableActive(W,l)};if(S&&v){if(E(b)&&(b=void 0),!b){var N=v.Components.getComponents(),z={avoidChildren:c,avoidStore:1,avoidUpdateStyle:1},R=N.add(S,$r($r({},z),{temporary:!0}));if(b=N.remove(R,z),b=b instanceof Array?b[0]:b,this.dropModel=b,E(b))return this.getSourceModel(y,{target:l,avoidChildren:0})}return b}return y&&(0,Je.default)(y).data("model")},r.prototype.selectTargetModel=function(t,e){if(!(t instanceof Wt.pM)&&!(e&&e===t)){var n=this.targetModel;if(n&&n!==this.srcModel&&n.set("status",""),t?.set){var i=this.em.Canvas,l=Lr.F.Select,u=Lr.F.Hover,c=Lr.F.Spacing;[l,u,c].forEach(function(f){return i.removeSpots({type:f})}),i.addSpot($r($r({},sp),{component:t})),t.set("status","selected-parent"),this.targetModel=t}}},r.prototype.onMove=function(t){var e=t,n=this,i=n.em,l=n.onMoveClb,u=n.plh,c=n.customTarget;this.moved=!0;var f=u.style.display;(!f||f==="none")&&(u.style.display="block");var v=this.offset(this.el);this.elT=this.wmargin?Math.abs(v.top):v.top,this.elL=this.wmargin?Math.abs(v.left):v.left;var g=t.pageY-this.elT+this.el.scrollTop,y=t.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&i){var _=i.Canvas.getMouseRelativeCanvas(t,{noScroll:1});y=_.x,g=_.y}this.rX=y,this.rY=g,this.eventMove=t;var b=this.getSourceModel(),S=c?c({sorter:this,event:t}):t.target,E=this.dimsFromTarget(S,y,g),N=this.target,z=N&&this.getTargetModel(N);if(this.selectTargetModel(z,b),z||(u.style.display="none"),!!N){this.lastDims=E;var R=this.findPosition(E,y,g);this.isTextableActive(b,z)?(this.activeTextModel=z,u.style.display="none",this.lastPos=R,this.updateTextViewCursorPosition(e)):(this.disableTextable(),delete this.activeTextModel,(!this.lastPos||this.lastPos.index!=R.index||this.lastPos.method!=R.method)&&(this.movePlaceholder(this.plh,E,R,this.prevTargetDim),this.$plh||(this.$plh=(0,Je.default)(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css("top","+="+this.offTop+"px"),this.offLeft&&this.$plh.css("left","+="+this.offLeft+"px")),this.lastPos=R)),(0,k.isFunction)(l)&&l({event:t,target:b,parent:z,index:R.index+(R.method=="after"?1:0)}),i&&i.trigger("sorter:drag",{target:N,targetModel:z,sourceModel:b,dims:E,pos:R,x:y,y:g})}},r.prototype.isTextableActive=function(t,e){var n;return((n=t?.get)===null||n===void 0?void 0:n.call(t,"textable"))&&e?.isInstanceOf("text")},r.prototype.disableTextable=function(){var t=this.activeTextModel;t?.getView().disableEditing(),this.setContentEditable(t,!1)},r.prototype.isInFlow=function(t,e){if(!t)return!1;e=e||document.body;var n=-1,i,l=t;return i=l.offsetHeight,!!this.styleInFlow(l,e)},r.prototype.styleInFlow=function(t,e){if(!(0,$t.ir)(t)){var n=t.style||{},i=(0,Je.default)(t),l=e&&(0,Je.default)(e);if(!(n.overflow&&n.overflow!=="visible")){var u=i.css("float");if(!(u&&u!=="none")&&!(l&&l.css("display")=="flex"&&l.css("flex-direction")!=="column")){switch(n.position){case"static":case"relative":case"":break;default:return}switch(t.tagName){case"TR":case"TBODY":case"THEAD":case"TFOOT":return!0}switch(i.css("display")){case"block":case"list-item":case"table":case"flex":case"grid":return!0}}}}},r.prototype.validTarget=function(t,e){var n,i,l=this.lastPos,u=this.getTargetModel(t),c=this.getSourceModel(e,{target:u});e=(n=c?.view)===null||n===void 0?void 0:n.el,t=(i=u?.view)===null||i===void 0?void 0:i.el;var f={valid:!0,src:e,srcModel:c,trg:t,trgModel:u,draggable:!1,droppable:!1,dragInfo:"",dropInfo:""};if(!e||!t)return f.valid=!1,f;var v=l?l.method==="after"?l.indexEl+1:l.indexEl:u.components().length,g=c.get("draggable");if((0,k.isFunction)(g)){var y=g(c,u,v);f.dragInfo=y,f.draggable=y,g=y}else g=g instanceof Array?g.join(", "):g,f.dragInfo=g,g=(0,k.isString)(g)?this.matches(t,g):g,f.draggable=g;var _=u.get("droppable");if((0,k.isFunction)(_)){var y=_(c,u,v);f.droppable=y,f.dropInfo=y,_=y}
407else _=_ instanceof Wt.pM?1:_,_=_ instanceof Array?_.join(", "):_,f.dropInfo=_,_=(0,k.isString)(_)?this.matches(e,_):_,_=g&&this.isTextableActive(c,u)?1:_,f.droppable=_;return(!_||!g)&&(f.valid=!1),f},r.prototype.dimsFromTarget=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=0);var i=this.em,l=[];if(!t||(this.matches(t,"".concat(this.itemSel,", ").concat(this.containerSel))||(t=this.closest(t,this.itemSel)),this.draggable instanceof Array&&(t=this.closest(t,this.draggable.join(","))),!t))return l;if(this.prevTarget&&this.prevTarget!=t&&delete this.prevTarget,!this.prevTarget){this.targetP=this.closest(t,this.containerSel);var u=this.validTarget(t);if(i&&i.trigger("sorter:drag:validation",u),!u.valid&&this.targetP)return this.dimsFromTarget(this.targetP,e,n);this.prevTarget=t,this.prevTargetDim=this.getDim(t),this.cacheDimsP=this.getChildrenDim(this.targetP),this.cacheDims=this.getChildrenDim(t)}if(this.prevTarget==t&&(l=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,e,n)||!this.nested&&!this.cacheDims.length){var c=this.targetP;c&&this.validTarget(c).valid&&(l=this.cacheDimsP,this.target=c)}return delete this.lastPos,l},r.prototype.getTargetFromEl=function(t){var e=t,n,i=this.targetPrev,l=this.em,u=this.containerSel,c=this.itemSel;if(this.matches(e,"".concat(c,", ").concat(u))||(e=this.closest(e,c)),this.draggable instanceof Array&&(e=this.closest(e,this.draggable.join(","))),i&&i!=e&&delete this.targetPrev,!this.targetPrev){n=this.closest(e,u);var f=this.validTarget(e);if(l&&l.trigger("sorter:drag:validation",f),!f.valid&&n)return this.getTargetFromEl(n);this.targetPrev=e}return this.nearElBorders(e)&&(n=this.closest(e,u),n&&this.validTarget(n).valid&&(e=n)),e},r.prototype.nearElBorders=function(t){var e=10,n=t.getBoundingClientRect(),i=t.ownerDocument.body,l=this.getCurrentPos(),u=l.x,c=l.y,f=n.top+i.scrollTop,v=n.left+i.scrollLeft,g=n.width,y=n.height;if(c<f+e||c>f+y-e||u<v+e||u>v+g-e)return 1},r.prototype.getCurrentPos=function(){var t=this.eventMove,e=t?.pageX||0,n=t?.pageY||0;return{x:e,y:n}},r.prototype.getDim=function(t){var e=this,n=e.em,i=e.canvasRelative,l=n?.Canvas,u=l?l.getElementOffsets(t):{},c,f,v,g;if(i&&n){var y=l.getElementPos(t,{noScroll:1});c=y.top,f=y.left,v=y.height,g=y.width}else{var _=this.offset(t);c=this.relative?t.offsetTop:_.top-(this.wmargin?-1:1)*this.elT,f=this.relative?t.offsetLeft:_.left-(this.wmargin?-1:1)*this.elL,v=t.offsetHeight,g=t.offsetWidth}return{top:c,left:f,height:v,width:g,offsets:u}},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,k.each)(t.children,function(u,c){var f=u,v=(0,At.getModel)(f,Je.default),g=v&&v.index?v.index():c;if(!(!(0,$t.ir)(f)&&!e.matches(f,e.itemSel))){var y=e.getDim(f),_=e.direction,b;_=="v"?b=!0:_=="h"?b=!1:b=e.isInFlow(f,t),y.dir=b,y.el=f,y.indexEl=g,n.push(y)}}),n},r.prototype.nearBorders=function(t,e,n){var i=!1,l=this.borderOffset,u=e||0,c=n||0,f=t.top,v=t.left,g=t.height,y=t.width;return(f+l>c||c>f+g-l||v+l>u||u>v+y-l)&&(i=!0),i},r.prototype.findPosition=function(t,e,n){for(var i={index:0,indexEl:0,method:"before"},l=0,u=0,c=0,f=0,v=0,g=0,y=0,_,b=0,S=t.length;b<S;b++){_=t[b];var E=_.top,N=_.left,z=_.height,R=_.width;if(c=N+R,y=E+z,v=N+R/2,g=E+z/2,!(u&&N>u||f&&g>=f||l&&c<l))if(i.index=b,i.indexEl=_.indexEl,!_.dir)n<y&&(f=y),e<v?(u=v,i.method="before"):(l=v,i.method="after");else if(n<g){i.method="before";break}else i.method="after"}return i},r.prototype.movePlaceholder=function(t,e,n,i){var l=0,u=0,c=0,f="",v="",g="px",y=5,_=n.method,b=e[n.index];if(t.classList.remove("vertical"),t.classList.add("horizontal"),b){var S=b.top,E=b.left,N=b.height,z=b.width;b.dir?(f=z+g,v="auto",u=_=="before"?S-l:S+N-l,c=E):(f="auto",v=N-l*2+g,u=S+l,c=_=="before"?E-l:E+z-l,t.classList.remove("horizontal"),t.classList.add("vertical"))}else{if(!this.nested){t.style.display="none";return}if(i){var R=i.offsets||{},W=R.paddingTop||y,ct=R.paddingLeft||y,_t=R.borderTopWidth||0,xt=R.borderLeftWidth||0,ut=R.borderRightWidth||0,q=xt+ut;u=i.top+W+_t,c=i.left+ct+xt,f=parseInt("".concat(i.width))-ct*2-q+g,v="auto"}}t.style.top=u+g,t.style.left=c+g,f&&(t.style.width=f),v&&(t.style.height=v)},r.prototype.parents=function(t){return t?[t].concat(this.parents(t.parent())):[]},r.prototype.sort=function(t,e){var n=t.parents.filter(function(c){return e.parents.includes(c)}),i=n[0];if(!i)return e.model.index()-t.model.index();var l=t.parents[t.parents.indexOf(i)-1],u=e.parents[e.parents.indexOf(i)-1];return u.index()-l.index()},r.prototype.endMove=function(){var t=this,e,n=this.sourceEl,i=[],l=this.getDocuments(),u=this.getContainerEl(),c=this.onEndMove,f=this.onEnd,v=this,g=v.target,y=v.lastPos,_;if((0,$t.AU)(u,"mousemove dragover",this.onMove),(0,$t.AU)(l,"mouseup dragend touchend",this.endMove),(0,$t.AU)(l,"keydown",this.rollback),this.plh.style.display="none",n&&(_=this.getSourceModel()),this.moved&&g){var b=this.toMove,S=(0,k.isArray)(b)?b:b?[b]:[n],E=0;S.length===1?i.push(this.move(g,S[0],y)):S.map(function(R){return{model:R,parents:t.parents(R)}}).sort(this.sort).forEach(function(R){var W=R.model,ct=W.index(),_t=W.parent().getEl();i.push(t.move(g,W,$r($r({},y),{indexEl:y.indexEl-E,index:y.index-E}))),_t===g&&ct<=y.index&&E++})}this.plh&&(this.plh.style.display="none");var N=this.dragHelper;if(N&&(N.parentNode.removeChild(N),delete this.dragHelper),this.disableTextable(),this.selectTargetModel(),this.toggleSortCursor(),(e=this.em)===null||e===void 0||e.Canvas.removeSpots(sp),delete this.toMove,delete this.eventMove,delete this.dropModel,(0,k.isFunction)(c)){var z={target:_,parent:_&&_.parent(),index:_&&_.index()};
407i.length?i.forEach(function(R){return c(R,t,z)}):c(null,this,$r($r({},z),{cancelled:1}))}(0,k.isFunction)(f)&&f({sorter:this})},r.prototype.move=function(t,e,n){var i=this,l=i.em,u=i.dropContent,c=(0,At.getElement)(e),f=[],v=n.method==="after"?n.indexEl+1:n.indexEl,g=this.validTarget(t,c),y=(0,Je.default)(t).data("collection"),_=g.trgModel,b=g.srcModel,S=g.draggable,E=_ instanceof Wt.pM?1:g.droppable,N,z;if(y&&E&&S){var R={at:v,action:"move-component"},W=this.isTextableActive(b,_);if(u)N=(0,k.isFunction)(u)?u():u,R.avoidUpdateStyle=!0,R.action="add-component";else{var ct=b.collection.indexOf(b),_t=y===b.collection,xt=ct===v||ct===v-1,ut=!_t||!xt||W;ut&&(N=b.collection.remove(b,{temporary:!0}),_t&&v>ct&&(R.at=v-1))}N&&(W?(delete R.at,z=_.getView().insertComponent(N,R)):z=y.add(N,R)),delete this.dropContent,delete this.prevTarget}else if(l){var q=g.dropInfo||_?.get("droppable"),lt=g.dragInfo||b?.get("draggable");!y&&f.push("Target collection not found"),!E&&q&&f.push("Target is not droppable, accepts [".concat(q,"]")),!S&<&&f.push("Component not draggable, acceptable by [".concat(lt,"]")),l.logWarning("Invalid target position",{errors:f,model:b,context:"sorter",target:_})}return l?.trigger("sorter:drag:end",{targetCollection:y,modelToDrop:N,warns:f,validResult:g,dst:t,srcEl:c}),z},r.prototype.rollback=function(t){(0,$t.AU)(this.getDocuments(),"keydown",this.rollback);var e=t.which||t.keyCode;e==27&&(this.moved=!1,this.endMove())},r})(Wt.Ss),Mx=kx,no=function(){return no=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},no.apply(this,arguments)},Lx=function(a,r){r===void 0&&(r={});var t=r.prefix||"",e=document.createElement("i");return e.className=t+"resizer-h "+t+"resizer-h-"+a,e.setAttribute("data-"+t+"handler",a),e},Dx=function(a,r){var t=r||window,e=a.getBoundingClientRect();return{left:e.left+t.pageXOffset,top:e.top+t.pageYOffset,width:e.width,height:e.height}},jx=(function(){function a(r){r===void 0&&(r={}),this.defOpts={ratioDefault:!1,onUpdateContainer:function(){},step:1,minDim:10,maxDim:1/0,unitHeight:"px",unitWidth:"px",keyHeight:"height",keyWidth:"width",currentUnit:!0,silentFrames:!1,avoidContainerUpdate:!1,keepAutoHeight:!1,keepAutoWidth:!1,autoHeight:!1,autoWidth:!1,tl:!0,tc:!0,tr:!0,cl:!0,cr:!0,bl:!0,bc:!0,br:!0},this.opts=no({},this.defOpts),this.setOptions(r),(0,k.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop")}return a.prototype.getConfig=function(){return this.opts},a.prototype.setOptions=function(r,t){r===void 0&&(r={}),this.opts=no(no({},t?this.defOpts:this.opts),r),this.setup()},a.prototype.setup=function(){var r=this.opts,t=r.prefix||"",e=r.appendTo||document.body,n=this.container;for(n||(n=document.createElement("div"),n.className="".concat(t,"resizer-c"),e.appendChild(n),this.container=n);n.firstChild;)n.removeChild(n.firstChild);var i={};["tl","tc","tr","cl","cr","bl","bc","br"].forEach(function(c){return i[c]=r[c]?Lx(c,r):null});for(var l in i){var u=i[l];u&&n.appendChild(u)}this.handlers=i,this.mousePosFetcher=r.mousePosFetcher,this.updateTarget=r.updateTarget,this.posFetcher=r.posFetcher,this.onStart=r.onStart,this.onMove=r.onMove,this.onEnd=r.onEnd,this.onUpdateContainer=r.onUpdateContainer},a.prototype.toggleFrames=function(r){if(this.opts.silentFrames){var t=document.querySelectorAll("iframe");(0,k.each)(t,function(e){return e.style.pointerEvents=r?"none":""})}},a.prototype.isHandler=function(r){var t=this.handlers;for(var e in t)if(t[e]===r)return!0;return!1},a.prototype.getFocusedEl=function(){return this.el},a.prototype.getParentEl=function(){var r;return(r=this.el)===null||r===void 0?void 0:r.parentElement},a.prototype.getDocumentEl=function(){return[this.el.ownerDocument,document]},a.prototype.getElementPos=function(r,t){t===void 0&&(t={});var e=this.posFetcher;return e?e(r,t):Dx(r)},a.prototype.focus=function(r){r&&r===this.el||(this.el=r,this.updateContainer({forceShow:!0}),(0,$t.on)(this.getDocumentEl(),"pointerdown",this.handleMouseDown))},a.prototype.blur=function(){this.container.style.display="none",this.el&&((0,$t.AU)(this.getDocumentEl(),"pointerdown",this.handleMouseDown),delete this.el)},a.prototype.start=function(r){var t=r;if(t.button===0){t.preventDefault(),t.stopPropagation();var e=this.el,n=this.getParentEl(),i=this,l=this.opts||{},u=this.mousePosFetcher,c="data-"+l.prefix+"handler",f=this.getElementPos(e,{avoidFrameZoom:!0,avoidFrameOffset:!0}),v=this.getElementPos(n),g=t.target;this.handlerAttr=g.getAttribute(c),this.clickedHandler=g,this.startDim={t:f.top,l:f.left,w:f.width,h:f.height},this.rectDim={t:f.top,l:f.left,w:f.width,h:f.height},this.startPos=u?u(t):{x:t.clientX,y:t.clientY},this.parentDim={t:v.top,l:v.left,w:v.width,h:v.height};var y=this.getDocumentEl();this.docs=y,(0,$t.on)(y,"pointermove",this.move),(0,$t.on)(y,"keydown",this.handleKeyDown),(0,$t.on)(y,"pointerup",this.stop),(0,k.isFunction)(this.onStart)&&this.onStart(t,{docs:y,config:l,el:e,resizer:i}),this.toggleFrames(!0),this.move(t)}},a.prototype.move=function(r){var t=r,e=this.onMove,n=this.mousePosFetcher,i=n?n(t):{x:t.clientX,y:t.clientY};this.currentPos=i,this.delta={x:i.x-this.startPos.x,y:i.y-this.startPos.y},this.keys={shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey},this.rectDim=this.calc(this),this.updateRect(!1),e&&e(t)},a.prototype.stop=function(r){var t=this.el,e=this.opts,n=this.docs||this.getDocumentEl();(0,$t.AU)(n,"pointermove",this.move),(0,$t.AU)(n,"keydown",this.handleKeyDown),(0,$t.AU)(n,"pointerup",this.stop),this.updateRect(!0),this.toggleFrames(),(0,k.isFunction)(this.onEnd)&&this.onEnd(r,{docs:n,config:e,el:t,resizer:this}),delete this.docs},a.prototype.updateRect=function(r){var t=this.el,e=this,n=this.opts,i=this.rectDim,l=this.updateTarget,u=this.getSelectedHandler(),c=n.unitHeight,f=n.unitWidth,v=n.keyWidth,g=n.keyHeight;if((0,k.isFunction)(l))l(t,i,{store:r,selectedHandler:u,resizer:e,config:n});else{var y=t.style;y[v]=i.w+f,y[g]=i.h+c}this.updateContainer()},a.prototype.updateContainer=function(r){var t;r===void 0&&(r={});var e=this,n=e.opts,i=e.container,l=e.el,u=i.style;!n.avoidContainerUpdate&&l&&r.forceShow&&(u.display="block"),(t=this.onUpdateContainer)===null||t===void 0||t.call(this,{el:i,resizer:this,opts:no(no({},n),r)})},a.prototype.getSelectedHandler=function(){var r=this.handlers;if(this.selectedHandler){for(var t in r)if(r[t]===this.selectedHandler)return t}},a.prototype.handleKeyDown=function(r){r.keyCode===27&&(this.rectDim=this.startDim,this.stop(r))},a.prototype.handleMouseDown=function(r){var t=r.target;this.isHandler(t)?(this.selectedHandler=t,this.start(r)):t!==this.el&&(delete this.selectedHandler,this.blur()
407)},a.prototype.calc=function(r){var t,e=this.opts||{},n=e.step,i=this.startDim,l=e.minDim,u=e.maxDim,c=r.delta.x,f=r.delta.y,v=this.parentDim.w,g=this.parentDim.h,y=this.opts.unitWidth,_=this.opts.unitHeight,b=y==="%"?i.w/100*v:i.w,S=_==="%"?i.h/100*g:i.h,E={t:i.t,l:i.l,w:b,h:S};if(r){var N=r.handlerAttr;~N.indexOf("r")&&(t=y==="%"?(0,At.normalizeFloat)((b+c*n)/v*100,.01):(0,At.normalizeFloat)(b+c*n,n),t=Math.max(l,t),u&&(t=Math.min(u,t)),E.w=t),~N.indexOf("b")&&(t=_==="%"?(0,At.normalizeFloat)((S+f*n)/g*100,.01):(0,At.normalizeFloat)(S+f*n,n),t=Math.max(l,t),u&&(t=Math.min(u,t)),E.h=t),~N.indexOf("l")&&(t=y==="%"?(0,At.normalizeFloat)((b-c*n)/v*100,.01):(0,At.normalizeFloat)(b-c*n,n),t=Math.max(l,t),u&&(t=Math.min(u,t)),E.w=t),~N.indexOf("t")&&(t=_==="%"?(0,At.normalizeFloat)((S-f*n)/g*100,.01):(0,At.normalizeFloat)(S-f*n,n),t=Math.max(l,t),u&&(t=Math.min(u,t)),E.h=t);var z=e.ratioDefault?!r.keys.shift:r.keys.shift;if(N.indexOf("c")<0&&z){var R=i.w/i.h;E.w/E.h>R?E.h=Math.round(E.w/R):E.w=Math.round(E.h*R)}~N.indexOf("l")&&(E.l+=i.w-E.w),~N.indexOf("t")&&(E.t+=i.h-E.h);for(var W in E){var ct=W;E[ct]=parseInt("".concat(E[ct]),10)}return E}},a})(),Ix=jx,Rx=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),vc=function(){return vc=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},vc.apply(this,arguments)},Nx=(function(a){Rx(r,a);function r(t){var e=a.call(this,t,"Utils")||this;return e.Sorter=Mx,e.Resizer=Ix,e.Dragger=eh.A,e.helpers=vc({},At),e}return r.prototype.destroy=function(){},r})(pr),Fx=Nx,dr,Tr={},Xn={16:!1,18:!1,17:!1,91:!1},Gh="all",lo={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,command:91},$h={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},Lc=function(a){return $h[a]||a.toUpperCase().charCodeAt(0)},$o=[];for(dr=1;dr<20;dr++)$h["f"+dr]=111+dr;function Ha(a,r){for(var t=a.length;t--;)if(a[t]===r)return t;return-1}function Vx(a,r){if(a.length!=r.length)return!1;for(var t=0;t<a.length;t++)if(a[t]!==r[t])return!1;return!0}var Hx={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};function Ux(a){for(dr in Xn)Xn[dr]=a[Hx[dr]]}function Bx(a){var r,t,e,n,i,l;if(r=a.keyCode,Ha($o,r)==-1&&$o.push(r),(r==93||r==224)&&(r=91),r in Xn){Xn[r]=!0;for(e in lo)lo[e]==r&&(Zn[e]=!0);return}if(Ux(a),!!Zn.filter.call(this,a)&&r in Tr){for(l=Dc(),n=0;n<Tr[r].length;n++)if(t=Tr[r][n],t.scope==l||t.scope=="all"){i=t.mods.length>0;for(e in Xn)(!Xn[e]&&Ha(t.mods,+e)>-1||Xn[e]&&Ha(t.mods,+e)==-1)&&(i=!1);(t.mods.length==0&&!Xn[16]&&!Xn[18]&&!Xn[17]&&!Xn[91]||i)&&t.method(a,t)===!1&&(a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.cancelBubble&&(a.cancelBubble=!0))}}}function Wx(a){var r=a.keyCode,t,e=Ha($o,r);if(e>=0&&$o.splice(e,1),(r==93||r==224)&&(r=91),r in Xn){Xn[r]=!1;for(t in lo)lo[t]==r&&(Zn[t]=!1)}}function zx(){for(dr in Xn)Xn[dr]=!1;for(dr in lo)Zn[dr]=!1}function Zn(a,r,t){var e,n;e=qh(a),t===void 0&&(t=r,r="all");for(var i=0;i<e.length;i++)n=[],a=e[i].split("+"),a.length>1&&(n=Yh(a),a=[a[a.length-1]]),a=a[0],a=Lc(a),a in Tr||(Tr[a]=[]),Tr[a].push({shortcut:e[i],scope:r,method:t,key:e[i],mods:n})}function Kx(a,r){var t,e,n=[],i,l,u;for(t=qh(a),l=0;l<t.length;l++){if(e=t[l].split("+"),e.length>1&&(n=Yh(e)),a=e[e.length-1],a=Lc(a),r===void 0&&(r=Dc()),!Tr[a])return;for(i=0;i<Tr[a].length;i++)u=Tr[a][i],u.scope===r&&Vx(u.mods,n)&&(Tr[a][i]={})}}
407function Gx(a){return typeof a=="string"&&(a=Lc(a)),Ha($o,a)!=-1}function $x(){return $o.slice(0)}function qx(a){var r=(a.target||a.srcElement).tagName;return!(r=="INPUT"||r=="SELECT"||r=="TEXTAREA")}for(dr in lo)Zn[dr]=!1;function Yx(a){Gh=a||"all"}function Dc(){return Gh||"all"}function Xx(a){var r,t,e;for(r in Tr)for(t=Tr[r],e=0;e<t.length;)t[e].scope===a?t.splice(e,1):e++}function qh(a){var r;return a=a.replace(/\s/g,""),r=a.split(","),r[r.length-1]==""&&(r[r.length-2]+=","),r}function Yh(a){for(var r=a.slice(0,a.length-1),t=0;t<r.length;t++)r[t]=lo[r[t]];return r}function zu(a,r,t){a.addEventListener?a.addEventListener(r,t,!1):a.attachEvent&&a.attachEvent("on"+r,function(){t(window.event)})}Zn.setScope=Yx;Zn.getScope=Dc;Zn.deleteScope=Xx;Zn.filter=qx;Zn.isPressed=Gx;Zn.getPressedKeyCodes=$x;Zn.unbind=Kx;Zn.handlers=Tr;Zn.init=function(a){zu(a.document,"keydown",function(r){Bx(r)}),zu(a.document,"keyup",Wx),zu(a,"focus",zx)};var ka=Zn,Jx={defaults:{"core:undo":{keys:"\u2318+z, ctrl+z",handler:"core:undo",opts:{prevent:!0}},"core:redo":{keys:"\u2318+shift+z, ctrl+shift+z",handler:"core:redo",opts:{prevent:!0}},"core:copy":{keys:"\u2318+c, ctrl+c",handler:"core:copy"},"core:paste":{keys:"\u2318+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}}}},Zx=Jx,Qx=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),lp=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))};(0,At.hasWin)()&&ka.init(window);var tC=(function(a){Qx(r,a);function r(t){var e=a.call(this,t,"Keymaps",Zx)||this;return e.keymaster=ka,e.keymaps={},e}return r.prototype.onLoad=function(){var t=this.config.defaults;for(var e in t){var n=t[e];this.add(e,n.keys,n.handler,n.opts||{})}},r.prototype.add=function(t,e,n,i){i===void 0&&(i={});var l=this.em,u=l.Commands,c=l.getEditor(),f=l.Canvas,v={id:t,keys:e,handler:n},g=this.keymaps[t];return g&&this.remove(t),this.keymaps[t]=v,ka(e,function(y,_){var b={event:y,h:_},S=(0,k.isString)(n)?u.get(n):n,E=!l.isEditing()&&!c.Canvas.isInputFocused();if(E||i.force){i.prevent&&f.getCanvasView().preventDefault(y),(0,k.isFunction)(S)?S(c,0,b):u.runCommand(S,b);var N=[t,_.shortcut,y];l.trigger.apply(l,lp(["keymap:emit"],N,!1)),l.trigger.apply(l,lp(["keymap:emit:".concat(t)],N,!1))}},void 0),l.trigger("keymap:add",v),v},r.prototype.get=function(t){return this.keymaps[t]},r.prototype.getAll=function(){return this.keymaps},r.prototype.remove=function(t){var e=this.em,n=this.get(t);if(n)return delete this.keymaps[t],n.keys.split(", ").forEach(function(i){ka.unbind(i.trim())}),e?.trigger("keymap:remove",n),n},r.prototype.removeAll=function(){var t=this;return Object.keys(this.keymaps).forEach(function(e){return t.remove(e)}),ka.handlers={},this},r.prototype.destroy=function(){this.removeAll(),this.keymaps={}},r})(pr),eC=tC,nC={stylePrefix:"mdl-",title:"",content:"",backdrop:!0,custom:!1,extend:{}},rC=nC,iC=(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");a(r,t);function e(){this.constructor=r}
407r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),oC=(function(a){iC(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return{title:"",content:"",attributes:{},open:!1}},r.prototype.open=function(){this.set("open",!0)},r.prototype.close=function(){this.set("open",!1)},r})(Ii.A),aC=oC,sC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Sl=function(){return Sl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Sl.apply(this,arguments)},lC=(function(a){sC(r,a);function r(t){var e=a.call(this,t)||this,n=e.model;return e.listenTo(n,"change:open",e.updateOpen),e.listenTo(n,"change:title",e.updateTitle),e.listenTo(n,"change:content",e.updateContent),e}return r.prototype.template=function(t){var e=t.pfx,n=t.ppfx,i=t.content,l=t.title;return'<div class="'.concat(e,"dialog ").concat(n,"one-bg ").concat(n,`two-color"> 408 <div class="`).concat(e,`header"> 409 <div class="`).concat(e,'title">').concat(l,`</div> 410 <div class="`).concat(e,`btn-close" data-close-modal>⨯</div> 411 </div> 412 <div class="`).concat(e,`content"> 413 <div id="`).concat(e,'c">').concat(i,`</div> 414 <div style="clear:both"></div> 415 </div> 416 </div> 417 <div class="`).concat(e,'collector" style="display: none"></div>')},r.prototype.events=function(){return{click:"onClick","click [data-close-modal]":"hide"}},r.prototype.onClick=function(t){var e=this.config.backdrop;e&&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,u=[].slice.call(l.attributes).map(function(c){return c.name});i.removeAttr(u.join(" ")),i.attr(Sl(Sl({},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})(Dr),uC=lC,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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),fC=(function(a){cC(r,a);function r(t){var e=a.call(this,t,"Modal",rC)||this;return e.model=new aC(e),e.model.on("change:open",function(n,i){t.trigger("modal:".concat(i?"open":"close"))}),e.model.on("change",(0,k.debounce)(function(){var n=e._evData(),i=e.config.custom;(0,k.isFunction)(i)&&i(n),t.trigger("modal",n)},0)),e}return r.prototype._evData=function(){var t=this,e=this.getTitle(),n=this.getContent(),i=this.model.attributes,l=i.open,u=i.attributes;return{open:l,attributes:u,title:(0,k.isString)(e)?(0,$t.GZ)(e):e,content:(0,k.isString)(n)?(0,$t.GZ)(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?.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=uC.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})(pr),dC=fC,up="sw-visibility",cp="export-template",fp="open-sm",dp="open-tm",pp="open-layers",hp="open-blocks",Ku="fullscreen",Gu="preview",pC={stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:up,className:"fa fa-square-o",command:"core:component-outline",context:up,attributes:{title:"View components"}},{id:Gu,className:"fa fa-eye",command:Gu,context:Gu,attributes:{title:"Preview"}},{id:Ku,className:"fa fa-arrows-alt",command:Ku,context:Ku,attributes:{title:"Fullscreen"}},{id:cp,className:"fa fa-code",command:cp,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:fp,className:"fa fa-paint-brush",command:fp,active:!0,togglable:!1,attributes:{title:"Open Style Manager"}},{id:dp,className:"fa fa-cog",command:dp,togglable:!1,attributes:{title:"Settings"}},{id:pp,className:"fa fa-bars",command:pp,togglable:!1,attributes:{title:"Open Layer Manager"}},{id:hp,className:"fa fa-th-large",command:hp,togglable:!1,attributes:{title:"Open Blocks"}}]}]}
417,$u=pC,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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),vC=(function(a){hC(r,a);function r(t,e){var n=a.call(this,t,e)||this;return n.get("buttons").length&&n.set("buttons",new Zh(n.module,n.get("buttons"))),n}return 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})(Ii.A),Xh=vC,gC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Jh=(function(a){gC(r,a);function r(t,e){return a.call(this,t,e,Xh)||this}return 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}
417)})},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})(Ul),Zh=Jh;Jh.prototype.model=Xh;var yC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),mC=(function(a){yC(r,a);function r(t,e){var n=a.call(this,t,e)||this,i=n.get("buttons")||[];return n.buttons=new Zh(t,i),n}return 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})(Ii.A),Qh=mC,_C=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),tv=(function(a){_C(r,a);function r(t,e){return a.call(this,t,e,Qh)||this}return r})(Ul),wC=tv;tv.prototype.model=Qh;var bC=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Vo=function(){return Vo=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Vo.apply(this,arguments)},xC=(function(a){bC(r,a);function r(t){var e=a.call(this,t)||this,n=e,i=n.model,l=n.em,u=n.pfx,c=n.ppfx,f=i.className,v=i.attributes,g=v.command,y=v.listen;if(e.id=u+i.get("id"),e.activeCls="".concat(u,"active ").concat(c,"four-color"),e.disableCls="".concat(c,"disabled"),e.btnsVisCls="".concat(u,"visible"),e.className=u+"btn"+(f?" "+f:""),e.listenTo(i,"change",e.render),e.listenTo(i,"change:active updateActive",e.updateActive),e.listenTo(i,"checkActive",e.checkActive),e.listenTo(i,"change:bntsVis",e.updateBtnsVis),e.listenTo(i,"change:attributes",e.updateAttributes),e.listenTo(i,"change:className",e.updateClassName),e.listenTo(i,"change:disable",e.updateDisable),l&&(0,k.isString)(g)&&y){var _={fromListen:!0};e.listenTo(l,"run:".concat(g),function(){return i.set("active",!0,_)}),e.listenTo(l,"stop:".concat(g),function(){return i.set("active",!1,_)})}return l&&l.get&&(e.commands=l.get("Commands")),e}return r.prototype.tagName=function(){return this.model.get("tagName")},r.prototype.events=function(){return{click:"clicked"}},r.prototype.updateClassName=function(){var t=this,e=t.model,n=t.pfx,i=e.className,l=e.get("attributes").class,u="".concat(l||""," ").concat(n,"btn ").concat(i||"");this.$el.attr("class",u.trim())},r.prototype.updateAttributes=function(){var t=this,e=t.em,n=t.model,i=t.$el,l=n.get("attributes")||{},u=e&&e.t&&e.t("panels.buttons.titles.".concat(n.id));i.attr(l),u&&i.attr({title:u}),this.updateClassName()},r.prototype.updateBtnsVis=function(){this.$buttons&&(this.model.get("bntsVis")?this.$buttons.addClass(this.btnsVisCls):this.$buttons.removeClass(this.btnsVisCls))},r.prototype.updateActive=function(t,e,n){var i;n===void 0&&(n={});var l=this,u=l.model,c=l.commands,f=l.$el,v=l.activeCls,g=n.fromCollection,y=n.fromListen,_=u.get("context"),b=u.get("options"),S=u.command,E={};S&&(c&&(0,k.isString)(S)?E=c.get(S)||{}:(0,k.isFunction)(S)?E=c.create({run:S}):S!==null&&(0,k.isObject)(S)&&(E=c.create(S)),u.active?(!g&&((i=u.collection)===null||i===void 0||i.deactivateAll(_,u)),u.set("active",!0,{silent:!0}).trigger("checkActive"),!y&&c.runCommand(E,Vo(Vo({},b),{sender:u}
417)),E.noStop&&u.set("active",!1)):(f.removeClass(v),!y&&c.stopCommand(E,Vo(Vo({},b),{sender:u,force:1}))))},r.prototype.updateDisable=function(){var t=this,e=t.disableCls,n=t.model,i=n.disable;this.$el[i?"addClass":"removeClass"](e)},r.prototype.checkActive=function(){var t=this,e=t.model,n=t.$el,i=t.activeCls;e.active?n.addClass(i):n.removeClass(i)},r.prototype.clicked=function(){var t=this.model;t.get("bntsVis")||t.disable||!t.command||this.toggleActive()},r.prototype.toggleActive=function(){var t=this,e=t.model,n=t.em,i=e.active,l=e.togglable;i&&!l||(e.active=!i,i?e.runDefaultCommand&&n.runDefault():e.stopDefaultCommand&&n.stopDefault())},r.prototype.render=function(){var t=this.model,e=t.get("label"),n=this.$el;return!t.get("el")&&n.empty(),this.updateAttributes(),e&&n.append(e),this.checkActive(),this.updateDisable(),this},r})(Dr),CC=xC,SC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),OC=(function(a){SC(r,a);function r(t){var e=a.call(this,{collection:t})||this;return e.listenTo(e.collection,"add",e.addTo),e.listenTo(e.collection,"reset remove",e.render),e.className=e.pfx+"buttons",e}return r.prototype.addTo=function(t){this.addToCollection(t)},r.prototype.addToCollection=function(t,e){var n=e||null,i=t.get("el"),l=new CC({el:i,model:t}),u=l.render().el;return n?n.appendChild(u):this.$el.append(u),u},r.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(n){return t.addToCollection(n,e)}),this.$el.append(e),this.$el.attr("class",(0,k.result)(this,"className")),this},r})(Dr),TC=OC,EC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),gc=function(){return gc=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},gc.apply(this,arguments)},PC=(function(a){EC(r,a);function r(t){var e=a.call(this,{model:t,el:t.get("el")})||this;return e.className=e.pfx+"panel",e.id=e.pfx+t.get("id"),e.listenTo(t,"change:appendContent",e.appendContent),e.listenTo(t,"change:content",e.updateContent),e.listenTo(t,"change:visible",e.toggleVisible),t.view=e,e}return r.prototype.appendContent=function(){this.$el.append(this.model.get("appendContent"))},r.prototype.updateContent=function(){this.$el.html(this.model.get("content"))},r.prototype.toggleVisible=function(){if(!this.model.get("visible")){this.$el.addClass("".concat(this.ppfx,"hidden"));return}this.$el.removeClass("".concat(this.ppfx,"hidden"))},r.prototype.attributes=function(){return this.model.get("attributes")},r.prototype.initResize=function(){var t=this.em,e=t?.Editor,n=this.model.get("resizable");if(e&&n){var i=n===!0?[!0,!0,!0,!0]:n,l=i.length,u=void 0,c=void 0,f=void 0,v=!1;if(l==2){var g=i;u=g[0],f=g[0],c=g[1],v=g[1]}else if(l==4){var g=i;u=g[0],c=g[1],f=g[2],v=g[3]}var y=new e.Utils.Resizer(gc({tc:u,cr:c,bc:f,cl:v,tl:!1,tr:!1,bl:!1,br:!1,appendTo:this.el,silentFrames:!0,avoidContainerUpdate:!0,prefix:e.getConfig().stylePrefix,onEnd:function(){t.Canvas.refresh({all:!0})},posFetcher:function(_,b){var S=b.target,E=_.style,N=y.getConfig(),z=N.keyWidth,R=N.keyHeight,W=_.getBoundingClientRect(),ct=S=="container",_t=E[z],xt=E[R],ut=_t&&!ct?parseFloat(_t):W.width,q=xt&&!ct?parseFloat(xt):W.height;return{left:0,top:0,width:ut,height:q}}},n&&typeof n!="boolean"?n:{}));y.blur=function(){},y.focus(this.el)}},r.prototype.render=function(){var t=this.model.buttons,e=this.$el,n=this.ppfx,i="".concat(this.className," ").concat(this.id," ").concat(n,"one-bg ").concat(n,"two-color");
417if(e.addClass(i),this.toggleVisible(),t.length){var l=new TC(t);e.append(l.render().el)}return e.append(this.model.get("content")),this},r})(Dr),AC=PC,kC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),MC=(function(a){kC(r,a);function r(t){var e=a.call(this,{collection:t})||this;return e.listenTo(t,"add",e.addTo),e.listenTo(t,"reset",e.render),e.listenTo(t,"remove",e.onRemove),e.className=e.pfx+"panels",e}return r.prototype.onRemove=function(t){var e=t.view;e&&e.remove()},r.prototype.addTo=function(t){this.addToCollection(t)},r.prototype.addToCollection=function(t,e){var n=e||null,i=t.get("el"),l=new AC(t),u=l.render().el,c=t.get("appendTo");if(!i)if(c){var f=document.querySelector(c);f?.appendChild(u)}else n?n.appendChild(u):this.$el.append(u);return l.initResize(),u},r.prototype.render=function(){var t=this,e=this.$el,n=document.createDocumentFragment();return e.empty(),this.collection.each(function(i){return t.addToCollection(i,n)}),e.append(n),e.attr("class",this.className),this},r})(Dr),LC=MC,DC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),jC=(function(a){DC(r,a);function r(t){var e=a.call(this,t,"Panels",$u)||this;e.panels=new wC(e,e.config.defaults);for(var n in $u)n in e.config||(e.config[n]=$u[n]);return e}return r.prototype.getPanels=function(){return this.panels},r.prototype.getPanelsEl=function(){var t;return(t=this.PanelsViewObj)===null||t===void 0?void 0:t.el},r.prototype.addPanel=function(t){return this.panels.add(t)},r.prototype.removePanel=function(t){return this.panels.remove(t)},r.prototype.getPanel=function(t){var e=this.panels.where({id:t});return e.length?e[0]:null},r.prototype.addButton=function(t,e){var n=this.getPanel(t);return n?n.buttons.add(e):null},r.prototype.removeButton=function(t,e){var n=this.getPanel(t);return n&&n.buttons.remove(e)},r.prototype.getButton=function(t,e){var n=this.getPanel(t);if(n){var i=n.buttons.where({id:e});return i.length?i[0]:null}return null},r.prototype.render=function(){var t;return(t=this.PanelsViewObj)===null||t===void 0||t.remove(),this.PanelsViewObj=new LC(this.panels),this.PanelsViewObj.render().el},r.prototype.active=function(){this.getPanels().each(function(t){t.buttons.each(function(e){e.get("active")&&e.trigger("updateActive")})})},r.prototype.disableButtons=function(){this.getPanels().each(function(t){t.buttons.each(function(e){e.get("disable")&&e.trigger("change:disable")})})},r.prototype.destroy=function(){this.panels.reset(),this.panels.stopListening(),this.PanelsViewObj&&this.PanelsViewObj.remove()},r})(pr),IC=jC,RC={stylePrefix:"cm-",optsCodeViewer:{}},NC=RC,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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),VC=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},HC=(function(a){FC(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.build=function(t,e){e===void 0&&(e={});var n=e.em,i=VC(e,["em"]),l=i;if(e.cleanId&&n){var u=n.Css.getAll(),c=u.toJSON().map(function(f){var v=f.selectors,g=v&&v.length===1&&v.models[0];return g&&g.isId()&&g.get("name")}
417).filter(Boolean);l.attributes||(l.attributes=function(f,v){var g=v.id;return g&&g[0]==="i"&&!f.get("script")&&!f.get("attributes").id&&c.indexOf(g)<0&&delete v.id,v})}return t.toHTML(l)},r})(Wt.Kx),UC=HC,BC=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),WC=(function(a){BC(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.build=function(t){var e=this,n=t.toJSON();return this.beforeEach(n),(0,k.each)(n,function(i,l){var u=n[l];if(u instanceof Wt.Kx)n[l]=e.build(u);else if(u instanceof Wt.pM){var c=u;n[l]=[],c.length&&c.forEach(function(f,v){n[l][v]=e.build(f)})}}),n},r.prototype.beforeEach=function(t){delete t.status},r})(Wt.Kx),zC=WC,KC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})();function GC(a){var r,t=((r=a.toString().match(/\{([\s\S]*)\}/m))===null||r===void 0?void 0:r[1])||"";return t.replace(/^\s*\/\/.*$/gm,"").trim().length===0}var $C=(function(a){KC(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.mapModel=function(t){var e,n=this,i="",l=t.get("script-export")||t.get("script"),u=t.get("type"),c=t.get("components"),f=t.getId();if(l){var v=t.get("attributes");v=(0,k.extend)({},v,{id:f}),t.set("attributes",v,{silent:!0});var g=t.getScriptString(l),y=t.get("script-props");if(t.get("scriptUpdated")&&!y)this.mapJs[u+"-"+f]={ids:[f],code:g};else{var _=void 0,b=this.mapJs[u];if(y&&(_=t.__getScriptProps()),b)b.ids.push(f),_&&(b.props[f]=_);else{var S={ids:[f],code:g};_&&(S.props=(e={},e[f]=_,e)),this.mapJs[u]=S}}}return c.forEach(function(E){i+=n.mapModel(E)}),i},r.prototype.build=function(t){this.mapJs={},this.mapModel(t);var e="";for(var n in this.mapJs){var i=this.mapJs[n];if(i.code)if(i.props){if(GC(i.code))continue;e+=` 418 var props = `.concat(JSON.stringify(i.props),`; 419 var ids = Object.keys(props).map(function(id) { return '#'+id }).join(','); 420 var els = document.querySelectorAll(ids); 421 for (var i = 0, len = els.length; i < len; i++) { 422 var el = els[i]; 423 (`).concat(i.code,`.bind(el))(props[el.id]); 424 }`)}else{var l="#"+i.ids.join(", #");e+=` 425 var items = document.querySelectorAll('`.concat(l,`'); 426 for (var i = 0, len = items.length; i < len; i++) { 427 (function(){ 428`).concat(i.code,` 429}.bind(items[i]))(); 430 }`)}}return e},r})(Wt.Kx),qC=$C,YC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),yc=function(){return yc=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},yc.apply(this,arguments)},Ua;(0,At.hasWin)()&&(Ua=De(237),De(520),De(656),De(862));var ev=(function(a){YC(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return{input:"",label:"",codeName:"",theme:"hopscotch",readOnly:!0,lineNumbers:!0,autoFormat:!0}},r.prototype.init=function(t){return(0,k.bindAll)(this,"onChange"),this.editor=Ua.fromTextArea(t,yc({dragDrop:!1,lineWrapping:!0,mode:this.get("codeName")},this.attributes)),this.element=t,this.editor.on("change",this.onChange),this},r.prototype.onChange=function(){this.trigger("update",this)},r.prototype.getEditor=function(){return this.editor},r.prototype.getElement=function(){return this.element},r.prototype.setElement=function(t){return this.element=t,this},r.prototype.refresh=function(){return this.getEditor().refresh(),this}
430,r.prototype.focus=function(){return this.getEditor().focus(),this},r.prototype.getContent=function(){var t=this.getEditor();return t&&t.getValue()},r.prototype.setContent=function(t,e){var n=this;e===void 0&&(e={});var i=this.editor;if(i){i.setValue(t);var l=this.get("autoFormat"),u=i.autoFormatRange&&(l===!0||Array.isArray(l)&&l.includes(this.get("codeName")));u&&(Ua.commands.selectAll(i),i.autoFormatRange(i.getCursor(!0),i.getCursor(!1)),Ua.commands.goDocStart(i)),!e.noRefresh&&setTimeout(function(){return n.refresh()})}},r})(Wt.Kx),XC=ev;ev.prototype.CodeMirror=Ua;var JC=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ZC=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},QC=(function(a){JC(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.template=function(t){var e=t.pfx,n=t.codeName,i=t.label;return fr(vp||(vp=ZC([` 431 <div class="`,'editor" id="',"",`"> 432 <div id="`,'title">',`</div> 433 <div id="`,`code"></div> 434 </div> 435 `],[` 436 <div class="`,'editor" id="',"",`"> 437 <div id="`,'title">',`</div> 438 <div id="`,`code"></div> 439 </div> 440 `])),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,e,n=this,i=n.model,l=n.pfx,u=n.$el,c=i.toJSON(),f=i.get("input")||((e=(t=i).getElement)===null||e===void 0?void 0:e.call(t));return c.pfx=l,u.html(this.template(c)),u.attr("class","".concat(l,"editor-c")),u.find("#".concat(l,"code")).append(f),this},r})(Wt.Ss),tS=QC,vp,eS=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ol=function(){return Ol=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Ol.apply(this,arguments)},nS="CodeMirror",rS=(function(a){eS(r,a);function r(t){var e=a.call(this,t,"CodeManager",NC)||this;e.EditorView=tS;var n=e.config,i=n.pStylePrefix;return i&&(n.stylePrefix=i+n.stylePrefix),e.generators={},e.viewers={},e.defGenerators={html:new UC,css:new M_,json:new zC,js:new qC},e.defViewers={CodeMirror:new XC},e.loadDefaultGenerators().loadDefaultViewers(),e}return 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,k.isUndefined)(t.type)?nS:t.type,n=this.getViewer(e)&&this.getViewer(e).clone(),i=document.createElement("div"),l=document.createElement("textarea");return i.appendChild(l),n.set(Ol(Ol({},this.config.optsCodeViewer),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})(pr),iS=rS,oS=De(982),aS=De.n(oS),sS={maximumStackLength:500,trackSelection:!0}
440,lS=sS,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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),oi=function(){return oi=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},oi.apply(this,arguments)},cS=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Ns=function(a){return a.avoidStore||a.noUndo},gp=function(a){return Object.keys(a.changedAttributes())},fS=(function(a){uS(r,a);function r(t){var e=a.call(this,t,"UndoManager",lS)||this;e.config._disable&&(e.config.maximumStackLength=0);var n=!0;return e.um=new(aS())(oi({track:!0,register:[]},e.config)),e.um.changeUndoType("change",{condition:function(i){var l=i.get("_undo");if(l){var u=i.get("_undoexc");if((0,k.isArray)(u)&&gp(i).some(function(c){return u.indexOf(c)>=0}))return!1;if((0,k.isBoolean)(l)||(0,k.isArray)(l)&&gp(i).some(function(c){return l.indexOf(c)>=0}))return!0}return!1},on:function(i,l,u){var c=this;!this.beforeCache&&(this.beforeCache=i.previousAttributes());var f=u||l||{};if(f.noUndo&&setTimeout(function(){c.beforeCache=null}),!Ns(f)){var v=i.toJSON({fromUndo:n}),g={object:i,before:this.beforeCache,after:v};return this.beforeCache=null,(0,k.isEmpty)(v)?void 0:g}}}),e.um.changeUndoType("add",{on:function(i,l,u){if(u===void 0&&(u={}),!(Ns(u)||!e.isRegistered(l)))return{object:l,before:void 0,after:i,options:oi(oi({},u),{fromUndo:n})}}}),e.um.changeUndoType("remove",{on:function(i,l,u){if(u===void 0&&(u={}),!(Ns(u)||!e.isRegistered(l)))return{object:l,before:i,after:void 0,options:oi(oi({},u),{fromUndo:n})}}}),e.um.changeUndoType("reset",{undo:function(i,l){i.reset(l,{fromUndo:n})},redo:function(i,l,u){i.reset(u,{fromUndo:n})},on:function(i,l){if(l===void 0&&(l={}),!(Ns(l)||!e.isRegistered(i)))return{object:i,before:l.previousModels,after:cS([],i.models,!0),options:oi(oi({},l),{fromUndo:n})}}}),e.um.on("undo redo",function(){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 r.prototype.postLoad=function(){var t=this,e=t.config,n=t.em;e.trackSelection&&n&&this.add(n.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,n=e.em,i=e.um;return!n.isEditing()&&i.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,n=e.em,i=e.um;return!n.isEditing()&&i.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){var e=!!this.um.isTracking();e&&this.stop(),t(),e&&this.start()},r.prototype.getGroupedStack=function(){var t={},e=this.getStack(),n=function(i,l){var u=i.attributes,c=u.type,f=u.after,v=u.before,g=u.object,y=u.options,_=y===void 0?{}:y;return{index:l,type:c,after:f,before:v,object:g,options:_}};return e.forEach(function(i,l){var u=i.get("magicFusionIndex"),c=n(i,l);t[u]?t[u].push(c):t[u]=[c]}),Object.keys(t).map(function(i){var l=t[i];return{index:l[l.length-1].index,actions:l,labels:(0,k.unique)(l.reduce(function(u,c){var f,v=(f=c.options)===null||f===void 0?void 0:f.action;return v&&u.push(v),u},[]))}})},r.prototype.goToGroup=function(t){var e=this;if(t){var n=this.getPointer(),i=t.index-n;(0,k.times)(Math.abs(i),function(){e[i<0?"undo":"redo"](!1)})}}
440,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})(pr),dS=fS,pS={stylePrefix:"rte-",adjustToolbar:!0,actions:["bold","italic","underline","strikethrough","link","wrap"],custom:!1},hS=pS,Ho=function(){return Ho=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Ho.apply(this,arguments)},mc=(function(a){return a[a.ACTIVE=1]="ACTIVE",a[a.INACTIVE=0]="INACTIVE",a[a.DISABLED=-1]="DISABLED",a})(mc||{}),qu="_rte",oo={ACTIVE:1,INACTIVE:0,DISABLED:-1},Fs=function(a,r){r===void 0&&(r="A");var t=a.selection()||{},e=t.anchorNode,n=t.focusNode,i=e?.parentNode,l=n?.parentNode;return i?.nodeName==r||l?.nodeName==r},Tl="data-selectme",Pa={bold:{name:"bold",icon:"<b>B</b>",attributes:{title:"Bold"},result:function(a){return a.exec("bold")}},italic:{name:"italic",icon:"<i>I</i>",attributes:{title:"Italic"},result:function(a){return a.exec("italic")}},underline:{name:"underline",icon:"<u>U</u>",attributes:{title:"Underline"},result:function(a){return a.exec("underline")}},strikethrough:{name:"strikethrough",icon:"<s>S</s>",attributes:{title:"Strike-through"},result:function(a){return a.exec("strikeThrough")}},link:{icon:`<svg viewBox="0 0 24 24"> 441 <path fill="currentColor" d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /> 442 </svg>`,name:"link",attributes:{style:"font-size:1.4rem;padding:0 4px 2px;",title:"Link"},state:function(a){return a&&a.selection()&&Fs(a)?oo.ACTIVE:oo.INACTIVE},result:function(a){Fs(a)?a.exec("unlink"):a.insertHTML('<a href="" '.concat(Tl,">").concat(a.selection(),"</a>"),{select:!0})}},wrap:{name:"wrap",icon:`<svg viewBox="0 0 24 24">
443 <path fill="currentColor" d="M20.71,4.63L19.37,3.29C19,2.9 18.35,2.9 17.96,3.29L9,12.25L11.75,15L20.71,6.04C21.1,5.65 21.1,5 20.71,4.63M7,14A3,3 0 0,0 4,17C4,18.31 2.84,19 2,19C2.92,20.22 4.5,21 6,21A4,4 0 0,0 10,17A3,3 0 0,0 7,14Z" /> 444 </svg>`,attributes:{title:"Wrap for style"},state:function(a){return a?.selection()&&Fs(a,"SPAN")?oo.DISABLED:oo.INACTIVE},result:function(a){!Fs(a,"SPAN")&&a.insertHTML("<span ".concat(Tl,">").concat(a.selection(),"</span>"),{select:!0})}}},vS=(function(){function a(r,t,e){e===void 0&&(e={});var n=this;if(this.em=r,this.settings=e,t[qu])return t[qu];t[qu]=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(v){var g=v;return(0,k.isString)(v)?g=Ho({},Pa[v]):Pa[v.name]&&(g=Ho(Ho({},Pa[v.name]),v)),g}),l=i.length?i:Object.keys(Pa).map(function(v){return Pa[v]});e.classes=Ho({actionbar:"actionbar",button:"action",active:"active",disabled:"disabled",inactive:"inactive"},e.classes);var u=e.classes,c=e.actionbar;if(this.actionbar=c,this.classes=u,this.actions=l,!c){if(!this.isCustom(e.module)){var f=e.actionbarContainer;c=document.createElement("div"),c.className=u.actionbar,f?.appendChild(c),this.actionbar=c}l.forEach(function(v){return n.addAction(v)})}return e.styleWithCSS&&this.exec("styleWithCSS"),this}return a.prototype.isCustom=function(r){var t=r||this.em.RichTextEditor;return!!(t?.config.custom||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,u=l.active,c=l.inactive,f=l.disabled,v=e.state,g=e.name,y=r.doc,_=mc.INACTIVE;if(i&&(i.className=i.className.replace(u,"").trim(),i.className=i.className.replace(c,"").trim(),i.className=i.className.replace(f,"").trim()),v){var b=v(r,y);if(_=b,i)switch(b){case oo.ACTIVE:i.className+=" ".concat(u);break;case oo.INACTIVE:i.className+=" ".concat(c);break;case oo.DISABLED:i.className+=" ".concat(f);break}}else y.queryCommandSupported(g)&&y.queryCommandState(g)&&(i&&(i.className+=" ".concat(u)),_=mc.ACTIVE);e.currentState=_,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?$t.on:$t.AU,n=this,i=n.el,l=n.doc,u=this.actionbarEl();if(u&&(u.style.display=r?"":"none"),i.contentEditable="".concat(!!r),e(i,"mouseup keyup",this.updateActiveActions),e(l,"keydown",this.__onKeydown),e(l,"paste",this.__onPaste),this.enabled=r,r){var c=t.event;if(this.syncActions(),this.updateActiveActions(),c){var f=null;if(l.caretRangeFromPoint){var v=(0,$t.G2)(c);f=l.caretRangeFromPoint(v.clientX,v.clientY)}else c.rangeParent&&(f=l.createRange(),f.setStart(c.rangeParent,c.rangeOffset));var g=l.getSelection();g?.removeAllRanges(),f&&g?.addRange(f)}i.focus()}return this},a.prototype.__onKeydown=function(r){var t=this.em,e=t.RichTextEditor.getConfig().onKeydown;if(e)return e({ev:r,rte:this,editor:t.getEditor()});var n=this.doc,i=["insertOrderedList","insertUnorderedList"];r.key==="Enter"&&!i.some(function(l){return n.queryCommandState(l)})&&(n.execCommand("insertLineBreak"),r.preventDefault())},a.prototype.__onPaste=function(r){var t=this.em,e=t.RichTextEditor.getConfig().onPaste;if(e)return e({ev:r,rte:this,editor:t.getEditor()});var n=r.clipboardData,i=n.getData("text"),l=n.getData("text/html");if(i&&!l){r.preventDefault();var u=i.replace(/(?:\r\n|\r|\n)/g,"<br/>");this.doc.execCommand("insertHTML",!1,u)}},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,u=l===void 0?{}:l,c=document.createElement("span");c.className=this.classes.button,r.btn=c;for(var f in u)c.setAttribute(f,u[f]);typeof i=="string"?c.innerHTML=i:c.appendChild(i),n.appendChild(c)}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,n=e.select,i=this,l=i.em,u=i.doc,c=i.el,f=u.getSelection();if(f&&f.rangeCount){var v=(0,At.getComponentModel)(c)||l.getSelected(),g=u.createElement("div"),y=f.getRangeAt(0);y.deleteContents(),(0,k.isString)(r)?g.innerHTML=r:r&&g.appendChild(r),Array.prototype.slice.call(g.childNodes).forEac
444h(function(_){y.insertNode(_)}),f.removeAllRanges(),f.addRange(y),c.focus(),n&&v&&(v.once("rte:disable",function(){var _=v.find("[".concat(Tl,"]"))[0];_&&(l.setSelected(_),_.removeAttributes(Tl))}),v.trigger("disable"))}},a})(),gS=vS,yS=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),yp=function(a,r,t,e){function n(i){return i instanceof t?i:new t(function(l){l(i)})}return new(t||(t=Promise))(function(i,l){function u(v){try{f(e.next(v))}catch(g){l(g)}}function c(v){try{f(e.throw(v))}catch(g){l(g)}}function f(v){v.done?i(v.value):n(v.value).then(u,c)}f((e=e.apply(a,r||[])).next())})},mp=function(a,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,n,i,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(f){return function(v){return c([f,v])}}function c(f){if(e)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(t=0)),t;)try{if(e=1,n&&(i=f[0]&2?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,n=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=r.call(a,t)}catch(v){f=[6,v],n=0}finally{e=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},mS=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Yu="".concat(Vs.refresh," frame:scroll ").concat(Vn.I.update),_S="rte:enable",wS="rte:disable",bS="rte:custom",xS={enable:_S,disable:wS,custom:bS},CS=(function(a){yS(r,a);function r(t){var e=a.call(this,t,"RichTextEditor",hS)||this;e.events=xS;var n=e.config,i=n.pStylePrefix;i&&(n.stylePrefix=i+n.stylePrefix),e.pfx=n.stylePrefix,e.actions=n.actions||[];var l=new Wt.Kx;return e.model=l,l.on("change:currentView",e.__trgCustom,e),e.__dbdTrgCustom=(0,k.debounce)(function(){return e.__trgCustom()},0),e}return r.prototype.onLoad=function(){if((0,At.hasWin)()){var t=this.config,e=t.pStylePrefix,n=t.custom,i=(0,$t.a_)("div",{class:(0,$t.cx)("".concat(e,"rte-toolbar"),!n&&"".concat(e,"one-bg ").concat(e,"rte-toolbar-ui"))});this.toolbar=i,this.initRte((0,$t.a_)("div")),(0,$t.on)(i,"mousedown",function(l){return l.stopPropagation()})}},r.prototype.__trgCustom=function(){var t=this,e=t.model,n=t.em,i=t.events;n.trigger(i.custom,{enabled:!!e.get("currentView"),container:this.getToolbarEl(),actions:this.getAll()})},r.prototype.destroy=function(){var t,e,n;(t=this.globalRte)===null||t===void 0||t.destroy(),(n=(e=this.customRte)===null||e===void 0?void 0:e.destroy)===null||n===void 0||n.call(e),this.model.stopListening().clear({silent:!0}),this.__dbdTrgCustom.cancel(),(0,$t.YZ)(this.toolbar)},r.prototype.postRender=function(t){var e=t.model.get("Canvas");this.toolbar.style.pointerEvents="all",this.hideToolbar(),e.getToolsEl().appendChild(this.toolbar)},r.prototype.initRte=function(t){var e=this.globalRte,n=this,i=n.em,l=n.pfx,u=n.actionbar,c=n.config,f=this.actions||mS([],c.actions,!0),v={actionbar:"".concat(l,"actionbar"),button:"".concat(l,"action"),active:"".concat(l,"active"),inactive:"".concat(l,"inactive"),disabled:"".concat(l,"disabled")};return e?(e.em=i,e.setEl(t)):(e=new gS(i,t,{classes:v,actions:f,actionbar:u,actionbarContainer:this.toolbar,module:this}),this.globalRte=e),e.actionbar&&(this.actionbar=e.actionbar),e.actions&&(this.actions=e.actions),e},r.prototype.add=function(t,e){var n;e===void 0&&(e={}),e.name=t,(n=this.globalRte)===null||n===void 0||n.addAction(e,{sync:!0})},r.prototype.get=function(t){var e,n;return(e=this.globalRte)===null||e===void 0||e.getActions().forEac
444h(function(i){i.name==t&&(n=i)}),n},r.prototype.getAll=function(){var t;return((t=this.globalRte)===null||t===void 0?void 0:t.getActions())||[]},r.prototype.remove=function(t){var e,n=this.getAll(),i=this.get(t);if(i){var l=i.btn,u=n.indexOf(i);(e=l?.parentNode)===null||e===void 0||e.removeChild(l),n.splice(u,1)}return i},r.prototype.run=function(t){var e=this.globalRte,n=(0,k.isString)(t)?this.get(t):t;e&&n&&(n.result(e,n),e.updateActiveActions())},r.prototype.getToolbarEl=function(){return this.toolbar},r.prototype.updatePosition=function(){var t=this,e=t.em,n=t.toolbar,i="px",l=e.Canvas,u=n.style,c=l.getTargetToElementFixed(this.lastEl,n,{event:"rteToolbarPosUpdate",left:0});["top","left","bottom","right"].forEach(function(f){var v=c[f];(0,At.isDef)(v)&&(u[f]=(0,k.isString)(v)?v:(v||0)+i)})},r.prototype.enable=function(t,e){return yp(this,arguments,void 0,function(n,i,l){var u,c,f,v,g;return l===void 0&&(l={}),mp(this,function(y){switch(y.label){case 0:return this.lastEl=n.el,u=this,c=u.customRte,f=u.em,v=n.getChildrenContainer(),this.toolbar.style.display="",[4,c?c.enable(v,i):this.initRte(v).enable(l)];case 1:return g=y.sent(),f&&(setTimeout(this.updatePosition.bind(this),0),f.off(Yu,this.updatePosition,this),f.on(Yu,this.updatePosition,this),f.trigger("rte:enable",n,g)),this.model.set({currentView:n}),[2,g]}})})},r.prototype.getContent=function(t,e){return yp(this,void 0,void 0,function(){var n;return mp(this,function(i){switch(i.label){case 0:return n=this.customRte,n&&e&&(0,k.isFunction)(n.getContent)?[4,n.getContent(t.el,e)]:[3,2];case 1:return[2,i.sent()];case 2:return[2,t.getChildrenContainer().innerHTML]}})})},r.prototype.hideToolbar=function(){var t=this.toolbar.style,e="-1000px";t.top=e,t.left=e,t.display="none"},r.prototype.disable=function(t,e,n){n===void 0&&(n={});var i=this.em,l=this.customRte,u=t.getChildrenContainer();l?l.disable(u,e):e&&e.disable(),this.hideToolbar(),i&&(i.off(Yu,this.updatePosition,this),!n.fromMove&&i.trigger("rte:disable",t,e)),this.model.unset("currentView")},r})(pr),SS=CS,OS={sectors:[{name:"General",open:!1,properties:["display","float","position","top","right","left","bottom"]},{name:"Flex",open:!1,properties:["flex-direction","flex-wrap","justify-content","align-items","align-content","order","flex-basis","flex-grow","flex-shrink","align-self"]},{name:"Dimension",open:!1,properties:["width","height","max-width","min-height","margin","padding"]},{name:"Typography",open:!1,properties:["font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","text-shadow"]},{name:"Decorations",open:!1,properties:["background-color","border-radius","border","box-shadow","background"]},{name:"Extra",open:!1,properties:["opacity","transition","transform"]}],appendTo:"",stylePrefix:"sm-",custom:!1,hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:!0,avoidComputed:["width","height"]},TS=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Yn=function(){return Yn=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Yn.apply(this,arguments)},ES=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},_p=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},jc=(function(a){TS(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.getDefaults=function(){return(0,k.result)(this.prototype,"defaults")},r.prototype.defaults=function(){return{name:"",property:"",type:"",defaults:"",info:"",value:"",icon:"",functionName:"",status:"",visible:!0,fixedValues:["initial","inherit"],full:!1,important:!1,toRequire:!1,requires:void 0,requiresParent:null,parentTarget:null}},r.prototype.initialize=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.em=e.em;var n=this.getId()||"",i=this.get("name")||this.get("label")||"";!this.get("property")&&this.set("property",(i||n).replace(/ /g,"-"));var l=this.get("property");!this.get("id")&&this.set("id",l),!i&&this.set("name",(0,At.capitalize)(l).replace(/-/g," ")),this.on("change",this.__upTargets),r.callInit(this,t,e)},r.prototype.__getParentProp=function(){var t,e;return(e=(t=this.collection)===null||t===void 0?void 0:t.opts)===null||e===void 0?void 0:e.parentProp},r.prototype.__upTargets=function(t,e){var n,i=this;e===void 0&&(e={});var l=this.em,u=l.Styles,c=this.getName(),f=e.__clear,v=f?"":this.__getFullValue(e),g=this.__getParentProp(),y=this.changedAttributes(),_=(0,k.keys)(y).reduce(function(R,W){return R[W]=i.previous(W),R},{}),b=_p(_p([],(0,k.keys)(this.__getClearProps()),!0),["__p"],!1),S=(0,k.
444keys)(y),E=!e.__up&&!g&&(f||b.some(function(R){return S.indexOf(R)>=0})),N=this.get("onChange"),z={property:this,from:_,to:y,value:v,opts:e};u.__trgEv(u.events.propertyUpdate,z),N&&N(z),E&&this.__upTargetsStyle((n={},n[c]=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?.addStyleTargets(Yn(Yn({},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=ES(e,["partial"]);return t.__p=!!(i.avoidStore||n),this.set(t,Yn(Yn({},i),{avoidStore:t.__p}))},r.prototype.up=function(t,e){e===void 0&&(e={}),this.set(t,Yn(Yn({},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?!0:n,l=this.getId(),u=this.get("name")||this.get("label");return i&&((e=this.em)===null||e===void 0?void 0:e.t("styleManager.properties.".concat(l)))||u},r.prototype.getValue=function(t){t===void 0&&(t={});var e=t.noDefault,n=this.get("value");return!this.hasValue()&&!e?this.getDefaultValue():n},r.prototype.hasValue=function(t){t===void 0&&(t={});var e=t.noParent,n=e&&this.getParentTarget(),i=this.get("value");return!(0,k.isUndefined)(i)&&i!==""&&!n},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(),i=t.camelCase?(0,At.camelCase)(n):n;return e={},e[i]=this.__getFullValue(t),e},r.prototype.getDefaultValue=function(){var t=this.get("default");return"".concat((0,k.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(),Yn(Yn({},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()},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,Yn({avoidStore:l},n))},r.prototype.setValueFromInput=function(t,e,n){n===void 0&&(n={}),this.setValue(t,e,Yn(Yn({},n),{fromInput:1}))},r.prototype.parseValue=function(t,e){e===void 0&&(e={});var n={value:t},i="!important",l=this.get("functionName")||"";if((0,k.isString)(t)&&t.indexOf(i)!==-1&&(n.value=t.replace(i,"").trim(),n.important=!0),!l&&!e.complete)return n;var u=[],c="".concat(n.value).trim(),f=c.indexOf("(")+1,v=l||c.substring(0,f-1);if(v&&(n.functionName=v),!l||c.indexOf("".concat(l,"("))===0){var g=c.lastIndexOf(")");u.push(f),g>=0&&u.push(g),n.value=String.prototype.substring.apply(c,u)}if(e.numeric){var y=parseFloat(n.value);n.unit=n.value.replace(y,""),n.value=y}return n},r.prototype.__getFullValue=function(t){var e=t===void 0?{}:t,n=e.withDefault;return!this.hasValue()&&n?this.getDefaultValue():this.getFullValue()},r.prototype.getFullValue=function(t,e){e===void 0&&(e={});var n=this.get("functionName"),i=this.getDefaultValue(),l=(0,k.isUndefined)(t)?this.get("value"):t,u=!(0,k.isUndefined)(l)&&l!=="";if(l&&i&&l===i)return i;if(n&&u){var c=n==="url"?"'".concat(l.replace(/'|"/g,""),"'"):l;l="".concat(n,"(").concat(c,")")}return u&&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 u=this.getId(),c=this.getName(),f=this.get("toRequire"),v=this.get("requires"),g=this.get("requiresParent"),y=l.get("unstylable"),_=l.get("stylable-require"),b=l.get("stylable");if((0,k.isArray)(b)&&(b=b.indexOf(c)>=0),(0,k.isArray)(y)&&(b=y.indexOf(c)<0),f&&(b=!e||_&&(_.indexOf(u)>=0||_.indexOf(c)>
444=0)),i&&v){var S=(0,k.keys)(v);i.forEach(function(R){R.getProperties().forEach(function(W){if((0,k.includes)(S,W.id)){var ct=v[W.id];b=b&&(0,k.includes)(ct,W.get("value"))}})})}if(g){var E=n&&n.parent(),N=E&&E.getEl();if(N){var z=(0,At.hasWin)()?window.getComputedStyle(N):{};(0,k.each)(g,function(R,W){b=b&&z[W]&&(0,k.includes)(R,z[W])})}else b=!1}return!!b},r})(Wt.Kx),$e=jc;jc.callParentInit=function(a,r,t,e){e===void 0&&(e={}),a.prototype.initialize.apply(r,[t,Yn(Yn({},e),{skipInit:1})])};jc.callInit=function(a,r,t){t===void 0&&(t={}),!t.skipInit&&a.init(r,t)};var PS=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),El=function(){return El=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},El.apply(this,arguments)},AS=(function(a){PS(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return{values:{}}},r.prototype.initialize=function(){var t=this.collection;this.prop=t?.prop},r.prototype.getId=function(){return this.cid},r.prototype.getIndex=function(){var t=this.collection;return t?t.indexOf(this):-1},r.prototype.getValues=function(t){t===void 0&&(t={});var e=this.get("values");return t.camelCase?Object.keys(e).reduce(function(n,i){return n[(0,At.camelCase)(i)]=e[i],n},{}):e},r.prototype.getLabel=function(){var t;return(t=this.prop)===null||t===void 0?void 0:t.getLayerLabel(this)},r.prototype.isSelected=function(){var t;return((t=this.prop)===null||t===void 0?void 0:t.getSelectedLayer())===this},r.prototype.select=function(){var t;return(t=this.prop)===null||t===void 0?void 0:t.selectLayer(this)},r.prototype.remove=function(){var t;return(t=this.prop)===null||t===void 0?void 0:t.removeLayer(this)},r.prototype.move=function(t){var e;return(e=this.prop)===null||e===void 0?void 0:e.moveLayer(this,t)},r.prototype.getStylePreview=function(t){var e;return t===void 0&&(t={}),(e=this.prop)===null||e===void 0?void 0:e.getStylePreview(this,t)},r.prototype.hasPreview=function(){var t;return!!(!((t=this.prop)===null||t===void 0)&&t.get("preview"))},r.prototype.upValues=function(t){return t===void 0&&(t={}),this.set("values",El(El({},this.getValues()),t))},r})(Wt.Kx),kS=AS,MS=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),nv=(function(a){MS(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.initialize=function(t,e){e===void 0&&(e={}),this.prop=e.prop},r})(Wt.pM),LS=nv;nv.prototype.model=kS;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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Uo=function(){return Uo=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Uo.apply(this,arguments)},wp=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},rv=function(a){return a==="integer"||a==="number"},jS=(function(a){DS(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return Uo(Uo({},$e.getDefaults()),{detached:!1,properties:[],separator:" ",join:null,fromStyle:null,toStyle:null,full:!0})},r.prototype.initialize=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),$e.callParentInit($e,this,t,e);var n=this.em,i=new Rc(this.get("properties")||[],{em:n,parentProp:this});this.set("properties",i,{silent:!0}),this.listenTo(i,"change",this.__upProperties),$e.callInit(this,t,e)},Object.defineProperty(r.prototype,"properties",{get:function(){return this.get("properties")||[]}
444,enumerable:!1,configurable:!0}),r.prototype.getProperties=function(){return wp([],this.get("properties").models,!0)},r.prototype.getProperty=function(t){return this.properties.filter(function(e){return e.getId()===t||e.getName()===t})[0]},r.prototype.getPropertyAt=function(t){return this.get("properties").at(t)},r.prototype.isDetached=function(){return!!this.get("detached")},r.prototype.getValues=function(t){var e=t===void 0?{}:t,n=e.byName;return this.getProperties().reduce(function(i,l){var u=n?l.getName():l.getId();return i[u]="".concat(l.__getFullValue()),i},{})},r.prototype.getSeparator=function(){return this.getSplitSeparator()},r.prototype.getJoin=function(){return this.__getJoin()},r.prototype.getStyleFromProps=function(t){var e;t===void 0&&(t={});var n=this.getName(),i=this.__getJoin(),l=this.get("toStyle"),u=this.getValues(),c={};if(l)c=l(u,{join:i,name:n,property:this});else if(u=this.getValues({byName:!0}),this.isDetached())c=u;else{var f=this.getProperties().map(function(v){return v.__getFullValue({withDefault:1})}).filter(Boolean).join(i);c=(e={},e[n]=f,e)}return this.isDetached()?c[n]="":(c[n]=c[n]||"",c=Uo(Uo({},c),this.getProperties().reduce(function(v,g){return v[g.getName()]="",v},{}))),t.camelCase?Object.keys(c).reduce(function(v,g){return v[(0,At.camelCase)(g)]=c[g],v},{}):c},r.prototype.getSplitSeparator=function(){return new RegExp("".concat(this.get("separator"),"(?![^\\(]*\\))"))},r.prototype.__upProperties=function(t,e){if(e===void 0&&(e={}),!(e.__up||e.__clearIn)){var n=this.__getParentProp();if(n)return n.__upProperties(this,e);this.__upTargetsStyleProps(e,t)}},r.prototype.__upTargetsStyleProps=function(t,e){var n;t===void 0&&(t={});var i=this.getStyleFromProps();if(this.isDetached()&&e){var l=e.getName();i=(n={},n[l]=i[l],n)}this.__upTargetsStyle(i,t)},r.prototype._up=function(t,e){return e===void 0&&(e={}),this.__setProperties(this.__getSplitValue(t.value),e),$e.prototype._up.call(this,t,e),this},r.prototype.getStyle=function(t){return this.getStyleFromProps(t)},r.prototype.__getFullValue=function(t){if(t===void 0&&(t={}),this.isDetached()||t.__clear)return"";var e=this.getStyleFromProps()[this.getName()]||"";return rc(e)},r.prototype.__getJoin=function(){var t=this.get("join");return(0,k.isString)(t)?t:this.get("separator")},r.prototype.__styleHasProps=function(t){t===void 0&&(t={});var e=this.getName(),n=this.getProperties(),i=n.map(function(u){return u.getName()}),l=wp([e],i,!0);return l.some(function(u){return!(0,k.isUndefined)(t[u])&&t[u]!==""})},r.prototype.__splitValue=function(t,e){return rc(t).split(e).map(function(n){return n.trim()}).filter(Boolean)},r.prototype.__splitStyleName=function(t,e,n){return this.__splitValue(t[e]||"",n)},r.prototype.__getSplitValue=function(t,e){t===void 0&&(t="");var n=e===void 0?{}:e,i=n.byName,l=this.getProperties(),u=l.length===4&&l.every(function(v){return rv(v.getType())}),c=this.__splitValue(t,this.getSplitSeparator()),f={};return l.forEach(function(v,g){var y=c[g],_=(0,k.isUndefined)(y)?"":y;if(u){var b=c.length;_=c[g]||c[g%b+(b!=1&&b%2?1:0)]||_}var S=i?v.getName():v.getId();f[S]=_||""}),f},r.prototype.__getPropsFromStyle=function(t,e){if(t===void 0&&(t={}),e===void 0&&(e={}),!this.__styleHasProps(t))return null;var n=e.byName,i=this.getName(),l=this.getProperties(),u=this.getSplitSeparator(),c=this.get("fromStyle"),f=c?c(t,{property:this,name:i,separator:u}):{};return c||(f=this.__getSplitValue(t[i]||"",{byName:n}),l.forEach(function(v){var g=t[v.getName()],y=n?v.getName():v.getId();!(0,k.isUndefined)(g)&&g!==""&&(f[y]=g)})),f},r.prototype.__setProperties=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.getProperties().forEach(function(i){var l=t[i.getId()];i.__getFullValue()!==l&&i.upValue(l,e)});var n=(0,k.keys)(t).map(function(i){return t[i]}).join(" ");this.set("value",n,{silent:!0})},r.prototype.clear=function(){var t=this;return this.getProperties().map(function(e){return e.clear({__clearIn:!t.isDetached()})}),$e.prototype.clear.call(this),this},r.prototype.hasValue=function(t){return this.getProperties().some(function(e){return e.hasValue(t)})},r.prototype.getFullValue=function(){return this.__getFullValue()},r.prototype.__canClearProp=function(t){return this.isDetached()&&t.hasValue({noParent:!0})},r}
444)($e),jo=jS,IS=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),lr=function(){return lr=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},lr.apply(this,arguments)},RS=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},NS=/,(?![^\(]*\))/,FS=/\s(?![^(]*\))/,VS=(function(a){IS(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return lr(lr({},jo.getDefaults()),{layers:[],emptyValue:"unset",layerSeparator:", ",layerJoin:"",prepend:0,preview:!1,layerLabel:null,selectedLayer:null})},r.prototype.initialize=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),jo.callParentInit(jo,this,t,e);var n=this.get("layers"),i=new LS(n,{prop:this});i.property=this,i.properties=this.get("properties"),this.set("layers",i,{silent:!0}),this.on("change:selectedLayer",this.__upSelected),this.listenTo(i,"add remove",this.__upLayers),jo.callInit(this,t,e)},Object.defineProperty(r.prototype,"layers",{get:function(){return this.get("layers")},enumerable:!1,configurable:!0}),r.prototype.getLayers=function(){return this.layers.models},r.prototype.hasLayers=function(){return this.getLayers().length>0},r.prototype.getLayer=function(t){return t===void 0&&(t=0),this.layers.at(t)||void 0},r.prototype.getSelectedLayer=function(){var t=this.get("selectedLayer");return t&&t.getIndex()>=0?t:void 0},r.prototype.selectLayer=function(t){return this.set("selectedLayer",t,{__select:!0})},r.prototype.selectLayerAt=function(t){t===void 0&&(t=0);var e=this.getLayer(t);return e&&this.selectLayer(e)},r.prototype.moveLayer=function(t,e){e===void 0&&(e=0);var n=this.layers,i=t?t.getIndex():-1;i>=0&&(0,k.isNumber)(e)&&e>=0&&e<n.length&&i!==e&&(this.removeLayer(t),n.add(t,{at:e}))},r.prototype.addLayer=function(t,e){t===void 0&&(t={}),e===void 0&&(e={});var n={};this.getProperties().forEach(function(l){var u=l.getId(),c=t[u];n[u]=(0,k.isUndefined)(c)?l.getDefaultValue():c});var i=this.layers.push({values:n},e);return i},r.prototype.removeLayer=function(t){return this.layers.remove(t)},r.prototype.removeLayerAt=function(t){t===void 0&&(t=0);var e=this.getLayer(t);return e?this.removeLayer(e):null},r.prototype.getLayerLabel=function(t){var e="";if(t){var n=this.get("layerLabel"),i=t.getValues(),l=t.getIndex();if(n)e=n(t,{index:l,values:i,property:this});else{var u=[];this.getProperties().map(function(c){u.push(i[c.getId()])}),e=u.filter(Boolean).join(" ")}}return e},r.prototype.getStyleFromLayer=function(t,e){var n;e===void 0&&(e={});var i=this.__getJoin(),l=this.__getJoinLayers(),u=this.get("toStyle"),c=this.getName(),f=t.getValues(),v;if(u)v=u(f,{join:i,joinLayers:l,name:c,layer:t,property:this});else{var g=this.getProperties().map(function(y){var _=y.getName(),b=f[y.getId()],S=(0,k.isUndefined)(b)?y.getDefaultValue():b;if(e.number&&rv(y.getType())){var E=y.parseValue(b,e.number);S="".concat(E.value).concat(E.unit)}return{name:_,value:S}});v=this.isDetached()?g.reduce(function(y,_){return y[_.name]=_.value,y},{}):(n={},n[this.getName()]=g.map(function(y){return y.value}).join(i),n)}return e.camelCase?Object.keys(v).reduce(function(y,_){return y[(0,At.camelCase)(_)]=v[_],y},{}):v},r.prototype.getStylePreview=function(t,e){e===void 0&&(e={});var n={},i=this.get("preview");return i&&(n=this.getStyleFromLayer(t,e)),n},r.prototype.getLayerSeparator=function(){var t=this.get("layerSeparator");return(0,k.isString)(t)?new RegExp("".concat(t,"(?![^\\(]*\\))")):t},r.prototype.hasEmptyValue=function(){return!this.hasLayers()&&!!this.attributes.isEmptyValue},r.prototype.__upProperties=function(t,e){var n;e===void 0&&(e={});var i=this.getSelectedLayer();i&&(i.upValues((n={},n[t.getId()]=t.__getFullValue(),n)),!e.__up&&this.__upTargetsStyleProps(e))},r.prototype.__upLayers=function(t,e,n){this.__upTargetsStyleProps(n||e)},r.prototype.__upTargets=function(t,e){if(e===void 0&&(e={}),!e.__select)return $e.prototype.__upTargets.call(this,t,e)},r.prototype.__upTargetsStyleProps=function(t){t===void 0&&(t={}),this.__upTargetsStyle(this.getStyleFromLayers(t),t)},r.prototype.__upTargetsStyle=function(t,e){return $e.prototype.__upTargetsStyle.call(this,t,e)},r.prototype.__upSelected=function(t,e){var n=t===void 0?{}:t,i=n.noEvent;e===void 0&&(e={});var l=this.em.Styles,u=this.getSelectedLayer(),c=u?.getValues();
444c&&this.getProperties().forEach(function(f){var v,g=(v=c[f.getId()])!==null&&v!==void 0?v:"";f.__getFullValue()!==g&&f.upValue(g,lr(lr({},e),{__up:!0}))}),!i&&l.__trgEv(l.events.layerSelect,{property:this})},r.prototype._up=function(t,e){e===void 0&&(e={});var n=t.__layers,i=n===void 0?[]:n,l=RS(t,["__layers"]);return!this.isDetached()&&this.__setLayers(i),this.__upSelected({noEvent:!0},e),$e.prototype._up.call(this,l,e),this},r.prototype.__setLayers=function(t,e){t===void 0&&(t=[]),e===void 0&&(e={});var n=this.layers,i=t.map(function(l){return{values:l}});n.length===i.length?i.map(function(l,u){var c;return(c=n.at(u))===null||c===void 0?void 0:c.upValues(l.values)}):n.reset(i),this.set({isEmptyValue:!!e.isEmptyValue}),this.__upSelected({noEvent:!0})},r.prototype.__parseValue=function(t){var e=this,n=this.parseValue(t);return n.__layers=t.split(NS).map(function(i){return i.trim()}).map(function(i){return e.__parseLayer(i)}).filter(Boolean),n},r.prototype.__parseLayer=function(t){var e=this.get("parseLayer"),n=t.split(FS),i=this.getProperties();return e?e({value:t,values:n}):i.reduce(function(l,u,c){var f=n[c];return l[u.getId()]=(0,k.isUndefined)(f)?u.getDefaultValue():f,l},{})},r.prototype.__getLayersFromStyle=function(t){var e=this;if(t===void 0&&(t={}),!this.__styleHasProps(t))return null;if(this.isEmptyValueStyle(t))return[];var n=this.getName(),i=this.getProperties(),l=this.getLayerSeparator(),u=this.attributes.fromStyle,c=u?u(t,{property:this,name:n,separatorLayers:l}):[];if(!u){var f=this.__splitStyleName(t,n,l).map(function(v){return v.split(e.getSplitSeparator())}).map(function(v){var g={};return i.forEach(function(y,_){var b=v[_];g[y.getId()]=(0,k.isUndefined)(b)?y.getDefaultValue():b}),g});i.forEach(function(v){var g=v.getId();e.__splitStyleName(t,v.getName(),l).map(function(y){var _;return _={},_[g]=y||v.getDefaultValue(),_}
444).forEach(function(y,_){f[_]=f[_]?lr(lr({},f[_]),y):y})}),c=f}return(0,k.isArray)(c)?c:[c]},r.prototype.getStyle=function(t){return t===void 0&&(t={}),this.getStyleFromLayers(t)},r.prototype.getStyleFromLayers=function(t){var e=this;t===void 0&&(t={});var n={},i=this.getName(),l=this.getLayers(),u=this.getProperties(),c=l.map(function(v){return e.getStyleFromLayer(v,t)});if(c.forEach(function(v){(0,k.keys)(v).map(function(g){n[g]||(n[g]=[]),n[g].push(v[g])})}),(0,k.keys)(n).map(function(v){n[v]=n[v].join(e.__getJoinLayers())}),this.isDetached())n[i]="",!l.length&&u.map(function(v){n[v.getName()]=""});else{var f=u.reduce(function(v,g){return v[g.getName()]="",v},{});n[i]=n[i]||"",n=lr(lr({},n),f)}return lr(lr({},n),t.__clear?{}:this.getEmptyValueStyle())},r.prototype.isEmptyValueStyle=function(t){t===void 0&&(t={});var e=this.getEmptyValueStyle({force:!0}),n=(0,k.keys)(e);return!!n.length&&n.every(function(i){return e[i]===t[i]})},r.prototype.getEmptyValueStyle=function(t){t===void 0&&(t={});var e=this.attributes.emptyValue;if(e&&(!this.hasLayers()||t.force)){var n=this.getName(),i=this.getProperties(),l=(0,k.isString)(e)?e:e({property:this});if((0,k.isString)(l)){var u={};return this.isDetached()?i.map(function(c){u[c.getName()]=l}):u[n]=l,u}else return l}else return{}},r.prototype.__getJoinLayers=function(){var t=this.get("layerJoin"),e=this.get("layerSeparator");return t||((0,k.isString)(e)?e:t)},r.prototype.__getFullValue=function(){if(this.get("detached"))return"";var t=this.getStyleFromLayers();return rc(t[this.getName()])},r.prototype.hasValue=function(t){t===void 0&&(t={});var e=t.noParent,n=e&&this.getParentTarget();return(this.hasLayers()||this.hasEmptyValue())&&!n},r.prototype.clear=function(t){return t===void 0&&(t={}),this.layers.reset(),this.__upTargetsStyleProps(lr(lr({},t),{__clear:!0})),$e.prototype.clear.call(this),this},r.prototype.__canClearProp=function(){return!1},r.prototype.__getLayers=function(){return this.layers},r})(jo),HS=VS,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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Pl=function(){return Pl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Pl.apply(this,arguments)},BS=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},WS=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Xu="data-clear-style",zS=(function(a){US(r,a);function r(t){t===void 0&&(t={});var e=a.call(this,t)||this;(0,k.bindAll)(e,"__change","__updateStyle");var n=t.config||{},i=n.em;e.config=n,e.em=i,e.pfx=n.stylePrefix||"",e.ppfx=n.pStylePrefix||"",e.__destroyFn=e.destroy?e.destroy.bind(e):function(){};var l=e.model;l.view=e,e.onValueChange=(0,k.debounce)(e.onValueChange.bind(e),10),e.updateStatus=(0,k.debounce)(e.updateStatus.bind(e),0),e.listenTo(l,"destroy remove",e.remove),e.listenTo(l,"change:visible",e.updateVisibility),e.listenTo(l,"change:name change:className change:full",e.render),e.listenTo(l,"change:value",e.onValueChange),e.listenTo(l,"change:parentTarget",e.updateStatus),e.listenTo(i,"change:device",e.onValueChange);var u=e.init&&e.init.bind(e);return u&&u(),e}return r.prototype.events=function(){var t;return t={change:"inputValueChanged"},t["click [".concat(Xu,"]")]="clear",t},r.prototype.template=function(t){var e=this,n=e.pfx,i=e.ppfx;return` 445 <div class="`.concat(n,`label" data-sm-label></div> 446 <div class="`).concat(i,`fields" data-sm-fields></div> 447 `)},r.prototype.templateLabel=function(t){var e=this,n=e.pfx,i=e.em,l=t.parent,u=t.attributes,c=u.icon,f=c===void 0?"":c,v=u.info,g=v===void 0?"":v,y=i?.getConfig().icons,_=y?.close||"";return`
448 <span class="`.concat(n,"icon ").concat(f,'" title="').concat(g,`"> 449 `).concat(t.getLabel(),` 450 </span> 451 `).concat(l?"":'<div class="'.concat(n,'clear" style="display: none" ').concat(Xu,">").concat(_,"</div>"),` 452 `)},r.prototype.templateInput=function(t){return` 453 <div class="`.concat(this.ppfx,`field"> 454 <input placeholder="`).concat(t.getDefaultValue(),`"/> 455 </div> 456 `)},r.prototype.remove=function(){var t=this;return Wt.Ss.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,u=e.config,c="".concat(l,"four-color"),f="".concat(l,"color-warn"),v=this.$el.children(".".concat(i,"label")),g=this.getClearEl(),y=g?g.style:{};v.removeClass("".concat(c," ").concat(f)),y.display="none",n.hasValue({noParent:!0})&&u.highlightChanged?(v.addClass(c),u.clearProperties&&(y.display="")):n.hasValue()&&u.highlightComputed&&v.addClass(f),(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(Xu,"]"))),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){n===void 0&&(n={}),this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},r.prototype.setValue=function(t){var e=this.model,n=(0,k.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(Pl(Pl({},this._getClbOpts()),{value:t}))},r.prototype.__change=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.emit&&this.emit.bind(this);n&&n.apply(void 0,WS([this._getClbOpts()],t,!1))},r.prototype.__updateStyle=function(t,e){e===void 0&&(e={});var n=e.complete,i=e.partial,l=BS(e,["complete","partial"]),u=this.model,c=n!==!1&&i!==!0;(0,At.isObject)(t)?u.__upTargetsStyle(t,{avoidStore:!c}):u.upValue(t,{partial:!c})},r.prototype._getClbOpts=function(){var t=this,e=t.model,n=t.el,i=t.createdEl;return{el:n,createdEl:i,property:e,props:e.attributes,change:this.__change,updateStyle:this.__updateStyle}},r.prototype.render=function(){this.clearCached();var t=this,e=t.pfx,n=t.model,i=t.el,l=t.$el,u=n.getName(),c=n.getType(),f=n.get("className")||"",v="".concat(e,"property"),g=c==="number"?"".concat(e).concat(c," ").concat(e,"integer"):"".concat(e).concat(c);this.createdEl&&this.__destroyFn(this._getClbOpts()),l.empty().append(this.template(n)),l.find("[data-sm-label]").append(this.templateLabel(n));var y=this.create&&this.create.bind(this);this.createdEl=y&&y(this._getClbOpts()),l.find("[data-sm-fields]").append(this.createdEl||this.templateInput(n)),i.className="".concat(v," ").concat(g," ").concat(v,"__").concat(u," ").concat(f).trim(),i.className+=n.isFull()?" ".concat(v,"--full"):"";var _=this.onRender&&this.onRender.bind(this);return _&&_(),this.setValue(n.getValue()),this},r.prototype.onRender=function(){},r})(Wt.Ss),si=zS,KS=(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");a(r,t);function e(){this.constructor=r}
456r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),GS=(function(a){KS(r,a);function r(t){var e=a.call(this,t)||this;e.config=t.config||{},e.pfx=e.config.stylePrefix||"",e.properties=[],e.parent=t.parent;var n=e.collection;return e.listenTo(n,"add",e.addTo),e.listenTo(n,"reset",e.render),e}return r.prototype.addTo=function(t,e,n){this.add(t,null,n)},r.prototype.add=function(t,e,n){n===void 0&&(n={});var i=this,l=i.parent,u=i.config,c=e||this.el,f=new t.typeView({model:t,config:u});l&&(f.parent=l),f.render();var v=f.el;this.properties.push(f),(0,$t.Sc)(c,v,n.at)},r.prototype.remove=function(){return Wt.Ss.prototype.remove.apply(this,arguments),this.clearItems(),this},r.prototype.clearItems=function(){this.properties.forEach(function(t){return t.remove()}),this.properties=[]},r.prototype.render=function(){var t=this,e=this,n=e.$el,i=e.pfx;this.clearItems();var l=document.createDocumentFragment();return this.collection.forEach(function(u){return t.add(u,l)}),n.empty(),n.append(l),n.attr("class","".concat(i,"properties")),this},r})(Wt.Ss),Ic=GS,$S=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Al=function(){return Al=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Al.apply(this,arguments)},qS=(function(a){$S(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.templateInput=function(){var t=this.pfx;return` 457 <div class="`.concat(t,"field ").concat(t,`composite"> 458 <span id="`).concat(t,`input-holder"></span> 459 </div> 460 `)},r.prototype.remove=function(){var t;return(t=this.props)===null||t===void 0||t.remove(),si.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 Ic({config:Al(Al({},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(){si.prototype.clearCached.apply(this,arguments),delete this.props},r})(si),Ma=qS,YS=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),XS=(function(a){YS(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return 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?.getConfig().icons,u=l?.close||"",c=l?.move||"";return` 461 <div class="`.concat(e,`label-wrp"> 462 <div id="`).concat(e,'move" class="').concat(n,`no-touch-actions" data-move-layer> 463 `).concat(c,` 464 </div> 465 <div id="`).concat(e,`label" data-label></div> 466 <div id="`).concat(e,'preview-box" class="').concat(e,`layer-preview" style="display: none" data-preview-box> 467 <div id="`).concat(e,'preview" class="').concat(e,`layer-preview-cnt" data-preview></div> 468 </div> 469 <div id="`).concat(e,'close-layer" class="').concat(e,`btn-close" data-close-layer> 470 `).concat(u,` 471 </div> 472 </div> 473 <div id="`).concat(e,`inputs" data-properties></div> 474 `)},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,k.keys)(i).map(function(u){return"".concat(u,":").concat(i[u])}).join(";");n.setAttribute("style",l)}},r.prototype.updateVisibility=function(){var t,e=this,n=e.pfx,i=e.model,l=e.propertyView,u=this.getPropertiesWrapper(),c=i.isSelected();u.style.display=c?"":"none",this.$el[c?"addClass":"removeClass"]("".concat(n,"active")),c&&u.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})(Wt.Ss),JS=XS,ZS=(function(){var a=function(r,t){return a=Object.
474setPrototypeOf||{__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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),QS=(function(a){ZS(r,a);function r(t){var e=a.call(this,t)||this,n=e.collection,i=t.config||{},l=i.em,u=i.stylePrefix||"",c=i.pStylePrefix||"";e.config=i,e.pfx=u,e.ppfx=c,e.propertyView=t.propertyView,e.className="".concat(u,"layers ").concat(c,"field"),e.listenTo(n,"add",e.addTo),e.listenTo(n,"reset",e.reset),e.items=[];var f=l?.Utils;return e.sorter=f?new f.Sorter({container:e.el,ignoreViewChildren:1,containerSel:".".concat(u,"layers"),itemSel:".".concat(u,"layer"),pfx:i.pStylePrefix,em:l}):"",n.view=e,e.$el.data("model",n),e.$el.data("collection",n),e}return 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,u=l.propertyView,c=l.config,f=l.sorter,v=l.$el,g=new JS({model:t,config:c,sorter:f,propertyView:u}),y=g.render().el;if(this.items.push(g),i)i.appendChild(y);else if(typeof n<"u"){var _="before";v.children().length===n&&(n--,_="after"),n<0?v.append(y):v.children().eq(n)[_](y)}else v.append(y);return y},r.prototype.reset=function(t,e){this.clearItems(),this.render()},r.prototype.remove=function(){return this.clearItems(),Wt.Ss.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,n=e.$el,i=e.sorter,l=document.createDocumentFragment();return n.empty(),this.collection.forEach(function(u){return t.addToCollection(u,l)}),n.append(l),n.attr("class",this.className),i&&(i.plh=null),this},r})(Wt.Ss),tO=QS,eO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Bo=function(){return Bo=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Bo.apply(this,arguments)},nO=(function(a){eO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.events=function(){return Bo(Bo({},Ma.prototype.events()),{"click [data-add-layer]":"addLayer",change:""})},r.prototype.templateInput=function(){var t=this,e=t.pfx,n=t.em,i=n?.getConfig().icons,l=i?.plus||"+";return` 475 <div class="`.concat(e,"field ").concat(e,`stack"> 476 <button type="button" id="`).concat(e,`add" data-add-layer> 477 `).concat(l,` 478 </button> 479 <div data-layers-wrapper></div> 480 </div> 481 `)},r.prototype.init=function(){var t=this.model;this.listenTo(t.layers,"change reset",this.updateStatus),this.listenTo(t,"change:isEmptyValue",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(),Ma.prototype.remove.apply(this,arguments),this},r.prototype.clearCached=function(){Ma.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 u=new Ic({config:Bo(Bo({},i),{highlightComputed:!1,highlightChanged:!1}),collection:l,parent:this});u.render();var c=new tO({collection:e.layers,config:i,propertyView:this});c.render();var f=n.querySelector("[data-layers-wrapper]");f.appendChild(c.el),this.props=u,this.layersView=c}},r}
481)(Ma),rO=nO,iO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),kl=function(){return kl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},kl.apply(this,arguments)},oO=(function(a){iO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.events=function(){return kl(kl({},si.prototype.events()),{"click [data-clear-asset]":"clear","click [data-open-assets]":"openAssetManager"})},r.prototype.templateInput=function(){var t,e=this,n=e.pfx,i=e.em,l=(t=this.em)===null||t===void 0?void 0:t.getConfig().icons,u=l?.close;return` 482 <div class="`.concat(n,"field ").concat(n,`file"> 483 <div id='`).concat(n,`input-holder'> 484 <div class="`).concat(n,`btn-c"> 485 <button class="`).concat(n,'btn" id="').concat(n,`images" type="button" data-open-assets> 486 `).concat(i.t("styleManager.fileButton"),` 487 </button> 488 </div> 489 <div style="clear:both;"></div> 490 </div> 491 <div id="`).concat(n,'preview-box" class="').concat(n,`preview-file" data-preview-box> 492 <div id="`).concat(n,'preview-file" class="').concat(n,`preview-file-cnt" data-preview></div> 493 <div id="`).concat(n,'close" class="').concat(n,'preview-file-close" data-clear-asset>').concat(u,`</div> 494 </div> 495 </div> 496 `)},r.prototype.__setValueInput=function(t){var e=this,n=e.model,i=e.el,l=n.getDefaultValue(),u=i.querySelector("[data-preview-box]"),c=i.querySelector("[data-preview]");u.style.display=!t||t===l?"none":"",c.style.backgroundImage=t||n.getDefaultValue()},r.prototype.openAssetManager=function(){var t=this,e,n=(e=this.em)===null||e===void 0?void 0:e.Assets;n?.open({select:function(i,l){var u=(0,k.isString)(i)?i:i.get("src");t.model.upValue(u,{partial:!l}),l&&n.close()},types:["image"],accept:"image/*"})},r})(si),aO=oO,sO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),lO=(function(a){sO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return 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();var u=i.querySelector(".".concat(e,"fields"));u.appendChild(l.el),this.input=l.inputEl.get(0),this.inputInst=l}},r.prototype.clearCached=function(){si.prototype.clearCached.apply(this,arguments),this.inputInst=null},r})(si),ai=lO,uO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),cO=(function(a){uO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return 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;ai.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,u=e.el,c=new Ph({target:l,model:i,ppfx:n,onChange:this.__handleChange}),f=c.render();u.querySelector(".".concat(n,"fields")).appendChild(f.el),this.input=(t=f.inputEl)===null||t===void 0?void 0:t.get(0),this.inputInst=f}},r}
496)(ai),fO=cO,dO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ml=function(){return Ml=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Ml.apply(this,arguments)},bp=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},pO=(function(a){dO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return Ml(Ml({},$e.getDefaults()),{options:[],full:0})},r.prototype.getOptions=function(){var t=this.attributes,e=t.options,n=t.list;return(e&&e.length?e:n)||[]},r.prototype.getOption=function(t){var e=this,n=(0,At.isDef)(t)?t:this.getValue();return this.getOptions().filter(function(i){return e.getOptionId(i)===n})[0]||null},r.prototype.setOptions=function(t){return t===void 0&&(t=[]),this.set("options",t),this},r.prototype.addOption=function(t){if(t){var e=this.getOptions();this.setOptions(bp(bp([],e,!0),[t],!1))}return this},r.prototype.getOptionId=function(t){return(0,At.isDef)(t.id)?t.id:t.value},r.prototype.getOptionLabel=function(t,e){var n;e===void 0&&(e={});var i=e.locale,l=i===void 0?!0:i,u=((0,k.isString)(t)?this.getOption(t):t)||{},c=this.getOptionId(u),f=u.label||u.name||c,v=e.property||this.getId();return l&&((n=this.em)===null||n===void 0?void 0:n.t("styleManager.options.".concat(v,".").concat(c)))||f},r.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];$e.prototype.initialize.apply(this,t),this.listenTo(this,"change:options",this.__onOptionChange)},r.prototype.__onOptionChange=function(){this.set("list",this.get("options"))},r})($e),_c=pO,hO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),vO=(function(a){hO(r,a);function r(t){var e=a.call(this,t)||this;return e.listenTo(e.model,"change:options",e.updateOptions),e}return r.prototype.templateInput=function(){var t=this,e=t.pfx,n=t.ppfx;return` 497 <div class="`.concat(n,"field ").concat(n,`select"> 498 <span id="`).concat(e,`input-holder"></span> 499 <div class="`).concat(n,`sel-arrow"> 500 <div class="`).concat(n,`d-s-arrow"></div> 501 </div> 502 </div> 503 `)},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(u){var c=e.getOptionId(u),f=e.getOptionLabel(c),v=u.style?u.style.replace(/"/g,"""):"",g=v?'style="'.concat(v,'"'):"",y=c.replace(/"/g,""");i.push('<option value="'.concat(y,'" ').concat(g,">").concat(f,"</option>"))});var l=this.el.querySelector("#".concat(t,"input-holder"));l.innerHTML="<select>".concat(i.join(""),"</select>"),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})(si),iv=vO,gO=(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");a(r,t);function e(){this.constructor=r}
503r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Ll=function(){return Ll=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Ll.apply(this,arguments)},yO=(function(a){gO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return Ll(Ll({},_c.getDefaults()),{full:1})},r})(_c),mO=yO,_O=(function(){var a=function(r,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},a(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),wO=(function(a){_O(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.templateInput=function(){var t=this.ppfx;return'<div class="'.concat(t,"field ").concat(t,'field-radio"></div>')},r.prototype.onRender=function(){var t=this,e=t.pfx,n=t.ppfx,i=this.model,l="".concat(n,"radio-item-label"),u=i.getName(),c=i.getOptions(),f="".concat(e,"radio ").concat(e,"radio-").concat(u),v=i.cid;if(!this.input){var g=[];c.forEach(function(_){var b=_.className?"".concat(_.className," ").concat(e,"icon ").concat(l):"",S=i.getOptionId(_),E="".concat(u,"-").concat(S,"-").concat(v),N=b?"":i.getOptionLabel(S),z=_.title?'title="'.concat(_.title,'"'):"",R=i.getValue()===S?"checked":"";g.push(` 504 <div class="`.concat(n,`radio-item"> 505 <input type="radio" class="`).concat(f,'" id="').concat(E,'" name="').concat(u,"-").concat(v,'" value="').concat(S,'" ').concat(R,`/> 506 <label class="`).concat(b||l,'" ').concat(z,' for="').concat(E,'">').concat(N,`</label> 507 </div> 508 `))});var y=this.el.querySelector(".".concat(n,"field"));y.innerHTML='<div class="'.concat(n,'radio-items">').concat(g.join(""),"</div>"),this.input=y.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})(iv),bO=wO,xO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),ro=function(){return ro=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},ro.apply(this,arguments)},CO=(function(a){xO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return ro(ro({},$e.getDefaults()),{units:[],unit:"",min:"",max:"",step:1})},r.prototype.getUnits=function(){return this.get("units")||[]},r.prototype.getUnit=function(){return this.get("unit")},r.prototype.getMin=function(){return this.get("min")},r.prototype.getMax=function(){return this.get("max")},r.prototype.getStep=function(){return this.get("step")},r.prototype.upUnit=function(t,e){return e===void 0&&(e={}),this._up({unit:t},e)},r.prototype.initialize=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),$e.callParentInit($e,this,t,e);var n=this.get("unit"),i=this.getUnits();this.input=(0,At.hasWin)()?new kh({model:this}):void 0,i.length&&!n&&this.set("unit",i[0],{silent:!0}),$e.callInit(this,t,e)},r.prototype.__getClearProps=function(){return ro(ro({},$e.prototype.__getClearProps()),{unit:""})},r.prototype.parseValue=function(t,e){e===void 0&&(e={});var n=$e.prototype.parseValue.apply(this,arguments),i=this.input.validateInputValue(n.value,ro({deepCheck:1},e)),l=i.value,u=i.unit;return n.value=l,n.unit=u,n},r.prototype.getFullValue=function(){var t=this.get("value"),e=this.get("unit"),n=(0,k.isUndefined)(t)?"":"".concat(t),i=!(0,k.isUndefined)(e)&&n?e:"",l="".concat(n).concat(i);return $e.prototype.getFullValue.apply(this,[l])},r}
508)($e),Dl=CO,SO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),jl=function(){return jl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},jl.apply(this,arguments)},OO=(function(a){SO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.defaults=function(){return jl(jl({},Dl.getDefaults()),{showInput:1})},r})(Dl),TO=OO,EO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Il=function(){return Il=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Il.apply(this,arguments)},PO=(function(a){EO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.events=function(){return Il(Il({},ai.prototype.events()),{"change [type=range]":"inputValueChanged","input [type=range]":"inputValueChangedSoft",change:""})},r.prototype.templateInput=function(t){var e=this.ppfx;return` 509 <div class="`.concat(e,"field ").concat(e,`field-range"> 510 <input type="range" min="`).concat(t.get("min"),'" max="').concat(t.get("max"),'" step="').concat(t.get("step"),`"/> 511 </div> 512 `)},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),ai.prototype.setValue.apply(this,arguments)},r.prototype.onRender=function(){ai.prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")},r.prototype.clearCached=function(){ai.prototype.clearCached.apply(this,arguments),delete this.slider},r})(ai),AO=PO,kO=Wt.pM.extend(Uh),MO=kO.extend({extendViewApi:1,init:function(){var a=this,r=a.opts,t=a.em,e=r.module||t?.get("StyleManager");e&&(e.__listenAdd(this,e.events.propertyAdd),e.__listenRemove(this,e.events.propertyRemove))},types:[{id:"stack",model:HS,view:rO,isType:function(a){if(a&&a.type=="stack")return a}},{id:"composite",model:jo,view:Ma,isType:function(a){if(a&&a.type=="composite")return a}},{id:"file",model:$e,view:aO,isType:function(a){if(a&&a.type=="file")return a}},{id:"color",model:$e,view:fO,isType:function(a){if(a&&a.type=="color")return a}},{id:"select",model:_c,view:iv,isType:function(a){if(a&&a.type=="select")return a}},{id:"radio",model:mO,view:bO,isType:function(a){if(a&&a.type=="radio")return a}},{id:"slider",model:TO,view:AO,isType:function(a){if(a&&a.type=="slider")return a}},{id:"integer",model:Dl,view:ai,isType:function(a){if(a&&a.type=="integer")return a}},{id:"number",model:Dl,view:ai,isType:function(a){if(a&&a.type=="number")return a}},{id:"base",model:$e,view:si,isType:function(a){return a.type="base",a}}]}),Rc=MO,LO=(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");a(r,t);function e(){this.constructor=r}
512r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Rl=function(){return Rl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Rl.apply(this,arguments)},DO=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},jO=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},IO=(function(a){LO(r,a);function r(t,e){e===void 0&&(e={});var n=a.call(this,t)||this,i=e.em;n.em=i;var l=t||{},u=n.buildProperties(l.buildProps),c=n.get("name")||"",f=[];!n.get("id")&&n.set("id",c.replace(/ /g,"_").toLowerCase()),u?f=n.extendProperties(u):f=n.get("properties").map(function(g){return(0,k.isString)(g)?n.buildProperties(g)[0]:g}).filter(Boolean),f=f.map(function(g){return n.checkExtend(g)});var v=new Rc(f,{em:i});return v.sector=n,n.set("properties",v),n}return r.prototype.defaults=function(){return{id:"",name:"",open:!0,visible:!0,extendBuilded:!0,properties:[]}},Object.defineProperty(r.prototype,"properties",{get:function(){return this.get("properties")},enumerable:!1,configurable:!0}),r.prototype.getId=function(){return this.get("id")},r.prototype.getName=function(){var t,e=this.getId();return((t=this.em)===null||t===void 0?void 0:t.t("styleManager.sectors.".concat(e)))||this.get("name")},r.prototype.setName=function(t){return this.set("name",t)},r.prototype.isOpen=function(){return!!this.get("open")},r.prototype.setOpen=function(t){return this.set("open",t)},r.prototype.isVisible=function(){return!!this.get("visible")},r.prototype.getProperties=function(t){t===void 0&&(t={});var e=this.properties,n=e.models?jO([],e.models,!0):e;return n.filter(function(i){var l=!0;if(t.withValue&&(l=i.hasValue({noParent:!0})),t.withParentValue){var u=i.hasValue({noParent:!0});l=!u&&i.hasValue()}return l})},r.prototype.getProperty=function(t){return this.getProperties().filter(function(e){return e.get("id")===t})[0]||void 0},r.prototype.addProperty=function(t,e){return this.properties.add(this.checkExtend(t),e)},r.prototype.extendProperties=function(t,e,n){n===void 0&&(n=!1);for(var i=t.length,l=e||this.get("properties"),u=this.get("extendBuilded"),c=[],f=0,v=l.length;f<v;f++){for(var g=l[f],y=0,_=0;_<i;_++){var b=t[_];if(g.property==b.property||g.id==b.property){var S=g.properties;S&&S.length&&(g.properties=this.extendProperties(b.properties||[],S,1)),t[_]=u?(0,k.extend)(b,g):g,c[_]=t[_],y=1;continue}}y||(t.push(g),c.push(g))}return n?c.filter(function(E){return E}):t},r.prototype.checkExtend=function(t){var e=((0,k.isString)(t)?{extend:t}:t)||{},n=e.extend,i=DO(e,["extend"]);return n?Rl(Rl({},this.buildProperties([n])[0]||{}),i):t},r.prototype.buildProperties=function(t){var e,n=t||[];if(!n.length)return[];var i=(e=this.em)===null||e===void 0?void 0:e.Styles.builtIn;return i?.build(n)},r})(Wt.Kx),ov=IO,RO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Nl=function(){return Nl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Nl.apply(this,arguments)},NO=(function(a){RO(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}return r.prototype.initialize=function(t,e){e===void 0&&(e={});var n=e.module,i=e.em;this.em=i,this.module=n,this.listenTo(this,"reset",this.onReset)},r.prototype.model=function(t,e){e===void 0&&(e={});var n=e.collection.em;return new ov(t,Nl(Nl({},e),{em:n}))},r.prototype.onReset=function(t,e){e===void 0&&(e={});var n=e.previousModels||[];
vendor: 8,723 bytes, line 512
512n.forEach(function(i){return i.get("properties").reset()})},r})(Wt.pM),FO=NO,Li=function(){return Li=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Li.apply(this,arguments)},VO=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},Zi=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},Sn=function(a){return a.map(function(r){return{id:r}})},HO=(function(){function a(){this.props={},this.typeNumber="number",this.typeColor="color",this.typeRadio="radio",this.typeSelect="select",this.typeFile="file",this.typeSlider="slider",this.typeComposite="composite",this.typeStack="stack",this.unitsSize=["px","%","em","rem","vh","vw"],this.unitsSizeNoPerc=["px","em","rem","vh","vw"],this.unitsTime=["s","ms"],this.unitsAngle=["deg","rad","grad"],this.fixedValues=["initial","inherit","auto"];var r=", sans-serif",t=["flex-start","flex-end","center"],e=Zi(Zi([],t,!0),["baseline","stretch"],!1);this.optsBgSize=Sn(["auto","cover","contain"]),this.optsBgAttach=Sn(["scroll","fixed","local"]),this.optsBgRepeat=Sn(["repeat","repeat-x","repeat-y","no-repeat"]),this.optsWrap=Sn(["nowrap","wrap","wrap-reverse"]),this.optsOverflow=Sn(["visible","hidden","scroll","auto"]),this.optsDir=Sn(["row","row-reverse","column","column-reverse"]),this.opstDisplay=Sn(["block","inline","inline-block","flex","none"]),this.optsTransitFn=Sn(["linear","ease","ease-in","ease-out","ease-in-out"]),this.optsCursor=Sn(["auto","pointer","copy","crosshair","grab","grabbing","help","move","text"]),this.optsFloat=Sn(["none","left","right"]),this.optsPos=Sn(["static","relative","absolute","fixed"]),this.optsTextAlign=Sn(["left","center","right","justify"]),this.optsFlexAlign=Sn(e),this.optsJustCont=Sn(Zi(Zi([],t,!0),["space-between","space-around","space-evenly"],!1)),this.optsAlignCont=Sn(Zi(Zi([],t,!0),["space-between","space-around","stretch"],!1)),this.optsAlignSelf=Sn(Zi(["auto"],e,!0)),this.optsTransitProp=Sn(["all","width","height","background-color","transform","box-shadow","opacity"]),this.optsBorderStyle=Sn(["none","solid","dotted","dashed","double","groove","ridge","inset","outset"]),this.optsBgPos=Sn(["left top","left center","left bottom","right top","right center","right bottom","center top","center center","center bottom"]),this.optsWeight=[{id:"100",label:"Thin"},{id:"200",label:"Extra-Light"},{id:"300",label:"Light"},{id:"400",label:"Normal"},{id:"500",label:"Medium"},{id:"600",label:"Semi-Bold"},{id:"700",label:"Bold"},{id:"800",label:"Extra-Bold"},{id:"900",label:"Ultra-Bold"}],this.optsShadowType=[{id:"",label:"Outside"},{id:"inset",label:"Inside"}],this.optsFonts=["Arial, Helvetica"+r,"Arial Black, Gadget"+r,"Brush Script MT"+r,"Comic Sans MS, cursive"+r,"Courier New, Courier, monospace","Georgia, serif","Helvetica"+r,"Impact, Charcoal"+r,"Lucida Sans Unicode, Lucida Grande"+r,"Tahoma, Geneva"+r,"Times New Roman, Times, serif","Trebuchet MS, Helvetica"+r,"Verdana, Geneva"+r].map(function(n){return{id:n,label:n.split(",")[0]}}),this.fixedFontSizes=["medium","xx-small","x-small","small","large","x-large","xx-large","smaller","larger","length","initial","inherit"],this.fixedLetSpace=["normal","initial","inherit"],this.requireFlex={display:["flex"]},this.init()}return a.prototype.__sub=function(r){var t=this;return function(){return r.map(function(e){if((0,k.isString)(e))return t.get(e);var n=e.extend,i=VO(e,["extend"]);return Li(Li({},t.get(n)),i)})}},a.prototype.init=function(){var r=this,t=this,e=t.fixedValues,n=t.requireFlex,i=t.typeNumber;this.props={};var l=[["text-shadow-h",{type:i,default:"0",units:this.unitsSizeNoPerc}],["top",{default:"auto",units:this.unitsSize,fixedValues:e},"text-shadow-h"],["right",{},"top"],["bottom",{},"top"],["left",{},"top"],["margin-top",{default:"0"},"top"],["margin-right",{},"margin-top"],["margin-bottom",{},"margin-top"],["margin-left",{},"margin-top"],["padding-top",{min:0},"margin-top"],["padding-right",{},"padding-top"],["padding-bottom",{},"padding-top"],["padding-left",{},"padding-top"],["width",{min:0},"top"],["min-width",{},"width"],["max-width",{},"width"],["height",{},"width"],["min-height",{},"width"],["max-height",{},"width"],["flex-basis",{requiresParent:n},"width"],["font-size",{default:"medium",fixedValues:this.fixedFontSizes},"width"],["letter-spacing",{default:"normal",fixedValues:this.fixedLetSpace},"top"],["line-height",{},"letter-spacing"],["text-shadow-v",{},"text-shadow-h"],["text-shadow-blur",{min:0},"text-shadow-h"],["border-radius-c",{property:"border-radius",fixedValues:void 0},"padding-top"],["border-top-left-radius",{},"border-radius-c"],["border-top-right-radius",{},"border-radius-c"],["border-bottom-left-radius",{},"border-radius-c"],["border-bottom-right-radius",{},"border-radius-c"],["border-width",{units:this.unitsSizeNoPerc},"border-radius-c"],["box-shadow-h",{},"text-shadow-h"],["box-shadow-v",{},"text-shadow-h"],["box-shadow-blur",{default:"5px"},"text-shadow-blur"],["box-shadow-spread",{},"text-shadow-h"],["transition-duration",{default:"2s",units:this.unitsTime},"border-radius-c"],["perspective",{},"border-radius-c"],["order",{type:i,default:"0",requiresParent:n}],["flex-grow",{},"order"],["flex-shrink",{default:"1"},"order"],["float",{type:this.typeRadio,default:"none",options:this.optsFloat}],["position",{default:"static",options:this.optsPos},"float"],["text-align",{default:"left",options:this.optsTextAlign},"float"],["color",{type:this.typeColor,default:"black",full:!0}],["text-shadow-color",{},"color"],["border-color",{},"color"],["box-shadow-color",{},"color"],["background-color",{default:"none"},"color"],["background-image",{type:this.typeFile,functionName:"url",default:"none",full:!0}],["opacity",{type:this.typeSlider,default:"1",min:0,max:1,step:.01,full:!0}],["display",{type:this.typeSelect,default:"block",options:this.opstDisplay}],["flex-direction",{default:"row",options:this.optsDir,requires:n},"display"],["flex-wrap",{default:"nowrap",options:this.optsWrap},"flex-direction"],["justify-content",{default:"flex-start",options:this.optsJustCont},"flex-wrap"],["align-items",{default:"stretch",options:this.optsFlexAlign},"flex-wrap"],["align-content",{options:this.optsAlignCont},"align-items"],["align-self",{default:"auto",options:this.optsAlignSelf,requiresParent:n},"display"],["font-family",{default:"Arial, Helvetica, sans-serif",options:this.optsFonts},"display"],["font-weight",{default:"400",options:this.optsWeight},"display"],["border-style",{default:"solid",options:this.optsBorderStyle},"display"],["box-shadow-type",{default:"",options:this.optsShadowType},"display"],["background-repeat",{default:"repeat",options:this.optsBgRepeat},"display"],["background-position",{default:"left top",options:this.optsBgPos},"display"],["background-attachment",{default:"scroll",options:this.optsBgAttach},"display"],["background-size",{default:"auto",options:this.optsBgSize},"display"],["transition-property",{default:"width",options:this.optsTransitProp},"display"],["transition-timing-function",{default:"ease",options:this.optsTransitFn},"display"],["cursor",{default:"auto",options:this.optsCursor},"display"],["overflow",{default:"visible",options:this.optsOverflow},"display"],["overflow-x",{},"overflow"],["overflow-y",{},"overflow"],["margin",{type:this.typeComposite,properties:this.__sub([{extend:"margin-top",id:"margin-top-sub"},{extend:"margin-right",id:"margin-right-sub"},{extend:"margin-bottom",id:"margin-bottom-sub"},{extend:"margin-left",id:"margin-left-sub"}])}],["padding",{properties:this.__sub([{extend:"padding-top",id:"padding-top-sub"},{extend:"padding-right",id:"padding-right-sub"},{extend:"padding-bottom",id:"padding-bottom-sub"},{extend:"padding-left",id:"padding-left-sub"}])},"margin"],["border",{properties:this.__sub([{extend:"border-width",id:"border-width-sub"},{extend:"border-style",id:"border-style-sub"},{extend:"border-color",id:"border-color-sub"}])},"margin"],["border-radius",{properties:this.__sub([{extend:"border-top-left-radius",id:"border-top-left-radius-sub"},{extend:"border-top-right-radius",id:"border-top-right-radius-sub"},{extend:"border-bottom-right-radius",id:"border-bottom-right-radius-sub"},{extend:"border-bottom-left-radius",id:"border-bottom-left-radius-sub"}])}
512,"margin"],["transition",{type:this.typeStack,properties:this.__sub([{extend:"transition-property",id:"transition-property-sub"},{extend:"transition-duration",id:"transition-duration-sub"},{extend:"transition-timing-function",id:"transition-timing-function-sub"}])}],["box-shadow",{preview:!0,layerLabel:function(u,c){var f=c.values,v=f["box-shadow-h"],g=f["box-shadow-v"],y=f["box-shadow-blur"],_=f["box-shadow-spread"];return"".concat(v," ").concat(g," ").concat(y," ").concat(_)},properties:this.__sub(["box-shadow-h","box-shadow-v","box-shadow-blur","box-shadow-spread","box-shadow-color","box-shadow-type"])},"transition"],["text-shadow",{default:"none",layerLabel:function(u,c){var f=c.values,v=f["text-shadow-h"],g=f["text-shadow-v"],y=f["text-shadow-blur"];return"".concat(v," ").concat(g," ").concat(y)},properties:this.__sub(["text-shadow-h","text-shadow-v","text-shadow-blur","text-shadow-color"])},"box-shadow"],["background",{detached:!0,layerLabel:function(u,c){var f=c.values,v=f["background-repeat-sub"]||"",g=f["background-position-sub"]||"",y=f["background-attachment-sub"]||"",_=f["background-size-sub"]||"";return[v,g,y,_].join(" ")},properties:this.__sub([{extend:"background-image",id:"background-image-sub"},{extend:"background-repeat",id:"background-repeat-sub"},{extend:"background-position",id:"background-position-sub"},{extend:"background-attachment",id:"background-attachment-sub"},{extend:"background-size",id:"background-size-sub"}])},"box-shadow"],["transform",{type:"stack",layerSeparator:" ",fromStyle:function(u,c){var f=c.property,v=c.name,g=u[v]||"",y=f.getLayerSeparator();return g?g.split(y).map(function(_){var b=f.__parseFn(_),S=b.name,E=b.value;return{"transform-type":S,"transform-value":E}}):[]},toStyle:function(u,c){var f,v=c.name;return f={},f[v]="".concat(u["transform-type"],"(").concat(u["transform-value"],")"),f},properties:[{property:"transform-type",name:"Type",type:this.typeSelect,default:"rotateZ",full:!0,options:[{id:"scaleX",propValue:{units:[""],step:.01}},{id:"scaleY",propValue:{units:[""],step:.01}},{id:"scaleZ",propValue:{units:[""],step:.01}},{id:"rotateX",propValue:{units:this.unitsAngle,step:1}},{id:"rotateY",propValue:{units:this.unitsAngle,step:1}},{id:"rotateZ",propValue:{units:this.unitsAngle,step:1}},{id:"translateX",propValue:{units:this.unitsSize,step:1}},{id:"translateY",propValue:{units:this.unitsSize,step:1}}],onChange:function(u){var c=u.property,f=u.to;if(f.value){var v=c.getOption(),g=Li({},v.propValue||{}),y=c.getParent().getProperty("transform-value"),_=y.getUnit();(!_||g?.units.indexOf(_)<0)&&(g.unit=g?.units[0]||""),y.up(g)}}},{property:"transform-value",type:this.typeNumber,default:"0",full:!0}]}]];return l.forEach(function(u){var c=u[0],f=u[1],v=u[2];r.add(c,f||{},{from:v})}),this},a.prototype.add=function(r,t,e){t===void 0&&(t={}),e===void 0&&(e={});var n=e.from||"",i=this.props[n||r]||{},l=Li(Li(Li({},i),{property:r}),t);return l.properties&&(0,k.isFunction)(l.properties)&&(l.properties=l.properties()),this.props[r]=l,l},a.prototype.get=function(r){return this.props[r]},a.prototype.build=function(r){var t=this,e=[],n=(0,k.isString)(r)?[r]:r;return n.forEach(function(i){e.push(t.get(i)||{property:i})}),e},a})(),UO=HO,BO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),WO=function(a,r){return Object.defineProperty?Object.defineProperty(a,"raw",{value:r}):a.raw=r,a},zO=(function(a){BO(r,a);function r(t){var e=a.call(this,t)||this,n=t.config||{},i=e.model,l=n.em;return e.config=n,e.em=l,e.pfx=n.stylePrefix||"",e.listenTo(i,"destroy remove",e.remove),e.listenTo(i,"change:open",e.updateOpen),e.listenTo(i,"change:visible",e.updateVisibility),e}return r.prototype.template=function(t){var e,n=t.pfx,i=t.label,l=(e=this.em)===null||e===void 0?void 0:e.getConfig().icons,u=l?.caret||"",c="".concat(n,"sector-");return fr(xp||(xp=WO([` 513 <div class="`,`title" data-sector-title> 514 <div class="`,'caret">$',`</div> 515 <div class="`,'label">',`</div> 516 </div> 517 `],[` 518 <div class="`,`title" data-sector-title> 519 <div class="`,'caret">$',`</div> 520 <div class="`,'label">',`</div> 521 </div> 522 `])),c,c,u,c,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,e=t.$el,n=t.pfx;return e.find(".".concat(n,"properties")).get(0)},r.prototype.toggle=function(){var t=this.model;t.setOpen(!t.get("open"))},r.prototype.renderProperties=function(){var t=this,e=t.model,n=t.config,i=e.get("properties");if(i){var l=new Ic({collection:i,config:n});this.$el.append(l.render().el)}},r.prototype.render=function(){var t=this,e=t.pfx,n=t.model,i=t.$el,l=n.getId(),u=n.getName();return i.html(this.template({pfx:e,label:u})),this.renderProperties(),i.attr("class","".concat(e,"sector ").concat(e,"sector__").concat(l," no-select")),this.updateOpen(),this},r})(Wt.Ss),KO=zO,xp,GO=(function(){var a=function(r,t){return a=Object.
522setPrototypeOf||{__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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),$O=(function(a){GO(r,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?.stylePrefix||"",e.ppfx=i?.pStylePrefix||"",e.config=i,e.module=n,e.listenTo(l,"add",e.addTo),e.listenTo(l,"reset",e.render),e}return r.prototype.remove=function(){var t=this;return Wt.Ss.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,l=i.config,u=i.el,c=e||u,f=new KO({model:t,config:l}).render().el;return(0,$t.Sc)(c,f,n.at),f},r.prototype.render=function(){var t=this,e=this,n=e.$el,i=e.pfx,l=e.ppfx;n.empty();var u=document.createDocumentFragment();return this.collection.each(function(c){return t.addToCollection(c,u)}),n.append(u),n.addClass("".concat(i,"sectors ").concat(l,"one-bg ").concat(l,"two-color")),this},r})(Wt.Ss),qO=$O,YO=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Di=function(){return Di=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Di.apply(this,arguments)},Cp=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},av="style",qa="".concat(av,":"),Nc="".concat(qa,"sector"),XO="".concat(Nc,":add"),JO="".concat(Nc,":remove"),ZO="".concat(Nc,":update"),Fc="".concat(qa,"property"),QO="".concat(Fc,":add"),tT="".concat(Fc,":remove"),eT="".concat(Fc,":update"),sv="".concat(qa,"layer:select"),wc="".concat(qa,"target"),nT="".concat(qa,"custom"),Sp=function(a){return a||a===0},rT={all:av,sectorAdd:XO,sectorRemove:JO,sectorUpdate:ZO,propertyAdd:QO,propertyRemove:tT,propertyUpdate:eT,layerSelect:sv,target:wc,custom:nT},iT=(function(a){YO(r,a);function r(t){var e=a.call(this,t,"StyleManager",new FO([],{em:t}),rT,OS)||this;e.Sector=ov,e.storageKey="",(0,k.bindAll)(e,"__clearStateTarget");var n=e.config,i=n.pStylePrefix;i&&(n.stylePrefix=i+n.stylePrefix),e.builtIn=new UO,e.properties=new Rc([],{em:t,module:e}),e.sectors=e.all;var l=new Wt.Kx({targets:[]});e.model=l;var u=Vn.I.update,c="component:toggled ".concat(u,":classes change:state change:device frame:resized selector:type");e.upAll=(0,k.debounce)(function(){return e.__upSel()},0),l.listenTo(t,c,e.upAll),l.listenTo(t,"component:toggled",e.__clearStateTarget);var f=(0,k.debounce)(function(){e.__upProps(),e.__trgCustom()},0);l.listenTo(t,"styleable:change undo redo",f);var v=(0,k.debounce)(function(){return e.__trgCustom()},0);return l.listenTo(t,"".concat(sv," ").concat(wc),v),l.on("change:lastTarget",function(){return t.trigger(wc,e.getSelected())}),e}return r.prototype.__upSel=function(){this.select(this.em.getSelectedAll())},r.prototype.__trgCustom=function(t){t===void 0&&(t={}),this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},r.prototype.__trgEv=function(t){for(var e,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];(e=this.em).trigger.apply(e,Cp([t],n,!1))},r.prototype.__clearStateTarget=function(){var t=this,e=this.em,n=this.__getStateTarget();n&&e?.skip(function(){e.Css.remove(n),t.model.set({stateTarget:null})})},r.prototype.onLoad=function(){this.sectors.add(this.config.sectors,{silent:!0})},r.prototype.postRender=function(){this.__appendTo()},r.prototype.addSector=function(t,e,n){n===void 0&&(n={});var i=this.getSector(t);
522return i||(e.id=t,i=this.sectors.add(e,n)),i},r.prototype.getSector=function(t,e){e===void 0&&(e={});var n=this.sectors.where({id:t})[0];return!n&&e.warn&&this._logNoSector(t),n||null},r.prototype.getSectors=function(t){t===void 0&&(t={});var e=this.sectors,n=e&&e.models?t.array?Cp([],e.models,!0):e:[];return t.visible?n.filter(function(i){return i.isVisible()}):n},r.prototype.removeSector=function(t){return this.getSectors().remove(this.getSector(t,{warn:!0}))},r.prototype.addProperty=function(t,e,n){n===void 0&&(n={});var i=this.getSector(t,{warn:!0}),l;return i&&(l=i.addProperty(e,n)),l},r.prototype.getProperty=function(t,e){var n=this.getSector(t,{warn:!0}),i;return n&&(i=n.properties.filter(function(l){return l.get("property")===e||l.get("id")===e})[0]),i},r.prototype.getProperties=function(t){var e,n=this.getSector(t,{warn:!0});return n&&(e=n.properties),e},r.prototype.removeProperty=function(t,e){var n=this.getProperties(t);return n?n.remove(this.getProperty(t,e)):null},r.prototype.select=function(t,e){var n=this;e===void 0&&(e={});var i=this.em,l=(0,k.isArray)(t)?t:[t],u=e.stylable,c=i.Css,f=[];l.filter(Boolean).forEach(function(S){var E=S;if((0,k.isString)(S)){var N=c.getRule(S)||c.setRule(S);!(0,k.isUndefined)(u)&&N.set({stylable:u}),E=N}f.push(E)});var v=e.component||f.filter(function(S){return(0,At.isComponent)(S)}).reverse()[0];f=f.map(function(S){return n.getModelToStyle(S)});var g=i.getState(),y=f.slice().reverse()[0],_=this.getParentRules(y,{state:g,component:v}),b=this.__getStateTarget();return i.skip(function(){var S;if(g&&(!((S=y?.getState)===null||S===void 0)&&S.call(y))){var E=y.getStyle();b?b.setStyle(E):b=c.getAll().add({selectors:"gjs-selected",style:E,shallow:!0,important:!0})}else b&&(c.remove(b),b=void 0)}),this.model.set({targets:f,lastTarget:y,lastTargetParents:_,stateTarget:b,component:v}),this.__upProps(e),f},r.prototype.getSelected=function(){return this.model.get("lastTarget")},r.prototype.getSelectedAll=function(){return this.model.get("targets")},r.prototype.getSelectedParents=function(){return this.model.get("lastTargetParents")||[]},r.prototype.__getStateTarget=function(){return this.model.get("stateTarget")},r.prototype.addStyleTargets=function(t,e){this.getSelectedAll().map(function(l){return l.addStyle(t,e)});var n=this.getSelected();n&&this.__emitCmpStyleUpdate(t);var i=this.__getStateTarget();n&&i?.setStyle(n.getStyle(),e)},r.prototype.getBuiltIn=function(t){return this.builtIn.get(t)},r.prototype.getBuiltInAll=function(){return this.builtIn.props},r.prototype.addBuiltIn=function(t,e){return this.builtIn.add(t,e)},r.prototype.getModelToStyle=function(t,e){e===void 0&&(e={});var n=this.em,i=e.skipAdd;if(n&&t?.toHTML){var l=n.getConfig(),u=n.UndoManager,c=n.Css,f=n.Selectors,v=f?f.getConfig():{},g=l.devicePreviewMode?"":n.get("state"),y=t.get("classes"),_=y.getStyleable(),b=_.length,S=!v.componentFirst||e.useClasses,E={noCount:1},N={state:g,addOpts:E};u.skip(function(){var z;if(b&&S){var R=n.getCurrentMedia();z=c.get(_,g,R),!z&&!i&&(z=c.add(_,g,R,{},E))}else if(l.avoidInlineStyle){var W=t.getId();z=c.getIdRule(W,N),!z&&!i&&(z=c.setIdRule(W,{},N)),t.is("wrapper")&&z.set("wrapper",1,E)}z&&(t=z)})}return t},r.prototype.getParentRules=function(t,e){var n=e===void 0?{}:e,i=n.state,l=n.component,u=this.em,c=[];if(u&&t){var f=l,v=u.Css,g=u.CodeManager.getGenerator("css"),y=t.toHTML?t:t.getComponent(),_={array:!0},b=[],S=[],E=[],N=[],z=[],R=function(ut){return ut.length?v.getRules().filter(function(q){var lt=q.getSelectors().map(function(H){return H.getFullName()});return lt.length===0?!1:lt.every(function(H){return ut.indexOf(H)>=0})}):[]},W=function(ut){return ut?v.getRules().filter(function(q){return q.selectorsToString()===ut}):[]};if(y)b=v.getRules("#".concat(y.getId())),S=W(y.get("tagName")),N=f?R(f.getSelectors().getFullName(_)):[],z=N.concat(S).concat(b);else{b=f?v.getRules("#".concat(f.getId())):[],S=W(f?.get("tagName")||"");var ct=f?.getSelectors().getFullName(_)||[],_t=ct.filter(function(ut){return t.getSelectors().getFullName(_).findIndex(function(q){return q===ut})===-1});E=R(_t.concat(t.getSelectors().getFullName(_))),z=S.concat(b).concat(E)}var xt=z.filter(function(ut){return(0,k.isUndefined)(i)?1:ut.get("state")===i}).sort(g.sortRules).reverse();c=xt.slice(xt.indexOf(t)+1)}return c},r.prototype.addType=function(t,e){this.properties.addType(t,e)},r.prototype.getType=function(t){return this.properties.getType(t)},r.prototype.getTypes=function(){return this.properties.getTypes()},r.prototype.createType=function(t,e){var n=e===void 0?{}:e,i=n.model,l=i===void 0?{}:i,u=n.view,c=u===void 0?{}:u,f=this.config,v=this.getType(t);if(v)return new v.view(Di({model:new v.model(l),config:f},c))},r.prototype.render=function(){var t=this,e=t.config,n=t.em,i=t.SectView,l=i&&i.el;return this.SectView=new qO({el:l,em:n,config:e,module:this,collection:this.sectors}),this.SectView.render().el},r.prototype._logNoSector=function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},r.prototype.__emitCmpStyleUpdate=function(t,e){e===void 0&&(e={});var n=this.em;if(!t.__p){var i=this.getSelectedAll(),l=e.components||n.getSelectedAll(),u=Array.isArray(l)?l:[l],c=Di({},t);delete c.__p,u.forEach(function(f){return!i.includes(f)&&f.__onStyleChange(c)})}},r.prototype.__upProps=function(t){var e=this;t===void 0&&(t={});var n=this.getSelected();if(n){var i=this.sectors,l=this.model.get("component"),u=this.getSelectedParents(),c=n.getStyle(),f=u.map(function(v){return{target:v,style:v.getStyle()}});i.map(function(v){v.getProperties().map(function(g){e.__upProp(g,c,f,t)})}
522),i.forEach(function(v){var g=v.getProperties();g.forEach(function(_){var b=_.__checkVisibility({target:n,component:l,sectors:i});_.set("visible",b)});var y=g.some(function(_){return _.isVisible()});v.set("visible",y)})}},r.prototype.__upProp=function(t,e,n,i){var l=this,u=t.getName(),c=e[u],f=Sp(c),v=t.getType()==="stack",g=t.getType()==="composite",y=Di(Di({},i),{__up:!0}),_=!g&&!v,b=t,S=t,E=v?b.__getLayersFromStyle(e):[],N=g?S.__getPropsFromStyle(e):{},z=f?c:null,R=null;if(v&&E===null||g&&N===null){var W=v?"__getLayersFromStyle":"__getPropsFromStyle",ct=n.filter(function(lt){return b[W](lt.style)!==null})[0];if(ct){z=ct.style[u],R=ct.target;var _t=b[W](ct.style);v?E=_t:N=_t}}else if(!f){z=null;var ct=n.filter(function(H){return Sp(H.style[u])})[0];ct&&(z=ct.style[u],R=ct.target)}if(t.__setParentTarget(R),_&&t.__getFullValue()!==z&&t.upValue(z,y),v&&b.__setLayers(E||[],{isEmptyValue:b.isEmptyValueStyle(e)}),g){var xt=S.getProperties();if(S.isDetached()){var ut=S.__getPropsFromStyle(e,{byName:!0})||{},q=n.map(function(lt){return Di(Di({},lt),{style:S.__getPropsFromStyle(lt.style,{byName:!0})||{}})});xt.map(function(lt){return l.__upProp(lt,ut,q,i)})}else S.__setProperties(N||{},y),S.getProperties().map(function(lt){return lt.__setParentTarget(R)})}},r.prototype.destroy=function(){var t;[this.properties,this.sectors].forEach(function(e){e.reset(),e.stopListening()}),(t=this.SectView)===null||t===void 0||t.remove(),this.model.stopListening(),this.upAll.cancel()},r})(Ri),oT=iT,aT=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),Fn=function(){return Fn=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Fn.apply(this,arguments)},Ju=function(a,r,t,e){function n(i){return i instanceof t?i:new t(function(l){l(i)})}return new(t||(t=Promise))(function(i,l){function u(v){try{f(e.next(v))}catch(g){l(g)}}function c(v){try{f(e.throw(v))}catch(g){l(g)}}function f(v){v.done?i(v.value):n(v.value).then(u,c)}f((e=e.apply(a,r||[])).next())})},Zu=function(a,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,n,i,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(f){return function(v){return c([f,v])}}function c(f){if(e)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(t=0)),t;)try{if(e=1,n&&(i=f[0]&2?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,n=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=r.call(a,t)}catch(v){f=[6,v],n=0}finally{e=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},sT=function(a,r){var t={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&r.indexOf(e)<0&&(t[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(a);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(a,e[n])&&(t[e[n]]=a[e[n]]);return t},lT=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))};Mg().$=Je.default;var uT=[Fx,Tx,eC,dS,Gw,ty,Mw,oT,ww,dC,iS,IC,SS,wb,Ub,_m,Mb,nw],cT=[cx,H_,_x,S_];Lg({$:Je.default});var Op={debug:console.log,info:console.info,warning:console.warn,error:console.error},fT=(function(a){aT(r,a);function r(t){t===void 0&&(t={});var e=a.call(this)||this;e.__skip=!1,e.defaultRunning=!1,e.destroyed=!1,e._config=t;var n=e.config;e.set("Config",t),e.set("modules",[]),e.set("toLoad",[]),e.set("storables",[]),e.set("selected",new Ig),e.set("dmode",n.dragMode);var i=n.el,l=n.log,u=l===!0?(0,k.keys)(Op):(0,k.isArray)(l)?l:[];return(0,k.bindAll)(e,"initBaseColorPicker"),i&&n.fromElement&&(n.components=i.innerHTML),e.attrsOrig=i?(0,k.toArray)(i.attributes).reduce(function(c,f){return c[f.nodeName]=f.nodeValue,c},{}):"",n.components&&!n.pageManager&&(n.pageManager={pages:[{component:n.components}]}),uT.forEach(function(c){return e.loadModule(c)}),cT.forEach(function(c){return e.loadStorableModule(c)}),e.on("change:componentHovered",e.componentHovered,e),e.on("change:changesCount",e.updateChanges,e),e.on("change:readyLoad change:readyCanvas",e._checkReady,e),u.forEach(function(c){return e.listenLog(c)}),[{from:"change:selectedComponent",to:"component:toggled"}
522].forEach(function(c){var f=c.from,v=c.to;e.listenTo(e,f,function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];e.trigger.apply(e,lT([v],g,!1)),e.logWarning("The event '".concat(f,"' is deprecated, replace it with '").concat(v,"'"))})}),e}return r.prototype.defaults=function(){return{editing:0,selected:0,clipboard:null,dmode:0,componentHovered:null,previousModel:null,changesCount:0,storables:[],modules:[],toLoad:[],opened:{},device:""}},Object.defineProperty(r.prototype,"storables",{get:function(){return this.get("storables")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"modules",{get:function(){return this.get("modules")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"toLoad",{get:function(){return this.get("toLoad")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"selected",{get:function(){return this.get("selected")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"shallow",{get:function(){return this.get("shallow")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"I18n",{get:function(){return this.get("I18n")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Utils",{get:function(){return this.get("Utils")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Commands",{get:function(){return this.get("Commands")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Keymaps",{get:function(){return this.get("Keymaps")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Modal",{get:function(){return this.get("Modal")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Panels",{get:function(){return this.get("Panels")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CodeManager",{get:function(){return this.get("CodeManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"UndoManager",{get:function(){return this.get("UndoManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RichTextEditor",{get:function(){return this.get("RichTextEditor")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Canvas",{get:function(){return this.get("Canvas")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Editor",{get:function(){return this.get("Editor")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Components",{get:function(){return this.get("DomComponents")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Css",{get:function(){return this.get("CssComposer")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Blocks",{get:function(){return this.get("BlockManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Selectors",{get:function(){return this.get("SelectorManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Storage",{get:function(){return this.get("StorageManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Traits",{get:function(){return this.get("TraitManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Parser",{get:function(){return this.get("Parser")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Layers",{get:function(){return this.get("LayerManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Assets",{get:function(){return this.get("AssetManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Devices",{get:function(){return this.get("DeviceManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Pages",{get:function(){return this.get("PageManager")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Styles",{get:function(){return this.get("StyleManager")},enumerable:!1,configurable:!0}),r.prototype._checkReady=function(){this.get("readyLoad")&&this.get("readyCanvas")&&!this.get("ready")&&this.set("ready",!0)},r.prototype.getContainer=function(){return this.config.el},r.prototype.listenLog=function(t){this.listenTo(this,"log:".concat(t),Op[t])},Object.defineProperty(r.prototype,"config",{get:function(){return this._config}
522,enumerable:!1,configurable:!0}),r.prototype.getConfig=function(t){var e=this.config;return(0,k.isUndefined)(t)?e:e[t]},r.prototype.loadOnStart=function(){var t=this,e=this.config,n=e.projectData,i=e.headless,l=this.Storage;this.toLoad.reverse().forEach(function(f){return f.onLoad()});var u=function(){t.modules.forEach(function(f){return f.postLoad&&f.postLoad(t)}),t.set("readyLoad",1)};i?(n&&this.loadData(n),u()):this._storageTimeout=setTimeout(function(){return Ju(t,void 0,void 0,function(){var f;return Zu(this,function(v){switch(v.label){case 0:return n?(this.loadData(n),[3,5]):[3,1];case 1:if(!l?.canAutoload())return[3,5];v.label=2;case 2:return v.trys.push([2,4,,5]),[4,this.load()];case 3:return v.sent(),[3,5];case 4:return f=v.sent(),this.logError(f),[3,5];case 5:return u(),[2]}})})});var c=new r({noticeOnUnload:!1,storageManager:!1,undoManager:!1});c.Pages.onLoad(),c.Canvas.postLoad(),this.set("shallow",c)},r.prototype.updateChanges=function(t,e,n){var i=this,l=this.Storage,u=this.getDirtyCount();n.isClear||(this.updateItr&&clearTimeout(this.updateItr),this.updateItr=setTimeout(function(){return i.trigger("update")})),this.config.noticeOnUnload&&(window.onbeforeunload=u?function(){return!0}:null),l.isAutosave()&&u>=l.getStepsBeforeSave()&&this.store().catch(function(c){return i.logError(c)})},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,u=n.unset,c=sT(n,["unset"]);i.set("changesCount",l+1,c)},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),u=(i||{}).shiftKey,c=((0,k.isArray)(t)?t:[t]).map(function(y){var _,b;return((b=(_=y?.delegate)===null||_===void 0?void 0:_.select)===null||b===void 0?void 0:b.call(_,y))||y}).filter(Boolean),f=this.getSelectedAll(),v=this.getConfig().multipleSelection,g=(0,k.isArray)(t);(g||!t)&&this.removeSelected(f.filter(function(y){return!(0,k.contains)(c,y)})),c.forEach(function(y){if(y&&(n.trigger("component:select:before",y,e),!y.get("selectable")||e.abort))if(e.useValid){for(var _=y.parent();_&&!_.get("selectable");)_=_.parent();y=_}else return;if(l&&v)return n.toggleSelected(y);if(u&&v){n.clearSelection(n.Canvas.getWindow());var b=y.collection,S=y.index(),E,N;if(n.getSelectedAll().forEach(function(z){var R=z.collection,W=z.index();R===b&&(W<S?E=(0,k.isUndefined)(E)?W:Math.max(E,W):W>S&&(N=(0,k.isUndefined)(N)?W:Math.min(N,W)))}),!(0,k.isUndefined)(E))for(;E!==S;)n.addSelected(b.at(E)),E++;if(!(0,k.isUndefined)(N))for(;N!==S;)n.addSelected(b.at(N)),N--;return n.addSelected(y)}!g&&n.removeSelected(f.filter(function(z){return z!==y})),n.addSelected(y,e)})},r.prototype.addSelected=function(t,e){var n=this;e===void 0&&(e={});var i=(0,k.isArray)(t)?t:[t];i.forEach(function(l){var u=n.selected;if(!(!l||!l.get("selectable")||l.parents().some(function(f){return u.hasComponent(f)}))){e.forceChange&&n.removeSelected(l,e);var c=u.allComponents().filter(function(f){return(0,k.contains)(f.parents(),l)});c.forEach(function(f){return n.removeSelected(f,e)}),u.addComponent(l,e),n.trigger("component:select",l,e),n.Canvas.addSpot({type:Lr.F.Select,component:l})}})},r.prototype.removeSelected=function(t,e){var n=this;e===void 0&&(e={}),this.selected.removeComponent(t,e);var i=(0,k.isArray)(t)?t:[t];
522i.forEach(function(l){return n.Canvas.removeSpots({type:Lr.F.Select,component:l})})},r.prototype.toggleSelected=function(t,e){var n=this;e===void 0&&(e={});var i=(0,k.isArray)(t)?t:[t];i.forEach(function(l){n.selected.hasComponent(l)?n.removeSelected(l,e):n.addSelected(l,e)})},r.prototype.setHovered=function(t,e){var n=this;e===void 0&&(e={});var i=function(c,f){var v=n,g=v.config,y=v.Canvas,_=n.getHovered(),b=n.getSelectedAll(),S=Lr.F.Hover,E=Lr.F.Spacing;n.set("componentHovered",c||null,f),_&&(y.removeSpots({type:S,component:_}),y.removeSpots({type:E,component:_})),c&&(y.addSpot({type:S,component:c}),(!b.includes(c)||g.showOffsetsSelected)&&y.addSpot({type:E,component:c}))};if(!t)return i();var l="component:hover";if(e.forceChange&&i(),this.trigger("".concat(l,":before"),t,e),!t.get("hoverable"))if(e.useValid&&!e.abort){for(var u=t.parent();u&&!u.get("hoverable");)u=u.parent();t=u}else return;e.abort||(i(t,e),this.trigger(l,t,e))},r.prototype.getHovered=function(){return this.get("componentHovered")},r.prototype.setComponents=function(t,e){return e===void 0&&(e={}),this.Components.setComponents(t,e)},r.prototype.getComponents=function(){var t=this.Components,e=this.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.Css;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,k.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.Components.getComponent(),u=l?this.CodeManager.getCode(l,"html",Fn(Fn({},n),t)):"";return u+=i?"<script>".concat(i,"<\/script>"):"",u},r.prototype.getCss=function(t){t===void 0&&(t={});var e=this.config,n=e.optsCss,i=t.avoidProtected,l=(0,k.isUndefined)(t.keepUnusedStyles)?e.keepUnusedStyles:t.keepUnusedStyles,u=this.Css,c=t.component||this.Components.getComponent(),f=i?"":e.protectedCss,v=c&&this.CodeManager.getCode(c,"css",Fn(Fn({cssc:u,keepUnusedStyles:l},n),t));return c?t.json?v:f+v:""},r.prototype.getJs=function(t){t===void 0&&(t={});var e=t.component||this.Components.getWrapper();return e?this.CodeManager.getCode(e,"js").trim():""},r.prototype.store=function(t){return Ju(this,void 0,void 0,function(){var e;return Zu(this,function(n){switch(n.label){case 0:return e=this.storeData(),[4,this.Storage.store(e,t)];case 1:return n.sent(),this.clearDirtyCount(),[2,e]}})})},r.prototype.load=function(t){return Ju(this,arguments,void 0,function(e,n){var i;return n===void 0&&(n={}),Zu(this,function(l){switch(l.label){case 0:return[4,this.Storage.load(e)];case 1:return i=l.sent(),this.loadData(i),[4,(0,At.wait)()];case 2:return l.sent(),n.clear&&(this.UndoManager.clear(),this.clearDirtyCount()),[2,i]}})})},r.prototype.storeData=function(){var t={},e=this.getEditing();return e&&e.trigger("sync:content",{noCount:!0}),this.storables.forEach(function(n){t=Fn(Fn({},t),n.store(1))}),JSON.parse(JSON.stringify(t))},r.prototype.loadData=function(t){return t===void 0&&(t={}),(0,At.isEmptyObj)(t)||(this.storables.forEach(function(e){return e.clear()}),this.storables.forEach(function(e){return e.load(t)})),t},r.prototype.getDeviceModel=function(){var t=this.get("device");return this.Devices.get(t)},r.prototype.runDefault=function(t){t===void 0&&(t={});var e=this.get("Commands").get(this.config.defaultCommand);!e||this.defaultRunning||(e.stop(this,this,t),e.run(this,this,t),this.defaultRunning=!0)},r.prototype.stopDefault=function(t){t===void 0&&(t={});var e=this.get("Commands");if(e){var n=e.get(this.config.defaultCommand);!n||!this.defaultRunning||(n.stop(this,this,t),this.defaultRunning=!1)}},r.prototype.refreshCanvas=function(t){t===void 0&&(t={}),this.Canvas.refresh({spots:t.tools})},r.prototype.clearSelection=function(t){var e,n=t||window;(e=n.getSelection())===null||e===void 0||e.removeAllRanges()},r.prototype.getCurrentMedia=function(){var t=this.config,e=this.getDeviceModel(),n=t.mediaCondition,i=t.devicePreviewMode,l=e&&e.get("widthMedia");return e&&l&&!i?"(".concat(n,": ").concat(l,")"):""},r.prototype.getWrapper=function(){return this.Components.getWrapper()},r.prototype.setCurrentFrame=function(t){return this.set("currentFrame",t)},r.prototype.getCurrentFrame=function(){return this.get("currentFrame")},r.prototype.getCurrentFrameModel=function(){var t;return(t=this.getCurrentFrame()||{})===null||t===void 0?void 0:t.model},r.prototype.getIcon=function(t){var e=this.config.icons||{};return e[t]||""},r.prototype.getDirtyCount=function(){return this.get("changesCount")},r.prototype.clearDirtyCount=function(){return this.set({changesCount:0},{isClear:!0})},r.prototype.getZoomDecimal=function(){return this.Canvas.getZoomDecimal()},r.prototype.getZoomMultiplier=function(){return this.Canvas.getZoomMultiplier()},r.prototype.setDragMode=function(t){return this.set("dmode",t)},r.prototype.getDragMode=function(t){var e=t?.getDragMode()||this.get("dmode");return e||""},r.prototype.t=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.get("I18n");return n?.t.apply(n,t)},r.prototype.inAbsoluteMode=function(t){return this.getDragMode(t)==="absolute"},r.prototype.destroyAll=function(){var t=this,e=this,n=e.config,i=e.view,l=this.getEditor(),u=(n.grapesjs||{}).editors,c=u===void 0?[]:u,f=this.get("shallow");this._storageTimeout&&clearTimeout(this._storageTimeout),f?.destroyAll(),this.stopListening(),this.stopDefault(),(this.modules||[]).slice().reverse().forEac
522h(function(v){return v.destroy()}),i?.remove&&i.remove(),this.clear({silent:!0}),this.destroyed=!0,["_config","view","_previousAttributes","_events","_listeners"].forEach(function(v){return t[v]={}}),c.splice(c.indexOf(l),1),(0,At.hasWin)()&&(0,Je.default)(n.el).empty().attr(this.attrsOrig)},r.prototype.getEditing=function(){var t=this.get("editing");return t&&t.model||void 0},r.prototype.setEditing=function(t){return this.set("editing",t),this},r.prototype.isEditing=function(){return!!this.get("editing")},r.prototype.log=function(t,e){e===void 0&&(e={});var n=e.ns,i=e.level,l=i===void 0?"debug":i;if(this.trigger("log",t,e),l&&this.trigger("log:".concat(l),t,e),n){var u="log-".concat(n);this.trigger(u,t,e),l&&this.trigger("".concat(u,":").concat(l),t,e)}},r.prototype.logInfo=function(t,e){this.log(t,Fn(Fn({},e),{level:"info"}))},r.prototype.logWarning=function(t,e){this.log(t,Fn(Fn({},e),{level:"warning"}))},r.prototype.logError=function(t,e){this.log(t,Fn(Fn({},e),{level:"error"}))},r.prototype.initBaseColorPicker=function(t,e){e===void 0&&(e={});var n=this.config,i=n.colorPicker,l=i===void 0?{}:i,u=n.el,c=n.stylePrefix;return(0,Je.default)(t).spectrum(Fn(Fn({containerClassName:"".concat(c,"one-bg ").concat(c,"two-color"),appendTo:u||"body",maxSelectionSize:8,showPalette:!0,palette:[],showAlpha:!0,chooseText:"Ok",cancelText:"\u2A2F"},e),l))},r.prototype.skip=function(t){this.__skip=!0;var e=this.UndoManager;e?e.skip(t):t(),this.__skip=!1},r.prototype.data=function(t,e,n){var i="_gjs-data";if(t[i]||(t[i]={}),(0,k.isUndefined)(n))return t[i][e];t[i][e]=n},r})(Wt.Kx),dT=fT,pT=(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");a(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}})(),hT=(function(a){pT(r,a);function r(t){var e=a.call(this,{model:t})||this,n=t.Panels,i=t.UndoManager;return t.view=e,t.once("change:ready",function(){n.active(),n.disableButtons(),i.clear(),setTimeout(function(){t.trigger("load",t.Editor),t.clearDirtyCount()})}),e}return r.prototype.render=function(){var t=this,e=this,n=e.$el,i=e.model,l=i.Panels,u=i.Canvas,c=i.config,f=i.modules,v=c.stylePrefix,g=["".concat(v,"editor")];!c.customUI&&g.push("".concat(v,"one-bg ").concat(v,"two-color"));var y=(0,Je.default)(c.el||"body ".concat(c.container));c.cssIcons&&(0,At.appendStyles)(c.cssIcons,{unique:!0,prepand:!0}),n.empty(),c.width&&y.css("width",c.width),c.height&&y.css("height",c.height),n.append(u.render()),n.append(l.render());var _=i.shallow,b=_.Canvas.render();return b.style.display="none",n.append(b),n.attr("class",g.join(" ")),y.addClass("".concat(v,"editor-cont")).empty().append(n),f.forEach(function(S){var E;return(E=S.postRender)===null||E===void 0?void 0:E.call(S,t)}),this},r})(Wt.Ss),vT=hT,Ba=function(){return Ba=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Ba.apply(this,arguments)},Tp=function(a,r,t,e){function n(i){return i instanceof t?i:new t(function(l){l(i)})}return new(t||(t=Promise))(function(i,l){function u(v){try{f(e.next(v))}catch(g){l(g)}}function c(v){try{f(e.throw(v))}catch(g){l(g)}}function f(v){v.done?i(v.value):n(v.value).then(u,c)}f((e=e.apply(a,r||[])).next())})},Ep=function(a,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,n,i,l;return l={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(f){return function(v){return c([f,v])}}function c(f){if(e)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(t=0)),t;)try{if(e=1,n&&(i=f[0]&2?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,n=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=r.call(a,t)}catch(v){f=[6,v],n=0}finally{e=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},gT=function(a,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,i;e<n;e++)(i||!(e in r))&&(i||(i=Array.prototype.slice.call(r,0,e)),i[e]=r[e]);return a.concat(i||Array.prototype.slice.call(r))},yT=(function(){function a(r,t){r===void 0&&(r={}),t===void 0&&(t={});var e;this.html=fr,this.config=Ba(Ba(Ba({},cd),r),{pStylePrefix:(e=r.stylePrefix)!==null&&e!==void 0?e:cd.stylePrefix}),this.em=new dT(this.config),this.$=t.$,this.em.init(this),this.editor=this.em}return Object.defineProperty(a.prototype,"Config",{get:function(){return this.em.config}
522,enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"I18n",{get:function(){return this.em.I18n},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Utils",{get:function(){return this.em.Utils},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Commands",{get:function(){return this.em.Commands},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Keymaps",{get:function(){return this.em.Keymaps},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Modal",{get:function(){return this.em.Modal},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Panels",{get:function(){return this.em.Panels},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Canvas",{get:function(){return this.em.Canvas},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Parser",{get:function(){return this.em.Parser},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"CodeManager",{get:function(){return this.em.CodeManager},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"UndoManager",{get:function(){return this.em.UndoManager},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"RichTextEditor",{get:function(){return this.em.RichTextEditor},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Pages",{get:function(){return this.em.Pages},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Components",{get:function(){return this.em.Components},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"DomComponents",{get:function(){return this.em.Components},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Layers",{get:function(){return this.em.Layers},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"LayerManager",{get:function(){return this.em.Layers},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Css",{get:function(){return this.em.Css},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"CssComposer",{get:function(){return this.em.Css},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Storage",{get:function(){return this.em.Storage},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"StorageManager",{get:function(){return this.em.Storage},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Assets",{get:function(){return this.em.Assets},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"AssetManager",{get:function(){return this.em.Assets},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Blocks",{get:function(){return this.em.Blocks},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"BlockManager",{get:function(){return this.em.Blocks},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Traits",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"TraitManager",{get:function(){return this.em.Traits},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Selectors",{get:function(){return this.em.Selectors},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"SelectorManager",{get:function(){return this.em.Selectors},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Styles",{get:function(){return this.em.Styles},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"StyleManager",{get:function(){return this.em.Styles},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"Devices",{get:function(){return this.em.Devices},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"DeviceManager",{get:function(){return this.em.Devices},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"EditorModel",{get:function(){return this.em},enumerable:!1,configurable:!0}),a.prototype.getConfig=function(r){return this.em.getConfig(r)},a.prototype.getHtml=function(r){return this.em.getHtml(r)},a.prototype.getCss=function(r){return this.em.getCss(r)},a.prototype.getJs=function(r){return this.em.getJs(r)},a.prototype.getComponents=function(){return this.Components.getComponents()},a.prototype.getWrapper=function(){return this.Components.getWrapper()},a.prototype.setComponents=function(r,t){return t===void 0&&(t={}),this.em.setComponents(r,t),this},a.prototype.addComponents=function(r,t){return this.getWrapper().append(r,t)},a.prototype.getStyle=function(){return this.em.Css.getAll()},a.prototype.setStyle=function(r,t){return t===void 0&&(t={}),this.em.setStyle(r,t),this},a.prototype.addStyle=function(r,t){return t===void 0&&(t={}),this.em.addStyle(r,t)},a.prototype.getSelected=function(){return this.em.getSelected()},a.prototype.getSelectedAll=function(){return this.em.getSelectedAll()},a.prototype.getSelectedToStyle=function(){var r=this.em.getSelected();if(r)return this.StyleManager.getModelToStyle(r)},a.prototype.select=function(r,t){return this.em.setSelected(r,t),this},a.prototype.selectAdd=function(r){return this.em.addSelected(r),this},a.prototype.selectRemove=function(r){return this.em.removeSelected(r),this},a.prototype.selectToggle=function(r){return this.em.toggleSelected(r),this},a.prototype.getEditing=function(){return this.em.getEditing()},a.prototype.setDevice=function(r){return this.em.set("device",r),this},a.prototype.getDevice=function(){return this.em.get("device")},a.prototype.runCommand=function(r,t){return t===void 0&&(t={}),this.Commands.run(r,t)},a.prototype.stopCommand=function(r,t){return t===void 0&&(t={}),this.Commands.stop(r,t)},a.prototype.store=function(r){return Tp(this,void 0,void 0,function(){return Ep(this,function(t){switch(t.label){case 0:return[4,this.em.store(r)];case 1:return[2,t.sent()]}})})},a.prototype.load=function(r){return Tp(this,arguments,void 0,function(t,e){return e===void 0&&(e={}),Ep(this,function(n){switch(n.label){case 0:return[4,this.em.load(t,e)];case 1:return[2,n.sent()]}})})},a.prototype.getProjectData=function(){return this.em.storeData()},a.prototype.loadProjectData=function(r){return this.em.loadData(r)},a.prototype.storeData=function(){return this.em.storeData()},a.prototype.loadData=function(r){return this.em.loadData(r)},a.prototype.getContainer=function(){return this.config.el},a.prototype.getDirtyCount=function(){return this.em.getDirtyCount()},a.prototype.clearDirtyCount=function(){return this.em.clearDirtyCount()},a.prototype.refresh=function(r){this.em.refreshCanvas(r)},a.prototype.setCustomRte=function(r){this.RichTextEditor.customRte=r},a.prototype.setCustomParserCss=function(r){return this.Parser.getConfig().parserCss=r,this},a.prototype.setDragMode=function(r){return this.em.setDragMode(r),this},a.prototype.log=function(r,t){return t===void 0&&(t={}),this.em.log(r,t),this},a.prototype.t=function(){for(var r,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(r=this.em).t.apply(r,t)},a.prototype.on=function(r,t){return this.em.on(r,t),this},a.prototype.once=function(r,t){return this.em.once(r,t),this},a.prototype.off=function(r,t){return this.em.off(r,t),this},a.prototype.trigger=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return this.em.trigger.apply(this.em,gT([r],t,!0)),this},a.prototype.destroy=function(){this.em&&(this.em.destroyAll(),this.editorView=void 0)},a.prototype.getEl=function(){var r;return(r=this.editorView)===null||r===void 0?void 0:r.el},a.prototype.getModel=function(){return this.em},a.prototype.render=function(){var r;return(r=this.editorView)===null||r===void 0||r.remove(),this.editorView=new vT(this.em),this.editorView.render().el},a.prototype.onReady=function(r){this.em.get("ready")?r(this):this.em.on("load",r)},a})(),mT=yT,_T=function(a,r){var t=r.get(a);if(!t){var e=(0,At.getGlobal)()[a];t=e?.default||e}return t},lv=function(a,r){return(0,k.isString)(a)?_T(a,r):a?.default||a},uv=function(a,r){a.getModel().logWarning("Plugin ".concat(r," not found"),{context:"plugins",plugin:r})},wT=(function(){function a(){this.plugins={}}return a.prototype.add=function(r,t){var e=this.get(r);return e||(this.plugins[r]=t,t)},a.prototype.get=function(r){return this.plugins[r]},a.prototype.getAll=function(){return this.plugins},a})(),bT=wT,xT=function(){var a=function(){for(var t,e=window.navigator.userAgent,n=[["edge",/Edge\/([0-9\._]+)/],["ie",/MSIE\s(7\.0)/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]],i=0;i<n.length;i++){var l=n[i];if(t=l[1].exec(e),t)break}return!!t};
522if((0,At.hasWin)()&&a()){var r=DOMImplementation.prototype.createHTMLDocument;DOMImplementation.prototype.createHTMLDocument=function(t){return t||(t=""),r.apply(document.implementation,[t])}}},Fl=function(){return Fl=Object.assign||function(a){for(var r,t=1,e=arguments.length;t<e;t++){r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},Fl.apply(this,arguments)};xT();var bc=new bT,Pp=[],cv=function(a,r){var t=lv(a,bc);return function(e){t?t(e,r||{}):uv(e,a)}},fv={$:Je.default,editors:Pp,plugins:bc,usePlugin:cv,version:"0.21.13",init:function(a){a===void 0&&(a={});var r=a.headless,t=a.container;if(!t&&!r)throw new Error("'container' is required");var e=Fl(Fl({autorender:!0,plugins:[],pluginsOpts:{}},a),{grapesjs:this,el:r?void 0:(0,k.isElement)(t)?t:document.querySelector(t)}),n=new mT(e,{$:Je.default}),i=n.getModel();return e.plugins.forEach(function(l){var u=lv(l,bc),c=e.pluginsOpts[l]||{};u?u(n,c):uv(n,l)}),i.loadOnStart(),e.autorender&&!r&&n.render(),Pp.push(n),n}},CT=fv,TT=Vl.Ay,ET=Vl.I0,PT=Vl.nu;export{TT as default,ET as grapesjs,PT as usePlugin};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.