/*! grapesjs - 0.20.1 */ !function(t,e){'object'==typeof exports&&'object'==typeof module?module.exports=e():'function'==typeof define&&define.amd?define([],e):'object'==typeof exports?exports["grapesjs"]=e():t["grapesjs"]=e()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(()=>(()=>{var t={3410:(t,e,n)=>{var r,i,o;1&&(i=[n(9050),n(2316)],r=function(t,e){var n=Array.prototype.slice;function r(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function i(t,e){return n.call(t,e)}function o(e,n){return null!=e&&(t.isArray(n)||(n=i(arguments,1)),t.all(n,(function(t){return t in e})))}var a=function(){var e=!1,n=-1;function r(){n++,e=!0,t.defer((function(){e=!1}))}return function(){return e||r(),n}}();function s(){this.registeredObjects=[],this.cidIndexes=[]}function l(e,n,r,i){for(var o,a=0,s=n.length;at.maximumStackLength&&(t.shift(),t.pointer--)}}}s.prototype={isRegistered:function(e){return e&&e.cid?this.registeredObjects[e.cid]:t.contains(this.registeredObjects,e)},register:function(t){return!this.isRegistered(t)&&(t&&t.cid?(this.registeredObjects[t.cid]=t,this.cidIndexes.push(t.cid)):this.registeredObjects.push(t),!0)},unregister:function(e){if(this.isRegistered(e)){if(e&&e.cid)delete this.registeredObjects[e.cid],this.cidIndexes.splice(t.indexOf(this.cidIndexes,e.cid),1);else{var n=t.indexOf(this.registeredObjects,e);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return t.map(this.cidIndexes,(function(t){return this.registeredObjects[t]}),this).concat(this.registeredObjects)}};var p={add:{undo:function(t,e,n,r){t.remove(n,r)},redo:function(t,e,n,r){r.index&&(r.at=r.index),t.add(n,r)},on:function(e,n,r){return{object:n,before:void 0,after:e,options:t.clone(r)}}},remove:{undo:function(t,e,n,r){"index"in r&&(r.at=r.index),t.add(e,r)},redo:function(t,e,n,r){t.remove(e,r)},on:function(e,n,r){return{object:n,before:e,after:void 0,options:t.clone(r)}}},change:{undo:function(e,n,r,i){t.isEmpty(n)?t.each(t.keys(r),e.unset,e):(e.set(n),i&&i.unsetData&&i.unsetData.before&&i.unsetData.before.length&&t.each(i.unsetData.before,e.unset,e))},redo:function(e,n,r,i){t.isEmpty(r)?t.each(t.keys(n),e.unset,e):(e.set(r),i&&i.unsetData&&i.unsetData.after&&i.unsetData.after.length&&t.each(i.unsetData.after,e.unset,e))},on:function(e,n){var r=e.changedAttributes(),i=t.keys(r),o=t.pick(e.previousAttributes(),i),a=t.keys(o),s=(n||(n={})).unsetData={after:[],before:[]};return i.length!=a.length&&(i.length>a.length?t.each(i,(function(t){t in o||s.before.push(t)}),this):t.each(a,(function(t){t in r||s.after.push(t)}))),{object:e,before:o,after:r,options:t.clone(n)}}},reset:{undo:function(t,e,n){t.reset(e)},redo:function(t,e,n){t.reset(n)},on:function(e,n){return{object:e,before:n.previousModels,after:t.clone(e.models)}}}};function d(){}function g(e,n,r,i){if("object"==typeof n)return t.each(n,(function(t,n){2===e?g(e,t,r,i):g(e,n,t,r)}));switch(e){case 0:o(r,"undo","redo","on")&&t.all(t.pick(r,"undo","redo","on"),t.isFunction)&&(i[n]=r);break;case 1:i[n]&&t.isObject(r)&&(i[n]=t.extend({},i[n],r));break;case 2:delete i[n]}return this}d.prototype=p;var v=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(t){c("undo",this.attributes)},redo:function(t){c("redo",this.attributes)}}),m=e.Collection.extend({model:v,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),y=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new m,this.objectRegistry=new s,this.undoTypes=new d,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",(function(t,e){this.stack.setMaxLength(e)}),this),e&&e.track&&this.startTracking(),e&&e.register&&(t.isArray(e.register)||t.isArguments(e.register)?r(this.register,this,e.register):this.register(e.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(t){h(this.stack,t,i(arguments,1),this.undoTypes)},register:function(){l("on",arguments,this._addToStack,this)},unregister:function(){l("off",arguments,this._addToStack,this)},unregisterAll:function(){r(this.unregister,this,this.objectRegistry.get())},undo:function(t){u("undo",this,this.stack,t)},undoAll:function(){u("undo",this,this.stack,!1,!0)},redo:function(t){u("redo",this,this.stack,t)},redoAll:function(){u("redo",this,this.stack,!1,!0)},isAvailable:function(t){var e=this.stack,n=e.length;switch(t){case"undo":return n>0&&e.pointer>-1;case"redo":return n>0&&e.pointer{var r,i;!function(o){var a='object'==typeof self&&self.self===self&&self||'object'==typeof n.g&&n.g.global===n.g&&n.g;if(1)r=[n(9050),n(2579),e],i=function(t,e,n){a.Backbone=function(t,e,n,r){var i=t.Backbone,o=Array.prototype.slice;e.VERSION='1.4.1',e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a,s=e.Events={},l=/\s+/,c=function(t,e,r,i,o){var a,s=0;if(r&&'object'==typeof r){void 0!==i&&'context'in o&&void 0===o.context&&(o.context=i);for(a=n.keys(r);sthis.length&&(i=this.length),i<0&&(i+=this.length+1);var o,a,s=[],l=[],c=[],u=[],f={},h=e.add,p=e.merge,d=e.remove,g=!1,v=this.comparator&&null==i&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(a=0;a7),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(U,'/'),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||'/';return this.location.replace(e+'#'+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement('iframe'),this.iframe.src='javascript:0',this.iframe.style.display='none',this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash='#'+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent('on'+t,e)};if(this._usePushState?o('popstate',this.checkUrl,!1):this._useHashChange&&!this.iframe?o('hashchange',this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent('on'+t,e)};this._usePushState?t('popstate',this.checkUrl,!1):this._useHashChange&&!this.iframe&&t('hashchange',this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),H.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!H.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||'');var n=this.root;''!==t&&'?'!==t.charAt(0)||(n=n.slice(0,-1)||'/');var r=n+t;t=t.replace(W,'');var i=this.decodeFragment(t);if(this.fragment!==i){if(this.fragment=i,this._usePushState)this.history[e.replace?'replaceState':'pushState']({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var o=this.iframe.contentWindow;e.replace||(o.document.open(),o.document.close()),this._updateHash(o.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,'');t.replace(r+'#'+e)}else t.hash='#'+e}}),e.history=new H;var $=function(t,e){var r,i=this;return r=t&&n.has(t,'constructor')?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e),r.prototype=n.create(i.prototype,t),r.prototype.constructor=r,r.__super__=i.prototype,r};m.extend=y.extend=N.extend=P.extend=H.extend=$;var q=function(){throw new Error('A "url" property or function must be specified')},G=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger('error',t,r,e)}};return e}(a,n,t,e)}.apply(e,r),void 0===i||(t.exports=i);else;}()},9210:(t,e,n)=>{1&&function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,r){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!r.lexical||")"!=r.lexical.type)&&/^[;{}]$/.test(e)&&!/^;/.test(n)}});var e=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;t.extendMode("xml",{commentStart:"\x3c!--",commentEnd:"--\x3e",newlineAfterToken:function(t,n,r,i){var o=!1;return"html"==this.configuration&&(o=!!i.context&&e.test(i.context.tagName)),!o&&("tag"==t&&/>$/.test(n)&&i.context||/^-1&&s>-1&&s>a&&(t=t.substr(0,a)+t.substring(a+o.commentStart.length,s)+t.substr(s+o.commentEnd.length)),i.replaceRange(t,n,r)}}))})),t.defineExtension("autoIndentRange",(function(t,e){var n=this;this.operation((function(){for(var r=t.line;r<=e.line;r++)n.indentLine(r,"smart")}))})),t.defineExtension("autoFormatRange",(function(e,n){var r=this,i=r.getMode(),o=r.getRange(e,n).split("\n"),a=t.copyState(i,r.getTokenAt(e).state),s=r.getOption("tabSize"),l="",c=0,u=0===e.ch;function f(){l+="\n",u=!0,++c}for(var h=0;h2),m=/Android/.test(t),y=v||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),b=v||/Mac/.test(e),w=/\bCrOS\b/.test(t),k=/win/i.test(e),x=h&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(h=!1,l=!0);var O=b&&(c||h&&(null==x||x<12.11)),C=n||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var _,P=function(t,e){var n=t.className,r=S(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function E(t,e){return T(t).appendChild(e)}function j(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}v?L=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(L=function(t){try{t.select()}catch(t){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=N(this.onTimeout,this)};function B(t,e){for(var n=0;n=e)return r+Math.min(a,e-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=e)return r}}var G=[""];function K(t){for(;G.length<=t;)G.push(Y(G)+" ");return G[t]}function Y(t){return t[t.length-1]}function X(t,e){for(var n=[],r=0;r"€"&&(t.toUpperCase()!=t.toLowerCase()||et.test(t))}function rt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&nt(t))||e.test(t):nt(t)}function it(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var ot=/[\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 at(t){return t.charCodeAt(0)>=768&&ot.test(t)}function st(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}function ct(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;oe||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}var ut=null;function ft(t,e,n){var r;ut=null;for(var i=0;ie)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:ut=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:ut=i)}return null!=r?r:ut}var ht=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var c="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!r.test(t))return!1;for(var u=t.length,f=[],h=0;h-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function yt(t,e){var n=vt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function xt(t){t.prototype.on=function(t,e){gt(this,t,e)},t.prototype.off=function(t,e){mt(this,t,e)}}function Ot(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Ct(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function St(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function _t(t){Ot(t),Ct(t)}function Pt(t){return t.target||t.srcElement}function Tt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),b&&t.ctrlKey&&1==e&&(e=3),e}var Et,jt,At=function(){if(a&&s<9)return!1;var t=j('div');return"draggable"in t||"dragDrop"in t}();function Rt(t){if(null==Et){var e=j("span","​");E(t,j("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Et=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Et?j("span","​"):j("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Dt(t){if(null!=jt)return jt;var e=E(t,document.createTextNode("AخA")),n=_(e,0,1).getBoundingClientRect(),r=_(e,1,2).getBoundingClientRect();return T(t),!(!n||n.left==n.right)&&(jt=r.right-n.right<3)}var Mt,Zt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Lt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Nt="oncopy"in(Mt=j("div"))||(Mt.setAttribute("oncopy","return;"),"function"==typeof Mt.oncopy),It=null;function Ft(t){if(null!=It)return It;var e=E(t,j("span","x")),n=e.getBoundingClientRect(),r=_(e,0,1).getBoundingClientRect();return It=Math.abs(n.left-r.left)>1}var Vt={},Bt={};function Ht(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Vt[t]=e}function zt(t,e){Bt[t]=e}function Ut(t){if("string"==typeof t&&Bt.hasOwnProperty(t))t=Bt[t];else if(t&&"string"==typeof t.name&&Bt.hasOwnProperty(t.name)){var e=Bt[t.name];"string"==typeof e&&(e={name:e}),(t=tt(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Ut("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Ut("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Wt(t,e){e=Ut(e);var n=Vt[e.name];if(!n)return Wt(t,"text/plain");var r=n(t,e);if($t.hasOwnProperty(e.name)){var i=$t[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}var $t={};function qt(t,e){I(e,$t.hasOwnProperty(t)?$t[t]:$t[t]={})}function Gt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Kt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Yt(t,e,n){return!t.startState||t.startState(e,n)}var Xt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Jt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e=t.first&&en?ae(n,Jt(t,n).text.length):de(e,Jt(t,e.line).text.length)}function de(t,e){var n=t.ch;return null==n||n>e?ae(t.line,e):n<0?ae(t.line,0):t}function ge(t,e){for(var n=[],r=0;r=this.string.length},Xt.prototype.sol=function(){return this.pos==this.lineStart},Xt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xt.prototype.next=function(){if(this.pose},Xt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Xt.prototype.skipToEnd=function(){this.pos=this.string.length},Xt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Xt.prototype.backUp=function(t){this.pos-=t},Xt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},Xt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Xt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Xt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ve=function(t,e){this.state=t,this.lookAhead=e},me=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ye(t,e,n,r){var i=[t.state.modeGen],o={};Pe(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=t.state.overlays[r],l=1,c=0;n.state=!0,Pe(t,e.text,s.mode,n,(function(t,e){for(var n=l;ct&&i.splice(l,1,t,i[l+1],r),l+=2,c=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Gt(t.doc.mode,r.state),o=ye(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function we(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new me(r,!0,e);var o=Te(t,e,n),a=o>r.first&&Jt(r,o-1).stateAfter,s=a?me.fromSaved(r,a,o):new me(r,Yt(r.mode),o);return r.iter(o,e,(function(n){ke(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&re.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}me.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},me.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},me.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},me.fromSaved=function(t,e,n){return e instanceof ve?new me(t,Gt(t.mode,e.state),n,e.lookAhead):new me(t,Gt(t.mode,e),n)},me.prototype.save=function(t){var e=!1!==t?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ve(e,this.maxLookAhead):e};var Ce=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Se(t,e,n,r){var i,o,a=t.doc,s=a.mode,l=Jt(a,(e=pe(a,e)).line),c=we(t,e.line,n),u=new Xt(l.text,t.options.tabSize,c);for(r&&(o=[]);(r||u.post.options.maxHighlightLength?(s=!1,a&&ke(t,e,r,f.pos),f.pos=e.length,l=null):l=_e(Oe(n,f,r.state,h),o),h){var p=h[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;ca;--s){if(s<=o.first)return o.first;var l=Jt(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ve?c.lookAhead:0)<=o.modeFrontier))return s;var u=F(l.text,null,t.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}function Ee(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;r--){var i=Jt(t,r).stateAfter;if(i&&(!(i instanceof ve)||r+i.lookAhead=e:o.to>e);(r||(r=[])).push(new Me(a,o.from,s?null:o.to))}}return r}function Fe(t,e,n){var r;if(t)for(var i=0;i=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from0&&s)for(var b=0;b0)){var u=[l,1],f=se(c.from,s.from),h=se(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function ze(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||qe(n,o.marker)<0)&&(n=o.marker)}return n}function Je(t,e,n,r,i){var o=Jt(t,e),a=Ae&&o.markedSpans;if(a)for(var s=0;s=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?se(c.to,n)>=0:se(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?se(c.from,r)<=0:se(c.from,r)<0)))return!0}}}function Qe(t){for(var e;e=Ke(t);)t=e.find(-1,!0).line;return t}function tn(t){for(var e;e=Ye(t);)t=e.find(1,!0).line;return t}function en(t){for(var e,n;e=Ye(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function nn(t,e){var n=Jt(t,e),r=Qe(n);return n==r?e:ne(r)}function rn(t,e){if(e>t.lastLine())return e;var n,r=Jt(t,e);if(!on(t,r))return e;for(;n=Ye(r);)r=n.find(1,!0).line;return ne(r)+1}function on(t,e){var n=Ae&&e.markedSpans;if(n)for(var r=void 0,i=0;ie.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var un=function(t,e,n){this.text=t,Ue(this,e),this.height=n?n(this):1};function fn(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),ze(t),Ue(t,n);var i=r?r(t):1;i!=t.height&&ee(t,i)}function hn(t){t.parent=null,ze(t)}un.prototype.lineNo=function(){return ne(this)},xt(un);var pn={},dn={};function gn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?dn:pn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function vn(t,e){var n=A("span",null,null,l?"padding-right: .1px":null),r={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,a=void 0;r.pos=0,r.addToken=yn,Dt(t.display.measure)&&(a=pt(o,t.doc.direction))&&(r.addToken=wn(r.addToken,a)),r.map=[],xn(o,r,be(t,o,e!=t.display.externalMeasured&&ne(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Z(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Z(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Rt(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return yt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=Z(r.pre.className,r.textClass||"")),r}function mn(t){var e=j("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function yn(t,e,n,r,i,o,l){if(e){var c,u=t.splitSpaces?bn(e,t.trailingSpace):e,f=t.cm.state.specialChars,h=!1;if(f.test(e)){c=document.createDocumentFragment();for(var p=0;1;){f.lastIndex=p;var d=f.exec(e),g=d?d.index-p:e.length-p;if(g){var v=document.createTextNode(u.slice(p,p+g));a&&s<9?c.appendChild(j("span",[v])):c.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!d)break;p+=g+1;var m=void 0;if("\t"==d[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(m=c.appendChild(j("span",K(b),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=b}else"\r"==d[0]||"\n"==d[0]?((m=c.appendChild(j("span","\r"==d[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",d[0]),t.col+=1):((m=t.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),a&&s<9?c.appendChild(j("span",[m])):c.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),a&&s<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||r||i||h||o||l){var w=n||"";r&&(w+=r),i&&(w+=i);var k=j("span",[c],w,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&k.setAttribute(x,l[x]);return t.content.appendChild(k)}t.content.appendChild(c)}}function bn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;ic&&f.from<=c);h++);if(f.to>=u)return t(n,r,i,o,a,s,l);t(n,r.slice(0,f.to-c),i,o,null,s,l),o=null,r=r.slice(f.to-c),c=f.to}}}function kn(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function xn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,c,u,f,h,p=i.length,d=0,g=1,v="",m=0;;){if(m==d){l=c=u=s="",h=null,f=null,m=1/0;for(var y=[],b=void 0,w=0;wd||x.collapsed&&k.to==d&&k.from==d)){if(null!=k.to&&k.to!=d&&m>k.to&&(m=k.to,c=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&k.from==d&&(u+=" "+x.startStyle),x.endStyle&&k.to==m&&(b||(b=[])).push(x.endStyle,k.to),x.title&&((h||(h={})).title=x.title),x.attributes)for(var O in x.attributes)(h||(h={}))[O]=x.attributes[O];x.collapsed&&(!f||qe(f.marker,x)<0)&&(f=k)}else k.from>d&&m>k.from&&(m=k.from)}if(b)for(var C=0;C=p)break;for(var _=Math.min(p,m);1;){if(v){var P=d+v.length;if(!f){var T=P>_?v.slice(0,_-d):v;e.addToken(e,T,a?a+l:l,u,d+T.length==m?c:"",s,h)}if(P>=_){v=v.slice(_-d),d=_;break}d=P,u=""}v=i.slice(o,o=n[g++]),a=gn(n[g++],e.cm.options)}}else for(var E=1;E2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Qn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){for(var r=0;rn)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}}function tr(t,e){var n=ne(e=Qe(e)),r=t.display.externalMeasured=new On(t.doc,e,n);r.lineN=n;var i=r.built=vn(t,r);return r.text=i.pre,E(t.display.lineMeasure,i.pre),r}function er(t,e,n,r){return ir(t,rr(t,e),n,r)}function nr(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(i=(o=l-s)-1,e>=l&&(a="right")),null!=i){if(r=t[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)r=t[(c-=3)+2],a="left";if("right"==n&&i==l-s)for(;c=0&&(n=t[i]).left==n.right;i--);return n}function cr(t,e,n,r){var i,o=sr(e.map,n,r),l=o.node,c=o.start,u=o.end,f=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;c&&at(e.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u0&&(f=r="right"),i=t.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var d=l.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+Ar(t.display),top:d.top,bottom:d.bottom}:ar}for(var g=i.top-e.rect.top,v=i.bottom-e.rect.top,m=(g+v)/2,y=e.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var f=ft(s,l,c),h=ut,p=u(l,f,"before"==c);return null!=h&&(p.other=u(l,h,"before"!=c)),p}function kr(t,e){var n=0;e=pe(t.doc,e),t.options.lineWrapping||(n=Ar(t.display)*e.ch);var r=Jt(t.doc,e.line),i=sn(r)+$n(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(t,e,n,r,i){var o=ae(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function Or(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=re(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,Jt(r,o).text.length,null,1,1);e<0&&(e=0);for(var a=Jt(r,i);;){var s=Pr(t,a,i,e,n),l=Xe(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=Jt(r,i=c.line)}}function Cr(t,e,n,r){r-=vr(e);var i=e.text.length,o=lt((function(e){return ir(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=lt((function(e){return ir(t,n,e).top>r}),o,i)}}function Sr(t,e,n,r){return n||(n=rr(t,e)),Cr(t,e,n,mr(t,e,ir(t,n,r),"line").top)}function _r(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function Pr(t,e,n,r,i){i-=sn(e);var o=rr(t,e),a=vr(e),s=0,l=e.text.length,c=!0,u=pt(e,t.doc.direction);if(u){var f=(t.options.lineWrapping?Er:Tr)(t,e,n,o,u,r,i);s=(c=1!=f.level)?f.from:f.to-1,l=c?f.to:f.from-1}var h,p,d=null,g=null,v=lt((function(e){var n=ir(t,o,e);return n.top+=a,n.bottom+=a,!!_r(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(d=e,g=n),!0)}),s,l),m=!1;if(g){var y=r-g.left=w.bottom?1:0}return xr(n,v=st(e.text,v,1),p,m,r-h)}function Tr(t,e,n,r,i,o,a){var s=lt((function(s){var l=i[s],c=1!=l.level;return _r(wr(t,ae(n,c?l.to:l.from,c?"before":"after"),"line",e,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=wr(t,ae(n,c?l.from:l.to,c?"after":"before"),"line",e,r);_r(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function Er(t,e,n,r,i,o,a){var s=Cr(t,e,r,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,f=null,h=0;h=c||p.to<=l)){var d=ir(t,r,1!=p.level?Math.min(c,p.to)-1:Math.max(l,p.from)).right,g=dg)&&(u=p,f=g)}}return u||(u=i[i.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function jr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==or){or=j("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)or.appendChild(document.createTextNode("x")),or.appendChild(j("br"));or.appendChild(document.createTextNode("x"))}E(t.measure,or);var n=or.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),T(t.measure),n||1}function Ar(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=j("span","xxxxxxxxxx"),n=j("pre",[e],"CodeMirror-line-like");E(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function Rr(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Dr(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function Dr(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Mr(t){var e=jr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/Ar(t.display)-3);return function(i){if(on(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Jt(t.doc,c.line).text).length==c.ch){var u=F(l,l.length,t.options.tabSize)-l.length;c=ae(c.line,Math.max(0,Math.round((o-Gn(t.display).left)/Ar(t.display))-u))}return c}function Nr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;re)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Ae&&nn(t.doc,e)i.viewFrom?Vr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)Vr(t);else if(e<=i.viewFrom){var o=Br(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Vr(t)}else if(n>=i.viewTo){var a=Br(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Vr(t)}else{var s=Br(t,e,e,-1),l=Br(t,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Cn(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Vr(t)}var c=i.externalMeasured;c&&(n=i.lineN&&e=r.viewTo)){var o=r.view[Nr(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,n)&&a.push(n)}}}function Vr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Br(t,e,n,r){var i,o=Nr(t,e),a=t.display.view;if(!Ae||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,n+=i}for(;nn(t.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Hr(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=Cn(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=Cn(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Nr(t,n)))),r.viewTo=n}function zr(t){for(var e=t.display.view,n=0,r=0;r=t.display.viewTo||l.to().line0?a:t.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(j("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function qr(t,e){return t.top-e.top||t.left-e.left}function Gr(t,e,n){var r=t.display,i=t.doc,o=document.createDocumentFragment(),a=Gn(t.display),s=a.left,l=Math.max(r.sizerWidth,Yn(t)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),o.appendChild(j("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(r-e)+"px"))}function f(e,n,r){var o,a,f=Jt(i,e),h=f.text.length;function p(n,r){return br(t,ae(e,n),"div",f,r)}function d(e,n,r){var i=Sr(t,f,null,e),o="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var g=pt(f,i.direction);return ct(g,n||0,null==r?h:r,(function(t,e,i,f){var v="ltr"==i,m=p(t,v?"left":"right"),y=p(e-1,v?"right":"left"),b=null==n&&0==t,w=null==r&&e==h,k=0==f,x=!g||f==g.length-1;if(y.top-m.top<=3){var O=(c?w:b)&&x,C=(c?b:w)&&k?s:(v?m:y).left,S=O?l:(v?y:m).right;u(C,m.top,S-C,m.bottom)}else{var _,P,T,E;v?(_=c&&b&&k?s:m.left,P=c?l:d(t,i,"before"),T=c?s:d(e,i,"after"),E=c&&w&&x?l:y.right):(_=c?d(t,i,"before"):s,P=!c&&b&&k?l:m.right,T=!c&&w&&x?s:y.left,E=c?d(e,i,"after"):l),u(_,m.top,P-_,m.bottom),m.bottom0?e.blinker=setInterval((function(){t.hasFocus()||Qr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Yr(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Jr(t))}function Xr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Qr(t))}),100)}function Jr(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(yt(t,"focus",t,e),t.state.focused=!0,M(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),Kr(t))}function Qr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(yt(t,"blur",t,e),t.state.focused=!1,P(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function ti(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=Math.max(0,e.scroller.getBoundingClientRect().top),i=e.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||g<-.005)&&(it.display.sizerWidth){var m=Math.ceil(h/Ar(t.display));m>t.display.maxLineLength&&(t.display.maxLineLength=m,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(e.scroller.scrollTop+=o)}function ei(t){if(t.widgets)for(var e=0;e=a&&(o=re(e,sn(Jt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ri(t,e){if(!bt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;if(e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!g){var o=j("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-$n(t.display))+"px;\n height: "+(e.bottom-e.top+Kn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(i),t.display.lineSpace.removeChild(o)}}}function ii(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?ae(e.line,e.ch+1,"before"):e,e=e.ch?ae(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var o=0;o<5;o++){var a=!1,s=wr(t,e),l=n&&n!=e?wr(t,n):s,c=ai(t,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=t.doc.scrollTop,f=t.doc.scrollLeft;if(null!=c.scrollTop&&(pi(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(gi(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-f)>1&&(a=!0)),!a)break}return i}function oi(t,e){var n=ai(t,e);null!=n.scrollTop&&pi(t,n.scrollTop),null!=n.scrollLeft&&gi(t,n.scrollLeft)}function ai(t,e){var n=t.display,r=jr(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Xn(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+qn(n),l=e.tops-r;if(e.topi+o){var u=Math.min(e.top,(c?s:e.bottom)-o);u!=i&&(a.scrollTop=u)}var f=t.options.fixedGutter?0:n.gutters.offsetWidth,h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-f,p=Yn(t)-n.gutters.offsetWidth,d=e.right-e.left>p;return d&&(e.right=e.left+p),e.left<10?a.scrollLeft=0:e.leftp+h-3&&(a.scrollLeft=e.right+(d?0:10)-p),a}function si(t,e){null!=e&&(fi(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function li(t){fi(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function ci(t,e,n){null==e&&null==n||fi(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function ui(t,e){fi(t),t.curOp.scrollToPos=e}function fi(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,hi(t,kr(t,e.from),kr(t,e.to),e.margin))}function hi(t,e,n,r){var i=ai(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});ci(t,i.scrollLeft,i.scrollTop)}function pi(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Ui(t,{top:e}),di(t,e,!0),n&&Ui(t),Li(t,100))}function di(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function gi(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,Gi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function vi(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+qn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Kn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var mi=function(t,e,n){this.cm=n;var r=this.vert=j("div",[j("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=j("div",[j("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),gt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),gt(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},mi.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var t=b&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new V,this.disableVert=new V},mi.prototype.enableZeroWidthBar=function(t,e,n){function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.visibility="hidden":e.set(1e3,r)}t.style.visibility="",e.set(1e3,r)},mi.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var yi=function(){};function bi(t,e){e||(e=vi(t));var n=t.display.barWidth,r=t.display.barHeight;wi(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&ti(t),wi(t,vi(t)),n=t.display.barWidth,r=t.display.barHeight}function wi(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}yi.prototype.update=function(){return{bottom:0,right:0}},yi.prototype.setScrollLeft=function(){},yi.prototype.setScrollTop=function(){},yi.prototype.clear=function(){};var ki={native:mi,null:yi};function xi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&P(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new ki[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),gt(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?gi(t,e):pi(t,e)}),t),t.display.scrollbars.addClass&&M(t.display.wrapper,t.display.scrollbars.addClass)}var Oi=0;function Ci(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Oi,markArrays:null},_n(t.curOp)}function Si(t){var e=t.curOp;e&&Tn(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Ii(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Ti(t){t.updatedDisplay=t.mustUpdate&&Hi(t.cm,t.update)}function Ei(t){var e=t.cm,n=e.display;t.updatedDisplay&&ti(e),t.barMeasure=vi(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=er(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Kn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Yn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function ji(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft=t.display.viewTo)){var n=+new Date+t.options.workTime,r=we(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?Gt(e.mode,r.state):null,l=ye(t,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&hn)return Li(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Ri(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zr(t))return!1;Ki(t)&&(Vr(t),e.dims=Rr(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Ae&&(o=nn(t.doc,o),a=rn(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Hr(t,o,a),n.viewOffset=sn(Jt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=zr(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Vi(t);return l>4&&(n.lineDiv.style.display="none"),Wi(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Bi(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Li(t,400)),n.updateLineNumbers=null,!0}function zi(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Yn(t))r&&(e.visible=ni(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+qn(t.display)-Xn(t),n.top)}),e.visible=ni(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!Hi(t,e))break;ti(t);var i=vi(t);Ur(t),bi(t,i),qi(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Ui(t,e){var n=new Ii(t,e);if(Hi(t,n)){ti(t),zi(t,n);var r=vi(t);Ur(t),bi(t,r),qi(t,r),n.finish()}}function Wi(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return l&&b&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=r.view,u=r.viewFrom,f=0;f-1&&(p=!1),Rn(t,h,u,n)),p&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(oe(t.options,u)))),a=h.node.nextSibling}else{var d=Vn(t,h,u,n);o.insertBefore(d,a)}u+=h.size}for(;a;)a=s(a)}function $i(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",jn(t,"gutterChanged",t)}function qi(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Kn(t)+"px"}function Gi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=Dr(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;a=102&&(null==t.display.chromeScrollHack?t.display.sizer.style.pointerEvents="none":clearTimeout(t.display.chromeScrollHack),t.display.chromeScrollHack=setTimeout((function(){t.display.chromeScrollHack=null,t.display.sizer.style.pointerEvents=""}),100));var r=no(e),i=r.x,o=r.y,a=eo;0===e.deltaMode&&(i=e.deltaX,o=e.deltaY,a=1);var s=t.display,c=s.scroller,p=c.scrollWidth>c.clientWidth,d=c.scrollHeight>c.clientHeight;if(i&&p||o&&d){if(o&&b&&l)t:for(var g=e.target,v=s.view;g!=c;g=g.parentNode)for(var m=0;m=0&&se(t,r.to())<=0)return n}return-1};var ao=function(t,e){this.anchor=t,this.head=e};function so(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return se(t.from(),e.from())})),n=B(e,i);for(var o=1;o0:l>=0){var c=fe(s.from(),a.from()),u=ue(s.to(),a.to()),f=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new ao(f?u:c,f?c:u))}}return new oo(e,n)}function lo(t,e){return new oo([new ao(t,e||t)],0)}function co(t){return t.text?ae(t.from.line+t.text.length-1,Y(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function uo(t,e){if(se(t,e.from)<0)return t;if(se(t,e.to)<=0)return co(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=co(e).ch-e.to.ch),ae(n,r)}function fo(t,e){for(var n=[],r=0;r1&&t.remove(s.line+1,d-1),t.insert(s.line+1,m)}jn(t,"change",t,e)}function bo(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a1&&!t.done[t.done.length-2].ranges?(t.done.pop(),Y(t.done)):void 0}function Po(t,e,n,r){var i=t.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=_o(i,i.lastOp==r)))a=Y(o.changes),0==se(e.from,e.to)&&0==se(e.from,a.to)?a.to=co(e):o.changes.push(Co(t,e));else{var l=Y(i.done);for(l&&l.ranges||jo(t.sel,i.done),o={changes:[Co(t,e)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,a||yt(t,"historyAdded")}function To(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Eo(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(t,o,Y(i.done),e))?i.done[i.done.length-1]=e:jo(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function jo(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Ao(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Ro(t){if(!t)return null;for(var e,n=0;n-1&&(Y(s)[f]=c[f],delete c[f])}}}return r}function Lo(t,e,n,r){if(r){var i=t.anchor;if(n){var o=se(e,i)<0;o!=se(n,i)<0?(i=e,e=n):o!=se(e,n)<0&&(e=n)}return new ao(i,e)}return new ao(n||e,e)}function No(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),zo(t,new oo([Lo(t.sel.primary(),e,n,i)],0),r)}function Io(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:s.to>e.ch))){if(i&&(yt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var f=l.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(f=Yo(t,f,-r,f&&f.line==e.line?o:null)),f&&f.line==e.line&&(h=se(f,n))&&(r<0?h<0:h>0))return Go(t,f,e,r,i)}var p=l.find(r<0?-1:1);return(r<0?c:u)&&(p=Yo(t,p,r,p.line==e.line?o:null)),p?Go(t,p,e,r,i):null}}return e}function Ko(t,e,n,r,i){var o=r||1,a=Go(t,e,n,o,i)||!i&&Go(t,e,n,o,!0)||Go(t,e,n,-o,i)||!i&&Go(t,e,n,-o,!0);return a||(t.cantEdit=!0,ae(t.first,0))}function Yo(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?pe(t,ae(e.line-1)):null:n>0&&e.ch==(r||Jt(t,e.line)).text.length?e.line=0;--i)ta(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else ta(t,e)}}function ta(t,e){if(1!=e.text.length||""!=e.text[0]||0!=se(e.from,e.to)){var n=fo(t,e);Po(t,e,n,t.cm?t.cm.curOp.id:NaN),ra(t,e,n,Ve(t,e));var r=[];bo(t,(function(t,n){n||-1!=B(r,t.history)||(la(t.history,e),r.push(t.history)),ra(t,e,null,Ve(t,e))}))}}function ea(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,c=0;c=0;--p){var d=h(p);if(d)return d.v}}}}function na(t,e){if(0!=e&&(t.first+=e,t.sel=new oo(X(t.sel.ranges,(function(t){return new ao(ae(t.anchor.line+e,t.anchor.ch),ae(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Ir(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.lineo&&(e={from:e.from,to:ae(o,Jt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Qt(t,e.from,e.to),n||(n=fo(t,e)),t.cm?ia(t.cm,e,r):yo(t,e,r),Uo(t,n,U),t.cantEdit&&Ko(t,ae(t.firstLine(),0))&&(t.cantEdit=!1)}}function ia(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=ne(Qe(Jt(r,o.line))),r.iter(l,a.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&wt(t),yo(r,e,n,Mr(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=ln(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),Ee(r,o.line),Li(t,400);var c=e.text.length-(a.line-o.line)-1;e.full?Ir(t):o.line!=a.line||1!=e.text.length||mo(t.doc,e)?Ir(t,o.line,a.line+1,c):Fr(t,o.line,"text");var u=kt(t,"changes"),f=kt(t,"change");if(f||u){var h={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};f&&jn(t,"change",t,h),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}function oa(t,e,n,r,i){var o;r||(r=n),se(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Qo(t,{from:n,to:r,text:e,origin:i})}function aa(t,e,n,r){n1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var a=i.lines.length%25+25,s=a;s10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Je(t,e.line,e,n,o)||e.line!=n.line&&Je(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");De()}o.addToHistory&&Po(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(r){c&&o.collapsed&&!c.options.lineWrapping&&Qe(r)==c.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&ee(r,0),Ne(r,new Me(o,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){on(t,e)&&ee(e,0)})),o.clearOnEnter&>(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Re(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++ga,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Ir(c,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=e.line;u<=n.line;u++)Fr(c,u,"text");o.atomic&&$o(c.doc),jn(c,"markerAdded",c,o)}return o}va.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Ci(t),kt(this,"clear")){var n=this.find();n&&jn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&Ir(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&$o(t.doc)),t&&jn(t,"markerCleared",t,this,r,i),e&&Si(t),this.parent&&this.parent.clear()}},va.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i=0;l--)Qo(this,r[l]);s?Ho(this,s):this.cm&&li(this.cm)})),undo:Zi((function(){ea(this,"undo")})),redo:Zi((function(){ea(this,"redo")})),undoSelection:Zi((function(){ea(this,"undo",!0)})),redoSelection:Zi((function(){ea(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=pe(this,t),e=pe(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;rt)return e=t,!0;t-=o,++n})),pe(this,ae(n,e))},indexFromPos:function(t){var e=(t=pe(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var f=t.dataTransfer.getData("Text");if(f){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),Uo(e.doc,lo(n,n)),h)for(var p=0;p=0;e--)oa(t.doc,"",r[e].from,r[e].to,"+delete");li(t)}))}function Ga(t,e,n){var r=st(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Ka(t,e,n){var r=Ga(t,e.ch,n);return null==r?null:new ae(e.line,r,n<0?"after":"before")}function Ya(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=pt(n,e.doc.direction);if(o){var a,s=i<0?Y(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=rr(e,n);a=i<0?n.text.length-1:0;var u=ir(e,c,a).top;a=lt((function(t){return ir(e,c,t).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ga(n,a,1))}else a=i<0?s.to:s.from;return new ae(r,a,l)}}return new ae(r,i<0?n.text.length:0,i<0?"before":"after")}function Xa(t,e,n,r){var i=pt(e,t.doc.direction);if(!i)return Ka(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ft(i,n.ch,n.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&h>=u.begin)){var p=f?"before":"after";return new ae(n.line,h,p)}}var d=function(t,e,r){for(var o=function(t,e){return e?new ae(n.line,l(t,1),"before"):new ae(n.line,t,"after")};t>=0&&t0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==v||r>0&&v==e.text.length||!(g=d(r>0?0:i.length-1,r,c(v)))?null:g}Fa.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"},Fa.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"},Fa.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"},Fa.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"]},Fa["default"]=b?Fa.macDefault:Fa.pcDefault;var Ja={selectAll:Xo,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),U)},killLine:function(t){return qa(t,(function(e){if(e.empty()){var n=Jt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)i=new ae(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ae(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=Jt(t.doc,i.line-1).text;a&&(i=new ae(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),ae(i.line-1,a.length-1),i,"+transpose"))}n.push(new ao(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Ri(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r-1&&(se((i=s.ranges[i]).from(),e)<0||e.xRel>0)&&(se(i.to(),e)>0||e.xRel<0)?Os(t,r,e,o):Ss(t,r,e,o)}function Os(t,e,n,r){var i=t.display,o=!1,c=Di(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Xr(t)),mt(i.wrapper.ownerDocument,"mouseup",c),mt(i.wrapper.ownerDocument,"mousemove",u),mt(i.scroller,"dragstart",f),mt(i.scroller,"drop",c),o||(Ot(e),r.addNew||No(t.doc,n,null,null,r.extend),l&&!p||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},f=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=c,c.copy=!r.moveOnDrag,gt(i.wrapper.ownerDocument,"mouseup",c),gt(i.wrapper.ownerDocument,"mousemove",u),gt(i.scroller,"dragstart",f),gt(i.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Cs(t,e,n){if("char"==n)return new ao(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ao(ae(e.line,0),pe(t.doc,ae(e.line+1,0)));var r=n(t,e);return new ao(r.from,r.to)}function Ss(t,e,n,r){a&&Xr(t);var i=t.display,o=t.doc;Ot(e);var s,l,c=o.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?u[l]:new ao(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new ao(n,n)),n=Lr(t,e,!0,!0),l=-1;else{var f=Cs(t,n,r.unit);s=r.extend?Lo(s,f.anchor,f.head,r.extend):f}r.addNew?-1==l?(l=u.length,zo(o,so(t,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(zo(o,so(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Fo(o,l,s,W):(l=0,zo(o,new oo([s],0),W),c=o.sel);var h=n;function p(e){if(0!=se(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],a=t.options.tabSize,u=F(Jt(o,n.line).text,n.ch,a),f=F(Jt(o,e.line).text,e.ch,a),p=Math.min(u,f),d=Math.max(u,f),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var m=Jt(o,g).text,y=q(m,p,a);p==d?i.push(new ao(ae(g,y),ae(g,y))):m.length>y&&i.push(new ao(ae(g,y),ae(g,q(m,d,a))))}i.length||i.push(new ao(n,n)),zo(o,so(t,c.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=s,k=Cs(t,e,r.unit),x=w.anchor;se(k.anchor,x)>0?(b=k.head,x=fe(w.from(),k.anchor)):(b=k.anchor,x=ue(w.to(),k.head));var O=c.ranges.slice(0);O[l]=_s(t,new ao(pe(o,x),b)),zo(o,so(t,O,l),W)}}var d=i.wrapper.getBoundingClientRect(),g=0;function v(e){var n=++g,a=Lr(t,e,!0,"rectangle"==r.unit);if(a)if(0!=se(a,h)){t.curOp.focus=D(),p(a);var s=ni(i,o);(a.line>=s.to||a.lined.bottom?20:0;l&&setTimeout(Di(t,(function(){g==n&&(i.scroller.scrollTop+=l,v(e))})),50)}}function m(e){t.state.selectingText=!1,g=1/0,e&&(Ot(e),i.input.focus()),mt(i.wrapper.ownerDocument,"mousemove",y),mt(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Di(t,(function(t){0!==t.buttons&&Tt(t)?v(t):m(t)})),b=Di(t,m);t.state.selectingText=b,gt(i.wrapper.ownerDocument,"mousemove",y),gt(i.wrapper.ownerDocument,"mouseup",b)}function _s(t,e){var n=e.anchor,r=e.head,i=Jt(t.doc,n.line);if(0==se(n,r)&&n.sticky==r.sticky)return e;var o=pt(i);if(!o)return e;var a=ft(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ft(o,r.ch,r.sticky),f=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?f<0:f>0}var h=o[c+(l?-1:0)],p=l==(1==h.level),d=p?h.from:h.to,g=p?"after":"before";return n.ch==d&&n.sticky==g?e:new ao(new ae(n.line,d,g),r)}function Ps(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(t){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&Ot(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!kt(t,n))return St(e);o-=s.top-a.viewOffset;for(var l=0;l=i)return yt(t,n,t,re(t.doc,o),t.display.gutterSpecs[l].className,e),St(e)}}function Ts(t,e){return Ps(t,e,"gutterClick",!0)}function Es(t,e){Wn(t.display,e)||js(t,e)||bt(t,e,"contextmenu")||C||t.display.input.onContextMenu(e)}function js(t,e){return!!kt(t,"gutterContextMenu")&&Ps(t,e,"gutterContextMenu",!1)}function As(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pr(t)}ms.prototype.compare=function(t,e,n){return this.time+vs>t&&0==se(e,this.pos)&&n==this.button};var Rs={toString:function(){return"CodeMirror.Init"}},Ds={},Ms={};function Zs(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=Rs&&i(t,e,n)}:i)}t.defineOption=n,t.Init=Rs,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,go(t)}),!0),n("indentUnit",2,go,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){vo(t),pr(t),Ir(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(ae(r,o))}r++}));for(var i=n.length-1;i>=0;i--)oa(t.doc,e,n[i],ae(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Rs&&t.refresh()})),n("specialCharPlaceholder",mn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!k),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){As(t),Ji(t)}),!0),n("keyMap","default",(function(t,e,n){var r=$a(e),i=n!=Rs&&$a(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ns,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Yi(e,t.options.lineNumbers),Ji(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Dr(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return bi(t)}),!0),n("scrollbarStyle","native",(function(t){xi(t),bi(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Yi(t.options.gutters,e),Ji(t)}),!0),n("firstLineNumber",1,Ji,!0),n("lineNumberFormatter",(function(t){return t}),Ji,!0),n("showCursorWhenSelecting",!1,Ur,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Qr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=''===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Ls),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Ur,!0),n("singleCursorHeightPerLine",!0,Ur,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,vo,!0),n("addModeClass",!1,vo,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,vo,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Ls(t,e,n){if(!e!=!(n&&n!=Rs)){var r=t.display.dragFunctions,i=e?gt:mt;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function Ns(t){t.options.lineWrapping?(M(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(P(t.display.wrapper,"CodeMirror-wrap"),cn(t)),Zr(t),Ir(t),pr(t),setTimeout((function(){return bi(t)}),100)}function Is(t,e){var n=this;if(!(this instanceof Is))return new Is(t,e);this.options=e=e?I(e):{},I(Ds,e,!1);var r=e.value;"string"==typeof r?r=new Ca(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Is.inputStyles[e.inputStyle](this),o=this.display=new Qi(t,r,i,e);for(var c in o.wrapper.CodeMirror=this,As(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(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 V,keySeq:null,specialChars:null},e.autofocus&&!y&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Fs(this),Ra(),Ci(this),this.curOp.forceUpdate=!0,wo(this,r),e.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Jr(n)}),20):Qr(this),Ms)Ms.hasOwnProperty(c)&&Ms[c](this,e[c],Rs);Ki(this),e.finishInit&&e.finishInit(this);for(var u=0;u20*20}gt(e.scroller,"touchstart",(function(i){if(!bt(t,i)&&!o(i)&&!Ts(t,i)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),gt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),gt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Wn(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=t.coordsChar(e.activeTouch,"page");o=!r.prev||l(r,r.prev)?new ao(a,a):!r.prev.prev||l(r,r.prev.prev)?t.findWordAt(a):new ao(ae(a.line,0),pe(t.doc,ae(a.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),Ot(n)}i()})),gt(e.scroller,"touchcancel",i),gt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(pi(t,e.scroller.scrollTop),gi(t,e.scroller.scrollLeft,!0),yt(t,"scroll",t))})),gt(e.scroller,"mousewheel",(function(e){return io(t,e)})),gt(e.scroller,"DOMMouseScroll",(function(e){return io(t,e)})),gt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){bt(t,e)||_t(e)},over:function(e){bt(t,e)||(Ta(t,e),_t(e))},start:function(e){return Pa(t,e)},drop:Di(t,_a),leave:function(e){bt(t,e)||Ea(t)}};var c=e.input.getField();gt(c,"keyup",(function(e){return hs.call(t,e)})),gt(c,"keydown",Di(t,us)),gt(c,"keypress",Di(t,ps)),gt(c,"focus",(function(e){return Jr(t,e)})),gt(c,"blur",(function(e){return Qr(t,e)}))}Is.defaults=Ds,Is.optionHandlers=Ms;var Vs=[];function Bs(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=we(t,e).state:n="prev");var a=t.options.tabSize,s=Jt(o,e),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==z||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?F(Jt(o,e-1).text,null,a):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var f="",h=0;if(t.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)h+=a,f+="\t";if(ha,l=Zt(e),c=null;if(s&&r.ranges.length>1)if(Hs&&Hs.text.join("\n")==e){if(r.ranges.length%Hs.text.length==0){c=[];for(var u=0;u=0;h--){var p=r.ranges[h],d=p.from(),g=p.to();p.empty()&&(n&&n>0?d=ae(d.line,d.ch-n):t.state.overwrite&&!s?g=ae(g.line,Math.min(Jt(o,g.line).text.length,g.ch+Y(l).length)):s&&Hs&&Hs.lineWise&&Hs.text.join("\n")==l.join("\n")&&(d=g=ae(d.line,0)));var v={from:d,to:g,text:c?c[h%c.length]:l,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};Qo(t.doc,v),jn(t,"inputRead",t,v)}e&&!s&&$s(t,e),li(t),t.curOp.updateInput<2&&(t.curOp.updateInput=f),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ws(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||!e.hasFocus()||Ri(e,(function(){return Us(e,n,0,null,"paste")})),!0}function $s(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Bs(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Jt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Bs(t,i.head.line,"smart"));a&&jn(t,"electricInput",t,i.head.line)}}}function qs(t){for(var e=[],n=[],r=0;rn&&(Bs(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&li(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Fo(this.doc,r,new ao(o,c[r].to()),U)}}})),getTokenAt:function(t,e){return Se(this,t,e)},getLineTokens:function(t,e){return Se(this,ae(t),e,!0)},getTokenTypeAt:function(t){t=pe(this.doc,t);var e,n=be(this,Jt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(t=o,i=!0),r=Jt(this.doc,t)}else r=t;return mr(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-sn(r):0)},defaultTextHeight:function(){return jr(this.display)},defaultCharWidth:function(){return Ar(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display,a=(t=wr(this,pe(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);('above'==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>c&&(s=c-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==i?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&oi(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:Mi(us),triggerOnKeyPress:Mi(ps),triggerOnKeyUp:hs,triggerOnMouseDown:Mi(bs),execCommand:function(t){if(Ja.hasOwnProperty(t))return Ja[t].call(null,this)},triggerElectric:Mi((function(t){$s(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=pe(this.doc,t),a=0;a0&&a(e.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Zr(this),yt(this,"refresh",this)})),swapDoc:Mi((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),wo(this,t),pr(this),this.display.input.reset(),ci(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,jn(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}function Xs(t,e,n,r,i){var o=e,a=n,s=Jt(t,e.line),l=i&&"rtl"==t.direction?-n:n;function c(){var n=e.line+l;return!(n=t.first+t.size)&&(e=new ae(n,e.ch,e.sticky),s=Jt(t,n))}function u(o){var a;if("codepoint"==r){var u=s.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var f=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new ae(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(f?2:1))),-n)}}else a=i?Xa(t.cm,s,e,n):Ka(s,e,n);if(null==a){if(o||!c())return!1;e=Ya(i,t.cm,s,e.line,l)}else e=a;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var f=null,h="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(n<0)||u(!d);d=!1){var g=s.text.charAt(e.ch)||"\n",v=rt(g,p)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||d||v||(v="s"),f&&f!=v){n<0&&(n=1,u(),e.sticky="after");break}if(v&&(f=v),n>0&&!u(!d))break}var m=Ko(t,e,o,a,!0);return le(o,m)&&(m.hitSide=!0),m}function Js(t,e,n,r){var i,o,a=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*jr(t.display),3);i=(n>0?e.bottom:e.top)+n*c}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(o=Or(t,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Qs=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function tl(t,e){var n=nr(t,e.line);if(!n||n.hidden)return null;var r=Jt(t.doc,e.line),i=Qn(n,r,e.line),o=pt(r,t.doc.direction),a="left";o&&(a=ft(o,e.ch)%2?"right":"left");var s=sr(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function el(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function nl(t,e){return e&&(t.bad=!0),t}function rl(t,e,n,r,i){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(t){return function(e){return e.id==t}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function f(t){t&&(u(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void f(n);var o,p=e.getAttribute("cm-marker");if(p){var d=t.findMarks(ae(r,0),ae(i+1,0),c(+p));return void(d.length&&(o=d[0].find(0))&&f(Qt(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&u();for(var v=0;v=e.display.viewTo||o.line=e.display.viewFrom&&tl(e,i)||{node:l[0].measure.map[2],offset:0},u=o.liner.firstLine()&&(a=ae(a.line-1,Jt(r.doc,a.line-1).length)),s.ch==Jt(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(t=Nr(r,a.line))?(e=ne(i.view[0].line),n=i.view[0].node):(e=ne(i.view[t].line),n=i.view[t-1].node.nextSibling);var l,c,u=Nr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=ne(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(rl(r,n,c,e,l)),h=Qt(r.doc,ae(e,0),ae(l,Jt(r.doc,l).text.length));f.length>1&&h.length>1;)if(Y(f)==Y(h))f.pop(),h.pop(),l--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),e++}for(var p=0,d=0,g=f[0],v=h[0],m=Math.min(g.length,v.length);pa.ch&&y.charCodeAt(y.length-d-1)==b.charCodeAt(b.length-d-1);)p--,d++;f[f.length-1]=y.slice(0,y.length-d).replace(/^\u200b+/,""),f[0]=f[0].slice(p).replace(/\u200b+$/,"");var k=ae(e,p),x=ae(l,h.length?Y(h).length-d:0);return f.length>1||f[0]||se(k,x)?(oa(r.doc,f,k,x,"+input"),!0):void 0},Qs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qs.prototype.reset=function(){this.forceCompositionEnd()},Qs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Qs.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Qs.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Ri(this.cm,(function(){return Ir(t.cm)}))},Qs.prototype.setUneditable=function(t){t.contentEditable="false"},Qs.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Di(this.cm,Us)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Qs.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Qs.prototype.onContextMenu=function(){},Qs.prototype.resetPosition=function(){},Qs.prototype.needsContentAttribute=!0;var al=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};function sl(t,e){if((e=e?I(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=D();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(gt(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(mt(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Is((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function ll(t){t.off=mt,t.on=gt,t.wheelEventPixels=ro,t.Doc=Ca,t.splitLines=Zt,t.countColumn=F,t.findColumn=q,t.isWordChar=nt,t.Pass=z,t.signal=yt,t.Line=un,t.changeEnd=co,t.scrollbarModel=ki,t.Pos=ae,t.cmpPos=se,t.modes=Vt,t.mimeModes=Bt,t.resolveMode=Ut,t.getMode=Wt,t.modeExtensions=$t,t.extendMode=qt,t.copyState=Gt,t.startState=Yt,t.innerMode=Kt,t.commands=Ja,t.keyMap=Fa,t.keyName=Wa,t.isModifierKey=za,t.lookupKey=Ha,t.normalizeKeyMap=Ba,t.StringStream=Xt,t.SharedTextMarker=ya,t.TextMarker=va,t.LineWidget=ha,t.e_preventDefault=Ot,t.e_stopPropagation=Ct,t.e_stop=_t,t.addClass=M,t.contains=R,t.rmClass=P,t.keyNames=Za}al.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!bt(r,t)){if(r.somethingSelected())zs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=qs(r);zs({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,U):(n.prevInput="",i.value=e.text.join("\n"),L(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),v&&(i.style.width="0px"),gt(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),gt(i,"paste",(function(t){bt(r,t)||Ws(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),gt(i,"cut",o),gt(i,"copy",o),gt(t.scroller,"paste",(function(e){if(!Wn(t,e)&&!bt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),gt(t.lineSpace,"selectstart",(function(e){Wn(t,e)||Ot(e)})),gt(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),gt(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},al.prototype.createField=function(t){this.wrapper=Ks(),this.textarea=this.wrapper.firstChild},al.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute('aria-label',t):this.textarea.removeAttribute('aria-label')},al.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=Wr(t);if(t.options.moveInputWithCursor){var i=wr(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},al.prototype.showSelection=function(t){var e=this.cm.display;E(e.cursorDiv,t.cursors),E(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},al.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&L(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},al.prototype.getField=function(){return this.textarea},al.prototype.supportsTouch=function(){return!1},al.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||D()!=this.textarea))try{this.textarea.focus()}catch(t){}},al.prototype.blur=function(){this.textarea.blur()},al.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},al.prototype.receivedFocus=function(){this.slowPoll()},al.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},al.prototype.fastPoll=function(){var t=!1,e=this;function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},al.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||Lt(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},al.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},al.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},al.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=Lr(n,t),c=r.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Di(n,zo)(n.doc,lo(o),U);var u,f=i.style.cssText,p=e.wrapper.style.cssText,d=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-d.top-5)+"px; left: "+(t.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=m,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),C){_t(t);var g=function(){mt(window,"mouseup",g),setTimeout(m,20)};gt(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=i.selectionStart){var t=n.somethingSelected(),o="​"+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function m(){if(e.contextMenuPending==m&&(e.contextMenuPending=!1,e.wrapper.style.cssText=p,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&v();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==e.prevInput?Di(n,Xo)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},al.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},al.prototype.setUneditable=function(){},al.prototype.needsContentAttribute=!1,Zs(Is),Ys(Is);var cl="iter insert remove copy getEditor constructor".split(" ");for(var ul in Ca.prototype)Ca.prototype.hasOwnProperty(ul)&&B(cl,ul)<0&&(Is.prototype[ul]=function(t){return function(){return t.apply(this.doc,arguments)}}(Ca.prototype[ul]));return xt(Ca),Is.inputStyles={textarea:al,contenteditable:Qs},Is.defineMode=function(t){Is.defaults.mode||"null"==t||(Is.defaults.mode=t),Ht.apply(this,arguments)},Is.defineMIME=zt,Is.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Is.defineMIME("text/plain","null"),Is.defineExtension=function(t,e){Is.prototype[t]=e},Is.defineDocExtension=function(t,e){Ca.prototype[t]=e},Is.fromTextArea=sl,ll(Is),Is.version="5.65.6",Is}())},6629:(t,e,n)=>{1&&function(t){"use strict";function e(t){for(var e={},n=0;n*\/]/.test(n)?x(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?x(null,n):t.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(t.current())&&(e.tokenize=S),x("variable callee","variable")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),x("number","unit")):t.match(/^-[\w\\\-]*/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):t.match(/^\w+-/)?x("meta","meta"):void 0}function C(t){return function(e,n){for(var r,i=!1;null!=(r=e.next());){if(r==t&&!i){")"==t&&e.backUp(1);break}i=!i&&"\\"==r}return(r==t||!i&&")"!=t)&&(n.tokenize=null),x("string","string")}}function S(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=C(")"),x(null,"(")}function _(t,e,n){this.type=t,this.indent=e,this.prev=n}function P(t,e,n,r){return t.context=new _(n,e.indentation()+(!1===r?0:a),t.context),n}function T(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function E(t,e,n){return R[n.context.type](t,e,n)}function j(t,e,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return E(t,e,n)}function A(t){var e=t.current().toLowerCase();o=m.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var R={top:function(t,e,n){if("{"==t)return P(n,e,"block");if("}"==t&&n.context.prev)return T(n);if(w&&/@component/i.test(t))return P(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return P(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return P(n,e,"atBlock");if(/^@(font-face|counter-style)/i.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))return"keyframes";if(t&&"@"==t.charAt(0))return P(n,e,"at");if("hash"==t)o="builtin";else if("word"==t)o="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return P(n,e,"interpolation");if(":"==t)return"pseudo";if(y&&"("==t)return P(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return h.hasOwnProperty(r)?(o="property","maybeprop"):p.hasOwnProperty(r)?(o=k?"string-2":"property","maybeprop"):y?(o=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==t?"block":y||"hash"!=t&&"qualifier"!=t?R.top(t,e,n):(o="error","block")},maybeprop:function(t,e,n){return":"==t?P(n,e,"prop"):E(t,e,n)},prop:function(t,e,n){if(";"==t)return T(n);if("{"==t&&y)return P(n,e,"propBlock");if("}"==t||"{"==t)return j(t,e,n);if("("==t)return P(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e.current())){if("word"==t)A(e);else if("interpolation"==t)return P(n,e,"interpolation")}else o+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?T(n):"word"==t?(o="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?j(t,e,n):")"==t?T(n):"("==t?P(n,e,"parens"):"interpolation"==t?P(n,e,"interpolation"):("word"==t&&A(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(o="variable-3",n.context.type):E(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(o="tag",n.context.type):R.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return P(n,e,"atBlock_parens");if("}"==t||";"==t)return j(t,e,n);if("{"==t)return T(n)&&P(n,e,y?"block":"top");if("interpolation"==t)return P(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();o="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?"keyword":h.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?k?"string-2":"property":m.hasOwnProperty(r)?"atom":v.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?j(t,e,n):"{"==t?T(n)&&P(n,e,y?"block":"top",!1):("word"==t&&(o="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?T(n):"{"==t||"}"==t?j(t,e,n,2):R.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?P(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):E(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,T(n)):"word"==t?(o="@font-face"==n.stateArg&&!d.hasOwnProperty(e.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(t,e,n){return"word"==t?(o="variable","keyframes"):"{"==t?P(n,e,"top"):E(t,e,n)},at:function(t,e,n){return";"==t?T(n):"{"==t||"}"==t?j(t,e,n):("word"==t?o="tag":"hash"==t&&(o="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?T(n):"{"==t||";"==t?j(t,e,n):("word"==t?o="variable":"variable"!=t&&"("!=t&&")"!=t&&(o="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new _(r?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||O)(t,e);return n&&"object"==typeof n&&(i=n[1],n=n[0]),o=n,"comment"!=i&&(e.state=R[e.state](i,t,e)),o},indent:function(t,e){var n=t.context,r=e&&e.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-a)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=e(n),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=e(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=e(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=e(u),h=["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"],p=e(h),d=e(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=e(v),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=e(y),w=n.concat(i).concat(a).concat(l).concat(u).concat(h).concat(v).concat(y);function k(t,e){for(var n,r=!1;null!=(n=t.next());){if(r&&"/"==n){e.tokenize=null;break}r="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",w),t.defineMIME("text/css",{documentTypes:r,mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:d,counterDescriptors:g,colorKeywords:m,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=k,k(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:m,valueKeywords:b,fontProperties:d,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=k,k(t,e)):["operator","operator"]},":":function(t){return!!t.match(/^\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:m,valueKeywords:b,fontProperties:d,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=k,k(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:o,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:d,counterDescriptors:g,colorKeywords:m,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=k,k(t,e))}},name:"css",helperType:"gss"})}(n(4631))},6531:(t,e,n)=>{1&&function(t){"use strict";var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function n(t,e,n){var r=t.current(),i=r.search(e);return i>-1?t.backUp(r.length-i):r.match(/<\/?$/)&&(t.backUp(r.length),t.match(e,!1)||t.match(r)),n}var r={};function i(t){var e=r[t];return e||(r[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function o(t,e){var n=t.match(i(e));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function a(t,e){return new RegExp((e?"^":"")+"","i")}function s(t,e){for(var n in t)for(var r=e[n]||(e[n]=[]),i=t[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function l(t,e){for(var n=0;n=0;h--)c.script.unshift(["type",f[h].matches,f[h].mode]);function p(e,i){var s,u=o.token(e,i.htmlState),f=/\btag\b/.test(u);if(f&&!/[<>\s\/]/.test(e.current())&&(s=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(s))i.inTag=s+" ";else if(i.inTag&&f&&/>$/.test(e.current())){var h=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var d=">"==e.current()&&l(c[h[1]],h[2]),g=t.getMode(r,d),v=a(h[1],!0),m=a(h[1],!1);i.token=function(t,e){return t.match(v,!1)?(e.token=p,e.localState=e.localMode=null,null):n(t,m,e.localMode.token(t,e.localState))},i.localMode=g,i.localState=t.startState(g,o.indent(i.htmlState,"",""))}else i.inTag&&(i.inTag+=e.current(),e.eol()&&(i.inTag+=" "));return u}return{startState:function(){return{token:p,inTag:null,localMode:null,localState:null,htmlState:t.startState(o)}},copyState:function(e){var n;return e.localState&&(n=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:n,htmlState:t.copyState(o,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,r){return!e.localMode||/^\s*<\//.test(n)?o.indent(e.htmlState,n,r):e.localMode.indent?e.localMode.indent(e.localState,n,r):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||o}}}}),"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}(n(4631),n(9589),n(6876),n(6629))},6876:(t,e,n)=>{1&&function(t){"use strict";t.defineMode("javascript",(function(e,n){var r,i,o=e.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=!1!==n.trackScope,u=n.typescript,f=n.wordCharacters||/[\w$\xa1-\uffff]/,h=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("keyword d"),o=t("operator"),a={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:t("new"),delete:r,void:r,throw:r,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:t("this"),class:t("class"),super:t("atom"),yield:r,export:t("export"),import:t("import"),extends:r,await:r}}(),p=/[+\-*&%=<>!?|~^@]/,d=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}function v(t,e,n){return r=t,i=n,e}function m(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=y(n),e.tokenize(t,e);if("."==n&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return v("number","number");if("."==n&&t.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return v(n);if("="==n&&t.eat(">"))return v("=>","operator");if("0"==n&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return v("number","number");if(/\d/.test(n))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),v("number","number");if("/"==n)return t.eat("*")?(e.tokenize=b,b(t,e)):t.eat("/")?(t.skipToEnd(),v("comment","comment")):ie(t,e,1)?(g(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),v("regexp","string-2")):(t.eat("="),v("operator","operator",t.current()));if("`"==n)return e.tokenize=w,w(t,e);if("#"==n&&"!"==t.peek())return t.skipToEnd(),v("meta","meta");if("#"==n&&t.eatWhile(f))return v("variable","property");if("<"==n&&t.match("!--")||"-"==n&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),v("comment","comment");if(p.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-|&?]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),"?"==n&&t.eat(".")?v("."):v("operator","operator",t.current());if(f.test(n)){t.eatWhile(f);var r=t.current();if("."!=e.lastType){if(h.propertyIsEnumerable(r)){var i=h[r];return v(i.type,i.style,r)}if("async"==r&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",r)}return v("variable","variable",r)}}function y(t){return function(e,n){var r,i=!1;if(s&&"@"==e.peek()&&e.match(d))return n.tokenize=m,v("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=t||i);)i=!i&&"\\"==r;return i||(n.tokenize=m),v("string","string")}}function b(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=m;break}r="*"==n}return v("comment","comment")}function w(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=m;break}r=!r&&"\\"==n}return v("quasi","string-2",t.current())}var k="([{}])";function x(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),l=k.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(f.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(t.string.charAt(a-1)==s&&"\\"!=t.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(e.fatArrowAt=a)}}var O={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function C(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function S(t,e){if(!c)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==e)return!0}function _(t,e,n,r,i){var o=t.cc;for(P.state=t,P.stream=i,P.marked=null,P.cc=o,P.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);1;)if((o.length?o.pop():l?W:z)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return P.marked?P.marked:"variable"==n&&S(t,r)?"variable-2":e}}var P={state:null,column:null,marked:null,cc:null};function T(){for(var t=arguments.length-1;t>=0;t--)P.cc.push(arguments[t])}function E(){return T.apply(null,arguments),!0}function j(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function A(t){var e=P.state;if(P.marked="def",c){if(e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var r=R(t,e.context);if(null!=r)return void(e.context=r)}else if(!j(t,e.localVars))return void(e.localVars=new Z(t,e.localVars));n.globalVars&&!j(t,e.globalVars)&&(e.globalVars=new Z(t,e.globalVars))}}function R(t,e){if(e){if(e.block){var n=R(t,e.prev);return n?n==e.prev?e:new M(n,e.vars,!0):null}return j(t,e.vars)?e:new M(e.prev,new Z(t,e.vars),!1)}return null}function D(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function M(t,e,n){this.prev=t,this.vars=e,this.block=n}function Z(t,e){this.name=t,this.next=e}var L=new Z("this",new Z("arguments",null));function N(){P.state.context=new M(P.state.context,P.state.localVars,!1),P.state.localVars=L}function I(){P.state.context=new M(P.state.context,P.state.localVars,!0),P.state.localVars=null}function F(){P.state.localVars=P.state.context.vars,P.state.context=P.state.context.prev}function V(t,e){var n=function(){var n=P.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new C(r,P.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function B(){var t=P.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function H(t){function e(n){return n==t?E():";"==t||"}"==n||")"==n||"]"==n?T():E(e)}return e}function z(t,e){return"var"==t?E(V("vardef",e),Tt,H(";"),B):"keyword a"==t?E(V("form"),q,z,B):"keyword b"==t?E(V("form"),z,B):"keyword d"==t?P.stream.match(/^\s*$/,!1)?E():E(V("stat"),K,H(";"),B):"debugger"==t?E(H(";")):"{"==t?E(V("}"),I,ht,B,F):";"==t?E():"if"==t?("else"==P.state.lexical.info&&P.state.cc[P.state.cc.length-1]==B&&P.state.cc.pop()(),E(V("form"),q,z,B,Mt)):"function"==t?E(It):"for"==t?E(V("form"),I,Zt,z,F,B):"class"==t||u&&"interface"==e?(P.marked="keyword",E(V("form","class"==t?t:e),zt,B)):"variable"==t?u&&"declare"==e?(P.marked="keyword",E(z)):u&&("module"==e||"enum"==e||"type"==e)&&P.stream.match(/^\s*\w/,!1)?(P.marked="keyword","enum"==e?E(ee):"type"==e?E(Vt,H("operator"),mt,H(";")):E(V("form"),Et,H("{"),V("}"),ht,B,B)):u&&"namespace"==e?(P.marked="keyword",E(V("form"),W,z,B)):u&&"abstract"==e?(P.marked="keyword",E(z)):E(V("stat"),ot):"switch"==t?E(V("form"),q,H("{"),V("}","switch"),I,ht,B,B,F):"case"==t?E(W,H(":")):"default"==t?E(H(":")):"catch"==t?E(V("form"),N,U,z,B,F):"export"==t?E(V("stat"),qt,B):"import"==t?E(V("stat"),Kt,B):"async"==t?E(z):"@"==e?E(W,z):T(V("stat"),W,H(";"),B)}function U(t){if("("==t)return E(Bt,H(")"))}function W(t,e){return G(t,e,!1)}function $(t,e){return G(t,e,!0)}function q(t){return"("!=t?T():E(V(")"),K,H(")"),B)}function G(t,e,n){if(P.state.fatArrowAt==P.stream.start){var r=n?et:tt;if("("==t)return E(N,V(")"),ut(Bt,")"),B,H("=>"),r,F);if("variable"==t)return T(N,Et,H("=>"),r,F)}var i=n?X:Y;return O.hasOwnProperty(t)?E(i):"function"==t?E(It,i):"class"==t||u&&"interface"==e?(P.marked="keyword",E(V("form"),Ht,B)):"keyword c"==t||"async"==t?E(n?$:W):"("==t?E(V(")"),K,H(")"),B,i):"operator"==t||"spread"==t?E(n?$:W):"["==t?E(V("]"),te,B,i):"{"==t?ft(st,"}",null,i):"quasi"==t?T(J,i):"new"==t?E(nt(n)):E()}function K(t){return t.match(/[;\}\)\],]/)?T():T(W)}function Y(t,e){return","==t?E(K):X(t,e,!1)}function X(t,e,n){var r=0==n?Y:X,i=0==n?W:$;return"=>"==t?E(N,n?et:tt,F):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?E(r):u&&"<"==e&&P.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?E(V(">"),ut(mt,">"),B,r):"?"==e?E(W,H(":"),i):E(i):"quasi"==t?T(J,r):";"!=t?"("==t?ft($,")","call",r):"."==t?E(at,r):"["==t?E(V("]"),K,H("]"),B,r):u&&"as"==e?(P.marked="keyword",E(mt,r)):"regexp"==t?(P.state.lastType=P.marked="operator",P.stream.backUp(P.stream.pos-P.stream.start-1),E(i)):void 0:void 0}function J(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?E(J):E(K,Q)}function Q(t){if("}"==t)return P.marked="string-2",P.state.tokenize=w,E(J)}function tt(t){return x(P.stream,P.state),T("{"==t?z:W)}function et(t){return x(P.stream,P.state),T("{"==t?z:$)}function nt(t){return function(e){return"."==e?E(t?it:rt):"variable"==e&&u?E(St,t?X:Y):T(t?$:W)}}function rt(t,e){if("target"==e)return P.marked="keyword",E(Y)}function it(t,e){if("target"==e)return P.marked="keyword",E(X)}function ot(t){return":"==t?E(B,z):T(Y,H(";"),B)}function at(t){if("variable"==t)return P.marked="property",E()}function st(t,e){return"async"==t?(P.marked="property",E(st)):"variable"==t||"keyword"==P.style?(P.marked="property","get"==e||"set"==e?E(lt):(u&&P.state.fatArrowAt==P.stream.start&&(n=P.stream.match(/^\s*:\s*/,!1))&&(P.state.fatArrowAt=P.stream.pos+n[0].length),E(ct))):"number"==t||"string"==t?(P.marked=s?"property":P.style+" property",E(ct)):"jsonld-keyword"==t?E(ct):u&&D(e)?(P.marked="keyword",E(st)):"["==t?E(W,pt,H("]"),ct):"spread"==t?E($,ct):"*"==e?(P.marked="keyword",E(st)):":"==t?T(ct):void 0;var n}function lt(t){return"variable"!=t?T(ct):(P.marked="property",E(It))}function ct(t){return":"==t?E($):"("==t?T(It):void 0}function ut(t,e,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=P.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),E((function(n,r){return n==e||r==e?T():T(t)}),r)}return i==e||o==e?E():n&&n.indexOf(";")>-1?T(t):E(H(e))}return function(n,i){return n==e||i==e?E():T(t,r)}}function ft(t,e,n){for(var r=3;r"),mt):"quasi"==t?T(kt,Ct):void 0}function yt(t){if("=>"==t)return E(mt)}function bt(t){return t.match(/[\}\)\]]/)?E():","==t||";"==t?E(bt):T(wt,bt)}function wt(t,e){return"variable"==t||"keyword"==P.style?(P.marked="property",E(wt)):"?"==e||"number"==t||"string"==t?E(wt):":"==t?E(mt):"["==t?E(H("variable"),dt,H("]"),wt):"("==t?T(Ft,wt):t.match(/[;\}\)\],]/)?void 0:E()}function kt(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?E(kt):E(mt,xt)}function xt(t){if("}"==t)return P.marked="string-2",P.state.tokenize=w,E(kt)}function Ot(t,e){return"variable"==t&&P.stream.match(/^\s*[?:]/,!1)||"?"==e?E(Ot):":"==t?E(mt):"spread"==t?E(Ot):T(mt)}function Ct(t,e){return"<"==e?E(V(">"),ut(mt,">"),B,Ct):"|"==e||"."==t||"&"==e?E(mt):"["==t?E(mt,H("]"),Ct):"extends"==e||"implements"==e?(P.marked="keyword",E(mt)):"?"==e?E(mt,H(":"),mt):void 0}function St(t,e){if("<"==e)return E(V(">"),ut(mt,">"),B,Ct)}function _t(){return T(mt,Pt)}function Pt(t,e){if("="==e)return E(mt)}function Tt(t,e){return"enum"==e?(P.marked="keyword",E(ee)):T(Et,pt,Rt,Dt)}function Et(t,e){return u&&D(e)?(P.marked="keyword",E(Et)):"variable"==t?(A(e),E()):"spread"==t?E(Et):"["==t?ft(At,"]"):"{"==t?ft(jt,"}"):void 0}function jt(t,e){return"variable"!=t||P.stream.match(/^\s*:/,!1)?("variable"==t&&(P.marked="property"),"spread"==t?E(Et):"}"==t?T():"["==t?E(W,H(']'),H(':'),jt):E(H(":"),Et,Rt)):(A(e),E(Rt))}function At(){return T(Et,Rt)}function Rt(t,e){if("="==e)return E($)}function Dt(t){if(","==t)return E(Tt)}function Mt(t,e){if("keyword b"==t&&"else"==e)return E(V("form","else"),z,B)}function Zt(t,e){return"await"==e?E(Zt):"("==t?E(V(")"),Lt,B):void 0}function Lt(t){return"var"==t?E(Tt,Nt):"variable"==t?E(Nt):T(Nt)}function Nt(t,e){return")"==t?E():";"==t?E(Nt):"in"==e||"of"==e?(P.marked="keyword",E(W,Nt)):T(W,Nt)}function It(t,e){return"*"==e?(P.marked="keyword",E(It)):"variable"==t?(A(e),E(It)):"("==t?E(N,V(")"),ut(Bt,")"),B,gt,z,F):u&&"<"==e?E(V(">"),ut(_t,">"),B,It):void 0}function Ft(t,e){return"*"==e?(P.marked="keyword",E(Ft)):"variable"==t?(A(e),E(Ft)):"("==t?E(N,V(")"),ut(Bt,")"),B,gt,F):u&&"<"==e?E(V(">"),ut(_t,">"),B,Ft):void 0}function Vt(t,e){return"keyword"==t||"variable"==t?(P.marked="type",E(Vt)):"<"==e?E(V(">"),ut(_t,">"),B):void 0}function Bt(t,e){return"@"==e&&E(W,Bt),"spread"==t?E(Bt):u&&D(e)?(P.marked="keyword",E(Bt)):u&&"this"==t?E(pt,Rt):T(Et,pt,Rt)}function Ht(t,e){return"variable"==t?zt(t,e):Ut(t,e)}function zt(t,e){if("variable"==t)return A(e),E(Ut)}function Ut(t,e){return"<"==e?E(V(">"),ut(_t,">"),B,Ut):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(P.marked="keyword"),E(u?mt:W,Ut)):"{"==t?E(V("}"),Wt,B):void 0}function Wt(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&D(e))&&P.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(P.marked="keyword",E(Wt)):"variable"==t||"keyword"==P.style?(P.marked="property",E($t,Wt)):"number"==t||"string"==t?E($t,Wt):"["==t?E(W,pt,H("]"),$t,Wt):"*"==e?(P.marked="keyword",E(Wt)):u&&"("==t?T(Ft,Wt):";"==t||","==t?E(Wt):"}"==t?E():"@"==e?E(W,Wt):void 0}function $t(t,e){if("!"==e)return E($t);if("?"==e)return E($t);if(":"==t)return E(mt,Rt);if("="==e)return E($);var n=P.state.lexical.prev;return T(n&&"interface"==n.info?Ft:It)}function qt(t,e){return"*"==e?(P.marked="keyword",E(Qt,H(";"))):"default"==e?(P.marked="keyword",E(W,H(";"))):"{"==t?E(ut(Gt,"}"),Qt,H(";")):T(z)}function Gt(t,e){return"as"==e?(P.marked="keyword",E(H("variable"))):"variable"==t?T($,Gt):void 0}function Kt(t){return"string"==t?E():"("==t?T(W):"."==t?T(Y):T(Yt,Xt,Qt)}function Yt(t,e){return"{"==t?ft(Yt,"}"):("variable"==t&&A(e),"*"==e&&(P.marked="keyword"),E(Jt))}function Xt(t){if(","==t)return E(Yt,Xt)}function Jt(t,e){if("as"==e)return P.marked="keyword",E(Yt)}function Qt(t,e){if("from"==e)return P.marked="keyword",E(W)}function te(t){return"]"==t?E():T(ut($,"]"))}function ee(){return T(V("form"),Et,H("{"),V("}"),ut(ne,"}"),B,B)}function ne(){return T(Et,Rt)}function re(t,e){return"operator"==t.lastType||","==t.lastType||p.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function ie(t,e,n){return e.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return N.lex=I.lex=!0,F.lex=!0,B.lex=!0,{startState:function(t){var e={tokenize:m,lastType:"sof",cc:[],lexical:new C((t||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new M(null,null,!1),indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),x(t,e)),e.tokenize!=b&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==r?n:(e.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",_(e,n,r,i,t))},indent:function(e,r){if(e.tokenize==b||e.tokenize==w)return t.Pass;if(e.tokenize!=m)return 0;var i,s=r&&r.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(r))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==B)l=l.prev;else if(u!=Mt&&u!=F)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=e.cc[e.cc.length-1])&&(i==Y||i==X)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var f=l.type,h=s==f;return"vardef"==f?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==f&&"{"==s?l.indented:"form"==f?l.indented+o:"stat"==f?l.indented+(re(e,r)?a||o:0):"switch"!=l.info||h||0==n.doubleIndentSwitch?l.align?l.column+(h?0:1):l.indented+(h?0:o):l.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:ie,skipExpression:function(e){_(e,"atom","atom","true",new t.StringStream("",2,null))}}})),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/manifest+json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(4631))},9589:(t,e,n)=>{1&&function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function f(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(d("atom","]]>")):null:t.match("--")?n(d("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(g(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=d("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=h,"tag bracket"):"&"==r?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function h(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=f,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){e.tokenize=f,e.state=w,e.tagName=e.tagStart=null;var r=e.tokenize(t,e);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=p(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=h;break}return"string"};return e.isInAttribute=!0,e}function d(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=f;break}n.next()}return t}}function g(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=g(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=f;break}return n.tokenize=g(t-1),n.tokenize(e,n)}}return"meta"}}function v(t){return t&&t.toLowerCase()}function m(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function y(t){t.context&&(t.context=t.context.prev)}function b(t,e){for(var n;1;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(v(n))||!l.contextGrabbers[v(n)].hasOwnProperty(v(e)))return;y(t)}}function w(t,e,n){return"openTag"==t?(n.tagStart=e.column(),k):"closeTag"==t?x:w}function k(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",S):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",S(t,e,n)):(a="error",k)}function x(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(v(n.context.tagName))&&y(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",O):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",O(t,e,n)):(a="error",C)}function O(t,e,n){return"endTag"!=t?(a="error",O):(y(n),w)}function C(t,e,n){return a="error",O(t,e,n)}function S(t,e,n){if("word"==t)return a="attribute",_;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(v(r))?b(n,r):(b(n,r),n.context=new m(n,r,i==n.indented)),w}return a="error",S}function _(t,e,n){return"equals"==t?P:(l.allowMissing||(a="error"),S(t,e,n))}function P(t,e,n){return"string"==t?T:"word"==t&&l.allowUnquoted?(a="string",S):(a="error",S(t,e,n))}function T(t,e,n){return"string"==t?T:S(t,e,n)}return f.isInText=!0,{startState:function(t){var e={tokenize:f,state:w,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(e,n,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=h&&e.tokenize!=f)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==P&&(t.state=S)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(4631))},9714:(t,e,n)=>{"use strict";n.d(e,{Z:()=>f});var r=n(4942),i=n(2982),o=n(5671),a=n(3144),s=n(9050),l=n(1163);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.all,r=e.onResult,i=e.reset,o=this.storageKey,a={action:'load'},s=n||this.getAll(),c=t[o];if('string'==typeof c)try{c=JSON.parse(c)}catch(t){this.__logWarn('Data parsing failed',{input:c})}return i&&c&&s.reset(null,a),r?c&&r(c,a):c&&(0,l.isDef)(c.length)&&s.reset(c,a),c}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all;return e&&e.reset(null,t),this}},{key:"__getConfig",value:function(t){var e=this.config||{};return t?e[t]:e}},{key:"getAll",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.all?t.array?(0,i.Z)(this.all.models):this.all:[]}},{key:"getAllMap",value:function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})}},{key:"__initConfig",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=(0,l.deepMerge)(t,e),this.em=this.config.em,this.cls=[]}},{key:"__initListen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all,n=this.em,r=this.events;e&&n&&e.on('add',(function(t,e,i){return n.trigger(r.add,t,i)})).on('remove',(function(t,e,i){return n.trigger(r.remove,t,i)})).on('change',(function(t,e){return n.trigger(r.update,t,t.changedAttributes(),e)})).on('all',this.__catchAllEvent,this),this.cls=[e].concat(t.collections||[]),(t.propagate||[]).forEach((function(t){var r=t.entity,i=t.event;r.on('all',(function(t,r,o,a){var s=u({event:t},a||o);[n,e].map((function(t){return t.trigger(i,r,s)}))}))}))}},{key:"__remove",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=(0,s.isString)(t)?this.get(t):t,o=function(){return i&&e.all.remove(i,n),i};return!n.silent&&r&&r.trigger(this.events.removeBefore,i,o,n),!n.abort&&o()}},{key:"__catchAllEvent",value:function(t,e,n,r){var i=this.em,o=this.events,a=r||n;i&&o.all&&i.trigger(o.all,{event:t,model:e,options:a}),this.__onAllEvent()}},{key:"__appendTo",value:function(){var t=this.getConfig().appendTo;if(t){var e=(0,s.isElement)(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}}},{key:"__onAllEvent",value:function(){}},{key:"__logWarn",value:function(t,e){this.em.logWarning("[".concat(this.name,"]: ").concat(t),e)}},{key:"_createId",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,n=this.getAll(),r=n.length+e,i=this.getAllMap();do{t=(0,l.createId)(r)}while(i[t]);return t}},{key:"__listenAdd",value:function(t,e){var n=this;t.on('add',(function(t,r,i){return n.em.trigger(e,t,i)}))}},{key:"__listenRemove",value:function(t,e){var n=this;t.on('remove',(function(t,r,i){return n.em.trigger(e,t,i)}))}},{key:"__listenUpdate",value:function(t,e){var n=this;t.on('change',(function(t,r){return n.em.trigger(e,t,t.changedAttributes(),r)}))}},{key:"__destroy",value:function(){var t;this.cls.forEach((function(t){t.stopListening(),t.reset()})),this.em=0,this.config=0,null===(t=this.view)||void 0===t||t.remove(),this.view=0}}]),t}()},1030:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>et,evAdd:()=>U,evAll:()=>V,evClose:()=>K,evCustom:()=>q,evOpen:()=>G,evPfx:()=>B,evRemove:()=>W,evRemoveBefore:()=>$,evSelect:()=>H,evUpdate:()=>z,evUpload:()=>Y,evUploadEnd:()=>J,evUploadError:()=>Q,evUploadRes:()=>tt,evUploadStart:()=>X});var r=n(4942),i=n(9050),o=n(9304);const a={assets:[],noAssets:'',stylePrefix:'am-',upload:0,uploadName:'files',headers:{},params:{},credentials:'include',multiUpload:!0,autoAdd:!0,customFetch:null,uploadFile:null,embedAsBase64:!0,handleAdd:null,beforeUpload:null,showUrlInput:!0,custom:!1,dropzone:!1,openAssetsOnDrop:1,dropzoneContent:''};var s=n(3144),l=n(5671),c=n(9340),u=n(2963),f=n(1120),h=n(2316);function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var d=function(t){(0,c.Z)(n,t);var e=p(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"defaults",value:function(){return{type:'',src:''}}},{key:"getType",value:function(){return this.get('type')}},{key:"getSrc",value:function(){return this.get('src')}},{key:"getFilename",value:function(){return this.get('src').split('/').pop().split('?').shift()}},{key:"getExtension",value:function(){return this.getFilename().split('.').pop()}}]),n}(h.Model);function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.options=t,this.collection=t.collection;var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.em=e.em,this.className=this.pfx+'asset',this.listenTo(this.model,'destroy remove',this.remove),this.model.view=this;var n=this.init&&this.init.bind(this);n&&n(t)}},{key:"__getBhv",value:function(){var t=this.em,e=t&&t.get('AssetManager');return e&&e.__getBehaviour()||{}}},{key:"template",value:function(){var t=this.pfx;return"\n
\n ").concat(this.getPreview(),"\n
\n
\n ").concat(this.getInfo(),"\n
\n
\n ⨯\n
\n ")}},{key:"updateTarget",value:function(t){t&&t.set&&(t.set('attributes',(0,i.clone)(t.get('attributes'))),t.set('src',this.model.get('src')))}},{key:"getPreview",value:function(){return''}},{key:"getInfo",value:function(){return''}},{key:"render",value:function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this}}]),n}(h.View),C=n(7539);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var _=function(t){(0,c.Z)(n,t);var e=S(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"getPreview",value:function(){var t=this.pfx,e=this.ppfx,n=this.model.get('src');return(0,C.Z)(k||(k=(0,b.Z)(["\n
\n
\n "])),t,n,t,e)}},{key:"getInfo",value:function(){var t=this.pfx,e=this.model,n=e.get('name'),r=e.get('width'),i=e.get('height'),o=e.get('unitDim'),a=r&&i?"".concat(r,"x").concat(i).concat(o):'';return n=n||e.getFilename(),(0,C.Z)(x||(x=(0,b.Z)(["\n
","
\n
","
\n "])),t,n,t,a)}},{key:"init",value:function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")}},{key:"onClick",value:function(){var t=this.model,e=this.pfx,n=this.__getBhv().select,r=this.config.onClick,o=this.collection;o.trigger('deselectAll'),this.$el.addClass(e+'highlight'),(0,i.isFunction)(n)?n(t,!1):(0,i.isFunction)(r)?r(t):this.updateTarget(o.target)}},{key:"onDblClick",value:function(){var t=this.em,e=this.model,n=this.__getBhv().select,r=this.config.onDblClick,o=this.collection,a=o.target,s=o.onSelect;(0,i.isFunction)(n)?n(e,!0):(0,i.isFunction)(r)?r(e):(this.updateTarget(a),t&&t.get('Modal').close()),(0,i.isFunction)(s)&&s(e)}},{key:"onRemove",value:function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)}}]),n}(O);_.prototype.events={'click [data-toggle=asset-remove]':'onRemove',click:'onClick',dblclick:'onDblClick'};var P=n(793);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}var E=function(t){(0,c.Z)(n,t);var e=T(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n)}(h.Collection.extend(P.Z));function j(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var i=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.Z)(this,n)}}E.prototype.types=[{id:'image',model:y,view:_,isType:function(t){return'string'==typeof t?{type:'image',src:t}:t}}];var A=function(t){(0,c.Z)(n,t);var e=j(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"template",value:function(t){var e=t.pfx,n=t.ppfx,r=t.em,i='';return this.config.showUrlInput&&(i="\n
\n
\n \n
\n \n
\n
\n ")),"\n
\n
\n ").concat(i,"\n
\n
\n
\n
\n ")}},{key:"initialize",value:function(t){this.options=t,this.config=t.config,this.pfx=this.config.stylePrefix||'',this.ppfx=this.config.pStylePrefix||'',this.em=this.config.em;var e=this.collection;this.listenTo(e,'reset',this.renderAssets),this.listenTo(e,'add',this.addToAsset),this.listenTo(e,'remove',this.removedAsset),this.listenTo(e,'deselectAll',this.deselectAll)}},{key:"handleSubmit",value:function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),r=this.config.handleAdd;n&&(e.value='',this.getAssetsEl().scrollTop=0,r?r.bind(this)(n):this.options.globalCollection.add(n,{at:0}))}},{key:"getAssetsEl",value:function(){return this.el.querySelector(".".concat(this.pfx,"assets"))}},{key:"getAddInput",value:function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl}},{key:"removedAsset",value:function(t){this.collection.length||this.toggleNoAssets()}},{key:"addToAsset",value:function(t){1==this.collection.length&&this.toggleNoAssets(1),this.addAsset(t)}},{key:"addAsset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e,r=this.collection,i=this.config,o=new t.typeView({model:t,collection:r,config:i}).render().el;if(n)n.appendChild(o);else{var a=this.getAssetsEl();a&&a.insertBefore(o,a.firstChild)}return o}},{key:"toggleNoAssets",value:function(t){var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}}},{key:"deselectAll",value:function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))}},{key:"renderAssets",value:function(){var t=this,e=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(this.collection.length),this.collection.each((function(n){return t.addAsset(n,e)})),n.append(e)}},{key:"render",value: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}}]),n}(h.View);A.prototype.events={submit:'handleSubmit'};var R,D=n(9661);function M(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n
","
\n \n
\n \n "])),e,n,r,i?'disabled':'',o?'multiple':'')}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t;var e=t.config||{};this.module=t.module,this.config=e,this.em=this.config.em,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.target=this.options.globalCollection||{},this.uploadId=this.pfx+'uploadFile',this.disabled=void 0!==e.disableUpload?e.disableUpload:!e.upload&&!e.embedAsBase64,this.multiUpload=void 0===e.multiUpload||e.multiUpload,this.events={["change #".concat(this.uploadId)]:'uploadFile'};var n=e.uploadFile;n?this.uploadFile=n.bind(this):!e.upload&&e.embedAsBase64&&(this.uploadFile=this.constructor.embedAsBase64),this.delegateEvents()}},{key:"onUploadStart",value:function(){var t=this.module;t&&t.__propEv('asset:upload:start')}},{key:"onUploadEnd",value:function(t){var e=this.$el,n=this.module;n&&n.__propEv('asset:upload:end',t);var r=e.find('input');r&&r.val('')}},{key:"onUploadError",value:function(t){var e=this.module;console.error(t),this.onUploadEnd(t),e&&e.__propEv('asset:upload:error',t)}},{key:"onUploadResponse",value:function(t,e){var n,r=this.module,i=this.config,o=this.target;try{n='string'==typeof t?JSON.parse(t):t}catch(e){n=t}r&&r.__propEv('asset:upload:response',n),i.autoAdd&&o&&o.add(n.data,{at:0}),this.onUploadEnd(t),e&&e(n)}},{key:"uploadFile",value:function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,i=this.config,o=i.beforeUpload;if(!1!==(o&&o(r))){var a=new FormData,s=i.params,l=i.customFetch;for(var c in s)a.append(c,s[c]);if(this.multiUpload)for(var u=0;u").concat(r.dropzoneContent,"")),f(),'draggable'in o&&[o,s].forEach((function(t){t.ondragover=h,t.ondragleave=p,t.ondrop=d}))}},{key:"render",value:function(){var t=this.$el,e=this.pfx,n=this.em;return t.html(this.template({title:n&&n.t('assetManager.uploadTitle'),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:e})),this.initDrop(),t.attr('class',e+'file-uploader'),this}}]),n}(h.View);function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function F(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},i=(s=F(F({},a),r)).pStylePrefix,o=s,l=o.em;return this.config=s,this.em=l,i&&(s.stylePrefix=i+s.stylePrefix),t=new E([]),e=new E([]),this.all=t,this.__initListen(),t.on('add',(function(t){return n.getAllVisible().add(t)})),t.on('remove',(function(t){return n.getAllVisible().remove(t)})),this},__propEv:function(t){for(var e,n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:{},e=this.em.get('Commands');e.run(l,F({types:['image'],select:function(){}},t))},close:function(){this.em.get('Commands').stop(l)},isOpen:function(){var t=this.em.get('Commands');return!(!t||!t.isActive(l))},add:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0===n.at&&(n.at=0),t.add(e,n)},get:function(e){return t.where({src:e})[0]||null},getAll:function(){return t},getAllVisible:function(){return e},remove:function(t,e){return this.__remove(t,e)},store:function(){return this.getProjectData()},load:function(t){return this.loadProjectData(t)},getContainer:function(){return this.__getBehaviour().container||n&&n.el},getAssetsEl:function(){return n.el.querySelector('[data-el=assets]')},render:function(t){if(!this.getConfig().custom){var r=t||this.getAll().models;if(!n){var i=this.__viewParams();i.fu=this.FileUploader();var o=n&&n.el;(n=new A(F({el:o},i))).render()}return e.reset(r),this.getContainer()}},__viewParams:function(){return{collection:e,globalCollection:t,config:s,module:this}},addType:function(t,e){this.getAll().addType(t,e)},getType:function(t){return this.getAll().getType(t)},getTypes:function(){return this.getAll().getTypes()},AssetsView:function(){return n},FileUploader:function(){return r||(r=new N(this.__viewParams())),r},onLoad:function(){var t=this;this.getAll().reset(s.assets);var e=this.em,n=this.events;e.on("run:".concat(l),(function(){return t.__propEv(n.open)})),e.on("stop:".concat(l),(function(){return t.__propEv(n.close)}))},postRender:function(t){s.dropzone&&r&&r.initDropzone(t)},setTarget:function(t){e.target=t},onSelect:function(t){e.onSelect=t},onClick:function(t){s.onClick=t},onDblClick:function(t){s.onDblClick=t},__behaviour:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._bhv=F(F({},this._bhv||{}),t)},__getBehaviour:function(){return this._bhv||{}},destroy:function(){t.stopListening(),e.stopListening(),t.reset(),e.reset(),r&&r.remove(),n&&n.remove(),[t,e,n,r].forEach((function(t){return null})),this._bhv={},this.all={},s={}}})}},6407:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>q,evAdd:()=>F,evAll:()=>N,evCustom:()=>$,evDrag:()=>z,evDragStart:()=>U,evDragStop:()=>W,evPfx:()=>I,evRemove:()=>B,evRemoveBefore:()=>H,evUpdate:()=>V});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(4942),u=n(9050),f=n(9714);const h={appendTo:'',appendOnClick:!1,blocks:[],custom:!1};var p=n(2316);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var g=function(t){(0,a.Z)(n,t);var e=d(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"defaults",value:function(){return{label:'',content:'',media:'',category:'',activate:!1,select:null,resetId:!1,disable:!1,onClick:null,attributes:{}}}},{key:"getId",value:function(){return this.id}},{key:"getLabel",value:function(){return this.get('label')}},{key:"getMedia",value:function(){return this.get('media')}},{key:"getContent",value:function(){return this.get('content')}},{key:"getCategoryLabel",value:function(){var t=this.get('category');return(0,u.isFunction)(t.get)?t.get('label'):t.label?t.label:t}}]),n}(p.Model);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var m=function(t){(0,a.Z)(n,t);var e=v(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n)}(p.Collection);function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}m.prototype.model=g;var b=function(t){(0,a.Z)(n,t);var e=y(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"defaults",value:function(){return{id:'',label:'',open:!0,attributes:{}}}}]),n}(p.Model);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var k=function(t){(0,a.Z)(n,t);var e=w(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n)}(p.Collection);k.prototype.model=b;var x=n(1163);function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var C,S=function(t){(0,a.Z)(n,t);var e=O(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"events",value:function(){return{click:'handleClick',mousedown:'startDrag',dragstart:'handleDragStart',drag:'handleDrag',dragend:'handleDragEnd'}}},{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model;this.em=e.em,this.config=e,this.endDrag=this.endDrag.bind(this),this.ppfx=e.pStylePrefix||'',this.listenTo(n,'destroy remove',this.remove),this.listenTo(n,'change',this.render)}},{key:"__getModule",value:function(){return this.em.get('BlockManager')}},{key:"handleClick",value:function(t){var e=this.config,n=this.model,r=this.em,i=n.get('onClick')||e.appendOnClick;if(r.trigger('block:click',n,t),i){if((0,u.isFunction)(i))return i(n,r.getEditor(),{event:t});var o,a,s=e.getSorter(),l=n.get('content'),c=r.getSelected();if(s.setDropContent(l),c)if(s.validTarget(c.getEl(),l).valid)o=c;else{var f=c.parent();s.validTarget(f.getEl(),l).valid&&(o=f,a=f.components().indexOf(c)+1)}if(!o){var h=r.getWrapper();s.validTarget(h.getEl(),l).valid&&(o=h)}var p=o&&o.append(l,{at:a})[0];p&&r.setSelected(p,{scroll:1})}}},{key:"startDrag",value:function(t){var e=this.config,n=this.em,r=this.model.get('disable');if(0===t.button&&e.getSorter&&!this.el.draggable&&!r){n.refreshCanvas();var i=e.getSorter();i.setDragHelper(this.el,t),i.setDropContent(this.model.get('content')),i.startSort(this.el),(0,x.on)(document,'mouseup',this.endDrag)}}},{key:"handleDragStart",value:function(t){this.__getModule().__startDrag(this.model,t)}},{key:"handleDrag",value:function(t){this.__getModule().__drag(t)}},{key:"handleDragEnd",value:function(){this.__getModule().__endDrag()}},{key:"endDrag",value:function(t){(0,x.off)(document,'mouseup',this.endDrag);var e=this.config.getSorter();e.moved=0,e.endMove()}},{key:"render",value:function(){var t=this.em,e=this.el,n=this.$el,r=this.ppfx,i=this.model,o=i.get('disable'),a=i.get('attributes')||{},s=a.class||'',l="".concat(r,"block"),c=t&&t.t("blockManager.labels.".concat(i.id))||i.get('label'),u=i.get('render'),f=i.get('media'),h=o?"".concat(l,"--disable"):"".concat(r,"four-color-h");n.attr(a),e.className="".concat(s," ").concat(l," ").concat(r,"one-bg ").concat(h).trim(),e.innerHTML="\n ".concat(f?"
").concat(f,"
"):'',"\n
").concat(c,"
\n "),e.title=a.title||e.textContent.trim(),e.setAttribute('draggable',!(!(0,x.hasDnd)(t)||o));var p=u&&u({el:e,model:i,className:l,prefix:r});return p&&(e.innerHTML=p),this}}]),n}(p.View),_=n(168),P=n(7539);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var E=function(t){(0,a.Z)(n,t);var e=T(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"template",value:function(t){var e=t.pfx,n=t.label;return(0,P.Z)(C||(C=(0,_.Z)(["\n
\n \n ","\n
\n
\n "])),e,e,n,e)}},{key:"attributes",value:function(){return this.model.get('attributes')}},{key:"initialize",value:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t;var e=t.pStylePrefix||'';this.em=t.em,this.pfx=e,this.caretR='fa fa-caret-right',this.caretD='fa fa-caret-down',this.iconClass="".concat(e,"caret-icon"),this.activeClass="".concat(e,"open"),this.className="".concat(e,"block-category"),this.events={},this.events["click .".concat(e,"title")]='toggle',this.listenTo(this.model,'change:open',this.updateVisibility),this.delegateEvents(),this.model.view=this}},{key:"updateVisibility",value:function(){this.model.get('open')?this.open():this.close()}},{key:"open",value:function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=''}},{key:"close",value:function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display='none'}},{key:"toggle",value:function(){var t=this.model;t.set('open',!t.get('open'))}},{key:"getIconEl",value:function(){return this.iconEl||(this.iconEl=this.el.querySelector('.'+this.iconClass)),this.iconEl}},{key:"getBlocksEl",value:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector('.'+this.pfx+'blocks-c')),this.blocksEl}},{key:"append",value:function(t){this.getBlocksEl().appendChild(t)}},{key:"render",value:function(){var t=this.em,e=this.el,n=this.$el,r=this.model,i=this.pfx,o=t.t("blockManager.categories.".concat(r.id))||r.get('label');return e.innerHTML=this.template({pfx:i,label:o}),n.addClass(this.className),n.css({order:r.get('order')}),this.updateVisibility(),this}}]),n}(p.View);function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.config=A(A({},this.config),t)}},{key:"getSorter",value:function(){if(this.em){if(!this.sorter){var t=this.em.get('Utils'),e=this.canvas;this.sorter=new t.Sorter({container:e.getBody(),placer:e.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,onMove:this.onMove,document:e.getFrameEl().contentDocument,direction:'a',wmargin:1,nested:1,em:this.em,canvasRelative:1})}return this.sorter}}},{key:"onDrag",value:function(t){this.em.stopDefault(),this.em.trigger('block:drag:start',t)}},{key:"onMove",value:function(t){this.em.trigger('block:drag:move',t)}},{key:"onDrop",value:function(t){var e=this.em;if(e.runDefault(),t&&t.get){var n='activeOnRender';t.get(n)&&(t.trigger('active'),t.unset(n)),e.trigger('block:drag:stop',t)}}},{key:"addTo",value:function(t){this.add(t)}},{key:"add",value:function(t,e){var n=this.config,r=e||null,i=new S({model:t,attributes:t.get('attributes')},n).render().el,o=t.get('category');if(o&&this.categories&&!n.ignoreCategories){(0,u.isString)(o)?o={id:o,label:o}:(0,u.isObject)(o)&&!o.id&&(o.id=o.label);var a=this.categories.add(o),s=a.get('id'),l=this.renderedCategories[s],c=this.getCategoriesEl();return t.set('category',a,{silent:!0}),!l&&c&&(l=new E({model:a},this.config).render(),this.renderedCategories[s]=l,c.appendChild(l.el)),void(l&&l.append(i))}r?r.appendChild(i):this.append(i)}},{key:"getCategoriesEl",value:function(){return this.catsEl||(this.catsEl=this.el.querySelector(".".concat(this.catsClass))),this.catsEl}},{key:"getBlocksEl",value:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.noCatClass," .").concat(this.blockContClass))),this.blocksEl}},{key:"append",value:function(t){var e=this.getBlocksEl();e&&e.appendChild(t)}},{key:"render",value:function(){var t=this,e=this.ppfx,n=document.createDocumentFragment();this.catsEl=null,this.blocksEl=null,this.renderedCategories=[],this.el.innerHTML="\n
\n
\n
\n
\n "),this.collection.each((function(e){return t.add(e,n)})),this.append(n);var r="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(r),this.rendered=!0,this}}]),n}(p.View);function M(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Z(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.c=Z(Z({},h),e);var n=this.c.em;return this.em=n,this.blocks=new m(this.c.blocks),this.blocksVisible=new m(this.blocks.models),this.categories=new k,this.all=this.blocks,this.__initListen(),this.blocks.on('add',(function(e){return t.blocksVisible.add(e)})),this.blocks.on('remove',(function(e){return t.blocksVisible.remove(e)})),this.blocks.on('reset',(function(e){return t.blocksVisible.reset(e.models)})),this}},{key:"__trgCustom",value:function(){this.em.trigger(this.events.custom,this.__customData())}},{key:"__customData",value:function(){var t=this,e=this.__getBehaviour();return{bm:this,blocks:this.getAll().models,container:e.container,dragStart:function(e,n){return t.startDrag(e,n)},drag:function(e){return t.__drag(e)},dragStop:function(e){return t.endDrag(e)}}}},{key:"__startDrag",value:function(t,e){var n=this.em,r=this.events,i=this.blocks,o=t.getContent?t.getContent():t;this._dragBlock=t,n.set({dragResult:null,dragContent:o}),[n,i].map((function(n){return n.trigger(r.dragStart,t,e)}))}},{key:"__drag",value:function(t){var e=this.em,n=this.events,r=this.blocks,i=this._dragBlock;[e,r].map((function(e){return e.trigger(n.drag,i,t)}))}},{key:"__endDrag",value:function(){var t=this.em,e=this.events,n=this.blocks,r=this._dragBlock,i=t.get('dragResult');if(this._dragBlock=null,i){var o='activeOnRender',a=i.get&&i.get(o),s=r.get('activate')||a,l=r.get('select'),c=(0,u.isArray)(i)?i[0]:i;(l||s&&!1!==l)&&t.setSelected(c),s&&(c.trigger('active'),a&&c.unset(o)),r.get('resetId')&&c.onAll((function(t){return t.resetId()}))}t.set({dragResult:null,dragContent:null}),[t,n].map((function(t){return t.trigger(e.dragEnd,i,r)}))}},{key:"__getFrameViews",value:function(){return this.em.get('Canvas').getFrames().map((function(t){return t.view}))}},{key:"__behaviour",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._bhv=Z(Z({},this._bhv||{}),t)}},{key:"__getBehaviour",value:function(){return this._bhv||{}}},{key:"startDrag",value:function(t,e){this.__startDrag(t,e),this.__getFrameViews().forEach((function(t){return t.droppable.startCustom()}))}},{key:"endDrag",value:function(t){this.__getFrameViews().forEach((function(e){return e.droppable.endCustom(t)})),this.__endDrag()}},{key:"getConfig",value:function(){return this.c}},{key:"postRender",value:function(){var t=this.categories,e=this.blocksVisible;this.blocksView=new D({collection:e,categories:t},this.c);var n=this.getConfig().appendTo;if(n){var r=(0,u.isElement)(n)?n:document.querySelector(n);if(!r)return this.__logWarn('"appendTo" element not found');r.appendChild(this.render(this.blocksVisible.models))}this.__trgCustom()}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e||{};return r.id=t,this.blocks.add(r,n)}},{key:"get",value:function(t){return this.blocks.get(t)}},{key:"getAll",value:function(){return this.blocks}},{key:"getAllVisible",value:function(){return this.blocksVisible}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__remove(t,e)}},{key:"getCategories",value:function(){return this.categories}},{key:"getContainer",value:function(){return this.blocksView.el}},{key:"render",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.categories.categories,r=t||this.getAll().models;if(e.external){var i=new m(r);return new D({collection:i,categories:n},Z(Z({},this.c),e)).render().el}return this.blocksView&&(this.blocksView.updateConfig(e),this.blocksView.collection.reset(r),this.blocksView.rendered||(this.blocksView.render(),this.blocksView.rendered=1)),this.getContainer()}},{key:"destroy",value:function(){var t,e=[this.blocks,this.blocksVisible,this.categories];e.map((function(t){return t.stopListening()})),e.map((function(t){return t.reset()})),null===(t=this.blocksView)||void 0===t||t.remove(),this.c={},this.blocks={},this.blocksVisible={},this.blocksView={},this.categories=[],this.all={}}}]),n}(f.Z)},7619:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>j});var r=n(9050);const i={stylePrefix:'cm-',inlineCss:!1};var o=n(4925),a=n(5671),s=n(3144),l=n(9340),c=n(2963),u=n(1120),f=n(2316),h=["em"];function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var d=function(t){(0,l.Z)(n,t);var e=p(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"build",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.em,r=(0,o.Z)(e,h),i=r;if(e.cleanId&&n){var a=n.get('CssComposer').getAll(),s=a.toJSON().map((function(t){var e=t.selectors,n=e&&1===e.length&&e.models[0];return n&&n.isId()&&n.get('name')})).filter((function(t){return t}));i.attributes||(i.attributes=function(t,e){var n=e.id;return n&&'i'===n[0]&&!t.get('script')&&!t.get('attributes').id&&s.indexOf(n)<0&&delete e.id,e})}return t.toHTML(i)}}]),n}(f.Model),g=n(8795);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var m=function(t){(0,l.Z)(n,t);var e=v(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"build",value:function(t){var e=t.toJSON();return this.beforeEach(e),(0,r.each)(e,(function(t,n){var r=e[n];if(r instanceof f.Model)e[n]=this.build(r);else if(r instanceof f.Collection){var i=r;e[n]=[],i.length&&i.each((function(t,r){e[n][r]=this.build(t)}),this)}}),this),e}},{key:"beforeEach",value:function(t){delete t.status}}]),n}(f.Model);function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var b,w=function(t){(0,l.Z)(n,t);var e=y(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"mapModel",value:function(t){var e='',n=t.get('script-export')||t.get('script'),i=t.get('type'),o=t.get('components'),a=t.getId();if(n){var s=t.get('attributes');s=(0,r.extend)({},s,{id:a}),t.set('attributes',s,{silent:1});var l=t.getScriptString(n),c=t.get('script-props');if(t.get('scriptUpdated')&&!c)this.mapJs[i+'-'+a]={ids:[a],code:l};else{var u,f=this.mapJs[i];if(c&&(u=t.__getScriptProps()),f)f.ids.push(a),u&&(f.props[a]=u);else{var h={ids:[a],code:l};u&&(h.props={[a]:u}),this.mapJs[i]=h}}}return o.each((function(t){e+=this.mapModel(t)}),this),e}},{key:"build",value:function(t){this.mapJs={},this.mapModel(t);var e='';for(var n in this.mapJs){var r=this.mapJs[n];if(r.code)if(r.props){if(0===r.code.toString().match(/\{([\s\S]*)\}/m)[1].replace(/^\s*\/\/.*$/gm,'').trim().length)continue;e+="\n var props = ".concat(JSON.stringify(r.props),";\n var ids = Object.keys(props).map(function(id) { return '#'+id }).join(',');\n var els = document.querySelectorAll(ids);\n for (var i = 0, len = els.length; i < len; i++) {\n var el = els[i];\n (").concat(r.code,".bind(el))(props[el.id]);\n }")}else{var i='#'+r.ids.join(', #');e+="\n var items = document.querySelectorAll('".concat(i,"');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){\n").concat(r.code,"\n}.bind(items[i]))();\n }")}}return e}}]),n}(f.Model),k=n(4942);function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}(0,n(1163).hasWin)()&&(b=n(4631),n(6531),n(6629),n(9210));var C=function(t){(0,l.Z)(n,t);var e=O(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"defaults",value:function(){return{input:'',label:'',codeName:'',theme:'hopscotch',readOnly:!0,lineNumbers:!0}}},{key:"init",value:function(t){return(0,r.bindAll)(this,'onChange'),this.editor=b.fromTextArea(t,function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},r=this.editor;r&&(r.setValue(t),r.autoFormatRange&&(b.commands.selectAll(r),r.autoFormatRange(r.getCursor(!0),r.getCursor(!1)),b.commands.goDocStart(r)),!n.noRefresh&&setTimeout((function(){return e.refresh()})))}}]),n}(f.Model);C.prototype.CodeMirror=b;var S,_=n(168),P=n(7539);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var E=function(t){(0,l.Z)(n,t);var e=T(n);function n(){return(0,a.Z)(this,n),e.apply(this,arguments)}return(0,s.Z)(n,[{key:"template",value:function(t){var e=t.pfx,n=t.codeName,r=t.label;return(0,P.Z)(S||(S=(0,_.Z)(["\n
\n
","
\n
\n
\n "])),e,e,n,e,r,e)}},{key:"initialize",value:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix}},{key:"render",value:function(){var t=this.model,e=this.pfx,n=this.$el,r=t.toJSON();return r.pfx=e,n.html(this.template(r)),n.attr('class',"".concat(e,"editor-c")),n.find("#".concat(e,"code")).append(t.get('input')),this}}]),n}(f.View);const j=function(){var t={},e={},n={},o={},a={},s='CodeMirror';return{getConfig:function(){return t},config:t,EditorView:E,name:'CodeManager',init:function(e){for(var r in t=e||{},i)r in t||(t[r]=i[r]);var o=t.pStylePrefix;return o&&(t.stylePrefix=o+t.stylePrefix),n.html=new d,n.css=new g.Z,n.json=new m,n.js=new w,a.CodeMirror=new C,this.loadDefaultGenerators().loadDefaultViewers(),this},addGenerator:function(t,n){return e[t]=n,this},getGenerator:function(t){return e[t]||null},getGenerators:function(){return e},addViewer:function(t,e){return o[t]=e,this},getViewer:function(t){return o[t]||null},getViewers:function(){return o},createViewer:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,r.isUndefined)(t.type)?s:t.type,n=this.getViewer(e)&&this.getViewer(e).clone(),i=document.createElement('div'),o=document.createElement('textarea');return i.appendChild(o),n.set(t),n.init(o),n.setElement(i),n},updateViewer:function(t,e){t.setContent(e)},getCode:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.em=t.em;var i=this.getGenerator(n);return i?i.build(e,r):''},loadDefaultGenerators:function(){for(var t in n)this.addGenerator(t,n[t]);return this},loadDefaultViewers:function(){for(var t in a)this.addViewer(t,a[t]);return this},destroy:function(){[t,e,n,o,a].forEach((function(t){return{}}))}}}},8795:(t,e,n)=>{"use strict";n.d(e,{U:()=>p,Z:()=>d});var r=n(5671),i=n(3144),o=n(9340),a=n(2963),s=n(1120),l=n(9050),c=n(2316),u=n(1163);function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var i=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var h=Number.MAX_VALUE,p=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?e[0]:''},d=function(t){(0,o.Z)(n,t);var e=f(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"initialize",value:function(){(0,l.bindAll)(this,'sortRules'),this.compCls=[],this.ids=[]}},{key:"buildFromModel",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r='',i=this.em,o=i&&i.getConfig().avoidInlineStyle,a=t.styleToString(),s=t.get('classes');this.ids.push("#".concat(t.getId())),s.each((function(t){return e.compCls.push(t.getFullName())})),!o&&a&&(r="#".concat(t.getId(),"{").concat(a,"}"));var l=t.components();return l.each((function(t){return r+=e.buildFromModel(t,n)})),r}},{key:"build",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.json,i=n.em||'',o=n.cssc||i&&i.get('CssComposer');this.em=i,this.compCls=[],this.ids=[],this.model=t;var a=[],s=t?this.buildFromModel(t,n):'',c=(0,l.isUndefined)(n.clearStyles)&&i?i.getConfig().clearStyles:n.clearStyles;if(o){var f=n.rules||o.getAll(),h={},p=[];n.onlyMatched&&t&&(0,u.hasWin)()&&(f=this.matchedRules(t,f)),f.forEach((function(t){var i=t.getAtRule();if(i){var o=h[i];o?o.push(t):h[i]=[t]}else{var l=e.buildFromRule(t,p,n);r?a.push(l):s+=l}})),this.sortMediaObject(h).forEach((function(t){var i='',o=t.key;t.value.forEach((function(t){var l=e.buildFromRule(t,p,n);t.get('singleAtRule')?s+="".concat(o,"{").concat(l,"}"):i+=l,r&&a.push(l)})),i&&(s+="".concat(o,"{").concat(i,"}"))})),i&&c&&f.remove&&f.remove(p)}return r?a.filter((function(t){return t})):s}},{key:"buildFromRule",value:function(t,e){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o='',a=this.model,s=t.selectorsToString({skipAdd:1}),l=t.get('selectorsAdd'),c=t.get('singleAtRule');if(t.get('selectors').each((function(t){var e=t.getFullName();(r.compCls.indexOf(e)>=0||r.ids.indexOf(e)>=0||i.keepUnusedStyles)&&(n=1)})),s&&n||l||c||!a){var u=t.getDeclaration({body:1});u&&(i.json?o=t:o+=u)}else e.push(t);return o}},{key:"matchedRules",value:function(t,e){var n=this,r=t.getEl(),i=[];return e.forEach((function(t){try{t.selectorsToString().split(',').some((function(t){return r.matches(n.__cleanSelector(t))}))&&i.push(t)}catch(t){}})),t.components().forEach((function(t){i=i.concat(n.matchedRules(t,e))})),i=i.filter((function(t,e){return i.indexOf(t)===e}))}},{key:"getQueryLength",value:function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):h}},{key:"sortMediaObject",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[];return(0,l.each)(e,(function(t,e){return n.push({key:e,value:t})})),n.sort((function(e,n){var r=[e.key,n.key].every((function(t){return-1!==t.indexOf('min-width')})),i=r?e.key:n.key,o=r?n.key:e.key;return t.getQueryLength(i)-t.getQueryLength(o)}))}},{key:"sortRules",value:function(t,e){var n=function(t){return t.get('mediaText')},r=[n(t),n(e)].every((function(t){return-1!==t.indexOf('min-width')})),i=n(r?t:e),o=n(r?e:t);return this.getQueryLength(i)-this.getQueryLength(o)}},{key:"__cleanSelector",value:function(t){return t.split(' ').map((function(t){return t.split(':')[0]})).join(' ')}}]),n}(c.Model)},289:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>h});var r=n(2982),i=n(4942),o=n(9050),a=n(238);const s={stylePrefix:'com-',defaults:[],strict:1};var l=n(9138);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};e=u(u({},s),a),t=e.em;var h=e.pStylePrefix;return h&&(e.stylePrefix=h+e.stylePrefix),Object.keys(e.defaults).forEach((function(t){var n=e.defaults[t];n.id&&i.add(n.id,n)})),c['tlb-delete']={run:function(t){return t.runCommand('core:component-delete')}},c['tlb-clone']={run:function(t){t.runCommand('core:copy'),t.runCommand('core:paste',{action:'clone-component'})}},c['tlb-move']={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getModel(),a=n&&n.event,s=n.target,c=s||t.getSelected(),u=s?[s]:(0,r.Z)(t.getSelectedAll()),f=a&&'dragstart'==a.type,h={preserveSelected:1},p=['absolute','translate'];if(!c||!c.get('draggable'))return i.logWarning('The element is not draggable');var d=c.get('dmode')||i.get('dmode'),g=function(){return i.stopDefault(h)},v=(0,o.includes)(p,d);u.forEach((function(t){return t.trigger('disable')})),f?setTimeout(g,0):g();var m=function(t){i.trigger("".concat(l.OA,":start"),t)},y=function(t){i.trigger(l.OA,t)},b=function(e,n,r){u.forEach((function(t){return t.set('status','selected')})),t.select(u),c.emitUpdate(),i.trigger("".concat(l.OA,":end"),r),setTimeout((function(){return i.runDefault(h)})),(v||r.cancelled)&&i.set('_cmpDrag',1)};if(v)t.runCommand('core:component-drag',{guidesInfo:1,mode:d,target:c,onStart:m,onDrag:y,onEnd:b,event:a});else{f&&a.dataTransfer.setDragImage(c.view.el,0,0);var w=t.Commands.get('move-comp');w.onStart=m,w.onDrag=y,w.onEndMoveFromModel=b,w.initSorterFromModels(u)}u.forEach((function(t){return t.set('status','freezed-selected')}))}},c['core:undo']=function(t){return t.UndoManager.undo()},c['core:redo']=function(t){return t.UndoManager.redo()},f.forEach((function(e){var r=e[2],i=n(2828)("./".concat(e[1])).default,o="core:".concat(e[0]);c[o]=i,r&&(c[r]=i,['run','stop'].forEach((function(e){t.on("".concat(e,":").concat(r),(function(){for(var n,r=arguments.length,i=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:{},n=this.get(t);if(n){var r=u(u({},n.constructor.prototype),e);this.add(t,r);var i=f.filter((function(e){return"core:".concat(e[0])===t&&e[2]}))[0];i&&this.add(i[2],r)}return this},has:function(t){return!!i[t]},getAll:function(){return i},run:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.runCommand(this.get(t),e)},stop:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.stopCommand(this.get(t),e)},isActive:function(t){return this.getActive().hasOwnProperty(t)},getActive:function(){return h},loadDefaultCommands:function(){for(var t in c)this.add(t,c[t]);return this},runCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,a=t.get('Editor');this.isActive(o)&&!i.force&&e.strict||(r=a&&n.callRun(a,i),o&&n.stop&&!n.noStop&&!i.abort&&(h[o]=r))}return r},stopCommand:function(n){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n&&n.run){var o=n.id,a=t.get('Editor');(this.isActive(o)||i.force||!e.strict)&&(o&&delete h[o],r=n.callStop(a,i))}return r},create:function(t){return t.stop||(t.noStop=1),new(a["default"].extend(t))(e)},destroy:function(){[t,e,i,c,h].forEach((function(t){return{}}))}}}},7202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){t.DomComponents.clear(),t.CssComposer.clear()}}},327:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var r=n(9050),i=n(1163),o=n(5610);const a={run:function(t){(0,r.bindAll)(this,'onKeyUp','enableDragger','disableDragger'),this.editor=t,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(t){this.toggleMove(),this.disableDragger()},onKeyUp:function(t){' '===(0,i.getKeyChar)(t)&&this.editor.stopCommand(this.id)},enableDragger:function(t){this.toggleDragger(1,t)},disableDragger:function(t){this.toggleDragger(0,t)},toggleDragger:function(t,e){var n=this.canvasModel,r=this.em,i=this.dragger,a=t?'add':'remove';this.getCanvas().classList[a]("".concat(this.ppfx,"is__grabbing")),i||(i=new o.Z({getPosition:function(){return{x:n.get('x'),y:n.get('y')}},setPosition:function(t){var e=t.x,r=t.y;n.set({x:e,y:r})},onStart:function(t,e){r.trigger('canvas:move:start',e)},onDrag:function(t,e){r.trigger('canvas:move',e)},onEnd:function(t,e){r.trigger('canvas:move:end',e)}}),this.dragger=i),t?i.start(e):i.stop()},toggleMove:function(t){var e=this.ppfx,n=t?'add':'remove',r=t?'on':'off',o={on:i.on,off:i.off},a=this.getCanvas(),s=["".concat(e,"is__grab")];!t&&s.push("".concat(e,"is__grabbing")),s.forEach((function(t){return a.classList[n](t)})),o[r](document,'keyup',this.onKeyUp),o[r](a,'mousedown',this.enableDragger),o[r](document,'mouseup',this.disableDragger)}}},238:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(5671),i=n(3144),o=n(9340),a=n(2963),s=n(1120),l=n(2316);function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var i=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var u=function(t){(0,o.Z)(n,t);var e=c(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"initialize",value:function(t){this.config=t||{},this.editorModel=this.em=this.config.em||{},this.pfx=this.config.stylePrefix,this.ppfx=this.config.pStylePrefix,this.hoverClass=this.pfx+'hover',this.badgeClass=this.pfx+'badge',this.plhClass=this.pfx+'placeholder',this.freezClass=this.ppfx+'freezed',this.canvas=this.em.get&&this.em.get('Canvas'),this.init(this.config)}},{key:"onFrameScroll",value:function(t){}},{key:"getCanvas",value:function(){return this.canvas.getElement()}},{key:"getCanvasBody",value:function(){return this.canvas.getBody()}},{key:"getCanvasTools",value:function(){return this.canvas.getToolsEl()}},{key:"offset",value:function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}}},{key:"init",value:function(t){}},{key:"callRun",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id;if(t.trigger("run:".concat(n,":before"),e),!e||!e.abort){var r=e.sender||t,i=this.run(t,r,e);return t.trigger("run:".concat(n),i,e),t.trigger('run',n,i,e),i}t.trigger("abort:".concat(n),e)}},{key:"callStop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.id,r=e.sender||t;t.trigger("stop:".concat(n,":before"),e);var i=this.stop(t,r,e);return t.trigger("stop:".concat(n),i,e),t.trigger('stop',n,i,e),i}},{key:"stopCommand",value:function(){this.em.get('Commands').stop(this.id)}},{key:"run",value:function(t,e){}},{key:"stop",value:function(t,e){}}]),n}(l.Model)},5820:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2982),i=n(9050);const o={run:function(t,e){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[],s=o.component||t.getSelectedAll();return(s=(0,i.isArray)(s)?(0,r.Z)(s):[s]).filter(Boolean).forEach((function(t){if(!t.get('removable'))return a.push(t),n.em.logWarning('The element is not removable',{component:t});t.remove()})),t.select(a),s}}},6694:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>c});var r=n(4942),i=n(9050),o=n(5610);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};(0,i.bindAll)(this,'setPosition','onStart','onDrag','onEnd','getPosition','getGuidesStatic','renderGuide','getGuidesTarget');var a=r.target,c=r.event,u=r.mode,f=r.dragger,h=void 0===f?{}:f,p=a.getEl(),d=s({doc:p.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return n.guidesStatic},guidesTarget:function(){return n.guidesTarget}},h);this.setupGuides(),this.opts=r,this.editor=t,this.em=t.getModel(),this.target=a,this.isTran='translate'==u,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var g=this.dragger;return g?g.setOptions(d):(g=new o.Z(d),this.dragger=g),c&&g.start(c),this.toggleDrag(1),this.em.trigger("".concat(l,":start"),this.getEventOpts()),g},getEventOpts:function(){return{mode:this.opts.mode,target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach((function(t){var e=t.guide;e&&e.parentNode.removeChild(e)})),this.guides=[]},getGuidesContainer:function(){var t=this,e=this.guidesEl;if(!e){var n=this.editor,r=this.em,o=this.opts,a=n.getConfig().stylePrefix,s=document.createElement('div'),l=document.createElement('div'),c="
\n
\n
");(e=document.createElement('div')).className="".concat(a,"guides"),s.className="".concat(a,"guide-info ").concat(a,"guide-info__x"),l.className="".concat(a,"guide-info ").concat(a,"guide-info__y"),s.innerHTML=c,l.innerHTML=c,e.appendChild(s),e.appendChild(l),n.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=s,this.elGuideInfoY=l,this.elGuideInfoContentX=s.querySelector(".".concat(a,"guide-info__content")),this.elGuideInfoContentY=l.querySelector(".".concat(a,"guide-info__content")),r.on('canvas:update frame:scroll',(0,i.debounce)((function(){t.updateGuides(),o.debug&&t.guides.forEach((function(e){return t.renderGuide(e)}))}),200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),r=n.parentNode,o=void 0===r?{}:r;return(0,i.each)(o.children,(function(r){return e=e.concat(n!==r?t.getElementGuides(r):[])})),e.concat(this.getElementGuides(o))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,r=this;(t||this.guides).forEach((function(t){var o=t.origin,a=e===o?n:r.getElementPos(o);e=o,n=a,(0,i.each)(r.getGuidePosUpdate(t,a),(function(e,n){return t[n]=e})),t.originRect=a}))},getGuidePosUpdate:function(t,e){var n={},r=e.top,i=e.height,o=e.left,a=e.width;switch(t.type){case't':n.y=r;break;case'b':n.y=r+i;break;case'l':n.x=o;break;case'r':n.x=o+a;break;case'x':n.x=o+a/2;break;case'y':n.y=r+i/2}return n},renderGuide:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.guide||document.createElement('div'),n='px',r=t.active?2:1,i=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?'green':'red',";"),e.children.length||((i=document.createElement('div')).style='position: absolute; color: red; padding: 5px; top: 0; left: 0;',e.appendChild(i)),t.y?(e.style.width='100%',e.style.height="".concat(r).concat(n),e.style.top="".concat(t.y).concat(n),e.style.left=0):(e.style.width="".concat(r).concat(n),e.style.height='100%',e.style.left="".concat(t.x).concat(n),e.style.top="0".concat(n)),!t.guide&&this.guidesContainer.appendChild(e),e},getElementPos:function(t){return this.editor.Canvas.getElementPos(t,{noScroll:1})},getElementGuides:function(t){var e=this,n=this.opts,r=this.getElementPos(t),i=r.top,o=r.height,a=r.left,l=r.width,c=[{type:'t',y:i},{type:'b',y:i+o},{type:'l',x:a},{type:'r',x:a+l},{type:'x',x:a+l/2},{type:'y',y:i+o/2}].map((function(i){return s(s({},i),{},{origin:t,originRect:r,guide:n.debug&&e.renderGuide(i)})}));return c.forEach((function(t){return e.guides.push(t)})),c},getTranslate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'x',n=0;return(t||'').split(' ').forEach((function(t){var r=t.trim(),i="translate".concat(e.toUpperCase(),"(");0===r.indexOf(i)&&(n=parseFloat(r.replace(i,'')))})),n},setTranslate:function(t,e,n){var r="translate".concat(e.toUpperCase(),"("),i="".concat(r).concat(n,")"),o=(t||'').split(' ').map((function(t){return 0===t.trim().indexOf(r)&&(t=i),t})).join(' ');return o.indexOf(r)<0&&(o+=" ".concat(i)),o},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),r=n.left,i=n.top,o=n.transform,a=0,s=0;return e?(a=this.getTranslate(o),s=this.getTranslate(o,'y')):(a=parseFloat(r||0),s=parseFloat(i||0)),{x:a,y:s}},setPosition:function(t){var e=t.x,n=t.y,r=t.end,o=t.position,a=t.width,s=t.height,l=this.target,c=this.isTran,u=this.em,f='px',h=r?'':1,p="".concat(e).concat(f),d="".concat(n).concat(f),g={};if(c){var v=l.getStyle()['transform']||'';v=this.setTranslate(v,'x',p),g={transform:v=this.setTranslate(v,'y',d),en:h},l.addStyle(g,{avoidStore:!r})}else{var m={position:o,width:a,height:s},y={left:p,top:d,en:h};(0,i.keys)(m).forEach((function(t){var e=m[t];e&&(y[t]=e)})),g=y,l.addStyle(g,{avoidStore:!r})}u.getSelected()&&(0,i.keys)(g).forEach((function(t){return u.trigger("update:component:style:".concat(t))}))},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this.target,n=this.editor,r=this.isTran,i=this.opts,o=i.center,a=i.onStart,s=n.Canvas,l=e.getStyle(),c='absolute',u=[c,'relative'];if(a&&a(this._getDragData()),!r&&l.position!==c){var f,h=s.offset(e.getEl()),p=h.left,d=h.top,g=h.width,v=h.height,m=e.parent();do{var y=m.getStyle();f=u.indexOf(y.position)>=0?m:null,m=m.parent()}while(m&&!f);if(o){var b=s.getMouseRelativeCanvas(t);p=b.x,d=b.y}else if(f){var w=s.offset(f.getEl());p-=w.left,d-=w.top}this.setPosition({x:p,y:d,width:"".concat(g,"px"),height:"".concat(v,"px"),position:c})}},onDrag:function(){var t=this,e=this.guidesTarget,n=this.opts,r=n.onDrag;this.updateGuides(e),n.debug&&e.forEach((function(e){return t.renderGuide(e)})),n.guidesInfo&&this.renderGuideInfo(e.filter((function(t){return t.active}))),r&&r(this._getDragData())},onEnd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.editor,i=this.opts,o=this.id,a=i.onEnd;a&&a(t,n,s(s({event:t},n),this._getDragData())),r.stopCommand(o),this.hideGuidesInfo(),this.em.trigger("".concat(l,":end"),this.getEventOpts())},hideGuidesInfo:function(){var t=this;['X','Y'].forEach((function(e){var n=t["elGuideInfo".concat(e)];n&&(n.style.display='none')}))},renderGuideInfo:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.guidesStatic;this.hideGuidesInfo(),e.forEach((function(e){var r=e.origin,o=e.x,a=t.getElementPos(r),c=(0,i.isUndefined)(o)?'y':'x',u='y'===c,f=a[u?'left':'top'],h=a.rect[u?'left':'top'],p=u?f+a.width:f+a.height,d=u?h+a.rect.width:h+a.rect.height,g=t["elGuideInfo".concat(c.toUpperCase())],v=t["elGuideInfoContent".concat(c.toUpperCase())],m=g.style,y=n.filter((function(t){return t.type===e.type})).map((function(t){var e=t.originRect,n=e.left,r=e.width,i=e.top,o=e.height,a=u?n+r:i+o;return{gap:a0})).sort((function(t,e){return t.gap-e.gap})).map((function(t){return t.guide}))[0];if(y){var b=y.originRect,w=b.left,k=b.width,x=b.top,O=b.height,C=b.rect,S=u?w{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.components(),r=n&&n.filter((function(t){return t.get('selectable')}))[0];r&&e.push(r)})),e.length&&t.select(e)}}}},3888:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.Canvas.hasFocus()||n.force){var r=[];t.getSelectedAll().forEach((function(t){for(var e=t.parent();e&&!e.get('selectable');)e=e.parent();e&&r.push(e)})),r.length&&t.select(r)}}}},5883:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,i=n.components().length,o=0,a=0;do{o++,r=(a=t.index()+o)<=i?n.getChildAt(a):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},7508:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,i=0,o=0;do{i++,r=(o=t.index()-i)>=0?n.getChildAt(o):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},8769:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050);const i={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.target,o=[];if(!i.get('styles'))return o;var a=i.get('type'),s=t.Pages.getAllWrappers(),l=(0,r.flatten)(s.map((function(t){return t.findType(a)}))).length;if(!l){var c=t.CssComposer.getAll();o=c.filter((function(t){return t.get('group')==="cmp:".concat(a)})),c.remove(o)}return o}}},2213:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(2982);const i={run:function(t){var e=t.getModel(),n=(0,r.Z)(t.getSelectedAll());n.length&&e.set('clipboard',n)}}},5049:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var r=n(9050),i=n(2316),o=n.n(i),a=n(2620),s=o().$;const l=(0,r.extend)({},a["default"],{init:function(t){(0,r.bindAll)(this,'startDelete','stopDelete','onDelete'),this.hoverClass=this.pfx+'hover-delete',this.badgeClass=this.pfx+'badge-red'},enable:function(){this.$el.find('*').mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete)},startDelete:function(t){t.stopPropagation();var e=s(t.target);e.data('model').get('removable')&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation(),s(t.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=s(t.target);e.data('model').get('removable')&&(e.data('model').destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html('Remove '+t.getName())}})},3775:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2316),i=n.n(r)().$;const o={run:function(t,e){var n=this;e&&e.set&&e.set('active',0);var r=t.getConfig(),o=t.Modal,a=r.stylePrefix;if(this.cm=t.CodeManager||null,!this.$editors){var s=this.buildEditor('htmlmixed','hopscotch','HTML'),l=this.buildEditor('css','hopscotch','CSS');this.htmlEditor=s.el,this.cssEditor=l.el;var c=i("
"));c.append(s.$el).append(l.$el),this.$editors=c}o.open({title:r.textViewCode,content:this.$editors}).getModel().once('change:open',(function(){return t.stopCommand(n.id)})),this.htmlEditor.setContent(t.getHtml()),this.cssEditor.setContent(t.getCss())},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var r=document.createElement('textarea');!this.codeMirror&&(this.codeMirror=this.cm.getViewer('CodeMirror'));var i=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:r}),o=new this.cm.EditorView({model:i,config:this.cm.getConfig()}).render().$el;return i.init(r),{el:i,$el:o}}}},58:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050);const i={isEnabled:function(){var t=document;return t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement?1:0},enable:function(t){var e='';return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e='webkit',t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e='moz',t.mozRequestFullScreen()):t.msRequestFullscreen?t.msRequestFullscreen():console.warn('Fullscreen not supported'),e},disable:function(){var t=document;this.isEnabled()&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},fsChanged:function(t,e){document;var n=(t||'')+'fullscreenchange';this.isEnabled()||(this.stop(null,this.sender),document.removeEventListener(n,this.fsChanged))},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sender=e;var i=n.target,o=(0,r.isElement)(i)?i:document.querySelector(i),a=this.enable(o||t.getContainer());this.fsChanged=this.fsChanged.bind(this,a),document.addEventListener(a+'fullscreenchange',this.fsChanged),t.trigger('change:canvasOffset')},stop:function(t,e){e&&e.set&&e.set('active',!1),this.disable(),t&&t.trigger('change:canvasOffset')}}},8658:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(9050),i=n(2316),o=n.n(i),a=n(1163),s=n(2620),l=n(8463),c=o().$;const u=(0,r.extend)({},l["default"],s["default"],{init:function(t){s["default"].init.apply(this,arguments),(0,r.bindAll)(this,'initSorter','rollback','onEndMove'),this.opt=t,this.hoverClass=this.ppfx+'highlighter-warning',this.badgeClass=this.ppfx+'badge-warning',this.noSelClass=this.ppfx+'no-select'},enable:function(){for(var t=arguments.length,e=new Array(t),n=0;n{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(9050),i=n(9283);const o={open:function(t){var e=this,n=this.editor,i=this.title,o=this.config,a=this.am,s=o.custom;if((0,r.isFunction)(s.open))return s.open(a.__customData());n.Modal.open({title:i,content:t}).onceClose((function(){return n.stopCommand(e.id)}))},close:function(){var t=this.config.custom;if((0,r.isFunction)(t.close))return t.close(this.am.__customData());var e=this.editor.Modal;e&&e.close()},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.AssetManager,o=r.getConfig(),a=n.types,s=void 0===a?[]:a,l=n.accept,c=n.select;if(this.title=n.modalTitle||t.t('assetManager.modalTitle')||'',this.editor=t,this.config=o,this.am=r,r.setTarget(n.target),r.onClick(n.onClick),r.onDblClick(n.onDblClick),r.onSelect(n.onSelect),r.__behaviour({select:c,types:s,options:n}),o.custom)this.rendered=this.rendered||(0,i.ut)('div'),this.rendered.className="".concat(o.stylePrefix,"custom-wrp"),r.__behaviour({container:this.rendered}),r.__trgCustom();else{if(!this.rendered||s){var u=r.getAll().filter((function(t){return t}));s&&s.length&&(u=u.filter((function(t){return-1!==s.indexOf(t.get('type'))}))),r.render(u),this.rendered=r.getContainer()}if(l){var f=this.rendered.querySelector("input#".concat(o.stylePrefix,"uploadFile"));f&&f.setAttribute('accept',l)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},5821:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(9050),i=n(9283);const o={open:function(){var t=this.container,e=this.editor,n=this.bm,i=this.config,o=i.custom,a=i.appendTo;if((0,r.isFunction)(o.open))return o.open(n.__customData());if(this.firstRender&&!a){var s='views-container',l=e.Panels;(l.getPanel(s)||l.addPanel({id:s})).set('appendContent',t).trigger('change:appendContent'),o||t.appendChild(n.render())}t&&(t.style.display='block')},close:function(){var t=this.container,e=this.config.custom;if((0,r.isFunction)(e.close))return e.close(this.bm.__customData());t&&(t.style.display='none')},run:function(t){var e=t.Blocks;this.config=e.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,i.ut)('div'),this.editor=t,this.bm=e;var n=this.container;e.__behaviour({container:n}),this.config.custom&&e.__trgCustom(),this.open()},stop:function(){this.close()}}},3452:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){var e=t.LayerManager,n=t.Panels,r=e.getConfig();if(!r.appendTo){if(!this.layers){var i='views-container',o=document.createElement('div'),a=n.getPanel(i)||n.addPanel({id:i});r.custom?e.__trgCustom({container:o}):o.appendChild(e.render()),a.set('appendContent',o).trigger('change:appendContent'),this.layers=o}this.layers.style.display='block'}},stop:function(){var t=this.layers;t&&(t.style.display='none')}}},2840:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2316),i=n.n(r)().$;const o={run:function(t,e){if(this.sender=e,!this.$cn){var n=t.getConfig(),r=t.Panels,o='change:appendContent';this.$cn=i('
'),this.$cn2=i('
'),this.$cn.append(this.$cn2);var a=t.DeviceManager;if(a&&n.showDevices){var s=r.addPanel({id:'devices-c'}),l=a.render();s.set('appendContent',l).trigger(o)}var c=t.SelectorManager;this.slm=c;var u=c.getConfig();u.custom?c.__trgCustom({container:this.$cn2.get(0)}):u.appendTo||this.$cn2.append(c.render([]));var f=t.StyleManager;this.sm=f;var h=f.getConfig(),p=h.stylePrefix;this.$header=i("
").concat(t.t('styleManager.empty'),"
")),this.$cn.append(this.$header),h.custom?f.__trgCustom({container:this.$cn2.get(0)}):h.appendTo||this.$cn2.append(f.render());var d='views-container';this.panel=r.getPanel(d),this.panel||(this.panel=r.addPanel({id:d})),this.panel.set('appendContent',this.$cn).trigger(o),this.em=t.getModel(),this.listenTo(this.em,f.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t,e,n,r,i=this.sender,o=this.sm;i&&i.get&&!i.get('active')||!o||(o.getSelected()?(null===(t=this.$cn2)||void 0===t||t.show(),null===(e=this.$header)||void 0===e||e.hide()):(null===(n=this.$cn2)||void 0===n||n.hide(),null===(r=this.$header)||void 0===r||r.show()))},stop:function(){var t,e;null===(t=this.$cn2)||void 0===t||t.hide(),null===(e=this.$header)||void 0===e||e.hide()}}},8644:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2316),i=n.n(r)().$;const o={run:function(t,e){this.sender=e;var n=t.getModel(),r=t.Config.stylePrefix,o=t.TraitManager,a=o.getConfig();if(!a.appendTo){if(!this.$cn){this.$cn=i('
'),this.$cn2=i('
'),this.$cn.append(this.$cn2),this.$header=i('
').append("
").concat(n.t('traitManager.empty'),"
")),this.$cn.append(this.$header),this.$cn2.append("
").concat(n.t('traitManager.label'),"
")),this.$cn2.append(o.render());var s=t.Panels;(s.getPanel('views-container')?s.getPanel('views-container'):s.addPanel({id:'views-container'})).set('appendContent',this.$cn.get(0)).trigger('change:appendContent'),this.target=t.getModel(),this.listenTo(this.target,'component:toggled',this.toggleTm)}this.toggleTm()}},toggleTm:function(){var t=this.sender;t&&t.get&&!t.get('active')||(1===this.target.getSelectedAll().length?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},560:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050);const i={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.getModel(),o=i.get('clipboard'),a=t.getSelected();o&&a&&(t.getSelectedAll().forEach((function(e){var i=e.collection;if(i){var a,s={at:e.index()+1,action:n.action||'paste-component'};if((0,r.contains)(o,e)&&e.get('copyable'))a=i.add(e.clone(),s);else{var l=o.filter((function(t){return t.get('copyable')})).filter((function(n){return t.Components.canMove(e.parent(),n).result}));a=i.add(l.map((function(t){return t.clone()})),s)}(a=(0,r.isArray)(a)?a:[a]).forEach((function(e){return t.trigger('component:paste',e)}))}})),a.emitUpdate())}}},4944:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var r=n(2982),i=n(9050),o='sw-visibility';const a={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanels()),this.panels},preventDrag:function(t){t.abort=1},tglEffects:function(t){var e=this.em,n=t?'on':'off';if(e){var r=e.get('Canvas'),o=r.getBody(),a=r.getToolbarEl();a&&(a.style.display=t?'none':'');var s=o.querySelectorAll(".".concat(this.ppfx,"no-pointer"));(0,i.each)(s,(function(e){return e.style.pointerEvents=t?'all':''})),e[n]('run:tlb-move:before',this.preventDrag)}},run:function(t,e){var n=this;this.sender=e,this.selected=(0,r.Z)(t.getSelectedAll()),t.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=t.Commands.isActive(o)),this.shouldRunSwVisibility&&t.stopCommand(o),t.getModel().stopDefault();var i=this.getPanels(t),a=t.Canvas.getElement(),s=t.getEl(),l=t.Config.stylePrefix;if(!this.helper){var c=document.createElement('span');c.className="".concat(l,"off-prv fa fa-eye-slash"),s.appendChild(c),c.onclick=function(){return n.stopCommand()},this.helper=c}this.helper.style.display='inline-block',i.forEach((function(t){return t.set('visible',!1)}));var u=a.style;u.width='100%',u.height='100%',u.top='0',u.left='0',u.padding='0',u.margin='0',t.refresh(),this.tglEffects(1)},stop:function(t){var e=this.sender,n=void 0===e?{}:e,r=this.selected;n.set&&n.set('active',0);var i=this.getPanels(t);this.shouldRunSwVisibility&&(t.runCommand(o),this.shouldRunSwVisibility=!1),t.getModel().runDefault(),i.forEach((function(t){return t.set('visible',!0)})),t.Canvas.getElement().setAttribute('style',''),r&&t.select(r),delete this.selected,this.helper&&(this.helper.style.display='none'),t.refresh(),this.tglEffects()}}},7538:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(4942);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}const o={run:function(t,e,n){var o=n||{},a=t.Canvas,s=a.getCanvasView(),l=function(t){for(var e=1;e{"use strict";n.r(e),n.d(e,{default:()=>E});var r=n(1002),i=n(4942),o=n(2316),a=n.n(o),s=n(9050),l=n(1163),c=n(9283),u=n(3144),f=n(5671),h=n(9340),p=n(2963),d=n(1120),g=n(6602);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=t.config,n=void 0===e?{}:e;this.em=n.em,this.editor=n.editor}},{key:"handleClick",value:function(t){t.preventDefault(),t.stopPropagation();var e=this.editor,n=this.em,r=e.Canvas.getFrameEl().getBoundingClientRect(),i=r.left,o=r.top,a=m(m({},t),{},{clientX:t.clientX-i,clientY:t.clientY-o});n.trigger('toolbar:run:before'),this.execCommand(a)}},{key:"execCommand",value:function(t){var e={event:t},n=this.model.get('command'),r=this.editor;'function'==typeof n&&n(r,null,e),'string'==typeof n&&r.runCommand(n,e)}},{key:"render",value:function(){var t=this.editor,e=this.$el,n=this.model,r=n.get('id'),i=n.get('label'),o=t.getConfig().stylePrefix;return e.addClass("".concat(o,"toolbar-item")),r&&e.addClass("".concat(o,"toolbar-item__").concat(r)),i&&e.append(i),this}}]),n}(a().View);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var k=function(t){(0,h.Z)(n,t);var e=w(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return(0,f.Z)(this,n),(t=e.call(this,r,i)).config={editor:r.editor||'',em:r.em},t.listenTo(t.collection,'reset',t.render),t}return(0,u.Z)(n)}(g.Z);function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}k.prototype.itemView=b;var O=function(t){(0,h.Z)(n,t);var e=x(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,u.Z)(n,[{key:"defaults",value:function(){return{command:'',attributes:{}}}}]),n}(a().Model);const C=a().Collection.extend({model:O});function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=n.el||this.canvas.getToolsEl(e);return r&&(r.style.display=t?'':'none'),r||{}},showElementOffset:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};P&&this.editor.runCommand('show-offset',{el:t,elPos:e,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(t){this.editor.stopCommand('show-offset',{view:t})},showFixedElementOffset:function(t,e){this.editor.runCommand('show-offset',{el:t,elPos:e,state:'Fixed'})},hideFixedElementOffset:function(t,e){this.editor&&this.editor.stopCommand('show-offset',{state:'Fixed'})},hideHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=0},onClick:function(t){t.stopPropagation(),t.preventDefault();var e=this.em;if(e.get('_cmpDrag'))return e.set('_cmpDrag');var n=T(t.target),r=n.data('model');if(!r)for(var i=n.parent();!r&&i.length&&!(0,c.Mx)(i[0]);)r=i.data('model'),i=i.parent();if(r){if(e.isEditing()&&!r.get('textable')&&r.isChildOf('text'))return;this.select(r,t)}},select:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&(this.editor.select(t,{event:e,useValid:!0}),this.initResize(t))},updateBadge:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.canvas,i=T(t).data('model');if(i&&i.get('badgable')){var o=this.getBadge(n);if(!n.posOnly){var a=this.canvas.getConfig(),s=i.getIcon(),l=a.pStylePrefix||'',c="".concat(l,"badge"),u=a.customBadgeLabel,f="".concat(s?"
").concat(s,"
"):'',"\n
").concat(i.getName(),"
");o.innerHTML=u?u(i):f}var h='px',p=o.style;p.display='block';var d=r.getTargetToElementFixed(t,o,{pos:e}),g=d.top,v=n.leftOff<0?-n.leftOff:0;p.top=g+h,p.left=v+h}},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=''},initResize:function(t){var e,n=this.em,i=this.canvas,o=n?n.get('Editor'):'',a=(n?n.get('Config'):'').stylePrefix||'',c="".concat(a,"resizing"),u=!(0,s.isElement)(t)&&(0,l.isTaggableNode)(t)?t:n.getSelected(),f=u&&u.get('resizable'),h={},p=function(t,e,n){var r=n.docs;r&&r.forEach((function(e){var n=e.body,r=n.className||'';n.className=('add'==t?"".concat(r," ").concat(c):r.replace(c,'')).trim()}))};if(o&&f){var d=(0,s.isElement)(t)?t:u.getEl();h={onStart:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.el,a=r.config,s=r.resizer,c=a.keyHeight,f=a.keyWidth,h=a.currentUnit,d=a.keepAutoHeight,g=a.keepAutoWidth;p('add',0,r),e=n.get('StyleManager').getModelToStyle(u),i.toggleFramesEvents();var v=getComputedStyle(o),m=e.getStyle(),y=m[f];a.autoWidth=g&&'auto'===y,isNaN(parseFloat(y))&&(y=v[f]);var b=m[c];a.autoHeight=d&&'auto'===b,isNaN(parseFloat(b))&&(b=v[c]),s.startDim.w=parseFloat(y),s.startDim.h=parseFloat(b),P=0,h&&(a.unitHeight=(0,l.getUnitFromValue)(b),a.unitWidth=(0,l.getUnitFromValue)(y))},onMove:function(){o.trigger('component:resize')},onEnd:function(t,e){p('remove',0,e),o.trigger('component:resize'),i.toggleFramesEvents(1),P=1},updateTarget:function(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var a=o.store,s=o.selectedHandler,l=o.config,c=l.keyHeight,u=l.keyWidth,f=l.autoHeight,h=l.autoWidth,p=l.unitWidth,d=l.unitHeight,g=['tc','bc'].indexOf(s)>=0,v=['cl','cr'].indexOf(s)>=0,m={},y=a?'':1;if(!g){var b=i.getBody().offsetWidth,w=r.w0&&void 0!==arguments[0]?arguments[0]:{};return this.canvas.getBadgeEl(t.view)},onFrameScroll:function(){this.updateTools()},updateTools:function(){this.updateLocalPos(),this.updateGlobalPos()},isCompSelected:function(t){return t&&'selected'===t.get('status')},updateToolsLocal:function(t){var e=t||this.getElHovered(),n=e.el,r=e.pos,i=e.view,o=e.component;if(n){var a=o.get('hoverable'),s=this.lastHovered!==n,l=s?{}:{posOnly:1};s&&a&&(this.lastHovered=n,this.showHighlighter(i),this.showElementOffset(n,r,{view:i})),this.isCompSelected(o)&&(this.hideHighlighter(i),this.hideElementOffset(i));var c='px',u=this.toggleToolsEl(1,i),f=u.style,h=this.canvas.canvasRectOffset(n,r),p=h.top,d=h.left;this.updateBadge(n,r,_(_({},l),{},{view:i,topOff:p,leftOff:d})),f.top=p+c,f.left=d+c,f.width=r.width+c,f.height=r.height+c,this._trgToolUp('local',{component:o,el:u,top:p,left:d,width:r.width,height:r.height})}else this.lastHovered=0},_upToolbar:(0,s.debounce)((function(){this.updateToolsGlobal({force:1})})),_trgToolUp:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em.trigger('canvas:tools:update',_({type:t},e))},updateToolsGlobal:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getElSelected(),n=e.el,r=e.pos,i=e.component;if(!n)return this.toggleToolsEl(),void(this.lastSelected=0);var o=this.canvas,a=this.lastSelected!==n;(a||t.force)&&(this.lastSelected=n,this.updateToolbar(i));var s='px',l=this.toggleToolsEl(1),c=l.style,u=o.getTargetToElementFixed(n,o.getToolbarEl(),{pos:r}),f=u.canvasOffsetTop,h=u.canvasOffsetLeft;c.top=f+s,c.left=h+s,c.width=r.width+s,c.height=r.height+s,this.updateToolbarPos({top:u.top,left:u.left}),this._trgToolUp('global',{component:i,el:l,top:f,left:h,width:r.width,height:r.height})},updateAttached:(0,s.debounce)((function(){this.updateGlobalPos()})),onContainerChange:(0,s.debounce)((function(){this.em.refreshCanvas()}),150),getElementPos:function(t){return this.canvas.getCanvasView().getElementPos(t)},hideBadge:function(){this.getBadge().style.display='none'},cleanPrevious:function(t){t&&t.set({status:'',state:''})},getContentWindow:function(){return this.canvas.getWindow()},run:function(t){(0,l.hasWin)()&&(this.editor=t&&t.get('Editor'),this.enable())},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((0,l.hasWin)()){var r=this.em,i=this.editor;this.onHovered(),this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(null),this.toggleToolsEl(),i&&i.stopCommand('resize')}}}},8463:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2316),i=n.n(r)().$;const o={startSelectPosition:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.isPointed=!1;var i=this.editorModel.get('Utils'),o=t.ownerDocument.body;i&&!this.sorter&&(this.sorter=new i.Sorter({container:o,placer:this.canvas.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,direction:'a',document:e,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1,scale:function(){return n.em.getZoomDecimal()}})),r.onStart&&(this.sorter.onStart=r.onStart),t&&this.sorter.startSort(t,{container:o})},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement());return{top:t.top-e.top,left:t.left-e.left}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex='after'==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.sorter&&(this.sorter.moved=0,this.sorter.endMove()),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&'after'==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?i(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?i(this.cDim[this.posIndex][5]).parent():i(this.outsideElem),this.posTargetModel=this.posTargetEl.data('model'),this.posTargetCollection=this.posTargetEl.data('model-comp'))},enable:function(){this.startSelectPosition()},nearFloat:function(t,e,n){var r=t||0,i=e||'before',o=n.length,a=0!==o&&'after'==i&&r==o;return 0!==o&&(!a&&!n[r][4]||n[r-1]&&!n[r-1][4]||a&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css('cursor',''),this.$wrapper.unbind()}}},7994:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(4942),i=n(2316),o=n.n(i),a=n(9050),s=n(1163);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var c=o().$;const u={getOffsetMethod:function(t){return'get'+(t||'')+'OffsetViewerEl'},run:function(t,e,n){var i=n||{},o=i.state||'',u=t.getConfig(),f=this.em.getZoomDecimal(),h=i.el||'';if(!u.showOffsets||(0,s.isTextNode)(h)||!u.showOffsetsSelected&&'Fixed'==o)t.stopCommand(this.id,n);else{var p=t.Canvas,d=function(t){for(var e=1;e")).get(0),A=c("
")).get(0),R=v+E+'-el',D="".concat(v+T+'-el'," ").concat(v+T),M="".concat(R," ").concat(v+E);b=c("
")).get(0),w=c("
")).get(0),k=c("
")).get(0),x=c("
")).get(0),O=c("
")).get(0),C=c("
")).get(0),S=c("
")).get(0),_=c("
")).get(0),this['marginT'+o]=b,this['marginB'+o]=w,this['marginL'+o]=k,this['marginR'+o]=x,this['padT'+o]=O,this['padB'+o]=C,this['padL'+o]=S,this['padR'+o]=_,j.appendChild(b),j.appendChild(w),j.appendChild(k),j.appendChild(x),A.appendChild(O),A.appendChild(C),A.appendChild(S),A.appendChild(_),y.appendChild(j),y.appendChild(A),this[m]='1'}var Z='px',L=parseFloat(g.marginLeft.replace(Z,''))*f,N=parseFloat(g.marginRight.replace(Z,''))*f,I=parseFloat(g.marginTop.replace(Z,''))*f,F=parseFloat(g.marginBottom.replace(Z,''))*f,V=b.style,B=w.style,H=k.style,z=x.style,U=O.style,W=C.style,$=S.style,q=_.style,G=parseFloat(d.left),K=parseFloat(g.width)*f+Z;V.height=I+Z,V.width=K,V.top=d.top-I+Z,V.left=G+Z,B.height=F+Z,B.width=K,B.top=d.top+d.height+Z,B.left=G+Z;var Y=d.height+I+F+Z,X=d.top-I+Z;H.height=Y,H.width=L+Z,H.top=X,H.left=G-L+Z,z.height=Y,z.width=N+Z,z.top=X,z.left=G+d.width+Z;var J=parseFloat(g.paddingTop)*f;U.height=J+Z;var Q=parseFloat(g.paddingBottom)*f;W.height=Q+Z;var tt=d.height-Q-J+Z,et=d.top+J+Z;$.height=tt,$.width=parseFloat(g.paddingLeft)*f+Z,$.top=et;var nt=parseFloat(g.paddingRight)*f;q.height=tt,q.width=nt+Z,q.top=et}},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n||{},i=r.state||'',o=this.getOffsetMethod(i),a=t.Canvas,s=a[o](n.view);s.style.opacity=0}}},8352:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050);const i={init:function(){(0,r.bindAll)(this,'_onFramesChange')},run:function(t){this.toggleVis(t)},stop:function(t){this.toggleVis(t,0)},toggleVis:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t.Commands.isActive('preview')){var r=t.Canvas,i=n?'on':'off';r.getFrames().forEach((function(t){return e._upFrame(t,n)})),r.getModel()[i]('change:frames',this._onFramesChange)}},_onFramesChange:function(t,e){var n=this;e.forEach((function(t){return t.once('loaded',(function(){return n._upFrame(t,!0)}))}))},_upFrame:function(t,e){var n=e?'add':'remove';t.view.getBody().classList[n]("".concat(this.ppfx,"dashed"))}}},9304:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(4942),i=n(2982),o=n(9050),a=n(1163);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.all,r=e.onResult,i=e.reset,o=this.storageKey,s={action:'load'},l=n||this.getAll(),c=t[o];if('string'==typeof c)try{c=JSON.parse(c)}catch(t){this.__logWarn('Data parsing failed',{input:c})}return i&&c&&l.reset(null,s),r?c&&r(c,s):c&&(0,a.isDef)(c.length)&&l.reset(c,s),c},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all;return e&&e.reset(null,t),this},__getConfig:function(t){var e=this.config||{};return t?e[t]:e},getAll:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.all?t.array?(0,i.Z)(this.all.models):this.all:[]},getAllMap:function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})},__initConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=(0,a.deepMerge)(t,e),this.em=this.config.em,this.cls=[]},__initListen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all,n=this.em,r=this.events;e&&n&&e.on('add',(function(t,e,i){return n.trigger(r.add,t,i)})).on('remove',(function(t,e,i){return n.trigger(r.remove,t,i)})).on('change',(function(t,e){return n.trigger(r.update,t,t.changedAttributes(),e)})).on('all',this.__catchAllEvent,this),this.cls=[e].concat(t.collections||[]),(t.propagate||[]).forEach((function(t){var r=t.entity,i=t.event;r.on('all',(function(t,r,o,a){var s=l({event:t},a||o);[n,e].map((function(t){return t.trigger(i,r,s)}))}))}))},__remove:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=(0,o.isString)(t)?this.get(t):t,a=function(){return i&&e.all.remove(i,n),i};return!n.silent&&r&&r.trigger(this.events.removeBefore,i,a,n),!n.abort&&a()},__catchAllEvent:function(t,e,n,r){var i=this.em,o=this.events,a=r||n;i&&o.all&&i.trigger(o.all,{event:t,model:e,options:a}),this.__onAllEvent()},__appendTo:function(){var t=this.getConfig().appendTo;if(t){var e=(0,o.isElement)(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}},__onAllEvent:function(){},__logWarn:function(t,e){this.em.logWarning("[".concat(this.name,"]: ").concat(t),e)},_createId:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,n=this.getAll(),r=n.length+e,i=this.getAllMap();do{t=(0,a.createId)(r)}while(i[t]);return t},__listenAdd:function(t,e){var n=this;t.on('add',(function(t,r,i){return n.em.trigger(e,t,i)}))},__listenRemove:function(t,e){var n=this;t.on('remove',(function(t,r,i){return n.em.trigger(e,t,i)}))},__listenUpdate:function(t,e){var n=this;t.on('change',(function(t,r){return n.em.trigger(e,t,t.changedAttributes(),r)}))},__destroy:function(){var t;this.cls.forEach((function(t){t.stopListening(),t.reset()})),this.em=0,this.config=0,null===(t=this.view)||void 0===t||t.remove(),this.view=0}}},672:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>A});var r=n(2982),i=n(5671),o=n(3144),a=n(7326),s=n(9340),l=n(2963),c=n(1120),u=n(4942),f=n(9050),h=n(1163),p=n(9714),d=n(966),g=n(5963);const v={stylePrefix:'css-',rules:[]};var m=n(2316),y=n(9524),b=n(8795);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};this.config=t||{},this.opt=e,this.em=e.em,this.ensureSelectors(),this.on('change',this.__onChange)}},{key:"__onChange",value:function(t,e){var n=this.em,r=this.changedAttributes();!(0,h.isEmptyObj)(r)&&n&&n.changesUp(e)}},{key:"clone",value:function(){var t=k({},this.opt),e=k({},this.attributes);return e.selectors=this.get('selectors').map((function(t){return t.clone()})),new this.constructor(e,t)}},{key:"ensureSelectors",value:function(t,e,n){var i=this.em,o=i&&i.get('SelectorManager'),a=[this,'change:selectors',this.ensureSelectors],s=this.getSelectors();if(this.stopListening.apply(this,a),s.models&&(s=(0,r.Z)(s.models)),s=(0,f.isString)(s)?[s]:s,Array.isArray(s)){var l=s.filter((function(t){return t})).map((function(t){return o?o.add(t):t}));s=new d.Z(l)}this.set('selectors',s,n),this.listenTo.apply(this,a)}},{key:"getAtRule",value:function(){var t=this.get('atRuleType'),e=this.get('mediaText'),n=t?"@".concat(t):e?'@media':'';return n+(e&&n?" ".concat(e):'')}},{key:"selectorsToString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.get('state'),r=this.get('selectorsAdd'),i={escape:function(t){return O&&O.escape?O.escape(t):t}},o=this.get('selectors').getFullString(0,i),a=n&&!t.skipState?":".concat(n):'';return o&&e.push("".concat(o).concat(a)),r&&!t.skipAdd&&e.push(r),e.join(', ')}},{key:"getDeclaration",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e='',n=this.attributes.important,r=this.selectorsToString(t),i=this.styleToString(k({important:n},t)),o=this.get('singleAtRule');return(r||o)&&(i||t.allowEmpty)&&(e=o?i:"".concat(r,"{").concat(i,"}")),e}},{key:"getDevice",value:function(){var t=this.em,e=this.attributes,n=e.atRuleType,r=e.mediaText,i=(null==t?void 0:t.get('DeviceManager').getDevices())||[],o=i.filter((function(t){return''===t.getWidthMedia()}))[0];return'media'===n&&r?i.filter((function(t){return t.getWidthMedia()===(0,b.U)(r)}))[0]||null:o||null}},{key:"getState",value:function(){var t=this.em,e=this.get('state');return(t.get('SelectorManager').getStates()||[]).filter((function(t){return t.getName()===e}))[0]||null}},{key:"getComponent",value:function(){var t,e=this.getSelectors(),n=1==e.length&&e.at(0),r=n&&n.isId()&&n.get('name');return r&&(null===(t=this.em)||void 0===t?void 0:t.get('DomComponents').getById(r))||null}},{key:"toCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e='',n=this.getAtRule(),r=this.getDeclaration(t);return(r||t.allowEmpty)&&(e=r),n&&e&&(e="".concat(n,"{").concat(e,"}")),e}},{key:"toJSON",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n3&&void 0!==arguments[3]?arguments[3]:{},i=e||'',o=n||'',a=r.selectorsAdd||'',s=r.atRuleType||'',l=(0,f.isArray)(t)||t.models?t.models||t:[t];o&&!s&&(s='media');var c=l.map((function(t){return t.getFullName()})),u=this.get('selectors').map((function(t){return t.getFullName()})),h=c.slice().sort(),p=u.slice().sort();return!(c.length!==u.length||!h.every((function(t,e){return t===p[e]})))&&(this.get('state')===i&&this.get('mediaText')===o&&this.get('selectorsAdd')===a&&this.get('atRuleType')===s)}}]),n}(y.Z);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.Z)(t);if(e){var i=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.Z)(this,n)}}var _=function(t){(0,s.Z)(n,t);var e=S(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"initialize",value:function(t,e){var n=this;e&&e.em&&(this.editor=e.em),setTimeout((function(){n.on('remove',n.onRemove),n.on('add',n.onAdd)}))}},{key:"toJSON",value:function(t){return m.Collection.prototype.toJSON.call(this,t).filter((function(t){return t.style&&!t.shallow}))}},{key:"onAdd",value:function(t,e,n){t.ensureSelectors(t,e,n)}},{key:"onRemove",value:function(t){var e=this.editor;e.stopListening(t),e.get('UndoManager').remove(t)}},{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return'string'==typeof t&&(t=this.editor.get('Parser').parseCss(t)),e.em=this.editor,m.Collection.prototype.add.apply(this,[t,e])}}]),n}(m.Collection);_.prototype.model=C;var P=n(4868);function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=e||'',a=n||'',s=E({},r),l=this.get(t,o,a,s);return l&&l.config&&!l.config.singleAtRule||(s.state=o,s.mediaText=a,s.selectors=[],a&&(s.atRuleType='media'),(l=new C(s,this.c)).get('selectors').add(t,i),this.rules.add(l,i)),l}},{key:"get",value:function(t,e,n,r){var i=t;if((0,f.isString)(t)){var o=this.em.get('SelectorManager'),a=t.split(',')[0].trim(),s=this.em.get('Parser').parserCss.checkNode({selectors:a})[0];i=o.get(s.selectors)}return this.rules.find((function(t){return t.compare(i,e,n,r)}))||null}},{key:"getAll",value:function(){return this.rules}},{key:"addCollection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[];(0,f.isString)(t)&&(t=this.em.get('Parser').parseCss(t));for(var i=t instanceof Array?t:[t],o=0,a=i.length;o2&&void 0!==arguments[2]?arguments[2]:{},r=n.atRuleType,i=n.atRuleParams,o=this.em.get('Parser').parserCss.checkNode({selectors:t,style:e})[0],a=o.state,s=o.selectorsAdd,l=this.em.get('SelectorManager'),c=l.add(o.selectors),u=this.add(c,a,i,{selectorsAdd:s,atRule:r});return u.setStyle(e,n),u}},{key:"getRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em.get('SelectorManager'),r=this.em.get('Parser').parserCss.checkNode({selectors:t})[0],i=n.get(r.selectors),o=r.state,a=r.selectorsAdd,s=e.atRuleType,l=e.atRuleParams;return i&&this.get(i,o,l,{selectorsAdd:a,atRule:s})}},{key:"getRules",value:function(t){var e=this.getAll();if(!t)return(0,r.Z)(e.models);var n={sort:!0},i=(0,f.isString)(t)?t.split(',').map((function(t){return t.trim()})):t;return e.filter((function(t){return i.indexOf(t.getSelectors().getFullString(null,n))>=0}))}},{key:"setIdRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.addOpts,i=void 0===r?{}:r,o=n.mediaText,a=n.state||'',s=(0,f.isUndefined)(o)?this.em.getCurrentMedia():o,l=this.em.get('SelectorManager'),c=l.add({name:t,type:g.Z.TYPE_ID},i),u=this.add(c,a,s,{},i);return u.setStyle(e,E(E({},n),i)),u}},{key:"getIdRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.mediaText,r=e.state||'',i=(0,f.isUndefined)(n)?this.em.getCurrentMedia():n,o=this.em.get('SelectorManager').get(t,g.Z.TYPE_ID);return o&&this.get(o,r,i)}},{key:"setClassRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.state||'',i=n.mediaText||this.em.getCurrentMedia(),o=this.em.get('SelectorManager'),a=o.add({name:t,type:g.Z.TYPE_CLASS}),s=this.add(a,r,i);return s.setStyle(e,n),s}},{key:"getClassRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state||'',r=e.mediaText||this.em.getCurrentMedia(),i=this.em.get('SelectorManager').get(t,g.Z.TYPE_CLASS);return i&&this.get(i,n,r)}},{key:"remove",value:function(t,e){var n=(0,f.isString)(t)?this.getRules(t):t,r=this.getAll().remove(n,e);return(0,f.isArray)(r)?r:[r]}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().reset(null,t),this}},{key:"getComponentRules",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state,r=e.mediaText,i=e.current;i&&(n=this.em.get('state')||'',r=this.em.getCurrentMedia());var o=t.getId(),a=this.getAll().filter((function(t){if(((0,f.isUndefined)(n)||t.get('state')===n)&&((0,f.isUndefined)(r)||t.get('mediaText')===r))return t.getSelectorsString()==="#".concat(o)}));return a}},{key:"render",value:function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new P.Z({collection:this.rules,config:this.c}),this.rulesView.render().el}},{key:"destroy",value:function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove(),[this.em,this.rules,this.rulesView].forEach((function(t){return null})),this.c={}}}]),n}(p.Z)},4868:(t,e,n)=>{"use strict";n.d(e,{Z:()=>y});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(9050),u=n(2316),f=n(9283);function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var p=function(t){(0,a.Z)(n,t);var e=h(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"tagName",value:function(){return'style'}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t.config||{};var e=this.model;this.listenTo(e,'change',this.render),this.listenTo(e,'destroy remove',this.remove),this.listenTo(e.get('selectors'),'change',this.render)}},{key:"render",value:function(){var t=this.model,e=this.el,n=t.get('important');return e.innerHTML=t.toCSS({important:n}),this}}]),n}(u.View);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var g=function(t){(0,a.Z)(n,t);var e=d(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"_createElement",value:function(){return document.createTextNode('')}},{key:"render",value:function(){var t=this.model,e=t.get('important');return this.el.textContent=t.getDeclaration({important:e}),this}}]),n}(p);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var m=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):'')},y=function(t){(0,a.Z)(n,t);var e=v(n);function n(t){var i;return(0,r.Z)(this,n),i=e.call(this,t),(0,c.bindAll)((0,o.Z)(i),'sortRules'),i}return(0,i.Z)(n,[{key:"initialize",value:function(t){var e=t.config||{};this.atRules={},this.config=e,this.em=e.em,this.pfx=e.stylePrefix||'',this.className=this.pfx+'rules';var n=this.collection;this.listenTo(n,'add',this.addTo),this.listenTo(n,'reset',this.render)}},{key:"addTo",value:function(t){this.addToCollection(t)}},{key:"addToCollection",value:function(t,e){if(this.renderStarted){var n,r,i=e||null,o={model:t,config:this.config};if('keyframes'===t.get('atRuleType')){var a=t.getAtRule(),s=this.atRules[a];if(!s){var l=document.createElement('style');s=document.createTextNode(''),l.appendChild(document.createTextNode("".concat(a,"{"))),l.appendChild(s),l.appendChild(document.createTextNode('}')),this.atRules[a]=s,n=l}r=new g(o),s.appendData(r.render().el.textContent)}else n=(r=new p(o)).render().el;var c=this.className,u=t.get('mediaText'),f=m(c),h=f;if(u&&(h=m(c,this.getMediaWidth(u))),n){var d,v=i||this.el;try{d=v.querySelector("#".concat(h))}catch(t){}d||(d=v.querySelector("#".concat(f))),d.appendChild(n)}return n}}},{key:"getMediaWidth",value:function(t){return t&&t.replace("(".concat(this.em.getConfig().mediaCondition,": "),'').replace(')','')}},{key:"sortRules",value:function(t,e){var n=-1!==(this.em.getConfig().mediaCondition||'').indexOf('min-width');return n?(n?t:e)-(n?e:t):0}},{key:"render",value:function(){var t=this;this.renderStarted=1,this.atRules={};var e=this.em,n=this.$el,r=this.className,i=this.collection,o=document.createDocumentFragment();n.empty();var a=e.get('DeviceManager').getAll().pluck('priority').sort(this.sortRules);return a.every((function(t){return t}))&&a.unshift(0),a.forEach((function(t){return o.appendChild((0,f.ut)('div',{id:m(r,t)}))})),i.each((function(e){return t.addToCollection(e,o)})),n.append(o),n.attr('class',r),this}}]),n}(u.View)},2004:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>L,evAdd:()=>A,evAddBefore:()=>R,evAll:()=>_,evPfx:()=>P,evRemove:()=>D,evRemoveBefore:()=>M,evSelect:()=>T,evSelectBefore:()=>E,evUpdate:()=>j});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(4942),u=n(9050),f=n(9714);const h={default:null,devices:[{id:'desktop',name:'Desktop',width:''},{id:'tablet',name:'Tablet',width:'770px',widthMedia:'992px'},{id:'mobileLandscape',name:'Mobile landscape',width:'568px',widthMedia:'768px'},{id:'mobilePortrait',name:'Mobile portrait',width:'320px',widthMedia:'480px'}]};var p=n(2316);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var g=function(t){(0,a.Z)(n,t);var e=d(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"defaults",value:function(){return{name:'',width:null,height:'',widthMedia:null,priority:null}}},{key:"initialize",value:function(){var t=this;null===this.get('widthMedia')&&this.set('widthMedia',this.get('width')),null===this.get('width')&&this.set('width',this.get('widthMedia')),!this.get('priority')&&this.set('priority',parseFloat(this.get('widthMedia'))||0);['width','height','widthMedia'].forEach((function(e){return t.checkUnit(e)}))}},{key:"checkUnit",value:function(t){var e=this.get(t)||'';(parseFloat(e)||0).toString()===e.toString()&&this.set(t,"".concat(e,"px"))}},{key:"getName",value:function(){return this.get('name')||this.get('id')}},{key:"getWidthMedia",value:function(){return this.get('widthMedia')||''}}]),n}(p.Model);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var m=function(t){(0,a.Z)(n,t);var e=v(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n)}(p.Collection);m.prototype.model=g;var y,b=n(168),w=n(7539);function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var x=function(t){(0,a.Z)(n,t);var e=k(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"template",value:function(t){var e=t.ppfx,n=t.label;return(0,w.Z)(y||(y=(0,b.Z)(["\n
","
\n
\n \n \n \n
\n
\n
\n
\n \n "])),e,n,e,e,e,e,e,e,e)}},{key:"events",value:function(){return{change:'updateDevice'}}},{key:"initialize",value:function(t){this.config=t.config||{},this.em=this.config.em,this.ppfx=this.config.pStylePrefix||'',this.events['click .'+this.ppfx+'add-trasp']=this.startAdd,this.listenTo(this.em,'change:device',this.updateSelect),this.delegateEvents()}},{key:"startAdd",value:function(){}},{key:"updateDevice",value:function(){var t=this.em;if(t){var e=this.devicesEl,n=e?e.val():'';t.set('device',n)}}},{key:"updateSelect",value:function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel(),r=n?n.get('id'):'';e.val(r)}}},{key:"getOptions",value:function(){var t=this.collection,e=this.em,n='';return t.each((function(t){var r=t.attributes,i=r.name,o=r.id,a=e&&e.t&&e.t("deviceManager.devices.".concat(o))||i;n+="")})),n}},{key:"render",value:function(){var t=this.em,e=this.ppfx,n=this.$el,r=this.el,i=t&&t.t&&t.t('deviceManager.device');return n.html(this.template({ppfx:e,label:i})),this.devicesEl=n.find(".".concat(e,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(t.get('device')),r.className="".concat(e,"devices-c"),this}}]),n}(p.View);function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.c=C(C({},h),e);var n=this.c.em;return this.devices=new m,this.c.devices.forEach((function(e){return t.add(e)})),this.em=n,this.all=this.devices,this.select(this.c.default||this.devices.at(0)),this.__initListen(),n.on(Z,this._onSelect,this),this}},{key:"_onSelect",value:function(t,e,n){var r=this.em,i=this.events,o=t.previous('device'),a=this.get(e),s=i.select;r.trigger(s,a,this.get(o)),this.__catchAllEvent(s,a,n)}},{key:"add",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n;if((0,u.isString)(t)){var i=n;e=C(C({},r=arguments[2]||{}),{},{id:t,name:r.name||t,width:i})}else e=t;return e.id||(e.id=e.name||this._createId()),this.devices.add(e,r)}},{key:"get",value:function(t){return this.getAll().filter((function(e){return e.get('name')===t}))[0]||this.devices.get(t)||null}},{key:"remove",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__remove(t,e)}},{key:"getDevices",value:function(){return this.devices.models}},{key:"select",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,u.isString)(t)?this.get(t):t;return n&&this.em.set('device',n.get('id'),e),this}},{key:"getSelected",value:function(){return this.get(this.em.get('device'))}},{key:"getAll",value:function(){return this.devices}},{key:"render",value:function(){var t;return null===(t=this.view)||void 0===t||t.remove(),this.view=new x({collection:this.devices,config:this.c}),this.view.render().el}},{key:"destroy",value:function(){var t;this.devices.stopListening(),this.devices.reset(),null===(t=this.view)||void 0===t||t.remove(),[this.devices,this.view].forEach((function(t){return null})),this.c={}}}]),n}(f.Z)},9138:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>N,OA:()=>A,GN:()=>Z,xH:()=>L});var r=n(1002),i=n(2982),o=n(885),a=n(4942),s=n(5671),l=n(3144),c=n(1752),u=n(9340),f=n(2963),h=n(1120),p=n(9050),d=n(1163),g=n(9524),v=n(2316),m=n(8431),y=n(5963),b=n(966);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},n=e.locale,r=void 0===n||n,i=this.getId(),o=this.get('label')||this.getName();return r&&(null===(t=this.em)||void 0===t?void 0:t.t("traitManager.traits.labels.".concat(i)))||o}},{key:"getValue",value:function(){return this.getTargetValue()}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};e.partial&&(n.avoidStore=!0),this.setTargetValue(t,n),!1===e.partial&&(this.setTargetValue(''),this.setTargetValue(t))}},{key:"props",value:function(){return this.attributes}},{key:"targetUpdated",value:function(){var t,e=this.getTargetValue();this.set({value:e},{fromTarget:1}),null===(t=this.em)||void 0===t||t.trigger('trait:update',{trait:this,component:this.target})}},{key:"getTargetValue",value:function(){var t,e=this.get('name'),n=this.target;return t=this.get('changeProp')?n.get(e):n.getAttributes()[e],(0,p.isUndefined)(t)?'':t}},{key:"setTargetValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=this.get('name');if(!(0,p.isUndefined)(t)){var i=t;if('false'===t?i=!1:'true'===t&&(i=!0),this.get('changeProp'))n.set(r,i,e);else{var o=k({},n.get('attributes'));o[r]=i,n.set('attributes',o,e)}}}},{key:"setValueFromInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={value:t};this.set(r,k(k({},n),{},{avoidStore:1})),e&&(this.set('value','',n),this.set(r,n))}},{key:"getInitValue",value:function(){var t,e=this.target,n=this.get('name');if(e){var r=e.get('attributes');t=this.get('changeProp')?e.get(n):r[n]}return t||this.get('value')||this.get('default')}}]),n}(v.Model);O.prototype.defaults={type:'text',label:'',name:'',min:'',max:'',unit:'',step:1,value:'',target:'',default:'',placeholder:'',changeProp:0,options:[]};function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var S=function(t){(0,u.Z)(n,t);var e=C(n);function n(){return(0,s.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em,this.listenTo(this,'add',this.handleAdd),this.listenTo(this,'reset',this.handleReset)}},{key:"handleReset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels,r=void 0===n?[]:n;r.forEach((function(t){return t.trigger('remove')}))}},{key:"handleAdd",value:function(t){t.em=this.em;var e=this.target;e&&(t.target=e)}},{key:"setTarget",value:function(t){this.target=t}},{key:"add",value:function(t,e){var n=this.em;if((0,p.isString)(t)||(0,p.isArray)(t)){var r=n&&n.get&&n.get('TraitManager'),i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{build:function(e){var n=[];'string'==typeof e&&(e=[e]);for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,p.bindAll)(this,'__upSymbProps','__upSymbCls','__upSymbComps');var i=r.em,o=this.parent(),a=o&&o.attributes,s=this.get('propagate');if(s&&this.set('propagate',(0,p.isArray)(s)?s:[s]),a&&a.propagate&&!s){var l={},c=a.propagate;c.forEach((function(t){return l[t]=o.get(t)})),l.propagate=c,this.set(P(P({},l),e))}if(r&&r.config&&r.config.voidElements.indexOf(this.get('tagName'))>=0&&this.set('void',!0),r.em=i,this.opt=r,this.em=i,this.frame=r.frame,this.config=r.config||{},this.set('attributes',P(P({},(0,p.result)(this,'defaults').attributes||{}),this.get('attributes')||{})),this.ccid=n.createId(this,r),this.initClasses(),this.initTraits(),this.initComponents(),this.initToolbar(),this.initScriptProps(),this.listenTo(this,'change:script',this.scriptUpdated),this.listenTo(this,'change:tagName',this.tagUpdated),this.listenTo(this,'change:attributes',this.attrUpdated),this.listenTo(this,'change:attributes:id',this._idUpdated),this.on('change:toolbar',this.__emitUpdateTlb),this.on('change',this.__onChange),this.on(L,this.__propToParent),this.set('status',''),this.views=[],['classes','traits','components'].forEach((function(e){var n="add remove ".concat('components'!==e?'change':'');t.listenTo(t.get(e),n.trim(),(function(){for(var n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=e&&e.get('UndoManager'),r=this.components();n&&!this.__hasUm&&(n.add(r),n.add(this.getSelectors()),this.__hasUm=1),t.recursive&&r.map((function(e){return e.__postAdd(t)}))}},{key:"__postRemove",value:function(){var t=this.em,e=t&&t.get('UndoManager');e&&(e.remove(this.components()),e.remove(this.getSelectors()),delete this.__hasUm)}},{key:"__onChange",value:function(t,e){var n=this,r=this.changedAttributes();(0,p.keys)(r).forEach((function(t){return n.emitUpdate(t)})),['status','open','toolbar','traits'].forEach((function(t){return delete r[t]})),(0,d.isEmptyObj)(r)||(this.__changesUp(e),this.__propSelfToParent({component:this,changed:r,options:e}))}},{key:"__changesUp",value:function(t){var e=this.em;[this.frame,e].forEach((function(e){return e&&e.changesUp(t)}))}},{key:"__propSelfToParent",value:function(t){this.trigger(Z,t),this.__propToParent(t)}},{key:"__propToParent",value:function(t){var e=this.parent();e&&e.trigger(L,t)}},{key:"__emitUpdateTlb",value:function(){this.emitUpdate('toolbar')}},{key:"is",value:function(t){return!(this.get('type')!=t)}},{key:"props",value:function(){return this.attributes}},{key:"index",value:function(){var t=this.collection;return t?t.indexOf(this):0}},{key:"setDragMode",value:function(t){return this.set('dmode',t)}},{key:"find",value:function(t){var e=[],n=this.view.$el.find(t);return n.each((function(t){var r=n.eq(t).data('model');r&&e.push(r)})),e}},{key:"findType",value:function(t){var e=[];return function n(r){return r.forEach((function(r){r.is(t)&&e.push(r),n(r.components())}))}(this.components()),e}},{key:"closest",value:function(t){var e=this.view.$el.closest(t);return e.length&&e.data('model')}},{key:"closestType",value:function(t){for(var e=this.parent();e&&!e.is(t);)e=e.parent();return e}},{key:"contains",value:function(t){var e=!1;if(!t)return e;var n=function n(r){!e&&r.forEach((function(r){r===t&&(e=!0),!e&&n(r.components())}))};return n(this.components()),e}},{key:"tagUpdated",value:function(){this.trigger('rerender')}},{key:"replaceWith",value:function(t){var e=this.collection,n=e.indexOf(this);return e.remove(this),e.add(t,{at:n})}},{key:"attrUpdated",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.get('attributes'),o=i.class;o&&this.setClass(o),delete i.class;var a=i.style;a&&this.setStyle(a),delete i.style;var s=P({},this.previous('attributes')),l=(0,d.shallowDiff)(s,this.get('attributes'));(0,p.keys)(l).forEach((function(t){return n.trigger("change:attributes:".concat(t),n,l[t],r)}))}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.set('attributes',P({},t),e),this}},{key:"addAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.setAttributes(P(P({},this.getAttributes({noClass:1})),t),e)}},{key:"removeAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(t)?t:[t],r=this.getAttributes();return n.map((function(t){return delete r[t]})),this.setAttributes(r,e)}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=(0,p.isString)(t)?t:'',o=i?e:t;if(r&&r.getConfig().avoidInlineStyle&&!o.inline){var a=r.get('state'),s=r.get('CssComposer'),l=s.getIdRule(this.getId(),P({state:a},o));if(this.rule=l,l)return l.getStyle(i)}return(0,c.Z)((0,h.Z)(n.prototype),"getStyle",this).call(this,i)}},{key:"setStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,o=this.opt;if(i&&i.getConfig().avoidInlineStyle&&!o.temporary&&!r.inline){var a=this.get('style')||{};e=P(P({},e=(0,p.isString)(e)?this.parseStyle(e):e),a);var s=i.get('state'),l=i.get('CssComposer'),u=this.getStyle(r);this.rule=l.setIdRule(this.getId(),e,P(P({},r),{},{state:s}));var f=(0,d.shallowDiff)(u,e);this.set('style','',{silent:1}),(0,p.keys)(f).forEach((function(e){return t.trigger("change:style:".concat(e))}))}else e=(0,c.Z)((0,h.Z)(n.prototype),"setStyle",this).apply(this,arguments);return e}},{key:"getAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=[],i=P({},this.get('attributes')),o=n&&n.get('SelectorManager'),a=this.getId();if(e.noClass||(this.get('classes').forEach((function(t){return r.push((0,p.isString)(t)?t:t.get('name'))})),r.length&&(i.class=r.join(' '))),!e.noStyle){var s=this.get('style');(0,d.isObject)(s)&&!(0,d.isEmptyObj)(s)&&(i.style=this.styleToString({inline:1}))}(0,p.has)(i,'id')||(j(n)?t=o&&o.get(a,o.Selector.TYPE_ID):(0,p.isEmpty)(this.getStyle())||(t=1),(this.__getSymbol()||this.__getSymbols())&&(t=1),t&&(i.id=a));return i}},{key:"addClass",value:function(t){var e=this.em.get('SelectorManager').addClass(t);return this.get('classes').add(e)}},{key:"setClass",value:function(t){return this.get('classes').reset(),this.addClass(t)}},{key:"removeClass",value:function(t){var e=[];t=(0,p.isArray)(t)?t:[t];var n=this.get('classes'),r=y.Z.TYPE_CLASS;return t.forEach((function(t){t.split(' ').forEach((function(t){var i=n.where({name:t,type:r})[0];i&&e.push(n.remove(i))}))})),e}},{key:"getClasses",value:function(){var t=this.getAttributes().class;return t?t.split(' '):[]}},{key:"__logSymbol",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.__getSymbol(),i=this.__getSymbols();(r||i)&&this.em.log(t,{model:this,toUp:e,context:'symbols',opts:n})}},{key:"__initSymb",value:function(){this.__symbReady||(this.on('change',this.__upSymbProps),this.__symbReady=1)}},{key:"__isSymbol",value:function(){return(0,p.isArray)(this.get(R))}},{key:"__isSymbolOrInst",value:function(){return!(!this.__isSymbol()&&!this.get(D))}},{key:"__isSymbolTop",value:function(){var t=this.parent();return this.__isSymbolOrInst()&&(!t||t&&!t.__isSymbol()&&!t.__getSymbol())}},{key:"__isSymbolNested",value:function(){if(!this.__isSymbolOrInst()||this.__isSymbolTop())return!1;var t=(this.__isSymbol()?this:this.__getSymbol()).__getSymbTop(),e=this.__getSymbTop();return(e.__isSymbol()?e:e.__getSymbol())!==t}},{key:"__getAllById",value:function(){var t=this.em;return t?t.get('DomComponents').allById():{}}},{key:"__getSymbol",value:function(){var t=this.get(D);if(t&&(0,p.isString)(t)){var e=this.__getAllById()[t];e?(t=e,this.set(D,e)):t=0}return t}},{key:"__getSymbols",value:function(){var t=this,e=this.get(R);return e&&(0,p.isArray)(e)&&(e.forEach((function(n,r){n&&(0,p.isString)(n)&&(e[r]=t.__getAllById()[n])})),e=e.filter((function(t){return t&&!(0,p.isString)(t)}))),e}},{key:"__isSymbOvrd",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=this.get(M),n=t.split(':'),r=(0,o.Z)(n,1),i=r[0],a=t!==i?[t,i]:[t];return!0===e||(0,p.isArray)(e)&&a.some((function(t){return e.indexOf(t)>=0}))}},{key:"__getSymbToUp",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[],r=this.em,o=e.changed,a=r&&r.config.symbols;if(e.fromInstance||e.noPropagate||e.fromUndo||!a||o&&this.__isSymbOvrd(o))return n;var s=this.__getSymbols()||[],l=this.__getSymbol(),c=l?[l].concat((0,i.Z)(l.__getSymbols()||[])):s;return n=c.filter((function(e){return e!==t})).filter((function(t){return!(o&&t.__isSymbOvrd(o))}))}},{key:"__getSymbTop",value:function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e}},{key:"__upSymbProps",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.changedAttributes(),i=r.attributes||{};if(delete r.status,delete r.open,delete r[R],delete r[D],delete r[M],delete r.attributes,delete i.id,(0,d.isEmptyObj)(i)||(r.attributes=i),!(0,d.isEmptyObj)(r)){var o=this.__getSymbToUp(n);(0,p.keys)(r).map((function(t){e.__isSymbOvrd(t)&&delete r[t]})),this.__logSymbol('props',o,{opts:n,changed:r}),o.forEach((function(t){var i=P({},r);(0,p.keys)(i).map((function(e){t.__isSymbOvrd(e)&&delete i[e]})),t.set(i,P({fromInstance:e},n))}))}}},{key:"__upSymbCls",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.__getSymbToUp(r);this.__logSymbol('classes',i,{opts:r}),i.forEach((function(t){t.set('classes',n.get('classes'),{fromInstance:n})})),this.__changesUp(r)}},{key:"__upSymbComps",value:function(t,e,n){var r=this,o=n||e||{},a={fromInstance:o.fromInstance,fromUndo:o.fromUndo},s=t.opt.temporary;if(n)if(n.add){var l=[],c=!!this.__getSymbols(),u=this.__getSymbToUp(P(P({},a),{},{changed:'components:add'}));if(u.length){var f=t.__getSymbol();l=(f?f.__getSymbols():t.__getSymbols())||[],(l=(0,i.Z)(l)).push(f||t)}!s&&this.__logSymbol('add',u,{opts:n,addedInstances:l.map((function(t){return t.cid})),added:t.cid}),u.forEach((function(e){var i=e.__getSymbTop(),o=l.filter((function(t){var e=t.__getSymbTop({prev:1});return i&&e&&e===i}))[0]||t.clone({symbol:1,symbolInv:c});e.append(o,P({fromInstance:r},n))}))}else{var h=t.__getSymbol();if(h&&!n.temporary&&h.set(R,h.__getSymbols().filter((function(e){return e!==t}))),!t.__isSymbolTop()){var p='components:remove',d=n.index,g=t.parent(),v=P({fromInstance:t},n),m=t.__isSymbolNested(),y=function(t){var e=t.parent();e&&!e.__isSymbOvrd(p)&&t.remove(v)},b=g.__isSymbOvrd(p)?[]:t.__getSymbToUp(a);m&&(b=g.__getSymbToUp(P(P({},a),{},{changed:p})),y=function(t){var e=t.components().at(d);e&&e.remove(P({fromInstance:g},v))}),!s&&this.__logSymbol('remove',b,{opts:n,removed:t.cid,isSymbNested:m}),b.forEach(y)}}else{var w=this.__getSymbToUp(P(P({},a),{},{changed:'components:reset'}));this.__logSymbol('reset',w,{components:t.models}),w.forEach((function(n){var i=t.models.map((function(t){return t.clone({symbol:1})}));n.components().reset(i,P({fromInstance:r},e))}))}this.__changesUp(o)}},{key:"initClasses",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r='change:classes',i=this.get('attributes').class||[],o=[this,r,this.initClasses],a=this.get('classes')||i,s=(0,p.isString)(a)?a.split(' '):a;this.stopListening.apply(this,o);var l=this.normalizeClasses(s),c=new b.Z([]);return this.set('classes',c,n),c.add(l),c.on('add remove reset',this.__upSymbCls),this.listenTo.apply(this,o),this}},{key:"initComponents",value:function(){var t=[this,'change:components',this.initComponents];this.stopListening.apply(this,t);var e=new m.Z(null,this.opt);e.parent=this;var n=this.get('components'),r=!this.opt.avoidChildren;return this.set('components',e),r&&n&&e.add((0,p.isFunction)(n)?n(this):n,this.opt),e.on('add remove reset',this.__upSymbComps),this.listenTo.apply(this,t),this}},{key:"initTraits",value:function(t){var e=this.em,n='change:traits';this.off(n,this.initTraits),this.__loadTraits();var r=P({},this.get('attributes')),i=this.get('traits');return i.each((function(t){if(!t.get('changeProp')){var e=t.get('name'),n=t.getInitValue();e&&n&&(r[e]=n)}})),i.length&&this.set('attributes',r),this.on(n,this.initTraits),t&&e&&e.trigger('component:toggled'),this}},{key:"initScriptProps",value:function(){if(!this.opt.temporary){var t='script-props',e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],r=this.get(t)||[],i=n.map((function(t){return"change:".concat(t)})).join(' '),o=r.map((function(t){return"change:".concat(t)})).join(' ');i&&this.off(i,this.__scriptPropsChange),o&&this.on(o,this.__scriptPropsChange),this.on.apply(this,e)}}},{key:"__scriptPropsChange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.avoidStore||this.trigger('rerender')}},{key:"append",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,p.isArray)(t)?t:[t],r=n.map((function(t){return(0,p.isString)(t)||t.collection&&t.collection.remove(t,{temporary:1}),t})),i=this.components().add(r,e);return(0,p.isArray)(i)?i:[i]}},{key:"components",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get('components');return(0,p.isUndefined)(t)?n:(n.reset(null,e),t?this.append(t,e):[])}},{key:"getChildAt",value:function(t){return this.components().at(t||0)||null}},{key:"getLastChild",value:function(){var t=this.components();return t.at(t.length-1)||null}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.components().reset(null,t),this}},{key:"parent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.collection||t.prev&&this.prevColl;return e?e.parent:null}},{key:"parents",value:function(){var t=this.parent();return t?[t].concat(t.parents()):[]}},{key:"scriptUpdated",value:function(){this.set('scriptUpdated',1)}},{key:"initToolbar",value:function(){var t=this.em,e=this,n=t&&t.getConfig().stylePrefix||'';if(!e.get('toolbar')&&t){var r=[];e.collection&&r.push({label:t.getIcon('arrowUp'),command:function(t){return t.runCommand('core:component-exit',{force:1})}}),e.get('draggable')&&r.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:t.getIcon('move'),command:'tlb-move'}),e.get('copyable')&&r.push({label:t.getIcon('copy'),command:'tlb-clone'}),e.get('removable')&&r.push({label:t.getIcon('delete'),command:'tlb-delete'}),e.set('toolbar',r)}}},{key:"__loadTraits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t||this.get('traits');if(!(n instanceof S)){n=(0,p.isFunction)(n)?n(this):n;var r=new S([],this.opt);r.setTarget(this),n.length&&(n.forEach((function(t){return t.attributes&&delete t.attributes.value})),r.add(n)),this.set({traits:r},e)}return this}},{key:"getTraits",value:function(){return this.__loadTraits(),(0,i.Z)(this.get('traits').models)}},{key:"setTraits",value:function(t){var e=(0,p.isArray)(t)?t:[t];return this.set({traits:e}),this.getTraits()}},{key:"getTrait",value:function(t){return this.getTraits().filter((function(e){return e.get('id')===t||e.get('name')===t}))[0]||null}},{key:"updateTrait",value:function(t,e){var n,r=this.getTrait(t);return r&&r.set(e),null===(n=this.em)||void 0===n||n.trigger('component:toggled'),this}},{key:"getTraitIndex",value:function(t){var e=this.getTrait(t);return e?this.get('traits').indexOf(e):-1}},{key:"removeTrait",value:function(t){var e,n=this,r=((0,p.isArray)(t)?t:[t]).map((function(t){return n.getTrait(t)})),i=this.get('traits'),o=r.length?i.remove(r):[];return null===(e=this.em)||void 0===e||e.trigger('component:toggled'),(0,p.isArray)(o)?o:[o]}},{key:"addTrait",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.__loadTraits();var r=this.get('traits').add(t,n);return null===(e=this.em)||void 0===e||e.trigger('component:toggled'),(0,p.isArray)(r)?r:[r]}},{key:"normalizeClasses",value:function(t){var e=[],n=this.em,r=n&&n.get('SelectorManager');if(r)return t.models?(0,i.Z)(t.models):(t.forEach((function(t){return e.push(r.add(t))})),e)}},{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=P({},this.attributes),r=P({},this.opt),o=this.getId(),a=e&&e.get('CssComposer');n.attributes=P({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=1),this.get('components').each((function(e,r){n.components[r]=e.clone(P(P({},t),{},{_inner:1}))})),this.get('traits').each((function(t,e){n.traits[e]=t.clone()})),this.get('classes').each((function(t,e){n.classes[e]=t.get('name')})),n.status='',r.collection=null;var s=new this.constructor(n,r),l="#".concat(s.getId()),c=a?a.getRules("#".concat(o)):[];c.forEach((function(t){var e=t.clone();e.set('selectors',[l]),a.getAll().add(e)})),s.set(R,0);var u=this.__getSymbol(),f=this.__getSymbols();t.symbol||!u&&!f?u?(u.set(R,[].concat((0,i.Z)(u.__getSymbols()),[s])),s.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(R,[].concat((0,i.Z)(f),[s])),s.set(D,this),s.__initSymb()):t.symbolInv?(this.set(R,[s]),s.set(D,this),[this,s].map((function(t){return t.__initSymb()}))):(s.set(R,[this]),[this,s].map((function(t){return t.__initSymb()})),this.set(D,s))):(s.set(D,0),s.set(R,0));var h='component:clone';return e&&e.trigger(h,s),this.trigger(h,s),s}},{key:"getName",value:function(){var t=this.em,e=this.attributes,n=e.type,r=e.tagName,i=e.name,o=n||r,a=!n&&r,s='domComponents.names.',l=i&&(null==t?void 0:t.t("".concat(s).concat(i))),c=a&&(null==t?void 0:t.t("".concat(s).concat(a))),u=t&&(t.t("".concat(s).concat(n))||t.t("".concat(s).concat(r)));return this.get('custom-name')||l||i||c||(0,d.capitalize)(a)||u||(0,d.capitalize)(o)}},{key:"getIcon",value:function(){var t=this.get('icon');return t?t+' ':''}},{key:"toHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=[],r=t.tag,i=r||e.get('tagName'),o=e.get('void'),a=t.attributes,s=this.getAttrToHTML();if(delete t.tag,a&&((0,p.isFunction)(a)?s=a(e,s)||{}:(0,d.isObject)(a)&&(s=a)),t.withProps){var l=this.toJSON();(0,p.forEach)(l,(function(t,e){'_'!==e[0]&&['classes','attributes','components'].indexOf(e)<0&&(s["data-gjs-".concat(e)]=(0,p.isArray)(t)||(0,d.isObject)(t)?JSON.stringify(t):t)}))}for(var c in s){var u=s[c];if(!(0,p.isUndefined)(u)&&null!==u)if((0,p.isBoolean)(u))u&&n.push(c);else{var f='';if(t.altQuoteAttr&&(0,p.isString)(u)&&u.indexOf('"')>=0)f="'".concat(u.replace(/'/g,'''),"'");else{var h=(0,p.isString)(u)?u.replace(/"/g,'"'):u;f="\"".concat(h,"\"")}n.push("".concat(c,"=").concat(f))}}var g=n.length?" ".concat(n.join(' ')):'',v=e.getInnerHTML(t),m="<".concat(i).concat(g).concat(o?'/':'',">").concat(v);return!o&&(m+="")),m}},{key:"getInnerHTML",value:function(t){return this.__innerHTML(t)}},{key:"__innerHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.components();return e.length?e.map((function(e){return e.toHTML(t)})).join(''):this.get('content')}},{key:"getAttrToHTML",value:function(){var t=this.getAttributes();return delete t.style,t}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=v.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,!t.fromUndo){var n=e[D],r=e[R];r&&(0,p.isArray)(r)&&(e[R]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),n&&!(0,p.isString)(n)&&(e[D]=n.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(e),e}},{key:"getChangedProps",value:function(t){var e=t||v.Model.prototype.toJSON.apply(this),n=(0,p.result)(this,'defaults');return(0,p.forEach)(n,(function(t,n){-1===['type'].indexOf(n)&&e[n]===t&&delete e[n]})),(0,p.isEmpty)(e.type)&&delete e.type,(0,p.forEach)(['attributes','style'],(function(t){(0,p.isEmpty)(n[t])&&(0,p.isEmpty)(e[t])&&delete e[t]})),(0,p.forEach)(['classes','components'],(function(t){(!e[t]||(0,p.isEmpty)(n[t])&&!e[t].length)&&delete e[t]})),e}},{key:"getId",value:function(){return(this.get('attributes')||{}).id||this.ccid||this.cid}},{key:"setId",value:function(t,e){var n=P({},this.get('attributes'));return n.id=t,this.set('attributes',n,e),this}},{key:"getEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=this.getView(t);return e&&e.el}},{key:"getView",value:function(t){var e=this.view,n=this.views;return t&&(e=n.filter((function(e){return e._getFrame()===t.view}))[0]),e}},{key:"getCurrentView",value:function(){var t=(this.em.get('currentFrame')||{}).model;return this.getView(t)}},{key:"__getScriptProps",value:function(){var t=this.props();return(this.get('script-props')||[]).reduce((function(e,n){return e[n]=t[n],e}),{})}},{key:"getScriptString",value: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('function'==typeof n){var i=n.toString().trim();n=(i=i.replace(/^function[\s\w]*\(\)\s?\{/,'').replace(/\}$/,'')).trim()}var o=this.em.getConfig(),a=E(o.tagVarStart||'{[ '),s=E(o.tagVarEnd||' ]}'),l=new RegExp("".concat(a,"([\\w\\d-]*)").concat(s),'g');n=n.replace(l,(function(t,n){e.scriptUpdated();var i=e.attributes[n]||'';return(0,p.isArray)(i)||'object'==(0,r.Z)(i)?JSON.stringify(i):i}))}return n}},{key:"emitUpdate",value:function(t){for(var e=this.em,n=Z+(t?":".concat(t):''),r=t&&this.get(t),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a=0&&this.__propSelfToParent({component:this,changed:{[t]:r},options:o[2]||o[1]||{}})}},{key:"onAll",value:function(t){return(0,p.isFunction)(t)&&(t(this),this.components().forEach((function(e){return e.onAll(t)}))),this}},{key:"remove",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=this.collection,i=function(){r&&r.remove(t,P(P({},e),{},{action:'remove-component'})),r||(t.components('',e),t.components().removeChildren(t,null,e))},o=P({},e);return[this,n].map((function(e){return e.trigger('component:remove:before',t,i,o)})),!o.abort&&i(),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){var n=e.at,r=this.index(),i=t===this.parent(),o=r===n||r===n-1;i&&o||(i&&n&&n>r&&(e.at=n-1),this.remove({temporary:1}),t.append(this,e),this.emitUpdate())}return this}},{key:"isInstanceOf",value:function(t){var e,n,r=null===(e=this.em)||void 0===e||null===(n=e.get('DomComponents').getType(t))||void 0===n?void 0:n.model;return!!r&&this instanceof r}},{key:"isChildOf",value:function(t){for(var e=(0,p.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}},{key:"resetId",value:function(){var t=this.em,e=this.getId();if(e){var r=n.createId(this);this.setId(r);var i=t&&t.get('CssComposer').getIdRule(e),o=i&&i.get('selectors').at(0);return o&&o.set('name',r),this}}},{key:"_getStyleRule",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.id,n=this.em,r=e||this.getId();return n&&n.get('CssComposer').getIdRule(r)}},{key:"_getStyleSelector",value:function(t){var e=this._getStyleRule(t);return e&&e.get('selectors').at(0)}},{key:"_idUpdated",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r.idUpdate){var i=this.ccid,o=this.get('attributes')||{},a=o.id,s=(this.previous('attributes')||{}).id||i,l=n.getList(this);if(l[a]||!a&&s)return this.setId(s,{idUpdate:1});delete l[s],l[a]=this,this.ccid=a;var c=this._getStyleSelector({id:s});c&&c.set({name:a,label:a})}}}]),n}(g.Z);N.getDefaults=function(){return(0,p.result)(this.prototype,'defaults')},N.isComponent=function(t){return{tagName:(0,d.toLowerCase)(t.tagName)}},N.ensureInList=function(t){var e=N.getList(t),n=t.getId(),r=e[n];if(r){if(r!==t){var i=N.getIncrementId(n,e);t.setId(i),e[i]=t}}else e[n]=t;t.components().forEach((function(t){return N.ensureInList(t)}))},N.createId=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=N.getList(t),i=n.idMap,o=void 0===i?{}:i,a=t.get('attributes'),s=a.id;return s?(e=N.getIncrementId(s,r,n),t.setId(e),s!==e&&(o[s]=e)):e=N.getNewId(r),r[e]=t,e},N.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),r="i".concat(n);t[r];)r=N.getNewId(t);return r},N.getIncrementId=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.keepIds,i=void 0===r?[]:r,o=1,a=t;if(i.indexOf(t)<0)for(;e[a];)o++,a="".concat(t,"-").concat(o);return a},N.getList=function(t){var e=t.opt,n=void 0===e?{}:e,r=n.domc,i=n.em,o=r||i&&i.get('DomComponents');return o?o.componentsById:{}},N.checkId=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,p.isArray)(t)?t:[t],o=r.keepIds,a=void 0===o?[]:o;i.forEach((function(t){var i=t.attributes,o=void 0===i?{}:i,s=t.components,l=o.id;if(l&&n[l]&&a.indexOf(l)<0){var c=N.getIncrementId(l,n);o.id=c,(0,p.isArray)(e)&&e.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(l)&&(e[n]="#".concat(c))}))}))}s&&N.checkId(s,e,n,r)}))}},8431:(t,e,n)=>{"use strict";n.d(e,{Z:()=>C});var r=n(1002),i=n(2982),o=n(5671),a=n(3144),s=n(7326),l=n(9340),c=n(2963),u=n(1120),f=n(4942),h=n(4925),p=n(2316),d=n.n(p),g=n(9050),v=n(9138),m=["id","draggable"],y=["at"];function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var i=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return[];var r=(0,g.isArray)(e)||(0,g.isFunction)(e.map)?e:[e];return r.map((function(e){n.push(e.getId()),t(e.components().models,n)})),n},O=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.visitedCmps=r.visitedCmps||{};var i=r.visitedCmps,o=(0,g.isArray)(e)?e:[e];return o.map((function(e){var o=e.attributes,a=void 0===o?{}:o,s=e.components,l=e.tagName,c=a.id,u=(a.draggable,(0,h.Z)(a,m)),f=e;if(c&&(i[c]?(i[c].push(f),c=v.ZP.getNewId(n),f.attributes.id=c):(i[c]=[],n[c]&&(f=n[c],l&&f.set({tagName:l},k(k({},r),{},{silent:!0})),(0,g.keys)(u).length&&f.addAttributes(u,k({},r))))),s){var p=t(s,n);if((0,g.isFunction)(f.components)){var d=f.components();d.length>0&&d.reset(p,r)}else f.components=p}return f}))},C=function(t){(0,l.Z)(n,t);var e=b(n);function n(){var t;(0,o.Z)(this,n);for(var r=arguments.length,i=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:{};this.opt=e,this.listenTo(this,'add',this.onAdd),this.listenTo(this,'remove',this.removeChildren),this.listenTo(this,'reset',this.resetChildren);var n=e.em,r=e.config;this.config=r,this.em=n,this.domc=e.domc||n&&n.get('DomComponents')}},{key:"resetChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this,i=n.previousModels||[],o=i.filter((function(e){return!t.get(e.cid)})),a=x(t);n.keepIds=x(i).filter((function(t){return a.indexOf(t)>=0})),o.forEach((function(t){return e.removeChildren(t,r,n)})),t.each((function(t){return e.onAdd(t)}))}},{key:"resetFromString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.keepIds=x(this);var n=this.domc,r=this.em,i=this.parent,o=null==r?void 0:r.get('CssComposer'),a=(null==n?void 0:n.allById())||{},s=this.parseString(t,e),l=O(s,a,e),c=e.visitedCmps,u=void 0===c?{}:c;Object.keys(u).forEach((function(t){var e=u[t];if(e.length){var n=(null==o?void 0:o.getRules("#".concat(t)))||[];n.length&&e.forEach((function(t){n.forEach((function(e){var n=e.clone();n.set('selectors',["#".concat(t.attributes.id)]),o.getAll().add(n)}))}))}})),this.reset(l,e),null==r||r.trigger('component:content',i,e,t)}},{key:"removeChildren",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var i=this.domc,o=this.em,a=r.temporary||r.fromUndo;if(t.prevColl=this,!a){var s=t.getId(),l=o.get('SelectorManager').getAll(),c=o.get('CssComposer').getAll(),u=(r.keepIds||[]).indexOf(s)<0,f=i?i.allById():{};delete f[s];var h=u?c.remove(c.filter((function(t){return t.getSelectors().getFullString()==="#".concat(s)})),r):[];l.remove(h.map((function(t){return t.getSelectors().at(0)}))),t.opt.temporary||(o.get('Commands').run('core:component-style-clear',{target:t}),t.removed(),t.trigger('removed'),o.trigger('component:remove',t));var p=t.components();p.forEach((function(t){return n.removeChildren(t,e,r)}))}var d=t.components();o.stopListening(d),o.stopListening(t),o.stopListening(t.get('classes')),t.__postRemove()}}},{key:"model",value:function(t,e){var n,r=e.collection.opt,i=r.em,o=i.get('DomComponents').componentTypes;e.em=i,e.config=r.config,e.componentTypes=o,e.domc=r.domc;for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.domc,i=n.get('CssComposer'),o=n.get('Parser').parseHtml(t);if(v.ZP.checkId(o.html,o.css,r.componentsById,e),o.css&&i&&!e.temporary){e.at;var a=(0,h.Z)(e,y);i.addCollection(o.css,k(k({},a),{},{extend:1}))}return o.html}},{key:"add",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.keepIds=[].concat((0,i.Z)(n.keepIds||[]),(0,i.Z)(x(n.previousModels))),(0,g.isString)(t)?t=this.parseString(t,n):(0,g.isArray)(t)&&(t=(0,i.Z)(t)).forEach((function(r,i){if((0,g.isString)(r)){var o=e.parseString(r,n);t[i]=(0,g.isArray)(o)&&!o.length?null:o}}));var r=(0,g.isArray)(t);t=(r?t:[t]).filter((function(t){return t})).map((function(t){return e.processDef(t)})),t=r?(0,g.flatten)(t,1):t[0];var o=d().Collection.prototype.add.apply(this,[t,n]);return this.__firstAdd=o,o}},{key:"processDef",value:function(t){if(t.cid&&t.ccid)return t;var e=this.em,n=this.config,i=(void 0===n?{}:n).processor,o=t;if(i){var a=i(o=k({},o));a&&((0,g.each)(o,(function(t,e){return delete o[e]})),(0,g.extend)(o,a))}if(o.$$typeof&&'object'==(0,r.Z)(o.props)){(o=k({},o)).props=k({},o.props);var s=e.get('DomComponents'),l=e.get('Parser').parserHtml;(0,g.each)(o,(function(t,e){(0,g.includes)(['props','type'],e)||delete o[e]}));var c=o.props,u=c.children;delete c.children,delete o.props;var f=l.splitPropsFromAttr(c);o.attributes=f.attrs,u&&(o.components=u),o.type?s.getType(o.type)||(o.tagName=o.type,delete o.type):o.type='textnode',(0,g.extend)(o,f.props)}return o}},{key:"onAdd",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.domc,i=this.em,o=t.getStyle(),a=i&&i.getConfig().avoidInlineStyle;if(r&&r.Component.ensureInList(t),!(0,g.isEmpty)(o)&&!a&&i&&i.get&&i.getConfig().forceClass&&!n.temporary){var s=t.cid;i.get('CssComposer').setClassRule(s,o);t.setStyle({}),t.addClass(s)}t.__postAdd({recursive:1}),this.__onAddEnd()}}]),n}(d().Collection)},2169:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var r=n(4942),i=n(5671),o=n(3144),a=n(9340),s=n(2963),l=n(1120),c=n(2316),u=n.n(c),f=n(9050),h=n(8431),p=n(3505),d=n(966),g=n(9283),v=n(1163);function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{},r=n.em,i=e.opt||{},o=this.$el,a=this.el;this.opts=t,this.modelOpt=i,this.config=n,this.em=r||'',this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.attr=e.get('attributes'),this.classe=this.attr.class||[],this.listenTo(e,'change:style',this.updateStyle),this.listenTo(e,'change:attributes',this.renderAttributes),this.listenTo(e,'change:highlightable',this.updateHighlight),this.listenTo(e,'change:status change:locked',this.updateStatus),this.listenTo(e,'change:script rerender',this.reset),this.listenTo(e,'change:content',this.updateContent),this.listenTo(e,'change',this.handleChange),this.listenTo(e,'active',this.onActive),this.listenTo(e,'disable',this.onDisable),o.data('model',e),(0,v.setViewEl)(a,this),e.view=this,this._getFrame()&&e.views.push(this),this.initClasses(),this.initComponents({avoidRender:1}),this.events=y(y({},this.constructor.getEvents()),{},{dragstart:'handleDragStart'}),this.delegateEvents(),!i.temporary&&this.init(this._clbObj())}},{key:"__isDraggable",value:function(){var t=this.model,e=this.config,n=t.attributes.draggable;return e.draggableComponents&&n}},{key:"_clbObj",value:function(){var t=this.em,e=this.model,n=this.el;return{editor:t&&t.getEditor(),model:e,el:n}}},{key:"init",value:function(){}},{key:"removed",value:function(){}},{key:"onActive",value:function(){}},{key:"onDisable",value:function(){}},{key:"remove",value:function(){var t;u().View.prototype.remove.apply(this,arguments);var e=this.model,n=this.$el,r=e.views,i=this._getFrame()||{};return e.components().forEach((function(t){var e=t.getView(i.model);null==e||e.remove()})),null===(t=this.childrenView)||void 0===t||t.remove(),r.splice(r.indexOf(this),1),this.removed(this._clbObj()),n.data({model:'',collection:'',view:''}),this}},{key:"handleDragStart",value:function(t){if(!this.__isDraggable())return!1;t.stopPropagation(),t.preventDefault(),this.em.get('Commands').run('tlb-move',{target:this.model,event:t})}},{key:"initClasses",value:function(){var t=this.model,e='change:classes',n=t.get('classes');n instanceof d.Z&&(this.stopListening(t,e,this.initClasses),this.listenTo(t,e,this.initClasses),this.listenTo(n,'add remove change',this.updateClasses),n.length&&this.importClasses())}},{key:"initComponents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.$el,r=this.childrenView,i='change:components',o=e.get('components'),a=[e,i,this.initComponents];o instanceof h.Z&&(n.data('collection',o),r&&r.remove(),this.stopListening.apply(this,a),!t.avoidRender&&this.renderChildren(),this.listenTo.apply(this,a))}},{key:"handleChange",value:function(){var t=this.model,e=(0,f.keys)(t.changed);if(1!==e.length||'status'!==e[0])for(var n in t.emitUpdate(),t.changed)t.emitUpdate(n)}},{key:"importClasses",value:function(){var t=this.config.em.get('SelectorManager');t&&this.model.get('classes').each((function(e){t.add(e.get('name'))}))}},{key:"updateStatus",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=this.el,r=this.ppfx,i=this.model,o=e?e.get('Canvas').getConfig():{},a=o.extHl,s=i.get('status'),l="".concat(r,"selected"),c="".concat(l,"-parent"),u="".concat(r,"freezed"),f="".concat(r,"hovered"),h="".concat(r,"no-pointer"),p=[l,c,u,f,h],d=a&&!t.noExtHl?'':l;this.$el.removeClass(p.join(' '));var g=n.getAttribute('class')||'',v=[g];switch(s){case'selected':v.push(d);break;case'selected-parent':v.push(c);break;case'freezed':v.push(u);break;case'freezed-selected':v.push(u,d);break;case'hovered':!t.avoidHover&&v.push(f)}i.get('locked')&&v.push(h);var m=v.filter(Boolean).join(' ');m&&n.setAttribute('class',m)}},{key:"updateHighlight",value:function(){var t=this.model,e=t.get('textable'),n=t.get('highlightable')&&(e||!t.isChildOf('text'));this.setAttribute('data-gjs-highlightable',!!n||'')}},{key:"updateStyle",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.model,i=this.em;if(i&&i.getConfig().avoidInlineStyle&&!n.inline){var o=r.getStyle();!(0,f.isEmpty)(o)&&r.setStyle(o)}else this.setAttribute('style',r.styleToString(n))}},{key:"updateClasses",value:function(){var t=this.model.get('classes').pluck('name').join(' ');this.setAttribute('class',t),this.updateStatus(),this.onAttrUpdate()}},{key:"setAttribute",value:function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)}},{key:"getClasses",value:function(){return this.model.getClasses().join(' ')}},{key:"updateAttributes",value:function(){var t=[],e=this.model,n=this.$el,r=this.el,i=e.attributes,o=i.textable,a=i.type,s=y(y({id:e.getId(),'data-gjs-type':a||'default'},this.__isDraggable()&&{draggable:!0}),o&&{contenteditable:'false'});(0,f.each)(r.attributes,(function(e){return t.push(e.nodeName)})),t.forEach((function(t){return n.removeAttr(t)})),this.updateStyle(),this.updateHighlight();var l=y(y({},s),e.getAttributes());(0,f.keys)(l).forEach((function(t){return!1===l[t]&&delete l[t]})),n.attr(l)}},{key:"updateContent",value:function(){var t=this.model.get('content'),e=this.model.components().length;this.getChildrenContainer().innerHTML=e?'':t}},{key:"prevDef",value:function(t){t.preventDefault()}},{key:"updateScript",value:function(){var t=this.model,e=this.em;t.get('script')&&e&&e.get('Canvas').getCanvasView().updateScript(this)}},{key:"getChildrenContainer",value:function(){var t=this.el;return'function'==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t}},{key:"getOffsetRect",value:function(){var t={},e=this.el,n=0,r=0;return function i(o){var a=o.offsetParent;a?(n+=a.offsetTop,r+=a.offsetLeft,i(a)):(t.top=e.offsetTop+n,t.left=e.offsetLeft+r,t.bottom=t.top+e.offsetHeight,t.right=t.left+e.offsetWidth)}(e),t}},{key:"isInViewport",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.rect,n=this.el,r=n.ownerDocument,i=r.body,o=r.defaultView.frameElement,a=e||this.getOffsetRect(),s=a.top,l=a.left,c=this._getFrame().getOffsetRect();return s>=c.scrollTop&&l>=c.scrollLeft&&s<=c.scrollBottom&&l<=o.offsetWidth+i.scrollLeft}},{key:"scrollIntoView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getOffsetRect(),n=this.isInViewport({rect:e});if(!n||t.force){var r=this.el;'smooth'!==t.behavior?r.ownerDocument.defaultView.scrollTo(0,e.top):r.scrollIntoView(y({behavior:'smooth',block:'nearest'},t))}}},{key:"reset",value:function(){var t=this.el;this.el='',this._ensureElement(),this._setData(),(0,g.dL)(t,this.el),this.render()}},{key:"_setData",value:function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})}},{key:"_getFrame",value:function(){var t;return null===(t=this.config.em)||void 0===t?void 0:t.get('Canvas').config.frameView}},{key:"renderChildren",value:function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new p.Z({collection:this.model.get('components'),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),r=0,i=n.length;r{"use strict";n.d(e,{Z:()=>p});var r=n(5671),i=n(3144),o=n(9340),a=n(2963),s=n(1120),l=n(2316),c=n.n(l),u=n(9050),f=n(9283);function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var i=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var p=function(t){(0,o.Z)(a,t);var e=h(a);function a(){return(0,r.Z)(this,a),e.apply(this,arguments)}return(0,i.Z)(a,[{key:"initialize",value: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)}},{key:"removeChildren",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.views.forEach((function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),(0,f.L_)(n),t.remove.apply(t)}}));var i=t.components();i.forEach((function(t){return n.removeChildren(t,e,r)}))}},{key:"addTo",value:function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.config.em,r=this.collection.indexOf(t);if(this.addToCollection(t,null,r),n&&!e.temporary){var i=function t(e){n.trigger('component:add',e),e.components().forEach((function(e){return t(e)}))};i(t)}}},{key:"addToCollection",value:function(t,e,r){this.compView||(this.compView=n(2169).Z);for(var i=this.config,o=this.opts,a=this.em,s=e||null,l=i.frameView,c=void 0===l?{}:l,f=c.model&&t.getView(c.model),h=o.componentTypes||a&&a.get('DomComponents').getTypes(),p=t.get('type')||'default',d=this.compView,g=0;g1&&void 0!==arguments[1]?arguments[1]:{},r=n.previousModels,i=void 0===r?[]:r;this.parentEl.innerHTML='',i.forEach((function(t){return e.removeChildren(t,e.collection)})),t.each((function(t){return e.addToCollection(t)}))}},{key:"render",value:function(t){var e=this,n=this.el,r=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each((function(t){return e.addToCollection(t,r)})),n.innerHTML='',n.appendChild(r),this}}]),a}(c().View)},9524:(t,e,n)=>{"use strict";n.d(e,{Z:()=>m});var r=n(4942),i=n(5671),o=n(3144),a=n(9340),s=n(2963),l=n(1120),c=n(9050),u=n(1163),f=n(5311),h=n(2316);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function d(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,c.isString)(e)&&(e=this.parseStyle(e));var r=this.getStyle(n),i=d({},e),o=d({},i);(0,c.keys)(o).forEach((function(t){''===o[t]&&delete o[t]})),this.set('style',o,n);var a=(0,u.shallowDiff)(r,i);return delete a.__p,(0,c.keys)(a).forEach((function(e){var r=t.em;n.noEvent||(t.trigger("change:style:".concat(e)),r&&(r.trigger('styleable:change',t,e,n),r.trigger("styleable:change:".concat(e),t,e,n)))})),i}},{key:"addStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'',n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};'string'==typeof t?t={prop:e}:n=e||{},t=this.extendStyle(t),this.setStyle(t,n)}},{key:"removeStyle",value:function(t){var e=this.getStyle();delete e[t],this.setStyle(e)}},{key:"styleToString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.getStyle(t);for(var r in n){var i=t.important,o=(0,c.isArray)(i)?i.indexOf(r)>=0:i,a="".concat(n[r]).concat(o?' !important':''),s='__'==r.substr(0,2);a&&!s&&e.push("".concat(r,":").concat(a,";"))}return e.join('')}},{key:"getSelectors",value:function(){return this.get('selectors')||this.get('classes')}},{key:"getSelectorsString",value:function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()}},{key:"_validate",value:function(t,e){return!0}}]),n}(h.Model)},793:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(4942),i=n(9050),o=n(2316);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},r=n.em;this.em=r,this.opts=n,this.model=function(){var t,n,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o&&o.type){var l=e.getBaseType();t=(i=e.getType(o.type))?i.model:l.model,n=i?i.view:l.view}else{var c=e.recognizeType(o);t=(i=c.type).model,n=i.view,o=c.attributes}var u=new t(o,s(s({},a),{},{em:r}));return u.typeView=n,u};var i=this.init&&this.init.bind(this);i&&i()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n{"use strict";n.d(e,{Z:()=>h});var r=n(5671),i=n(3144),o=n(9340),a=n(2963),s=n(1120),l=n(2316),c=n.n(l);function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var i=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var f=c().$,h=function(t){(0,o.Z)(n,t);var e=u(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,n),t=e.call(this,i);var o=i.ppfx||'';return t.opts=i,t.ppfx=o,t.em=i.target||{},!i.onChange&&t.listenTo(t.model,'change:value',t.handleModelChange),t}return(0,i.Z)(n,[{key:"template",value:function(){return"")}},{key:"inputClass",value:function(){return"".concat(this.ppfx,"field")}},{key:"holderClass",value:function(){return"".concat(this.ppfx,"input-holder")}},{key:"elementUpdated",value:function(){this.model.trigger('el:change')}},{key:"setValue",value:function(t){var e=this.model,n=t||e.get('defaults'),r=this.getInputEl();r&&(r.value=n)}},{key:"handleModelChange",value:function(t,e,n){this.setValue(e,n)}},{key:"handleChange",value:function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()}},{key:"__onInputChange",value:function(t){this.model.set({value:t},{fromInput:1})}},{key:"getInputEl",value:function(){if(!this.inputEl){var t=this.model,e=this.opts.type||'text',n=t.get('placeholder')||t.get('defaults')||t.get('default')||'';this.inputEl=f(""))}return this.inputEl.get(0)}},{key:"render",value: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}}]),n}(c().View);h.prototype.events={change:'handleChange'}},1511:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var r=n(4942),i=n(5671),o=n(3144),a=n(9340),s=n(2963),l=n(1120),c=n(2316),u=n.n(c),f=n(9050),h=n(1002),p=n(1163);var d=n(8659);function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e","
","
",'
'].join(''),s=function(){var t='';if(i)for(var e=1;e<=6;e++)t+="
";return["
","
","
","
","",'
','
',"
","
","
","
","
","
","
","
",'
','
','
',"
",'
',"
","
",t,'
','
',"
",'
',"
","",'
',"
","
","","",'
','
','
'].join('')}(),l='spectrum.id';t.fn.spectrum=function(e,n){if('string'==typeof e){var i=this,o=Array.prototype.slice.call(arguments,1);return this.each((function(){var n=r[t(this).data(l)];if(n){var a=n[e];if(!a)throw new Error("Spectrum: no such method: '"+e+"'");'get'==e?i=n.get():'container'==e?i=n.container:'option'==e?i=n.option.apply(n,o):'destroy'==e?(n.destroy(),t(this).removeData(l)):a.apply(n,o)}})),i}return this.spectrum('destroy').each((function(){var n=P(this,t.extend({},e,t(this).data()));t(this).data(l,n.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=A,t.fn.spectrum.defaults=n,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var n=t("")[0];e._cachedResult='color'===n.type&&''!==n.value}return e._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t('input[type=color]');e.length&&!R()&&e.spectrum({preferredFormat:'hex6'})};var c=/^[\s,#]+/,u=/\s+$/,f=0,d=Math,g=d.round,v=d.min,m=d.max,y=d.random,b=function t(e,n){if(n=n||{},(e=e||'')instanceof t)return e;if(!(this instanceof t))return new t(e,n);var r=function(t){var e={r:0,g:0,b:0},n=1,r=!1,i=!1;'string'==typeof t&&(t=function(t){t=t.replace(c,'').replace(u,'').toLowerCase();var e,n=!1;if(O[t])t=O[t],n=!0;else if('transparent'==t)return{r:0,g:0,b:0,a:0,format:'name'};if(e=S.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=S.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=S.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=S.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=S.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=S.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=S.hex8.exec(t))return{a:nt(e[1]),r:Q(e[2]),g:Q(e[3]),b:Q(e[4]),format:n?'name':'hex8'};if(e=S.hex6.exec(t))return{r:Q(e[1]),g:Q(e[2]),b:Q(e[3]),format:n?'name':'hex'};if(e=S.hex3.exec(t))return{r:Q(e[1]+''+e[1]),g:Q(e[2]+''+e[2]),b:Q(e[3]+''+e[3]),format:n?'name':'hex'};return!1}(t));'object'==(0,h.Z)(t)&&(t.hasOwnProperty('r')&&t.hasOwnProperty('g')&&t.hasOwnProperty('b')?(o=t.r,a=t.g,s=t.b,e={r:255*X(o,255),g:255*X(a,255),b:255*X(s,255)},r=!0,i='%'===String(t.r).substr(-1)?'prgb':'rgb'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('v')?(t.s=et(t.s),t.v=et(t.v),e=function(t,e,n){t=6*X(t,360),e=X(e,100),n=X(n,100);var r=d.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),l=r%6;return{r:255*[n,a,o,o,s,n][l],g:255*[s,n,n,a,o,o][l],b:255*[o,o,s,n,n,a][l]}}(t.h,t.s,t.v),r=!0,i='hsv'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('l')&&(t.s=et(t.s),t.l=et(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=X(t,360),e=X(e,100),n=X(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=a(l,s,t+1/3),i=a(l,s,t),o=a(l,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,t.s,t.l),r=!0,i='hsl'),t.hasOwnProperty('a')&&(n=t.a));var o,a,s;return n=Y(n),{ok:r,format:t.format||i,r:v(255,m(e.r,0)),g:v(255,m(e.g,0)),b:v(255,m(e.b,0)),a:n}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=g(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=g(this._r)),this._g<1&&(this._g=g(this._g)),this._b<1&&(this._b=g(this._b)),this._ok=r.ok,this._tc_id=f++};b.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=Y(t),this._roundA=g(100*this._a)/100,this},toHsv:function(){var t=M(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=M(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),r=g(100*t.v);return 1==this._a?'hsv('+e+', '+n+'%, '+r+'%)':'hsva('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHsl:function(){var t=D(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=D(this._r,this._g,this._b),e=g(360*t.h),n=g(100*t.s),r=g(100*t.l);return 1==this._a?'hsl('+e+', '+n+'%, '+r+'%)':'hsla('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHex:function(t){return Z(this._r,this._g,this._b,t)},toHexString:function(t){return'#'+this.toHex(t)},toHex8:function(){return L(this._r,this._g,this._b,this._a)},toHex8String:function(){return'#'+this.toHex8()},toRgb:function(){return{r:g(this._r),g:g(this._g),b:g(this._b),a:this._a}},toRgbString:function(){return 1==this._a?'rgb('+g(this._r)+', '+g(this._g)+', '+g(this._b)+')':'rgba('+g(this._r)+', '+g(this._g)+', '+g(this._b)+', '+this._roundA+')'},toPercentageRgb:function(){return{r:g(100*X(this._r,255))+'%',g:g(100*X(this._g,255))+'%',b:g(100*X(this._b,255))+'%',a:this._a}},toPercentageRgbString:function(){return 1==this._a?'rgb('+g(100*X(this._r,255))+'%, '+g(100*X(this._g,255))+'%, '+g(100*X(this._b,255))+'%)':'rgba('+g(100*X(this._r,255))+'%, '+g(100*X(this._g,255))+'%, '+g(100*X(this._b,255))+'%, '+this._roundA+')'},toName:function(){return 0===this._a?'transparent':!(this._a<1)&&(C[Z(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e='#'+L(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?'GradientType = 1, ':'';t&&(n=b(t).toHex8String());return'progid:DXImageTransform.Microsoft.gradient('+r+'startColorstr='+e+',endColorstr='+n+')'},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||'hex'!==t&&'hex6'!==t&&'hex3'!==t&&'name'!==t?('rgb'===t&&(n=this.toRgbString()),'prgb'===t&&(n=this.toPercentageRgbString()),'hex'!==t&&'hex6'!==t||(n=this.toHexString()),'hex3'===t&&(n=this.toHexString(!0)),'hex8'===t&&(n=this.toHex8String()),'name'===t&&(n=this.toName()),'hsl'===t&&(n=this.toHslString()),'hsv'===t&&(n=this.toHsvString()),n||this.toHexString()):'name'===t&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(V,arguments)},brighten:function(){return this._applyModification(B,arguments)},darken:function(){return this._applyModification(H,arguments)},desaturate:function(){return this._applyModification(N,arguments)},saturate:function(){return this._applyModification(I,arguments)},greyscale:function(){return this._applyModification(F,arguments)},spin:function(){return this._applyModification(z,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(G,arguments)},complement:function(){return this._applyCombination(U,arguments)},monochromatic:function(){return this._applyCombination(K,arguments)},splitcomplement:function(){return this._applyCombination(q,arguments)},triad:function(){return this._applyCombination(W,arguments)},tetrad:function(){return this._applyCombination($,arguments)}},b.fromRatio=function(t,e){if('object'==(0,h.Z)(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]='a'===r?t[r]:et(t[r]));t=n}return b(t,e)},b.equals=function(t,e){return!(!t||!e)&&b(t).toRgbString()==b(e).toRgbString()},b.random=function(){return b.fromRatio({r:y(),g:y(),b:y()})},b.mix=function(t,e,n){n=0===n?0:n||50;var r,i=b(t).toRgb(),o=b(e).toRgb(),a=n/100,s=2*a-1,l=o.a-i.a,c=1-(r=((r=s*l==-1?s:(s+l)/(1+s*l))+1)/2),u={r:o.r*r+i.r*c,g:o.g*r+i.g*c,b:o.b*r+i.b*c,a:o.a*a+i.a*(1-a)};return b(u)},b.readability=function(t,e){var n=b(t),r=b(e),i=n.toRgb(),o=r.toRgb(),a=n.getBrightness(),s=r.getBrightness(),l=Math.max(i.r,o.r)-Math.min(i.r,o.r)+Math.max(i.g,o.g)-Math.min(i.g,o.g)+Math.max(i.b,o.b)-Math.min(i.b,o.b);return{brightness:Math.abs(a-s),color:l}},b.isReadable=function(t,e){var n=b.readability(t,e);return n.brightness>125&&n.color>500},b.mostReadable=function(t,e){for(var n=null,r=0,i=!1,o=0;o125&&a.color>500,l=3*(a.brightness/125)+a.color/500;(s&&!i||s&&i&&l>r||!s&&!i&&l>r)&&(i=s,r=l,n=b(e[o]))}return n};var w,k,x,O=b.names={aliceblue:'f0f8ff',antiquewhite:'faebd7',aqua:'0ff',aquamarine:'7fffd4',azure:'f0ffff',beige:'f5f5dc',bisque:'ffe4c4',black:'000',blanchedalmond:'ffebcd',blue:'00f',blueviolet:'8a2be2',brown:'a52a2a',burlywood:'deb887',burntsienna:'ea7e5d',cadetblue:'5f9ea0',chartreuse:'7fff00',chocolate:'d2691e',coral:'ff7f50',cornflowerblue:'6495ed',cornsilk:'fff8dc',crimson:'dc143c',cyan:'0ff',darkblue:'00008b',darkcyan:'008b8b',darkgoldenrod:'b8860b',darkgray:'a9a9a9',darkgreen:'006400',darkgrey:'a9a9a9',darkkhaki:'bdb76b',darkmagenta:'8b008b',darkolivegreen:'556b2f',darkorange:'ff8c00',darkorchid:'9932cc',darkred:'8b0000',darksalmon:'e9967a',darkseagreen:'8fbc8f',darkslateblue:'483d8b',darkslategray:'2f4f4f',darkslategrey:'2f4f4f',darkturquoise:'00ced1',darkviolet:'9400d3',deeppink:'ff1493',deepskyblue:'00bfff',dimgray:'696969',dimgrey:'696969',dodgerblue:'1e90ff',firebrick:'b22222',floralwhite:'fffaf0',forestgreen:'228b22',fuchsia:'f0f',gainsboro:'dcdcdc',ghostwhite:'f8f8ff',gold:'ffd700',goldenrod:'daa520',gray:'808080',green:'008000',greenyellow:'adff2f',grey:'808080',honeydew:'f0fff0',hotpink:'ff69b4',indianred:'cd5c5c',indigo:'4b0082',ivory:'fffff0',khaki:'f0e68c',lavender:'e6e6fa',lavenderblush:'fff0f5',lawngreen:'7cfc00',lemonchiffon:'fffacd',lightblue:'add8e6',lightcoral:'f08080',lightcyan:'e0ffff',lightgoldenrodyellow:'fafad2',lightgray:'d3d3d3',lightgreen:'90ee90',lightgrey:'d3d3d3',lightpink:'ffb6c1',lightsalmon:'ffa07a',lightseagreen:'20b2aa',lightskyblue:'87cefa',lightslategray:'789',lightslategrey:'789',lightsteelblue:'b0c4de',lightyellow:'ffffe0',lime:'0f0',limegreen:'32cd32',linen:'faf0e6',magenta:'f0f',maroon:'800000',mediumaquamarine:'66cdaa',mediumblue:'0000cd',mediumorchid:'ba55d3',mediumpurple:'9370db',mediumseagreen:'3cb371',mediumslateblue:'7b68ee',mediumspringgreen:'00fa9a',mediumturquoise:'48d1cc',mediumvioletred:'c71585',midnightblue:'191970',mintcream:'f5fffa',mistyrose:'ffe4e1',moccasin:'ffe4b5',navajowhite:'ffdead',navy:'000080',oldlace:'fdf5e6',olive:'808000',olivedrab:'6b8e23',orange:'ffa500',orangered:'ff4500',orchid:'da70d6',palegoldenrod:'eee8aa',palegreen:'98fb98',paleturquoise:'afeeee',palevioletred:'db7093',papayawhip:'ffefd5',peachpuff:'ffdab9',peru:'cd853f',pink:'ffc0cb',plum:'dda0dd',powderblue:'b0e0e6',purple:'800080',rebeccapurple:'663399',red:'f00',rosybrown:'bc8f8f',royalblue:'4169e1',saddlebrown:'8b4513',salmon:'fa8072',sandybrown:'f4a460',seagreen:'2e8b57',seashell:'fff5ee',sienna:'a0522d',silver:'c0c0c0',skyblue:'87ceeb',slateblue:'6a5acd',slategray:'708090',slategrey:'708090',snow:'fffafa',springgreen:'00ff7f',steelblue:'4682b4',tan:'d2b48c',teal:'008080',thistle:'d8bfd8',tomato:'ff6347',turquoise:'40e0d0',violet:'ee82ee',wheat:'f5deb3',white:'fff',whitesmoke:'f5f5f5',yellow:'ff0',yellowgreen:'9acd32'},C=b.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(O),S=(k='[\\s|\\(]+('+(w='(?:'+'[-\\+]?\\d*\\.\\d+%?'+')|(?:'+'[-\\+]?\\d+%?'+')')+')[,|\\s]+('+w+')[,|\\s]+('+w+')\\s*\\)?',x='[\\s|\\(]+('+w+')[,|\\s]+('+w+')[,|\\s]+('+w+')[,|\\s]+('+w+')\\s*\\)?',{rgb:new RegExp('rgb'+k),rgba:new RegExp('rgba'+x),hsl:new RegExp('hsl'+k),hsla:new RegExp('hsla'+x),hsv:new RegExp('hsv'+k),hsva:new RegExp('hsva'+x),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=b,t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))}function _(e,n,r,i){for(var a=[],s=0;s')}else{a.push(t('
').append(t('').attr('title',i.noColorSelectedText)).html())}}return"
"+a.join('')+'
'}function P(l,c){var u,f,h,p,d=function(e,r){var i=t.extend({},n,e);return i.callbacks={move:j(i.move,r),change:j(i.change,r),show:j(i.show,r),hide:j(i.hide,r),beforeShow:j(i.beforeShow,r)},i}(c,l),g=d.flat,v=d.showSelectionPalette,m=d.localStorageKey,y=d.theme,w=d.callbacks,k=(u=Wt,f=10,function(){var t=this,e=arguments,n=function(){p=null,u.apply(t,e)};h&&clearTimeout(p),!h&&p||(p=setTimeout(n,f))}),x=!1,O=!1,C=!0,S=0,P=0,T=0,D=0,M=0,Z=0,L=0,N=0,I=0,F=0,V=1,B=[],H=[],z={},U=d.selectionPalette.slice(0),W=d.maxSelectionSize,$='sp-dragging',q=null,G=l.ownerDocument,K=(G.body,t(l)),Y=!1,X=t(s,G).addClass(y),J=X.find('.sp-picker-container'),Q=X.find('.sp-color'),tt=X.find('.sp-dragger'),et=X.find('.sp-hue'),nt=X.find('.sp-slider'),rt=X.find('.sp-alpha-inner'),it=X.find('.sp-alpha'),ot=X.find('.sp-alpha-handle'),at=X.find('.sp-input'),st=X.find('.sp-palette'),lt=X.find('.sp-initial'),ct=X.find('.sp-cancel'),ut=X.find('.sp-clear'),ft=X.find('.sp-choose'),ht=X.find('.sp-palette-toggle'),pt=K.is('input'),dt=pt&&'color'===K.attr('type')&&R(),gt=pt&&!g,vt=gt?t(a).addClass(y).addClass(d.className).addClass(d.replacerClassName):t([]),mt=gt?vt:K,yt=vt.find('.sp-preview-inner'),bt=d.color||pt&&K.val(),wt=!1,kt=d.preferredFormat,xt=!d.showButtons||d.clickoutFiresChange,Ot=!bt,Ct=d.allowEmpty&&!dt;function St(){if(d.showPaletteOnly&&(d.showPalette=!0),ht.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),d.palette){B=d.palette.slice(0),H=t.isArray(B[0])?B:[B],z={};for(var e=0;e1&&(delete window.localStorage[m],t.each(e,(function(t,e){Pt(e)})))}catch(t){}try{U=window.localStorage[m].split(';')}catch(t){}}}function Pt(e){if(v){var n=b(e).toRgbString();if(!z[n]&&-1===t.inArray(n,U))for(U.push(n);U.length>W;)U.shift();if(m&&window.localStorage)try{window.localStorage[m]=U.join(';')}catch(t){}}}function Tt(){var e=Vt(),n=t.map(H,(function(t,n){return _(t,e,'sp-palette-row sp-palette-row-'+n,d)}));_t(),U&&n.push(_(function(){var t=[];if(d.showPalette)for(var e=0;ep&&p>i?Math.abs(g.left+i-p):0),g.top-=Math.min(g.top,g.top+o>d&&d>o?Math.abs(o+a-r):r),g}(X,mt))),zt(),d.showPalette&&Tt(),K.trigger('reflow.spectrum'))}function $t(){Nt(),Y=!0,K.attr('disabled',!0),mt.addClass('sp-disabled')}!function(){if(i&&X.find('*:not(input)').attr('unselectable','on'),St(),gt&&K.after(vt).hide(),Ct||ut.hide(),g)K.after(X).hide();else{var e='parent'===d.appendTo?K.parent():t(d.appendTo);1!==e.length&&(e=t('body')),e.append(X)}function n(e){return e.data&&e.data.ignore?(Ft(t(e.target).closest('.sp-thumb-el').data('color')),Bt()):(Ft(t(e.target).closest('.sp-thumb-el').data('color')),Bt(),d.hideAfterPaletteSelect&&(Ut(!0),Nt())),!1}_t(),mt.bind('click.spectrum touchstart.spectrum',(function(e){Y||Dt(),e.stopPropagation(),t(e.target).is('input')||e.preventDefault()})),(K.is(':disabled')||!0===d.disabled)&&$t(),X.click(E),at.change(Rt),at.bind('paste',(function(){setTimeout(Rt,1)})),at.keydown((function(t){13==t.keyCode&&Rt()})),ct.text(d.cancelText),ct.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),It(),Nt()})),ut.attr('title',d.clearText),ut.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),Ot=!0,Bt(),g&&Ut(!0)})),ft.text(d.chooseText),ft.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),i&&at.is(':focus')&&at.trigger('change'),at.hasClass('sp-validation-error')||(Ut(!0),Nt())})),ht.text(d.showPaletteOnly?d.togglePaletteMoreText:d.togglePaletteLessText),ht.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),d.showPaletteOnly=!d.showPaletteOnly,d.showPaletteOnly||g||X.css('left','-='+(J.outerWidth(!0)+5)),St()})),A(it,(function(t,e,n){V=t/M,Ot=!1,n.shiftKey&&(V=Math.round(10*V)/10),Bt()}),jt,At),A(et,(function(t,e){N=parseFloat(e/D),Ot=!1,d.showAlpha||(V=1),Bt()}),jt,At),A(Q,(function(t,e,n){if(n.shiftKey){if(!q){var r=I*S,i=P-F*P,o=Math.abs(t-r)>Math.abs(e-i);q=o?'x':'y'}}else q=null;var a=!q||'y'===q;(!q||'x'===q)&&(I=parseFloat(t/S)),a&&(F=parseFloat((P-e)/P)),Ot=!1,d.showAlpha||(V=1),Bt()}),jt,At),bt?(Ft(bt),Ht(),kt=d.preferredFormat||b(bt).getFormat(),Pt(bt)):Ht(),g&&Mt();var r=i?'mousedown.spectrum':'click.spectrum touchstart.spectrum';st.delegate('.sp-thumb-el',r,n),lt.delegate('.sp-thumb-el:nth-child(1)',r,{ignore:!0},n)}();var qt={show:Mt,hide:Nt,toggle:Dt,reflow:Wt,option:function(n,r){return n===e?t.extend({},d):r===e?d[n]:(d[n]=r,'preferredFormat'===n&&(kt=d.preferredFormat),void St())},enable:function(){Y=!1,K.attr('disabled',!1),mt.removeClass('sp-disabled')},disable:$t,offset:function(t){d.offset=t,Wt()},set:function(t){Ft(t),Ut()},get:Vt,destroy:function(){K.show(),mt.unbind('click.spectrum touchstart.spectrum'),X.remove(),vt.remove(),r[qt.id]=null},container:X};return qt.id=r.push(qt)-1,qt}function T(){}function E(t){t.stopPropagation()}function j(t,e){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}function A(e,n,r,o){n=n||function(){},r=r||function(){},o=o||function(){};var a=document,s=!1,l={},c=0,u=0,f='ontouchstart'in window,h={};function p(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function d(t){if(s){if(i&&a.documentMode<9&&!t.button)return g();var r=t&&t.touches&&t.touches[0],o=r&&r.pageX||t.pageX,h=r&&r.pageY||t.pageY,d=Math.max(0,Math.min(o-l.left,u)),v=Math.max(0,Math.min(h-l.top,c));f&&p(t),n.apply(e,[d,v,t])}}function g(){s&&(t(a).unbind(h),t(a.body).removeClass('sp-dragging'),setTimeout((function(){o.apply(e,arguments)}),0)),s=!1}h['selectstart']=p,h['dragstart']=p,h['touchmove mousemove']=d,h['touchend mouseup']=g,t(e).bind('touchstart mousedown',(function(n){var i=n.which?3==n.which:2==n.button;i||s||!1!==r.apply(e,arguments)&&(s=!0,c=t(e).height(),u=t(e).width(),l=t(e).offset(),t(a).bind(h),t(a.body).addClass('sp-dragging'),d(n),p(n))}))}function R(){return t.fn.spectrum.inputTypeColorSupport()}function D(t,e,n){t=X(t,255),e=X(e,255),n=X(n,255);var r,i,o=m(t,e,n),a=v(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case t:r=(e-n)/l+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(b(r));return o}function K(t,e){e=e||6;for(var n=b(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(b({h:r,s:i,v:o})),o=(o+s)%1;return a}function Y(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function X(t,e){(function(t){return'string'==typeof t&&-1!=t.indexOf('.')&&1===parseFloat(t)})(t)&&(t='100%');var n=function(t){return'string'==typeof t&&-1!=t.indexOf('%')}(t);return t=v(e,m(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),d.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function J(t){return v(1,m(0,t))}function Q(t){return parseInt(t,16)}function tt(t){return 1==t.length?'0'+t:''+t}function et(t){return t<=1&&(t=100*t+'%'),t}function nt(t){return Q(t)/255}}(y);var b=function(t){var e='name'===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,'')},w=function(t){(0,a.Z)(n,t);var e=m(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"template",value:function(){var t=this.ppfx;return"\n
\n
\n
\n
\n
\n
\n ")}},{key:"inputClass",value:function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")}},{key:"holderClass",value:function(){return"".concat(this.ppfx,"input-holder")}},{key:"remove",value:function(){d.Z.prototype.remove.apply(this,arguments),this.colorEl.spectrum('destroy')}},{key:"handleChange",value:function(t){t.stopPropagation();var e=t.target.value;(0,f.isUndefined)(e)||this.__onInputChange(e)}},{key:"__onInputChange",value:function(t){var e=this.model,n=this.opts.onChange,r=t,i=this.getColorEl();if(i){i.spectrum('set',r);var o=i.spectrum('get'),a=r&&b(o);a&&(r=a)}n?n(r):e.set({value:r},{fromInput:1})}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=(0,f.isUndefined)(e.def)?n.get('defaults'):e.def,i=(0,f.isUndefined)(t)?(0,f.isUndefined)(r)?'':r:t,o=this.getInputEl(),a=this.getColorEl(),s='none'!=i?i:'';o.value=i,a.get(0).style.backgroundColor=s,(e.fromTarget||e.fromInput&&!e.avoidStore)&&(a.spectrum('set',s),this.noneColor='none'==i)}},{key:"getColorEl",value:function(){if(!this.colorEl){var t,e=this.em,n=this.model,r=this.opts,i=this,o=this.ppfx,a=r.onChange,s=y("
")),l=s.get(0).style,c=e&&e.config?e.config.el:'',u=e&&e.getConfig&&e.getConfig().colorPicker||{},f=!1,h='';this.$el.find('[data-colorp-c]').append(s);var p=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];a?a(t,!e):(e&&n.setValueFromInput(0,!1),n.setValueFromInput(t,e))};s.spectrum(v(v(v({color:n.getValue()||!1,containerClassName:"".concat(o,"one-bg ").concat(o,"two-color"),appendTo:c||'body',maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:'Ok',cancelText:'⨯',palette:[]},u),n.get('colorPicker')||{}),{},{move:function(t){var e=b(t);h=e,l.backgroundColor=e,p(e,!1)},change:function(t){f=!0;var e=b(t);l.backgroundColor=e,p(e),i.noneColor=0},show:function(e){f=!1,h='',t=a?n.getValue({noDefault:!0}):b(e)},hide:function(){f||!t&&!a||(i.noneColor&&(t=''),l.backgroundColor=t,s.spectrum('set',t),p(t,!1))}})),e&&e.on&&this.listenTo(e,'component:selected',(function(){h&&p(h),f=!0,h='',s.spectrum('hide')})),this.colorEl=s}return this.colorEl}},{key:"render",value:function(){return d.Z.prototype.render.call(this),this.getColorEl(),this}}]),n}(d.Z)},7610:(t,e,n)=>{"use strict";n.d(e,{Z:()=>g});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(2316),u=n.n(c),f=n(9050),h=n(1163),p=n(8659);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}u().$;var g=function(t){(0,a.Z)(n,t);var e=d(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.Z)(this,n),t=e.call(this,i),(0,f.bindAll)((0,o.Z)(t),'moveIncrement','upIncrement'),t.doc=document,t.listenTo(t.model,'change:unit',t.handleModelChange),t}return(0,i.Z)(n,[{key:"template",value:function(){var t=this.ppfx;return"\n \n \n
\n
\n
\n
\n ")}},{key:"inputClass",value:function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")}},{key:"setValue",value:function(t,e){var n=e||{},r=this.validateInputValue(t,{deepCheck:1}),i={value:r.value};(r.unit||r.force)&&(i.unit=r.unit),this.model.set(i,n),n.silent&&this.handleModelChange()}},{key:"handleChange",value:function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()}},{key:"handleUnitChange",value:function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set('unit',e),this.elementUpdated()}},{key:"handleKeyDown",value:function(t){'ArrowUp'===t.key&&(t.preventDefault(),this.upArrowClick()),'ArrowDown'===t.key&&(t.preventDefault(),this.downArrowClick())}},{key:"elementUpdated",value:function(){this.model.trigger('el:change')}},{key:"handleModelChange",value:function(){var t=this.model;this.getInputEl().value=t.get('value');var e=this.getUnitEl();e&&(e.value=t.get('unit')||'')}},{key:"getUnitEl",value:function(){if(!this.unitEl){var t=this.model,e=t.get('units')||[];if(e.length){var n=[''];e.forEach((function(e){var r=e==t.get('unit')?'selected':'';n.push(""))}));var r=document.createElement('div');r.innerHTML=""),this.unitEl=r.firstChild}}return this.unitEl}},{key:"upArrowClick",value:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n+e)),this.elementUpdated()}},{key:"downArrowClick",value:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n-e)),this.elementUpdated()}},{key:"downIncrement",value:function(t){t.preventDefault(),this.moved=0;var e=this.model.get('value')||0;e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,h.on)(this.doc,'mousemove',this.moveIncrement),(0,h.on)(this.doc,'mouseup',this.upIncrement)}},{key:"moveIncrement",value:function(t){this.moved=1;var e=this.model,n=e.get('step'),r=this.current,i=this.normalizeValue(r.val+(r.y-t.pageY)*n),o=this.validateInputValue(i),a=o.value,s=o.unit;return this.prValue=a,e.set({value:a,unit:s},{avoidStore:1}),!1}},{key:"upIncrement",value:function(){var t=this.model,e=t.get('step');if((0,h.off)(this.doc,'mouseup',this.upIncrement),(0,h.off)(this.doc,'mousemove',this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set('value',n,{avoidStore:1}).set('value',n+e),this.elementUpdated()}}},{key:"normalizeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model,r=n.get('step'),i=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var o=r.toString().split('.')[1];i=o?o.length:0}return i?parseFloat(t.toFixed(i)):t}},{key:"validateInputValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=e||{},i=this.model,o='',a=(0,f.isUndefined)(t)?o:t,s=e.units||i.get('units')||[],l=i.get('unit')||s.length&&s[0]||'',c=(0,f.isUndefined)(e.max)?i.get('max'):e.max,u=(0,f.isUndefined)(e.min)?i.get('min'):e.min,h=!!i.get('limitlessMax'),p=!!i.get('limitlessMin');if(r.deepCheck){var d=i.get('fixedValues')||[];if(''===a&&(l=''),a){var g=new RegExp('^'+d.join('|'),'g');if(d.length&&g.test(a))a=a.match(g)[0],l='',n=1;else{var v=a+'';a+='',a=parseFloat(a.replace(',','.')),a=isNaN(a)?o:a;var m=v.replace(a,'');(0,f.indexOf)(s,m)>=0&&(l=m)}}}return h||(0,f.isUndefined)(c)||''===c||(a=a>c?c:a),p||(0,f.isUndefined)(u)||''===u||(a=a{"use strict";n.d(e,{Z:()=>d});var r=n(5671),i=n(3144),o=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(4942),u=n(9050),f=n(2316),h=n.n(f);function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var i=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var d=function(t){(0,a.Z)(n,t);var e=p(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.Z)(this,n),t=e.call(this,i),(0,c.Z)((0,o.Z)(t),"itemsView",''),(0,c.Z)((0,o.Z)(t),"itemType",'type'),(0,c.Z)((0,o.Z)(t),"reuseView",!1),t.config=a||i.config||{},s&&t.listenTo(t.collection,'add',t.addTo),t.items=[],t}return(0,i.Z)(n,[{key:"addTo",value:function(t){this.add(t)}},{key:"itemViewNotFound",value:function(t){var e=this.config,n=this.ns,r=e.em,i="".concat(n?"[".concat(n,"]: "):'',"'").concat(t,"' type not found");r&&r.logWarning(i)}},{key:"add",value:function(t,e){var n,r=this.config,i=this.reuseView,o=this.items,a=this.itemsView,s=void 0===a?{}:a,l=e||null,c=this.itemView,f=t.get(this.itemType);s[f]?c=s[f]:!f||s[f]||(0,u.includes)(['button','checkbox','color','date','datetime-local','email','file','hidden','image','month','number','password','radio','range','reset','search','submit','tel','text','time','url','week'],f)||this.itemViewNotFound(f),n=t.view&&i?t.view:new c({model:t,config:r},r),o&&o.push(n);var h=n.render().el;l?l.appendChild(h):this.$el.append(h)}},{key:"render",value:function(){var t=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(e){this.add(e,t)}),this),this.$el.append(t),this.onRender(),this}},{key:"onRender",value:function(){}},{key:"onRemoveBefore",value:function(){}},{key:"onRemove",value:function(){}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.items;this.onRemoveBefore(e,t),this.clearItems(),h().View.prototype.remove.apply(this,arguments),this.onRemove(e,t)}},{key:"clearItems",value:function(){this.items}}]),n}(h().View);d.prototype.itemView=''},4836:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>h});var r=n(5671),i=n(3144),o=n(4942),a=n(9050),s=n(1163),l={placeholder:'eg. Text here'};const c={locale:'en',localeFallback:'en',detectLocale:!0,debug:!1,messages:{en:{assetManager:{addButton:'Add image',inputPlh:'http://path/to/the/image.jpg',modalTitle:'Select Image',uploadTitle:'Drop files here or click to upload'},blockManager:{labels:{},categories:{}},domComponents:{names:{'':'Box',wrapper:'Body',text:'Text',comment:'Comment',image:'Image',video:'Video',label:'Label',link:'Link',map:'Map',tfoot:'Table foot',tbody:'Table body',thead:'Table head',table:'Table',row:'Table row',cell:'Table cell'}},deviceManager:{device:'Device',devices:{desktop:'Desktop',tablet:'Tablet',mobileLandscape:'Mobile Landscape',mobilePortrait:'Mobile Portrait'}},panels:{buttons:{titles:{preview:'Preview',fullscreen:'Fullscreen','sw-visibility':'View components','export-template':'View code','open-sm':'Open Style Manager','open-tm':'Settings','open-layers':'Open Layer Manager','open-blocks':'Open Blocks'}}},selectorManager:{label:'Classes',selected:'Selected',emptyState:'- State -',states:{hover:'Hover',active:'Click','nth-of-type(2n)':'Even/Odd'}},styleManager:{empty:'Select an element before using Style Manager',layer:'Layer',fileButton:'Images',sectors:{general:'General',layout:'Layout',typography:'Typography',decorations:'Decorations',extra:'Extra',flex:'Flex',dimension:'Dimension'},properties:{'text-shadow-h':'X','text-shadow-v':'Y','text-shadow-blur':'Blur','text-shadow-color':'Color','box-shadow-h':'X','box-shadow-v':'Y','box-shadow-blur':'Blur','box-shadow-spread':'Spread','box-shadow-color':'Color','box-shadow-type':'Type','margin-top-sub':'Top','margin-right-sub':'Right','margin-bottom-sub':'Bottom','margin-left-sub':'Left','padding-top-sub':'Top','padding-right-sub':'Right','padding-bottom-sub':'Bottom','padding-left-sub':'Left','border-width-sub':'Width','border-style-sub':'Style','border-color-sub':'Color','border-top-left-radius-sub':'Top Left','border-top-right-radius-sub':'Top Right','border-bottom-right-radius-sub':'Bottom Right','border-bottom-left-radius-sub':'Bottom Left','transform-rotate-x':'Rotate X','transform-rotate-y':'Rotate Y','transform-rotate-z':'Rotate Z','transform-scale-x':'Scale X','transform-scale-y':'Scale Y','transform-scale-z':'Scale Z','transition-property-sub':'Property','transition-duration-sub':'Duration','transition-timing-function-sub':'Timing','background-image-sub':'Image','background-repeat-sub':'Repeat','background-position-sub':'Position','background-attachment-sub':'Attachment','background-size-sub':'Size'}},traitManager:{empty:'Select an element before using Trait Manager',label:'Component settings',traits:{labels:{},attributes:{id:l,alt:l,title:l,href:{placeholder:'eg. https://google.com'}},options:{target:{false:'This window',_blank:'New window'}}}},storageManager:{recover:'Do you want to recover unsaved changes?'}}},messagesAdd:null};function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.config=f(f(f({},c),t),{},{messages:f(f({},c.messages),t.messages||{})});var e=this.config.messagesAdd;return e&&this.addMessages(e),this.config.detectLocale&&(this.config.locale=this._localLang()),this.em=t.em,this}},{key:"getConfig",value:function(){return this.config}},{key:"setLocale",value:function(t){var e=this.em,n=this.config,r={value:t,valuePrev:n.locale};return e&&e.trigger('i18n:locale',r),n.locale=t,this}},{key:"getLocale",value:function(){return this.config.locale}},{key:"getMessages",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config.messages;return t&&!n[t]&&this._debug("'".concat(t,"' i18n lang not found"),e),t?n[t]:n}},{key:"setMessages",value:function(t){var e=this.em;return this.config.messages=t,e&&e.trigger('i18n:update',t),this}},{key:"addMessages",value:function(t){var e=this.em,n=this.config.messages;return e&&e.trigger('i18n:add',t),this.setMessages((0,s.deepMerge)(n,t)),this}},{key:"t",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.config,r=e.params||{},i=e.l||this.getLocale(),o=e.lFlb||n.localeFallback,s=this._getMsg(t,i,e);return s||(s=this._getMsg(t,o,e)),!s&&this._debug("'".concat(t,"' i18n key not found in '").concat(i,"' lang"),e),s=s&&(0,a.isString)(s)?this._addParams(s,r):s}},{key:"_localLang",value:function(){var t=(0,s.hasWin)()&&window.navigator||{},e=t.language||t.userLanguage;return e?e.split('-')[0]:'en'}},{key:"_addParams",value:function(t,e){var n=new RegExp('{([\\w\\d-]*)}','g');return t.replace(n,(function(t,n){return e[n]||''})).trim()}},{key:"_getMsg",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getMessages(e,n);if(r){var i=r[t];return!i&&t.indexOf('.')>0&&(i=t.split('.').reduce((function(t,e){if(!(0,a.isUndefined)(t))return t[e]}),r)),i}}},{key:"_debug",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.config;(e.debug||r.debug)&&n&&n.logWarning(t)}},{key:"destroy",value:function(){this.config={},this.em={}}}]),t}()},9788:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>E});var r,i=n(1002),o=n(4942),a=n(9050),s=n(1163),l={},c={16:!1,18:!1,17:!1,91:!1},u='all',f={'⇧':16,shift:16,'⌥':18,alt:18,option:18,'⌃':17,ctrl:17,control:17,'⌘':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},p=function(t){return h[t]||t.toUpperCase().charCodeAt(0)},d=[];for(r=1;r<20;r++)h['f'+r]=111+r;function g(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function v(t,e){if(t.length!=e.length)return!1;for(var n=0;n=0&&d.splice(r,1),93!=n&&224!=n||(n=91),n in c)for(e in c[n]=!1,f)f[e]==n&&(k[e]=!1)}function w(){for(r in c)c[r]=!1;for(r in f)k[r]=!1}function k(t,e,n){var r,i;r=O(t),void 0===n&&(n=e,e='all');for(var o=0;o1&&(i=C(t),t=[t[t.length-1]]),t=t[0],(t=p(t))in l||(l[t]=[]),l[t].push({shortcut:r[o],scope:e,method:n,key:r[o],mods:i})}for(r in f)k[r]=!1;function x(){return u||'all'}function O(t){var e;return''==(e=(t=t.replace(/\s/g,'')).split(','))[e.length-1]&&(e[e.length-2]+=','),e}function C(t){for(var e=t.slice(0,t.length-1),n=0;n1&&(s=C(r)),t=r[r.length-1],t=p(t),void 0===e&&(e=x()),!l[t])return;for(i=0;i0,c)(!c[r]&&g(n.mods,+r)>-1||c[r]&&-1==g(n.mods,+r))&&(o=!1);(0!=n.mods.length||c[16]||c[18]||c[17]||c[91])&&!o||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)})),S(t.document,'keyup',b),S(t,'focus',w)};const _=k;function P(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function T(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return this.config=T(T({},t),e),this.em=this.config.em,this.keymaps={},this},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||{})}},add:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=this.em,s=o.get('Commands'),l=o.getEditor(),c=o.get('Canvas'),u={id:t,keys:e,handler:n},f=this.keymaps[t];return f&&this.remove(t),this.keymaps[t]=u,_(e,(function(e,u){var f={event:e,h:u};if(n=(0,a.isString)(n)?s.get(n):n,!o.isEditing()&&!l.Canvas.isInputFocused()||r.force){r.prevent&&c.getCanvasView().preventDefault(e),'object'==(0,i.Z)(n)?s.runCommand(n,f):n(l,0,f);var h=[t,u.shortcut,e];o.trigger.apply(o,['keymap:emit'].concat(h)),o.trigger.apply(o,["keymap:emit:".concat(t)].concat(h))}})),o.trigger('keymap:add',u),u},get:function(t){return this.keymaps[t]},getAll:function(){return this.keymaps},remove:function(t){var e=this.em,n=this.get(t);if(n)return delete this.keymaps[t],n.keys.split(', ').forEach((function(t){return _.unbind(t.trim())})),e&&e.trigger('keymap:remove',n),n},removeAll:function(){var t=this;return Object.keys(this.keymaps).forEach((function(e){return t.remove(e)})),_.handlers={},this},destroy:function(){this.removeAll(),this.keymaps={},this.em={}}}}},4424:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>w});var r=n(4942);const i={textTags:['br','b','i','u','a','ul','ol'],parserCss:null,parserHtml:null,optionsHtml:{htmlType:null,allowScripts:!1,allowUnsafeAttr:!1}};var o=n(9050),a={4:'media',5:'font-face',6:'page',7:'keyframes',11:'counter-style',12:'supports',13:'document',14:'font-feature-values',15:'viewport'},s=(0,o.keys)(a),l=['5','6','11','15'],c=['font-face','page','counter-style','viewport'],u=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=[],n=[],r=t.split(','),i=0,o=r.length;i1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=t.length,o=t[i-1],a=o?o.split(/:(.+)/):[],s=a[1],l=n.atRule,u=n.selectorsAdd,f=n.mediaText,h=c.indexOf(l)>=0;return h&&(r.singleAtRule=1),l&&(r.atRuleType=l),u&&(r.selectorsAdd=u),f&&(r.mediaText=f),s&&(t[i-1]=a[0],r.state=s,a.splice(a.length-1,1)),r.selectors=t,r.style=e,r},d=function t(e){for(var n=[],r=e.cssRules||[],i=0,o=r.length;i=0;if(b)g=1,v=a[d],m=h(c);else if(s.indexOf(d)>=0){var w=t(c);m=h(c);for(var k=0,x=w.length;k0&&void 0!==arguments[0]?arguments[0]:{};return{parse:function(e){var n=this,r=[],i=t.parserCss,o=t.em,a=o&&o.get&&o.get('Editor');return(i?i(e,a):g(e)).forEach((function(t){return r=r.concat(n.checkNode(t))})),o&&o.trigger('parse:css',{input:e,output:r}),r},checkNode:function(t){var e=t,n=e.selectors,r=e.style;if((0,o.isString)(n)){var i=[],a=u(n),s=a.result,l=a.add.join(', '),c={atRule:t.atRule,mediaText:t.params};if(s.length?s.forEach((function(t){i.push(p(t,r,c))})):i.push(p([],r,c)),l)i[i.length-1].selectorsAdd=l;t=i}return t}}};var m=n(5311);function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return(n=b(b({},i),r)).Parser=this,t=new m.Z(n),e=new v(n),this.em=n.em,this.parserCss=e,this.parserHtml=t,this},getConfig:function(){return n},parseHtml:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,o=this.compTypes;return t.compTypes=i?i.get('DomComponents').getTypes():o,t.parse(n,e,r)},parseCss:function(t){return e.parse(t)},destroy:function(){var r=this;[n,t,e].forEach((function(t){return{}})),['em','parserCss','parserHtml'].forEach((function(t){return r[t]={}}))}}}},5311:(t,e,n)=>{"use strict";n.d(e,{Z:()=>f});var r=n(4942),i=n(1002),o=n(9050),a='text/html',s=a;const l=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new DOMParser,i=n.htmlType||s,l=i===a,c=l?t:"
".concat(t,"
"),u=r.parseFromString(c,i);if(l){var f=u.head,h=u.body,p=f.querySelectorAll('script');(0,o.each)(p,(function(t){return h.appendChild(t)}));var d=[];(0,o.each)(f.children,(function(t){return d.push(t)})),(0,o.each)(d,(function(t,e){return h.insertBefore(t,h.children[e])})),e=h}else e=u.firstChild;return e};function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},r={},i={};return(0,o.each)(e,(function(e,a){if(0===a.indexOf(t.modelAttrStart)){var s=a.replace(n,''),l=e.length,c=e&&(0,o.isString)(e),u=c&&e.substr(0,1),f=c&&e.substr(l-1);e='false'!==(e='true'===e||e)&&e;try{e='{'==u&&'}'==f||'['==u&&']'==f?JSON.parse(e):e}catch(t){}r[s]=e}else i[a]=e})),{props:r,attrs:i}},parseStyle:function(t){for(var e={},n=t.split(';'),r=0,i=n.length;r1&&void 0!==arguments[1]?arguments[1]:{},a=[],s=r.childNodes,l=0,c=s.length;l'!=="".concat(f.outerHTML).slice(-2)||(m.void=!0);var D=m.components;if(!m.type&&D){for(var M=1,Z=0,L=0;L2&&void 0!==arguments[2]?arguments[2]:{},c=e.em,f=c&&c.get('Config')||{},h={html:null,css:null},p=u(u({},t),s),d=u(u({},t.optionsHtml),{},{htmlType:(null===(a=t.optionsHtml)||void 0===a?void 0:a.htmlType)||t.htmlType},s),g=(0,o.isFunction)(p.parserHtml)?p.parserHtml(n,d):l(n,d),v=g.querySelectorAll('script'),m=v.length,y=(0,o.isUndefined)(f.allowScripts)?d.allowScripts:f.allowScripts;if(!y)for(;m--;)v[m].parentNode.removeChild(v[m]);if(d.allowUnsafeAttr||this.__clearUnsafeAttr(g),i){for(var b=g.querySelectorAll('style'),w=b.length,k='';w--;)k=b[w].innerHTML+k,b[w].parentNode.removeChild(b[w]);k&&(h.css=i.parse(k))}c&&c.trigger("".concat(r,":root"),{input:n,root:g});var x=this.parseNode(g,p),O=1!==x.length||e.returnArray?x:x[0];return h.html=O,c&&c.trigger(r,{input:n,output:h}),h},__clearUnsafeAttr:function(t){var e=this,n=t.attributes||[],r=t.childNodes||[],i=[];(0,o.each)(n,(function(t){var e=t.nodeName||'';0===e.indexOf('on')&&i.push(e)})),i.map((function(e){return t.removeAttribute(e)})),(0,o.each)(r,(function(t){return e.__clearUnsafeAttr(t)}))}}}},2012:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>_});var r=n(5861),i=n(2982),o=n(4942),a=n(4687),s=n.n(a),l=n(1163),c=n(5671),u=n(3144),f=n(9050);function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:'A',n=t.selection(),r=n.anchorNode,i=n.focusNode,o=null==r?void 0:r.parentNode,a=null==i?void 0:i.parentNode;return(null==o?void 0:o.nodeName)==e||(null==a?void 0:a.nodeName)==e},b='data-selectme',w={bold:{name:'bold',icon:'B',attributes:{title:'Bold'},result:function(t){return t.exec('bold')}},italic:{name:'italic',icon:'I',attributes:{title:'Italic'},result:function(t){return t.exec('italic')}},underline:{name:'underline',icon:'U',attributes:{title:'Underline'},result:function(t){return t.exec('underline')}},strikethrough:{name:'strikethrough',icon:'S',attributes:{title:'Strike-through'},result:function(t){return t.exec('strikeThrough')}},link:{icon:"\n \n ",name:'link',attributes:{style:'font-size:1.4rem;padding:0 4px 2px;',title:'Link'},state:function(t){return t&&t.selection()&&y(t)?g:v},result:function(t){y(t)?t.exec('unlink'):t.insertHTML("").concat(t.selection(),""),{select:!0})}},wrap:{name:'wrap',icon:"\n \n ",attributes:{title:'Wrap for style'},state:function(t){return null!=t&&t.selection()&&y(t,'SPAN')?m:v},result:function(t){!y(t,'SPAN')&&t.insertHTML("").concat(t.selection(),""),{select:!0})}}},k=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,c.Z)(this,t);var r=n.el,i=n.em;if(this.em=i,r[d])return r[d];r[d]=this,this.setEl(r),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var o=(n.actions||[]).map((function(t){var e=t;return'string'==typeof t?e=p({},w[t]):w[t.name]&&(e=p(p({},w[t.name]),t)),e})),a=o.length?o:Object.keys(w).map((function(t){return w[t]}));n.classes=p(p({},{actionbar:'actionbar',button:'action',active:'active',disabled:'disabled',inactive:'inactive'}),n.classes);var s=n.classes,l=n.actionbar;if(this.actionbar=l,this.settings=n,this.classes=s,this.actions=a,!l){var u=n.actionbarContainer;(l=document.createElement('div')).className=s.actionbar,u.appendChild(l),this.actionbar=l,a.forEach((function(t){return e.addAction(t)}))}return n.styleWithCSS&&this.exec('styleWithCSS'),this}return(0,u.Z)(t,[{key:"destroy",value:function(){this.el=0,this.doc=0,this.actionbar=0,this.settings={},this.classes={},this.actions=[]}},{key:"setEl",value:function(t){this.el=t,this.doc=t.ownerDocument}},{key:"updateActiveActions",value:function(){var t=this;this.getActions().forEach((function(e){var n=e.btn,r=e.update,i=p({},t.classes),o=i.active,a=i.inactive,s=i.disabled,l=e.state,c=e.name,u=t.doc;if(n.className=n.className.replace(o,'').trim(),n.className=n.className.replace(a,'').trim(),n.className=n.className.replace(s,'').trim(),l)switch(l(t,u)){case g:n.className+=" ".concat(o);break;case v:n.className+=" ".concat(a);break;case m:n.className+=" ".concat(s)}else u.queryCommandSupported(c)&&u.queryCommandState(c)&&(n.className+=" ".concat(o));r&&r(t,e)}))}},{key:"enable",value:function(t){return this.enabled?this:this.__toggleEffects(!0,t)}},{key:"disable",value:function(){return this.__toggleEffects(!1)}},{key:"__toggleEffects",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t?l.on:l.off,r=this.el,i=this.doc;if(this.actionbarEl().style.display=t?'':'none',r.contentEditable=!!t,n(r,'mouseup keyup',this.updateActiveActions),n(i,'keydown',this.__onKeydown),n(i,'paste',this.__onPaste),this.enabled=t,t){var o=e.event;if(this.syncActions(),this.updateActiveActions(),o){var a=null;if(i.caretRangeFromPoint){var s=(0,l.getPointerEvent)(o);a=i.caretRangeFromPoint(s.clientX,s.clientY)}else o.rangeParent&&(a=i.createRange()).setStart(o.rangeParent,o.rangeOffset);var c=i.getSelection();c.removeAllRanges(),a&&c.addRange(a)}r.focus()}return this}},{key:"__onKeydown",value:function(t){var e=this.doc;'Enter'!==t.key||['insertOrderedList','insertUnorderedList'].some((function(t){return e.queryCommandState(t)}))||(e.execCommand('insertLineBreak'),t.preventDefault())}},{key:"__onPaste",value:function(t){var e=t.clipboardData||window.clipboardData,n=e.getData('text'),r=e.getData('text/html');if(n&&!r){t.preventDefault();var i=n.replace(/(?:\r\n|\r|\n)/g,'
');this.doc.execCommand('insertHTML',!1,i)}}},{key:"syncActions",value:function(){var t=this;this.getActions().forEach((function(e){if(t.actionbar&&(!e.state||e.state&&e.state(t,t.doc)>=0)){var n=e.event||'click';e.btn["on".concat(n)]=function(n){e.result(t,e),t.updateActiveActions()}}}))}},{key:"addAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.sync,r=document.createElement('span'),i=t.icon,o=t.attributes||{};for(var a in r.className=this.classes.button,t.btn=r,o)r.setAttribute(a,o[a]);'string'==typeof i?r.innerHTML=i:r.appendChild(i),this.actionbarEl().appendChild(r),n&&(this.actions.push(t),this.syncActions())}},{key:"getActions",value:function(){return this.actions}},{key:"selection",value:function(){return this.doc.getSelection()}},{key:"exec",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.doc.execCommand(t,!1,e)}},{key:"actionbarEl",value:function(){return this.actionbar}},{key:"insertHTML",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.select,r=this.em,i=this.doc,o=this.el,a=i.getSelection();if(a&&a.rangeCount){var s=(0,l.getModel)(o),c=i.createElement('div'),u=a.getRangeAt(0);u.deleteContents(),(0,f.isString)(t)?c.innerHTML=t:t&&c.appendChild(t),Array.prototype.slice.call(c.childNodes).forEach((function(t){u.insertNode(t)})),a.removeAllRanges(),a.addRange(u),o.focus(),n&&s&&(s.once('rte:disable',(function(){var t=s.find("[".concat(b,"]"))[0];t&&(r.setSelected(t),t.removeAttributes(b))})),s.trigger('disable'))}}}]),t}();const x={stylePrefix:'rte-',adjustToolbar:1,actions:['bold','italic','underline','strikethrough','link','wrap']};function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},n=C(C({},x),e),r=n.pStylePrefix;return r&&(n.stylePrefix=r+n.stylePrefix),this.config=n,this.pfx=n.stylePrefix,this.em=n.em,this.actions=n.actions||[],(0,l.hasWin)()?((t=document.createElement('div')).className="".concat(r,"rte-toolbar ").concat(r,"one-bg"),this.initRte(document.createElement('div')),(0,l.on)(t,'mousedown',(function(t){return t.stopPropagation()})),this):this},destroy:function(){var e,n,r,i=this;null===(e=this.globalRte)||void 0===e||e.destroy(),null===(n=this.customRte)||void 0===n||null===(r=n.destroy)||void 0===r||r.call(n),t=0,['actionbar','actions','em','config','globalRte','lastEl'].map((function(t){delete i[t]}))},postRender:function(n){var r=n.model.get('Canvas');t.style.pointerEvents='all',e(),r.getToolsEl().appendChild(t)},initRte:function(e){var n=this.globalRte,r=this.em,o=this.pfx,a=this.actionbar,s=this.config,l=t,c=this.actions||(0,i.Z)(s.actions),u={actionbar:"".concat(o,"actionbar"),button:"".concat(o,"action"),active:"".concat(o,"active"),inactive:"".concat(o,"inactive"),disabled:"".concat(o,"disabled")};return n?(n.em=r,n.setEl(e)):(n=new k({em:r,el:e,classes:u,actions:c,actionbar:a,actionbarContainer:l}),this.globalRte=n),n.actionbar&&(this.actionbar=n.actionbar),n.actions&&(this.actions=n.actions),n},add:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.name=t,null===(e=this.globalRte)||void 0===e||e.addAction(n,{sync:1})},get:function(t){var e,n;return null===(e=this.globalRte)||void 0===e||e.getActions().forEach((function(e){e.name==t&&(n=e)})),n},getAll:function(){var t;return null===(t=this.globalRte)||void 0===t?void 0:t.getActions()},remove:function(t){var e=this.getAll(),n=this.get(t);if(n){var r=n.btn,i=e.indexOf(n);r.parentNode.removeChild(r),e.splice(i,1)}return n},getToolbarEl:function(){return t},updatePosition:function(){var e='px',n=this.em.get('Canvas'),r=t.style,i=n.getTargetToElementFixed(this.lastEl,t,{event:'rteToolbarPosUpdate',left:0});r.top=(i.top||0)+e,r.left=(i.left||0)+e},enable:function(e,n,i){var o=this;return(0,r.Z)(s().mark((function r(){var a,l,c,u;return s().wrap((function(r){for(;1;)switch(r.prev=r.next){case 0:return o.lastEl=e.el,a=o.customRte,l=o.em,c=e.getChildrenContainer(),t.style.display='',r.next=6,a?a.enable(c,n):o.initRte(c).enable(i);case 6:return u=r.sent,l&&(setTimeout(o.updatePosition.bind(o),0),l.off(S,o.updatePosition,o),l.on(S,o.updatePosition,o),l.trigger('rte:enable',e,u)),r.abrupt("return",u);case 9:case"end":return r.stop()}}),r)})))()},disable:function(t,n){var r=this.em,i=this.customRte,o=t.getChildrenContainer();i?i.disable(o,n):n&&n.disable(),e(),r&&(r.off(S,this.updatePosition,this),r.trigger('rte:disable',t,n))}}}},4859:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>A});var r=n(5861),i=n(5671),o=n(3144),a=n(7326),s=n(9340),l=n(2963),c=n(1120),u=n(4942),f=n(4687),h=n.n(f),p=n(9714);const d={id:'gjs-',type:'local',autosave:!0,autoload:!0,recovery:!1,stepsBeforeSave:1,onStore:function(t){return t},onLoad:function(t){return t},options:{local:{key:'gjsProject',checkLocal:!0},remote:{headers:{},urlStore:'',urlLoad:'',contentTypeJson:!0,fetchOptions:'',credentials:'include',onStore:function(t){return t},onLoad:function(t){return t}}}};var g=n(1163),v=function(){function t(){(0,i.Z)(this,t)}var e,n;return(0,o.Z)(t,[{key:"store",value:(n=(0,r.Z)(h().mark((function t(e){var n,r=arguments;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:n=r.length>1&&void 0!==r[1]?r[1]:{},this.hasLocal(n,!0)&&localStorage.setItem(n.key,JSON.stringify(e));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"load",value:(e=(0,r.Z)(h().mark((function t(){var e,n,r=arguments;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n={},this.hasLocal(e,!0)&&(n=JSON.parse(localStorage.getItem(e.key)||'{}')),t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"hasLocal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(t.checkLocal&&(!(0,g.hasWin)()||!localStorage)){if(e)throw new Error('localStorage not available');return!1}return!0}}]),t}(),m=n(9050),y=n(9661);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e1&&void 0!==r[1]?r[1]:{},t.next=3,this.request(n.urlStore,this.__props(n,e),n);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"load",value:(e=(0,r.Z)(h().mark((function t(e){return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return t.next=2,this.request(e.urlLoad,this.__props(e),e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"request",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,y.Z)(t,e).then((function(t){var e=t.text();return 1==(t.status/200|0)?e:e.then(Promise.reject)})).then((function(t){var e=t&&(0,m.isString)(t);return n.contentTypeJson&&e?JSON.parse(t):t}))}},{key:"__props",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=e.contentTypeJson,i=e.headers||{},o=e.fetchOptions||{},a='X-Requested-With',s='Content-Type';if((0,m.isUndefined)(i[a])&&(i[a]='XMLHttpRequest'),(0,m.isUndefined)(i[s])&&r&&(i[s]='application/json; charset=utf-8'),n)if(r)t=JSON.stringify(n);else for(var l in t=new FormData,n)t.append(l,n[l]);var c={method:t?'POST':'GET',credentials:e.credentials,headers:i,body:t};return w(w({},c),(0,m.isFunction)(o)?o(c):o)}}]),t}();function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.__initConfig(d,t);var e=this.getConfig();return e._disable&&(e.type=0),this.storages={},this.add(E,new v(e)),this.add(j,new k(e)),this.setCurrent(e.type),this}},{key:"isAutosave",value:function(){return!!this.getConfig().autosave}},{key:"setAutosave",value:function(t){return this.getConfig().autosave=!!t,this}},{key:"getStepsBeforeSave",value:function(){return this.getConfig().stepsBeforeSave}},{key:"setStepsBeforeSave",value:function(t){return this.getConfig().stepsBeforeSave=t,this}},{key:"add",value:function(t,e){return this.storages[t]=e,this}},{key:"get",value:function(t){return this.storages[t]||null}},{key:"getStorages",value:function(){return this.storages}},{key:"getCurrent",value:function(){return this.getConfig().currentStorage}},{key:"setCurrent",value:function(t){return this.getConfig().currentStorage=t,this}},{key:"getCurrentStorage",value:function(){return this.get(this.getCurrent())}},{key:"getStorageOptions",value:function(t){return this.getCurrentOptions(t)}},{key:"store",value:(l=(0,r.Z)(h().mark((function t(e){var n,r,i,o,a,s=arguments;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=this.getCurrentStorage(),i=O(O({},this.getCurrentOptions()),n),o=this.getRecoveryStorage(),a=this.getCurrentOptions(E),t.prev=5,t.next=8,this.__exec(r,i,e);case 8:if(t.t0=o,!t.t0){t.next=12;break}return t.next=12,this.__exec(o,a,{});case 12:case 19:t.next=22;break;case 14:if(t.prev=14,t.t1=t["catch"](5),!o){t.next=21;break}return t.next=19,this.__exec(o,a,e);case 21:throw t.t1;case 22:return t.abrupt("return",e);case 23:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t){return l.apply(this,arguments)})},{key:"load",value:(n=(0,r.Z)(h().mark((function t(){var e,n,r,i,o,a,s=arguments;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]?s[0]:{},n=this.getCurrentStorage(),r=O(O({},this.getCurrentOptions()),e),!(i=this.getRecoveryStorage())){t.next=17;break}return t.next=7,this.__exec(i,this.getCurrentOptions(E));case 7:if(a=t.sent,(0,m.isEmpty)(a)){t.next=17;break}return t.prev=9,t.next=12,this.__askRecovery();case 12:o=a,t.next=17;break;case 15:t.prev=15,t.t0=t["catch"](9);case 17:if(o){t.next=21;break}return t.next=20,this.__exec(n,r);case 20:o=t.sent;case 21:return t.abrupt("return",o||{});case 22:case"end":return t.stop()}}),t,this,[[9,15]])}))),function(){return n.apply(this,arguments)})},{key:"__askRecovery",value:function(){var t=this.em,e=this.getRecovery();return new Promise((function(n,r){(0,m.isFunction)(e)?e(n,r,null==t?void 0:t.getEditor()):confirm(null==t?void 0:t.t('storageManager.recover'))?n():r()}))}},{key:"getRecovery",value:function(){return this.getConfig().recovery}},{key:"getRecoveryStorage",value:function(){return this.getRecovery()&&this.getCurrent()===j&&this.get(E)}},{key:"__exec",value:(e=(0,r.Z)(h().mark((function t(e,n,r){var i,o,a,s,l,c,u,f;return h().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(i=r?'store':'load',o=this.getConfig(),a=o.onStore,s=o.onLoad,this.onStart(i,r),e){t.next=5;break}return t.abrupt("return",r||{});case 5:if(t.prev=5,u=null===(c=this.em)||void 0===c?void 0:c.getEditor(),!r){t.next=31;break}if(t.t1=a,!t.t1){t.next=13;break}return t.next=12,a(r,u);case 12:t.t1=t.sent;case 13:if(t.t0=t.t1,t.t0){t.next=16;break}t.t0=r;case 16:if(f=t.t0,t.t3=n.onStore,!t.t3){t.next=22;break}return t.next=21,n.onStore(f,u);case 21:t.t3=t.sent;case 22:if(t.t2=t.t3,t.t2){t.next=25;break}t.t2=f;case 25:return f=t.t2,t.next=28,e.store(f,n);case 28:l=r,t.next=53;break;case 31:return t.next=33,e.load(n);case 33:if(l=t.sent,l=this.__clearKeys(l),t.t5=n.onLoad,!t.t5){t.next=40;break}return t.next=39,n.onLoad(l,u);case 39:t.t5=t.sent;case 40:if(t.t4=t.t5,t.t4){t.next=43;break}t.t4=l;case 43:if(l=t.t4,t.t7=s,!t.t7){t.next=49;break}return t.next=48,s(l,u);case 48:t.t7=t.sent;case 49:if(t.t6=t.t7,t.t6){t.next=52;break}t.t6=l;case 52:l=t.t6;case 53:this.onAfter(i,l),this.onEnd(i,l),t.next=61;break;case 57:throw t.prev=57,t.t8=t["catch"](5),this.onError(i,t.t8),t.t8;case 61:return t.abrupt("return",l);case 62:case"end":return t.stop()}}),t,this,[[5,57]])}))),function(t,n,r){return e.apply(this,arguments)})},{key:"__clearKeys",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getConfig(),n=new RegExp("^".concat(e.id)),r={};for(var i in t){var o=i.replace(n,'');r[o]=t[i]}return r}},{key:"getCurrentOptions",value:function(t){var e=this.getConfig(),n=t||this.getCurrent();return e.options[n]||{}}},{key:"onStart",value:function(t,e){var n=this.em;n&&(n.trigger(S),t&&n.trigger("".concat(S,":").concat(t),e))}},{key:"onAfter",value:function(t,e){var n=this.em;n&&(n.trigger(_),n.trigger("".concat(_,":").concat(t),e),n.trigger("storage:".concat(t),e))}},{key:"onEnd",value:function(t,e){var n=this.em;n&&(n.trigger(P),t&&n.trigger("".concat(P,":").concat(t),e))}},{key:"onError",value:function(t,e){var n=this.em;n&&(n.trigger(T,e),t&&n.trigger("".concat(T,":").concat(t),e),this.onEnd(t,e))}},{key:"canAutoload",value:function(){return this.getCurrentStorage()&&this.getConfig().autoload}},{key:"destroy",value:function(){this.__destroy(),this.storages={}}}]),f}(p.Z)},2326:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>Pe,evAll:()=>pe,evCustom:()=>Se,evLayerSelect:()=>Oe,evPfx:()=>de,evProp:()=>be,evPropAdd:()=>we,evPropRemove:()=>ke,evPropUp:()=>xe,evSector:()=>ge,evSectorAdd:()=>ve,evSectorRemove:()=>me,evSectorUpdate:()=>ye,evTarget:()=>Ce});var r=n(2982),i=n(4942),o=n(9050),a=n(1163),s=n(9304),l=n(2316),c=n.n(l);const u={sectors:[{name:'General',open:!1,properties:['display','float','position','top','right','left','bottom']},{name:'Flex',open:!1,properties:['flex-direction','flex-wrap','justify-content','align-items','align-content','order','flex-basis','flex-grow','flex-shrink','align-self']},{name:'Dimension',open:!1,properties:['width','height','max-width','min-height','margin','padding']},{name:'Typography',open:!1,properties:['font-family','font-size','font-weight','letter-spacing','color','line-height','text-align','text-shadow']},{name:'Decorations',open:!1,properties:['background-color','border-radius','border','box-shadow','background']},{name:'Extra',open:!1,properties:['opacity','transition','transform']}],appendTo:'',stylePrefix:'sm-',custom:!1,hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:!0,avoidComputed:['width','height']};var f=n(4925),h=n(5671),p=n(3144),d=n(9340),g=n(2963),v=n(1120),m=n(793),y=["partial"];function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em;var r=this.get('id')||'',i=this.get('name')||this.get('label')||'';!this.get('property')&&this.set('property',(i||r).replace(/ /g,'-'));var o=this.get('property');!this.get('id')&&this.set('id',o),!i&&this.set('name',(0,a.capitalize)(o).replace(/-/g,' ')),this.on('change',this.__upTargets),n.callInit(this,t,e)}},{key:"__getParentProp",value:function(){var t,e;return null===(t=this.collection)||void 0===t||null===(e=t.opts)||void 0===e?void 0:e.parentProp}},{key:"__upTargets",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.em,a=i.get('StyleManager'),s=this.getName(),l=n.__clear,c=l?'':this.__getFullValue(n),u=this.__getParentProp(),f=this.changedAttributes(),h=(0,o.keys)(f).reduce((function(t,n){return t[n]=e.previous(n),t}),{}),p=[].concat((0,r.Z)((0,o.keys)(this.__getClearProps())),['__p']),d=(0,o.keys)(f),g=!n.__up&&!u&&(l||p.some((function(t){return d.indexOf(t)>=0}))),v=this.get('onChange'),m={property:this,from:h,to:f,value:c,opts:n};a.__trgEv(a.events.propertyUpdate,m),v&&v(m),g&&this.__upTargetsStyle({[s]:c},n)}},{key:"__upTargetsStyle",value:function(t,e){var n,r=null===(n=this.em)||void 0===n?void 0:n.get('StyleManager');null==r||r.addStyleTargets(w(w({},t),{},{__p:!!e.avoidStore}),e)}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.noTarget&&(e.__up=!0);var n=e.partial,r=(0,f.Z)(e,y);return t.__p=!(!r.avoidStore&&!n),this.set(t,w(w({},r),{},{avoidStore:t.__p}))}},{key:"up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.set(t,w(w({},e),{},{__up:!0}))}},{key:"init",value:function(){}},{key:"getId",value:function(){return this.get('id')}},{key:"getType",value:function(){return this.get('type')}},{key:"getName",value:function(){return this.get('property')}},{key:"getLabel",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.locale,r=void 0===n||n,i=this.getId(),o=this.get('name')||this.get('label');return r&&(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.properties.".concat(i)))||o}},{key:"getValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noDefault,n=this.get('value');return this.hasValue()||e?n:this.getDefaultValue()}},{key:"hasValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noParent,n=e&&this.getParentTarget(),r=this.get('value');return!(0,o.isUndefined)(r)&&''!==r&&!n}},{key:"hasValueParent",value:function(){return this.hasValue()&&!this.hasValue({noParent:!0})}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=t.camelCase?(0,a.camelCase)(e):e;return{[n]:this.__getFullValue(t)}}},{key:"getDefaultValue",value:function(){var t=this.get('default');return"".concat((0,o.isUndefined)(t)?this.get('defaults'):t)}},{key:"upValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null===t||''===t?this.__getClearProps():this.__parseValue(t,e);return this._up(n,e)}},{key:"isVisible",value:function(){return!!this.get('visible')}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._up(this.__getClearProps(),w(w({},t),{},{__clear:!0}))}},{key:"canClear",value:function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})}},{key:"getParent",value:function(){return this.__getParentProp()||null}},{key:"isFull",value:function(){return!!this.get('full')}},{key:"__parseValue",value:function(t,e){return this.parseValue(t,e)}},{key:"__getClearProps",value:function(){return{value:''}}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parseValue(t),i=!e;!i&&this.set({value:void 0},{avoidStore:i,silent:!0}),this.set(r,w({avoidStore:i},n))}},{key:"setValueFromInput",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(t,e,w(w({},n),{},{fromInput:1}))}},{key:"parseValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:t},r='!important';if((0,o.isString)(t)&&-1!==t.indexOf(r)&&(n.value=t.replace(r,'').trim(),n.important=1),!this.get('functionName')&&!e.complete)return n;var i=[],a="".concat(n.value),s=a.indexOf('(')+1,l=a.lastIndexOf(')'),c=a.substring(0,s-1);if(c&&(n.functionName=c),i.push(s),l>=0&&i.push(l),n.value=String.prototype.substring.apply(a,i),e.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,''),n.value=u}return n}},{key:"__getFullValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()}},{key:"getFullValue",value:function(t){var e=this.get('functionName'),n=this.getDefaultValue(),r=(0,o.isUndefined)(t)?this.get('value'):t,i=!(0,o.isUndefined)(r)&&''!==r;if(r&&n&&r===n)return n;if(e&&i){var a='url'===e?"'".concat(r.replace(/'|"/g,''),"'"):r;r="".concat(e,"(").concat(a,")")}return i&&this.get('important')&&(r="".concat(r," !important")),r||''}},{key:"__setParentTarget",value:function(t){this.up({parentTarget:t})}},{key:"getParentTarget",value:function(){return this.get('parentTarget')||null}},{key:"__parseFn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',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()}}},{key:"__checkVisibility",value:function(t){var e=t.target,n=t.component,r=t.sectors,i=n||e;if(!i)return!1;var s=this.getId(),l=this.getName(),c=this.get('toRequire'),u=this.get('requires'),f=this.get('requiresParent'),h=i.get('unstylable'),p=i.get('stylable-require'),d=i.get('stylable');if((0,o.isArray)(d)&&(d=d.indexOf(l)>=0),(0,o.isArray)(h)&&(d=h.indexOf(l)<0),c&&(d=!e||p&&(p.indexOf(s)>=0||p.indexOf(l)>=0)),r&&u){var g=(0,o.keys)(u);r.forEach((function(t){t.getProperties().forEach((function(t){if((0,o.includes)(g,t.id)){var e=u[t.id];d=d&&(0,o.includes)(e,t.get('value'))}}))}))}if(f){var v=n&&n.parent(),m=v&&v.getEl();if(m){var y=(0,a.hasWin)()?window.getComputedStyle(m):{};(0,o.each)(f,(function(t,e){d=d&&y[e]&&(0,o.includes)(t,y[e])}))}else d=!1}return!!d}}]),n}(l.Model);function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e3&&void 0!==arguments[3]?arguments[3]:{};t.prototype.initialize.apply(e,[n,w(w({},r),{},{skipInit:1})])},x.callInit=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&t.init(e,n)},x.getDefaults=function(){return(0,o.result)(this.prototype,'defaults')},x.prototype.defaults={name:'',property:'',type:'',defaults:'',info:'',value:'',icon:'',functionName:'',status:'',visible:!0,fixedValues:['initial','inherit'],onChange:null,full:0,important:0,toRequire:0,requires:null,requiresParent:null,parentTarget:null};var _=function(t){return'integer'===t||'number'===t},P=function(t){(0,d.Z)(n,t);var e=S(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"defaults",value:function(){return C(C({},x.getDefaults()),{},{detached:!1,properties:[],separator:' ',join:null,fromStyle:null,toStyle:null,full:!0})}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x.callParentInit(x,this,t,e);var n=this.em,r=new Ht(this.get('properties')||[],{em:n,parentProp:this});this.set('properties',r,{silent:1}),this.listenTo(r,'change',this.__upProperties),x.callInit(this,t,e)}},{key:"getProperties",value:function(){return(0,r.Z)(this.get('properties').models)}},{key:"getProperty",value:function(t){return this.get('properties').filter((function(e){return e.getId()===t||e.getName()===t}))[0]||null}},{key:"getPropertyAt",value:function(t){return this.get('properties').at(t)}},{key:"isDetached",value:function(){return!!this.get('detached')}},{key:"getValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.byName;return this.getProperties().reduce((function(t,n){return t[e?n.getName():n.getId()]="".concat(n.__getFullValue()),t}),{})}},{key:"getSeparator",value:function(){return this.getSplitSeparator()}},{key:"getJoin",value:function(){return this.__getJoin()}},{key:"getStyleFromProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=this.__getJoin(),r=this.get('toStyle'),i=this.getValues(),o={};if(r)o=r(i,{join:n,name:e,property:this});else if(i=this.getValues({byName:!0}),this.isDetached())o=i;else{var a=this.getProperties().map((function(t){return t.__getFullValue({withDefault:1})})).filter(Boolean).join(n);o={[e]:a}}return this.isDetached()?o[e]='':(o[e]=o[e]||'',o=C(C({},o),this.getProperties().reduce((function(t,e){return t[e.getName()]='',t}),{}))),t.camelCase?Object.keys(o).reduce((function(t,e){return t[camelCase(e)]=o[e],t}),{}):o}},{key:"getSplitSeparator",value:function(){return new RegExp("".concat(this.get('separator'),"(?![^\\(]*\\))"))}},{key:"__upProperties",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.__up&&!e.__clearIn){var n=this.__getParentProp();if(n)return n.__upProperties(this,e);this.__upTargetsStyleProps(e,t)}}},{key:"__upTargetsStyleProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=this.getStyleFromProps();if(this.isDetached()&&e){var r=e.getName();n={[r]:n[r]}}this.__upTargetsStyle(n,t)}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__setProperties(this.__getSplitValue(t.value),e),x.prototype._up.call(this,t,e)}},{key:"getStyle",value:function(t){return this.getStyleFromProps(t)}},{key:"__getFullValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isDetached()||t.__clear?'':this.getStyleFromProps()[this.getName()]||''}},{key:"__getJoin",value:function(){var t=this.get('join');return(0,o.isString)(t)?t:this.get('separator')}},{key:"__styleHasProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=this.getProperties(),i=n.map((function(t){return t.getName()})),a=[e].concat((0,r.Z)(i));return a.some((function(e){return!(0,o.isUndefined)(t[e])&&''!==t[e]}))}},{key:"__splitValue",value:function(t,e){return t.split(e).map((function(t){return t.trim()})).filter(Boolean)}},{key:"__splitStyleName",value:function(t,e,n){return this.__splitValue(t[e]||'',n)}},{key:"__getSplitValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.byName,r=this.getProperties(),i=4===r.length&&r.every((function(t){return _(t.getType())})),a=this.__splitValue(t,this.getSplitSeparator()),s={};return r.forEach((function(t,e){var r=a[e],l=(0,o.isUndefined)(r)?'':r;if(i){var c=a.length;l=a[e]||a[e%c+(1!=c&&c%2?1:0)]||l}var u=n?t.getName():t.getId();s[u]=l||''})),s}},{key:"__getPropsFromStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.__styleHasProps(t))return null;var n=e.byName,r=this.getName(),i=this.getProperties(),a=this.getSplitSeparator(),s=this.get('fromStyle'),l=s?s(t,{property:this,name:r,separator:a}):{};return s||(l=this.__getSplitValue(t[r]||'',{byName:n}),i.forEach((function(e){var r=t[e.getName()],i=n?e.getName():e.getId();(0,o.isUndefined)(r)||''===r||(l[i]=r)}))),l}},{key:"__setProperties",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.getProperties().forEach((function(n){var r=t[n.getId()];n.__getFullValue()!==r&&n.upValue(r,e)}));var n=(0,o.keys)(t).map((function(e){return t[e]})).join(' ');this.set('value',n,{silent:!0})}},{key:"clear",value:function(){var t=this;return this.getProperties().map((function(e){return e.clear({__clearIn:!t.isDetached()})})),x.prototype.clear.call(this)}},{key:"hasValue",value:function(t){return this.getProperties().some((function(e){return e.hasValue(t)}))}},{key:"getFullValue",value:function(){return this.__getFullValue()}},{key:"__canClearProp",value:function(t){return this.isDetached()&&t.hasValue({noParent:!0})}}]),n}(x);function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('values');return t.camelCase?Object.keys(e).reduce((function(t,n){return t[(0,a.camelCase)(n)]=e[n],t}),{}):e}},{key:"getLabel",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.getLayerLabel(this)}},{key:"isSelected",value:function(){var t;return(null===(t=this.prop)||void 0===t?void 0:t.getSelectedLayer())===this}},{key:"select",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.selectLayer(this)}},{key:"remove",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.removeLayer(this)}},{key:"move",value:function(t){var e;return null===(e=this.prop)||void 0===e?void 0:e.moveLayer(this,t)}},{key:"getStylePreview",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null===(t=this.prop)||void 0===t?void 0:t.getStylePreview(this,e)}},{key:"hasPreview",value:function(){var t;return!(null===(t=this.prop)||void 0===t||!t.get('preview'))}},{key:"upValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set('values',E(E({},this.getValues()),t))}}]),n}(l.Model);function R(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var D=function(t){(0,d.Z)(n,t);var e=R(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prop=e.prop}}]),n}(l.Collection);D.prototype.model=A;var M=["__layers"];function Z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function L(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};P.callParentInit(P,this,t,e);var n=this.get('layers'),r=new D(n,{prop:this});r.property=this,r.properties=this.get('properties'),this.set('layers',r,{silent:!0}),this.on('change:selectedLayer',this.__upSelected),this.listenTo(r,'add remove',this.__upLayers),P.callInit(this,t,e)}},{key:"getLayers",value:function(){return this.__getLayers().models}},{key:"__getLayers",value:function(){return this.get('layers')}},{key:"getLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.__getLayers().at(t)||null}},{key:"getSelectedLayer",value:function(){var t=this.get('selectedLayer');return t&&t.getIndex()>=0?t:null}},{key:"selectLayer",value:function(t){return this.set('selectedLayer',t,{__select:!0})}},{key:"selectLayerAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.getLayer(t);return e&&this.selectLayer(e)}},{key:"moveLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t?t.getIndex():-1;n>=0&&(0,o.isNumber)(e)&&e>=0&&e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};this.getProperties().forEach((function(e){var r=e.getId(),i=t[r];n[r]=(0,o.isUndefined)(i)?e.getDefaultValue():i}));var r=this.get('layers').push({values:n},e);return r}},{key:"removeLayer",value:function(t){return this.get('layers').remove(t)}},{key:"removeLayerAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.getLayer(t);return e?this.removeLayer(e):null}},{key:"getLayerLabel",value:function(t){var e='';if(t){var n=this.get('layerLabel'),r=t.getValues(),i=t.getIndex();if(n)e=n(t,{index:i,values:r,property:this});else{var o=[];this.getProperties().map((function(t){o.push(r[t.getId()])})),e=o.filter(Boolean).join(' ')}}return e}},{key:"getStyleFromLayer",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.__getJoin(),i=this.__getJoinLayers(),s=this.get('toStyle'),l=this.getName(),c=t.getValues();if(s)e=s(c,{join:r,joinLayers:i,name:l,layer:t,property:this});else{var u=this.getProperties().map((function(t){var e=t.getName(),r=c[t.getId()],i=(0,o.isUndefined)(r)?t.getDefaultValue():r;if(n.number&&_(t.getType())){var a=t.parseValue(r,n.number);i="".concat(a.value).concat(a.unit)}return{name:e,value:i}}));e=this.isDetached()?u.reduce((function(t,e){return t[e.name]=e.value,t}),{}):{[this.getName()]:u.map((function(t){return t.value})).join(r)}}return n.camelCase?Object.keys(e).reduce((function(t,n){return t[(0,a.camelCase)(n)]=e[n],t}),{}):e}},{key:"getStylePreview",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=this.get('preview');return r&&(n=this.getStyleFromLayer(t,e)),n}},{key:"getLayerSeparator",value:function(){var t=this.get('layerSeparator');return(0,o.isString)(t)?new RegExp("".concat(t,"(?![^\\(]*\\))")):t}},{key:"__upProperties",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getSelectedLayer();n&&(n.upValues({[t.getId()]:t.__getFullValue()}),e.__up||this.__upTargetsStyleProps(e))}},{key:"__upLayers",value:function(t,e,n){this.__upTargetsStyleProps(n||e)}},{key:"__upTargets",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.__select)return x.prototype.__upTargets.call(this,t,e)}},{key:"__upTargetsStyleProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__upTargetsStyle(this.getStyleFromLayers(),t)}},{key:"__upTargetsStyle",value:function(t,e){return x.prototype.__upTargetsStyle.call(this,t,e)}},{key:"__upSelected",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noEvent,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em.get('StyleManager'),i=this.getSelectedLayer(),o=null==i?void 0:i.getValues();o&&this.getProperties().forEach((function(t){var e,r=null!==(e=o[t.getId()])&&void 0!==e?e:'';t.__getFullValue()!==r&&t.upValue(r,L(L({},n),{},{__up:!0}))})),!e&&r.__trgEv(r.events.layerSelect,{property:this})}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.__layers,r=void 0===n?[]:n,i=(0,f.Z)(t,M);return!this.isDetached()&&this.__setLayers(r),this.__upSelected({noEvent:!0},e),x.prototype._up.call(this,i,e)}},{key:"__setLayers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.__getLayers(),n=t.map((function(t){return{values:t}}));e.length===n.length?n.map((function(t,n){var r;return null===(r=e.at(n))||void 0===r?void 0:r.upValues(t.values)})):this.__getLayers().reset(n),this.__upSelected({noEvent:!0})}},{key:"__parseValue",value:function(t){var e=this,n=this.parseValue(t);return n.__layers=t.split(I).map((function(t){return t.trim()})).map((function(t){return e.__parseLayer(t)})).filter(Boolean),n}},{key:"__parseLayer",value:function(t){var e=this.get('parseLayer'),n=t.split(F),r=this.getProperties();return e?e({value:t,values:n}):r.reduce((function(t,e,r){var i=n[r];return t[e.getId()]=(0,o.isUndefined)(i)?e.getDefaultValue():i,t}),{})}},{key:"__getLayersFromStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.__styleHasProps(e))return null;var n=this.getName(),r=this.getProperties(),i=this.getLayerSeparator(),a=this.get('fromStyle'),s=a?a(e,{property:this,name:n,separatorLayers:i}):[];if(!a){var l=this.__splitStyleName(e,n,i).map((function(e){return e.split(t.getSplitSeparator())})).map((function(t){var e={};return r.forEach((function(n,r){var i=t[r];e[n.getId()]=(0,o.isUndefined)(i)?n.getDefaultValue():i})),e}));r.forEach((function(n){var r=n.getId();t.__splitStyleName(e,n.getName(),i).map((function(t){return{[r]:t||n.getDefaultValue()}})).forEach((function(t,e){l[e]=l[e]?L(L({},l[e]),t):t}))})),s=l}return(0,o.isArray)(s)?s:[s]}},{key:"getStyle",value:function(t){return this.getStyleFromLayers(t)}},{key:"getStyleFromLayers",value:function(t){var e=this,n={},r=this.getName(),i=this.getLayers(),a=this.getProperties();if(i.map((function(n){return e.getStyleFromLayer(n,t)})).forEach((function(t){(0,o.keys)(t).map((function(e){n[e]||(n[e]=[]),n[e].push(t[e])}))})),(0,o.keys)(n).map((function(t){n[t]=n[t].join(e.__getJoinLayers())})),this.isDetached())n[r]='',!i.length&&a.map((function(t){n[t.getName()]=''}));else{var s=a.reduce((function(t,e){return t[e.getName()]='',t}),{});n[r]=n[r]||'',n=L(L({},n),s)}return n}},{key:"__getJoinLayers",value:function(){var t=this.get('layerJoin'),e=this.get('layerSeparator');return t||((0,o.isString)(e)?e:t)}},{key:"__getFullValue",value:function(){return this.get('detached')?'':this.getStyleFromLayers()[this.getName()]}},{key:"hasValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noParent,n=e&&this.getParentTarget();return this.getLayers().length>0&&!n}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.__getLayers().reset(),this.__upTargetsStyleProps(t),x.prototype.clear.call(this)}},{key:"__canClearProp",value:function(){return!1}}]),n}(P),B=["complete","partial"];function H(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function z(t){for(var e=1;e
\n
\n ")}},{key:"templateLabel",value:function(t){var e=this.pfx,n=this.em,r=t.parent,i=t.attributes,o=i.icon,a=void 0===o?'':o,s=i.info,l=void 0===s?'':s,c=null==n?void 0:n.getConfig().icons,u=(null==c?void 0:c.close)||'';return"\n \n ").concat(t.getLabel(),"\n \n ").concat(r?'':"
").concat(u,"
"),"\n ")}},{key:"templateInput",value:function(t){return"\n
\n \n
\n ")}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.bindAll)(this,'__change','__updateStyle');var e=t.config||{},n=e.em;this.config=e,this.em=n,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.__destroyFn=this.destroy?this.destroy.bind(this):function(){};var r=this.model;r.view=this,this.onValueChange=(0,o.debounce)(this.onValueChange.bind(this),10),this.updateStatus=(0,o.debounce)(this.updateStatus.bind(this)),this.listenTo(r,'destroy remove',this.remove),this.listenTo(r,'change:visible',this.updateVisibility),this.listenTo(r,'change:name change:className change:full',this.render),this.listenTo(r,'change:value',this.onValueChange),this.listenTo(r,'change:parentTarget',this.updateStatus),this.listenTo(n,'change:device',this.onValueChange);var i=this.init&&this.init.bind(this);i&&i()}},{key:"remove",value:function(){var t=this;l.View.prototype.remove.apply(this,arguments),['em','input','$input','view'].forEach((function(e){return t[e]=null})),this.__destroyFn(this._getClbOpts())}},{key:"updateStatus",value:function(){var t,e=this.model,n=this.pfx,r=this.ppfx,i=this.config,o="".concat(r,"four-color"),a="".concat(r,"color-warn"),s=this.$el.children(".".concat(n,"label")),l=this.getClearEl(),c=l?l.style:{};s.removeClass("".concat(o," ").concat(a)),c.display='none',e.hasValue({noParent:!0})&&i.highlightChanged?(s.addClass(o),i.clearProperties&&(c.display='')):e.hasValue()&&i.highlightComputed&&s.addClass(a),null===(t=this.parent)||void 0===t||t.updateStatus()}},{key:"clear",value:function(t){t&&t.stopPropagation(),this.model.clear()}},{key:"getClearEl",value:function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(W,"]"))),this.clearEl}},{key:"inputValueChanged",value:function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)}},{key:"onValueChange",value:function(t,e){this.setValue(this.model.getFullValue()),this.updateStatus()}},{key:"setValue",value:function(t){var e=this.model,n=(0,o.isUndefined)(t)||''===t?e.getDefaultValue():t;if(this.update)return this.__update(n);this.__setValueInput(n)}},{key:"__setValueInput",value:function(t){var e=this.getInputEl();e&&(e.value=t)}},{key:"getInputEl",value:function(){return this.input||(this.input=this.el.querySelector('input')),this.input}},{key:"updateVisibility",value:function(){this.el.style.display=this.model.isVisible()?'':'none'}},{key:"clearCached",value:function(){this.clearEl=null,this.input=null,this.$input=null}},{key:"__unset",value:function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())}},{key:"__update",value:function(t){var e=this.update&&this.update.bind(this);e&&e(z(z({},this._getClbOpts()),{},{value:t}))}},{key:"__change",value:function(){for(var t=this.emit&&this.emit.bind(this),e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=e.complete,r=e.partial,i=((0,f.Z)(e,B),this.model),o=!1!==n&&!0!==r;(0,a.isObject)(t)?i.__upTargetsStyle(t,{avoidStore:!o}):i.upValue(t,{partial:!o})}},{key:"_getClbOpts",value:function(){var t=this.model;return{el:this.el,createdEl:this.createdEl,property:t,props:t.attributes,change:this.__change,updateStyle:this.__updateStyle}}},{key:"render",value:function(){this.clearCached();var t=this.pfx,e=this.model,n=this.el,r=this.$el,i=e.getName(),o=e.getType(),a=e.get('className')||'',s="".concat(t,"property"),l='number'===o?"".concat(t).concat(o," ").concat(t,"integer"):"".concat(t).concat(o);this.createdEl&&this.__destroyFn(this._getClbOpts()),r.empty().append(this.template(e)),r.find('[data-sm-label]').append(this.templateLabel(e));var c=this.create&&this.create.bind(this);this.createdEl=c&&c(this._getClbOpts()),r.find('[data-sm-fields]').append(this.createdEl||this.templateInput(e)),n.className="".concat(s," ").concat(l," ").concat(s,"__").concat(i," ").concat(a).trim(),n.className+=e.isFull()?" ".concat(s,"--full"):'';var u=this.onRender&&this.onRender.bind(this);u&&u(),this.setValue(e.getValue())}}]),n}(l.View);$.prototype.events={change:'inputValueChanged',["click [".concat(W,"]")]:'clear'};var q=n(9283);function G(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var K=function(t){(0,d.Z)(n,t);var e=G(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||'',this.properties=[],this.parent=t.parent;var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.render)}},{key:"addTo",value:function(t,e,n){this.add(t,null,n)}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parent,i=this.config,o=e||this.el,a=new t.typeView({model:t,config:i});r&&(a.parent=r),a.render();var s=a.el;this.properties.push(a),(0,q.$Q)(o,s,n.at)}},{key:"remove",value:function(){l.View.prototype.remove.apply(this,arguments),this.clearItems()}},{key:"clearItems",value:function(){this.properties.forEach((function(t){return t.remove()})),this.properties=[]}},{key:"render",value:function(){var t=this,e=this.$el,n=this.pfx;this.clearItems();var r=document.createDocumentFragment();return this.collection.forEach((function(e){return t.add(e,r)})),e.empty(),e.append(r),e.attr('class',"".concat(n,"properties")),this}}]),n}(l.View);function Y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function X(t){for(var e=1;e\n \n
\n ")}},{key:"remove",value:function(){var t;null===(t=this.props)||void 0===t||t.remove(),$.prototype.remove.apply(this,arguments)}},{key:"onValueChange",value:function(){}},{key:"onRender",value:function(){var t=this.model,e=this.pfx,n=t.get('properties');if(n.length&&!this.props){var r=t.isDetached(),i=new K({config:X(X({},this.config),{},{highlightComputed:r,highlightChanged:r}),collection:n,parent:this});i.render(),this.$el.find("#".concat(e,"input-holder")).append(i.el),this.props=i}}},{key:"clearCached",value:function(){$.prototype.clearCached.apply(this,arguments),this.props=null}}]),n}($);function tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var et=function(t){(0,d.Z)(n,t);var e=tt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"events",value:function(){return{click:'select','click [data-close-layer]':'removeItem','mousedown [data-move-layer]':'initSorter','touchstart [data-move-layer]':'initSorter'}}},{key:"template",value:function(){var t=this.pfx,e=this.ppfx,n=this.em,r=null==n?void 0:n.getConfig().icons,i=(null==r?void 0:r.close)||'',o=(null==r?void 0:r.move)||'';return"\n
\n
\n ").concat(o,"\n
\n
\n
\n
\n
\n
\n ").concat(i,"\n
\n
\n
\n ")}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.propertyView=t.propertyView;var r=this.propertyView.model;this.listenTo(e,'destroy remove',this.remove),this.listenTo(e,'change:values',this.updateLabel),this.listenTo(r,'change:selectedLayer',this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data('model',e)}},{key:"initSorter",value:function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)}},{key:"removeItem",value:function(t){t&&t.stopPropagation(),this.model.remove()}},{key:"select",value:function(){this.model.select()}},{key:"getPropertiesWrapper",value:function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector('[data-properties]')),this.propsWrapEl}},{key:"getPreviewEl",value:function(){return this.previewEl||(this.previewEl=this.el.querySelector('[data-preview]')),this.previewEl}},{key:"getLabelEl",value:function(){return this.labelEl||(this.labelEl=this.el.querySelector('[data-label]')),this.labelEl}},{key:"updateLabel",value:function(){var t=this.model,e=t.getLabel();if(this.getLabelEl().innerHTML=e,t.hasPreview()){var n=this.getPreviewEl(),r=t.getStylePreview({number:{min:-3,max:3}}),i=(0,o.keys)(r).map((function(t){return"".concat(t,":").concat(r[t])})).join(';');n.setAttribute('style',i)}}},{key:"updateVisibility",value:function(){var t=this.pfx,e=this.model,n=this.propertyView,r=this.getPropertiesWrapper(),i=e.isSelected();r.style.display=i?'':'none',this.$el[i?'addClass':'removeClass']("".concat(t,"active")),i&&r.appendChild(n.props.el)}},{key:"render",value:function(){var t=this.el,e=this.pfx,n=this.model;return t.innerHTML=this.template(),t.className="".concat(e,"layer"),n.hasPreview()&&(t.querySelector('[data-preview-box]').style.display=''),this.updateLabel(),this.updateVisibility(),this}}]),n}(l.View);function nt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var rt=function(t){(0,d.Z)(n,t);var e=nt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(t){var e=this.collection,n=t.config||{},r=n.em,i=n.stylePrefix||'',o=n.pStylePrefix||'';this.config=n,this.pfx=i,this.ppfx=o,this.propertyView=t.propertyView,this.className="".concat(i,"layers ").concat(o,"field"),this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.reset),this.items=[];var a=r?r.get('Utils'):'';this.sorter=a?new a.Sorter({container:this.el,ignoreViewChildren:1,containerSel:".".concat(i,"layers"),itemSel:".".concat(i,"layer"),pfx:n.pStylePrefix}):'',e.view=this,this.$el.data('model',e),this.$el.data('collection',e)}},{key:"addTo",value:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)}},{key:"addToCollection",value:function(t,e,n){var r=e||null,i=this.propertyView,o=this.config,a=this.sorter,s=this.$el,l=new et({model:t,config:o,sorter:a,propertyView:i}),c=l.render().el;if(this.items.push(l),r)r.appendChild(c);else if(void 0!==n){var u='before';s.children().length===n&&(n--,u='after'),n<0?s.append(c):s.children().eq(n)[u](c)}else s.append(c);return c}},{key:"reset",value:function(t,e){this.clearItems(e),this.render()}},{key:"remove",value:function(){this.clearItems(),l.View.prototype.remove.apply(this,arguments)}},{key:"clearItems",value:function(){this.items.forEach((function(t){return t.remove()})),this.items=[]}},{key:"render",value:function(){var t=this,e=this.$el,n=this.sorter,r=document.createDocumentFragment();return e.empty(),this.collection.forEach((function(e){return t.addToCollection(e,r)})),e.append(r),e.attr('class',this.className),n&&(n.plh=null),this}}]),n}(l.View);function it(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ot(t){for(var e=1;e\n \n
\n \n ")}},{key:"init",value:function(){var t=this.model;this.listenTo(t.__getLayers(),'change reset',this.updateStatus)}},{key:"addLayer",value:function(){this.model.addLayer({},{at:0})}},{key:"setValue",value:function(){}},{key:"remove",value:function(){var t;null===(t=this.layersView)||void 0===t||t.remove(),Q.prototype.remove.apply(this,arguments)}},{key:"clearCached",value:function(){Q.prototype.clearCached.apply(this,arguments),this.layersView=null}},{key:"onRender",value:function(){var t=this.model,e=this.el,n=this.config,r=t.get('properties');if(r.length&&!this.props){var i=new K({config:ot(ot({},n),{},{highlightComputed:!1,highlightChanged:!1}),collection:r,parent:this});i.render();var o=new rt({collection:t.__getLayers(),config:n,propertyView:this});o.render(),e.querySelector('[data-layers-wrapper]').appendChild(o.el),this.props=i,this.layersView=o}}}]),n}(Q);function lt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ct(t){for(var e=1;e\n
\n
\n \n
\n
\n
\n
\n
\n
").concat(i,"
\n
\n \n ")}},{key:"__setValueInput",value:function(t){var e=this.model,n=this.el,r=e.getDefaultValue(),i=n.querySelector('[data-preview-box]'),o=n.querySelector('[data-preview]');i.style.display=t&&t!==r?'':'none',o.style.backgroundImage=t||e.getDefaultValue()}},{key:"openAssetManager",value:function(){var t,e=this,n=null===(t=this.em)||void 0===t?void 0:t.get('AssetManager');null==n||n.open({select:function(t,r){var i=(0,o.isString)(t)?t:t.get('src');e.model.upValue(i,{partial:!r}),r&&n.close()},types:['image'],accept:'image/*'})}}]),n}($);function ht(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var pt=function(t){(0,d.Z)(n,t);var e=ht(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"templateInput",value:function(){return''}},{key:"init",value:function(){var t=this.model;this.listenTo(t,'change:unit',this.onValueChange),this.listenTo(t,'change:units',this.render)}},{key:"setValue",value:function(){}},{key:"onRender",value:function(){var t=this.ppfx,e=this.model,n=this.el;if(!this.inputInst){var r=e.input;r.ppfx=t,r.render(),n.querySelector(".".concat(t,"fields")).appendChild(r.el),this.input=r.inputEl.get(0),this.inputInst=r}}},{key:"clearCached",value:function(){$.prototype.clearCached.apply(this,arguments),this.inputInst=null}}]),n}($),dt=n(1511);function gt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var vt=function(t){(0,d.Z)(n,t);var e=gt(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"setValue",value:function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})}},{key:"remove",value:function(){var t=this;pt.prototype.remove.apply(this,arguments);var e=this.inputInst;e&&e.remove&&e.remove(),['inputInst','$color'].forEach((function(e){return t[e]=null}))}},{key:"__handleChange",value:function(t,e){this.model.upValue(t,{partial:e})}},{key:"onRender",value:function(){if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var t=this.ppfx,e=this.model,n=this.em,r=this.el,i=new dt.Z({target:n,model:e,ppfx:t,onChange:this.__handleChange}).render();r.querySelector(".".concat(t,"fields")).appendChild(i.el),this.input=i.inputEl.get(0),this.inputInst=i}}}]),n}(pt);function mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yt(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[];return this.set('options',t),this}},{key:"addOption",value:function(t){if(t){var e=this.getOptions();this.setOptions([].concat((0,r.Z)(e),[t]))}return this}},{key:"getOptionId",value:function(t){return(0,a.isDef)(t.id)?t.id:t.value}},{key:"getOptionLabel",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.locale,i=void 0===r||r,a=((0,o.isString)(t)?this.getOption(t):t)||{},s=this.getOptionId(a),l=a.label||a.name||s,c=this.getId();return i&&(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.options.".concat(c,".").concat(s)))||l}},{key:"initialize",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n\n \n
\n
\n
\n \n ")}},{key:"initialize",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n").concat(i,""))}));var i=this.el.querySelector("#".concat(e,"input-holder"));i.innerHTML=""),this.input=i.firstChild}}},{key:"__setValueInput",value:function(t){var e=this.model,n=this.getInputEl(),r=e.getOptions()[0],i=r?e.getOptionId(r):'';n&&(n.value=t||i)}}]),n}($);function Ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ct(t){for(var e=1;e")}},{key:"onRender",value:function(){var t=this.pfx,e=this.ppfx,n=this.model,r="".concat(e,"radio-item-label"),i=n.getName(),o=n.getOptions(),a="".concat(t,"radio ").concat(t,"radio-").concat(i),s=n.cid;if(!this.input){var l=[];o.forEach((function(o){var c=o.className?"".concat(o.className," ").concat(t,"icon ").concat(r):'',u=n.getOptionId(o),f="".concat(i,"-").concat(u,"-").concat(s),h=c?'':n.getOptionLabel(u),p=o.title?"title=\"".concat(o.title,"\""):'',d=n.getValue()===u?'checked':'';l.push("\n
\n \n \n
\n "))}));var c=this.el.querySelector(".".concat(e,"field"));c.innerHTML="
").concat(l.join(''),"
"),this.input=c.firstChild}}},{key:"__setValueInput",value:function(t){var e,n=this.model,r=t||n.getDefaultValue(),i=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector("[value=\"".concat(r,"\"]"));i&&(i.checked=!0)}}]),n}(xt),Et=n(7610);function jt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function At(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x.callParentInit(x,this,t,e);var n=this.get('unit'),r=this.get('units');this.input=(0,a.hasWin)()&&new Et.Z({model:this}),r.length&&!n&&this.set('unit',r[0],{silent:1}),x.callInit(this,t,e)}},{key:"__getClearProps",value:function(){return At(At({},x.prototype.__getClearProps()),{},{unit:''})}},{key:"parseValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=x.prototype.parseValue.apply(this,arguments),r=this.input.validateInputValue(n.value,At({deepCheck:1},e)),i=r.value,o=r.unit;return n.value=i,n.unit=o,n}},{key:"getFullValue",value:function(){var t=this.get('value'),e=this.get('unit');return t=(0,o.isUndefined)(t)?'':t,e=!(0,o.isUndefined)(e)&&t?e:'',t="".concat(t).concat(e),x.prototype.getFullValue.apply(this,[t])}}]),n}(x);function Mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zt(t){for(var e=1;e\n \n \n ")}},{key:"getSliderEl",value:function(){return this.slider||(this.slider=this.el.querySelector('input[type=range]')),this.slider}},{key:"inputValueChanged",value:function(){this.model.upValue(this.getSliderEl().value)}},{key:"inputValueChangedSoft",value:function(){this.model.upValue(this.getSliderEl().value,{partial:!0})}},{key:"setValue",value:function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=''===t?e.getDefaultValue():parseFloat(n.value),pt.prototype.setValue.apply(this,arguments)}},{key:"onRender",value:function(){pt.prototype.onRender.apply(this,arguments),this.model.get('showInput')||(this.inputInst.el.style.display='none')}},{key:"clearCached",value:function(){pt.prototype.clearCached.apply(this,arguments),this.slider=null}}]),n}(pt);const Ht=c().Collection.extend(m.Z).extend({extendViewApi:1,init:function(){var t=this.opts,e=this.em,n=t.module||(null==e?void 0:e.get('StyleManager'));n&&(n.__listenAdd(this,n.events.propertyAdd),n.__listenRemove(this,n.events.propertyRemove))},types:[{id:'stack',model:V,view:st,isType:function(t){if(t&&'stack'==t.type)return t}},{id:'composite',model:P,view:Q,isType:function(t){if(t&&'composite'==t.type)return t}},{id:'file',model:x,view:ft,isType:function(t){if(t&&'file'==t.type)return t}},{id:'color',model:x,view:vt,isType:function(t){if(t&&'color'==t.type)return t}},{id:'select',model:wt,view:xt,isType:function(t){if(t&&'select'==t.type)return t}},{id:'radio',model:_t,view:Tt,isType:function(t){if(t&&'radio'==t.type)return t}},{id:'slider',model:Nt,view:Bt,isType:function(t){if(t&&'slider'==t.type)return t}},{id:'integer',model:Dt,view:pt,isType:function(t){if(t&&'integer'==t.type)return t}},{id:'number',model:Dt,view:pt,isType:function(t){if(t&&'number'==t.type)return t}},{id:'base',model:x,view:$,isType:function(t){return t.type='base',t}}]});var zt=["extend"];function Ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},r=n.em;this.em=r;var i=t||{},a=this.buildProperties(i.buildProps),s=this.get('name')||'',l=[];!this.get('id')&&this.set('id',s.replace(/ /g,'_').toLowerCase()),l=(l=a?this.extendProperties(a):this.get('properties').map((function(t){return(0,o.isString)(t)?e.buildProperties(t)[0]:t})).filter(Boolean)).map((function(t){return e.checkExtend(t)}));var c=new Ht(l,{em:r});c.sector=this,this.set('properties',c)}},{key:"getId",value:function(){return this.get('id')}},{key:"getName",value:function(){var t,e=this.getId();return(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.sectors.".concat(e)))||this.get('name')}},{key:"setName",value:function(t){return this.set('name',t)}},{key:"isOpen",value:function(){return!!this.get('open')}},{key:"setOpen",value:function(t){return this.set('open',t)}},{key:"isVisible",value:function(){return!!this.get('visible')}},{key:"getProperties",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('properties'),n=e.models?(0,r.Z)(e.models):e;return n.filter((function(e){var n=!0;(t.withValue&&(n=e.hasValue({noParent:!0})),t.withParentValue)&&(n=!e.hasValue({noParent:!0})&&e.hasValue());return n}))}},{key:"getProperty",value:function(t){return this.getProperties().filter((function(e){return e.get('id')===t}))[0]||null}},{key:"addProperty",value:function(t,e){return this.get('properties').add(this.checkExtend(t),e)}},{key:"extendProperties",value:function(t,e,n){for(var r=t.length,i=e||this.get('properties'),a=this.get('extendBuilded'),s=[],l=0,c=i.length;l1&&void 0!==arguments[1]?arguments[1]:{},n=e.module,r=e.em;this.em=r,this.module=n,this.listenTo(this,'reset',this.onReset)}},{key:"model",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.collection.em;return new qt(t,Kt(Kt({},e),{},{em:n}))}},{key:"onReset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels||[];n.forEach((function(t){return t.get('properties').reset()}))}}]),n}(l.Collection),Jt=n(885),Qt=["extend"];function te(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ee(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.from||'',i=this.props[r||t]||{},a=ee(ee({},i),{},{property:t},e);return a.properties&&(0,o.isFunction)(a.properties)&&(a.properties=a.properties()),this.props[t]=a,a}},{key:"get",value:function(t){return this.props[t]||null}},{key:"build",value:function(t){var e=this,n=[];return((0,o.isString)(t)?[t]:t).forEach((function(t){n.push(e.get(t)||{property:t})})),n}}]),t}(),oe=n(168),ae=n(7539);function se(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var le=function(t){(0,d.Z)(n,t);var e=se(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"template",value:function(t){var e,n=t.pfx,r=t.label,i=null===(e=this.em)||void 0===e?void 0:e.getConfig().icons,o=(null==i?void 0:i.caret)||'',a="".concat(n,"sector-");return(0,ae.Z)(ne||(ne=(0,oe.Z)(["\n
\n
$","
\n
","
\n
\n "])),a,a,o,a,r)}},{key:"events",value:function(){return{'click [data-sector-title]':'toggle'}}},{key:"initialize",value:function(t){var e=t.config||{},n=this.model,r=e.em;this.config=e,this.em=r,this.pfx=e.stylePrefix||'',this.listenTo(n,'destroy remove',this.remove),this.listenTo(n,'change:open',this.updateOpen),this.listenTo(n,'change:visible',this.updateVisibility)}},{key:"updateOpen",value:function(){var t=this.$el,e=this.model,n=this.pfx,r=e.isOpen();t[r?'addClass':'removeClass']("".concat(n,"open")),this.getPropertiesEl().style.display=r?'':'none'}},{key:"updateVisibility",value:function(){this.el.style.display=this.model.isVisible()?'':'none'}},{key:"getPropertiesEl",value:function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)}},{key:"toggle",value:function(){var t=this.model;t.setOpen(!t.get('open'))}},{key:"renderProperties",value:function(){var t=this.model,e=this.config,n=t.get('properties');if(n){var r=new K({collection:n,config:e});this.$el.append(r.render().el)}}},{key:"render",value:function(){var t=this.pfx,e=this.model,n=this.$el,r=e.getId(),i=e.getName();return n.html(this.template({pfx:t,label:i})),this.renderProperties(),n.attr('class',"".concat(t,"sector ").concat(t,"sector__").concat(r," no-select")),this.updateOpen(),this}}]),n}(l.View);function ce(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var i=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var ue=function(t){(0,d.Z)(n,t);var e=ce(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,p.Z)(n,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.module,n=t.config,r=void 0===n?{}:n,i=this.collection;this.pfx=r.stylePrefix||'',this.ppfx=r.pStylePrefix||'',this.config=r,this.module=e,this.listenTo(i,'add',this.addTo),this.listenTo(i,'reset',this.render)}},{key:"remove",value:function(){var t=this;l.View.prototype.remove.apply(this,arguments),['config','module','em'].forEach((function(e){return t[e]={}}))}},{key:"addTo",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.addToCollection(t,null,n)}},{key:"addToCollection",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.config,i=this.el,o=e||i,a=new le({model:t,config:r}).render().el;return(0,q.$Q)(o,a,n.at),a}},{key:"render",value:function(){var t=this,e=this.$el,n=this.pfx,r=this.ppfx;e.empty();var i=document.createDocumentFragment();return this.collection.each((function(e){return t.addToCollection(e,i)})),e.append(i),e.addClass("".concat(n,"sectors ").concat(r,"one-bg ").concat(r,"two-color")),this}}]),n}(l.View);function fe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function he(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};(0,o.bindAll)(this,'__clearStateTarget'),this.__initConfig(u,r);var i=this.config,a=i.em,s=i.pStylePrefix;s&&(i.stylePrefix=s+i.stylePrefix),this.builtIn=new ie,t=new Ht([],{em:a,module:this}),e=new Xt([],he(he({},i),{},{module:this}));var c=new l.Model({targets:[]});this.model=c,this.__listenAdd(e,ve),this.__listenRemove(e,me),this.__listenUpdate(e,ye);var f='component:toggled component:update:classes change:state change:device frame:resized selector:type';this.upAll=(0,o.debounce)((function(){return n.__upSel()})),c.listenTo(a,f,this.upAll),c.listenTo(a,'component:toggled',this.__clearStateTarget);var h=(0,o.debounce)((function(){n.__upProps(),n.__trgCustom()}));c.listenTo(a,'styleable:change undo redo',h);var p=(0,o.debounce)((function(){return n.__trgCustom()}));return c.listenTo(a,"".concat(Oe," ").concat(Ce),p),c.on('change:lastTarget',(function(){return a.trigger(Ce,n.getSelected())})),this},__upSel:function(){this.select(this.em.getSelectedAll())},__trgCustom:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},__trgEv:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{},i=this.getSector(t);return i||(n.id=t,i=e.add(n,r)),i},getSector:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.where({id:t})[0];return!r&&n.warn&&this._logNoSector(t),r||null},getSectors:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e&&e.models?t.array?(0,r.Z)(e.models):e:[];return t.visible?n.filter((function(t){return t.isVisible()})):n},removeSector:function(t){return this.getSectors().remove(this.getSector(t,{warn:1}))},addProperty:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getSector(t,{warn:1}),i=null;return r&&(i=r.addProperty(e,n)),i},getProperty:function(t,e){var n,r=this.getSector(t,{warn:1});return r&&(n=r.get('properties').filter((function(t){return t.get('property')===e||t.get('id')===e}))[0]),n||null},getProperties:function(t){var e=null,n=this.getSector(t,{warn:1});return n&&(e=n.get('properties')),e},removeProperty:function(t,e){var n=this.getProperties(t);return n?n.remove(this.getProperty(t,e)):null},select:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=(0,o.isArray)(t)?t:[t],s=n.stylable,l=r.get('CssComposer'),c=[];i.filter(Boolean).forEach((function(t){var e=t;if((0,o.isString)(t)){var n=l.getRule(t)||l.setRule(t);!(0,o.isUndefined)(s)&&n.set({stylable:s}),e=n}c.push(e)}));var u=n.component||c.filter((function(t){return(0,a.isComponent)(t)})).reverse()[0];c=c.map((function(t){return e.getModelToStyle(t)}));var f=r.getState(),h=c.slice().reverse()[0],p=this.getParentRules(h,{state:f,component:u}),d=this.__getStateTarget();return r.skip((function(){var t;if(f&&null!=h&&null!==(t=h.getState)&&void 0!==t&&t.call(h)){var e=h.getStyle();d?d.setStyle(e):d=l.getAll().add({selectors:'gjs-selected',style:e,shallow:!0,important:!0})}else d&&(l.remove(d),d=null)})),this.model.set({targets:c,lastTarget:h,lastTargetParents:p,stateTarget:d,component:u}),this.__upProps(n),c},getSelected:function(){return this.model.get('lastTarget')||null},getSelectedAll:function(){return this.model.get('targets')},getSelectedParents:function(){return this.model.get('lastTargetParents')||[]},__getStateTarget:function(){return this.model.get('stateTarget')||null},addStyleTargets:function(t,e){this.getSelectedAll().map((function(n){return n.addStyle(t,e)}));var n=this.getSelected(),r=this.__getStateTarget();n&&(null==r||r.setStyle(n.getStyle(),e))},getBuiltIn:function(t){return this.builtIn.get(t)},getBuiltInAll:function(){return this.builtIn.props},addBuiltIn:function(t,e){return this.builtIn.add(t,e)},getModelToStyle:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,i=n.skipAdd;if(r&&null!==(e=t)&&void 0!==e&&e.toHTML){var o,a=r.getConfig(),s=r.get('UndoManager'),l=r.get('CssComposer'),c=r.get('SelectorManager'),u=c?c.getConfig():{},f=a.devicePreviewMode?'':r.get('state'),h=t.get('classes'),p=h.getStyleable(),d=p.length,g=!u.componentFirst||n.useClasses,v={noCount:1},m={state:f,addOpts:v};if(s.stop(),d&&g){var y=r.getCurrentMedia();(o=l.get(p,f,y))||i||(o=l.add(p,f,y,{},v))}else if(a.avoidInlineStyle){var b=t.getId();!(o=l.getIdRule(b,m))&&!i&&(o=l.setIdRule(b,{},m)),t.is('wrapper')&&o.set('wrapper',1,v)}o&&(t=o),s.start()}return t},getParentRules:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state,r=e.component,i=this.em,a=[];if(i&&t){var s=r,l=i.get('CssComposer'),c=i.get('CodeManager').getGenerator('css'),u=t.toHTML?t:t.getComponent(),f={combination:!0,array:!0},h=[],p=[],d=[];u?(h=l.getRules("#".concat(u.getId())),d=(p=s?l.getRules(s.getSelectors().getFullName(f)):[]).concat(h)):(h=s?l.getRules("#".concat(s.getId())):[],p=l.getRules(t.getSelectors().getFullName(f)),d=h.concat(p));var g=d.filter((function(t){return(0,o.isUndefined)(n)?1:t.get('state')===n})).sort(c.sortRules).reverse();a=g.slice(g.indexOf(t)+1)}return a},addType:function(e,n){t.addType(e,n)},getType:function(e){return t.getType(e)},getTypes:function(){return t.getTypes()},createType:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.model,r=void 0===n?{}:n,i=e.view,o=void 0===i?{}:i,a=this.config,s=this.getType(t);if(s)return new s.view(he({model:new s.model(r),config:a},o))},render:function(){var t=this.config,r=this.em,i=n&&n.el;return(n=new ue({el:i,em:r,config:t,collection:e,module:this})).render().el},_logNoSector:function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},__upProps:function(t){var n=this,r=this.getSelected();if(r){var i=this.model.get('component'),o=this.getSelectedParents(),a=r.getStyle(),s=o.map((function(t){return{target:t,style:t.getStyle()}}));e.map((function(e){e.getProperties().map((function(e){n.__upProp(e,a,s,t)}))})),e.forEach((function(t){var n=t.getProperties();n.forEach((function(t){var n=t.__checkVisibility({target:r,component:i,sectors:e});t.set('visible',n)}));var o=n.some((function(t){return t.isVisible()}));t.set('visible',o)}))}},__upProp:function(t,e,n,r){var i=this,o=t.getName(),a=e[o],s=_e(a),l='stack'===t.getType(),c='composite'===t.getType(),u=he(he({},r),{},{__up:!0}),f=!c&&!l,h=l?t.__getLayersFromStyle(e):[],p=c?t.__getPropsFromStyle(e):{},d=s?a:null,g=null;if(l&&null===h||c&&null===p){var v=l?'__getLayersFromStyle':'__getPropsFromStyle',m=n.filter((function(e){return null!==t[v](e.style)}))[0];if(m){d=m.style[o],g=m.target;var y=t[v](m.style);l?h=y:p=y}}else if(!s){d=null;var b=n.filter((function(t){return _e(t.style[o])}))[0];b&&(d=b.style[o],g=b.target)}if(t.__setParentTarget(g),f&&t.__getFullValue()!==d&&t.upValue(d,u),l&&t.__setLayers(h||[]),c){var w=t.getProperties();if(t.isDetached()){var k=t.__getPropsFromStyle(e,{byName:!0})||{},x=n.map((function(e){return he(he({},e),{},{style:t.__getPropsFromStyle(e.style,{byName:!0})||{}})}));w.map((function(t){return i.__upProp(t,k,x,r)}))}else t.__setProperties(p||{},u),t.getProperties().map((function(t){return t.__setParentTarget(g)}))}},destroy:function(){[t,e].forEach((function(t){t.reset(),t.stopListening()})),n&&n.remove(),this.model.stopListening(),this.upAll.cancel(),this.em={},this.config={},this.builtIn={},this.model={}}})}},6388:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>z,evAll:()=>V,evCustom:()=>H,evPfx:()=>B});var r=n(4942),i=n(9050),o=n(9304),a=n(2316),s=n.n(a);const l={stylePrefix:'trt-',appendTo:'',optionsTarget:[{value:!1},{value:'_blank'}]};var c=n(5671),u=n(3144),f=n(7326),h=n(9340),p=n(2963),d=n(1120),g=n(6602),v=n(885),m=n(1163);function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};(0,c.Z)(this,n),t=e.call(this,i),(0,r.Z)((0,f.Z)(t),"events",{}),(0,r.Z)((0,f.Z)(t),"appendInput",!0);var o=i.config,a=void 0===o?{}:o,s=(0,f.Z)(t),l=s.model,u=s.eventCapture,h=l.target,p=l.attributes.type;t.config=a,t.em=a.em,t.pfx=a.stylePrefix||'',t.ppfx=a.pStylePrefix||'',t.target=h;var d=(0,f.Z)(t),g=d.ppfx;return t.clsField="".concat(g,"field ").concat(g,"field-").concat(p),[['change:value',t.onValueChange],['remove',t.removeView]].forEach((function(e){var n=(0,v.Z)(e,2),r=n[0],i=n[1];l.off(r,i),t.listenTo(l,r,i)})),l.view=(0,f.Z)(t),t.listenTo(l,'change:label',t.render),t.listenTo(l,'change:placeholder',t.rerender),t.events={},u.forEach((function(e){return t.events[e]='onChange'})),t.delegateEvents(),t.init(),t}return(0,u.Z)(n,[{key:"attributes",value:function(){return this.model.get('attributes')}},{key:"templateLabel",value:function(){var t=this.ppfx,e=this.getLabel();return"
").concat(e,"
")}},{key:"templateInput",value:function(){var t=this.clsField;return"
")}},{key:"getClbOpts",value:function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}}},{key:"removeView",value:function(){this.remove(),this.removed()}},{key:"init",value:function(){}},{key:"removed",value:function(){}},{key:"onRender",value:function(){}},{key:"onUpdate",value:function(){}},{key:"onEvent",value:function(){}},{key:"onChange",value:function(t){var e=this.getInputElem();e&&!(0,i.isUndefined)(e.value)&&this.model.set('value',e.value),this.onEvent(b(b({},this.getClbOpts()),{},{event:t}))}},{key:"getValueForTarget",value:function(){return this.model.get('value')}},{key:"setInputValue",value:function(t){var e=this.getInputElem();e&&(e.value=t)}},{key:"onValueChange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n.fromTarget)this.setInputValue(t.get('value')),this.postUpdate();else{var r=this.getValueForTarget();t.setTargetValue(r,n)}}},{key:"renderLabel",value:function(){var t=this.$el,e=this.target,n=this.getLabel(),r=this.templateLabel(e);this.createLabel&&(r=this.createLabel({label:n,component:e,trait:this})||''),t.find('[data-label]').append(r)}},{key:"getLabel",value:function(){var t=this.em,e=this.model.attributes,n=e.label,r=e.name;return t.t("traitManager.traits.labels.".concat(r))||(0,m.capitalize)(n||r).replace(/-/g,' ')}},{key:"getComponent",value:function(){return this.target}},{key:"getInputEl",value:function(){if(!this.$input){var t=this.em,e=this.model,n=e,r=e.attributes.name,o=n.get('placeholder')||n.get('default')||'',a=n.get('type')||'text',s=n.get('min'),l=n.get('max'),c=this.getModelValue(),u=k("")),f=t.t("traitManager.traits.attributes.".concat(r))||{};u.attr(f),(0,i.isUndefined)(c)||(n.set({value:c},{silent:!0}),u.prop('value',c)),s&&u.prop('min',s),l&&u.prop('max',l),this.$input=u}return this.$input.get(0)}},{key:"getInputElem",value:function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()}},{key:"getModelValue",value:function(){var t,e=this.model,n=this.target,r=e.get('name');if(e.get('changeProp'))t=n.get(r);else{var o=n.get('attributes');t=e.get('value')||o[r]}return(0,i.isUndefined)(t)?'':t}},{key:"getElInput",value:function(){return this.elInput}},{key:"renderField",value:function(){var t=this.$el,e=this.appendInput,n=this.model,r=t.find('[data-input]'),o=r[r.length-1],a=n.el;a||(a=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,i.isString)(a)?(o.innerHTML=a,this.elInput=o.firstChild):(e?o.appendChild(a):o.insertBefore(a,o.firstChild),this.elInput=a),n.el=this.elInput}},{key:"hasLabel",value:function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t}},{key:"rerender",value:function(){this.model.el=null,this.render()}},{key:"postUpdate",value:function(){this.onUpdate(this.getClbOpts())}},{key:"render",value:function(){var t=this.$el,e=this.pfx,n=this.ppfx,r=this.model.attributes,o=r.type,a=r.id,s=this.hasLabel&&this.hasLabel(),l="".concat(e,"trait");this.$input=null;var c="
\n ").concat(s?"
"):'',"\n
\n ").concat(this.templateInput?(0,i.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:'',"\n
\n
");return t.empty().append(c),s&&this.renderLabel(),this.renderField(),this.el.className="".concat(l,"__wrp ").concat(l,"__wrp-").concat(a),this.postUpdate(),this.onRender(this.getClbOpts()),this}}]),n}(s().View);function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}x.prototype.eventCapture=['change'];var C=function(t){(0,h.Z)(n,t);var e=O(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;(0,c.Z)(this,n),t=e.call(this,i),(0,r.Z)((0,f.Z)(t),"reuseView",!0),t.itemsView=o;var a=i.config||{},s=a.stylePrefix||'',l=i.editor;return t.config=a,t.em=l,t.pfx=s,t.ppfx=a.pStylePrefix||'',t.className="".concat(s,"traits"),t.listenTo(l,'component:toggled',t.updatedCollection),t.updatedCollection(),t}return(0,u.Z)(n,[{key:"updatedCollection",value:function(){var t=this.ppfx,e=this.className,n=this.em.getSelected();this.el.className="".concat(e," ").concat(t,"one-bg ").concat(t,"two-color"),this.collection=n?n.get('traits'):[],this.render()}}]),n}(g.Z);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}C.prototype.itemView=x;var _=s().$,P=function(t){(0,h.Z)(n,t);var e=S(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,c.Z)(this,n),(t=e.call(this,r)).listenTo(t.model,'change:options',t.rerender),t}return(0,u.Z)(n,[{key:"templateInput",value:function(){var t=this.ppfx,e=this.clsField;return"
\n
\n
\n
\n
\n
")}},{key:"getInputEl",value:function(){if(!this.$input){var t=this.model,e=this.em,n=t.get('name'),r=t.get('options')||[],o=[],a='',this.$input=_(a);var s=t.getTargetValue(),l=o.indexOf(s)>=0?s:t.get('default');!(0,i.isUndefined)(l)&&this.$input.val(l)}return this.$input.get(0)}}]),n}(x);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.Z)(t);if(e){var i=(0,d.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var E=function(t){(0,h.Z)(n,t);var e=T(n);function n(){var t;(0,c.Z)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a\n \n ")}},{key:"onChange",value:function(){var t=this.getInputElem().checked;this.model.set('value',this.getCheckedValue(t))}},{key:"getCheckedValue",value:function(t){var e=t,n=this.model.attributes,r=n.valueTrue,o=n.valueFalse;return e&&!(0,i.isUndefined)(r)&&(e=r),e||(0,i.isUndefined)(o)||(e=o),e}},{key:"getInputEl",value:function(){for(var t=!this.$input,e=arguments.length,n=new Array(e),r=0;r").concat(a,"")}}]),n}(x);function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function F(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.__initConfig(l,n);var r=this.config,o=new a.Model;this.model=o;var s=this.em,c=r.pStylePrefix;this.types=F({},t),c&&(r.stylePrefix="".concat(c).concat(r.stylePrefix));var u=(0,i.debounce)((function(){return e.__upSel()}));o.listenTo(s,'component:toggled',u);var f=(0,i.debounce)((function(){return e.__onUp()}));return o.listenTo(s,'trait:update',f),this},__upSel:function(){this.select(this.em.getSelected())},__onUp:function(){this.select(this.getSelected())},select:function(t){var e=t?t.getTraits():[];this.model.set({component:t,traits:e}),this.__trgCustom()},getSelected:function(){return this.model.get('component')||null},getCurrent:function(){return this.model.get('traits')||[]},__trgCustom:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},postRender:function(){this.__appendTo()},getTraitsViewer:function(){return this.view},addType:function(t,e){var n=this.getType('text');this.types[t]=n.extend(e)},getType:function(t){return this.getTypes()[t]},getTypes:function(){return this.types},render:function(){var t=this.view,e=this.getConfig(),n=t&&t.el;return t=new C({el:n,collection:[],editor:e.em,config:e},this.getTypes()),this.view=t,t.el},destroy:function(){this.__destroy()}})}},8202:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(2982),i=n(4942),o=n(3410),a=n.n(o),s=n(9050);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};n=c(c({},o),h),t=n.em,this.em=t,n._disable&&(n=c(c({},n),{},{maximumStackLength:0}));var p=!0;return(e=new(a())(c({track:!0,register:[]},n))).changeUndoType('change',{condition:function(t){var e=t.get('_undo');if(e){var n=t.get('_undoexc');if((0,s.isArray)(n)&&u(t).some((function(t){return n.indexOf(t)>=0})))return!1;if((0,s.isBoolean)(e))return!0;if((0,s.isArray)(e)&&u(t).some((function(t){return e.indexOf(t)>=0})))return!0}return!1},on:function(t,e,n){!i&&(i=t.previousAttributes());var r=n||e||{};if(r.noUndo&&setTimeout((function(){i=null})),!l(r)){var o=t.toJSON({fromUndo:p}),a={object:t,before:i,after:o};if(i=null,!(0,s.isEmpty)(o))return a}}}),e.changeUndoType('add',{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!l(n)&&f.isRegistered(e))return{object:e,before:void 0,after:t,options:c(c({},n),{},{fromUndo:p})}}}),e.changeUndoType('remove',{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!l(n)&&f.isRegistered(e))return{object:e,before:t,after:void 0,options:c(c({},n),{},{fromUndo:p})}}}),e.changeUndoType('reset',{undo:function(t,e){t.reset(e,{fromUndo:p})},redo:function(t,e,n){t.reset(n,{fromUndo:p})},on:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!l(e)&&f.isRegistered(t))return{object:t,before:e.previousModels,after:(0,r.Z)(t.models),options:c(c({},e),{},{fromUndo:p})}}}),e.on('undo redo',(function(){t.trigger('change:canvasOffset'),t.getSelectedAll().map((function(t){return t.trigger('rerender:layer')}))})),['undo','redo'].forEach((function(n){return e.on(n,(function(){return t.trigger(n)}))})),this},postLoad:function(){n.trackSelection&&t&&this.add(t.get('selected'))},getConfig:function(){return n},add:function(t){return e.register(t),this},remove:function(t){return e.unregister(t),this},removeAll:function(){return e.unregisterAll(),this},start:function(){return e.startTracking(),this},stop:function(){return e.stopTracking(),this},undo:function(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!t.isEditing()&&e.undo(n),this},undoAll:function(){return e.undoAll(),this},redo:function(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!t.isEditing()&&e.redo(n),this},redoAll:function(){return e.redoAll(),this},hasUndo:function(){return e.isAvailable('undo')},hasRedo:function(){return e.isAvailable('redo')},isRegistered:function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},getStack:function(){return e.stack},getStackGroup:function(){var t=[],e=[];return this.getStack().forEach((function(n){var r=n.get('magicFusionIndex');e.indexOf(r)<0&&(e.push(r),t.push(n))})),t},skip:function(t){this.stop(),t(),this.start()},getGroupedStack:function(){var t={},e=this.getStack();return e.forEach((function(e,n){var r=e.get('magicFusionIndex'),i=function(t,e){var n=t.attributes,r=n.type,i=n.after,o=n.before,a=n.object,s=n.options;return{index:e,type:r,after:i,before:o,object:a,options:void 0===s?{}:s}}(e,n);t[r]?t[r].push(i):t[r]=[i]})),Object.keys(t).map((function(e){var n=t[e];return{index:n[n.length-1].index,actions:n,labels:(0,s.unique)(n.reduce((function(t,e){var n,r=null===(n=e.options)||void 0===n?void 0:n.action;return r&&t.push(r),t}),[]))}}))},goToGroup:function(t){var e=this;if(t){var n=this.getPointer(),r=t.index-n;(0,s.times)(Math.abs(r),(function(){e[r<0?'undo':'redo'](!1)}))}},getPointer:function(){return this.getStack().pointer},clear:function(){return e.clear(),this},getInstance:function(){return e},destroy:function(){this.clear().removeAll(),[t,e,n,i].forEach((function(t){return{}})),this.em={}}}}},5610:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(4942),i=n(5671),o=n(3144),a=n(9050),s=n(1163);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return(0,i.Z)(this,t),this.opts={container:null,onStart:null,onDrag:null,onEnd:null,setPosition:null,getPosition:null,guidesStatic:null,guidesTarget:null,snapOffset:5,doc:0,scale:1},(0,a.bindAll)(this,'drag','stop','keyHandle','handleScroll'),this.setOptions(e),this.delta={x:0,y:0},this}return(0,o.Z)(t,[{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=c(c({},this.opts),t)}},{key:"toggleDrag",value:function(t){var e=this.getDocumentEl(),n=this.getContainerEl(),r=this.getWindowEl(),i=t?'on':'off',o={on:s.on,off:s.off};o[i](n,'mousemove dragover',this.drag),o[i](e,'mouseup dragend touchend',this.stop),o[i](e,'keydown',this.keyHandle),o[i](r,'scroll',this.handleScroll)}},{key:"handleScroll",value:function(){var t=this.lastScroll,e=this.delta,n=this.getScrollInfo(),r={x:n.x-t.x,y:n.y-t.y};this.move(e.x+r.x,e.y+r.y),this.lastScrollDiff=r}},{key:"start",value:function(t){var e=this.opts,n=e.onStart;this.toggleDrag(1),this.startPointer=this.getPointerPos(t),this.guidesStatic=(0,a.result)(e,'guidesStatic')||[],this.guidesTarget=(0,a.result)(e,'guidesTarget')||[],(0,a.isFunction)(n)&&n(t,this),this.startPosition=this.getStartPosition(),this.lastScrollDiff={x:0,y:0},this.globScrollDiff={x:0,y:0},this.drag(t)}},{key:"drag",value:function(t){var e=this,n=this.opts,r=this.lastScrollDiff,i=this.globScrollDiff,o=n.onDrag,s=this.startPointer,l=this.getPointerPos(t),u={x:i.x+r.x,y:i.y+r.y};this.globScrollDiff=u;var f={x:l.x-s.x+u.x,y:l.y-s.y+u.y};this.lastScrollDiff={x:0,y:0};var h=this.lockedAxis;'x'===(h=t.shiftKey?!h&&this.detectAxisLock(f.x,f.y):null)?f.x=s.x:'y'===h&&(f.y=s.y);var p=function(r){['x','y'].forEach((function(t){return r[t]=r[t]*(0,a.result)(n,'scale')})),e.delta=r,e.move(r.x,r.y),(0,a.isFunction)(o)&&o(t,e)},d=c({},f);if(this.currentPointer=l,this.lockedAxis=h,this.lastScroll=this.getScrollInfo(),p(f),this.guidesTarget.length){var g=this.snapGuides(d),v=g.newDelta,m=g.trgX,y=g.trgY;(m||y)&&p(v)}0===t.which&&this.stop(t)}},{key:"snapGuides",value:function(t){var e=this,n=t,r=this.trgX,i=this.trgY;return this.guidesTarget.forEach((function(n){n.x&&e.trgX||n.y&&e.trgY||(n.active=0,e.guidesStatic.forEach((function(o){if(!(n.y&&o.x||n.x&&o.y)){var s=n.y&&o.y,l=s?'y':'x',c=n[l],u=o[l],f=t[l],h=s?i:r;if(e.isPointIn(c,u)&&(0,a.isUndefined)(h)){var p=f-(c-u);e.setGuideLock(n,p)}}})))})),r=this.trgX,i=this.trgY,['x','y'].forEach((function(r){var i=r.toUpperCase(),o=e["trg".concat(i)];o&&!e.isPointIn(t[r],o.lock)&&(e.setGuideLock(o,null),o=null),o&&!(0,a.isUndefined)(o.lock)&&(n[r]=o.lock)})),{newDelta:n,trgX:this.trgX,trgY:this.trgY}}},{key:"isPointIn",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.offset,i=r||this.opts.snapOffset;return t>=e&&t<=e+i||t<=e&&t>=e-i}},{key:"setGuideLock",value:function(t,e){var n=(0,a.isUndefined)(t.x)?'Y':'X',r="trg".concat(n);return null!==e?(t.active=1,t.lock=e,this[r]=t):(delete t.active,delete t.lock,delete this[r]),t}},{key:"stop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.delta,r=e.cancel,i=r?0:n.x,o=r?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,o,1);var s=this.opts.onEnd;(0,a.isFunction)(s)&&s(t,this,{cancelled:r})}},{key:"keyHandle",value:function(t){(0,s.isEscKey)(t)&&this.stop(t,{cancel:1})}},{key:"move",value:function(t,e,n){var r=this.el,i=this.opts,o=this.startPosition;if(o){var s=i.setPosition,l=o.x+t,c=o.y+e;this.position={x:l,y:c,end:n},(0,a.isFunction)(s)&&s(this.position),r&&(r.style.left="".concat(l,"px"),r.style.top="".concat(c,"px"))}}},{key:"getContainerEl",value:function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()}},{key:"getWindowEl",value:function(){return this.getContainerEl().map((function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow}))}},{key:"getDocumentEl",value:function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs}},{key:"getPointerPos",value:function(t){var e=this.opts.getPointerPosition,n=(0,s.getPointerEvent)(t);return e?e(t):{x:n.clientX,y:n.clientY}}},{key:"getStartPosition",value:function(){var t=this.el,e=this.opts.getPosition,n={x:0,y:0};return(0,a.isFunction)(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n}},{key:"getScrollInfo",value:function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}}},{key:"detectAxisLock",value:function(t,e){var n=t,r=e,i=Math.abs(n),o=Math.abs(r);return r>=i||r<=-i?'x':n>o||n<-o?'y':void 0}}]),t}()},2579:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>vt});var r='undefined'!=typeof document?document:null,i='undefined'!=typeof window?window:null,o=Array.prototype,a=o.filter,s=o.indexOf,l=o.map,c=o.push,u=o.reverse,f=o.slice,h=o.splice,p=/^#[\w-]*$/,d=/^\.[\w-]*$/,g=/<.+>/,v=/^\w+$/;function m(t,e){return void 0===e&&(e=r),d.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function y(t,e){if(void 0===e&&(e=r),t){if(t.__cash)return t;var n=t;if(T(t)){if(e.__cash&&(e=e[0]),!(n=p.test(t)?e.getElementById(t.slice(1)):g.test(t)?pt(t):m(t,e)))return}else if(P(t))return this.ready(t);(n.nodeType||n===i)&&(n=[n]),this.length=n.length;for(var o=0,a=this.length;o=0})):n.value=i}))},w.clone=function(){return this.map((function(t,e){return e.cloneNode(!0)}))},w.detach=function(){return this.each((function(t,e){e.parentNode&&e.parentNode.removeChild(e)}))};var ut,ft=/^\s*<(\w+)[^>]*>/,ht=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function pt(t){if(function(){if(!ut){var t=r.createElement('table'),e=r.createElement('tr');ut={'*':r.createElement('div'),tr:r.createElement('tbody'),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!T(t))return[];if(ht.test(t))return[r.createElement(RegExp.$1)];var e=ft.test(t)&&RegExp.$1,n=ut[e]||ut['*'];return n.innerHTML=t,b(n.childNodes).detach().get()}function dt(t,e,n){if(void 0!==e){var r=T(e);!r&&e.length?C(e,(function(e){return dt(t,e,n)})):C(t,r?function(t){t.insertAdjacentHTML(n?'afterbegin':'beforeend',e)}:function(t,r){return function(t,e,n){n?t.insertBefore(e,t.childNodes[0]):t.appendChild(e)}(t,r?e.cloneNode(!0):e,n)})}}b.parseHTML=pt,w.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},w.append=function(){var t=this;return C(arguments,(function(e){dt(t,e)})),this},w.appendTo=function(t){return dt(b(t),this),this},w.html=function(t){if(void 0===t)return this[0]&&this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each((function(t,n){n.innerHTML=e}))},w.insertAfter=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,i){r.insertBefore(t?i.cloneNode(!0):i,n.nextSibling)}))})),this},w.after=function(){var t=this;return C(u.apply(arguments),(function(e){u.apply(b(e).slice()).insertAfter(t)})),this},w.insertBefore=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,i){r.insertBefore(t?i.cloneNode(!0):i,n)}))})),this},w.before=function(){var t=this;return C(arguments,(function(e){b(e).insertBefore(t)})),this},w.prepend=function(){var t=this;return C(arguments,(function(e){dt(t,e,!0)})),this},w.prependTo=function(t){return dt(b(t),u.apply(this.slice()),!0),this},w.remove=function(){return this.detach().off()},w.replaceWith=function(t){var e=this;return this.each((function(n,r){var i=r.parentNode;if(i){var o=n?b(t).clone():b(t);if(!o[0])return e.remove(),!1;i.replaceChild(o[0],r),b(o[0]).after(o.slice(1))}}))},w.replaceAll=function(t){return b(t).replaceWith(this),this},w.text=function(t){return void 0===t?this[0]?this[0].textContent:'':this.each((function(e,n){n.textContent=t}))};var gt=r&&r.documentElement;w.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+i.pageYOffset-gt.clientTop,left:e.left+i.pageXOffset-gt.clientLeft}}},w.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},w.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},w.children=function(t){var e=[];return this.each((function(t,n){c.apply(e,n.children)})),e=b(M(e)),t?e.filter((function(e,n){return _(n,t)})):e},w.contents=function(){var t=[];return this.each((function(e,n){c.apply(t,'IFRAME'===n.tagName?[n.contentDocument]:n.childNodes)})),b(t.length&&M(t))},w.find=function(t){for(var e=[],n=0,r=this.length;n{"use strict";n.d(e,{$Q:()=>p,FW:()=>u,G1:()=>a,L_:()=>l,Mx:()=>s,R3:()=>d,SJ:()=>y,dL:()=>h,pn:()=>f,rw:()=>v,sE:()=>c,t3:()=>m,ut:()=>g});var r=n(9050),i='tag',o='attributes',a='transitionend oTransitionEnd transitionend webkitTransitionEnd',s=function(t){return t&&9===t.nodeType},l=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},c=function(t,e){return t.querySelectorAll(e)},u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&t.setAttribute&&(0,r.each)(e,(function(e,n){return t.setAttribute(n,e)}))},f=function(t){return t&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},h=function(t,e){t.parentNode.replaceChild(e,t)},p=function(t,e,n){var i=t.childNodes,o=i.length,a=(0,r.isUndefined)(n)?o:n;(0,r.isString)(e)&&(t.insertAdjacentHTML('beforeEnd',e),e=t.lastChild,t.removeChild(e)),a>=o?t.appendChild(e):t.insertBefore(e,i[a])},d=function(t,e){return p(t,e)},g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=document.createElement(t);return e&&(0,r.each)(e,(function(t,e){return i.setAttribute(e,t)})),n&&((0,r.isString)(n)?i.innerHTML=n:i.appendChild(n)),i},v=function(t){return document.createTextNode(t)},m=function(t,e){var n,r=t.type;try{n=new window[e](r,t)}catch(t){(n=document.createEvent(e)).initEvent(r,!0,!0)}return n._parentEvent=t,0===r.indexOf('key')&&(n.keyCodeVal=t.keyCode,['keyCode','which'].forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})}))),n},y=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Array.isArray(e)?e:[e];n.forEach((function(e){var n=e[i]||'div',a=e[o]||{},s=document.createElement(n);(0,r.each)(a,(function(t,e){s.setAttribute(e,t)})),t.appendChild(s)}))}},9661:(t,e,n)=>{"use strict";n.d(e,{Z:()=>m});var r=n(1002);const i=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))};const o=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError((0,r.Z)(t)+' '+t+' is not iterable(cannot read property Symbol(Symbol.iterator))'));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var o=i.length;function a(t,n){if(n&&('object'===(0,r.Z)(n)||'function'==typeof n)){var s=n.then;if('function'==typeof s)return void s.call(n,(function(e){a(t,e)}),(function(n){i[t]={status:'rejected',reason:n},0==--o&&e(i)}))}i[t]={status:'fulfilled',value:n},0==--o&&e(i)}for(var s=0;s{"use strict";n.r(e),n.d(e,{default:()=>C});var r=n(4942),i=n(5610),o=n(2316),a=n.n(o),s=n(9050),l=n(1163);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},s=this.em,c=this.itemSel,u=this.containerSel,f=this.plh,h=this.getContainerEl(a.container),p=this.getDocuments(t);this.dropModel=null,this.target=null,this.prevTarget=null,this.moved=0,t&&!this.matches(t,"".concat(c,", ").concat(u))&&(t=this.closest(t,c)),this.sourceEl=t,f||(this.plh=this.createPlaceholder(),h.appendChild(this.plh)),t&&((o=this.getSourceModel(t))&&o.set&&o.set('status','freezed'),this.srcModel=o),(0,l.on)(h,'mousemove dragover',this.onMove),(0,l.on)(p,'mouseup dragend touchend',this.endMove),(0,l.on)(p,'keydown',this.rollback),this.onStart({sorter:this,target:o,parent:o&&(null===(e=(n=o).parent)||void 0===e?void 0:e.call(n)),index:o&&(null===(r=(i=o).index)||void 0===r?void 0:r.call(i))}),null==s||s.clearSelection(),this.toggleSortCursor(1),null==s||s.trigger('sorter:drag:start',t,o)},getTargetModel:function(t){var e=t||this.target;return f(e).data('model')},getSourceModel:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.target,i=n.avoidChildren,o=void 0===i?1:i,a=this.em,s=this.sourceEl,l=t||s,c=this.dropModel,h=this.dropContent,p=function(t){return t&&r&&t.opt&&t.opt.avoidChildren&&e.isTextableActive(t,r)};if(h&&a){if(p(c)&&(c=null),!c){var d=a.get('DomComponents').getComponents(),g={avoidChildren:o,avoidStore:1,avoidUpdateStyle:1},v=d.add(h,u(u({},g),{},{temporary:1}));if(c=(c=d.remove(v,g))instanceof Array?c[0]:c,this.dropModel=c,p(c))return this.getSourceModel(l,{target:r,avoidChildren:0})}return c}return l&&f(l).data('model')},selectTargetModel:function(t,e){if(!(t instanceof a().Collection||e&&e===t)){var n=this.targetModel;n&&n!==this.srcModel&&n.set('status',''),t&&t.set&&(t.set('status','selected-parent'),this.targetModel=t)}},onMove:function(t){var e=t,n=this.em,r=this.onMoveClb,i=this.plh,o=this.customTarget;this.moved=1;var a=i.style.display;a&&'none'!==a||(i.style.display='block');var l=this.offset(this.el);this.elT=this.wmargin?Math.abs(l.top):l.top,this.elL=this.wmargin?Math.abs(l.left):l.left;var c=t.pageY-this.elT+this.el.scrollTop,u=t.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&n){var h=n.get('Canvas').getMouseRelativeCanvas(t,{noScroll:1});u=h.x,c=h.y}this.rX=u,this.rY=c,this.eventMove=t;var p=this.getSourceModel(),d=o?o({sorter:this,event:t}):t.target,g=this.dimsFromTarget(d,u,c),v=this.target,m=v&&this.getTargetModel(v);if(this.selectTargetModel(m,p),m||(i.style.display='none'),v){this.lastDims=g;var y=this.findPosition(g,u,c);this.isTextableActive(p,m)?(this.activeTextModel=m,i.style.display='none',this.lastPos=y,this.updateTextViewCursorPosition(e)):(this.disableTextable(),this.activeTextModel=null,this.lastPos&&this.lastPos.index==y.index&&this.lastPos.method==y.method||(this.movePlaceholder(this.plh,g,y,this.prevTargetDim),this.$plh||(this.$plh=f(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css('top','+='+this.offTop+'px'),this.offLeft&&this.$plh.css('left','+='+this.offLeft+'px')),this.lastPos=y)),(0,s.isFunction)(r)&&r({event:t,target:p,parent:m,index:y.index+('after'==y.method?1:0)}),n&&n.trigger('sorter:drag',{target:v,targetModel:m,sourceModel:p,dims:g,pos:y,x:u,y:c})}},isTextableActive:function(t,e){var n;return(null==t||null===(n=t.get)||void 0===n?void 0:n.call(t,'textable'))&&(null==e?void 0:e.isInstanceOf('text'))},disableTextable:function(){var t=this.activeTextModel;t&&t.getView().disableEditing(),this.setContentEditable(t,!1)},isInFlow:function(t,e){if(!t)return!1;e=e||document.body;var n=t;return n.offsetHeight,!!this.styleInFlow(n,e)},styleInFlow:function(t,e){if(!(0,l.isTextNode)(t)){var n=t.style||{},r=f(t),i=e&&f(e);if(!n.overflow||'visible'===n.overflow){var o=r.css('float');if(!(o&&'none'!==o||i&&'flex'==i.css('display')&&'column'!==i.css('flex-direction'))){switch(n.position){case'static':case'relative':case'':break;default:return}switch(t.tagName){case'TR':case'TBODY':case'THEAD':case'TFOOT':return!0}switch(r.css('display')){case'block':case'list-item':case'table':case'flex':return!0}}}}},validTarget:function(t,e){var n=this.getTargetModel(t),r=this.getSourceModel(e,{target:n}),i={valid:!0,src:e=r&&r.view&&r.view.el,srcModel:r,trg:t=n&&n.view&&n.view.el,trgModel:n};if(!e||!t)return i.valid=!1,i;var o=r.get('draggable');if((0,s.isFunction)(o)){var l=o(r,n);i.dragInfo=l,i.draggable=l,o=l}else o=o instanceof Array?o.join(', '):o,i.dragInfo=o,o=(0,s.isString)(o)?this.matches(t,o):o,i.draggable=o;var c=n.get('droppable');if((0,s.isFunction)(c)){var u=c(r,n);i.droppable=u,i.dropInfo=u,c=u}else c=(c=c instanceof a().Collection?1:c)instanceof Array?c.join(', '):c,i.dropInfo=c,c=(0,s.isString)(c)?this.matches(e,c):c,c=o&&this.isTextableActive(r,n)?1:c,i.droppable=c;return c&&o||(i.valid=!1),i},dimsFromTarget:function(t,e,n){var r=this.em,i=[];if(!t)return i;if(this.matches(t,"".concat(this.itemSel,", ").concat(this.containerSel))||(t=this.closest(t,this.itemSel)),this.draggable instanceof Array&&(t=this.closest(t,this.draggable.join(','))),!t)return i;if(this.prevTarget&&this.prevTarget!=t&&(this.prevTarget=null),!this.prevTarget){this.targetP=this.closest(t,this.containerSel);var o=this.validTarget(t);if(r&&r.trigger('sorter:drag:validation',o),!o.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&&(i=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,e,n)||!this.nested&&!this.cacheDims.length){var a=this.targetP;a&&this.validTarget(a).valid&&(i=this.cacheDimsP,this.target=a)}return this.lastPos=null,i},getTargetFromEl:function(t){var e,n=t,r=this.targetPrev,i=this.em,o=this.containerSel,a=this.itemSel;if(this.matches(n,"".concat(a,", ").concat(o))||(n=this.closest(n,a)),this.draggable instanceof Array&&(n=this.closest(n,this.draggable.join(','))),r&&r!=n&&(this.targetPrev=''),!this.targetPrev){e=this.closest(n,o);var s=this.validTarget(n);if(i&&i.trigger('sorter:drag:validation',s),!s.valid&&e)return this.getTargetFromEl(e);this.targetPrev=n}return this.nearElBorders(n)&&(e=this.closest(n,o))&&this.validTarget(e).valid&&(n=e),n},nearElBorders:function(t){var e=10,n=t.getBoundingClientRect(),r=t.ownerDocument.body,i=this.getCurrentPos(),o=i.x,a=i.y,s=n.top+r.scrollTop,l=n.left+r.scrollLeft,c=n.width,u=n.height;if(as+u-e||ol+c-e)return 1},getCurrentPos:function(){var t=this.eventMove;return{x:t.pageX||0,y:t.pageY||0}},getDim:function(t){var e,n,r,i,o=this.em,a=this.canvasRelative,s=o&&o.get('Canvas'),l=s?s.getElementOffsets(t):{};if(a&&o){var c=s.getElementPos(t,{noScroll:1});e=c.top,n=c.left,r=c.height,i=c.width}else{var u=this.offset(t);e=this.relative?t.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,r=t.offsetHeight,i=t.offsetWidth}return{top:e,left:n,height:r,width:i,offsets:l}},getChildrenDim:function(t){var e=this,n=[];if(!t)return n;var r=this.getTargetModel(t);if(r&&r.view&&!this.ignoreViewChildren){var i=r.getCurrentView?r.getCurrentView():r.view;t=i.getChildrenContainer()}return(0,s.each)(t.children,(function(r,i){var o=(0,l.getModel)(r,f),a=o&&o.index?o.index():i;if((0,l.isTextNode)(r)||e.matches(r,e.itemSel)){var s=e.getDim(r),c=e.direction;c='v'==c||'h'!=c&&e.isInFlow(r,t),s.dir=c,s.el=r,s.indexEl=a,n.push(s)}})),n},nearBorders:function(t,e,n){var r=0,i=this.borderOffset,o=e||0,a=n||0,s=t.top,l=t.left,c=t.height,u=t.width;return(s+i>a||a>s+c-i||l+i>o||o>l+u-i)&&(r=1),!!r},findPosition:function(t,e,n){for(var r={index:0,indexEl:0,method:'before'},i=0,o=0,a=0,s=0,l=0,c=0,u=0,f=0,h=t.length;fo||a&&l>=a||i&&g+mx&&(w.at=p-1))}r&&(k?(delete w.at,i=v.getView().insertComponent(r,w)):i=g.add(r,w)),this.dropContent=null,this.prevTarget=null}else if(o){var C=d.dropInfo||(null==v?void 0:v.get('droppable')),S=d.dragInfo||(null==m?void 0:m.get('draggable'));!g&&h.push('Target collection not found'),!b&&C&&h.push("Target is not droppable, accepts [".concat(C,"]")),!y&&S&&h.push("Component not draggable, acceptable by [".concat(S,"]")),o.logWarning('Invalid target position',{errors:h,model:m,context:'sorter',target:v})}return null==o||o.trigger('sorter:drag:end',{targetCollection:g,modelToDrop:r,warns:h,validResult:d,dst:t,srcEl:u}),i},rollback:function(t){(0,l.off)(this.getDocuments(),'keydown',this.rollback),27==(t.which||t.keyCode)&&(this.moved=0,this.endMove())}});var d=n(5671),g=n(3144);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return(0,d.Z)(this,t),this.setOptions(e),(0,s.bindAll)(this,'handleKeyDown','handleMouseDown','move','stop'),this}return(0,g.Z)(t,[{key:"getConfig",value:function(){return this.opts}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=(0,s.defaults)(t,y),this.setup()}},{key:"setup",value:function(){var t=this.opts,e=t.prefix||'',n=t.appendTo||document.body,r=this.container;for(r||((r=document.createElement('div')).className="".concat(e,"resizer-c"),n.appendChild(r),this.container=r);r.firstChild;)r.removeChild(r.firstChild);var i={};for(var o in['tl','tc','tr','cl','cr','bl','bc','br'].forEach((function(e){return i[e]=t[e]?function(t,e){var n=e.prefix||'',r=document.createElement('i');return r.className=n+'resizer-h '+n+'resizer-h-'+t,r.setAttribute('data-'+n+'handler',t),r}(e,t):''})),i){var a=i[o];a&&r.appendChild(a)}this.handlers=i,this.mousePosFetcher=t.mousePosFetcher,this.updateTarget=t.updateTarget,this.posFetcher=t.posFetcher,this.onStart=t.onStart,this.onMove=t.onMove,this.onEnd=t.onEnd,this.onUpdateContainer=t.onUpdateContainer}},{key:"toggleFrames",value:function(t){if(this.opts.silentFrames){var e=document.querySelectorAll('iframe');(0,s.each)(e,(function(e){return e.style.pointerEvents=t?'none':''}))}}},{key:"isHandler",value:function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1}},{key:"getFocusedEl",value:function(){return this.el}},{key:"getParentEl",value:function(){return this.el.parentElement}},{key:"getDocumentEl",value:function(){return[this.el.ownerDocument,document]}},{key:"getElementPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.posFetcher||'';return n?n(t,e):b(t)}},{key:"focus",value:function(t){t&&t===this.el||(this.el=t,this.updateContainer({forceShow:1}),(0,l.on)(this.getDocumentEl(),'pointerdown',this.handleMouseDown))}},{key:"blur",value:function(){this.container.style.display='none',this.el&&((0,l.off)(this.getDocumentEl(),'pointerdown',this.handleMouseDown),this.el=null)}},{key:"start",value:function(t){if(0===t.button){t.preventDefault(),t.stopPropagation();var e=this.el,n=this.getParentEl(),r=this.opts||{},i=this.mousePosFetcher,o='data-'+r.prefix+'handler',a=this.getElementPos(e,{target:'el'}),c=this.getElementPos(n);this.handlerAttr=t.target.getAttribute(o),this.clickedHandler=t.target,this.startDim={t:a.top,l:a.left,w:a.width,h:a.height},this.rectDim={t:a.top,l:a.left,w:a.width,h:a.height},this.startPos=i?i(t):{x:t.clientX,y:t.clientY},this.parentDim={t:c.top,l:c.left,w:c.width,h:c.height};var u=this.getDocumentEl();this.docs=u,(0,l.on)(u,'pointermove',this.move),(0,l.on)(u,'keydown',this.handleKeyDown),(0,l.on)(u,'pointerup',this.stop),(0,s.isFunction)(this.onStart)&&this.onStart(t,{docs:u,config:r,el:e,resizer:this}),this.toggleFrames(1),this.move(t)}}},{key:"move",value:function(t){var e=this.onMove,n=this.mousePosFetcher,r=n?n(t):{x:t.clientX,y:t.clientY};this.currentPos=r,this.delta={x:r.x-this.startPos.x,y:r.y-this.startPos.y},this.keys={shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey},this.rectDim=this.calc(this),this.updateRect(0),e&&e(t)}},{key:"stop",value:function(t){var e=this.el,n=this.opts,r=this.docs||this.getDocumentEl();(0,l.off)(r,'pointermove',this.move),(0,l.off)(r,'keydown',this.handleKeyDown),(0,l.off)(r,'pointerup',this.stop),this.updateRect(1),this.toggleFrames(),(0,s.isFunction)(this.onEnd)&&this.onEnd(t,{docs:r,config:n,el:e,resizer:this}),delete this.docs}},{key:"updateRect",value:function(t){var e=this.el,n=this.opts,r=this.rectDim,i=this.updateTarget,o=this.getSelectedHandler(),a=n.unitHeight,l=n.unitWidth,c=n.keyWidth,u=n.keyHeight;if((0,s.isFunction)(i))i(e,r,{store:t,selectedHandler:o,resizer:this,config:n});else{var f=e.style;f[c]=r.w+l,f[u]=r.h+a}this.updateContainer()}},{key:"updateContainer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.opts,n=this.container,r=this.el,i=n.style;!e.avoidContainerUpdate&&r&&t.forceShow&&(i.display='block'),this.onUpdateContainer({el:n,resizer:this,opts:m(m({},e),t)})}},{key:"getSelectedHandler",value:function(){var t=this.handlers;if(this.selectedHandler)for(var e in t)if(t[e]===this.selectedHandler)return e}},{key:"handleKeyDown",value:function(t){27===t.keyCode&&(this.rectDim=this.startDim,this.stop(t))}},{key:"handleMouseDown",value:function(t){var e=t.target;this.isHandler(e)?(this.selectedHandler=e,this.start(t)):e!==this.el&&(this.selectedHandler='',this.blur())}},{key:"calc",value:function(t){var e,n=this.opts||{},r=n.step,i=this.startDim,o=n.minDim,a=n.maxDim,s=t.delta.x,c=t.delta.y,u=this.parentDim.w,f=this.parentDim.h,h=this.opts.unitWidth,p=this.opts.unitHeight,d='%'===h?i.w/100*u:i.w,g='%'===p?i.h/100*f:i.h,v={t:0,l:0,w:d,h:g};if(t){var m=t.handlerAttr;~m.indexOf('r')&&(e='%'===h?(0,l.normalizeFloat)((d+s*r)/u*100,.01):(0,l.normalizeFloat)(d+s*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.w=e),~m.indexOf('b')&&(e='%'===p?(0,l.normalizeFloat)((g+c*r)/f*100,.01):(0,l.normalizeFloat)(g+c*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.h=e),~m.indexOf('l')&&(e='%'===h?(0,l.normalizeFloat)((d-s*r)/u*100,.01):(0,l.normalizeFloat)(d-s*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.w=e),~m.indexOf('t')&&(e='%'===p?(0,l.normalizeFloat)((g-c*r)/f*100,.01):(0,l.normalizeFloat)(g-c*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),v.h=e);var y=n.ratioDefault?!t.keys.shift:t.keys.shift;if(m.indexOf('c')<0&&y){var b=i.w/i.h;v.w/v.h>b?v.h=Math.round(v.w/b):v.w=Math.round(v.h*b)}return~m.indexOf('l')&&(v.l=i.w-v.w),~m.indexOf('t')&&(v.t=i.h-v.h),v}}}]),t}();const k={init:function(t){return new w(t)}};function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e{"use strict";n.d(e,{Z:()=>l});var r,i=n(2316),o=n.n(i),a=n(9050),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const l=function(t){function e(e,n,r){return t.call(this,n,{module:e,modelConstructor:r})||this}return s(e,t),e.prototype.add=function(e,n){var r,i=this,o=(0,a.isArray)(e)?e:(0,a.isUndefined)(e)?void 0:[e];return o=null!==(r=null==o?void 0:o.map((function(t){return t instanceof i.newModel?t:new i.newModel(i.module,t)})))&&void 0!==r?r:[void 0],t.prototype.add.call(this,(0,a.isArray)(e)?o:o[0],n)},e.prototype.preinitialize=function(t,e){this.newModel=e.modelConstructor,this.module=e.module},e}(o().Collection)},7904:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r,i=n(2316),o=n.n(i),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const s=function(t){function e(e,n,r){var i=t.call(this,n,r)||this;return i._module=e,i}return a(e,t),Object.defineProperty(e.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),e}(o().Model)},6434:(t,e,n)=>{"use strict";n.d(e,{O:()=>f,Z:()=>u});var r,i=n(9050),o=n(1163),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=void 0&&(void 0).__assign||function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";n.d(e,{Z:()=>s});var r,i=n(2316),o=n.n(i),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.ppfx+this.config.stylePrefix||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.config.stylePrefix||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"module",{get:function(){var t,e;return null!==(e=null===(t=this.model)||void 0===t?void 0:t.module)&&void 0!==e?e:this.collection.module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.module.config},enumerable:!1,configurable:!0}),e.prototype.preinitialize=function(t){this.className=''},e}(o().View)},7287:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>q});var r=n(9050),i=n(6434),o=n(1163);const a={stylePrefix:'cv-',scripts:[],styles:[],customBadgeLabel:'',autoscrollLimit:50,extHl:0,frameContent:'',frameStyle:"\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n ",notTextable:['button','a','input[type=checkbox]','input[type=radio]']};var s,l=n(7904),c=n(7948),u=n(2004),f=n(3560),h=void 0&&(void 0).__extends||(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e){var n=this,r=e.em,i=e.config,o=i.scripts,a=i.styles;return(n=t.call(this,e,{scripts:o,styles:a})||this).set('frames',new f.Z(e)),n.listenTo(n,'change:zoom',n.onZoomChange),n.listenTo(r,"change:device ".concat(u.evUpdate),n.updateDevice),n.listenTo(r,c.evPageSelect,n._pageUpdated),n}return h(e,t),e.prototype.defaults=function(){return{frame:'',frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[]}},Object.defineProperty(e.prototype,"frames",{get:function(){return this.get('frames')},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this.em.get('PageManager').getMain();this.set('frames',t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype._pageUpdated=function(t,e){var n=this.em;n.setSelected(),n.get('readyCanvas')&&n.stopDefault(),null==e||e.getFrames().map((function(t){return t.disable()})),this.set('frames',t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype.updateDevice=function(t){void 0===t&&(t={});var e=this.em,n=e.getDeviceModel(),r=t.frame||e.getCurrentFrameModel();if(r&&n){var i=n.attributes,o=i.width,a=i.height;r.set({width:o,height:a},{noUndo:1})}},e.prototype.onZoomChange=function(){this.get('zoom')<1&&this.set('zoom',1)},e}(l.Z);const d=p;var g=n(6840),v=n(3059),m=n(9283),y=n(2316),b=n.n(y),w=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const k=function(t){function e(e,n){void 0===e&&(e={}),void 0===n&&(n=!1);var r=t.call(this,e)||this;return r.itemsView='',r.itemType='type',r.reuseView=!1,r.viewCollection=[],n&&r.listenTo(r.collection,'add',r.addTo),r}return w(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){},e.prototype.add=function(t,e){var n,r=this,i=r.reuseView,o=r.viewCollection,a=(r.itemsView,e||null),s=t.get(this.itemType);n=t.view&&i?t.view:this.renderView(t,s),o.push(n);var l=n.render().el;a?a.appendChild(l):this.$el.append(l)},e.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(n){return t.add(n,e)})),this.$el.append(e),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(t){void 0===t&&(t={});var e=this.viewCollection;return this.onRemoveBefore(e,t),this.clearItems(),b().View.prototype.remove.apply(this,t),this.onRemove(e,t),this},e.prototype.clearItems=function(){this.viewCollection},e}(v.Z);var x=n(4868),O=n(4942),C=n(5671),S=n(3144);function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var P=function(){function t(e,n){var i=this;(0,C.Z)(this,t),this.em=e;var o=n||e.get('Canvas').getFrames().map((function(t){return t.getComponent().getEl()})),a=Array.isArray(o)?o:[o];return this.el=o,this.counter=0,(0,r.bindAll)(this,'handleDragEnter','handleDragOver','handleDrop','handleDragLeave'),a.forEach((function(t){return i.toggleEffects(t,1)})),this}return(0,S.Z)(t,[{key:"toggleEffects",value:function(t,e){var n={on:o.on,off:o.off},r=e?'on':'off';n[r](t,'dragenter',this.handleDragEnter),n[r](t,'dragover',this.handleDragOver),n[r](t,'drop',this.handleDrop),n[r](t,'dragleave',this.handleDragLeave)}},{key:"__customTglEff",value:function(t){var e=t?o.on:o.off,n=this.el.ownerDocument,r=n.defaultView.frameElement;this.sortOpts=t?{onStart:function(t){var e=t.sorter;(0,o.on)(r,'pointermove',e.onMove)},onEnd:function(t){var e=t.sorter;(0,o.off)(r,'pointermove',e.onMove)},customTarget:function(t){var e=t.event;return n.elementFromPoint(e.clientX,e.clientY)}}:null,e(r,'pointerenter',this.handleDragEnter),e(r,'pointermove',this.handleDragOver),e(document,'pointerup',this.handleDrop),e(r,'pointerout',this.handleDragLeave)}},{key:"startCustom",value:function(){this.__customTglEff(!0)}},{key:"endCustom",value:function(t){this.over?this.endDrop(t):this.__customTglEff(!1)}},{key:"endDrop",value:function(t,e){var n=this.em,r=this.dragStop;this.counter=0,r&&r(t),this.__customTglEff(!1),n.trigger('canvas:dragend',e)}},{key:"handleDragLeave",value:function(t){this.updateCounter(-1,t)}},{key:"updateCounter",value:function(t,e){this.counter+=t,0===this.counter&&this.endDrop(1,e)}},{key:"handleDragEnter",value:function(t){var e=this,n=this.em,r=t.dataTransfer;if(this.updateCounter(1,t),!this.over){this.over=1;var i,o,a=n.get('Utils'),s=n.get('Canvas'),l=n.get('dragContent')||'
';if(n.stopDefault(),n.inAbsoluteMode()){var c=n.get('DomComponents').getWrapper(),u=c.append({})[0],f=n.get('Commands').run('core:component-drag',{event:t,guidesInfo:1,center:1,target:u,onEnd:function(t,n,i){var o;if(!i.cancelled){o=c.append(l)[0];var a=s.getOffset(),f=u.getStyle(),h=f.top,p=f.left,d=f.position;o.addStyle({left:parseFloat(p)-a.left+'px',top:parseFloat(h)-a.top+'px',position:d})}e.handleDragEnd(o,r),u.remove()}});i=function(e){return f.stop(t,{cancel:e})},o=function(t){return l=t}}else{var h=new a.Sorter(function(t){for(var e=1;e=0)a=t&&t.getData('text/html').replace(/<\/?meta[^>]*>/g,'');else if((0,r.indexOf)(n,'text/uri-list')>=0)a={type:'link',attributes:{href:a},content:a};else if((0,r.indexOf)(n,'text/json')>=0){var u=t&&t.getData('text/json');u&&(a=JSON.parse(u))}else 1===n.length&&'text/plain'===n[0]&&(a="
".concat(a,"
"));var f={content:a};return e.trigger('canvas:dragdata',t,f),f}}]),t}(),T=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=void 0&&(void 0).__assign||function(){return E=Object.assign||function(t){for(var e,n=1,r=arguments.length;ns&&(l+=o-s),!(0,r.isUndefined)(t)&&l!==i&&l>0&&l0){var l=e.shift(),u=(0,m.ut)('script',E({type:'text/javascript'},(0,r.isString)(l)?{src:l}:l));u.onerror=u.onload=c.bind(null,e),null===(i=n.contentDocument)||void 0===i||i.head.appendChild(u)}else t.renderBody(),o&&o.trigger(a,s)};n.onload=function(){var e=t.config.frameContent;if(e){var n=t.getDoc();n.open(),n.write(e),n.close()}o&&o.trigger("".concat(a,":before"),s),c(j([],l.get('scripts'),!0))}},e.prototype.renderStyles=function(t){void 0===t&&(t={});var e=this.getHead(),n=this.getCanvasModel(),i=function(t){return t.map((function(t){return{tag:'link',attributes:E({rel:'stylesheet'},(0,r.isString)(t)?{href:t}:t)}}))},o=i(t.prev||n.previous('styles')),a=i(n.get('styles')),s=[],l=[],c=function(t,e,n){t.forEach((function(t){var r=t.attributes.href;!e.some((function(t){return t.attributes.href===r}))&&n.push(t)}))};c(a,o,l),c(o,a,s),s.forEach((function(t){var n,r=e.querySelector("link[href=\"".concat(t.attributes.href,"\"]"));null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r)})),(0,m.SJ)(e,l)},e.prototype.renderBody=function(){var t,e,n=this,r=this,i=r.config,a=r.em,s=r.model,l=r.ppfx,c=this.getDoc(),u=this.getBody(),f=this.getWindow(),h=a.config;f._isEditor=!0,this.renderStyles({prev:[]});(0,m.R3)(u,""));var p=s.getComponent(),d=a.get('DomComponents').getType('wrapper').view;this.wrapper=new d({model:p,config:E(E({},p.config),{em:a,frameView:this})}).render(),(0,m.R3)(u,null===(t=this.wrapper)||void 0===t?void 0:t.el),(0,m.R3)(u,new x.Z({collection:s.getStyles(),config:E(E({},a.get('CssComposer').getConfig()),{frameView:this})}).render().el),(0,m.R3)(u,this.getJsContainer()),(0,o.on)(u,'click',(function(t){var e;return t&&'A'==(null===(e=t.target)||void 0===e?void 0:e.tagName)&&t.preventDefault()})),(0,o.on)(u,'submit',(function(t){return t&&t.preventDefault()})),[{event:'keydown keyup keypress',class:'KeyboardEvent'},{event:'mousedown mousemove mouseup',class:'MouseEvent'},{event:'pointerdown pointermove pointerup',class:'PointerEvent'},{event:'wheel',class:'WheelEvent'}].forEach((function(t){return t.event.split(' ').forEach((function(e){c.addEventListener(e,(function(e){return n.el.dispatchEvent((0,m.t3)(e,t.class))}))}))})),this._toggleEffects(!0),this.droppable=(0,o.hasDnd)(a)&&new P(a,null===(e=this.wrapper)||void 0===e?void 0:e.el),s.trigger('loaded')},e.prototype._toggleEffects=function(t){var e=t?o.on:o.off,n=this.getWindow();n&&e(n,"".concat(m.G1," resize"),this._emitUpdate)},e.prototype._emitUpdate=function(){this.model._emitUpdated()},e}(v.Z);const R=A;var D=n(5610),M=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Z=void 0&&(void 0).__assign||function(){return Z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n ").concat(o.get('name')||'',"\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n ")).append(e.el);var l=(0,m.ut)('div',{class:"".concat(r,"tools"),style:'pointer-events:none; display: none'},"\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n "));this.elTools=l;var c=null==i?void 0:i.toolsWrapper;return c&&c.appendChild(l),s&&s({el:a,elTop:a.querySelector('[data-frame-top]'),elRight:a.querySelector('[data-frame-right]'),elBottom:a.querySelector('[data-frame-bottom]'),elLeft:a.querySelector('[data-frame-left]'),frame:o,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},e}(v.Z);var N=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),I=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,!0)||this;return r.listenTo(r.collection,'reset',r.render),r.canvasView=n.canvasView,r._module=n.module,r}return N(e,t),e.prototype.onRemoveBefore=function(t,e){void 0===e&&(e={}),t.forEach((function(t){return t.remove(e)}))},e.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},e.prototype.renderView=function(t,e){return new L(t,this.canvasView)},e}(k);const F=I;var V=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),B=void 0&&(void 0).__assign||function(){return B=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n ")},e.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},e.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,r=t.config,i=t.em,o=n.frames;i.set('readyCanvas',0),o.once('loaded:all',(function(){return i.set('readyCanvas',1)})),null==e||e.remove(),this.frames=new F({collection:o},B(B({},r),{canvasView:this}))},e.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var r=e.scroll,i=this.em.get('currentFrame');r&&(null===(n=t.views)||void 0===n||n.forEach((function(t){t._getFrame()===i&&t.scrollIntoView(r)})))},e.prototype.remove=function(){for(var t,e=[],n=0;n=0&&a>=0&&i<=r.height&&a<=r.width},e.prototype.offset=function(t,e){var n,r;void 0===e&&(e={});var i=(0,o.getElRect)(t),a=null==t?void 0:t.ownerDocument.body,s=e.noScroll;return{top:i.top+(s?0:null!==(n=null==a?void 0:a.scrollTop)&&void 0!==n?n:0),left:i.left+(s?0:null!==(r=null==a?void 0:a.scrollLeft)&&void 0!==r?r:0),width:i.width,height:i.height}},e.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},e.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,r=null==t?void 0:t.ownerDocument.defaultView,i=r?r.frameElement:n;this.frmOff=this.offset(i||n)}return this.frmOff},e.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},e.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.getZoom(),r=e||{},i=this.getFrameOffset(t),o=this.el,a=this.getCanvasOffset(),s=this.offset(t,e),l=r.avoidFrameOffset?0:i.top,c=r.avoidFrameOffset?0:i.left;return{top:s.top*n+l-a.top+o.scrollTop,left:s.left*n+c-a.left+o.scrollLeft,height:s.height*n,width:s.width*n,zoom:n,rect:s}},e.prototype.getElementOffsets=function(t){var e=this;if(!t||(0,o.isTextNode)(t))return{};var n={},r=window.getComputedStyle(t);return['marginTop','marginRight','marginBottom','marginLeft','paddingTop','paddingRight','paddingBottom','paddingLeft'].forEach((function(t){n[t]=parseFloat(r[t])*e.getZoom()})),n},e.prototype.getPosition=function(t){var e;void 0===t&&(t={});var n=null===(e=this.frame)||void 0===e?void 0:e.el.contentDocument;if(n){var r=n.body,i=this.getZoom(),o=this.getFrameOffset(),a=this.getCanvasOffset(),s=t.noScroll;return{top:o.top+(s?0:r.scrollTop)*i-a.top,left:o.left+(s?0:r.scrollLeft)*i-a.left,width:a.width,height:a.height}}},e.prototype.updateScript=function(t){var e=t.model,n=e.getId();t.scriptContainer||(t.scriptContainer=(0,m.ut)('div',{'data-id':n}),this.getJsContainer().appendChild(t.scriptContainer)),t.el.id=n,t.scriptContainer.innerHTML='';var r=document.createElement('script'),i=e.getScriptString(),o=e.get('script-props')?i:"function(){\n".concat(i,"\n;}"),a=JSON.stringify(e.__getScriptProps());r.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n (").concat(o,".bind(item))(").concat(a,")\n }, 1);"),setTimeout((function(){var e=t.scriptContainer;null==e||e.appendChild(r)}),0)},e.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return e&&e.getJsContainer()},e.prototype.getFrameView=function(t){return(null==t?void 0:t._getFrame())||this.em.get('currentFrame')},e.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,r=t.em,i=t.framesArea,o=e.frames;o.listenToLoad(),n.render();var a=o.at(0),s=null==a?void 0:a.view;r.setCurrentFrame(s),null==i||i.appendChild(n.el),this.frame=s}},e.prototype.render=function(){var t=this,e=t.el,n=t.$el,r=t.ppfx,i=t.config,a=t.em;n.html(this.template());var s=n.find('[data-frames]');this.framesArea=s.get(0);var l=n.find('[data-tools]');this.toolsWrapper=l.get(0),l.append("\n
\n
\n
\n
\n
\n
\n ").concat(i.extHl?"
"):'',"\n
\n
\n
\n
\n
\n
\n
\n "));var c=e.querySelector("#".concat(r,"tools"));return this.hlEl=e.querySelector(".".concat(r,"highlighter")),this.badgeEl=e.querySelector(".".concat(r,"badge")),this.placerEl=e.querySelector(".".concat(r,"placeholder")),this.ghostEl=e.querySelector(".".concat(r,"ghost")),this.toolbarEl=e.querySelector(".".concat(r,"toolbar")),this.resizerEl=e.querySelector(".".concat(r,"resizer")),this.offsetEl=e.querySelector(".".concat(r,"offset-v")),this.fixedOffsetEl=e.querySelector(".".concat(r,"offset-fixed-v")),this.toolsGlobEl=e.querySelector(".".concat(r,"tools-gl")),this.toolsEl=c,this.el.className=(0,o.getUiClass)(a,this.className),this.ready=!0,this._renderFrames(),this},e}(v.Z);const z=H;var U=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),W=void 0&&(void 0).__assign||function(){return W=Object.assign||function(t){for(var e,n=1,r=arguments.length;no.top+o.height?o.top+o.height:p,left:h,elementTop:o.top,elementLeft:o.left,elementWidth:o.width,elementHeight:o.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:i.top,canvasLeft:i.left,canvasWidth:i.width,canvasHeight:i.height};return c&&this.em&&this.em.trigger(c,d),d}},e.prototype.canvasRectOffset=function(t,e,n){var r=this;void 0===n&&(n={});var i=function(t,e,i){void 0===e&&(e=1);var o=r.em.getZoomDecimal(),a=e?'top':'left',s=t.ownerDocument,l=n.offset?function(t){var e=t.defaultView;return null==e?void 0:e.frameElement}(s):{},c=l.offsetTop,u=void 0===c?0:c,f=l.offsetLeft,h=void 0===f?0:f,p=s.body||{},d=p.scrollTop,g=void 0===d?0:d,v=p.scrollLeft,m=e?g:void 0===v?0:v,y=e?u:h;return i[a]-(m-y)*o};return{top:i(t,1,e),left:i(t,0,e)}},e.prototype.getTargetToElementFixed=function(t,e,n){var i;void 0===n&&(n={});var o=n.pos||this.getElementPos(t),a=n.canvasOff||this.canvasRectOffset(t,o),s=e.offsetHeight||0,l=e.offsetWidth||0,c=o.left+o.width,u=this.getCanvasView(),f=u.getPosition(),h=u.getFrameOffset(t),p=n.event,d=-s,g=(0,r.isUndefined)(n.left)?o.width-l:n.left;g=o.left<-g?-o.left:g;var v=null!==(i=null==f?void 0:f.width)&&void 0!==i?i:0;g=c>v?g-(c-v):g;var m=o.height+s,y=m{"use strict";n.d(e,{Z:()=>h});var r,i=n(9050),o=n(7904),a=n(1163),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=void 0&&(void 0).__assign||function(){return l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0&&this.head.splice(i,1)},e.prototype.addLink=function(t){var e='link';!this.getHeadByAttr('href',t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:'stylesheet'}})},e.prototype.removeLink=function(t){this.removeHeadByAttr('href',t,'link')},e.prototype.addScript=function(t){var e='script';!this.getHeadByAttr('src',t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},e.prototype.removeScript=function(t){this.removeHeadByAttr('src',t,'script')},e.prototype.getPage=function(){var t;return null===(t=this.collection)||void 0===t?void 0:t.page},e.prototype._emitUpdated=function(t){void 0===t&&(t={}),this.em.trigger('frame:updated',l({frame:this},t))},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=o.Z.prototype.toJSON.call(this,t),n=(0,i.result)(this,'defaults');return t.fromUndo&&delete e.component,delete e.styles,delete e.changesCount,e[u]&&delete e.width,e[f]&&delete e.height,(0,i.forEach)(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),(0,i.forEach)(n,(function(t,n){e[n]===t&&delete e[n]})),(0,i.forEach)(['attributes','head'],(function(t){(0,i.isEmpty)(e[t])&&delete e[t]})),e},e}(o.Z)},3560:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r,i=n(9050),o=n(7116),a=n(6840),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const l=function(t){function e(e,n){void 0===n&&(n=[]);var r=t.call(this,e,n,a.Z)||this;return r.loadedItems=0,r.itemsToLoad=0,(0,i.bindAll)(r,'itemLoaded'),r.on('reset',r.onReset),r.on('remove',r.onRemove),r}return s(e,t),e.prototype.onReset=function(t,e){var n=this;((null==e?void 0:e.previousModels)||[]).map((function(t){return n.onRemove(t)}))},e.prototype.onRemove=function(t){null==t||t.onRemove()},e.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger('loaded:all'),this.listenToLoadItems(!1))},e.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},e.prototype.listenToLoadItems=function(t){var e=this;this.forEach((function(n){return n[t?'on':'off']('loaded',e.itemLoaded)}))},e}(o.Z)},5819:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>Ue});var r=n(9050);const i={stylePrefix:'comp-',components:[],draggableComponents:1,processor:0,voidElements:['area','base','br','col','embed','hr','img','input','keygen','link','menuitem','meta','param','source','track','wbr']};var o=n(9138),a=n(8431),s=n(2169),l=n(5671),c=n(3144),u=n(9340),f=n(2963),h=n(1120);function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var d=function(t){(0,u.Z)(n,t);var e=p(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"tagName",value:function(){return'div'}}]),n}(s.Z),g=n(3505),v=n(4942),m=n(1752),y=n(1163);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e=0};const O=s.Z.extend({});function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function S(t){for(var e=1;e\n \n "),fallback:"\n \n "),file:''})}},{key:"initialize",value:function(t,e){o.ZP.prototype.initialize.apply(this,arguments);var n=this.get('attributes'),i=n.src;i&&(0,y.buildBase64UrlFromSvg)((0,r.result)(this,'defaults').src)!==i&&this.set('src',i,{silent:1})}},{key:"initToolbar",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=this.get(t.fallback?'fallback':'src')||'',n=e;return e&&'0&&void 0!==arguments[0]?arguments[0]:'',e={},n=t.substring(1).split('&'),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if('a'===(0,y.toLowerCase)(t.tagName)){var i=n.textTags||[];e={type:kt,editable:!1};var o=t.childNodes,a=o.length;a||delete e.editable,(0,r.forEach)(o,(function(t){var n=t.tagName;(3==t.nodeType&&''!==t.textContent.trim()||n&&i.indexOf((0,y.toLowerCase)(n))>=0)&&delete e.editable}))}return e};var Ot=n(5861),Ct=n(4687),St=n.n(Ct);function _t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pt(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};!n.fromDisable&&this.disableEditing()}},{key:"canActivate",value:function(){var t,e=this.model,n=this.rteEnabled,r=this.em,i=(null==r?void 0:r.getEditing())===e,o=!0,a=!1;if((n||!e.get('editable')||i||(a=e.isChildOf('text')))&&(o=!1,a&&!e.get('textable'))){for(var s=e.parent();s&&!s.isInstanceOf('text');)s=s.parent();s&&s.get('editable')?t=s:o=!0}return{result:o,delegate:t}}},{key:"onActive",value:(n=(0,Ot.Z)(St().mark((function t(e){var n,r,i,o,a,s,l;return St().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(r=this.rte,i=this.em,o=this.canActivate(),a=o.result,s=o.delegate,a){t.next=5;break}return s&&(null==e||null===(l=e.stopPropagation)||void 0===l||l.call(e),i.setSelected(s),s.trigger('active',e)),t.abrupt("return");case 5:if(null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.lastContent=this.getContent(),!r){t.next=17;break}return t.prev=8,t.next=11,r.enable(this,this.activeRte,{event:e});case 11:this.activeRte=t.sent,t.next=17;break;case 14:t.prev=14,t.t0=t["catch"](8),i.logError(t.t0);case 17:this.toggleEvents(1);case 18:case"end":return t.stop()}}),t,this,[[8,14]])}))),function(t){return n.apply(this,arguments)})},{key:"onDisable",value:function(){this.disableEditing()}},{key:"disableEditing",value:(e=(0,Ot.Z)(St().mark((function t(){var e,n,r,i,o,a,s=arguments;return St().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]?s[0]:{},n=this.model,r=this.rte,i=this.activeRte,o=this.em,a=n&&n.get('editable'),!r){t.next=13;break}return t.prev=4,t.next=7,r.disable(this,i);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](4),o.logError(t.t0);case 12:a&&this.getContent()!==this.lastContent&&(this.syncContent(e),this.lastContent='');case 13:this.toggleEvents();case 14:case"end":return t.stop()}}),t,this,[[4,9]])}))),function(){return e.apply(this,arguments)})},{key:"getContent",value:function(){var t=this.activeRte;return t&&'function'==typeof t.getContent?t.getContent():this.getChildrenContainer().innerHTML}},{key:"syncContent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.rte,r=this.rteEnabled;if(r||t.force){var i=this.getContent(),o=e.components(),a=Pt({fromDisable:1},t);e.set('content','',a),n.customRte?(o.length&&o.reset(null,t),e.set('content',i,a)):o.resetFromString(i,t)}}},{key:"insertComponent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=this.el,i=r.ownerDocument,o=i.getSelection();if(null!=o&&o.rangeCount){var a,s=o.getRangeAt(0),l=s.startContainer,c=s.startOffset,u=(0,y.getModel)(l),f=[];if(u&&null!==(a=u.is)&&void 0!==a&&a.call(u,'textnode')){var h=u.collection;h.forEach((function(e){if(e===u){var n='textnode',r=e.get('content');f.push({type:n,content:r.slice(0,c)}),f.push(t),f.push({type:n,content:r.slice(c)})}else f.push(e)}));var p=f.filter(Boolean),d=p.indexOf(t);return h.reset(p,e),h.at(d)}}return n.append(t,e)}},{key:"onInput",value:function(){var t=this.em,e='component',n=["".concat(e,":update"),"".concat(e,":input")].join(' ');t&&t.trigger(n,this.model)}},{key:"disablePropagation",value:function(t){t.stopPropagation()}},{key:"toggleEvents",value:function(t){var e=this.em,n=this.model,r=this.$el,i={on:y.on,off:y.off},o=t?'on':'off';e.setEditing(t?this:0),this.rteEnabled=!!t;var a=[this.el.ownerDocument,document];if(i.off(a,'mousedown',this.onDisable),i[o](a,'mousedown',this.onDisable),e[o]('toolbar:run:before',this.onDisable),n&&(n[o]('removed',this.onDisable),n.trigger("rte:".concat(t?'enable':'disable'))),r&&r.off('mousedown',this.disablePropagation),r&&r[o]('mousedown',this.disablePropagation),this.config.draggableComponents)for(var s=this.el;s;)s.draggable=!t,(s=s.parentNode)&&'BODY'==s.tagName&&(s=0)}}]),o}(s.Z);function At(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var i=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,f.Z)(this,n)}}var Rt=function(t){(0,u.Z)(n,t);var e=At(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"render",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return!!e.inSvg};var de=function(t){(0,u.Z)(n,t);var e=pe(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"_createElement",value:function(t){return document.createElementNS('http://www.w3.org/2000/svg',t)}}]),n}(s.Z);function ge(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ve(t){for(var e=1;e-1;return Be(Be({},o),!u||f?{reason:2}:{result:!0})},e.prototype.allById=function(){return this.componentsById},e.prototype.getById=function(t){return this.componentsById[t]||null},e.prototype.destroy=function(){var t,e=this.allById();Object.keys(e).forEach((function(t){return e[t]&&e[t].remove()})),null===(t=this.componentView)||void 0===t||t.remove(),[this.em,this.componentsById,this.componentView].forEach((function(t){return{}}))},e}(Fe.O);const Ue=ze},8588:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>m});var r=n(9050),i=n(6434),o=n(9283);const a={stylePrefix:'mdl-',title:'',content:'',backdrop:!0,custom:!1,extend:{}};var s,l=n(7904),c=void 0&&(void 0).__extends||(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.defaults=function(){return{title:'',content:'',attributes:{},open:!1}},e.prototype.open=function(){this.set('open',!0)},e.prototype.close=function(){this.set('open',!1)},e}(l.Z);var f=n(3059),h=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),p=void 0&&(void 0).__assign||function(){return p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n
").concat(i,"
\n
\n
\n
\n
").concat(r,"
\n
\n
\n \n
")},e.prototype.events=function(){return{click:'onClick','click [data-close-modal]':'hide'}},e.prototype.onClick=function(t){this.config.backdrop&&t.target===this.el&&this.hide()},e.prototype.getCollector=function(){return this.$collector||(this.$collector=this.$el.find('.'+this.pfx+'collector')),this.$collector},e.prototype.getContent=function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content},e.prototype.getTitle=function(t){return void 0===t&&(t={}),this.$title||(this.$title=this.$el.find('.'+this.pfx+'title')),t.$?this.$title:this.$title.get(0)},e.prototype.updateContent=function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),r=this.model.get('content');e.length&&n.append(e),t.empty().append(r)},e.prototype.updateTitle=function(){var t=this.getTitle({$:!0});t&&t.empty().append(this.model.get('title'))},e.prototype.updateOpen=function(){this.el.style.display=this.model.get('open')?'':'none'},e.prototype.hide=function(){this.model.close()},e.prototype.show=function(){this.model.open()},e.prototype.updateAttr=function(t){var e=this,n=e.pfx,r=e.$el,i=e.el,o=[].slice.call(i.attributes).map((function(t){return t.name}));r.removeAttr(o.join(' ')),r.attr(p(p({},t||{}),{class:"".concat(n,"container ").concat(t&&t.class||'').trim()}))},e.prototype.render=function(){var t=this.$el,e=this.model.toJSON();return e.pfx=this.pfx,e.ppfx=this.ppfx,t.html(this.template(e)),this.updateAttr(),this.updateOpen(),this},e}(f.Z);var g=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e){var n=t.call(this,e,'Modal',a)||this;return n.model=new u(n),n.model.on('change:open',(function(t,n){e.trigger("modal:".concat(n?'open':'close'))})),n.model.on('change',(0,r.debounce)((function(){var t=n._evData(),i=n.config.custom;(0,r.isFunction)(i)&&i(t),e.trigger('modal',t)}),0)),n}return g(e,t),e.prototype._evData=function(){var t=this,e=this.getTitle(),n=this.getContent(),i=this.model.attributes;return{open:i.open,attributes:i.attributes,title:(0,r.isString)(e)?(0,o.rw)(e):e,content:(0,r.isString)(n)?(0,o.rw)(n):n.get?n.get(0):n,close:function(){return t.close()}}},e.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(null==e||e.appendChild(n))},e.prototype.open=function(t){void 0===t&&(t={});var e=t.attributes||{};return t.title&&this.setTitle(t.title),t.content&&this.setContent(t.content),this.model.set('attributes',e),this.model.open(),this.modal&&this.modal.updateAttr(e),this},e.prototype.close=function(){return this.model.close(),this},e.prototype.onceClose=function(t){return this.em.once('modal:close',t),this},e.prototype.onceOpen=function(t){return this.em.once('modal:open',t),this},e.prototype.isOpen=function(){return!!this.model.get('open')},e.prototype.setTitle=function(t){return this.model.set('title',t),this},e.prototype.getTitle=function(){return this.model.get('title')},e.prototype.setContent=function(t){return this.model.set('content',' '),this.model.set('content',t),this},e.prototype.getContent=function(){return this.model.get('content')},e.prototype.getContentEl=function(){var t;return null===(t=this.modal)||void 0===t?void 0:t.getContent().get(0)},e.prototype.getModel=function(){return this.model},e.prototype.render=function(){var t;if(!this.config.custom){var e=d.extend(this.config.extend),n=this.modal&&this.modal.el;return this.modal=new e({el:n,model:this.model,config:this.config}),null===(t=this.modal)||void 0===t?void 0:t.render().el}},e.prototype.destroy=function(){var t;null===(t=this.modal)||void 0===t||t.remove()},e}(i.Z);const m=v},7892:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>j,evAll:()=>k,evComponent:()=>C,evCustom:()=>S,evPfx:()=>x,evRoot:()=>O});var r=n(9050),i=n(7904),o=n(6434),a=n(1163);const s={stylePrefix:'',appendTo:'',sortable:!0,hidable:!0,hideTextnode:!0,root:'',showWrapper:!0,showHover:!0,scrollCanvas:{behavior:'smooth',block:'nearest'},scrollLayers:{behavior:'auto',block:'nearest'},highlightHover:!0,custom:!1,onInit:function(){},onRender:function(){},extend:{}};var l,c=n(2316),u=n(2169),f=n(9138),h=void 0&&(void 0).__extends||(l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.items=[],n.opt=e;var r=e.config||{};n.config=r,n.parentView=e.parentView;var i=r.stylePrefix||'',o=r.pStylePrefix||'',a=n.collection;n.listenTo(a,'add',n.addTo),n.listenTo(a,'reset resetNavigator',n.render),n.listenTo(a,'remove',n.removeChildren),n.className="".concat(i,"layers");var s=r.em;if(r.sortable&&!n.opt.sorter){var l=s.get('Utils');n.opt.sorter=new l.Sorter({container:r.sortContainer||n.el,containerSel:".".concat(n.className),itemSel:".".concat(i,"layer"),ignoreViewChildren:1,onEndMove:function(t,e,n){var r=e.getSourceModel();s.setSelected(r,{forceChange:1}),s.trigger("".concat(f.OA,":end"),n)},avoidSelectOnEnd:1,nested:1,ppfx:o,pfx:i})}return n.$el.data('collection',a),e.parent&&n.$el.data('model',e.parent),n}return h(e,t),e.prototype.removeChildren=function(t){var e=t.viewLayer;e&&(e.remove(),delete t.viewLayer)},e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var r=this,i=r.parentView,o=r.opt,a=r.config,s=o.ItemView,l=o.opened,c=o.module,u=e||null,f=new s({ItemView:s,level:o.level,model:t,parentView:i,config:a,sorter:o.sorter,opened:l,module:c}),h=f.render().el;if(u)u.appendChild(h);else if(void 0!==n){var p='before';this.$el.children().length==n&&(n--,p='after'),n<0?this.$el.append(h):this.$el.children().eq(n)[p](h)}else this.$el.append(h);return this.items.push(f),h},e.prototype.remove=function(){for(var t=[],e=0;e\n ").concat(x,"\n ").concat(O,"\n "):'',"\n
\n
\n
\n ").concat(C,"\n ").concat(y?"").concat(y,""):'',"\n ").concat(m,"\n
\n
\n
\n
").concat(u||'',"
\n
").concat(k||'',"
\n
")},Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),e.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,r=e.components();this.listenTo(r,'remove add reset',this.checkChildren),[['change:status',this.updateStatus],['change:open',this.updateOpening],['change:layerable',this.updateLayerable],['change:style:display',this.updateVisibility],['rerender:layer',this.render],['change:name change:custom-name',this.updateName]].forEach((function(n){return t.listenTo(e,n[0],n[1])})),this.$el.data('model',e),this.$el.data('collection',r),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},e.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},e.prototype.getVisibilityEl=function(){return this.eyeEl||(this.eyeEl=this.$el.children(".".concat(this.pfx,"layer-vis"))),this.eyeEl},e.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,r=t.module,i="".concat(e,"layer-hidden"),o=!r.isVisible(n)?'addClass':'removeClass';this.$el[o](i),this.getVisibilityEl()[o]("".concat(e,"layer-off"))},e.prototype.toggleVisibility=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},e.prototype.handleEdit=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,i=e.clsNoEdit,o=e.clsEdit,a=this.getInputName();a[v]='true',a.focus(),document.execCommand('selectAll',!1),n.setEditing(!0),r.find(".".concat(this.inputNameCls)).removeClass(i).addClass(o)},e.prototype.handleEditKey=function(t){t.stopPropagation(),((0,a.isEscKey)(t)||(0,a.isEnterKey)(t))&&this.handleEditEnd(t)},e.prototype.handleEditEnd=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,i=e.clsNoEdit,o=e.clsEdit,a=this.getInputName(),s=a.textContent;a.scrollLeft=0,a[v]='false',this.setName(s,{component:this.model,propName:'custom-name'}),n.setEditing(!1),r.find(".".concat(this.inputNameCls)).addClass(i).removeClass(o),this.updateName()},e.prototype.setName=function(t,e){var n=e.propName;this.model.set(n,t)},e.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},e.prototype.updateOpening=function(){var t=this,e=t.$el,n=t.model,r=t.pfx,i='open',o="".concat(r,"layer-open"),a=this.getCaret();this.module.isOpen(n)?(e.addClass(i),a.addClass(o)):(e.removeClass(i),a.removeClass(o))},e.prototype.toggleOpening=function(t){var e=this.model,n=this.module;null==t||t.stopImmediatePropagation(),e.get('components').length&&n.setOpen(e,!n.isOpen(e))},e.prototype.handleSelect=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},e.prototype.handleHover=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},e.prototype.handleHoverOut=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},e.prototype.startSort=function(t){t.stopPropagation();var e=this.em,n=this.sorter;t.button&&0!==t.button||n&&(n.onStart=function(t){return e.trigger("".concat(f.OA,":start"),t)},n.onMoveClb=function(t){return e.trigger(f.OA,t)},n.startSort(t.target))},e.prototype.updateStatus=function(){u.Z.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:1}])},e.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,r=t.$el,i=t.module,o=i.getComponents(e).length,a=r.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)),s=this.cnt;s||(s=r.children('[data-count]').get(0),this.cnt=s),a[o?'removeClass':'addClass'](n),s&&(s.innerHTML=o||''),!o&&i.setOpen(e,!1)},e.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))),this.caret},e.prototype.setRoot=function(t){t=(0,r.isString)(t)?this.em.getWrapper().find(t)[0]:t;var e=(0,a.getModel)(t,0);e&&(this.stopListening(),this.model=e,this.initComponent(),this._rendered&&this.render())},e.prototype.updateLayerable=function(){(this.parentView||this).render()},e.prototype.__clearItems=function(){var t;null===(t=this.items)||void 0===t||t.remove()},e.prototype.remove=function(){for(var t=[],e=0;e{"use strict";n.r(e),n.d(e,{default:()=>E,evAll:()=>v,evPageAdd:()=>k,evPageAddBefore:()=>x,evPageRemove:()=>O,evPageRemoveBefore:()=>C,evPageSelect:()=>y,evPageSelectBefore:()=>b,evPageUpdate:()=>w,evPfx:()=>m});var r,i=n(9050),o=n(1163),a=n(7904),s=n(6434),l=n(2316),c=n(3560),u=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const f=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e,n)||this,i=n.em,o={};r.em=i,e.frames||(o.component=e.component,o.styles=e.styles,['component','styles'].map((function(t){return r.unset(t)})));var a=e.frames||[o],s=new c.Z(i.get('Canvas'),a);s.page=r,r.set('frames',s),!r.getId()&&r.set('id',null==i?void 0:i.get('PageManager')._createId());var l=null==i?void 0:i.get('UndoManager');return null==l||l.add(s),r}return u(e,t),e.prototype.defaults=function(){return{frames:[],_undo:!0}},e.prototype.onRemove=function(){this.getFrames().reset()},e.prototype.getFrames=function(){return this.get('frames')},e.prototype.getId=function(){return this.id},e.prototype.getName=function(){return this.get('name')},e.prototype.setName=function(t){return this.set({name:t})},e.prototype.getAllFrames=function(){return this.getFrames().models||[]},e.prototype.getMainFrame=function(){return this.getFrames().at(0)},e.prototype.getMainComponent=function(){var t=this.getMainFrame();return null==t?void 0:t.getComponent()},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=l.Model.prototype.toJSON.call(this,t),n=(0,i.result)(this,'defaults');return(0,i.forEach)(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),(0,i.forEach)(n,(function(t,n){e[n]===t&&delete e[n]})),e},e}(l.Model);var h=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),p=void 0&&(void 0).__assign||function(){return p=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";n.r(e),n.d(e,{default:()=>V});var r=n(6434),i='sw-visibility',o='export-template',a='open-sm',s='open-tm',l='open-layers',c='open-blocks',u='fullscreen',f='preview';const h={stylePrefix:'pn-',defaults:[{id:'commands',buttons:[{}]},{id:'options',buttons:[{active:!0,id:i,className:'fa fa-square-o',command:i,context:i,attributes:{title:'View components'}},{id:f,className:'fa fa-eye',command:f,context:f,attributes:{title:'Preview'}},{id:u,className:'fa fa-arrows-alt',command:u,context:u,attributes:{title:'Fullscreen'}},{id:o,className:'fa fa-code',command:o,attributes:{title:'View code'}}]},{id:'views',buttons:[{id:a,className:'fa fa-paint-brush',command:a,active:!0,togglable:0,attributes:{title:'Open Style Manager'}},{id:s,className:'fa fa-cog',command:s,togglable:0,attributes:{title:'Settings'}},{id:l,className:'fa fa-bars',command:l,togglable:0,attributes:{title:'Open Layer Manager'}},{id:c,className:'fa fa-th-large',command:c,togglable:0,attributes:{title:'Open Blocks'}}]}],em:null,delayBtnsShow:300};var p,d=n(7116),g=n(7904),v=void 0&&(void 0).__extends||(p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const m=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.get('buttons').length&&r.set('buttons',new w(r.module,r.get('buttons'))),r}return v(e,t),e.prototype.defaults=function(){return{id:'',label:'',tagName:'span',className:'',command:'',context:'',buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1}},Object.defineProperty(e.prototype,"className",{get:function(){return this.get('className')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.get('command')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this.get('active')},set:function(t){this.set('active',t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"togglable",{get:function(){return this.get('togglable')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runDefaultCommand",{get:function(){return this.get('runDefaultCommand')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stopDefaultCommand",{get:function(){return this.get('stopDefaultCommand')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disable",{get:function(){return this.get('disable')},enumerable:!1,configurable:!0}),e}(g.Z);var y=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(t){function e(e,n){return t.call(this,e,n,m)||this}return y(e,t),e.prototype.deactivateAllExceptOne=function(t,e){this.forEach((function(n,r){n!==t&&(n.set('active',!1),e&&n.get('buttons').length&&n.get('buttons').deactivateAllExceptOne(t,e))}))},e.prototype.deactivateAll=function(t,e){var n=t||'';this.forEach((function(t){t.get('context')==n&&t!==e&&t.set('active',!1,{fromCollection:!0})}))},e.prototype.disableAllButtons=function(t){var e=t||'';this.forEach((function(t,n){t.get('context')==e&&t.set('disable',!0)}))},e.prototype.disableAllButtonsExceptOne=function(t,e){this.forEach((function(n,r){n!==t&&(n.set('disable',!0),e&&n.get('buttons').length&&n.get('buttons').disableAllButtonsExceptOne(t,e))}))},e}(d.Z);const w=b;b.prototype.model=m;var k=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const x=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=r.get('buttons')||[];return r.buttons=new w(e,i),r}return k(e,t),e.prototype.defaults=function(){return{id:'',content:'',visible:!0,buttons:[],attributes:{}}},Object.defineProperty(e.prototype,"buttons",{get:function(){return this.get('buttons')},set:function(t){this.set('buttons',t)},enumerable:!1,configurable:!0}),e}(g.Z);var O=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t){function e(e,n){return t.call(this,e,n,x)||this}return O(e,t),e}(d.Z);const S=C;C.prototype.model=x;var _=n(3059),P=n(9050),T=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=void 0&&(void 0).__assign||function(){return E=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";n.r(e),n.d(e,{default:()=>B,evAdd:()=>Z,evAll:()=>D,evCustom:()=>F,evPfx:()=>M,evRemove:()=>N,evRemoveBefore:()=>I,evState:()=>V,evUpdate:()=>L});var r=n(9050),i=n(1163),o=n(9714),a=n(2316);const s={stylePrefix:'clm-',appendTo:'',selectors:[],states:[{name:'hover'},{name:'active'},{name:'nth-of-type(2n)'}],escapeName:0,selectedName:0,iconAdd:'',iconSync:'',iconTagOn:'',iconTagOff:'',iconTagRemove:'',render:0,componentFirst:!1,custom:!1};var l,c=n(5963),u=n(966),f=void 0&&(void 0).__extends||(l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.defaults=function(){return{name:'',label:''}},e.prototype.getName=function(){return this.get('name')},e.prototype.getLabel=function(){return this.get('label')||this.getName()},e}(a.Model);const p=h;h.prototype.idAttribute='name';var d=n(7539),g=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},m='contentEditable';const y=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.config||{};return n.config=r,n.module=e.module,n.coll=e.coll||null,n.pfx=r.stylePrefix||'',n.ppfx=r.pStylePrefix||'',n.em=r.em,n.listenTo(n.model,'change:active',n.updateStatus),n}return g(e,t),e.prototype.template=function(){var t=this,e=t.pfx,n=t.model,r=t.config,i=n.get('label')||'';return(0,d.Z)(b||(b=v(["\n \n ","\n $"," \n "],["\n \n ","\n $"," \n "])),e,e,e,i,e,e,r.iconTagRemove)},e.prototype.events=function(){return{'click [data-tag-remove]':'removeTag','click [data-tag-status]':'changeStatus','dblclick [data-tag-name]':'startEditTag','focusout [data-tag-name]':'endEditTag'}},e.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector('[data-tag-name]')),this.inputEl},e.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[m]='true',e.focus(),t&&t.setEditing(1)},e.prototype.endEditTag=function(){var t=this.model,e=this.getInputEl(),n=e.textContent,r=this.em,i=r&&r.get('SelectorManager');if(e[m]='false',r&&r.setEditing(0),i){var o=i.escapeName(n);i.get(o)?e.innerText=t.get('label'):t.set({name:o,label:n})}},e.prototype.changeStatus=function(){var t=this.model;t.set('active',!t.get('active'))},e.prototype.removeTag=function(){this.module.removeSelected(this.model)},e.prototype.updateStatus=function(){var t=this,e=t.model,n=t.$el,r=t.config,i=r.iconTagOn,o=r.iconTagOff,a=n.find('[data-tag-status]');e.get('active')?(a.html(i),n.removeClass('opac50')):(a.html(o),n.addClass('opac50'))},e.prototype.render=function(){var t=this.pfx,e=this.ppfx;return this.$el.html(this.template()),this.$el.attr('class',"".concat(t,"tag ").concat(e,"three-bg")),this.updateStatus(),this},e}(a.View);var b,w=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t};const x=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{},n.pfx=n.config.stylePrefix||'',n.ppfx=n.config.pStylePrefix||'',n.className=n.pfx+'tags',n.stateInputId=n.pfx+'states',n.stateInputC=n.pfx+'input-c',n.states=n.config.states||[];var i=n.config.em,o=n.collection;n.target=i;var a=i.get('SelectorManager');n.module=a,n.em=i,n.componentChanged=(0,r.debounce)(n.componentChanged.bind(n),0),n.checkSync=(0,r.debounce)(n.checkSync.bind(n),0);return n.listenTo(i,'component:toggled component:update:classes',n.componentChanged),n.listenTo(i,'styleManager:update',n.componentChanged),n.listenTo(i,'component:update:classes change:state',n.__handleStateChange),n.listenTo(i,'styleable:change change:device',n.checkSync),n.listenTo(o,'add',n.addNew),n.listenTo(o,'reset',n.renderClasses),n.listenTo(o,'remove',n.tagRemoved),n.listenTo(a.getAll(),a.events.state,(0,r.debounce)((function(){return n.renderStates()}),0)),n.delegateEvents(),n}return w(e,t),e.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,r=t.iconSync,i=t.iconAdd,o=t.pfx,a=t.ppfx;return(0,d.Z)(O||(O=k(["
\n
","
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $"," \n $"," \n
\n
\n
",":
\n
\n
"],["
\n
","
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $"," \n $"," \n
\n
\n
",":
\n
\n
"])),o,o,o,o,n,o,o,o,a,a,a,o,a,a,o,a,o,o,o,o,o,i,o,o,r,o,o,e,o)},e.prototype.events=function(){return{'change [data-states]':'stateChanged','click [data-add]':'startNewTag','focusout [data-input]':'endNewTag','keyup [data-input]':'onInputKeyUp','click [data-sync-style]':'syncStyle'}},e.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),r=e.get('CssComposer'),i=this.getCommonSelectors({opts:{noDisabled:1}}),o=e.get('state'),a=e.getCurrentMedia(),s=[],l=r.get(i,o,a)||r.add(i,o,a);this.getTargets().forEach((function(e){var n=r.getIdRule(e.getId(),{state:o,mediaText:a});t=n.getStyle(),n.setStyle({}),s.push(n)})),t&&l.addStyle(t),e.trigger('component:toggled'),e.trigger('component:sync-style',{component:n,selectors:i,mediaText:a,rule:l,ruleComponents:s,state:o})},e.prototype.tagRemoved=function(t){this.updateStateVis()},e.prototype.addNew=function(t){this.addToClasses(t)},e.prototype.startNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:'none'}),null===(e=this.$input)||void 0===e||e.show().focus()},e.prototype.endNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:''}),null===(e=this.$input)||void 0===e||e.hide().val('')},e.prototype.onInputKeyUp=function(t){var e;13===t.keyCode?(t.preventDefault(),this.addNewTag(null===(e=this.$input)||void 0===e?void 0:e.val())):27===t.keyCode&&this.endNewTag()},e.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},e.prototype.componentChanged=function(t){var e=(void 0===t?{}:t).targets;this.updateSelection(e)},e.prototype.updateSelection=function(t){var e=t||this.getTargets(),n=[];return(e=(0,r.isArray)(e)?e:[e])&&e.length&&(n=this.getCommonSelectors({targets:e}),this.checkSync({validSelectors:n})),this.collection.reset(n),this.updateStateVis(e),this.module.__trgCustom(),n},e.prototype.getCommonSelectors=function(t){var e=void 0===t?{}:t,n=e.targets,r=e.opts,i=void 0===r?{}:r,o=n||this.getTargets();return this.module.__getCommonSelectors(o,i)},e.prototype._commonSelectors=function(){for(var t,e=[],n=0;n",""],["",""])),i,t);else{var c=null==t?void 0:t.getSelectors();if(!c)return'';var u=c.getStyleable(),f=a.get('state'),h=t.getId?(0,d.Z)(S||(S=k(["","\n #",""],["","\n #",""])),i,t.getName(),i,t.getId()):'';e=(e=this.collection.getFullString(u))?(0,d.Z)(_||(_=k(["",""],["",""])),i,e):t.get('selectorsAdd')||h,e=l&&h?h:e,e+=f?(0,d.Z)(P||(P=k([":",""],[":",""])),i,f):'',e=s?s({result:e,state:f,target:t}):e}return e&&"").concat(e,"")},e.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set('state',n)},e.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},e.prototype.addToClasses=function(t,e){var n=e,r=this.getClasses(),i=new y({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(i):r.append(i),i},e.prototype.renderClasses=function(){var t=this,e=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each((function(n){return t.addToClasses(n,e)})),n.append(e)},e.prototype.getClasses=function(){return this.$el.find('[data-selectors]')},e.prototype.getStates=function(){if(!this.$states){var t=this.$el.find('[data-states]');this.$states=t[0]&&t}return this.$states},e.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find('#'+this.stateInputC)),this.$statesC},e.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t('selectorManager.emptyState'),r=t.getStates().map((function(t){var n=e.t("selectorManager.states.".concat(t.id))||t.getLabel()||t.id;return"")})).join(''),i=this.getStates();i&&i.html("").concat(r)),this.checkStates()},e.prototype.render=function(){var t=this,e=t.em,n=t.pfx,r=t.ppfx,i=t.config,o=t.$el,a=t.el,s=i.render,l={iconSync:i.iconSync,iconAdd:i.iconAdd,labelHead:e.t('selectorManager.label'),labelInfo:e.t('selectorManager.selected'),ppfx:r,pfx:n,el:a};o.html(this.template(l));var c=s&&s(l);return c&&c!==a&&o.empty().append(c),this.$input=o.find('[data-input]'),this.$addBtn=o.find('[data-add]'),this.$classes=o.find('#'+n+'tags-c'),this.$btnSyncEl=o.find('[data-sync-style]'),this.$input.hide(),this.renderStates(),this.renderClasses(),o.attr('class',"".concat(this.className," ").concat(r,"one-bg ").concat(r,"two-color")),this},e}(a.View);var O,C,S,_,P,T=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=void 0&&(void 0).__assign||function(){return E=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0})):e.slice(1).reduce((function(e,n){return t.__common(e,n)}),e[0]):[]},e}(o.Z)},5963:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r,i=n(9050),o=n(2316),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=1,l=2,c=function(t){function e(n,r){void 0===r&&(r={});var i=t.call(this,n,r)||this,o=r.config,a=void 0===o?{}:o,s=i.get('name'),l=i.get('label');s?l||i.set('label',s):i.set('name',l);var c=i.get('name'),u=a.escapeName,f=u?u(c):e.escapeName(c);return i.set('name',f),i.em=r.em,i}return a(e,t),e.prototype.defaults=function(){return{name:'',label:'',type:s,active:!0,private:!1,protected:!1,_undo:!0}},e.prototype.isId=function(){return this.get('type')===l},e.prototype.isClass=function(){return this.get('type')===s},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.escape,n=this.get('name'),r='';switch(this.get('type')){case s:r='.';break;case l:r='#'}return r+(e?e(n):n)},e.prototype.toString=function(){return this.getFullName()},e.prototype.getLabel=function(){return this.get('label')},e.prototype.setLabel=function(t){return this.set('label',t)},e.prototype.getActive=function(){return this.get('active')},e.prototype.setActive=function(t){return this.set('active',t)},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=this.em,n=o.Model.prototype.toJSON.call(this,[t]),r=(0,i.result)(this,'defaults');if(e&&e.getConfig().avoidDefaults){(0,i.forEach)(r,(function(t,e){n[e]===t&&delete n[e]})),n.label===n.name&&delete n.label;var a=(0,i.keys)(n).length;1===a&&n.name&&(n=n.name),2===a&&n.name&&n.type&&(n=this.getFullName())}return n},e.escapeName=function(t){return"".concat(t).trim().replace(/([^a-z0-9\w-\:]+)/gi,'-')},e.TYPE_CLASS=s,e.TYPE_ID=l,e}(o.Model);const u=c;c.prototype.idAttribute='name'},966:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r,i=n(9050),o=n(2316),a=n(5963),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t,e){return t.reduce((function(n,r,i){return n.concat(l(t.slice(i+1),"".concat(e).concat(r)))}),[e])},c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.modelId=function(t){return"".concat(t.name,"_").concat(t.type||a.Z.TYPE_CLASS)},e.prototype.getStyleable=function(){return(0,i.filter)(this.models,(function(t){return t.get('active')&&!t.get('private')}))},e.prototype.getValid=function(t){var e=(void 0===t?{}:t).noDisabled;return(0,i.filter)(this.models,(function(t){return!t.get('private')})).filter((function(t){return e?t.get('active'):1}))},e.prototype.getFullString=function(t,e){void 0===e&&(e={});var n=[];return(t||this).forEach((function(t){return n.push(t.getFullName(e))})),e.sort&&n.sort(),n.join('').trim()},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.combination,n=t.array,r=[],i=this.map((function(e){return e.getFullName(t)})).sort();return e?i.forEach((function(t,e){r=r.concat(l(i.slice(e+1),t))})):r=i,n?r:e?r.join(','):r.join('')},e}(o.Collection);const u=c;c.prototype.model=a.Z},7539:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(1163);function i(t){for(var e=[],n=1;n{"use strict";n.r(e),n.d(e,{appendStyles:()=>p,buildBase64UrlFromSvg:()=>U,camelCase:()=>b,capitalize:()=>I,createId:()=>z,deepMerge:()=>T,escape:()=>P,find:()=>_,getElRect:()=>j,getElement:()=>x,getGlobal:()=>l,getKeyChar:()=>D,getKeyCode:()=>R,getModel:()=>E,getPointerEvent:()=>A,getUiClass:()=>h,getUnitFromValue:()=>m,getViewEl:()=>B,hasDnd:()=>k,hasWin:()=>s,isCommentNode:()=>C,isComponent:()=>F,isDef:()=>a,isEmptyObj:()=>N,isEnterKey:()=>Z,isEscKey:()=>M,isObject:()=>L,isRule:()=>V,isTaggableNode:()=>S,isTextNode:()=>O,matches:()=>f,normalizeFloat:()=>w,off:()=>v,on:()=>g,setViewEl:()=>H,shallowDiff:()=>d,toLowerCase:()=>c,upFirst:()=>y});var r=n(9050),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0?a!==s&&(n[o]=s):n[o]=null}for(var o in e)e.hasOwnProperty(o)&&(0,r.isUndefined)(t[o])&&(n[o]=e[o]);return n},g=function(t,e,n,r){var i=e.split(/\s+/);t=t instanceof Array?t:[t];for(var o=function(e){t.forEach((function(t){return t&&t.addEventListener(i[e],n,r)}))},a=0;a/g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/`/g,'`')},T=function(){for(var t=[],e=0;e{var r={"./CanvasClear":7202,"./CanvasClear.js":7202,"./CanvasMove":327,"./CanvasMove.js":327,"./CommandAbstract":238,"./CommandAbstract.js":238,"./ComponentDelete":5820,"./ComponentDelete.js":5820,"./ComponentDrag":6694,"./ComponentDrag.js":6694,"./ComponentEnter":1947,"./ComponentEnter.js":1947,"./ComponentExit":3888,"./ComponentExit.js":3888,"./ComponentNext":5883,"./ComponentNext.js":5883,"./ComponentPrev":7508,"./ComponentPrev.js":7508,"./ComponentStyleClear":8769,"./ComponentStyleClear.js":8769,"./CopyComponent":2213,"./CopyComponent.js":2213,"./DeleteComponent":5049,"./DeleteComponent.js":5049,"./ExportTemplate":3775,"./ExportTemplate.js":3775,"./Fullscreen":58,"./Fullscreen.js":58,"./MoveComponent":8658,"./MoveComponent.js":8658,"./OpenAssets":9617,"./OpenAssets.js":9617,"./OpenBlocks":5821,"./OpenBlocks.js":5821,"./OpenLayers":3452,"./OpenLayers.js":3452,"./OpenStyleManager":2840,"./OpenStyleManager.js":2840,"./OpenTraitManager":8644,"./OpenTraitManager.js":8644,"./PasteComponent":560,"./PasteComponent.js":560,"./Preview":4944,"./Preview.js":4944,"./Resize":7538,"./Resize.js":7538,"./SelectComponent":2620,"./SelectComponent.js":2620,"./SelectPosition":8463,"./SelectPosition.js":8463,"./ShowOffset":7994,"./ShowOffset.js":7994,"./SwitchVisibility":8352,"./SwitchVisibility.js":8352};function i(t){var e=o(t);return n(e)}function o(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code='MODULE_NOT_FOUND',e}return r[t]}i.keys=function(){return Object.keys(r)},i.resolve=o,t.exports=i,i.id=2828},7061:(t,e,n)=>{var r=n(8698)["default"];function i(){"use strict";t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports["default"]=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof d?e:d,o=Object.create(i.prototype),a=new _(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=O(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=h(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p={};function d(){}function g(){}function v(){}var m={};u(m,s,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(P([])));b&&b!==n&&o.call(b,s)&&(m=b);var w=v.prototype=d.prototype=Object.create(m);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(i,a,s,l){var c=h(t[i],t,a);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==r(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(f).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function O(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=h(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function P(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=i,t.exports.__esModule=!0,t.exports["default"]=t.exports},8698:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports["default"]=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports["default"]=t.exports},4687:(t,e,n)=>{var r=n(7061)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},907:(t,e,n)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr})},7326:(t,e,n)=>{"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,{Z:()=>r})},5861:(t,e,n)=>{"use strict";function r(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function s(t){r(a,i,o,s,l,"next",t)}function l(t){r(a,i,o,s,l,"throw",t)}s(void 0)}))}}n.d(e,{Z:()=>i})},5671:(t,e,n)=>{"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{Z:()=>r})},3144:(t,e,n)=>{"use strict";function r(t,e){for(var n=0;ni})},4942:(t,e,n)=>{"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{Z:()=>r})},1752:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(1120);function i(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=(0,r.Z)(t)););return t}function o(){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=i(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},o.apply(this,arguments)}},1120:(t,e,n)=>{"use strict";function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}n.d(e,{Z:()=>r})},9340:(t,e,n)=>{"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)}n.d(e,{Z:()=>i})},4925:(t,e,n)=>{"use strict";function r(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}n.d(e,{Z:()=>r})},2963:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(1002),i=n(7326);function o(t,e){if(e&&("object"===(0,r.Z)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(t)}},885:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(181);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw i}}return o}}(t,e)||(0,r.Z)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},168:(t,e,n)=>{"use strict";function r(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}n.d(e,{Z:()=>r})},2982:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(907);var i=n(181);function o(t){return function(t){if(Array.isArray(t))return(0,r.Z)(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||(0,i.Z)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},1002:(t,e,n)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.d(e,{Z:()=>r})},181:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(907);function i(t,e){if(t){if("string"==typeof t)return(0,r.Z)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.Z)(t,e):void 0}}},9050:(t,e,n)=>{"use strict";n.r(e),n.d(e,{VERSION:()=>i,after:()=>Ze,all:()=>en,allKeys:()=>vt,any:()=>nn,assign:()=>Zt,before:()=>Le,bind:()=>Oe,bindAll:()=>_e,chain:()=>be,chunk:()=>Fn,clone:()=>Ft,collect:()=>Ke,compact:()=>Tn,compose:()=>Me,constant:()=>J,contains:()=>rn,countBy:()=>yn,create:()=>It,debounce:()=>Ae,default:()=>Un,defaults:()=>Lt,defer:()=>Ee,delay:()=>Te,detect:()=>$e,difference:()=>jn,drop:()=>_n,each:()=>Ge,escape:()=>se,every:()=>en,extend:()=>Mt,extendOwn:()=>Zt,filter:()=>Qe,find:()=>$e,findIndex:()=>Ve,findKey:()=>Ie,findLastIndex:()=>Be,findWhere:()=>qe,first:()=>Sn,flatten:()=>En,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ge,functions:()=>Rt,get:()=>Ut,groupBy:()=>vn,has:()=>Wt,head:()=>Sn,identity:()=>$t,include:()=>rn,includes:()=>rn,indexBy:()=>mn,indexOf:()=>Ue,initial:()=>Cn,inject:()=>Xe,intersection:()=>Mn,invert:()=>At,invoke:()=>on,isArguments:()=>K,isArray:()=>$,isArrayBuffer:()=>N,isBoolean:()=>T,isDataView:()=>W,isDate:()=>D,isElement:()=>E,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>Z,isFinite:()=>Y,isFunction:()=>V,isMap:()=>St,isMatch:()=>ct,isNaN:()=>X,isNull:()=>_,isNumber:()=>R,isObject:()=>S,isRegExp:()=>M,isSet:()=>Pt,isString:()=>A,isSymbol:()=>L,isTypedArray:()=>it,isUndefined:()=>P,isWeakMap:()=>_t,isWeakSet:()=>Tt,iteratee:()=>Xt,keys:()=>st,last:()=>Pn,lastIndexOf:()=>We,map:()=>Ke,mapObject:()=>Qt,matcher:()=>qt,matches:()=>qt,max:()=>ln,memoize:()=>Pe,methods:()=>Rt,min:()=>cn,mixin:()=>Bn,negate:()=>De,noop:()=>te,now:()=>ie,object:()=>Nn,omit:()=>On,once:()=>Ne,pairs:()=>jt,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>an,property:()=>Gt,propertyOf:()=>ee,random:()=>re,range:()=>In,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>tn,rest:()=>_n,restArguments:()=>C,result:()=>ve,sample:()=>hn,select:()=>Qe,shuffle:()=>pn,size:()=>wn,some:()=>nn,sortBy:()=>dn,sortedIndex:()=>He,tail:()=>_n,take:()=>Sn,tap:()=>Vt,template:()=>ge,templateSettings:()=>ce,throttle:()=>je,times:()=>ne,toArray:()=>fn,toPath:()=>Bt,transpose:()=>Zn,unescape:()=>le,union:()=>Dn,uniq:()=>Rn,unique:()=>Rn,uniqueId:()=>ye,unzip:()=>Zn,values:()=>Et,where:()=>sn,without:()=>An,wrap:()=>Re,zip:()=>Ln});var r={};n.r(r),n.d(r,{VERSION:()=>i,after:()=>Ze,all:()=>en,allKeys:()=>vt,any:()=>nn,assign:()=>Zt,before:()=>Le,bind:()=>Oe,bindAll:()=>_e,chain:()=>be,chunk:()=>Fn,clone:()=>Ft,collect:()=>Ke,compact:()=>Tn,compose:()=>Me,constant:()=>J,contains:()=>rn,countBy:()=>yn,create:()=>It,debounce:()=>Ae,default:()=>Hn,defaults:()=>Lt,defer:()=>Ee,delay:()=>Te,detect:()=>$e,difference:()=>jn,drop:()=>_n,each:()=>Ge,escape:()=>se,every:()=>en,extend:()=>Mt,extendOwn:()=>Zt,filter:()=>Qe,find:()=>$e,findIndex:()=>Ve,findKey:()=>Ie,findLastIndex:()=>Be,findWhere:()=>qe,first:()=>Sn,flatten:()=>En,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ge,functions:()=>Rt,get:()=>Ut,groupBy:()=>vn,has:()=>Wt,head:()=>Sn,identity:()=>$t,include:()=>rn,includes:()=>rn,indexBy:()=>mn,indexOf:()=>Ue,initial:()=>Cn,inject:()=>Xe,intersection:()=>Mn,invert:()=>At,invoke:()=>on,isArguments:()=>K,isArray:()=>$,isArrayBuffer:()=>N,isBoolean:()=>T,isDataView:()=>W,isDate:()=>D,isElement:()=>E,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>Z,isFinite:()=>Y,isFunction:()=>V,isMap:()=>St,isMatch:()=>ct,isNaN:()=>X,isNull:()=>_,isNumber:()=>R,isObject:()=>S,isRegExp:()=>M,isSet:()=>Pt,isString:()=>A,isSymbol:()=>L,isTypedArray:()=>it,isUndefined:()=>P,isWeakMap:()=>_t,isWeakSet:()=>Tt,iteratee:()=>Xt,keys:()=>st,last:()=>Pn,lastIndexOf:()=>We,map:()=>Ke,mapObject:()=>Qt,matcher:()=>qt,matches:()=>qt,max:()=>ln,memoize:()=>Pe,methods:()=>Rt,min:()=>cn,mixin:()=>Bn,negate:()=>De,noop:()=>te,now:()=>ie,object:()=>Nn,omit:()=>On,once:()=>Ne,pairs:()=>jt,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>an,property:()=>Gt,propertyOf:()=>ee,random:()=>re,range:()=>In,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>tn,rest:()=>_n,restArguments:()=>C,result:()=>ve,sample:()=>hn,select:()=>Qe,shuffle:()=>pn,size:()=>wn,some:()=>nn,sortBy:()=>dn,sortedIndex:()=>He,tail:()=>_n,take:()=>Sn,tap:()=>Vt,template:()=>ge,templateSettings:()=>ce,throttle:()=>je,times:()=>ne,toArray:()=>fn,toPath:()=>Bt,transpose:()=>Zn,unescape:()=>le,union:()=>Dn,uniq:()=>Rn,unique:()=>Rn,uniqueId:()=>ye,unzip:()=>Zn,values:()=>Et,where:()=>sn,without:()=>An,wrap:()=>Re,zip:()=>Ln});var i='1.13.4',o='object'==typeof self&&self.self===self&&self||'object'==typeof global&&global.global===global&&global||Function('return this')()||{},a=Array.prototype,s=Object.prototype,l='undefined'!=typeof Symbol?Symbol.prototype:null,c=a.push,u=a.slice,f=s.toString,h=s.hasOwnProperty,p='undefined'!=typeof ArrayBuffer,d='undefined'!=typeof DataView,g=Array.isArray,v=Object.keys,m=Object.create,y=p&&ArrayBuffer.isView,b=isNaN,w=isFinite,k=!{toString:null}.propertyIsEnumerable('toString'),x=['valueOf','isPrototypeOf','toString','propertyIsEnumerable','hasOwnProperty','toLocaleString'],O=Math.pow(2,53)-1;function C(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i=0&&n<=O}}function tt(t){return function(e){return null==e?void 0:e[t]}}const et=tt('byteLength'),nt=Q(et);var rt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const it=p?function(t){return y?y(t)&&!W(t):nt(t)&&rt.test(f.call(t))}:J(!1),ot=tt('length');function at(t,e){e=function(t){for(var e={},n=t.length,r=0;r':'>','"':'"',"'":''','`':'`'},se=oe(ae),le=oe(At(ae)),ce=ut.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ue=/(.)^/,fe={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'},he=/\\|'|\r|\n|\u2028|\u2029/g;function pe(t){return'\\'+fe[t]}var de=/^\s*(\w|\$)+\s*$/;function ge(t,e,n){!e&&n&&(e=n),e=Lt({},e,ut.templateSettings);var r=RegExp([(e.escape||ue).source,(e.interpolate||ue).source,(e.evaluate||ue).source].join('|')+'|$','g'),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(he,pe),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n";var a,s=e.variable;if(s){if(!de.test(s))throw new Error('variable is not a bare identifier: '+s)}else o='with(obj||{}){\n'+o+'}\n',s='obj';o="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+o+'return __p;\n';try{a=new Function(s,'_',o)}catch(t){throw t.source=o,t}var l=function(t){return a.call(this,t,ut)};return l.source='function('+s+'){\n'+o+'}',l}function ve(t,e,n){var r=(e=Ht(e)).length;if(!r)return V(n)?n.call(t):n;for(var i=0;i1)Se(s,e-1,n,r),i=r.length;else for(var l=0,c=s.length;le?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}function Ae(t,e,n){var r,i,o,a,s,l=function(){var c=ie()-i;e>c?r=setTimeout(l,e-c):(r=null,n||(a=t.apply(s,o)),r||(o=s=null))},c=C((function(c){return s=this,o=c,i=ie(),r||(r=setTimeout(l,e),n&&(a=t.apply(s,o))),a}));return c.cancel=function(){clearTimeout(r),r=o=s=null},c}function Re(t,e){return xe(e,t)}function De(t){return function(){return!t.apply(this,arguments)}}function Me(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function Ze(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Le(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const Ne=xe(Le,2);function Ie(t,e,n){e=Jt(e,n);for(var r,i=st(t),o=0,a=i.length;o0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(u.call(r,a,s),X))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o0?0:a-1;for(i||(r=e[o?o[s]:s],s+=t);s>=0&&s=3;return e(t,Kt(n,i,4),r,o)}}const Xe=Ye(1),Je=Ye(-1);function Qe(t,e,n){var r=[];return e=Jt(e,n),Ge(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function tn(t,e,n){return Qe(t,De(Jt(e)),n)}function en(t,e,n){e=Jt(e,n);for(var r=!Ce(t)&&st(t),i=(r||t).length,o=0;o=0}const on=C((function(t,e,n){var r,i;return V(e)?i=e:(e=Ht(e),r=e.slice(0,-1),e=e[e.length-1]),Ke(t,(function(t){var o=i;if(!o){if(r&&r.length&&(t=zt(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)}))}));function an(t,e){return Ke(t,Gt(e))}function sn(t,e){return Qe(t,qt(e))}function ln(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,l=(t=Ce(t)?t:Et(t)).length;so&&(o=r);else e=Jt(e,n),Ge(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function cn(t,e,n){var r,i,o=1/0,a=1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,l=(t=Ce(t)?t:Et(t)).length;sr||void 0===n)return 1;if(n1&&(r=Kt(r,e[1])),e=vt(t)):(r=kn,e=Se(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i1&&(n=e[1])):(e=Ke(Se(e,!1,!1),String),r=function(t,n){return!rn(e,n)}),xn(t,r,n)}));function Cn(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function Sn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Cn(t,t.length-e)}function _n(t,e,n){return u.call(t,null==e||n?1:e)}function Pn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:_n(t,Math.max(0,t.length-e))}function Tn(t){return Qe(t,Boolean)}function En(t,e){return Se(t,e,!1)}const jn=C((function(t,e){return e=Se(e,!0,!0),Qe(t,(function(t){return!rn(e,t)}))})),An=C((function(t,e){return jn(t,e)}));function Rn(t,e,n,r){T(e)||(r=n,n=e,e=!1),null!=n&&(n=Jt(n,r));for(var i=[],o=[],a=0,s=ot(t);a{var e=t&&t.__esModule?()=>t['default']:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if('object'==typeof globalThis)return globalThis;try{return this||new Function('return this')()}catch(t){if('object'==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(t,'__esModule',{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>F});var t=n(4942),e=n(9050),i=n(2579),o=n(7539);const a={stylePrefix:'gjs-',components:'',style:'',fromElement:!1,projectData:null,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,dragMode:0,listenToEl:[],cssIcons:'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css',icons:{close:'',move:'',plus:'',caret:'',delete:'',copy:'',arrowUp:'',chevron:'',eye:'',eyeOff:''},el:'',i18n:{},undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:'Code',keepUnusedStyles:!1,multiFrames:!1,customUI:!1};var s=n(2316),l=n.n(s);var c,u=n(1163),f=void 0&&(void 0).__extends||(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},c(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(s.Model);const p=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getByComponent=function(t){var e=this;return this.filter((function(n){return e.getComponent(n)===t}))[0]},n.prototype.addComponent=function(t,n){var r=this,i=((0,e.isArray)(t)?t:[t]).filter((function(t){return!r.hasComponent(t)})).map((function(t){return new h({component:t})}))[0];return this.push(i,n)},n.prototype.getComponent=function(t){return t.get('component')},n.prototype.hasComponent=function(t){var e=this.getByComponent(t);return e&&this.contains(e)},n.prototype.lastComponent=function(){var t=this.last();return t&&this.getComponent(t)},n.prototype.allComponents=function(){var t=this;return this.map((function(e){return t.getComponent(e)})).filter((function(t){return t}))},n.prototype.removeComponent=function(t,n){var r=this,i=((0,e.isArray)(t)?t:[t]).map((function(t){return r.getByComponent(t)}));return this.remove(i,n)},n}(s.Collection);var d=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=void 0&&(void 0).__assign||function(){return g=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.getStepsBeforeSave()&&this.store().catch((function(e){return t.logError(e)}))},n.prototype.loadModule=function(t){var n=this.config,r=new(t.default||t)(this),i=r.name.charAt(0).toLowerCase()+r.name.slice(1),o=(0,e.isUndefined)(n[i])?n[r.name]:n[i],a=!0===o?{}:o||{};return a.pStylePrefix=n.pStylePrefix||'',(0,e.isUndefined)(o)||o||(a._disable=1),r.storageKey&&r.store&&r.load&&this.storables.push(r),a.em=this,r.init(g({},a)),!r.private&&this.set(r.name,r),r.onLoad&&this.toLoad.push(r),this.modules.push(r),this},n.prototype.tsLoadModule=function(t){var e=new(t.default||t)(this);return e.storageKey&&e.store&&e.load&&this.storables.push(e),!e.private&&this.set(e.name,e),e.onLoad&&this.toLoad.push(e),this.modules.push(e),this},n.prototype.init=function(t,e){void 0===e&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set('Editor',t)},n.prototype.getEditor=function(){return this.get('Editor')},n.prototype.handleUpdates=function(t,e,n){var r=this;void 0===n&&(n={}),this.__skip||n.temporary||n.noCount||n.avoidStore||!this.get('ready')||(this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout((function(){var t=r.getDirtyCount()||0,e=(n.unset,y(n,["unset"]));r.set('changesCount',t+1,e)}),0))},n.prototype.changesUp=function(t){this.handleUpdates(0,0,t)},n.prototype.componentHovered=function(t,e,n){var r=this.previous('componentHovered');r&&this.trigger('component:unhovered',r,n),e&&this.trigger('component:hovered',e,n)},n.prototype.getSelected=function(){return this.selected.lastComponent()},n.prototype.getSelectedAll=function(){return this.selected.allComponents()},n.prototype.setSelected=function(t,n){var r=this;void 0===n&&(n={});var o=n.event,a=o&&(o.ctrlKey||o.metaKey),s=(o||{}).shiftKey,l=((0,e.isArray)(t)?t:[t]).map((function(t){return(0,u.getModel)(t,i["default"])})),c=this.getSelectedAll(),f=this.getConfig().multipleSelection,h=(0,e.isArray)(t);h&&this.removeSelected(c.filter((function(t){return!(0,e.contains)(l,t)}))),l.forEach((function(t){var i=(0,u.getModel)(t,void 0);if(i&&(r.trigger('component:select:before',i,n),!i.get('selectable')||n.abort)){if(!n.useValid)return;for(var o=i.parent();o&&!o.get('selectable');)o=o.parent();i=o}if(a&&f)return r.toggleSelected(i);if(s&&f){r.clearSelection(r.get('Canvas').getWindow());var l,p,d=i.collection,g=i.index();if(r.getSelectedAll().forEach((function(t){var n=t.collection,r=t.index();n===d&&(rg&&(p=(0,e.isUndefined)(p)?r:Math.min(p,r)))})),!(0,e.isUndefined)(l))for(;l!==g;)r.addSelected(d.at(l)),l++;if(!(0,e.isUndefined)(p))for(;p!==g;)r.addSelected(d.at(p)),p--;return r.addSelected(i)}!h&&r.removeSelected(c.filter((function(t){return t!==i}))),r.addSelected(i,n),i}))},n.prototype.addSelected=function(t,n){var r=this;void 0===n&&(n={});var o=(0,u.getModel)(t,i["default"]);((0,e.isArray)(o)?o:[o]).forEach((function(t){if(!t||t.get('selectable')){var e=r.selected;n.forceChange&&r.removeSelected(t,n),e.addComponent(t,n),t&&r.trigger('component:select',t,n)}}))},n.prototype.removeSelected=function(t,e){void 0===e&&(e={}),this.selected.removeComponent((0,u.getModel)(t,i["default"]),e)},n.prototype.toggleSelected=function(t,n){var r=this;void 0===n&&(n={});var o=(0,u.getModel)(t,i["default"]);((0,e.isArray)(o)?o:[o]).forEach((function(t){r.selected.hasComponent(t)?r.removeSelected(t,n):r.addSelected(t,n)}))},n.prototype.setHovered=function(t,e){if(void 0===e&&(e={}),!t)return this.set('componentHovered','');var n='component:hover',r=(0,u.getModel)(t,void 0);if(r){if(e.forceChange&&this.set('componentHovered',''),this.trigger("".concat(n,":before"),r,e),!r.get('hoverable')){if(!e.useValid||e.abort)return;for(var i=r&&r.parent();i&&!i.get('hoverable');)i=i.parent();r=i}e.abort||(this.set('componentHovered',r,e),this.trigger(n,r,e))}},n.prototype.getHovered=function(){return this.get('componentHovered')},n.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.get('DomComponents').setComponents(t,e)},n.prototype.getComponents=function(){var t=this.get('DomComponents'),e=this.get('CodeManager');if(t&&e){var n=t.getComponents();return e.getCode(n,'json')}},n.prototype.setStyle=function(t,e){void 0===e&&(e={});var n=this.get('CssComposer');return n.clear(e),n.getAll().add(t,e),this},n.prototype.addStyle=function(t,n){void 0===n&&(n={});var r=this.getStyle().add(t,n);return(0,e.isArray)(r)?r:[r]},n.prototype.getStyle=function(){return this.get('CssComposer').getAll()},n.prototype.setState=function(t){return this.set('state',t),this},n.prototype.getState=function(){return this.get('state')||''},n.prototype.getHtml=function(t){void 0===t&&(t={});var e=this.config,n=e.optsHtml,r=e.jsInHtml?this.getJs(t):'',i=t.component||this.get('DomComponents').getComponent(),o=i?this.get('CodeManager').getCode(i,'html',g(g({},n),t)):'';return o+=r?"