@innovastudio/contentbox 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,7 @@ var ContentBox=function(){"use strict";class t{appendHtml(t,e,i="beforeend"){t.i
17
17
  * @author RubaXa <trash@rubaxa.org>
18
18
  * @author owenm <owen23355@gmail.com>
19
19
  * @license MIT
20
- */function O(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function I(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?O(Object(i),!0).forEach((function(e){R(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):O(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function $(t){return $="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)}function R(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function B(){return B=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},B.apply(this,arguments)}function P(t,e){if(null==t)return{};var i,n,o=function(t,e){if(null==t)return{};var i,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function N(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var z=N(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),D=N(/Edge/i),H=N(/firefox/i),j=N(/safari/i)&&!N(/chrome/i)&&!N(/android/i),F=N(/iP(ad|od|hone)/i),U=N(/chrome/i)&&N(/android/i),W={capture:!1,passive:!1};function Y(t,e,i){t.addEventListener(e,i,!z&&W)}function G(t,e,i){t.removeEventListener(e,i,!z&&W)}function X(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function V(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function K(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&X(t,e):X(t,e))||n&&t===i)return t;if(t===i)break}while(t=V(t))}return null}var Z,Q=/\s+/g;function J(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(Q," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(Q," ")}}function tt(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function et(t,e){var i="";if("string"==typeof t)i=t;else do{var n=tt(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(i)}function it(t,e,i){if(t){var n=t.getElementsByTagName(e),o=0,s=n.length;if(i)for(;o<s;o++)i(n[o],o);return n}return[]}function nt(){var t=document.scrollingElement;return t||document.documentElement}function ot(t,e,i,n,o){if(t.getBoundingClientRect||t===window){var s,a,l,r,c,d,u;if(t!==window&&t.parentNode&&t!==nt()?(a=(s=t.getBoundingClientRect()).top,l=s.left,r=s.bottom,c=s.right,d=s.height,u=s.width):(a=0,l=0,r=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||i)&&t!==window&&(o=o||t.parentNode,!z))do{if(o&&o.getBoundingClientRect&&("none"!==tt(o,"transform")||i&&"static"!==tt(o,"position"))){var p=o.getBoundingClientRect();a-=p.top+parseInt(tt(o,"border-top-width")),l-=p.left+parseInt(tt(o,"border-left-width")),r=a+s.height,c=l+s.width;break}}while(o=o.parentNode);if(n&&t!==window){var h=et(o||t),m=h&&h.a,b=h&&h.d;h&&(r=(a/=b)+(d/=b),c=(l/=m)+(u/=m))}return{top:a,left:l,bottom:r,right:c,width:u,height:d}}}function st(t,e,i){for(var n=dt(t,!0),o=ot(t)[e];n;){var s=ot(n)[i];if(!("top"===i||"left"===i?o>=s:o<=s))return n;if(n===nt())break;n=dt(n,!1)}return!1}function at(t,e,i,n){for(var o=0,s=0,a=t.children;s<a.length;){if("none"!==a[s].style.display&&a[s]!==he.ghost&&(n||a[s]!==he.dragged)&&K(a[s],i.draggable,t,!1)){if(o===e)return a[s];o++}s++}return null}function lt(t,e){for(var i=t.lastElementChild;i&&(i===he.ghost||"none"===tt(i,"display")||e&&!X(i,e));)i=i.previousElementSibling;return i||null}function rt(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===he.clone||e&&!X(t,e)||i++;return i}function ct(t){var e=0,i=0,n=nt();if(t)do{var o=et(t),s=o.a,a=o.d;e+=t.scrollLeft*s,i+=t.scrollTop*a}while(t!==n&&(t=t.parentNode));return[e,i]}function dt(t,e){if(!t||!t.getBoundingClientRect)return nt();var i=t,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var o=tt(i);if(i.clientWidth<i.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!i.getBoundingClientRect||i===document.body)return nt();if(n||e)return i;n=!0}}}while(i=i.parentNode);return nt()}function ut(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function pt(t,e){return function(){if(!Z){var i=arguments,n=this;1===i.length?t.call(n,i[0]):t.apply(n,i),Z=setTimeout((function(){Z=void 0}),e)}}}function ht(t,e,i){t.scrollLeft+=e,t.scrollTop+=i}function mt(t){var e=window.Polymer,i=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):i?i(t).clone(!0)[0]:t.cloneNode(!0)}var bt="Sortable"+(new Date).getTime();function gt(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==tt(t,"display")&&t!==he.ghost){e.push({target:t,rect:ot(t)});var i=I({},e[e.length-1].rect);if(t.thisAnimationDuration){var n=et(t,!0);n&&(i.top-=n.f,i.left-=n.e)}t.fromRect=i}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var i in t)if(t.hasOwnProperty(i))for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[i][n])return Number(i);return-1}(e,{target:t}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof i&&i());var o=!1,s=0;e.forEach((function(t){var e=0,i=t.target,a=i.fromRect,l=ot(i),r=i.prevFromRect,c=i.prevToRect,d=t.rect,u=et(i,!0);u&&(l.top-=u.f,l.left-=u.e),i.toRect=l,i.thisAnimationDuration&&ut(r,l)&&!ut(a,l)&&(d.top-l.top)/(d.left-l.left)==(a.top-l.top)/(a.left-l.left)&&(e=function(t,e,i,n){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))*n.animation}(d,r,c,n.options)),ut(l,a)||(i.prevFromRect=a,i.prevToRect=l,e||(e=n.options.animation),n.animate(i,d,l,e)),e&&(o=!0,s=Math.max(s,e),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout((function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null}),e),i.thisAnimationDuration=e)})),clearTimeout(t),o?t=setTimeout((function(){"function"==typeof i&&i()}),s):"function"==typeof i&&i(),e=[]},animate:function(t,e,i,n){if(n){tt(t,"transition",""),tt(t,"transform","");var o=et(this.el),s=o&&o.a,a=o&&o.d,l=(e.left-i.left)/(s||1),r=(e.top-i.top)/(a||1);t.animatingX=!!l,t.animatingY=!!r,tt(t,"transform","translate3d("+l+"px,"+r+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),tt(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),tt(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){tt(t,"transition",""),tt(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),n)}}}}var vt=[],ft={initializeByDefault:!0},yt={mount:function(t){for(var e in ft)ft.hasOwnProperty(e)&&!(e in t)&&(t[e]=ft[e]);vt.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),vt.push(t)},pluginEvent:function(t,e,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var o=t+"Global";vt.forEach((function(n){e[n.pluginName]&&(e[n.pluginName][o]&&e[n.pluginName][o](I({sortable:e},i)),e.options[n.pluginName]&&e[n.pluginName][t]&&e[n.pluginName][t](I({sortable:e},i)))}))},initializePlugins:function(t,e,i,n){for(var o in vt.forEach((function(n){var o=n.pluginName;if(t.options[o]||n.initializeByDefault){var s=new n(t,e,t.options);s.sortable=t,s.options=t.options,t[o]=s,B(i,s.defaults)}})),t.options)if(t.options.hasOwnProperty(o)){var s=this.modifyOption(t,o,t.options[o]);void 0!==s&&(t.options[o]=s)}},getEventProperties:function(t,e){var i={};return vt.forEach((function(n){"function"==typeof n.eventProperties&&B(i,n.eventProperties.call(e[n.pluginName],t))})),i},modifyOption:function(t,e,i){var n;return vt.forEach((function(o){t[o.pluginName]&&o.optionListeners&&"function"==typeof o.optionListeners[e]&&(n=o.optionListeners[e].call(t[o.pluginName],i))})),n}};var xt=["evt"],_t=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,o=P(i,xt);yt.pluginEvent.bind(he)(t,e,I({dragEl:St,parentEl:kt,ghostEl:Ct,rootEl:Lt,nextEl:At,lastDownEl:Et,cloneEl:qt,cloneHidden:Tt,dragStarted:Ft,putSortable:Bt,activeSortable:he.active,originalEvent:n,oldIndex:Mt,oldDraggableIndex:It,newIndex:Ot,newDraggableIndex:$t,hideGhostForTarget:ce,unhideGhostForTarget:de,cloneNowHidden:function(){Tt=!0},cloneNowShown:function(){Tt=!1},dispatchSortableEvent:function(t){wt({sortable:e,name:t,originalEvent:n})}},o))};function wt(t){!function(t){var e=t.sortable,i=t.rootEl,n=t.name,o=t.targetEl,s=t.cloneEl,a=t.toEl,l=t.fromEl,r=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,u=t.newDraggableIndex,p=t.originalEvent,h=t.putSortable,m=t.extraEventProperties;if(e=e||i&&i[bt]){var b,g=e.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||z||D?(b=document.createEvent("Event")).initEvent(n,!0,!0):b=new CustomEvent(n,{bubbles:!0,cancelable:!0}),b.to=a||i,b.from=l||i,b.item=o||i,b.clone=s,b.oldIndex=r,b.newIndex=c,b.oldDraggableIndex=d,b.newDraggableIndex=u,b.originalEvent=p,b.pullMode=h?h.lastPutMode:void 0;var f=I(I({},m),yt.getEventProperties(n,e));for(var y in f)b[y]=f[y];i&&i.dispatchEvent(b),g[v]&&g[v].call(e,b)}}(I({putSortable:Bt,cloneEl:qt,targetEl:St,rootEl:Lt,oldIndex:Mt,oldDraggableIndex:It,newIndex:Ot,newDraggableIndex:$t},t))}var St,kt,Ct,Lt,At,Et,qt,Tt,Mt,Ot,It,$t,Rt,Bt,Pt,Nt,zt,Dt,Ht,jt,Ft,Ut,Wt,Yt,Gt,Xt=!1,Vt=!1,Kt=[],Zt=!1,Qt=!1,Jt=[],te=!1,ee=[],ie="undefined"!=typeof document,ne=F,oe=D||z?"cssFloat":"float",se=ie&&!U&&!F&&"draggable"in document.createElement("div"),ae=function(){if(ie){if(z)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),le=function(t,e){var i=tt(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=at(t,0,e),s=at(t,1,e),a=o&&tt(o),l=s&&tt(s),r=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ot(o).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ot(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&"none"!==a.float){var d="left"===a.float?"left":"right";return!s||"both"!==l.clear&&l.clear!==d?"horizontal":"vertical"}return o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||r>=n&&"none"===i[oe]||s&&"none"===i[oe]&&r+c>n)?"vertical":"horizontal"},re=function(t){function e(t,i){return function(n,o,s,a){var l=n.options.group.name&&o.options.group.name&&n.options.group.name===o.options.group.name;if(null==t&&(i||l))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,o,s,a),i)(n,o,s,a);var r=(i?n:o).options.group.name;return!0===t||"string"==typeof t&&t===r||t.join&&t.indexOf(r)>-1}}var i={},n=t.group;n&&"object"==$(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},ce=function(){!ae&&Ct&&tt(Ct,"display","none")},de=function(){!ae&&Ct&&tt(Ct,"display","")};ie&&!U&&document.addEventListener("click",(function(t){if(Vt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Vt=!1,!1}),!0);var ue=function(t){if(St){t=t.touches?t.touches[0]:t;var e=(o=t.clientX,s=t.clientY,Kt.some((function(t){var e=t[bt].options.emptyInsertThreshold;if(e&&!lt(t)){var i=ot(t),n=o>=i.left-e&&o<=i.right+e,l=s>=i.top-e&&s<=i.bottom+e;return n&&l?a=t:void 0}})),a);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[bt]._onDragOver(i)}}var o,s,a},pe=function(t){St&&St.parentNode[bt]._isOutsideThisEl(t.target)};function he(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=B({},e),t[bt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return le(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==he.supportPointer&&"PointerEvent"in window&&!j,emptyInsertThreshold:5};for(var n in yt.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var o in re(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&se,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Y(t,"pointerdown",this._onTapStart):(Y(t,"mousedown",this._onTapStart),Y(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Y(t,"dragover",this),Y(t,"dragenter",this)),Kt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),B(this,gt())}function me(t,e,i,n,o,s,a,l){var r,c,d=t[bt],u=d.options.onMove;return!window.CustomEvent||z||D?(r=document.createEvent("Event")).initEvent("move",!0,!0):r=new CustomEvent("move",{bubbles:!0,cancelable:!0}),r.to=e,r.from=t,r.dragged=i,r.draggedRect=n,r.related=o||e,r.relatedRect=s||ot(e),r.willInsertAfter=l,r.originalEvent=a,t.dispatchEvent(r),u&&(c=u.call(d,r,a)),c}function be(t){t.draggable=!1}function ge(){te=!1}function ve(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function fe(t){return setTimeout(t,0)}function ye(t){return clearTimeout(t)}he.prototype={constructor:he,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Ut=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,St):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,o=n.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,r=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=n.filter;if(function(t){ee.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&ee.push(n)}}(i),!St&&!(/mousedown|pointerdown/.test(s)&&0!==t.button||n.disabled)&&!r.isContentEditable&&(this.nativeDraggable||!j||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=K(l,n.draggable,i,!1))&&l.animated||Et===l)){if(Mt=rt(l),It=rt(l,n.draggable),"function"==typeof c){if(c.call(this,t,l,this))return wt({sortable:e,rootEl:r,name:"filter",targetEl:l,toEl:i,fromEl:i}),_t("filter",e,{evt:t}),void(o&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(n){if(n=K(r,n.trim(),i,!1))return wt({sortable:e,rootEl:n,name:"filter",targetEl:l,fromEl:i,toEl:i}),_t("filter",e,{evt:t}),!0}))))return void(o&&t.cancelable&&t.preventDefault());n.handle&&!K(r,n.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,i){var n,o=this,s=o.el,a=o.options,l=s.ownerDocument;if(i&&!St&&i.parentNode===s){var r=ot(i);if(Lt=s,kt=(St=i).parentNode,At=St.nextSibling,Et=i,Rt=a.group,he.dragged=St,Pt={target:St,clientX:(e||t).clientX,clientY:(e||t).clientY},Ht=Pt.clientX-r.left,jt=Pt.clientY-r.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,St.style["will-change"]="all",n=function(){_t("delayEnded",o,{evt:t}),he.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!H&&o.nativeDraggable&&(St.draggable=!0),o._triggerDragStart(t,e),wt({sortable:o,name:"choose",originalEvent:t}),J(St,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){it(St,t.trim(),be)})),Y(l,"dragover",ue),Y(l,"mousemove",ue),Y(l,"touchmove",ue),Y(l,"mouseup",o._onDrop),Y(l,"touchend",o._onDrop),Y(l,"touchcancel",o._onDrop),H&&this.nativeDraggable&&(this.options.touchStartThreshold=4,St.draggable=!0),_t("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(D||z))n();else{if(he.eventCanceled)return void this._onDrop();Y(l,"mouseup",o._disableDelayedDrag),Y(l,"touchend",o._disableDelayedDrag),Y(l,"touchcancel",o._disableDelayedDrag),Y(l,"mousemove",o._delayedDragTouchMoveHandler),Y(l,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&Y(l,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(n,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){St&&be(St),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;G(t,"mouseup",this._disableDelayedDrag),G(t,"touchend",this._disableDelayedDrag),G(t,"touchcancel",this._disableDelayedDrag),G(t,"mousemove",this._delayedDragTouchMoveHandler),G(t,"touchmove",this._delayedDragTouchMoveHandler),G(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Y(document,"pointermove",this._onTouchMove):Y(document,e?"touchmove":"mousemove",this._onTouchMove):(Y(St,"dragend",this),Y(Lt,"dragstart",this._onDragStart));try{document.selection?fe((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Xt=!1,Lt&&St){_t("dragStarted",this,{evt:e}),this.nativeDraggable&&Y(document,"dragover",pe);var i=this.options;!t&&J(St,i.dragClass,!1),J(St,i.ghostClass,!0),he.active=this,t&&this._appendGhost(),wt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Nt){this._lastX=Nt.clientX,this._lastY=Nt.clientY,ce();for(var t=document.elementFromPoint(Nt.clientX,Nt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Nt.clientX,Nt.clientY))!==e;)e=t;if(St.parentNode[bt]._isOutsideThisEl(t),e)do{if(e[bt]){if(e[bt]._onDragOver({clientX:Nt.clientX,clientY:Nt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);de()}},_onTouchMove:function(t){if(Pt){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,o=t.touches?t.touches[0]:t,s=Ct&&et(Ct,!0),a=Ct&&s&&s.a,l=Ct&&s&&s.d,r=ne&&Gt&&ct(Gt),c=(o.clientX-Pt.clientX+n.x)/(a||1)+(r?r[0]-Jt[0]:0)/(a||1),d=(o.clientY-Pt.clientY+n.y)/(l||1)+(r?r[1]-Jt[1]:0)/(l||1);if(!he.active&&!Xt){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(Ct){s?(s.e+=c-(zt||0),s.f+=d-(Dt||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");tt(Ct,"webkitTransform",u),tt(Ct,"mozTransform",u),tt(Ct,"msTransform",u),tt(Ct,"transform",u),zt=c,Dt=d,Nt=o}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Ct){var t=this.options.fallbackOnBody?document.body:Lt,e=ot(St,!0,ne,!0,t),i=this.options;if(ne){for(Gt=t;"static"===tt(Gt,"position")&&"none"===tt(Gt,"transform")&&Gt!==document;)Gt=Gt.parentNode;Gt!==document.body&&Gt!==document.documentElement?(Gt===document&&(Gt=nt()),e.top+=Gt.scrollTop,e.left+=Gt.scrollLeft):Gt=nt(),Jt=ct(Gt)}J(Ct=St.cloneNode(!0),i.ghostClass,!1),J(Ct,i.fallbackClass,!0),J(Ct,i.dragClass,!0),tt(Ct,"transition",""),tt(Ct,"transform",""),tt(Ct,"box-sizing","border-box"),tt(Ct,"margin",0),tt(Ct,"top",e.top),tt(Ct,"left",e.left),tt(Ct,"width",e.width),tt(Ct,"height",e.height),tt(Ct,"opacity","0.8"),tt(Ct,"position",ne?"absolute":"fixed"),tt(Ct,"zIndex","100000"),tt(Ct,"pointerEvents","none"),he.ghost=Ct,t.appendChild(Ct),tt(Ct,"transform-origin",Ht/parseInt(Ct.style.width)*100+"% "+jt/parseInt(Ct.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,n=t.dataTransfer,o=i.options;_t("dragStart",this,{evt:t}),he.eventCanceled?this._onDrop():(_t("setupClone",this),he.eventCanceled||((qt=mt(St)).removeAttribute("id"),qt.draggable=!1,qt.style["will-change"]="",this._hideClone(),J(qt,this.options.chosenClass,!1),he.clone=qt),i.cloneId=fe((function(){_t("clone",i),he.eventCanceled||(i.options.removeCloneOnHide||Lt.insertBefore(qt,St),i._hideClone(),wt({sortable:i,name:"clone"}))})),!e&&J(St,o.dragClass,!0),e?(Vt=!0,i._loopId=setInterval(i._emulateDragOver,50)):(G(document,"mouseup",i._onDrop),G(document,"touchend",i._onDrop),G(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",o.setData&&o.setData.call(i,n,St)),Y(document,"drop",i),tt(St,"transform","translateZ(0)")),Xt=!0,i._dragStartId=fe(i._dragStarted.bind(i,e,t)),Y(document,"selectstart",i),Ft=!0,j&&tt(document.body,"user-select","none"))},_onDragOver:function(t){var e,i,n,o,s=this.el,a=t.target,l=this.options,r=l.group,c=he.active,d=Rt===r,u=l.sort,p=Bt||c,h=this,m=!1;if(!te){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),a=K(a,l.draggable,s,!0),q("dragOver"),he.eventCanceled)return m;if(St.contains(t.target)||a.animated&&a.animatingX&&a.animatingY||h._ignoreWhileAnimating===a)return M(!1);if(Vt=!1,c&&!l.disabled&&(d?u||(n=kt!==Lt):Bt===this||(this.lastPutMode=Rt.checkPull(this,c,St,t))&&r.checkPut(this,c,St,t))){if(o="vertical"===this._getDirection(t,a),e=ot(St),q("dragOverValid"),he.eventCanceled)return m;if(n)return kt=Lt,T(),this._hideClone(),q("revert"),he.eventCanceled||(At?Lt.insertBefore(St,At):Lt.appendChild(St)),M(!0);var b=lt(s,l.draggable);if(!b||function(t,e,i){var n=ot(lt(i.el,i.options.draggable)),o=10;return e?t.clientX>n.right+o||t.clientX<=n.right&&t.clientY>n.bottom&&t.clientX>=n.left:t.clientX>n.right&&t.clientY>n.top||t.clientX<=n.right&&t.clientY>n.bottom+o}(t,o,this)&&!b.animated){if(b===St)return M(!1);if(b&&s===t.target&&(a=b),a&&(i=ot(a)),!1!==me(Lt,s,St,e,a,i,t,!!a))return T(),b&&b.nextSibling?s.insertBefore(St,b.nextSibling):s.appendChild(St),kt=s,O(),M(!0)}else if(b&&function(t,e,i){var n=ot(at(i.el,0,i.options,!0)),o=10;return e?t.clientX<n.left-o||t.clientY<n.top&&t.clientX<n.right:t.clientY<n.top-o||t.clientY<n.bottom&&t.clientX<n.left}(t,o,this)){var g=at(s,0,l,!0);if(g===St)return M(!1);if(i=ot(a=g),!1!==me(Lt,s,St,e,a,i,t,!1))return T(),s.insertBefore(St,g),kt=s,O(),M(!0)}else if(a.parentNode===s){i=ot(a);var v,f,y,x=St.parentNode!==s,_=!function(t,e,i){var n=i?t.left:t.top,o=i?t.right:t.bottom,s=i?t.width:t.height,a=i?e.left:e.top,l=i?e.right:e.bottom,r=i?e.width:e.height;return n===a||o===l||n+s/2===a+r/2}(St.animated&&St.toRect||e,a.animated&&a.toRect||i,o),w=o?"top":"left",S=st(a,"top","top")||st(St,"top","top"),k=S?S.scrollTop:void 0;if(Ut!==a&&(f=i[w],Zt=!1,Qt=!_&&l.invertSwap||x),v=function(t,e,i,n,o,s,a,l){var r=n?t.clientY:t.clientX,c=n?i.height:i.width,d=n?i.top:i.left,u=n?i.bottom:i.right,p=!1;if(!a)if(l&&Yt<c*o){if(!Zt&&(1===Wt?r>d+c*s/2:r<u-c*s/2)&&(Zt=!0),Zt)p=!0;else if(1===Wt?r<d+Yt:r>u-Yt)return-Wt}else if(r>d+c*(1-o)/2&&r<u-c*(1-o)/2)return function(t){return rt(St)<rt(t)?1:-1}(e);if((p=p||a)&&(r<d+c*s/2||r>u-c*s/2))return r>d+c/2?1:-1;return 0}(t,a,i,o,_?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Qt,Ut===a),0!==v){var C=rt(St);do{C-=v,y=kt.children[C]}while(y&&("none"===tt(y,"display")||y===Ct))}if(0===v||y===a)return M(!1);Ut=a,Wt=v;var L=a.nextElementSibling,A=!1,E=me(Lt,s,St,e,a,i,t,A=1===v);if(!1!==E)return 1!==E&&-1!==E||(A=1===E),te=!0,setTimeout(ge,30),T(),A&&!L?s.appendChild(St):a.parentNode.insertBefore(St,A?L:a),S&&ht(S,0,k-S.scrollTop),kt=St.parentNode,void 0===f||Qt||(Yt=Math.abs(f-ot(a)[w])),O(),M(!0)}if(s.contains(St))return M(!1)}return!1}function q(l,r){_t(l,h,I({evt:t,isOwner:d,axis:o?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:u,fromSortable:p,target:a,completed:M,onMove:function(i,n){return me(Lt,s,St,e,i,ot(i),t,n)},changed:O},r))}function T(){q("dragOverAnimationCapture"),h.captureAnimationState(),h!==p&&p.captureAnimationState()}function M(e){return q("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(h),h!==p&&(J(St,Bt?Bt.options.ghostClass:c.options.ghostClass,!1),J(St,l.ghostClass,!0)),Bt!==h&&h!==he.active?Bt=h:h===he.active&&Bt&&(Bt=null),p===h&&(h._ignoreWhileAnimating=a),h.animateAll((function(){q("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(a===St&&!St.animated||a===s&&!a.animated)&&(Ut=null),l.dragoverBubble||t.rootEl||a===document||(St.parentNode[bt]._isOutsideThisEl(t.target),!e&&ue(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function O(){Ot=rt(St),$t=rt(St,l.draggable),wt({sortable:h,name:"change",toEl:s,newIndex:Ot,newDraggableIndex:$t,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){G(document,"mousemove",this._onTouchMove),G(document,"touchmove",this._onTouchMove),G(document,"pointermove",this._onTouchMove),G(document,"dragover",ue),G(document,"mousemove",ue),G(document,"touchmove",ue)},_offUpEvents:function(){var t=this.el.ownerDocument;G(t,"mouseup",this._onDrop),G(t,"touchend",this._onDrop),G(t,"pointerup",this._onDrop),G(t,"touchcancel",this._onDrop),G(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;Ot=rt(St),$t=rt(St,i.draggable),_t("drop",this,{evt:t}),kt=St&&St.parentNode,Ot=rt(St),$t=rt(St,i.draggable),he.eventCanceled||(Xt=!1,Qt=!1,Zt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ye(this.cloneId),ye(this._dragStartId),this.nativeDraggable&&(G(document,"drop",this),G(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),j&&tt(document.body,"user-select",""),tt(St,"transform",""),t&&(Ft&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),Ct&&Ct.parentNode&&Ct.parentNode.removeChild(Ct),(Lt===kt||Bt&&"clone"!==Bt.lastPutMode)&&qt&&qt.parentNode&&qt.parentNode.removeChild(qt),St&&(this.nativeDraggable&&G(St,"dragend",this),be(St),St.style["will-change"]="",Ft&&!Xt&&J(St,Bt?Bt.options.ghostClass:this.options.ghostClass,!1),J(St,this.options.chosenClass,!1),wt({sortable:this,name:"unchoose",toEl:kt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Lt!==kt?(Ot>=0&&(wt({rootEl:kt,name:"add",toEl:kt,fromEl:Lt,originalEvent:t}),wt({sortable:this,name:"remove",toEl:kt,originalEvent:t}),wt({rootEl:kt,name:"sort",toEl:kt,fromEl:Lt,originalEvent:t}),wt({sortable:this,name:"sort",toEl:kt,originalEvent:t})),Bt&&Bt.save()):Ot!==Mt&&Ot>=0&&(wt({sortable:this,name:"update",toEl:kt,originalEvent:t}),wt({sortable:this,name:"sort",toEl:kt,originalEvent:t})),he.active&&(null!=Ot&&-1!==Ot||(Ot=Mt,$t=It),wt({sortable:this,name:"end",toEl:kt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){_t("nulling",this),Lt=St=kt=Ct=At=qt=Et=Tt=Pt=Nt=Ft=Ot=$t=Mt=It=Ut=Wt=Bt=Rt=he.dragged=he.ghost=he.clone=he.active=null,ee.forEach((function(t){t.checked=!0})),ee.length=zt=Dt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":St&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,o=i.length,s=this.options;n<o;n++)K(t=i[n],s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||ve(t));return e},sort:function(t,e){var i={},n=this.el;this.toArray().forEach((function(t,e){var o=n.children[e];K(o,this.options.draggable,n,!1)&&(i[t]=o)}),this),e&&this.captureAnimationState(),t.forEach((function(t){i[t]&&(n.removeChild(i[t]),n.appendChild(i[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return K(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(void 0===e)return i[t];var n=yt.modifyOption(this,t,e);i[t]=void 0!==n?n:e,"group"===t&&re(i)},destroy:function(){_t("destroy",this);var t=this.el;t[bt]=null,G(t,"mousedown",this._onTapStart),G(t,"touchstart",this._onTapStart),G(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(G(t,"dragover",this),G(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Kt.splice(Kt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Tt){if(_t("hideClone",this),he.eventCanceled)return;tt(qt,"display","none"),this.options.removeCloneOnHide&&qt.parentNode&&qt.parentNode.removeChild(qt),Tt=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(Tt){if(_t("showClone",this),he.eventCanceled)return;St.parentNode!=Lt||this.options.group.revertClone?At?Lt.insertBefore(qt,At):Lt.appendChild(qt):Lt.insertBefore(qt,St),this.options.group.revertClone&&this.animate(St,qt),tt(qt,"display",""),Tt=!1}}else this._hideClone()}},ie&&Y(document,"touchmove",(function(t){(he.active||Xt)&&t.cancelable&&t.preventDefault()})),he.utils={on:Y,off:G,css:tt,find:it,is:function(t,e){return!!K(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},throttle:pt,closest:K,toggleClass:J,clone:mt,index:rt,nextTick:fe,cancelNextTick:ye,detectDirection:le,getChild:at},he.get=function(t){return t[bt]},he.mount=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e[0].constructor===Array&&(e=e[0]),e.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(he.utils=I(I({},he.utils),t.utils)),yt.mount(t)}))},he.create=function(t,e){return new he(t,e)},he.version="1.15.0";var xe,_e,we,Se,ke,Ce,Le=[],Ae=!1;function Ee(){Le.forEach((function(t){clearInterval(t.pid)})),Le=[]}function qe(){clearInterval(Ce)}var Te=pt((function(t,e,i,n){if(e.scroll){var o,s=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,l=e.scrollSensitivity,r=e.scrollSpeed,c=nt(),d=!1;_e!==i&&(_e=i,Ee(),xe=e.scroll,o=e.scrollFn,!0===xe&&(xe=dt(i,!0)));var u=0,p=xe;do{var h=p,m=ot(h),b=m.top,g=m.bottom,v=m.left,f=m.right,y=m.width,x=m.height,_=void 0,w=void 0,S=h.scrollWidth,k=h.scrollHeight,C=tt(h),L=h.scrollLeft,A=h.scrollTop;h===c?(_=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX||"visible"===C.overflowX),w=x<k&&("auto"===C.overflowY||"scroll"===C.overflowY||"visible"===C.overflowY)):(_=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX),w=x<k&&("auto"===C.overflowY||"scroll"===C.overflowY));var E=_&&(Math.abs(f-s)<=l&&L+y<S)-(Math.abs(v-s)<=l&&!!L),q=w&&(Math.abs(g-a)<=l&&A+x<k)-(Math.abs(b-a)<=l&&!!A);if(!Le[u])for(var T=0;T<=u;T++)Le[T]||(Le[T]={});Le[u].vx==E&&Le[u].vy==q&&Le[u].el===h||(Le[u].el=h,Le[u].vx=E,Le[u].vy=q,clearInterval(Le[u].pid),0==E&&0==q||(d=!0,Le[u].pid=setInterval(function(){n&&0===this.layer&&he.active._onTouchMove(ke);var e=Le[this.layer].vy?Le[this.layer].vy*r:0,i=Le[this.layer].vx?Le[this.layer].vx*r:0;"function"==typeof o&&"continue"!==o.call(he.dragged.parentNode[bt],i,e,t,ke,Le[this.layer].el)||ht(Le[this.layer].el,i,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&p!==c&&(p=dt(p,!1)));Ae=d}}),30),Me=function(t){var e=t.originalEvent,i=t.putSortable,n=t.dragEl,o=t.activeSortable,s=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var r=i||o;a();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(c.clientX,c.clientY);l(),r&&!r.el.contains(d)&&(s("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function Oe(){}function Ie(){}Oe.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=at(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),i&&i.animateAll()},drop:Me},B(Oe,{pluginName:"revertOnSpill"}),Ie.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:Me},B(Ie,{pluginName:"removeOnSpill"}),he.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?Y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Y(document,"pointermove",this._handleFallbackAutoScroll):e.touches?Y(document,"touchmove",this._handleFallbackAutoScroll):Y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?G(document,"dragover",this._handleAutoScroll):(G(document,"pointermove",this._handleFallbackAutoScroll),G(document,"touchmove",this._handleFallbackAutoScroll),G(document,"mousemove",this._handleFallbackAutoScroll)),qe(),Ee(),clearTimeout(Z),Z=void 0},nulling:function(){ke=_e=xe=Ae=Ce=we=Se=null,Le.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var i=this,n=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(n,o);if(ke=t,e||this.options.forceAutoScrollFallback||D||z||j){Te(t,this.options,s,e);var a=dt(s,!0);!Ae||Ce&&n===we&&o===Se||(Ce&&qe(),Ce=setInterval((function(){var s=dt(document.elementFromPoint(n,o),!0);s!==a&&(a=s,Ee()),Te(t,i.options,s,e)}),10),we=n,Se=o)}else{if(!this.options.bubbleScroll||dt(s,!0)===nt())return void Ee();Te(t,this.options,dt(s,!1),!1)}}},B(t,{pluginName:"scroll",initializeByDefault:!0})}),he.mount(Ie,Oe);class $e{constructor(t,e){this.builder=e,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="choices">\n <select class="inp-category">\n </select>\n </div>\n\n <div class="div-blocks">\n\n </div>\n `;t.insertAdjacentHTML("beforeend",n),this.blocks=t.querySelector(".div-blocks");t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()}));const o=this.builder.snippetCategories,s=document.querySelector(".inp-category");o.forEach((t=>{const e=document.createElement("option");e.value=t[0],e.innerHTML=t[1],s.appendChild(e)})),this.category=new m(s,{removeItemButton:!1,itemSelectText:"",allowHTML:!0,searchEnabled:!1,shouldSort:!1}),s.addEventListener("change",(t=>{this.filterBlocks(t.detail.value)})),this.renderBlocks()}filterBlocks(t){const e=window.data_basic,n=this.builder.snippetPath;let o=this.blocks.querySelectorAll(".snippet-item"),s=!1;Array.prototype.forEach.call(o,(e=>{e.getAttribute("data-cat")===t&&(s=!0)})),s||e.snippets.forEach((e=>{if(e.category===t){let t='<div class="snippet-item" data-id="'+e.id+'" data-cat="'+e.category+'"><img alt="'+i("Snippet")+'" src="'+n+e.thumbnail+'"><span class="is-overlay"></span></div>';this.blocks.insertAdjacentHTML("beforeend",t)}})),t&&(o.forEach((t=>t.classList.add("hide"))),o.forEach((e=>{e.getAttribute("data-cat")===t&&e.classList.remove("hide")})))}renderBlocks(){const t=window.data_basic;if(!t)return void setTimeout((()=>{this.renderBlocks()}),100);const e=this.builder.snippetPath;let n=t.snippets,o=this.builder.slider;if("slick"===o){const e=t=>"glide"!==t.type;t.snippets=n.filter(e)}else if("glide"===o){const e=t=>"slick"!==t.type;t.snippets=n.filter(e)}else if("all"===o);else{const e=t=>"glide"!==t.type&&"slick"!==t.type;t.snippets=n.filter(e)}let s,a=1;t.snippets.forEach((t=>{if(t.id=a,t.category===this.builder.defaultSnippetCategory+""){let n='<div class="snippet-item" data-id="'+t.id+'" data-cat="'+t.category+'"><img alt="'+i("Snippet")+'" src="'+e+t.thumbnail+'"><span class="is-overlay"></span></div>';this.blocks.insertAdjacentHTML("beforeend",n)}a++})),new he(this.blocks,{group:{name:"shared",pull:"clone",put:!1},sort:!1,animation:150,onChoose:()=>{const t='\n <style id="css-scale">\n .sortable-ghost {\n height: 50px;\n }\n .sortable-ghost * {\n display: none\n }\n </style>\n ';if(this.builder.editor.iframe){const e=this.builder.editor.contentStuff.querySelector("#css-scale");e&&e.parentNode.removeChild(e),this.builder.editor.contentStuff.insertAdjacentHTML("afterbegin",t)}else{const e=this.builder.editor.builderStuff.querySelector("#css-scale");e&&e.parentNode.removeChild(e),this.builder.editor.builderStuff.insertAdjacentHTML("afterbegin",t)}this.builder.editor.sectionDropSetup()},onMove:()=>{let t=this.builder.doc.querySelector(".row-add-initial");t&&(t.style.display="none")},onStart:()=>{s=null;const t=this.builder.doc.querySelector(".builder-active");t&&(s=t,s.classList.remove("builder-active")),this.builder.editor.uo.saveForUndo();let e=document.querySelector(".is-sidebar-overlay");e&&(e.style.display="none")},onEnd:()=>{let t=document.querySelector(".is-sidebar-overlay");t&&(t.style.display="block"),this.builder.editor.util.checkEmpty();let e=this.builder.doc.querySelector(".row-add-initial");e&&(e.style.display=""),s&&s.classList.remove("builder-active"),this.builder.editor.sortableOnPage&&this.builder.editor.sortableOnPage.destroy()}})}open(){this.dialog.style.display="flex"}close(){this.dialog.style.display=""}}class Re{constructor(t,e){this.builder=e,this.section=this.builder.section,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="submain">\n\n <div class="part-breadcrumb mt-3"></div>\n\n <div class="part-element label mt-2">${i("Element")}</div>\n\n <div class="flex">\n <div style="width:auto">\n <div class="label mt-3">${i("Background Color")}:</div>\n <div class="group">\n <button title="${i("Color")}" class="btn-bgcolor is-btn-color"></button>\n </div>\n </div>\n <div>\n <div class="label mt-3">${i("Gradient")}:</div>\n <div class="group">\n <button title="${i("Gradient")}" class="btn-gradient is-btn-color"></button>\n </div>\n </div>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Width")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-width">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Height")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-height">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Max Width")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-maxwidth">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Max Height")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-maxheight">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Min Width")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-minwidth">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Min Height")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-minheight">\n </label>\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent2">\n ${i("Spacing")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent2" aria-hidden="true">\n \n <div class="subpanel">\n\n <div class="label mt-2 subtitle">${i("Padding")}:</div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Top")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-paddingtop">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Bottom")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-paddingbottom">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Left")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-paddingleft">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Right")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-paddingright">\n </label>\n </div>\n\n <div class="label subtitle mt-5">${i("Margin")}:</div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Top")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-margintop">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Bottom")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-marginbottom">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Left")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-marginleft">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Right")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-marginright">\n </label>\n </div>\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent3">\n ${i("Text")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent3" aria-hidden="true">\n \n <div class="subpanel">\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Text Color")}:</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-textcolor is-btn-color"></button>\n </div>\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Font Size")}:</span>\n <a class="btn-fontunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-fontsize">\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Text Align")}:</span>\n <select class="inp-textalign">\n <option value=""></option>\n <option value="left">${i("Left")}</option>\n <option value="center">${i("Center")}</option>\n <option value="right">${i("Right")}</option>\n <option value="justify">${i("Full")}</option>\n </select>\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Line Height")}:</span>\n <a class="btn-paraunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-lineheight">\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Font Weight")}:</span>\n <select class="inp-fontweight">\n <option value=""></option>\n <option value="100">100</option>\n <option value="200">200</option>\n <option value="300">300</option>\n <option value="400">400</option>\n <option value="500">500</option>\n <option value="600">600</option>\n <option value="700">700</option>\n <option value="800">800</option>\n <option value="900">900</option>\n <option value="bold">${i("Bold")}</option>\n <option value="normal">${i("Normal")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">${i("Font Style")}:</span>\n <select class="inp-fontstyle">\n <option value=""></option>\n <option value="italic">${i("Italic")}</option>\n <option value="normal">${i("Normal")}</option>\n </select>\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Text Transform")}:</span>\n <select class="inp-texttransform">\n <option value=""></option>\n <option value="uppercase">${i("Uppercase")}</option>\n <option value="lowercase">${i("Lowercase")}</option>\n <option value="capitalize">${i("Capitalize")}</option>\n <option value="none">${i("None")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">${i("Text Decoration")}:</span>\n <select class="inp-textdecoration">\n <option value=""></option>\n <option value="underline">${i("Underline")}</option>\n <option value="line-through">${i("Line Through")}</option>\n <option value="overline">${i("Overline")}</option>\n <option value="none">${i("None")}</option>\n </select>\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Letter Spacing")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-letterspacing" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n <label class="std">\n <span class="label">${i("Word Spacing")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-wordspacing" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n </div>\n\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent4">\n ${i("Border")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent4" aria-hidden="true">\n \n <div class="subpanel">\n\n <div class="label subtitle mt-2">${i("Border")}:</div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Width")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-borderwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-borderstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-bordercolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n <div class="label subtitle">${i("Individual Sides")}:</div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Top")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-bordertopwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-bordertopstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-bordertopcolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Bottom")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-borderbottomwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-borderbottomstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-borderbottomcolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Left")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-borderleftwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-borderleftstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-borderleftcolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Right")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-borderrightwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-borderrightstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-borderrightcolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent5">\n ${i("Corners")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent5" aria-hidden="true">\n \n <div class="subpanel">\n\n <div class="label subtitle mt-2">${i("Corners")}:</div>\n\n <label class="std">\n <span class="label mt-3">${i("Border Radius")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-borderradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n \n <div class="label subtitle mt-5">${i("Individual Corners")}:</div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Top Left")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-bordertopleftradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n <label class="std">\n <span class="label">${i("Top Right")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-bordertoprightradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("bottom Left")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-borderbottomleftradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n <label class="std">\n <span class="label">${i("bottom Right")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-borderbottomrightradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n </div>\n </div>\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent6">\n ${i("Shadow")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content " id="elmcontent6" aria-hidden="true">\n\n <div class="subpanel">\n\n <div class="label subtitle mt-2">${i("Shadow")}:</div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("x Offset")}:</span>\n <a class="btn-simpleunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-shadowxoffset">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("y Offset")}:</span>\n <a class="btn-simpleunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-shadowyoffset">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Blur")}:</span>\n <a class="btn-simpleunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-shadowblur">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Spread")}:</span>\n <a class="btn-simpleunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-shadowspread">\n </label>\n </div>\n\n <label class="std">\n <span class="label">${i("Shadow Color")}:</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-shadowcolor is-btn-color"></button>\n </div>\n </label>\n\n <div class="flex" style="justify-content:space-between">\n <label class="std">\n <span class="label">${i("Type")}:</span>\n <select class="inp-shadowtype" style="width:80px">\n <option value="">${i("Outset")}</option>\n <option value="inset">${i("Inset")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Clean")}" class="btn-clean-shadow"><svg><use xlink:href="#icon-eraser"></use></svg></button>\n </div>\n </label>\n </div>\n\n <div class="group mt-5">\n <button title="${i("More")}" class="btn-shadow" style="width:221px">${i("More")}</button>\n </div>\n \n </div>\n\n </div>\n\n \x3c!--\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent7">${i("Display")}</button>\n <div class="accordion-content subpanel" id="elmcontent7" aria-hidden="true">\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent8">${i("Position")}</button>\n <div class="accordion-content subpanel" id="elmcontent8" aria-hidden="true">\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent8">${i("Effects")}</button>\n <div class="accordion-content subpanel" id="elmcontent8" aria-hidden="true">\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent9">${i("Attributes")}</button>\n <div class="accordion-content subpanel" id="elmcontent9" aria-hidden="true">\n\n </div>\n --\x3e\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent10">\n ${i("Responsive")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent10" aria-hidden="true">\n\n <div class="subpanel">\n\n <div class="div-target">\n <button title="${i("Desktop")}" class="on" data-device="">\n <svg><use xlink:href="#icon-device-desktop"></use></svg>\n </button>\n <button title="${i("Laptop/Tablet (Landscape)")}" data-device="md">\n <svg style="transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>\n </button>\n <button title="${i("Tablet (Portrait)")}" data-device="sm">\n <svg><use xlink:href="#icon-device-tablet"></use></svg>\n </button>\n <button title="${i("Mobile")}" data-device="xs">\n <svg><use xlink:href="#icon-device-mobile"></use></svg>\n </button>\n </div>\n\n <div class="label mt-3">${i("Visibility")}:</div>\n <div class="group">\n <button title="${i("Visible")}" data-visibility="on" style="width: 105px">\n <svg><use xlink:href="#icon-eye"></use></svg>\n <span>${i("Visible")}</span>\n </button>\n <button title="${i("Hidden")}" data-visibility="" style="width: 105px">\n <svg><use xlink:href="#icon-eye-off"></use></svg>\n <span>${i("Hidden")}</span>\n </button>\n </div>\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent11">\n ${i("More")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content last" id="elmcontent11" aria-hidden="true">\n\n <div class="subpanel">\n <label class="label mt-2">\n <div>${i("Add ID")}:</div>\n <input type="text" class="inp-elm-id" onkeypress="return /[0-9a-zA-Z_]/i.test(event.key)">\n </label>\n\n <label class="label">\n <div>${i("Add Css Classes")}:</div>\n <input type="text" class="inp-elm-classes">\n </label>\n </div>\n\n </div>\n\n <div class="panel-pop unit-1" tabIndex="-1" aria-hidden="true">\n <button title="px">px</button>\n <button title="px">%</button>\n <button title="vw">vw</button>\n <button title="vw">vh</button>\n <button title="em">em</button>\n <button title="rem">rem</button>\n </div>\n\n <div class="panel-pop unit-2" tabIndex="-1" aria-hidden="true">\n <button title="px">px</button>\n <button title="pt">pt</button>\n <button title="em">em</button>\n <button title="vw">vw</button>\n <button title="vh">vh</button>\n <button title="%">%</button>\n <button title="vmin" style="width:59px">vmin</button>\n <button title="vmax" style="width:59px">vmax</button>\n </div>\n\n <div class="panel-pop unit-3" tabIndex="-1" aria-hidden="true">\n <button title="">-</button>\n <button title="px">px</button>\n <button title="pt">pt</button>\n <button title="em">em</button>\n <button title="rem">rem</button>\n <button title="%">%</button>\n </div>\n\n <div class="panel-pop unit-4" tabIndex="-1" aria-hidden="true" style="width:90px">\n <button title="px">px</button>\n <button title="em">em</button>\n </div>\n\n `;t.insertAdjacentHTML("beforeend",n),this.breadcrumb=t.querySelector(".part-breadcrumb"),this.element=t.querySelector(".part-element"),this.unit=t.querySelector(".panel-pop.unit-1"),this.unitFont=t.querySelector(".panel-pop.unit-2"),this.unitPara=t.querySelector(".panel-pop.unit-3"),this.unitSimple=t.querySelector(".panel-pop.unit-4");let o;t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()})),t.querySelectorAll(".btn-unit").forEach((t=>t.addEventListener("click",(e=>{this.builder.controlpanel.showPop(this.unit,(()=>{t.focus()}),t),this.unitButton=t,e.preventDefault()})))),t.querySelectorAll(".btn-fontunit").forEach((t=>t.addEventListener("click",(e=>{this.builder.controlpanel.showPop(this.unitFont,(()=>{t.focus()}),t),this.unitButton=t,e.preventDefault()})))),t.querySelectorAll(".btn-paraunit").forEach((t=>t.addEventListener("click",(e=>{this.builder.controlpanel.showPop(this.unitPara,(()=>{t.focus()}),t),this.unitButton=t,e.preventDefault()})))),t.querySelectorAll(".btn-simpleunit").forEach((t=>t.addEventListener("click",(e=>{this.builder.controlpanel.showPop(this.unitSimple,(()=>{t.focus()}),t),this.unitButton=t,e.preventDefault()})))),t.querySelectorAll("input").forEach((t=>{t.classList.contains("inp-elm-id")||t.classList.contains("inp-elm-classes")||t.addEventListener("input",(()=>{clearTimeout(o),o=setTimeout((()=>{this.applyStyle(t)}),600)}))})),t.querySelectorAll("select").forEach((t=>t.addEventListener("change",(()=>{this.applyStyle(t)})))),this.unit.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(()=>{this.unitButton.innerText=t.innerText,this.builder.controlpanel.hidePop(this.unit);const e=this.unitButton.parentNode.parentNode.querySelector("input");this.applyStyle(e)}))})),this.unitFont.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(()=>{this.unitButton.innerText=t.innerText,this.builder.controlpanel.hidePop(this.unitFont);const e=this.unitButton.parentNode.parentNode.querySelector("input");this.applyStyle(e)}))})),this.unitPara.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(()=>{this.unitButton.innerText=t.innerText,this.builder.controlpanel.hidePop(this.unitPara);const e=this.unitButton.parentNode.parentNode.querySelector("input");this.applyStyle(e)}))})),this.unitSimple.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(()=>{this.unitButton.innerText=t.innerText,this.builder.controlpanel.hidePop(this.unitSimple);const e=this.unitButton.parentNode.parentNode.querySelector("input");this.applyStyle(e)}))}));const s=(e,i)=>{const n=t.querySelector(i);n.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.inspectedElement;let i=n.style.backgroundColor;this.builder.editor.colorpicker().open((i=>{t.style[e]=i,n.style.backgroundColor=i,this.builder.onChange()}),i)}))};s("background-color",".btn-bgcolor"),s("color",".btn-textcolor"),s("border-color",".btn-bordercolor"),s("border-top-color",".btn-bordertopcolor"),s("border-bottom-color",".btn-borderbottomcolor"),s("border-left-color",".btn-borderleftcolor"),s("border-right-color",".btn-borderrightcolor");const a=t.querySelector(".btn-shadowcolor");a.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);let t=a.style.backgroundColor;this.builder.editor.colorpicker().open((t=>{this.setBoxShadow(),a.style.backgroundColor=t,this.builder.onChange()}),t)}));t.querySelector(".btn-shadow").addEventListener("click",(()=>{this.builder.controlpanel.objDialogShadow.open()}));t.querySelector(".btn-clean-shadow").addEventListener("click",(()=>{this.inspectedElement.style.boxShadow="",this.refresh()}));const l=t.querySelector(".btn-gradient");l.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.inspectedElement;this.builder.editor.gradientpicker().open(t,(()=>{this.builder.onChange(),l.style.backgroundImage=t.style.backgroundImage}))}));const r=t.querySelector(".div-target"),c=r.querySelectorAll("[data-device]");c.forEach((t=>{t.addEventListener("click",(()=>{c.forEach((t=>t.classList.remove("on"))),t.classList.add("on"),this.refresh()}))}));const d=t.querySelectorAll("[data-visibility]");d.forEach((t=>{t.addEventListener("click",(()=>{const e=t.getAttribute("data-visibility"),i=this.section.getDeviceTarget(r);this.setVisibility(e,i),d.forEach((t=>t.classList.remove("on"))),t.classList.add("on")}))}));const u=t.querySelector(".inp-elm-id");u.addEventListener("change",(()=>{this.builder.editor.saveForUndo();const t=this.inspectedElement;""!==u.value?t.setAttribute("id",u.value):t.removeAttribute("id"),this.builder.onChange()}));const p=t.querySelector(".inp-elm-classes");p.addEventListener("change",(()=>{this.builder.editor.saveForUndo();const t=this.inspectedElement;let e=[],i=t.getAttribute("data-class");i&&(e=i.split(" "));let n=[],o=p.value;n=o.split(" "),e.forEach((e=>{n.includes(e)||t.classList.remove(e)})),n.forEach((e=>{""!==e&&t.classList.add(e)})),t.setAttribute("data-class",o),""===t.getAttribute("data-class")&&t.removeAttribute("data-class"),this.builder.onChange()})),u.addEventListener("keyup",(()=>{const t=this.inspectedElement;""!==u.value?t.setAttribute("id",u.value):t.removeAttribute("id")}))}getState(){let t=this.builder.controlpanel.activeElement;t&&t.classList?this.inspect(t):this.close()}applyStyle(t){this.builder.editor.saveForUndo();let e=t.classList;e.contains("inp-width")&&this.setStyle("width",".inp-width"),e.contains("inp-height")&&this.setStyle("height",".inp-height"),e.contains("inp-maxwidth")&&this.setStyle("max-width",".inp-maxwidth"),e.contains("inp-maxheight")&&this.setStyle("max-height",".inp-maxheight"),e.contains("inp-minwidth")&&this.setStyle("min-width",".inp-minwidth"),e.contains("inp-minheight")&&this.setStyle("min-height",".inp-minheight"),e.contains("inp-paddingtop")&&this.setStyle("padding-top",".inp-paddingtop"),e.contains("inp-paddingbottom")&&this.setStyle("padding-bottom",".inp-paddingbottom"),e.contains("inp-paddingleft")&&this.setStyle("padding-left",".inp-paddingleft"),e.contains("inp-paddingright")&&this.setStyle("padding-right",".inp-paddingright"),e.contains("inp-margintop")&&this.setStyle("margin-top",".inp-margintop"),e.contains("inp-marginbottom")&&this.setStyle("margin-bottom",".inp-marginbottom"),e.contains("inp-marginleft")&&this.setStyle("margin-left",".inp-marginleft"),e.contains("inp-marginright")&&this.setStyle("margin-right",".inp-marginright"),e.contains("inp-fontsize")&&this.setStyle("font-size",".inp-fontsize"),e.contains("inp-lineheight")&&this.setStyle("line-height",".inp-lineheight"),e.contains("inp-letterspacing")&&this.setStylePX("letter-spacing",".inp-letterspacing"),e.contains("inp-wordspacing")&&this.setStylePX("word-spacing",".inp-wordspacing"),e.contains("inp-borderwidth")&&this.setStyle("border-width",".inp-borderwidth"),e.contains("inp-bordertopwidth")&&this.setStyle("border-top-width",".inp-bordertopwidth"),e.contains("inp-borderbottomwidth")&&this.setStyle("border-bottom-width",".inp-borderbottomwidth"),e.contains("inp-borderleftwidth")&&this.setStyle("border-left-width",".inp-borderleftwidth"),e.contains("inp-borderrightwidth")&&this.setStyle("border-right-width",".inp-borderrightwidth"),e.contains("inp-borderradius")&&this.setStylePX("border-radius",".inp-borderradius"),e.contains("inp-bordertopleftradius")&&this.setStylePX("border-top-left-radius",".inp-bordertopleftradius"),e.contains("inp-bordertoprightradius")&&this.setStylePX("border-top-right-radius",".inp-bordertoprightradius"),e.contains("inp-borderbottomleftradius")&&this.setStylePX("border-bottom-left-radius",".inp-borderbottomleftradius"),e.contains("inp-borderbottomrightradius")&&this.setStylePX("border-bottom-right-radius",".inp-borderbottomrightradius"),(e.contains("inp-shadowxoffset")||e.contains("inp-shadowyoffset")||e.contains("inp-shadowblur")||e.contains("inp-shadowspread")||e.contains("inp-shadowtype"))&&this.setBoxShadow(),e.contains("inp-textalign")&&this.setStyleSelect("text-align",".inp-textalign"),e.contains("inp-fontweight")&&this.setStyleSelect("font-weight",".inp-fontweight"),e.contains("inp-fontstyle")&&this.setStyleSelect("font-style",".inp-fontstyle"),e.contains("inp-texttransform")&&this.setStyleSelect("text-transform",".inp-texttransform"),e.contains("inp-textdecoration")&&this.setStyleSelect("text-decoration",".inp-textdecoration"),e.contains("inp-borderstyle")&&this.setStyleSelect("border-style",".inp-borderstyle"),e.contains("inp-bordertopstyle")&&this.setStyleSelect("border-top-style",".inp-bordertopstyle"),e.contains("inp-borderbottomstyle")&&this.setStyleSelect("border-bottom-style",".inp-borderbottomstyle"),e.contains("inp-borderleftstyle")&&this.setStyleSelect("border-left-style",".inp-borderleftstyle"),e.contains("inp-borderrightstyle")&&this.setStyleSelect("border-right-style",".inp-borderrightstyle"),this.builder.onChange(),(e.contains("inp-borderwidth")||e.contains("inp-bordertopwidth")||e.contains("inp-borderbottomwidth")||e.contains("inp-borderleftwidth")||e.contains("inp-borderrightwidth")||e.contains("inp-borderradius")||e.contains("inp-bordertopleftradius")||e.contains("inp-bordertoprightradius")||e.contains("inp-borderbottomleftradius")||e.contains("inp-borderbottomrightradius"))&&this.refresh()}refresh(){this.getStyle("width",".inp-width"),this.getStyle("height",".inp-height"),this.getStyle("max-width",".inp-maxwidth"),this.getStyle("max-height",".inp-maxheight"),this.getStyle("min-width",".inp-minwidth"),this.getStyle("min-height",".inp-minheight"),this.getStyle("padding-top",".inp-paddingtop"),this.getStyle("padding-bottom",".inp-paddingbottom"),this.getStyle("padding-left",".inp-paddingleft"),this.getStyle("padding-right",".inp-paddingright"),this.getStyle("margin-top",".inp-margintop"),this.getStyle("margin-bottom",".inp-marginbottom"),this.getStyle("margin-left",".inp-marginleft"),this.getStyle("margin-right",".inp-marginright"),this.getStyle("font-size",".inp-fontsize"),this.getStyle("line-height",".inp-lineheight"),this.getStylePX("letter-spacing",".inp-letterspacing"),this.getStylePX("word-spacing",".inp-wordspacing"),this.getStyle("border-width",".inp-borderwidth"),this.getStyle("border-top-width",".inp-bordertopwidth"),this.getStyle("border-bottom-width",".inp-borderbottomwidth"),this.getStyle("border-left-width",".inp-borderleftwidth"),this.getStyle("border-right-width",".inp-borderrightwidth"),this.getStylePX("border-radius",".inp-borderradius"),this.getStylePX("border-top-left-radius",".inp-bordertopleftradius"),this.getStylePX("border-top-right-radius",".inp-bordertoprightradius"),this.getStylePX("border-bottom-left-radius",".inp-borderbottomleftradius"),this.getStylePX("border-bottom-right-radius",".inp-borderbottomrightradius"),this.getBoxShadow(),this.getStyleSelect("text-align",".inp-textalign"),this.getStyleSelect("font-weight",".inp-fontweight"),this.getStyleSelect("font-style",".inp-fontstyle"),this.getStyleSelect("text-transform",".inp-texttransform"),this.getStyleSelect("text-decoration",".inp-textdecoration"),this.getStyleSelect("border-style",".inp-borderstyle"),this.getStyleSelect("border-top-style",".inp-bordertopstyle"),this.getStyleSelect("border-bottom-style",".inp-borderbottomstyle"),this.getStyleSelect("border-left-style",".inp-borderleftstyle"),this.getStyleSelect("border-right-style",".inp-borderrightstyle");const t=this.inspectedElement,e=this.dialog,i=e.querySelector(".btn-bgcolor");let n=t.style.backgroundColor;i.style.backgroundColor=n||"";const o=e.querySelector(".btn-gradient");t.style.backgroundImage?o.style.backgroundImage=t.style.backgroundImage:o.style.backgroundImage="";const s=e.querySelector(".btn-textcolor");let a=t.style.color;s.style.backgroundColor=a||"";const l=e.querySelector(".btn-bordercolor");let r=t.style.borderColor;l.style.backgroundColor=r||"";const c=e.querySelector(".btn-bordertopcolor");let d=t.style.borderTopColor;c.style.backgroundColor=d||"";const u=e.querySelector(".btn-borderbottomcolor");let p=t.style.borderBottomColor;u.style.backgroundColor=p||"";const h=e.querySelector(".btn-borderleftcolor");let m=t.style.borderLeftColor;h.style.backgroundColor=m||"";const b=e.querySelector(".btn-borderrightcolor");let g=t.style.borderRightColor;b.style.backgroundColor=g||"",this.realtimeVisibility(t);const v=t.getAttribute("id"),f=e.querySelector(".inp-elm-id");f.value=v||"";const y=t.getAttribute("data-class"),x=e.querySelector(".inp-elm-classes");x.value=y||""}inspect(t){this.inspectedElement=t,this.builder.doc.querySelectorAll(".elm-inspected").forEach((t=>t.classList.remove("elm-inspected"))),t.classList.add("elm-inspected");this.breadcrumbRender(t)?this.refresh():this.close()}getStyle(t,e){const i=this.inspectedElement,n=this.parseStyle(i,t),o=this.dialog.querySelector(e),s=o.parentNode.querySelector(".btn-unit,.btn-fontunit,.btn-paraunit,.btn-simpleunit");"line-height"===t&&""===n.unit?(i.classList.contains("leading-05")&&(o.value="0.5",s.innerText="-"),i.classList.contains("leading-06")&&(o.value="0.6",s.innerText="-"),i.classList.contains("leading-07")&&(o.value="0.7",s.innerText="-"),i.classList.contains("leading-08")&&(o.value="0.8",s.innerText="-"),i.classList.contains("leading-09")&&(o.value="0.9",s.innerText="-"),i.classList.contains("leading-none")&&(o.value="1",s.innerText="-"),i.classList.contains("leading-11")&&(o.value="1.1",s.innerText="-"),i.classList.contains("leading-12")&&(o.value="1.2",s.innerText="-"),i.classList.contains("leading-tight")&&(o.value="1.25",s.innerText="-"),i.classList.contains("leading-13")&&(o.value="1.3",s.innerText="-"),i.classList.contains("leading-snug")&&(o.value="1.375",s.innerText="-"),i.classList.contains("leading-14")&&(o.value="1.4",s.innerText="-"),i.classList.contains("leading-normal")&&(o.value="1.5",s.innerText="-"),i.classList.contains("leading-16")&&(o.value="1.6",s.innerText="-"),i.classList.contains("leading-relaxed")&&(o.value="1.625",s.innerText="-"),i.classList.contains("leading-17")&&(o.value="1.7",s.innerText="-"),i.classList.contains("leading-18")&&(o.value="1.8",s.innerText="-"),i.classList.contains("leading-19")&&(o.value="1.9",s.innerText="-"),i.classList.contains("leading-loose")&&(o.value="2",s.innerText="-"),i.classList.contains("leading-21")&&(o.value="2.1",s.innerText="-"),i.classList.contains("leading-22")&&(o.value="2.2",s.innerText="-"),i.classList.contains("leading-23")&&(o.value="2.3",s.innerText="-"),i.classList.contains("leading-24")&&(o.value="2.4",s.innerText="-"),i.classList.contains("leading-25")&&(o.value="2.5",s.innerText="-"),i.classList.contains("leading-26")&&(o.value="2.6",s.innerText="-"),i.classList.contains("leading-27")&&(o.value="2.7",s.innerText="-"),i.classList.contains("leading-28")&&(o.value="2.8",s.innerText="-"),i.classList.contains("leading-29")&&(o.value="2.9",s.innerText="-"),i.classList.contains("leading-30")&&(o.value="3",s.innerText="-")):(o.value=n.value,s.innerText=n.unit?n.unit:"-")}setStyle(t,e){const i=this.inspectedElement,n=this.dialog.querySelector(e),o=n.parentNode.querySelector(".btn-unit,.btn-fontunit,.btn-paraunit,.btn-simpleunit"),s=n.value;let a=o.innerText;if("-"===a&&(a=""),"line-height"===t){const t=this.builder.cssClasses.leading;for(let e=0;e<Object.keys(t).length;e++){let n=Object.values(t)[e];i.classList.remove(n)}}i.style[t]=s?`${s+a}`:""}setStylePX(t,e){const i=this.inspectedElement,n=this.dialog.querySelector(e).value;"border-radius"===t?setTimeout((()=>{i.style[t]=n?n+"px":""}),10):i.style[t]=n?n+"px":"",i.style[t]=n?n+"px":""}getStylePX(t,e){const i=this.inspectedElement,n=this.parseStyle(i,t),o=this.dialog.querySelector(e);"px"===n.unit?o.value=n.value:o.value=""}getBoxShadow(){const t=this.inspectedElement,e=this.parseBoxShadow(t),i=this.dialog,n=i.querySelector(".inp-shadowxoffset"),o=n.parentNode.querySelector(".btn-simpleunit"),s=i.querySelector(".inp-shadowyoffset"),a=s.parentNode.querySelector(".btn-simpleunit"),l=i.querySelector(".inp-shadowblur"),r=l.parentNode.querySelector(".btn-simpleunit"),c=i.querySelector(".inp-shadowspread"),d=c.parentNode.querySelector(".btn-simpleunit"),u=i.querySelector(".btn-shadowcolor"),p=i.querySelector(".inp-shadowtype");if(n.value="",o.innerText="px",s.value="",a.innerText="px",l.value="",r.innerText="px",c.value="",d.innerText="px",u.style.backgroundColor="",p.value="",e.color){n.value=e.xoffset.value,o.innerText=e.xoffset.unit,s.value=e.yoffset.value,a.innerText=e.yoffset.unit,l.value=e.blur.value,r.innerText=e.blur.unit,c.value=e.spread.value,d.innerText=e.spread.unit,u.style.backgroundColor=e.color,p.value=e.type;let t=e.color;u.style.backgroundColor=t||""}}setBoxShadow(){const t=this.inspectedElement,e=this.dialog,i=e.querySelector(".inp-shadowxoffset"),n=i.parentNode.querySelector(".btn-simpleunit"),o=e.querySelector(".inp-shadowyoffset"),s=o.parentNode.querySelector(".btn-simpleunit"),a=e.querySelector(".inp-shadowblur"),l=a.parentNode.querySelector(".btn-simpleunit"),r=e.querySelector(".inp-shadowspread"),c=r.parentNode.querySelector(".btn-simpleunit"),d=e.querySelector(".btn-shadowcolor"),u=e.querySelector(".inp-shadowtype"),p=i.value?i.value+n.innerText:"0px",h=o.value?o.value+s.innerText:"0px",m=a.value?a.value+l.innerText:"0px",b=r.value?r.value+c.innerText:"0px",g=d.style.backgroundColor||"rgba(0, 0, 0, 0.08)",v=u.value;if("0px"!==p||"0px"!==h){const e=[];"inset"===v&&e.push("inset"),e.push(`${p} ${h} ${m} ${b} ${g}`);const i=e.join(" ");t.style.boxShadow=i}else t.style.boxShadow=""}parseStyle(t,e){const i=t.style[e],n=i.match(/^([0-9.]+)(px|vw|vh|em|rem|pt|vmin|vmax|%)$/);if("line-height"===e){if(n){return{value:n[1],unit:n[2]}}return{value:i,unit:""}}if(n){return{value:n[1],unit:n[2]}}return{value:"",unit:"px"}}getValUnit(t){const e=t.match(/^([0-9.]+)(px|vw|vh|em|rem|pt|vmin|vmax|%)$/);if(e){return{value:e[1],unit:e[2]}}return{value:"",unit:"px"}}parseBoxShadow(t){let e=t.style.boxShadow;const i={};if(-1!==e.indexOf("inset")?(i.type="inset",e=e.replace("inset","")):i.type="",""!==e){if(-1!==e.indexOf("rgb")){let t=e.substr(e.indexOf("rgb"));t=t.substr(0,t.indexOf(")")+1),i.color=t;let n=e.split("rgb")[1].indexOf(")");e=e.split("rgb")[0]+e.split("rgb")[1].substr(n+2)}let t=e.split(" "),n=t.length,o=1;for(let e=0;e<n;e++)1===o&&(i.xoffset=this.getValUnit(t[e])),2===o&&(i.yoffset=this.getValUnit(t[e])),3===o&&(i.blur=this.getValUnit(t[e])),i.spread=4===o?this.getValUnit(t[e]):{value:"0",unit:"px"},o++}return i}setStyleSelect(t,e){const i=this.inspectedElement,n=this.dialog.querySelector(e).value;i.style[t]=n,"text-align"===t&&(i.classList.remove("text-left"),i.classList.remove("text-right"),i.classList.remove("text-center"),i.classList.remove("text-justify"))}getStyleSelect(t,e){const i=this.inspectedElement;let n=i.style[t];const o=this.dialog.querySelector(e);o.value=n,"text-align"===t&&(i.classList.contains("text-left")&&(o.value="left"),i.classList.contains("text-right")&&(o.value="right"),i.classList.contains("text-center")&&(o.value="center"),i.classList.contains("text-justify")&&(o.value="justify"))}breadcrumbRender(t){let e="",i=t,n=0;const o=[];for(;i&&!i.classList.contains("is-container");){let t=i.tagName.toLowerCase();i.parentNode&&i.parentNode.classList.contains("is-container")&&(t="Row"),i.parentNode&&i.parentNode.parentNode&&i.parentNode.parentNode.classList.contains("is-container")&&(t="Column"),o.push({index:n,element:i,html:`<a href="#" data-value="${n}">${t}</a>`}),n++,i=i.parentNode}if(!i)return this.close(),!1;for(let t=o.length-1;t>0;t--)e+=o[t].html+'<svg class="is-icon-flex"><use xlink:href="#icon-right"></use></svg>';this.breadcrumb.innerHTML=e;let s;return this.breadcrumb.querySelectorAll("a").forEach((t=>{t.addEventListener("click",(e=>{const i=t.getAttribute("data-value"),n=o[i].element;this.inspect(n),e.preventDefault(),e.stopImmediatePropagation()}))})),s=t.parentNode&&t.parentNode.classList.contains("is-container")?"Row":t.parentNode&&t.parentNode.parentNode&&t.parentNode.parentNode.classList.contains("is-container")?"Column":t.tagName.toLowerCase(),this.element.innerHTML=s,!0}setVisibility(t,e){let i=this.inspectedElement;i.classList.remove("hideonmobile"),this.builder.editor.saveForUndo();const n=(t,e)=>t.querySelectorAll(`.${e}-hidden`).length>0;"on"===t?"xs"===e?i.classList.remove("xs-hidden"):"sm"===e?(i.classList.remove("sm-hidden"),n(i.parentNode,"sm")||i.parentNode.classList.remove("sm-autofit")):"md"===e?(i.classList.remove("md-hidden"),n(i.parentNode,"md")||i.parentNode.classList.remove("md-autofit")):""===e&&(i.classList.remove("desktop-hidden"),n(i.parentNode,"desktop")||i.parentNode.classList.remove("desktop-autofit")):"xs"===e?i.classList.add("xs-hidden"):"sm"===e?(i.classList.add("sm-hidden"),i.parentNode.classList.add("sm-autofit")):"md"===e?(i.classList.add("md-hidden"),i.parentNode.classList.add("md-autofit")):""===e&&(i.classList.add("desktop-hidden"),i.parentNode.classList.add("desktop-autofit")),this.builder.onChange()}getDeviceTarget(t){return t.querySelector("button.on").getAttribute("data-device")}realtimeVisibility(t){const e=this.dialog,i=e.querySelector(".div-target"),n=this.getDeviceTarget(i);let o=!1;o="xs"===n?t.classList.contains("xs-hidden"):"sm"===n?t.classList.contains("sm-hidden"):"md"===n?t.classList.contains("md-hidden"):t.classList.contains("desktop-hidden"),e.querySelectorAll("[data-visibility]").forEach((t=>t.classList.remove("on"))),o?e.querySelector('[data-visibility=""]').classList.add("on"):e.querySelector('[data-visibility="on"]').classList.add("on")}open(){this.dialog.style.display="flex",this.getState()}close(){this.dialog.style.display=""}}class Be{constructor(t,e){this.builder=e,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="submain">\n\n <div class="label" style="font-size:18px">${i("Shadow")}</div>\n\n <div class="div-shadow-list">\n\n <button data-shadow="rgba(0, 0, 0, 0.3) 0px 1px 3px 0px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 3px 0px">1</button>\n <button data-shadow="rgba(0, 0, 0, 0.15) 0px 1px 5px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.15) 0px 1px 5px">2</button>\n <button data-shadow="rgba(0, 0, 0, 0.16) 0px 3px 6px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px">3</button>\n <button data-shadow="rgba(0, 0, 0, 0.22) 0px 10px 10px -5px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.22) 0px 10px 10px -5px">4</button>\n <button data-shadow="rgba(0, 0, 0, 0.19) 0px 10px 20px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px">5</button>\n <button data-shadow="rgba(0, 0, 0, 0.21) 0px 5px 6px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.21) 0px 5px 6px">6</button>\n <button data-shadow="rgba(0, 0, 0, 0.25) 0px 14px 28px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px">7</button>\n <button data-shadow="rgba(0, 0, 0, 0.19) 0px 6px 20px 0px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.19) 0px 6px 20px 0px">8</button>\n <button data-shadow="rgba(0, 0, 0, 0.08) 4px 17px 20px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.08) 4px 17px 20px">9</button>\n <button data-shadow="rgba(0, 0, 0, 0.12) 0px 11px 35px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.12) 0px 11px 35px">10</button>\n <button data-shadow="rgba(0, 0, 0, 0.06) 17px 17px 0px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.06) 17px 17px 0px">11</button>\n <button data-shadow="rgba(0, 0, 0, 0.1) 0px 0px 40px inset" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 40px inset">12</button>\n <button data-shadow="rgba(22, 22, 22, 0.2) 2em 2em 5em" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(22, 22, 22, 0.2) 2em 2em 5em">13</button>\n <button data-shadow="rgb(0 0 0 / 24%) 30px 30px 45px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgb(0 0 0 / 24%) 30px 30px 45px">14</button>\n\n </div>\n\n <div class="group mt-4">\n <button title="${i("Clear")}" class="btn-clean-shadow"><svg><use xlink:href="#icon-eraser"></use></svg></button>\n </div>\n </div>\n `;t.insertAdjacentHTML("beforeend",n),this.dialog=t;t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()}));t.querySelectorAll("[data-shadow]").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();this.builder.controlpanel.objDialogElement.inspectedElement.style.boxShadow=t.getAttribute("data-shadow"),this.builder.controlpanel.objDialogElement.refresh(),this.builder.onChange()}))}));t.querySelector(".btn-clean-shadow").addEventListener("click",(()=>{this.builder.controlpanel.objDialogElement.inspectedElement.style.boxShadow="",this.builder.controlpanel.objDialogElement.refresh()}))}open(){this.dialog.style.display="flex"}close(){this.dialog.style.display=""}}class Pe{constructor(t,e){this.builder=e,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="submain">\n <div class="label" style="font-size:18px">${i("Background Image Adjustments")}</div>\n\n <div class="div-target" style="margin-top:20px">\n <button title="${i("Desktop")}" class="on" data-device="">\n <svg><use xlink:href="#icon-device-desktop"></use></svg>\n </button>\n <button title="${i("Laptop/Tablet (Landscape)")}" data-device="md">\n <svg style="transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>\n </button>\n <button title="${i("Tablet (Portrait)")}" data-device="sm">\n <svg><use xlink:href="#icon-device-tablet"></use></svg>\n </button>\n <button title="${i("Mobile")}" data-device="xs">\n <svg><use xlink:href="#icon-device-mobile"></use></svg>\n </button>\n </div>\n\n <div class="label mt-3">${i("Scale")}:</div>\n <div style="padding-top:4px">\n <input type="range" min="100" max="500" value="0" class="inp-scale-slider is-rangeslider">\n </div>\n\n <div class="label mt-3">${i("Horizontal")}:</div>\n <div style="padding-top:4px">\n <input type="range" min="0" max="100" value="0" class="inp-hor-slider is-rangeslider">\n </div>\n\n <div class="label mt-3">${i("Vertical")}:</div>\n <div style="padding-top:4px">\n <input type="range" min="0" max="100" value="0" class="inp-vert-slider is-rangeslider">\n </div>\n\n <div class="group mt-5">\n <button title="${i("Clean")}" class="btn-reset"><svg><use xlink:href="#icon-eraser"></use></svg></button>\n </div>\n </div>\n `;t.insertAdjacentHTML("beforeend",n);t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()}));const o=t.querySelector(".div-target"),s=o.querySelectorAll("[data-device]");s.forEach((t=>{t.addEventListener("click",(()=>{if(s.forEach((t=>t.classList.remove("on"))),t.classList.add("on"),this.builder.iframePanel){const t=this.getDeviceTarget(o);"xs"===t?this.builder.iframePanel.setScreenMode("mobile"):"sm"===t?this.builder.iframePanel.setScreenMode("tablet"):"md"===t?this.builder.iframePanel.setScreenMode("tablet-landscape"):this.builder.iframePanel.setScreenMode("desktop")}this.getState()}))}));const a=t.querySelector(".inp-scale-slider");a.onfocus=()=>{this.builder.editor.saveForUndo(!0)},a.oninput=()=>{const t=this.getDeviceTarget(o);let e=a.value,i=this.element;if("xs"===t){let t=i.getAttribute("data-bg-xs");t||(t="");let e=document.createElement("div");e.style.cssText=t,e.style.backgroundSize="cover",i.setAttribute("data-bg-xs",e.style.cssText),i.style.backgroundSize="cover"}else if("sm"===t){let t=i.getAttribute("data-bg-sm");t||(t="");let e=document.createElement("div");e.style.cssText=t,e.style.backgroundSize="cover",i.setAttribute("data-bg-sm",e.style.cssText),i.style.backgroundSize="cover"}else if("md"===t){let t=i.getAttribute("data-bg-md");t||(t="");let e=document.createElement("div");e.style.cssText=t,e.style.backgroundSize="cover",i.setAttribute("data-bg-md",e.style.cssText),i.style.backgroundSize="cover"}else{let t=i.getAttribute("data-bg-lg");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundSize=e+"%",i.setAttribute("data-bg-lg",n.style.cssText),i.style.backgroundSize=e+"%"}i.style.left="",i.style.top="",i.style.width="",i.style.height="",i.removeAttribute("data-x"),i.removeAttribute("data-y"),i.removeAttribute("data-scale")},a.onchange=()=>{const t=this.getDeviceTarget(o);("xs"===t||"sm"===t||"md"===t)&&(a.value=0),this.builder.onChange()};const l=t.querySelector(".inp-hor-slider");l.onfocus=()=>{this.builder.editor.saveForUndo(!0)},l.oninput=()=>{const t=this.getDeviceTarget(o);let e=l.value,i=this.element;if("xs"===t){let t=i.getAttribute("data-bg-xs");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionX=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-xs",n.style.cssText)}else if("sm"===t){let t=i.getAttribute("data-bg-sm");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionX=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-sm",n.style.cssText)}else if("md"===t){let t=i.getAttribute("data-bg-md");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionX=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-md",n.style.cssText)}else{let t=i.getAttribute("data-bg-lg");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionX=e+"%",i.setAttribute("data-bg-lg",n.style.cssText)}i.style.backgroundPositionX=e+"%",i.style.left="",i.style.top="",i.style.width="",i.style.height="",i.removeAttribute("data-x"),i.removeAttribute("data-y"),i.removeAttribute("data-scale")},l.onchange=()=>{this.builder.onChange()};const r=t.querySelector(".inp-vert-slider");r.onfocus=()=>{this.builder.editor.saveForUndo(!0)},r.oninput=()=>{const t=this.getDeviceTarget(o);let e=r.value,i=this.element;if("xs"===t){let t=i.getAttribute("data-bg-xs");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionY=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-xs",n.style.cssText)}else if("sm"===t){let t=i.getAttribute("data-bg-sm");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionY=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-sm",n.style.cssText)}else if("md"===t){let t=i.getAttribute("data-bg-md");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionY=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-md",n.style.cssText)}else{let t=i.getAttribute("data-bg-lg");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionY=e+"%",i.setAttribute("data-bg-lg",n.style.cssText)}i.style.backgroundPositionY=e+"%",i.style.left="",i.style.top="",i.style.width="",i.style.height="",i.removeAttribute("data-x"),i.removeAttribute("data-y"),i.removeAttribute("data-scale")},r.onchange=()=>{this.builder.onChange()};t.querySelector(".btn-reset").addEventListener("click",(()=>{this.resetImage()}))}getState(){this.realtimeImageAdjust()}getDeviceTarget(t){return t.querySelector("button.on").getAttribute("data-device")}realtimeImageAdjust(){let t=this.element;const e=this.dialog,i=e.querySelector(".div-target");if(this.builder.iframePanel){i.querySelectorAll("[data-device]").forEach((t=>t.classList.remove("on")));let t=this.builder.screenMode;"mobile"===t?i.querySelector('[data-device="xs"]').classList.add("on"):"tablet"===t?i.querySelector('[data-device="sm"]').classList.add("on"):"tablet-landscape"===t?i.querySelector('[data-device="md"]').classList.add("on"):i.querySelector('[data-device=""]').classList.add("on")}const n=this.getDeviceTarget(i),o=e.querySelector(".inp-scale-slider"),s=e.querySelector(".inp-hor-slider"),a=e.querySelector(".inp-vert-slider");o.value=100,s.value=50,a.value=60,o.disabled=!1,(t.classList.contains("cell-active")||t.classList.contains("is-row-overlay"))&&(s.value=0,a.value=0);let l=document.createElement("div");if("xs"===n){let e=t.getAttribute("data-bg-xs");e||(e=""),l.style.cssText=e,o.disabled=!0,o.style.opacity=.6}else if("sm"===n){let e=t.getAttribute("data-bg-sm");e||(e=""),l.style.cssText=e,o.disabled=!0,o.style.opacity=.6}else if("md"===n){let e=t.getAttribute("data-bg-md");e||(e=""),l.style.cssText=e,o.disabled=!0,o.style.opacity=.6}else{let e=t.getAttribute("data-bg-lg");e||(e=""),l.style.cssText=e,o.disabled=!1,o.style.opacity=""}if(l.style.backgroundSize){let t,e=l.style.backgroundSize;t=isNaN(parseInt(e))?100:parseInt(e),-1!==e.indexOf("%")&&(o.value=t)}if(l.style.backgroundPositionX){let t,e=l.style.backgroundPositionX;t=isNaN(parseInt(e))?0:parseInt(e),-1!==e.indexOf("%")&&(s.value=t)}if(l.style.backgroundPositionY){let t,e=l.style.backgroundPositionY;t=isNaN(parseInt(e))?0:parseInt(e),-1!==e.indexOf("%")&&(a.value=t)}}resetImage(){let t=this.element;const e=this.dialog,i=e.querySelector(".inp-scale-slider"),n=e.querySelector(".inp-hor-slider"),o=e.querySelector(".inp-vert-slider");n.value=50,o.value=60,i.value=0,(t.classList.contains("cell-active")||t.classList.contains("is-row-overlay"))&&(n.value=0,o.value=0),t.style.backgroundPositionX="",t.style.backgroundPositionY="",t.style.backgroundSize="cover",t.style.left="",t.style.top="",t.style.width="",t.style.height="",t.removeAttribute("data-x"),t.removeAttribute("data-y"),t.removeAttribute("data-scale"),t.removeAttribute("data-bg-xs"),t.removeAttribute("data-bg-sm"),t.removeAttribute("data-bg-md"),t.removeAttribute("data-bg-lg")}saveOri(){let t=this.element;const e=document.createElement("div");e.style.backgroundPositionX=t.style.backgroundPositionX,e.style.backgroundPositionY=t.style.backgroundPositionY,e.style.backgroundSize=t.style.backgroundSize,t.hasAttribute("data-bg-lg")||t.setAttribute("data-bg-lg",e.style.cssText)}open(t){this.dialog.style.display="flex",this.element=t,this.saveOri(),this.getState()}close(){this.dialog.style.display=""}}class Ne{constructor(){this.modal=null,this.focusableElements=[],this.previouslyFocusedElement=null,this.clickOutsideModal=this.clickOutsideModal.bind(this),this.handleEscKey=this.handleEscKey.bind(this)}showModal(t){this.modal=t,this.modal?(this.focusableElements=Array.from(this.modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')),this.previouslyFocusedElement=document.activeElement,this.modal.style.display="block",this.modal.setAttribute("aria-hidden","false"),document.addEventListener("click",this.clickOutsideModal),document.addEventListener("keydown",this.handleEscKey),this.focusableElements.length>0&&this.focusableElements[0].focus()):console.error("Modal element not found.")}clickOutsideModal(t){const e=this.modal.querySelector(".modal-content");"block"!==this.modal.style.display||e.contains(t.target)||t.target===this.previouslyFocusedElement||this.closeModal()}closeModal(){this.modal&&"block"===this.modal.style.display&&(this.modal.style.display="none",this.modal.setAttribute("aria-hidden","true"),document.removeEventListener("click",this.clickOutsideModal),document.removeEventListener("keydown",this.handleEscKey),this.previouslyFocusedElement&&this.previouslyFocusedElement.focus())}handleEscKey(t){"Escape"===t.key&&this.closeModal()}}class ze{constructor(t,e){this.builder=e,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="submain">\n\n <div class="label" style="font-size:18px">${i("Settings")}</div>\n\n <div class="label">${i("Paste")}:</div>\n <select class="inp-paste">\n <option value="html-without-styles">${i("HTML (without styles)")}</option>\n <option value="html">${i("HTML (with styles)")}</option>\n <option value="text">${i("Text only")}</option>\n </select>\n\n <div class="label">${i("HTML View")}:</div>\n <select class="inp-htmlview">\n <option value="shorten">${i("Shorten HTML")}</option>\n <option value="actual">${i("Actual")}</option>\n </select>\n\n <div class="label">${i("Theme")}:</div>\n <div class="group">\n <button type="button" title="${i("Light")}" data-theme="light" style="background:#fff;border:rgb(132 132 132 / 16%) 1px solid;"></button>\n <button type="button" title="${i("Dark")}" data-theme="dark" style="background:#000;border:rgba(0,0,0,0.15) 1px solid;"></button>\n </div>\n\n </div>\n `;t.insertAdjacentHTML("beforeend",n),this.dialog=t;const o=t.querySelector(".inp-paste");o.addEventListener("change",(()=>{const t=o.value;this.builder.editor.paste=t,localStorage.setItem("_pasteresult",t)}));const s=t.querySelector(".inp-htmlview");s.addEventListener("change",(()=>{const t=s.value;this.builder.editor.shortenHTML="shorten"===t,localStorage.setItem("_htmlview",t)}));t.querySelectorAll("[data-theme]").forEach((t=>{t.addEventListener("click",(()=>{const e=t.getAttribute("data-theme");if("light"===e&&(this.builder.editor.setUIColor(""),localStorage.setItem("_theme",0)),"dark"===e){const t=this.builder.themes[1][2];this.builder.editor.setUIColor("dark",t),localStorage.setItem("_theme",1)}this.builder.controlpanel.controlPanel.querySelectorAll("iframe").forEach((t=>{let i=t.contentDocument||t.contentWindow.document;"dark"===e?i.body.classList.add("dark"):i.body.classList.remove("dark")}))}))}));t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()}))}getState(){const t=this.dialog;if(null!==localStorage.getItem("_pasteresult")&&(this.builder.editor.paste=localStorage.getItem("_pasteresult")),null!==localStorage.getItem("_htmlview")){let t=localStorage.getItem("_htmlview");this.builder.editor.shortenHTML="shorten"===t}t.querySelector(".inp-paste").value=this.builder.editor.paste;const e=t.querySelector(".inp-htmlview");this.builder.editor.shortenHTML?e.value="shorten":e.value="actual"}open(){this.dialog.style.display="flex",this.getState()}close(){this.dialog.style.display=""}}class De{constructor(t){this.builder=t;let e=document.querySelector("#_newbox");e||(e=document.createElement("div"),e.id="_newbox",e.classList.add("builder-ui"),e.style.height="0px",e.style.float="left",e.style.marginTop="-100px",document.body.appendChild(e),e=document.querySelector("#_newbox")),this.builderStuff=e;let n=e.querySelector(".is-controlpanel");if(!n){let t=`\n <div class="is-controlpanel keep-selection is-side scroll-darker">\n\n <div class="is-devpanel">\n <button class="btn-close tooltip" title="${i("Close")}">\n <svg style="width:22px;height:22px;"><use xlink:href="#icon-close-right"></use></svg>\n </button>\n <div class="flex">\n <button class="btn-blocks tooltip" title="${i("Blocks")}" style="display:none">\n <svg><use xlink:href="#icon-plus2"></use></svg>\n </button>\n\n ${this.builder.undoRedoButtons?`\n <button class="btn-undo tooltip" title="${i("Undo")}">\n <svg style="width:14px;height:14px"><use xlink:href="#ion-ios-undo"></use></svg>\n </button>\n <button class="btn-redo tooltip" title="${i("Redo")}">\n <svg style="width:14px;height:14px"><use xlink:href="#ion-ios-redo"></use></svg>\n </button>\n `:""}\n\n <button class="btn-code tooltip" title="${i("Code")}" style="display:none">\n <svg><use xlink:href="#icon-code"></use></svg>\n </button>\n\n ${this.builder.toggleDeviceButton?`\n <button class="btn-toggledevice tooltip" title="${i("Toggle Device Toolbar")}">\n <svg><use xlink:href="#icon-devices"></use></svg>\n </button>\n `:""}\n \n <button class="btn-more tooltip" title="${i("More")}">\n <svg><use xlink:href="#icon-dots"></use></svg>\n </button>\n </div>\n </div>\n \n <div class="panelnav">\n <div class="part-breadcrumb"></div>\n <h3 class="part-title"></h3>\n <div class="part-empty">${i("No Selection.")}</div>\n </div>\n\n <div class="panel-code"></div>\n <div class="panel-text"></div>\n <div class="panel-image"></div>\n <div class="panel-video"></div>\n <div class="panel-icon"></div>\n <div class="panel-audio"></div>\n <div class="panel-iframe"></div>\n <div class="panel-spacer"></div>\n <div class="panel-column"></div>\n <div class="panel-row"></div>\n <div class="panel-container"></div>\n <div class="panel-box"></div>\n <div class="panel-section"></div>\n\n <div class="panel-dialog icons"></div>\n <div class="panel-dialog spacingfull"></div>\n <div class="panel-dialog spacingcontainer"></div>\n <div class="panel-dialog blocks"></div>\n <div class="panel-dialog element"></div>\n <div class="panel-dialog imageadjust"></div>\n <div class="panel-dialog settings"></div>\n <div class="panel-dialog shadow"></div>\n\n <div class="panel-pop more" tabIndex="-1" aria-hidden="true">\n \x3c!--<button class="btn-preferences" title="${i("Preferences")}">${i("Preferences")}</button>--\x3e\n <button class="btn-settings" title="${i("Settings")}">${i("Settings")}</button>\n <div class="label label-plugins text-center" style="display:none">\n ${i("Plugins")}:\n </div>\n <div class="plugins"></div>\n </div>\n\n <div class="is-modal modal-settings" aria-hidden="true">\n <div class="modal-content">\n <div style="padding:30px">\n <p>Modal content goes here.</p>\n </div>\n </div>\n </div>\n\n </div>\n\n `;e.insertAdjacentHTML("beforeend",t),n=e.querySelector(".is-controlpanel")}this.controlPanel=n,this.modal=new Ne,this.panelText=n.querySelector(".panel-text"),this.panelImage=n.querySelector(".panel-image"),this.panelVideo=n.querySelector(".panel-video"),this.panelAudio=n.querySelector(".panel-audio"),this.panelIframe=n.querySelector(".panel-iframe"),this.panelSpacer=n.querySelector(".panel-spacer"),this.panelIcon=n.querySelector(".panel-icon"),this.panelCode=n.querySelector(".panel-code"),this.panelColumn=n.querySelector(".panel-column"),this.panelRow=n.querySelector(".panel-row"),this.panelContainer=n.querySelector(".panel-container"),this.panelBox=n.querySelector(".panel-box"),this.panelSection=n.querySelector(".panel-section"),this.breadcrumb=n.querySelector(".part-breadcrumb"),this.title=n.querySelector(".part-title"),this.empty=n.querySelector(".part-empty"),this.dialogIcons=n.querySelector(".panel-dialog.icons"),this.dialogSpacingColumn=n.querySelector(".panel-dialog.spacingfull"),this.dialogSpacingContainer=n.querySelector(".panel-dialog.spacingcontainer"),this.dialogBlocks=n.querySelector(".panel-dialog.blocks"),this.dialogElement=n.querySelector(".panel-dialog.element"),this.dialogShadow=n.querySelector(".panel-dialog.shadow"),this.dialogImageAdjust=n.querySelector(".panel-dialog.imageadjust"),this.dialogSettings=n.querySelector(".panel-dialog.settings"),this.more=n.querySelector(".panel-pop.more"),this.objDialogIcons=new q(this.dialogIcons,this.builder),this.objDialogSpacingColumn=new T(this.dialogSpacingColumn,this.builder),this.objDialogSpacingContainer=new M(this.dialogSpacingContainer,this.builder),this.objDialogBlocks=new $e(this.dialogBlocks,this.builder),this.objDialogElement=new Re(this.dialogElement,this.builder),this.objDialogShadow=new Be(this.dialogShadow,this.builder),this.objDialogImageAdjust=new Pe(this.dialogImageAdjust,this.builder),this.objDialogSettings=new ze(this.dialogSettings,this.builder),this.objPanelText=new v(this.panelText,this.builder),this.objPanelImage=new f(this.panelImage,this.builder),this.objPanelVideo=new y(this.panelVideo,this.builder),this.objPanelAudio=new x(this.panelAudio,this.builder),this.objPanelIframe=new _(this.panelIframe,this.builder),this.objPanelSpacer=new w(this.panelSpacer,this.builder),this.objPanelIcon=new S(this.panelIcon,this.builder),this.objPanelCode=new k(this.panelCode,this.builder),this.objPanelColumn=new A(this.panelColumn,this.builder),this.objPanelRow=new E(this.panelRow,this.builder),this.objPanelBox=new C(this.panelBox,this.builder),this.objPanelSection=new L(this.panelSection,this.builder);let o=this.builder.onPageContentClick;this.builder.onPageContentClick=t=>{o&&o.call(this),this.builder.controlPanel&&!document.body.classList.contains("controlpanel")&&this.open(),document.body.classList.contains("controlpanel")&&this.clickContent(t)};n.querySelector(".btn-close").addEventListener("click",(()=>{this.close()}));const s=n.querySelector(".btn-toggledevice");!this.builder.iframeSrc&&s&&(s.style.display="none"),s&&s.addEventListener("click",(()=>{this.toggleDevice()}));const a=n.querySelector(".btn-undo");a&&a.addEventListener("click",(()=>{this.builder.editor.undo()}));const l=n.querySelector(".btn-redo");l&&l.addEventListener("click",(()=>{this.builder.editor.redo()}));const r=n.querySelector(".btn-code");r&&r.addEventListener("click",(()=>{this.builder.sidebar.viewHtml()}));const c=n.querySelector(".btn-blocks");c&&c.addEventListener("click",(()=>{this.objDialogBlocks.open()}));const d=n.querySelector(".btn-more");d&&d.addEventListener("click",(()=>{this.showPop(this.more,(()=>{d.focus()}),d,12,-6)}));const u=n.querySelector(".btn-inspect");u&&u.addEventListener("click",(()=>{this.objDialogElement.open(),this.hidePop(this.more)}));n.querySelector(".btn-settings").addEventListener("click",(()=>{this.objDialogSettings.open(),this.hidePop(this.more)}));n.querySelectorAll(".btn-device").forEach((t=>{this.builder.iframeSrc||(t.style.display="none"),t.addEventListener("click",(()=>{const t=this.builder.screenMode;"desktop"===t?this.builder.iframePanel.setScreenMode("tablet-landscape"):"tablet-landscape"===t?this.builder.iframePanel.setScreenMode("tablet"):"tablet"===t?this.builder.iframePanel.setScreenMode("mobile"):("mobile"===t||"fullview"===t)&&this.builder.iframePanel.setScreenMode("desktop")}))}));n.querySelectorAll(".accordion-item").forEach((t=>{const e=t.nextElementSibling;e.style.display="none",t.addEventListener("click",(()=>{"false"===e.getAttribute("aria-hidden")?(t.setAttribute("aria-expanded","false"),e.setAttribute("aria-hidden","true"),setTimeout((()=>{e.style.display="none"}),250)):(e.style.display="",setTimeout((()=>{t.setAttribute("aria-expanded","true"),e.setAttribute("aria-hidden","false")}),1))}))}))}clearPreview(){this.objPanelImage.clear(),this.objPanelVideo.clear(),this.objPanelAudio.clear(),this.objPanelIframe.clear(),this.objPanelColumn.clear(),this.objPanelRow.clear(),this.objPanelBox.clear()}editorReady(){this.objPanelText.editorReady(),this.objPanelImage.editorReady(),this.objPanelVideo.editorReady(),this.objPanelAudio.editorReady(),this.objPanelIframe.editorReady(),this.objPanelSpacer.editorReady(),this.objPanelIcon.editorReady(),this.objPanelCode.editorReady(),this.builder.editor.onSelectChange=()=>{document.body.classList.contains("controlpanel")&&(this.activeColumn=this.builder.doc.querySelector(".cell-active"),this.activeColumn?this.select("column"):this.select("box"),this.closeDialogs(),this.clearPreview())},this.builder.onSelectChange=()=>{document.body.classList.contains("controlpanel")&&(this.select(""),this.builder.activeBox?this.select("box"):this.select(""),this.closeDialogs())},this.builder.editor.controlpanel=this,this.showTooltip()}closeDialogs(){this.objDialogIcons.close(),this.objDialogSpacingColumn.close(),this.objDialogSpacingContainer.close(),this.objDialogBlocks.close(),this.objDialogElement.close(),this.objDialogShadow.close(),this.objDialogImageAdjust.close()}closeContentDialogs(){this.objDialogIcons.close(),this.objDialogSpacingColumn.close(),this.objDialogElement.close(),this.objDialogShadow.close(),this.objDialogImageAdjust.close()}toggleDevice(){if(this.builder.iframeSrc&&!this.builder.controlPanel){"fullview"!==this.builder.screenMode?this.builder.iframePanel.setScreenMode("fullview"):this.builder.iframePanel.setScreenMode("desktop")}else if(this.builder.iframeSrc&&this.builder.controlPanel){const t=this.controlPanel.querySelector(".btn-toggledevice");"fullview"!==this.builder.screenMode?(this.builder.iframePanel.setScreenMode("fullview"),t.classList.remove("on")):(this.builder.iframePanel.setScreenMode("desktop"),t.classList.add("on"))}}open(){document.body.classList.add("controlpanel"),this.builder.win.noRender=!0,this.builder.wrapperEl.style.transition="all ease 0.3s",setTimeout((()=>{this.builder.wrapperEl.style.transition=""}),300),this.getActive(),this.activeElement?this.select("element"):this.activeElement||this.activeColumn||this.activeRow||!this.activeBox?this.select(""):this.select("box"),this.repositionTool()}close(){document.body.classList.remove("controlpanel"),this.builder.wrapperEl.style.transition="all ease 0.3s",setTimeout((()=>{this.builder.wrapperEl.style.transition=""}),300),this.repositionTool()}repositionTool(){if(this.activeRow){const t=this.activeRow.querySelector(".is-col-tool"),e=this.activeRow.querySelector(".is-row-tool");t.style.opacity="0",e.style.opacity="0",setTimeout((()=>{this.builder.editor.util.repositionColumnTool(),t.style.opacity="",e.style.opacity="",this.builder.editor.elmTool.pos()}),600)}let t=this.builder.editor.activeImage,e=this.builder.editor.activeModule;if(t&&e)this.builder.editor.element.image.hideImageTool(),setTimeout((()=>{this.panelImage.classList.remove("active")}),1),setTimeout((()=>{this.builder.editor.util.refreshModuleLayout(e)}),600);else if(t){const t=document.querySelector("#divImageTool"),e=document.querySelector("#divImageResizer"),i=document.querySelector(".moveable-control-box");t.style.opacity="0",e.style.opacity="0",i.style.opacity="0",setTimeout((()=>{t.style.opacity="",e.style.opacity="",i.style.opacity="",this.builder.editor.element.image.repositionImageTool()}),600)}}getActive(){let t,e,i=this.builder.editor.inspectedElement,n=this.builder.editor.activeCol;n?(t=n.parentNode,e=t.parentNode):(i=null,t=null,e=null);let o,s=this.builder.activeBox;s&&(o=s.closest(".is-section")),this.activeElement=i,this.activeColumn=n,this.activeRow=t,this.activeContainer=e,this.activeBox=s,this.activeSection=o}clickContent(){this.hidePop(this.more),this.getActive(),this.objDialogIcons.close(),this.activeBox||this.objDialogContainer.close(),this.activeColumn||this.objDialogSpacingColumn.close(),this.objDialogImageAdjust.close(),this.activeElement&&this.select("element"),this.activeElement||this.activeColumn||this.activeRow||!this.activeBox||this.select("box")}breadcrumbRender(t){let e='<svg class="is-icon-flex"><use xlink:href="#icon-right"></use></svg>',n=`<a href="#" data-value="section">${i("Section")}</a>`,o=`<a href="#" data-value="box">${i("Box")}</a>`,s=`<a href="#" data-value="row">${i("Row")}</a>`,a=`<a href="#" data-value="column">${i("Column")}</a>`,l="";"element"===t?l=`<div>${n} ${e} ${o} ${e}</div><div>${s} ${e} ${a} ${e}</div>`:"column"===t?l=`<div>${n} ${e} ${o} ${e}</div><div>${s} ${e}`:"row"===t||"container"===t?l=`<div>${n} ${e} ${o} ${e}</div>`:"box"===t?l=`<div>${n} ${e}</div>`:"section"===t&&(l=""),this.breadcrumb.innerHTML=l;this.breadcrumb.querySelectorAll("a").forEach((t=>{t.addEventListener("click",(e=>{const i=t.getAttribute("data-value");this.select(i,!0),e.preventDefault(),e.stopImmediatePropagation()}))}))}animSelection(t){t.classList.add("selection-active"),setTimeout((()=>{t.style.transition="",t.classList.remove("selection-active")}),1e3)}select(t,e){if("column"===t&!this.activeColumn&&this.activeBox)this.select("box");else{if(""===t)return this.breadcrumb.innerHTML="",this.title.innerHTML="",this.title.style.display="none",this.empty.style.display="",void this.hidePanels();if(this.title.style.display="",this.empty.style.display="none",this.builder.selectWhat=t,this.showPanel(t),"column"===t&&(this.builder.editor.hideElementTools(),e&&this.animSelection(this.activeColumn)),"row"===t&&(this.activeRow.classList.remove("row-outline"),this.builder.editor.util.hideColumnTool(),this.builder.editor.hideElementTools(),e&&this.animSelection(this.activeRow)),"container"===t&&(this.builder.editor.util.clearActiveCell(),this.builder.editor.util.clearPops(),this.builder.wrapperEl.classList.remove("hard-select"),this.activeContainer.style.transition="none",this.activeContainer.classList.add("container-select"),e&&this.animSelection(this.activeContainer)),"box"===t){let t=this.activeBox,i=this.activeSection;this.builder.editor.util.clearActiveCell(),this.builder.editor.util.clearPops(),this.builder.editor.hideElementTools(),this.closeContentDialogs(),this.builder.wrapperEl.classList.add("hard-select"),this.builder.wrapperEl.classList.remove("is-clean-edit"),t.classList.add("box-select"),this.builder.activeBox=t,i.classList.add("section-select"),this.builder.activeSection=i,this.builder.positionTool(t),e&&this.animSelection(this.activeBox)}if("section"===t){let t=this.activeBox,i=this.activeSection;this.builder.editor.util.clearActiveCell(),this.builder.editor.util.clearPops(),this.builder.editor.hideElementTools(),this.closeContentDialogs(),this.builder.wrapperEl.classList.add("hard-select"),this.builder.wrapperEl.classList.remove("is-clean-edit"),t.classList.add("box-select"),this.builder.activeBox=t,i.classList.add("section-select"),this.builder.activeSection=i,this.builder.positionTool(t),e&&this.animSelection(this.activeSection)}}}hidePanels(){this.panelText.classList.remove("active"),this.panelImage.classList.remove("active"),this.panelVideo.classList.remove("active"),this.panelAudio.classList.remove("active"),this.panelIframe.classList.remove("active"),this.panelSpacer.classList.remove("active"),this.panelIcon.classList.remove("active"),this.panelCode.classList.remove("active"),this.panelColumn.classList.remove("active"),this.panelRow.classList.remove("active"),this.panelContainer.classList.remove("active"),this.panelBox.classList.remove("active"),this.panelSection.classList.remove("active")}refresh(){this.what&&document.body.classList.contains("controlpanel")&&this.showPanel(this.what)}showPanel(t){if(this.what=t,this.hidePanels(),this.clearPreview(),this.breadcrumbRender(t),"element"===t)if(this.activeElement.classList.contains("ovl")&&this.activeElement.parentNode.querySelector("audio")?this.activeElement=this.activeElement.parentNode.querySelector("audio"):this.activeElement.classList.contains("ovl")&&(this.activeElement=this.activeElement.parentNode.querySelector("iframe")),this.activeElement.closest("[data-html]")&&!this.activeElement.closest("[data-subblock]")){let t="",e=this.activeElement.closest("[data-module]");if(e){let n=e.getAttribute("data-module-desc");t=i(n||"Module")}else t=i("Code");this.title.innerHTML=t,this.panelCode.classList.add("active"),this.objPanelCode.getState()}else if(this.activeElement.closest("[data-noedit]")&&!this.activeElement.closest("[data-html]")){let t=i("Locked");this.title.innerHTML=t}else{if(this.activeElement.querySelector(".icon")&&this.activeElement.childElementCount,"img"===this.activeElement.tagName.toLowerCase()){let t=i("Image");this.title.innerHTML=t,this.panelImage.classList.add("active"),this.objPanelImage.getState()}else if("video"===this.activeElement.tagName.toLowerCase()){let t=i("Video");this.title.innerHTML=t,this.panelVideo.classList.add("active"),this.objPanelVideo.getState()}else if("audio"===this.activeElement.tagName.toLowerCase()){let t=i("Audio");this.title.innerHTML=t,this.panelAudio.classList.add("active"),this.objPanelAudio.getState()}else if(this.activeElement.classList.contains("spacer")){let t=i("Spacer");this.title.innerHTML=t,this.panelSpacer.classList.add("active"),this.objPanelSpacer.getState()}else if("iframe"===this.activeElement.tagName.toLowerCase()){let t="",e=this.activeElement.getAttribute("src");e=e.toLowerCase(),t=e.includes("youtube")||e.includes("vimeo")?i("Video"):e.includes("google.com/maps")?i("Map"):i("IFrame"),this.title.innerHTML=t,this.panelIframe.classList.add("active"),this.objPanelIframe.getState()}else if("i"===this.activeElement.tagName.toLowerCase()&&this.activeElement.classList.contains("icon")){let t=i("Icon");this.title.innerHTML=t,this.panelIcon.classList.add("active"),this.objPanelIcon.getState()}else{let t=i("Text");this.title.innerHTML=t,this.panelText.classList.add("active"),this.objPanelText.getState()}if(this.activeElement.closest("[data-subblock]")){let t="",e=this.activeElement.closest("[data-html]").getAttribute("data-module-desc");t=i(e||"Module"),this.title.innerHTML=t,this.panelCode.classList.add("active"),this.objPanelCode.getState()}}if("column"===t)if(this.activeColumn.closest("[data-noedit]")&&!this.activeColumn.closest("[data-html]")){let t=i("Column - Locked");this.title.innerHTML=t}else{let t=i("Column");this.title.innerHTML=t,this.panelColumn.classList.add("active"),this.objPanelColumn.getState()}if("row"===t){let t=i("Row");this.title.innerHTML=t,this.panelRow.classList.add("active"),this.objPanelRow.getState()}if("container"===t){let t=i("Container");this.title.innerHTML=t,this.panelContainer.classList.add("active")}if("box"===t){let t=i("Box");this.title.innerHTML=t,this.panelBox.classList.add("active"),this.objPanelBox.getState()}if("section"===t){let t=i("Section");this.title.innerHTML=t,this.panelSection.classList.add("active"),this.objPanelSection.getState()}"flex"===this.dialogSpacingColumn.style.display&&this.objDialogSpacingColumn.getState(),"flex"===this.dialogSpacingContainer.style.display&&this.objDialogSpacingContainer.getState(),"flex"===this.dialogElement.style.display&&this.objDialogElement.getState(),"flex"===this.dialogImageAdjust.style.display&&this.objDialogImageAdjust.getState()}showTooltip(){let t=document.querySelector(".is-controlpanel").querySelectorAll(".tooltip");Array.prototype.forEach.call(t,(t=>{t.setAttribute("data-title",t.getAttribute("title")),this.builder.editor.tooltip.set(t)}))}showPop(t,e,i,n=0,o=0){document.querySelectorAll(".panel-pop").forEach((t=>{this.hidePop(t)})),t.style.display="flex",t.setAttribute("aria-hidden",!1),t.focus({preventScroll:!0}),this.builder.editor.util.setupTabKeys(t),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e())},this.handlePopKeyDown=i=>{27===i.keyCode&&(this.hidePop(t),e&&e())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("click",this.handlePopClickOut);let s=i.getBoundingClientRect().top+22,a=i.getBoundingClientRect().left-t.offsetWidth+i.offsetWidth+6;t.style.top=`${s+n}px`,t.style.left=`${a+o}px`}hidePop(t){t.style.display="",t.setAttribute("aria-hidden",!0),t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("click",this.handlePopClickOut)}}class He{constructor(t){this.builder=t,this.dom=this.builder.dom}cellSelected(){return this.builder.doc.querySelector(".cell-active")}rowSelected(){return this.builder.doc.querySelector(".row-active")}builderStuff(){return document.querySelector("#_cbhtml")}cellNext(t){const e=this.dom;let i=t.nextElementSibling;return i?e.hasClass(i,"is-row-tool")||e.hasClass(i,"is-col-tool")||e.hasClass(i,"is-rowadd-tool")||e.hasClass(i,"is-row-overlay")?null:i:null}out(t){if(this.builder){let e=this.builder.opts.lang[t];return e||(this.builder.checkLang&&console.log(t),t)}return t}showMessage(t,e,i){const n=this.dom;let o="";o=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n <button title="${this.out("Ok")}" class="input-ok classic">${this.out("Ok")}</button>\n </div>\n </div>`;const s=this.builder.builderStuff;let a=s.querySelector(".modalmessage");a||(n.appendHtml(s,o),a=s.querySelector(".modalmessage")),this.showModal(a,!1,(()=>{a.parentNode.removeChild(a),i&&i()}));let l=a.querySelector(".modalmessage .input-ok");n.addEventListener(l,"click",(()=>{this.hideModal(a),a.parentNode&&a.parentNode.removeChild(a),i&&i()})),l.focus(),e&&l.classList.add("focus-outline")}showChoice(t,e,i){const n=this.dom;let o="";o=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n\n <div style="display:flex;">\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary" style="width:100%;margin-right:4px;">${this.out("Cancel")}</button>\n <button title="${e}" class="input-ok classic-primary" style="width:100%">${e}</button>\n </div>\n </div>\n </div>`;const s=this.builder.builderStuff;let a=s.querySelector(".modalmessage");a||(n.appendHtml(s,o),a=s.querySelector(".modalmessage")),this.showModal(a,!1,(()=>{a.parentNode.removeChild(a),i(!1)}));let l=a.querySelector(".modalmessage .input-cancel");n.addEventListener(l,"click",(()=>{this.hideModal(a),a.parentNode.removeChild(a),i(!1)})),l.focus();let r=a.querySelector(".modalmessage .input-ok");n.addEventListener(r,"click",(()=>{this.hideModal(a),a.parentNode.removeChild(a),i(!0)}))}confirm(t,e,i,n,o){if(!this.builder.deleteConfirm&&!o)return void e(!0);const s=this.dom;let a="";a=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Delete")}" class="input-ok classic focus-warning">${this.out("Delete")}</button>\n </div>\n </div>`,i&&(a=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary">${this.out("Cancel")}</button>\n <button title="${n}" class="input-ok classic-primary">${n}</button>\n </div>\n </div>`);const l=this.builder.builderStuff;let r=l.querySelector(".is-confirm");r||(s.appendHtml(l,a),r=l.querySelector(".is-confirm")),this.showModal(r,!1,(()=>{r.parentNode.removeChild(r),e(!1)}),!0);let c=r.querySelector(".is-confirm .input-ok");s.addEventListener(c,"click",(()=>{this.hideModal(r),r.parentNode.removeChild(r),e(!0)}));let d=r.querySelector(".is-confirm .input-cancel");s.addEventListener(d,"click",(t=>{this.hideModal(r),r.parentNode.removeChild(r),e(!1),t.preventDefault(),t.stopImmediatePropagation()}))}showRtePop(t,e,i){const n=this.dom;t.style.display="flex",e&&e(),n.removeClass(t,"deactive"),n.addClass(t,"active");const o=e=>{t.contains(e.target)||i.contains(e.target)||e.target.closest(".pickcolormore")||(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))},s=e=>{27===e.keyCode&&(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))};t.addEventListener("keydown",s),document.addEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",o)}hideRtePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),e.addClass(t,"deactive")}clearAllEventListener(t){for(let e=0;e<10;e++)t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",this.handlePopClickOut)}showPop(t,e,i){const n=this.dom;let o=document.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(o,(e=>{e!==t&&(e.style.display="",n.removeClass(e,"active"),e.setAttribute("aria-hidden",!0))})),this.clearAllEventListener(t),t.style.display="flex",n.addClass(t,"active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e())},this.handlePopKeyDown=i=>{27===i.keyCode&&(this.hidePop(t),e&&e())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",this.handlePopClickOut)}hidePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),this.clearAllEventListener(t)}setupTabKeys(t){let e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0],n=e[e.length-1];n.addEventListener("keydown",(n=>{9!==n.which||n.shiftKey||(n.preventDefault(),e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])'),i=e[0],i.focus())})),i.addEventListener("keydown",(t=>{9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}));t.querySelectorAll("iframe").forEach((t=>{t.addEventListener("focus",(()=>{const e=t.contentWindow.document.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0];i&&i.focus()}))}))}showModal(t,e,i,n,o){const s=this.dom;s.addClass(t,"active"),t.setAttribute("aria-hidden",!1),o&&(document.body.style.overflow="hidden");const a=e=>{if(27===e.keyCode){o&&(document.body.style.overflow=""),s.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",a);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()}};t.addEventListener("keydown",a);let l=t.querySelector(".is-tab-content.active");l?(l.focus(),this.builder.tabs.setupTabKey(l)):(this.setupTabKeys(t),t.focus());let r=!1;if(this.builder?this.builder.opts.animateModal&&(r=!0,n||(r=!1)):n&&(r=!0),r&&this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.style.transform=`scale(${this.builder.opts.zoom-.02})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom-.02})`,t.style.MozTransform=`scale(${this.builder.opts.zoom-.02})`,t.setAttribute("scaled-down","1")}))}const c=t.querySelector(".is-modal-overlay");if(c&&c.parentNode.removeChild(c),!t.querySelector(".is-modal-overlay")){let n;if(n=e?'<div class="is-modal-overlay overlay-stay"></div>':'<div class="is-modal-overlay"></div>',t.insertAdjacentHTML("afterbegin",n),!e){let e=t.querySelector(".is-modal-overlay");s.addEventListener(e,"click",(()=>{o&&(document.body.style.overflow=""),this.hideModal(t),t.removeEventListener("keydown",a);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()}))}}const d=()=>{o&&(document.body.style.overflow=""),s.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",a);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()},u=t.querySelector(".is-modal-close");u&&s.addEventListener(u,"click",d)}_hideModal(t){let e=t.querySelector(".is-modal-overlay");e?e.classList.contains("overlay-stay")?(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1}))):e.click():(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1})))}hideModal(t){if(t.setAttribute("aria-hidden",!0),this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.getAttribute("scaled-down")&&(t.style.transform=`scale(${this.builder.opts.zoom})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom})`,t.style.MozTransform=`scale(${this.builder.opts.zoom})`,t.removeAttribute("scaled-down"))}))}this.dom.removeClass(t,"active"),t.style.display=""}refreshModuleLayout(t){let e;t.style.height?e=t.style.height:t.style.height=`${t.offsetHeight}px`,t.style.opacity=0;let i=decodeURIComponent(t.getAttribute("data-html"));i=i.replace(/{id}/g,this.builder.util.makeId()),t.innerHTML="";let n=document.createRange();n.setStart(t,0),t.appendChild(n.createContextualFragment(i));let o=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(o,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s)),e.contentEditable=!0),s++})),setTimeout((()=>{t.style.height=e||"",t.style.opacity=""}),100)}removeColClasses(t){t.classList.remove("full"),t.classList.remove("two-third"),t.classList.remove("two-fourth"),t.classList.remove("two-fifth"),t.classList.remove("two-sixth"),t.classList.remove("half"),t.classList.remove("third"),t.classList.remove("fourth"),t.classList.remove("fifth"),t.classList.remove("sixth"),t.classList.remove("seventh"),t.classList.remove("eighth"),t.classList.remove("ninth"),t.classList.remove("tenth"),t.classList.remove("eleventh"),t.classList.remove("twelfth")}getAllColumns(t){let e=[];const i=this.dom;return i.elementChildren(t).forEach((t=>{i.hasClass(t,"is-row-tool")||i.hasClass(t,"is-col-tool")||i.hasClass(t,"is-rowadd-tool")||i.hasClass(t,"is-row-overlay")||e.push(t)})),e}fixLayout(t){const e=this.dom;let i=!1,n=!1;if(Array.from(t.children).map((e=>{e.classList.contains("is-row-tool")||e.classList.contains("is-col-tool")||e.classList.contains("is-rowadd-tool")||(e.getAttribute("data-html")?(e.style.width||(e.style.width="50%",e.style.flex="0 0 auto"),1===this.getAllColumns(t).length&&(e.style.width="",e.style.flex="")):(e.style.width="",e.style.flex=""),e.classList.contains("sm-hidden")&&(i=!0),e.classList.contains("md-hidden")&&(n=!0))})),i?t.classList.add("sm-autofit"):t.classList.remove("sm-autofit"),n?t.classList.add("md-autofit"):t.classList.remove("md-autofit"),this.builder.useDefaultGrid){return e.elementChildren(t).forEach((t=>{e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay")||this.removeColClasses(t)})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}let o=3;t.querySelector(".is-row-overlay")&&(o=4);const s=t.childElementCount-o,a=this.builder.opts.row;let l=this.builder.opts.cols;const r=this.builder.opts.colequal;if(r.length>0){return e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){for(let i=0;i<=l.length-1;i++)e.removeClass(t,l[i]);for(let i=0;i<=r.length-1;i++)if(r[i].length===s){e.addClass(t,r[i][0]);break}1===s&&e.addClass(t,l[l.length-1])}})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}if(""!==a&&l.length>0){let i=0;e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){-1!==t.className.indexOf("col-md-")||(-1!==t.className.indexOf("col-sm-")?l=["col-sm-1","col-sm-2","col-sm-3","col-sm-4","col-sm-5","col-sm-6","col-sm-7","col-sm-8","col-sm-9","col-sm-10","col-sm-11","col-sm-12"]:-1!==t.className.indexOf("col-xs-")?l=["col-xs-1","col-xs-2","col-xs-3","col-xs-4","col-xs-5","col-xs-6","col-xs-7","col-xs-8","col-xs-9","col-xs-10","col-xs-11","col-xs-12"]:-1!==t.className.indexOf("col-lg-")?l=["col-lg-1","col-lg-2","col-lg-3","col-lg-4","col-lg-5","col-lg-6","col-lg-7","col-lg-8","col-lg-9","col-lg-10","col-lg-11","col-lg-12"]:-1!==t.className.indexOf("col-xl-")?l=["col-xl-1","col-xl-2","col-xl-3","col-xl-4","col-xl-5","col-xl-6","col-xl-7","col-xl-8","col-xl-9","col-xl-10","col-xl-11","col-xl-12"]:-1!==t.className.indexOf("col-xxl-")&&(l=["col-xxl-1","col-xxl-2","col-xxl-3","col-xxl-4","col-xxl-5","col-xxl-6","col-xxl-7","col-xxl-8","col-xxl-9","col-xxl-10","col-xxl-11","col-xxl-12"])),i++;for(var n=0;n<=l.length-1;n++)e.removeClass(t,l[n]);1===s&&e.addClass(t,l[11]),2===s&&e.addClass(t,l[5]),3===s&&e.addClass(t,l[3]),4===s&&e.addClass(t,l[2]),5===s&&(5===i?e.addClass(t,l[3]):e.addClass(t,l[1])),6===s&&e.addClass(t,l[1]),7===s&&(i>=6?e.addClass(t,l[0]):e.addClass(t,l[1])),8===s&&(i>=5?e.addClass(t,l[0]):e.addClass(t,l[1])),9===s&&(i>=4?e.addClass(t,l[0]):e.addClass(t,l[1])),10===s&&(i>=3?e.addClass(t,l[0]):e.addClass(t,l[1])),11===s&&(i>=2?e.addClass(t,l[0]):e.addClass(t,l[1])),12===s&&e.addClass(t,l[0])}}))}Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}addContent(t,e,i){const n=this.dom;this.builder.opts.onAdd&&(t=this.builder.opts.onAdd(t));const o=this.cellSelected();let s;if(o)s=o.parentNode;else{if(s=this.builder.doc.querySelector(".row-active"),!s)return;e="row"}if("cell"===e||"cell-left"===e||"cell-right"===e){let a=4;this.builder.maxColumns&&(a=this.builder.maxColumns);let l,r=3;if(s.querySelector(".is-row-overlay")&&(r=4),s.childElementCount>=a+r)return alert(this.out("You have reached the maximum number of columns")),!1;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){let e=this.builder.opts.cellFormat,i=e.indexOf("</");t=e.substring(0,i)+t+e.substring(i),l=this.createElementFromHTML(t)}else{l=o.cloneNode(!0),l.removeAttribute("data-noedit"),l.removeAttribute("data-protected"),l.removeAttribute("data-module"),l.removeAttribute("data-module-desc"),l.removeAttribute("data-dialog-width"),l.removeAttribute("data-html"),l.removeAttribute("data-settings");for(let t=1;t<=20;t++)l.removeAttribute("data-html-"+t);l.removeAttribute("data-noedit"),n.removeClass(l,"cell-active"),n.removeClass(l,"is-light-text"),n.removeClass(l,"is-dark-text"),n.removeClass(l,"padding-0"),n.removeClass(l,"p-0"),l.removeAttribute("data-click"),l.removeAttribute("style"),i&&l.setAttribute(i,""),l.innerHTML=t}s.insertBefore(l,o),"cell"!==e&&"cell-right"!==e||n.moveAfter(l,o);let c=this.builder.doc.querySelector(".builder-active");c&&this.builder.applyBehaviorOn(c),this.fixLayout(s),l.click()}if("row"===e){let e,o;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){e=this.htmlToElement(this.builder.opts.rowFormat);let s=this.builder.opts.cellFormat,a=s.indexOf("</");t=s.substring(0,a)+t+s.substring(a);let l=n.elementChildren(e);for(;l.length>0&&(l=l[0],n.elementChildren(l).length>0);)l=n.elementChildren(l);l.innerHTML=t,o=l.firstChild,i&&o.setAttribute(i,"")}else o=n.createElement("div"),n.addClass(o,this.builder.opts.cols[this.builder.opts.cols.length-1]),o.innerHTML=t,i&&o.setAttribute(i,""),e=n.createElement("div"),n.addClass(e,this.builder.opts.row),n.appendChild(e,o);s.parentNode.insertBefore(e,s),n.moveAfter(e,s);let a=this.builder.doc.querySelector(".builder-active");a&&this.builder.applyBehaviorOn(a),o.click()}if("elm"===e){let e=this.builder.activeElement;if(!e)return;this.builder.uo.saveForUndo();let i=e;i.insertAdjacentHTML("afterend",t);let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n);let o=i.nextElementSibling;if("img"===o.tagName.toLowerCase()){let t=setInterval((()=>{o.complete&&(o.click(),clearInterval(t))}),30)}else o.click();let s=this.builder.builderStuff.querySelector(".quickadd");this.hidePop(s)}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}htmlToElement(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}addSnippet(t,e,i){this.builder.uo.saveForUndo();const n=this.dom;let o,s,a,l=!1;const r=this.builder.builderStuff.querySelector(".quickadd").getAttribute("data-mode");if(!e||"cell"!==r&&"cell-left"!==r&&"cell-right"!==r){if(e&&"row"===r){let e;if(a=document.createElement("div"),a.className=this.builder.opts.cols[this.builder.opts.cols.length-1],a.innerHTML=t,i&&a.setAttribute("data-noedit",""),o=document.createElement("div"),o.className=this.builder.opts.row,o.appendChild(a),s=this.builder.cellSelected(),s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(l=!0)),l){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}e.parentNode.insertBefore(o,e),n.moveAfter(o,e);let r=this.builder.doc.querySelector(".builder-active");r||(r=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(r),a.click(),o.className=o.className.replace("row-outline",""),this.builder.util.hideColumnTool()}else{if(e)return void(i?this.addContent(t,r,"data-noedit"):this.addContent(t,r));{var c=document.createElement("div");c.innerHTML=t;var d=c.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(d,(e=>{t=(t=(t=decodeURIComponent(e.getAttribute("data-html"))).replace(/{id}/g,this.makeId())).replace(/<script>/g,""+(this.builder.nonce?`<script nonce="${this.builder.nonce}">`:"<script>"));for(var i=1;i<=20;i++)t=t.replace("[%HTML"+i+"%]",void 0===e.getAttribute("data-html-"+i)?"":decodeURIComponent(e.getAttribute("data-html-"+i)));e.innerHTML=t})),1===c.childNodes.length&&1===c.childNodes[0].childNodes.length&&("cell"===r||"cell-left"===r||"cell-right"===r)){const t=this.cellSelected();let e=t.parentNode,i=4;if(this.builder.maxColumns&&(i=this.builder.maxColumns),e.querySelector(".is-row-overlay")){if(e.childElementCount>=i+4)return alert(this.out("You have reached the maximum number of columns")),!1}else if(e.childElementCount>=i+3)return alert(this.out("You have reached the maximum number of columns")),!1;this.builder.uo.saveForUndo();let n=c.childNodes[0].childNodes[0];var u=document.createRange();t.parentNode.insertBefore(u.createContextualFragment(n.outerHTML),t),"cell"!==r&&"cell-right"!==r||(t.parentNode.insertBefore(t.previousElementSibling,t),t.parentNode.insertBefore(t,t.previousElementSibling));let o=this.builder.doc.querySelector(".builder-active");return o||(o=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(o),this.fixLayout(e),"cell"===r||"cell-right"===r?t.nextElementSibling.click():t.previousElementSibling.click(),this.builder.opts.onChange(),void this.builder.opts.onRender()}let e;if(s=this.builder.activeCol,s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(l=!0)),l){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}u=document.createRange(),e.parentNode.insertBefore(u.createContextualFragment(c.innerHTML),e.nextSibling),o=c.childNodes[0],o=e.nextElementSibling;let i=this.builder.doc.querySelector(".builder-active");i||(i=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(i),a=o.querySelector("div"),a&&a.click(),o.className=o.className.replace("row-outline",""),this.builder.util.hideColumnTool()}}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}else i?this.addContent(t,r,"data-noedit"):this.addContent(t,r)}clearActiveCell(){const t=this.builder.builderStuff;if(!t)return;if(t.getAttribute("preventDevault"))return void setTimeout((()=>{t.removeAttribute("preventDevault")}),30);let e=this.builder.doc.getElementsByClassName("cell-active");for(;e.length;)e[0].classList.remove("cell-active");for(e=this.builder.doc.getElementsByClassName("row-outline");e.length;)e[0].classList.remove("row-outline");for(e=this.builder.doc.getElementsByClassName("row-active");e.length;)e[0].classList.remove("row-active");for(e=this.builder.doc.getElementsByClassName("builder-active");e.length;)e[0].classList.remove("builder-active");this.builder.activeCol=null,this.builder.dom.removeClass(this.builder.doc.body,"content-edit")}clearAfterUndoRedo(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none",this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null;const n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(e=>{t.removeClass(e,"icon-active")})),this.builder.activeIcon=null;let o=e.querySelector(".is-rte-tool").querySelectorAll("button");Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"on")})),o=e.querySelector(".is-elementrte-tool").querySelectorAll("button"),Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"on")}));let s=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(s,(t=>{t.style.display=""}))}hidePops(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}));let n=e.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(n,(e=>{e.style.transition="all 200ms ease",setTimeout((()=>{e.style.opacity="0"}),10),setTimeout((()=>{e.style.display="",t.removeClass(e,"active"),e.style.opacity="",e.style.transition=""}),200)}));const o=document.querySelector(".moveable-control-box"),s=document.querySelector("#divImageResizer");o&&!s.getAttribute("data-resizing")&&(o.style.display="none")}hideControls(){const t=this.dom;let e=this.builder.builderStuff.querySelectorAll(".is-tool");Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(e=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none"}clearActiveElement(t){const e=this.dom,i=this.builder.builderStuff,n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"icon-active")}));let o=this.builder.doc.querySelectorAll(".elm-inspected");if(Array.prototype.forEach.call(o,(t=>{e.removeClass(t,"elm-inspected")})),o=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(o,(t=>{e.removeClass(t,"elm-active")})),this.builder.doc.querySelector(".is-element-tool").style.display="",this.builder.doc.querySelector("#divLinkTool").style.display="",this.builder.activeIcon=null,this.builder.inspectedElement=null,this.builder.activeElement=null,t){let t=i.querySelector(".is-rte-tool");t&&(t.style.display="none");let e=i.querySelector(".is-elementrte-tool");e&&(e.style.display="flex");let n=i.querySelector(".rte-more-options");n&&(n.style.display="");let o=i.querySelector(".elementrte-more-options");o&&(o.style.display="");let s=e.querySelectorAll("button[data-align]");Array.prototype.forEach.call(s,(t=>{t.style.display="none"})),this.builder.rte.positionToolbar()}}clearPops(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;if(e.getAttribute("preventDevault"))return void setTimeout((()=>{e.removeAttribute("preventDevault")}),30);let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none";let n=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(n,(t=>{t.style.display="block"}));let o=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(o,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}clearControls(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;if(e.getAttribute("preventDevault"))return void setTimeout((()=>{e.removeAttribute("preventDevault")}),30);let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none",this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.activeImage=null;const n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(e=>{t.removeClass(e,"icon-active")})),this.builder.activeIcon=null;let o=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(o,(t=>{t.style.display="block"}));var s=e.querySelectorAll(".is-side.elementstyles");Array.prototype.forEach.call(s,(e=>{t.removeClass(e,"active")}));let a=this.builder.doc.querySelectorAll("[data-saveforundo]");if(Array.prototype.forEach.call(a,(t=>{t.removeAttribute("data-saveforundo")})),a=this.builder.doc.querySelectorAll(".elm-inspected"),Array.prototype.forEach.call(a,(e=>{t.removeClass(e,"elm-inspected")})),"auto"===this.builder.toolbarDisplay){let t=e.querySelector(".is-rte-tool");t&&(t.style.display="none");let i=e.querySelector(".is-elementrte-tool");i&&(i.style.display="none");let n=e.querySelector(".rte-more-options");n&&(n.style.display="");let o=e.querySelector(".elementrte-more-options");o&&(o.style.display="")}a=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(a,(e=>{t.removeClass(e,"elm-active")}));let l=e.querySelectorAll(".is-rte-pop");Array.prototype.forEach.call(l,(e=>{e.style.display="",t.removeClass(e,"active"),t.removeClass(e,"deactive")}));let r=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(r,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}makeId(){let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<2;i++)t+=e.charAt(Math.floor(Math.random()*e.length));let i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<5;t++)i+=n.charAt(Math.floor(Math.random()*n.length));return t+i}getSelection(){if(this.builder.dom.getSelectedBlocks().length>0)this.builder.selectionMulti=!0;else{this.builder.selectionMulti=!1;const t=this.builder.win.getSelection(),e=this.builder.dom.getElm();if(!e)return;if(e&&e.innerText===t.toString().trim()||""===t.toString().trim()){this.builder.selectionElm=e;let t=e.closest("a");this.builder.activeLink=t||null}else this.builder.selectionText=t,this.builder.activeLink=null}}saveSelection(){if(this.builder.win.getSelection){let t=this.builder.win.getSelection();if(t.getRangeAt&&t.rangeCount){let e=[];for(let i=0,n=t.rangeCount;i<n;++i)e.push(t.getRangeAt(i));return this.builder.selection=e,e}}else if(this.builder.doc.selection&&this.builder.doc.selection.createRange)return this.builder.selection=this.builder.doc.selection.createRange(),this.builder.doc.selection.createRange();return this.builder.selection=null,null}restoreSelection(){let t=this.builder.selection;if(t)if(this.builder.win.getSelection){let o=this.builder.win.getSelection();if(this.builder.doc.body.createTextRange){var e=this.builder.doc.body.createTextRange();e.collapse(),e.select()}else this.builder.win.getSelection?this.builder.win.getSelection().empty?this.builder.win.getSelection().empty():this.builder.win.getSelection().removeAllRanges&&this.builder.win.getSelection().removeAllRanges():this.builder.doc.selection&&this.builder.doc.selection.empty();for(var i=0,n=t.length;i<n;++i)o.addRange(t[i])}else this.builder.doc.selection&&t.select&&t.select()}cleanHTML(t,e){let i,n=t.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g," "),o=new RegExp("\x3c!--(.*?)--\x3e","g");n=n.replace(o,""),i=e?new RegExp("<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>","gi"):new RegExp("<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>","gi"),n=n.replace(i,"");let s,a=["style","script","applet","embed","noframes","noscript"];for(let t=0;t<a.length;t++)i=new RegExp("<"+a[t]+".*?"+a[t]+"(.*?)>","gi"),n=n.replace(i,"");s=e?["style","start"]:["start"];for(let t=0;t<s.length;t++){let e=new RegExp(" "+s[t]+'="(.*?)"',"gi");n=n.replace(e,"")}return n=n.replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,""),n=n.replace(/<(\/?)s>/gi,"<$1strike>"),n=n.replace(/&nbsp;/gi," "),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\);/gi,""),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\)/gi,""),n}checkEmpty(){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{this.checkEmptyOn(t)}))}checkEmptyOn(t){const e=this.dom,i=e.elementChildren(t);let n=!0;if(i.forEach((t=>{e.hasClass(t,"row-add-initial")||e.hasClass(t,"dummy-space")||"link"!==t.tagName.toLowerCase()&&(n=!1)})),n){let i=t.querySelector(".row-add-initial");i||(t.innerHTML=`<button type="button" class="row-add-initial">${this.out("Empty")}<br><span class="block">${this.out("+ Click to add content")}</span></div>`,i=t.querySelector(".row-add-initial")),i.addEventListener("click",(()=>{this.clearActiveCell();const n=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"builder-active")})),e.addClass(t,"builder-active"),e.addClass(i,"row-active");let o=this.builder.builderStuff.querySelector(".quickadd");o.querySelector(".is-pop-tabs").style.display="none";const s=window.innerHeight,a=this.getElementPosition(i);let l=a.top,r=a.left,c=a.scaleX,d=a.scaleY;r+=i.offsetWidth*(c*this.builder.opts.zoom)/2-11,l-=i.offsetHeight-i.offsetHeight*d,o.style.display="flex",this.showPop(o,!1,i);const u=o.offsetWidth,p=o.offsetHeight;s-l>p?(l=l+i.offsetHeight*this.builder.opts.zoom-19,o.style.top=l+window.pageYOffset+27+"px",o.style.left=r-u/2+7+"px",e.removeClass(o,"arrow-bottom"),e.removeClass(o,"arrow-right"),e.removeClass(o,"arrow-left"),e.removeClass(o,"center"),e.addClass(o,"arrow-top"),e.addClass(o,"center")):(o.style.top=l+window.pageYOffset-p-8+"px",o.style.left=r-u/2+7+"px",e.removeClass(o,"arrow-top"),e.removeClass(o,"arrow-right"),e.removeClass(o,"arrow-left"),e.removeClass(o,"center"),e.addClass(o,"arrow-bottom"),e.addClass(o,"center")),o.setAttribute("data-mode","row")}))}else{let e=t.querySelector(".row-add-initial");e&&e.parentNode.removeChild(e)}}clearPreferences(){localStorage.removeItem("_theme"),localStorage.removeItem("_zoom"),localStorage.removeItem("_buildermode"),localStorage.removeItem("_editingtoolbar"),localStorage.removeItem("_editingtoolbardisplay"),localStorage.removeItem("_hidecelltool"),localStorage.removeItem("_rowtool"),localStorage.removeItem("_hideelementtool"),localStorage.removeItem("_hidesnippetaddtool"),localStorage.removeItem("_outlinemode"),localStorage.removeItem("_hiderowcoloutline"),localStorage.removeItem("_outlinestyle"),localStorage.removeItem("_hideelementhighlight"),localStorage.removeItem("_opensnippets"),localStorage.removeItem("_toolstyle"),localStorage.removeItem("_snippetssidebardisplay"),localStorage.removeItem("_htmlview"),localStorage.removeItem("_pasteresult"),localStorage.removeItem("_livepreview"),localStorage.removeItem("_dictation"),localStorage.removeItem("_mic"),localStorage.removeItem("_autosendcommand"),localStorage.removeItem("_disclaimershown"),localStorage.removeItem("_temp"),localStorage.removeItem("_top_p"),localStorage.removeItem("_autosend_delay"),localStorage.removeItem("_auto_editblock"),localStorage.removeItem("_command_lang"),localStorage.removeItem("_ai_panel_open"),localStorage.removeItem("_scrollableeditor"),localStorage.removeItem("_animatedsorting"),localStorage.removeItem("_addbuttonplace"),localStorage.removeItem("_hiderowtool"),localStorage.removeItem("_dragwithouthandle"),localStorage.removeItem("_advancedhtmleditor"),localStorage.removeItem("_hidecolhtmleditor"),localStorage.removeItem("_hiderowhtmleditor"),localStorage.removeItem("_sampleshown")}pasteHtmlAtCaret(t,e){var i,n;if(this.restoreSelection(),this.builder.win.getSelection){if(!this.builder.activeCol)return;if((i=this.builder.win.getSelection()).getRangeAt&&i.rangeCount){(n=i.getRangeAt(0)).deleteContents();var o=this.builder.doc.createElement("div");o.innerHTML=t;for(var s,a,l=this.builder.doc.createDocumentFragment();s=o.firstChild;)a=l.appendChild(s);var r=l.firstChild;n.insertNode(l),a&&((n=n.cloneRange()).setStartAfter(a),e?n.setStartBefore(r):n.collapse(!0),i.removeAllRanges(),this.builder.isTouchSupport||i.addRange(n))}}else if((i=this.builder.doc.selection)&&"Control"!==i.type){if(!this.builder.activeCol)return;var c=i.createRange();c.collapse(!0),i.createRange().pasteHTML(t),e&&((n=i.createRange()).setEndPoint("StartToStart",c),this.builder.isTouchSupport||n.select())}}refreshModule(){let t=this.builder.activeModule;if(!t)return;let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}));let n=decodeURIComponent(t.getAttribute("data-html"));n=n.replace(/{id}/g,this.makeId()),t.innerHTML="";var o=document.createRange();o.setStart(t,0),t.appendChild(o.createContextualFragment(n)),i=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(i,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s))),s++})),this.repositionColumnTool(!0),this.builder.onRefreshTool&&this.builder.onRefreshTool()}repositionColumnTool(){let t=this.builder.activeCol;if(!t)return;let e=t.parentNode;if(t.parentNode||(e=this.rowSelected()),this.colTool=e.querySelector(".is-col-tool"),!this.colTool)return;t.parentNode||(this.colTool.style.display="none"),this.colTool.style.left=t.offsetLeft+"px";const i=this.builder.builderStuff.querySelector(".columnmore.active");if(i){const t=this.colTool.querySelector(".cell-more");i.classList.add("transition1"),setTimeout((()=>{const e=this.getElementPosition(t);let n=e.top,o=e.left;i.style.top=n+35+"px",i.style.left=o-7+"px",setTimeout((()=>{i.classList.remove("transition1")}),300)}),30)}}hideColumnTool(){this.builder.doc.querySelectorAll(".is-col-tool").forEach((t=>{t.style.display="none"}))}isTouchSupport(){return!!window.matchMedia("(pointer: coarse)").matches}detectIE(){return!!document.documentMode}LightenDarkenColor(t,e){var i=!1;"#"===t[0]&&(t=t.slice(1),i=!0);var n=parseInt(t,16),o=(n>>16)+e;o>255?o=255:o<0&&(o=0);var s=(n>>8&255)+e;s>255?s=255:s<0&&(s=0);var a=(255&n)+e;return a>255?a=255:a<0&&(a=0),(i?"#":"")+String("000000"+(a|s<<8|o<<16).toString(16)).slice(-6)}getUIStyles(){this.dom.appendHtml(this.builder.builderStuff,'\n <input type="text" class="style-helper-input" style="display:none;">\n <label class="style-helper-label" style="display:none;"></label>\n <button class="style-helper-button-classic classic" style="display:none;"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <select class="style-helper-select" style="display:none;"><option value=""></option></select>\n\n <div class="style-helper modal-color"></div>\n <div class="style-helper modal-background"></div>\n <div class="style-helper button-pickcolor-border"></div>\n <div class="style-helper button-pickcolor-background"></div>\n\n <button class="style-helper base"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <div class="style-helper base on"></div>\n <div class="style-helper base hover"></div>\n\n <div class="style-helper snippet-color"></div>\n <div class="style-helper snippet-background"></div>\n <div class="style-helper snippet-tabs-background"></div>\n <div class="style-helper snippet-tab-item-background"></div>\n <div class="style-helper snippet-tab-item-background-active"></div>\n <div class="style-helper snippet-tab-item-background-hover"></div>\n <div class="style-helper snippet-tab-item-color"></div>\n\n <div class="style-helper snippet-more-item-background"></div>\n <div class="style-helper snippet-more-item-background-active"></div>\n <div class="style-helper snippet-more-item-background-hover"></div>\n <div class="style-helper snippet-more-item-color"></div>\n\n <div class="style-helper tabs-background"></div>\n <div class="style-helper tab-item-active-border-bottom"></div>\n <div class="style-helper tab-item-color"></div>\n <div class="style-helper tabs-more-background"></div>\n <div class="style-helper tabs-more-border"></div>\n <div class="style-helper tabs-more-item-color"></div>\n <div class="style-helper tabs-more-item-background-hover"></div>\n <div class="style-helper separator-color"></div>\n <div class="style-helper outline-color"></div>\n ');const t=(t,e)=>{const i=this.builder.builderStuff.querySelector(".style-helper"+t);return window.getComputedStyle(i,null).getPropertyValue(e)},e=this.builder.builderStuff.querySelector(".style-helper-input"),i=this.builder.builderStuff.querySelector(".style-helper-label"),n=this.builder.builderStuff.querySelector(".style-helper-select"),o=this.builder.builderStuff.querySelector(".style-helper-button-classic");this.builder.styleModalColor=t(".modal-color","background-color"),this.builder.styleModalBackground=t(".modal-background","background-color"),this.builder.styleButtonPickColorBorder=t(".button-pickcolor-border","border"),this.builder.styleButtonPickColorBackground=t(".button-pickcolor-background","background-color"),this.builder.styleToolBackground=t(".base","background-color"),this.builder.styleButtonColor=t(".base","color"),this.builder.styleButtonSvgFill=(()=>{const t=this.builder.builderStuff.querySelector(".style-helper.base");return window.getComputedStyle(t.querySelector("svg"),null).getPropertyValue("fill")})(),this.builder.styleButtonBackgroundHover=t(".base.hover","background-color"),this.builder.styleSnippetColor=t(".snippet-color","background-color"),this.builder.styleSnippetBackground=t(".snippet-background","background-color"),this.builder.styleSnippetTabsBackground=t(".snippet-tabs-background","background-color"),this.builder.styleSnippetTabItemBackground=t(".snippet-tab-item-background","background-color"),this.builder.styleSnippetTabItemBackgroundActive=t(".snippet-tab-item-background-active","background-color"),this.builder.styleSnippetTabItemBackgroundHover=t(".snippet-tab-item-background-hover","background-color"),this.builder.styleSnippetTabItemColor=t(".snippet-tab-item-color","background-color"),this.builder.styleSnippetMoreItemBackground=t(".snippet-more-item-background","background-color"),this.builder.styleSnippetMoreItemBackgroundActive=t(".snippet-more-item-background-active","background-color"),this.builder.styleSnippetMoreItemBackgroundHover=t(".snippet-more-item-background-hover","background-color"),this.builder.styleSnippetMoreItemColor=t(".snippet-more-item-color","background-color"),this.builder.styleTabsBackground=t(".tabs-background","background-color"),this.builder.styleTabItemBorderBottomActive=t(".tab-item-active-border-bottom","border"),this.builder.styleTabItemColor=t(".tab-item-color","background-color"),this.builder.styleTabsMoreBackground=t(".tabs-more-background","background-color"),this.builder.styleTabsMoreBorder=t(".tabs-more-border","border"),this.builder.styleTabsMoreItemColor=t(".tabs-more-item-color","background-color"),this.builder.styleTabsMoreBackgroundHover=t(".tabs-more-item-background-hover","background-color"),this.builder.styleSeparatorColor=t(".separator-color","background-color"),this.builder.styleOutlineColor=t(".outline-color","background-color"),this.builder.styleSelectBackground=window.getComputedStyle(n,null).getPropertyValue("background-color"),this.builder.styleSelectColor=window.getComputedStyle(n,null).getPropertyValue("color"),this.builder.styleSelectOptionBackground=window.getComputedStyle(n.querySelector("option"),null).getPropertyValue("background-color"),this.builder.styleInputBackground=window.getComputedStyle(e,null).getPropertyValue("background-color"),this.builder.styleInputBorderBottom=window.getComputedStyle(e,null).getPropertyValue("border-bottom"),this.builder.styleInputColor=window.getComputedStyle(e,null).getPropertyValue("color"),this.builder.styleLabelColor=window.getComputedStyle(i,null).getPropertyValue("color"),this.builder.styleButtonClassicBackground=window.getComputedStyle(o,null).getPropertyValue("background-color"),this.builder.styleButtonClassicColor=window.getComputedStyle(o,null).getPropertyValue("color"),this.builder.styleButtonClassicBackgroundHover=this.getUIStyleValue(o,"hover","background-color"),this.builder.styleDark=!1,this.builder.styleColored=!1,this.builder.styleColoredDark=!1,this.builder.styleLight=!1,document.body.getAttribute("class")&&(-1!==document.body.getAttribute("class").indexOf("colored-dark")?this.builder.styleColoredDark=!0:-1!==document.body.getAttribute("class").indexOf("dark")?this.builder.styleDark=!0:-1!==document.body.getAttribute("class").indexOf("colored")?this.builder.styleColored=!0:-1!==document.body.getAttribute("class").indexOf("light")&&(this.builder.styleLight=!0))}getUIStyleValue(t,e,i){const n=this.dom;n.addClass(t,e);let o=window.getComputedStyle(t,null).getPropertyValue(i);return n.removeClass(t,e),o}getFontFamilyStyle(t){return`\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n `}refreshFontFamilyStyle1(){let t=this.builder.rte.rteFontFamilyOptions.querySelector("iframe").contentWindow.document;t.querySelector("#mainstyle").innerHTML=this.getFontFamilyStyle(),this.builder.styleDark?t.body.setAttribute("class","dark"):this.builder.styleColored?t.body.className="colored":this.builder.styleColoredDark?t.body.className="colored-dark":this.builder.styleLight?t.body.className="light":t.body.className=""}refreshFontFamilyStyle2(){let t=this.builder.builderStuff.querySelector(".is-modal.pickfontfamily").querySelector("iframe").contentWindow.document;t.querySelector("#mainstyle").innerHTML=this.getFontFamilyStyle(!0),this.builder.styleDark?t.body.setAttribute("class","dark"):this.builder.styleColored?t.body.className="colored":this.builder.styleColoredDark?t.body.className="colored-dark":this.builder.styleLight?t.body.className="light":t.body.className=""}getFontPreview(){let t=this.builder.fontAssetPath,e="";return e=`\n <li role="option" tabindex="0" data-provider="" data-font-family="" style="font-size:12px;padding:10px 7px;box-sizing:border-box;"><div></div>\n <span style="z-index:1;position: relative;pointer-events: none;">${this.out("None")}</span>\n </li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Arial, sans-serif"><div></div><img src="${t}arial.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="courier"><div></div><img src="${t}courier.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Georgia, serif"><div></div><img src="${t}georgia.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="monospace"><div></div><img src="${t}monospace.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="sans-serif"><div></div><img src="${t}sans_serif.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="serif"><div></div><img src="${t}serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Abel, sans-serif"><div></div><img src="${t}abel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Abril Fatface"><div></div><img src="${t}abril_fatface.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Advent Pro, sans-serif" data-font-style="wght@100;200;300;400;500;600;700"><div></div><img src="${t}advent_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Aladin, cursive"><div></div><img src="${t}aladin.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}alegreya.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya Sans SC, sans-serif" data-font-style="ital,wght@0,100;0,300;0,400;0,500;0,700;0,800;0,900;1,100;1,300;1,400;1,500;1,700;1,800;1,900"><div></div><img src="${t}alegreya_sans_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya SC, serif" data-font-style="ital,wght@0,400;0,500;0,700;0,800;0,900;1,400;1,500;1,700;1,800;1,900"><div></div><img src="${t}alegreya_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alice, serif"><div></div><img src="${t}alice.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Allerta Stencil, sans-serif"><div></div><img src="${t}allerta_stencil.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Allura, cursive"><div></div><img src="${t}allura.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Almendra Display, cursive"><div></div><img src="${t}almendra_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Amatic SC, cursive" data-font-style="wght@400;700"><div></div><img src="${t}amatic_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Andika, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}andika.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Anonymous Pro, monospace" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}anonymous_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Architects Daughter, cursive"><div></div><img style="transform:scale(1.1);" src="${t}architects_daughter.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Arimo, sans-serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700"><div></div><img src="${t}arimo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Arsenal, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}arsenal.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Assistant" data-font-style="wght@200;300;400;500;600;700;800"><div></div><img src="${t}assistant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Aubrey, cursive"><div></div><img src="${t}aubrey.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Anton, sans-serif"><div></div><img src="${t}anton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Archivo Narrow, sans-serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700"><div></div><img src="${t}archivo_narrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bad Script, cursive"><div></div><img src="${t}bad_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="BenchNine, sans-serif" data-font-style="wght@300;400;700"><div></div><img src="${t}benchNine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bevan, cursive"><div></div><img src="${t}bevan.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bigelow Rules, cursive"><div></div><img src="${t}bigelow_rules.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bilbo, cursive"><div></div><img src="${t}bilbo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bonbon, cursive"><div></div><img src="${t}bonbon.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bowlby One SC, cursive"><div></div><img src="${t}bowlby_one_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cabin Condensed, sans-serif" data-font-style="wght@400;500;600;700"><div></div><img src="${t}cabin_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Carrois Gothic SC, sans-serif"><div></div><img src="${t}carrois_gothic_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Caveat, cursive" data-font-style="wght@400;500;600;700"><div></div><img src="${t}caveat.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Chewy, cursive"><div></div><img src="${t}chewy.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cinzel, serif" data-font-style="wght@400;500;600;700;800;900"><div></div><img src="${t}cinzel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Comfortaa, cursive" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}comfortaa.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Concert One, cursive"><div></div><img src="${t}concert_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant, serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}cormorant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Garamond, serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}cormorant_garamond.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Infant, serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}cormorant_infant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant SC, serif" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}cormorant_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Unicase, serif" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}cormorant_unicase.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cousine" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}cousine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Crafty Girls, cursive"><div></div><img src="${t}crafty_girls.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cuprum, sans-serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700"><div></div><img src="${t}cuprum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cutive Mono, monospace"><div></div><img src="${t}cutive_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Devonshire, cursive"><div></div><img src="${t}devonshire.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Didact Gothic, sans-serif"><div></div><img src="${t}didact_gothic.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Diplomata SC, cursive"><div></div><img src="${t}diplomata_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Dosis, sans-serif" data-font-style="wght@200;300;400;500;600;700;800"><div></div><img src="${t}dosis.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="EB Garamond, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}eb_garamond.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="El Messiri, sans-serif" data-font-style="wght@400;500;600;700"><div></div><img src="${t}el_messiri.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Elsie, cursive" data-font-style="wght@400;900"><div></div><img src="${t}elsie.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Encode Sans, sans-serif" data-font-style="wght@100;200;300;400;500;600;700;800;900"><div></div><img src="${t}encode_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Exo, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}exo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'Exo 2', sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900" data-font-display="swap"><div></div><img src="${t}exo_2.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Felipa, cursive"><div></div><img src="${t}felipa.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Code, monospace" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}fira_code.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Mono, monospace" data-font-style="wght@400;500;700"><div></div><img src="${t}fira_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}fira_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans Condensed, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}fira_sans_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans Extra Condensed, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}fira_sans_extra_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fjalla One, sans-serif"><div></div><img src="${t}fjalla_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Forum, cursive"><div></div><img src="${t}forum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Frank Ruhl Libre" data-font-style="wght@300;400;500;700;900"><div></div><img src="${t}frank_ruhl_libre.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fredericka the Great, cursive"><div></div><img src="${t}fredericka_the_great.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gabriela, serif"><div></div><img src="${t}gabriela.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gilda Display, serif"><div></div><img src="${t}gilda_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Give You Glory, cursive"><div></div><img style="transform:scale(1.3);" src="${t}give_you_glory.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gruppo, cursive"><div></div><img src="${t}gruppo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Handlee, cursive"><div></div><img src="${t}handlee.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Happy Monkey, cursive"><div></div><img src="${t}happy_monkey.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Hind" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}hind.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Mono, monospace" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}ibm_plex_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Sans, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}ibm_plex_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Serif, serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}ibm_plex_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Iceland, cursive"><div></div><img src="${t}iceland.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Inconsolata, monospace" data-font-style="wght@200;300;400;500;600;700;800;900"><div></div><img src="${t}inconsolata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Josefin Sans, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}josefin_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Istok Web, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}istok_web.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Julee, cursive"><div></div><img src="${t}julee.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Julius Sans One, sans-serif"><div></div><img src="${t}julius_sans_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Junge, serif"><div></div><img src="${t}junge.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Jura, sans-serif" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}jura.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Just Me Again Down Here, cursive"><div></div><img style="transform:scale(1.1);" src="${t}just_me_again_down_here.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kaushan Script, cursive"><div></div><img src="${t}kaushan_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kelly Slab, cursive"><div></div><img src="${t}kelly_slab.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kite One, sans-serif"><div></div><img src="${t}kite_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kosugi, sans-serif"><div></div><img src="${t}kosugi.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kosugi Maru, sans-serif"><div></div><img src="${t}kosugi_maru.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kurale, serif"><div></div><img src="${t}kurale.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lato, sans-serif" data-font-style="ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900"><div></div><img src="${t}lato.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ledger, serif" data-font-display="swap"><div></div><img src="${t}ledger.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lekton, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400"><div></div><img src="${t}lekton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Life Savers, cursive" data-font-style="wght@400;700;800"><div></div><img src="${t}life_savers.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Literata, serif" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}literata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lobster, cursive"><div></div><img src="${t}lobster.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lobster Two, cursive" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}lobster_two.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Londrina Shadow, cursive"><div></div><img src="${t}londrina_shadow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lora, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700"><div></div><img src="${t}lora.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lovers Quarrel, cursive"><div></div><img style="transform:scale(1.1);" src="${t}lovers_quarrel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'M PLUS 1p', sans-serif" data-font-style="wght@100;300;400;500;700;800;900" data-font-display="swap"><div></div><img src="${t}m_plus_1p.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'M PLUS Rounded 1c', sans-serif" data-font-style="wght@100;300;400;500;700;800;900" data-font-display="swap"><div></div><img src="${t}m_plus_rounded_1c.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Macondo, cursive"><div></div><img src="${t}macondo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Marcellus SC, serif"><div></div><img src="${t}marcellus_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Marck Script, cursive"><div></div><img src="${t}marck_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Martel, serif" data-font-style="wght@200;300;400;600;700;800;900"><div></div><img src="${t}martel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Maven Pro, sans-serif"><div></div><img src="${t}maven_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Merriweather, serif" data-font-style="ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900"><div></div><img src="${t}merriweather.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Merriweather Sans" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}merriweather_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Mogra, cursive"><div></div><img src="${t}mogra.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Monoton, cursive"><div></div><img src="${t}monoton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montez, cursive"><div></div><img src="${t}montez.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}montserrat.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat Alternates, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}montserrat_alternates.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat Subrayada, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}montserrat_subrayada.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Neucha, cursive"><div></div><img src="${t}neucha.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Neuton, serif" data-font-style="ital,wght@0,200;0,300;0,400;0,700;0,800;1,400"><div></div><img src="${t}neuton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nixie One, cursive"><div></div><img src="${t}nixie_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nothing You Could Do, cursive"><div></div><img style="transform:scale(1.1);" src="${t}nothing_you_could_do.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Sans, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}noto_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Sans SC, sans-serif" data-font-style="wght@100;300;400;500;700;900"><div></div><img src="${t}noto_sans_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Serif, serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}noto_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Serif TC, serif" data-font-style="wght@200;300;400;500;600;700;900"><div></div><img src="${t}noto_serif_tc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nunito, sans-serif" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;0,1000;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900;1,1000"><div></div><img src="${t}nunito.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Old Standard TT, serif" data-font-style="ital,wght@0,400;0,700;1,400"><div></div><img src="${t}old_standard_tt.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans, sans-serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}open_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oranienbaum, serif"><div></div><img src="${t}oranienbaum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oswald, sans-serif" data-font-style="wght@200;300;400;500;600;700"><div></div><img src="${t}oswald.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oxygen, sans-serif" data-font-style="wght@300;400;700"><div></div><img src="${t}oxygen.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pacifico, cursive"><div></div><img src="${t}pacifico.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pangolin, cursive"><div></div><img src="${t}pangolin.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Passion One, cursive" data-font-style="wght@400;700;900"><div></div><img src="${t}passion_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pathway Gothic One, sans-serif"><div></div><img src="${t}pathway_gothic_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pattaya, sans-serif"><div></div><img src="${t}pattaya.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Petit Formal Script, cursive"><div></div><img style="transform:scale(1.1);" src="${t}petit_formal_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Philosopher, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}philosopher.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Play, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}play.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Playfair Display, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}playfair_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Playfair Display SC, serif" data-font-style="ital,wght@0,400;0,700;0,900;1,400;1,700;1,900"><div></div><img src="${t}playfair_display_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Podkova, serif" data-font-style="wght@400;500;600;700;800"><div></div><img src="${t}podkova.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Poiret One, cursive"><div></div><img src="${t}poiret_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pompiere, cursive"><div></div><img style="transform:scale(1.1);" src="${t}pompiere.png"></li>\n `,e+=`<li role="option" tabindex="0" data-provider="google" data-font-family="Poppins, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}poppins.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Prata, serif"><div></div><img src="${t}prata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'Press Start 2P', cursive"><div></div><img src="${t}press_start_2p.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Prosto One, cursive"><div></div><img src="${t}prosto_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Mono, monospace"><div></div><img src="${t}pt_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}pt_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans Caption, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}pt_sans_caption.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans Narrow, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}pt_sans_narrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Serif, serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}pt_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Serif Caption, serif" data-font-style="ital@0;1"><div></div><img src="${t}pt_serif_caption.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quattrocento Sans, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}quattrocento_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quattrocento, serif" data-font-style="wght@400;700"><div></div><img src="${t}quattrocento.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quicksand, sans-serif" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}quicksand.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Qwigley, cursive"><div></div><img src="${t}qwigley.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Raleway, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}raleway.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Raleway Dots, sans-serif"><div></div><img src="${t}raleway_dots.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Redressed, cursive"><div></div><img src="${t}redressed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ribeye Marrow, cursive"><div></div><img src="${t}ribeye_marrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Righteous, cursive"><div></div><img src="${t}righteous.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto, sans-serif" data-font-style="ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900"><div></div><img src="${t}roboto.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Condensed, sans-serif" data-font-style="ital,wght@0,300;0,400;0,700;1,300;1,400;1,700"><div></div><img src="${t}roboto_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Mono, monospace" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}roboto_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Slab, serif" data-font-style="wght@100;200;300;400;500;600;700;800;900"><div></div><img src="${t}roboto_slab.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rochester, cursive"><div></div><img src="${t}rochester.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rouge Script, cursive"><div></div><img src="${t}rouge_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rubik, sans-serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}rubik.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rubik Mono One, sans-serif"><div></div><img src="${t}rubik_mono_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ruslan Display, cursive"><div></div><img src="${t}ruslan_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Russo One, sans-serif"><div></div><img src="${t}russo_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sacramento, cursive"><div></div><img src="${t}sacramento.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sanchez, serif" data-font-style="ital@0;1"><div></div><img src="${t}sanchez.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Satisfy, cursive"><div></div><img src="${t}satisfy.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sawarabi Gothic, sans-serif"><div></div><img src="${t}sawarabi_gothic.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Scada, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}scada.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Seaweed Script, cursive"><div></div><img src="${t}seaweed_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Seymour One, sans-serif"><div></div><img src="${t}seymour_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Shadows Into Light Two, cursive"><div></div><img src="${t}shadows_into_light_two.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Six Caps, sans-serif"><div></div><img src="${t}six_caps.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Snowburst One, cursive"><div></div><img src="${t}snowburst_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Source Code Pro, monospace" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}source_code_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Source Sans Pro, sans-serif" data-font-style="ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900"><div></div><img src="${t}source_sans_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Special Elite, cursive"><div></div><img src="${t}special_elite.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Spectral, serif" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}spectral.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Spectral SC, serif" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}spectral_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Squada One, cursive"><div></div><img src="${t}squada_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Stalinist One, cursive"><div></div><img src="${t}stalinist_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Stint Ultra Expanded, cursive"><div></div><img src="${t}stint_ultra_expanded.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Syncopate, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}syncopate.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tangerine, cursive" data-font-style="wght@400;700"><div></div><img src="${t}tangerine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tenor Sans, sans-serif"><div></div><img src="${t}tenor_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tinos, serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}tinos.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu, sans-serif" data-font-style="ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700"><div></div><img src="${t}ubuntu.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu Condensed, sans-serif"><div></div><img src="${t}ubuntu_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu Mono, monospace" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}ubuntu_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Underdog, cursive"><div></div><img src="${t}underdog.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="UnifrakturMaguntia, cursive"><div></div><img src="${t}unifrakturmaguntia.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vast Shadow, cursive"><div></div><img src="${t}vast_shadow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Viga, sans-serif"><div></div><img src="${t}viga.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vollkorn, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}vollkorn.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vollkorn SC, serif" data-font-style="wght@400;600;700;900"><div></div><img src="${t}vollkorn_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Voltaire, sans-serif"><div></div><img src="${t}voltaire.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Wire One, sans-serif"><div></div><img src="${t}wire_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Yanone Kaffeesatz, sans-serif" data-font-style="wght@200;300;400;500;600;700"><div></div><img src="${t}yanone_kaffeesatz.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Yeseva One, cursive"><div></div><img src="${t}yeseva_one.png"></li>\n `,e}getFontFamilyHTML(t){return`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title>Fonts</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style id="mainstyle">\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n </style>\n\n </head>\n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <ul id="divFontList">\n ${this.getFontPreview()}\n </ul>\n\n <script${this.builder.nonce?` nonce="${this.builder.nonce}"`:""}>\n\n const close = () => {\n parent.focus();\n\n let pop = parent.document.querySelector('.rte-fontfamily-options.active, .pickfontfamily.active');\n if(pop) {\n pop.classList.remove('active');\n pop.classList.add('deactive');\n }\n }\n\n const setValue = (item) => {\n let provider = item.getAttribute('data-provider');\n let fontfamily = item.getAttribute('data-font-family');\n let fontstyle = item.getAttribute('data-font-style');\n let fontdisplay = item.getAttribute('data-font-display');\n parent._cb.setFont(fontfamily, fontstyle, fontdisplay, provider);\n\n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.classList.remove('on');\n });\n item.classList.add('on');\n }\n\n const handleItemClick = (e) => {\n e.preventDefault();\n\n let item = e.target;\n setValue(item);\n }\n\n const handleItemKeyDown = (e) => {\n e.preventDefault();\n\n if(e.keyCode === 38 && e.target.previousElementSibling) { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling) { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 27) { // escape key\n close();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n setValue(e.target);\n }\n }\n \n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.addEventListener('keydown', handleItemKeyDown);\n elm.addEventListener('click', handleItemClick);\n });\n <\/script>\n \n </body>\n </html>\n \n \n `}getFontFamilyEmail(t){let e=this.builder.fontAssetPath;return`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title>Fonts</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style>\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n </style>\n\n </head>\n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <ul id="divFontList">\n <li role="option" tabindex="0" data-provider="" data-font-family="" style="font-size:12px;padding:10px 7px;box-sizing:border-box;"><div></div>\n <span style="z-index:1;position: relative;pointer-events: none;">${this.out("None")}</span>\n </li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Arial, sans-serif"><div></div><img src="${e}arial.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="courier"><div></div><img src="${e}courier.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Georgia, serif"><div></div><img src="${e}georgia.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="monospace"><div></div><img src="${e}monospace.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="sans-serif"><div></div><img src="${e}sans_serif.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="serif"><div></div><img src="${e}serif.png"></li>\n </ul>\n\n <script>\n\n const close = () => {\n parent.focus();\n\n let pop = parent.document.querySelector('.is-rte-pop.active');\n if(pop) {\n pop.classList.remove('active');\n pop.classList.add('deactive');\n }\n }\n\n const setValue = (item) => {\n let provider = item.getAttribute('data-provider');\n let fontfamily = item.getAttribute('data-font-family');\n let fontstyle = item.getAttribute('data-font-style');\n let fontdisplay = item.getAttribute('data-font-display');\n parent._cb.setFont(fontfamily, fontstyle, fontdisplay, provider);\n\n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.classList.remove('on');\n });\n item.classList.add('on');\n }\n\n const handleItemClick = (e) => {\n e.preventDefault();\n\n let item = e.target;\n setValue(item);\n }\n\n const handleItemKeyDown = (e) => {\n e.preventDefault();\n\n if(e.keyCode === 38 && e.target.previousElementSibling) { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling) { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 27) { // escape key\n close();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n setValue(e.target);\n }\n }\n \n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.addEventListener('keydown', handleItemKeyDown);\n elm.addEventListener('click', handleItemClick);\n });\n <\/script>\n \n </body>\n </html>\n \n \n `}getPageTemplate(t){let e="";return e=""===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"tailwind"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content-tailwind.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <link rel="stylesheet" href="[%PATH%]/assets/frameworks/tailwindcss/styles.css">\n \x3c!-- To build your own, please see: https://tailwindcss.com/docs/installation --\x3e\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"bootstrap"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {margin: 140px auto; max-width: 800px; width:100%; padding:0 35px; box-sizing: border-box;}\n /* Bootstrap css adjustment to enable column drag to resize */\n .row > *,\n .column {\n max-width: unset !important;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"foundation"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation.min.css">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation-float.min.css">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"[%CONTENT%]",e}getElementPosition(t){const e=this.builder.iframe;let i,n,o,s;if(this.builder.iframe){let a=document.querySelector(".is-content-view");a||(a=e.parentNode);const l=window.getComputedStyle(a).transform;if("none"!==l){const t=l.match(/matrix\(([0-9., -]+)\)/)[1].split(",");o=parseFloat(t[0]),s=parseFloat(t[3])}else o=1,s=1;const r=e.getBoundingClientRect();i=t.getBoundingClientRect().top*s+r.top,n=t.getBoundingClientRect().left*o+r.left}else i=t.getBoundingClientRect().top,n=t.getBoundingClientRect().left,o=1,s=1;return{top:i,left:n,scaleX:o,scaleY:s}}}class je{constructor(t){this.builder=t}getScale(t){let e=window.getComputedStyle(t).transform.split("(")[1];e=e.split(")")[0],e=e.split(",");let i=e[0],n=e[1];return Math.sqrt(i*i+n*n)}createElement(t){return document.createElement(t)}appendChild(t,e){t&&t.appendChild(e)}appendHtml(t,e){t&&t.insertAdjacentHTML("beforeend",e)}addEventListener(t,e,i){t&&t.addEventListener(e,i)}addClass(t,e){t&&(this.hasClass(t,e)||(0===t.classList.length?t.className=e:t.className=t.className+" "+e,t.className=t.className.replace(/ +/g," ")))}removeClass(t,e){if(t&&t.classList.length>0){let i,n,o,s,a=e.split(" ");for(i=0,o=a.length;i<o;++i){if(!a[i])continue;let e=a[i],o="",l=t.className.split(" ");for(n=0,s=l.length;n<s;++n)l[n]&&l[n]!==e&&(o+=l[n]+" ");t.className=o.trim()}""===t.className&&t.removeAttribute("class")}}removeClassesByPrefix(t,e){t.classList&&t.classList.forEach((i=>{0===i.indexOf(e)&&this.removeClass(t,i)}))}hasClass(t,e){return!!t&&(!!t.className&&(" "+t.className+" ").indexOf(" "+e+" ")>-1)}moveAfter(t,e){e.parentNode.insertBefore(t,e),e.parentNode.insertBefore(e,e.previousElementSibling)}elementChildren(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}getElementOffset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset,width:e.width,height:e.height}}parentsHasClass(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(this.hasClass(t,e))return!0;t=t.parentNode}}parentsHasId(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.id===e)return!0;t=t.parentNode}}parentsHasTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return!0;t=t.parentNode}}parentsHasAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return!0}catch(t){}t=t.parentNode}}getParentByTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return t;t=t.parentNode}}getParentByAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return t}catch(t){}t=t.parentNode}}parentsHasElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return!0}}getParentElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return t}}removeClasses(t,e){for(let i=0;i<t.length;i++)t[i].classList.remove(e)}removeAttributes(t,e){for(let i=0;i<t.length;i++)t[i].removeAttribute(e)}removeElements(t){Array.prototype.forEach.call(t,(t=>{t.parentNode.removeChild(t)}))}moveCursorToElement(t){var e,i;window.getSelection&&this.builder.doc.createRange?((i=this.builder.doc.createRange()).selectNodeContents(t),i.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(i)):this.builder.doc.body.createTextRange&&((i=this.builder.doc.body.createTextRange()).moveToElementText(t),i.collapse(!1),i.select())}selectElementContents(t){var e=this.builder.doc.createRange();e.selectNodeContents(t);var i=this.builder.win.getSelection();i.removeAllRanges(),i.addRange(e)}getSelected(){if(this.builder.win.getSelection)return this.builder.win.getSelection().toString();if(this.builder.doc.getSelection)return this.builder.doc.getSelection().toString();var t=this.builder.doc.selection&&this.builder.doc.selection.createRange();return!!t.text&&t.text}checkEditable(){try{var t,e;return this.builder.win.getSelection?t=3===(e=this.builder.win.getSelection().getRangeAt(0).commonAncestorContainer).nodeType?e.parentNode:e:this.builder.doc.selection&&(e=this.builder.doc.selection.createRange(),t=this.builder.doc.selection.createRange().parentElement()),!!this.parentsHasAttribute(t,"contenteditable")}catch(t){return!1}}textSelection(){const t=this.getSelection().anchorNode;if(!t)return!1;return t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement}getStyle(t,e){return window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue(e):t.style[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]}observeElement(t,e,i,n=0){let o=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(o,e)){let s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,{get:function(){return s.get.apply(this,arguments)},set:function(){let t=this[e];s.set.apply(this,arguments);let o=this[e];"function"==typeof i&&setTimeout(i.bind(this,t,o),n)}})}}baseName(t){if("string"==typeof t){var e=t.split(".");return e.splice(0,e.length-1).join(".")}}doFunction(t,e,i){if(e(t),i){let i=Array.prototype.slice.call(t.getElementsByTagName("*"));for(var n=0;n<i.length;n++)e(i[n])}}execCommand(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((t=>{i(!0,t)}));else{const n=this.builder.win.getSelection(),o=this.getElm();if(!o)return void(i&&i(!1));let s;s=o&&o.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelection(t,e,o):this.replaceSelection(t,e,n,o),i&&i(!0,s)}}updateSelection(t,e,i){return i.style[t]=this.getStyleValue(i,t,e),this.checkStyleIfSameAsParent(i,t),this.cleanChildren(t,i),this.cleanUnusedSpan(i),i}replaceSelection(t,e,i,n){const o=i.getRangeAt(0),s=o.extractContents(),a=this.createSpan(n,t,e);return a.appendChild(s),this.cleanChildren(t,a),this.cleanUnusedSpan(a),o.insertNode(a),i.selectAllChildren(a),this.checkStyleIfSameAsParent(a,t),a}checkStyleIfSameAsParent(t,e){if(t.parentNode&&(t.parentNode.style[e]===t.style[e]||window.getComputedStyle(t.parentNode,null).getPropertyValue(e)===t.style[e])){t.style[e]="",""!==t.getAttribute("style")&&null!==t.style||t.removeAttribute("style");let i=0===t.attributes.length||1===t.attributes.length&&t.hasAttribute("data-keep");if("span"===t.nodeName.toLowerCase()&&i){const e=document.createTextNode(t.textContent);t.parentElement.replaceChild(e,t)}}}createSpan(t,e,i){const n=document.createElement("span");return n.style[e]=this.getStyleValue(t,e,i),n}findParentStyle(t,e){if("HTML"===t.nodeName.toUpperCase()||"BODY"===t.nodeName.toUpperCase())return null;if(!t.parentNode)return null;if(null!==t.style[e]&&void 0!==t.style[e]&&""!==t.style[e])return t;this.findParentStyle(t.parentNode,e)}getStyleValue(t,e,i){if("font-weight"===e||"font-style"===e||"text-decoration"===e||"text-transform"===e){let n,o=this.findParentStyle(t,e);if(o&&(n=o.style[e]),i===n){t.style[e]="";let o=window.getComputedStyle(t,null).getPropertyValue(e);t.style[e]=n,i=o}}return i}getParentBlock(t){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if("inline"!==this.getStyle(t,"display"))return t;t=t.parentNode}}execCommandClass(t,e,i=!0,n){const o=this.getSelectedBlocks();if(o.length>0)o.forEach((i=>{for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i)}));else{const o=this.builder.win.getSelection();let s=this.getElm();if(!s)return;const a=s&&s.innerText===o.toString().trim();(i||a||""===o.toString().trim())&&("block"===n&&"inline"===this.getStyle(s,"display")&&(s=this.getParentBlock(s)),this.updateSelectionClass(t,e,s))}}updateSelectionClass(t,e,i){for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}return""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i),i}cleanChildrenClass(t,e){if(!t.hasChildNodes())return;Array.from(t.children).map((t=>{for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];this.removeClass(t,n)}}));const i=Array.from(t.children).map((t=>this.cleanChildrenClass(t,e)));i&&i.length}getSelectedBlocks(){let t=!1,e=this.builder.win.getSelection(),i=[];if(!e.isCollapsed){let t=e.getRangeAt(0),n=t.commonAncestorContainer;const o=e=>{if(e.nodeType===Node.ELEMENT_NODE&&t.intersectsNode(e)&&i.push(e),e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)o(e.childNodes[t])};o(n),i.length>0&&i[0]===n&&i.shift()}let n=[];const o=["p","h1","h2","h3","h4","h5","h6","div","pre","td","th"];return i.forEach((e=>{const i=e.tagName.toLowerCase();o.includes(i)&&(t=!0,n.push(e))})),2===n.length&&n[0].innerText.trim()===e.toString().trim()&&n.pop(),t?n:[]}execCommandToggle(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((n=>{if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t||this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t||this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n)}));else{const n=this.builder.win.getSelection(),o=this.getElm();if(!o)return;o&&o.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelectionToggle(t,e,i,o):this.replaceSelectionToggle(t,e,i,n,o)}}getElm(){const t=this.builder.win.getSelection();if(!t)return!1;const e=t.anchorNode;if(!e)return!1;return e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement}updateSelectionToggle(t,e,i,n){if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0);parseInt(window.getComputedStyle(n,null).getPropertyValue("font-weight"))>=500&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t?this.addClass(n,i.fontWeight.defaultNormal):this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t?this.addClass(n,i.fontStyle.normal):this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}return this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n),n}replaceSelectionToggle(t,e,i,n,o){const s=n.getRangeAt(0),a=s.extractContents(),l=document.createElement("span");if("fontWeight"===t){let t=!1;o.closest(`.${i.fontWeight.defaultBold}`)&&(t=!0,this.hasClass(o,i.fontWeight.defaultNormal)&&(t=!1));parseInt(window.getComputedStyle(o,null).getPropertyValue("font-weight"))>=500&&(t=!0),t?this.addClass(l,i.fontWeight.defaultNormal):this.addClass(l,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;o.closest(`.${i.fontStyle.italic}`)&&(t=!0,this.hasClass(o,i.fontStyle.normal)&&(t=!1)),t?this.addClass(l,i.fontStyle.normal):this.addClass(l,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;o.closest(`.${i.textDecoration.underline}`)&&(t=!0),t||this.addClass(l,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;o.closest(`.${i.textDecoration.linethrough}`)&&(t=!0),t||this.addClass(l,i.textDecoration.linethrough)}if("textTransform"===t){let t="";o.closest(`.${i.textTransform.uppercase}`)&&(t="uppercase"),this.removeClass(l,i.textTransform.uppercase),this.removeClass(l,i.textTransform.lowercase),this.removeClass(l,i.textTransform.capitalize),this.removeClass(l,i.textTransform.normal),""===t&&this.addClass(l,i.textTransform.uppercase)}if("extend"===t){let t=!1;o.closest(`.${i.extend[e]}`)&&(t=!0),t||this.addClass(l,i.extend[e])}return l.appendChild(a),this.cleanChildrenToggle(t,e,l,i),this.cleanUnusedSpan(l),s.insertNode(l),n.selectAllChildren(l),l}cleanChildrenToggle(t,e,i,n){if(!i.hasChildNodes())return;"fontWeight"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontWeight.thin),this.removeClass(t,n.fontWeight.extralight),this.removeClass(t,n.fontWeight.light),this.removeClass(t,n.fontWeight.normal),this.removeClass(t,n.fontWeight.medium),this.removeClass(t,n.fontWeight.semibold),this.removeClass(t,n.fontWeight.bold),this.removeClass(t,n.fontWeight.extrabold),this.removeClass(t,n.fontWeight.black)})),"fontStyle"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontStyle.italic),this.removeClass(t,n.fontStyle.normal)})),"textUnderline"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textLinethrough"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textTransform"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textTransform.uppercase),this.removeClass(t,n.textTransform.lowercase),this.removeClass(t,n.textTransform.capitalize),this.removeClass(t,n.textTransform.normal)})),"clean"===t&&Array.from(i.children).map((t=>{t.className="",t.style.cssText=""})),"extend"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.extend[e])}));const o=Array.from(i.children).map((i=>this.cleanChildrenToggle(t,e,i,n)));o&&o.length}getSelection(){return this.builder.win&&this.builder.win.getSelection?this.builder.win.getSelection():this.builder.doc&&this.builder.doc.getSelection?this.builder.doc.getSelection():this.builder.doc&&this.builder.doc.selection?this.builder.doc.selection.createRange().text:null}cleanChildren(t,e){if(!e.hasChildNodes())return;const i=Array.from(e.children).filter((e=>void 0!==e.style[t]&&""!==e.style[t.style]));i&&i.length>0&&i.forEach((e=>{e.style[t]="",""!==e.getAttribute("style")&&null!==e.style||e.removeAttribute("style")}));const n=Array.from(e.children).map((e=>this.cleanChildren(t,e)));n&&n.length}addCssClass(t,e,i){this.removeCssClasses(t,i),this.addClass(t,e)}removeCssClasses(t,e){for(let i=0;i<Object.keys(e).length;i++){const n=Object.values(e)[i];this.removeClass(t,n)}}removeEmptyStyle(t){if(!t.hasChildNodes())return;const e=Array.from(t.children).filter((t=>t.getAttribute("style")));e&&e.length>0&&e.forEach((t=>{""!==t.getAttribute("style").trim()&&null!==t.style||t.removeAttribute("style")}));const i=Array.from(t.children).map((t=>this.removeEmptyStyle(t)));i&&i.length}cleanClassSize(t,e){if(!t.hasChildNodes())return;const i=Array.from(t.children).filter((t=>this.hasClass(t,e)));i&&i.length>0&&i.forEach((t=>{this.removeClass(t,e)}));const n=Array.from(t.children).map((t=>this.cleanClassSize(t,e)));n&&n.length}removeFormat(){const t=this.getSelection();if(!t)return;const e=t.anchorNode;if(!e)return;const i=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement;i&&i.innerText===t.toString().trim()||""===t.toString().trim()?this.cleanElement(i):this.cleanSelection(t)}cleanElement(t){t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)})),t.querySelectorAll("*").forEach((t=>{t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)}))})),this.cleanUnusedSpan(t)}cleanSelection(t){const e=t.getRangeAt(0),i=e.extractContents(),n=document.createElement("span");n.appendChild(i),e.insertNode(n),t.selectAllChildren(n),this.cleanElement(n)}cleanUnusedSpan(t){let e=t.querySelectorAll("span");const i=Array.prototype.filter;let n=i.call(e,(t=>0===t.attributes.length));n&&n.length>0&&n.forEach((t=>{t.outerHTML=t.innerHTML})),e=t.querySelectorAll("span"),i.call(e,(t=>{""===t.innerHTML&&t.parentNode.removeChild(t)})),e=t.querySelectorAll("span"),n=i.call(e,(t=>0===t.attributes.length)),n&&n.length>0&&this.cleanUnusedSpan(t)}contentReformat(t,e){this.replaceTag(t,"b",e.fontWeight.defaultBold),this.replaceTag(t,"i",e.fontStyle.italic),this.replaceTag(t,"u",e.textDecoration.underline),this.replaceTag(t,"strike",e.textDecoration.linethrough),this.replaceInline(t,"font-weight","normal",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","bold",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","600",e.fontWeight.semibold),this.replaceInline(t,"text-align","left",e.textAlign.left),this.replaceInline(t,"text-align","right",e.textAlign.right),this.replaceInline(t,"text-align","center",e.textAlign.center),this.replaceInline(t,"text-align","justify",e.textAlign.justify),this.replaceInline(t,"display","flex",e.display.flex),this.replaceInline(t,"justiify-content","flex-start",e.justifyContent.start),this.replaceInline(t,"justiify-content","flex-end",e.justifyContent.end),this.replaceInline(t,"justiify-content","center",e.justifyContent.center),this.replaceInline(t,"justiify-content","space-between",e.justifyContent.between),this.replaceInline(t,"flex-direction","column",e.flexDirection.column),this.replaceInline(t,"flex-direction","row",e.flexDirection.row),this.replaceInline(t,"align-items","flex-start",e.alignItems.start),this.replaceInline(t,"align-items","flex-end",e.alignItems.end),this.replaceInline(t,"align-items","center",e.alignItems.center),this.replaceInline(t,"text-transform","uppercase",e.textTransform.uppercase),this.replaceInline(t,"text-transform","lowercase",e.textTransform.lowercase),this.replaceInline(t,"text-transform","none",e.textTransform.normal),this.replaceInline(t,"line-height","1",e.leading.leading_10),this.replaceInline(t,"line-height","1.1",e.leading.leading_11),this.replaceInline(t,"line-height","1.2",e.leading.leading_12),this.replaceInline(t,"line-height","1.25",e.leading.leading_125),this.replaceInline(t,"line-height","1.3",e.leading.leading_13),this.replaceInline(t,"line-height","1.375",e.leading.leading_1375),this.replaceInline(t,"line-height","1.4",e.leading.leading_14),this.replaceInline(t,"line-height","1.5",e.leading.leading_15),this.replaceInline(t,"line-height","1.6",e.leading.leading_16),this.replaceInline(t,"line-height","1.625",e.leading.leading_1625),this.replaceInline(t,"line-height","1.7",e.leading.leading_17),this.replaceInline(t,"line-height","1.8",e.leading.leading_18),this.replaceInline(t,"line-height","1.9",e.leading.leading_19),this.replaceInline(t,"line-height","2",e.leading.leading_20),this.replaceInline(t,"line-height","2.1",e.leading.leading_21),this.replaceInline(t,"line-height","2.2",e.leading.leading_22)}replaceTag(t,e,i){let n=t.querySelectorAll(e);let o=Array.prototype.filter.call(n,(t=>0===t.attributes.length));o&&o.length>0&&o.forEach((t=>{const e=document.createElement("span");e.setAttribute("class",i),e.innerHTML=t.innerHTML,t.outerHTML=e.outerHTML}))}replaceInline(t,e,i,n){t.querySelectorAll("*").forEach((t=>{"justiify-content"===e?t.style.justifyContent===`${i}`&&(this.addClass(t,n),t.style.justifyContent=""):t.style[e]===`${i}`&&(this.addClass(t,n),t.style[e]="")}))}}var Fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ue={exports:{}},We={},Ye={exports:{}},Ge={},Xe={};function Ve(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function Ke(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function Ze(t,e){this.__indent_cache=new Ke(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new Ve(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}Ve.prototype.clone_empty=function(){var t=new Ve(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},Ve.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},Ve.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},Ve.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},Ve.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},Ve.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},Ve.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},Ve.prototype.is_empty=function(){return 0===this.__items.length},Ve.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},Ve.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},Ve.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},Ve.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},Ve.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},Ve.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},Ve.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},Ke.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},Ke.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},Ke.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},Ke.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},Ze.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},Ze.prototype.get_line_number=function(){return this.__lines.length},Ze.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},Ze.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},Ze.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},Ze.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},Ze.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},Ze.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},Ze.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},Ze.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},Ze.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},Ze.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},Ze.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},Ze.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},Ze.prototype.just_added_newline=function(){return this.current_line.is_empty()},Ze.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},Ze.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new Ve(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},Xe.Output=Ze;var Qe={};Qe.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var Je,ti,ei,ii,ni,oi={};ti="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",ii="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",ni="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(ei="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",(Je=oi).identifier=new RegExp(ni+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),Je.identifierStart=new RegExp(ni),Je.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+ti+ei+ii+"])+"),Je.newline=/[\n\r\u2028\u2029]/,Je.lineBreak=new RegExp("\r\n|"+Je.newline.source),Je.allLineBreaks=new RegExp(Je.lineBreak.source,"g");var si={},ai={};function li(t,e){this.raw_options=ri(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function ri(t,e){var i,n={};for(i in t=ci(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function ci(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}li.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},li.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},li.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},li.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},li.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},li.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},li.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},ai.Options=li,ai.normalizeOpts=ci,ai.mergeOpts=ri;var di=ai.Options,ui=["before-newline","after-newline","preserve-newline"];function pi(t){di.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",ui),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}pi.prototype=new di,si.Options=pi;var hi={},mi={},bi=RegExp.prototype.hasOwnProperty("sticky");function gi(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}gi.prototype.restart=function(){this.__position=0},gi.prototype.back=function(){this.__position>0&&(this.__position-=1)},gi.prototype.hasNext=function(){return this.__position<this.__input_length},gi.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},gi.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},gi.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||bi&&t.sticky||i.index!==e&&(i=null),i},gi.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},gi.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},gi.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},gi.prototype.read=function(t,e,i){var n,o="";return t&&(n=this.match(t))&&(o+=n[0]),!e||!n&&t||(o+=this.readUntil(e,i)),o},gi.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var o=t.exec(this.__input);return o?(n=o.index,e&&(n+=o[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},gi.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},gi.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&bi&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},gi.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},gi.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},gi.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},mi.InputScanner=gi;var vi={},fi={};function yi(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}yi.prototype.restart=function(){this.__position=0},yi.prototype.isEmpty=function(){return 0===this.__tokens_length},yi.prototype.hasNext=function(){return this.__position<this.__tokens_length},yi.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},yi.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},yi.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},fi.TokenStream=yi;var xi={},_i={};function wi(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}wi.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},wi.prototype.read_match=function(){return this._input.match(this._match_pattern)},wi.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},wi.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},wi.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},wi.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},wi.prototype._create=function(){return new wi(this._input,this)},wi.prototype._update=function(){},_i.Pattern=wi;var Si=_i.Pattern;function ki(t,e){Si.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}ki.prototype=new Si,ki.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},ki.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},ki.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},ki.prototype._create=function(){return new ki(this._input,this)},ki.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],o=t.exec(e);o;)n.push(e.substring(i,o.index)),i=o.index+o[0].length,o=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},xi.WhitespacePattern=ki;var Ci=mi.InputScanner,Li=Qe.Token,Ai=fi.TokenStream,Ei=xi.WhitespacePattern,qi={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Ti=function(t,e){this._input=new Ci(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new Ei(this._input)};Ti.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new Ai,this._reset();for(var e=new Li(qi.START,""),i=null,n=[],o=new Ai;e.type!==qi.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)o.add(t),t=this._get_next_token(e,i);o.isEmpty()||(t.comments_before=o,o=new Ai),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},Ti.prototype._is_first_token=function(){return this.__tokens.isEmpty()},Ti.prototype._reset=function(){},Ti.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(qi.RAW,i):this._create_token(qi.EOF,"")},Ti.prototype._is_comment=function(t){return!1},Ti.prototype._is_opening=function(t){return!1},Ti.prototype._is_closing=function(t,e){return!1},Ti.prototype._create_token=function(t,e){return new Li(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},Ti.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},vi.Tokenizer=Ti,vi.TOKEN=qi;var Mi={};function Oi(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Oi.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},Oi.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},Mi.Directives=Oi;var Ii={},$i=_i.Pattern,Ri={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function Bi(t,e){$i.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Ri),this._excluded=Object.assign({},Ri),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new $i(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}Bi.prototype=new $i,Bi.prototype._create=function(){return new Bi(this._input,this)},Bi.prototype._update=function(){this.__set_templated_pattern()},Bi.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},Bi.prototype.read_options=function(t){var e=this._create();for(var i in Ri)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},Bi.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},Bi.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},Bi.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},Bi.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},Ii.TemplatablePattern=Bi;var Pi=mi.InputScanner,Ni=vi.Tokenizer,zi=vi.TOKEN,Di=Mi.Directives,Hi=oi,ji=_i.Pattern,Fi=Ii.TemplatablePattern;function Ui(t,e){return-1!==e.indexOf(t)}var Wi={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:zi.START,RAW:zi.RAW,EOF:zi.EOF},Yi=new Di(/\/\*/,/\*\//),Gi=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,Xi=/[0-9]/,Vi=/[^\d\.]/,Ki=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),Zi=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";Zi=(Zi="\\?\\.(?!\\d) "+(Zi=Zi.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var Qi,Ji=new RegExp(Zi),tn="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),en=tn.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),nn=new RegExp("^(?:"+en.join("|")+")$"),on=function(t,e){Ni.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new ji(this._input),n=new Fi(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(Hi.identifier).matching(Hi.identifierMatch),number:i.matching(Gi),punct:i.matching(Ji),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(Hi.lineBreak),shebang:i.starting_with(/#!/).until_after(Hi.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(on.prototype=new Ni)._is_comment=function(t){return t.type===Wi.COMMENT||t.type===Wi.BLOCK_COMMENT||t.type===Wi.UNKNOWN},on.prototype._is_opening=function(t){return t.type===Wi.START_BLOCK||t.type===Wi.START_EXPR},on.prototype._is_closing=function(t,e){return(t.type===Wi.END_BLOCK||t.type===Wi.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},on.prototype._reset=function(){Qi=!1},on.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(Wi.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(Wi.UNKNOWN,this._input.next())},on.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(Hi.allLineBreaks,"\n"),t.type!==Wi.DOT&&(t.type!==Wi.RESERVED||"set"!==t.text&&"get"!==t.text)&&nn.test(e)?"in"===e||"of"===e?this._create_token(Wi.OPERATOR,e):this._create_token(Wi.RESERVED,e):this._create_token(Wi.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(Wi.WORD,e):void 0},on.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(Wi.START_EXPR,t):")"===t||"]"===t?e=this._create_token(Wi.END_EXPR,t):"{"===t?e=this._create_token(Wi.START_BLOCK,t):"}"===t?e=this._create_token(Wi.END_BLOCK,t):";"===t?e=this._create_token(Wi.SEMICOLON,t):"."===t&&Vi.test(this._input.peek(1))?e=this._create_token(Wi.DOT,t):","===t&&(e=this._create_token(Wi.COMMA,t)),e&&this._input.next(),e},on.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(Wi.EQUALS,t):"?."===t?this._create_token(Wi.DOT,t):this._create_token(Wi.OPERATOR,t)},on.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(Wi.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(Wi.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(Xi)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(Wi.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(Hi.newline);)e+=this._input.next();return Qi=!0,this._create_token(Wi.COMMENT,e)}}else if(Qi&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return Qi=!1,this._create_token(Wi.COMMENT,e);return null},on.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=Yi.get_directives(i);n&&"start"===n.ignore&&(i+=Yi.readIgnored(this._input)),i=i.replace(Hi.allLineBreaks,"\n"),(e=this._create_token(Wi.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(Wi.COMMENT,i))}return e},on.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new Pi(t),o=null;for(;n.hasNext();)if((o=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=o[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())o=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}o=n.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return t;if((i=parseInt(o[1],16))>126&&i<=255&&0===o[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+o[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(Hi.allLineBreaks,"\n"),this._create_token(Wi.STRING,e)}return null},on.prototype._allow_regexp_or_xml=function(t){return t.type===Wi.RESERVED&&Ui(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===Wi.END_EXPR&&")"===t.text&&t.opened.previous.type===Wi.RESERVED&&Ui(t.opened.previous.text,["if","while","for"])||Ui(t.type,[Wi.COMMENT,Wi.START_EXPR,Wi.START_BLOCK,Wi.START,Wi.END_BLOCK,Wi.OPERATOR,Wi.EQUALS,Wi.EOF,Wi.SEMICOLON,Wi.COMMA])},on.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,o=!1;this._input.hasNext()&&(n||o||this._input.peek()!==t)&&!this._input.testChar(Hi.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(Hi.identifier)),this._create_token(Wi.STRING,i)}return null},on.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var o=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===o.indexOf("{"),a=0;n;){var l=!!n[1],r=n[2];if(!(!!n[n.length-1]||"![CDATA["===r.slice(0,8))&&(r===o||s&&r.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(l?--a:++a),i+=n[0],a<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(Hi.allLineBreaks,"\n"),this._create_token(Wi.STRING,i)}}return null},on.prototype._read_string_recursive=function(t,e,i){var n,o;"'"===t?o=this.__patterns.single_quote:'"'===t?o=this.__patterns.double_quote:"`"===t?o=this.__patterns.template_text:"}"===t&&(o=this.__patterns.template_expression);for(var s=o.read(),a="";this._input.hasNext();){if((a=this._input.next())===t||!e&&Hi.newline.test(a)){this._input.back();break}"\\"===a&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),a+=this._input.next()):i&&("${"===i&&"$"===a&&"{"===this._input.peek()&&(a+=this._input.next()),i===a&&(a+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(a+=this._input.next()))),s+=a+=o.read()}return s},hi.Tokenizer=on,hi.TOKEN=Wi,hi.positionable_operators=Ki.slice(),hi.line_starters=tn.slice();var sn=Xe.Output,an=Qe.Token,ln=oi,rn=si.Options,cn=hi.Tokenizer,dn=hi.line_starters,un=hi.positionable_operators,pn=hi.TOKEN;function hn(t,e){return-1!==e.indexOf(t)}function mn(t,e){return t&&t.type===pn.RESERVED&&t.text===e}function bn(t,e){return t&&t.type===pn.RESERVED&&hn(t.text,e)}var gn=["case","return","do","if","throw","else","await","break","continue","async"],vn=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),fn=[vn.before_newline,vn.preserve_newline],yn="BlockStatement",xn="Statement",_n="ObjectLiteral",wn="ArrayLiteral",Sn="ForInitializer",kn="Conditional",Cn="Expression";function Ln(t,e){e.multiline_frame||e.mode===Sn||e.mode===kn||t.remove_indent(e.start_line_index)}function An(t){return t===wn}function En(t){return hn(t,[Cn,Sn,kn])}function qn(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new rn(e)}qn.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new an(pn.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},qn.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new sn(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(yn);var i=new cn(t,this._options);return this._tokens=i.tokenize(),t},qn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&ln.lineBreak.test(t||"")&&(e=t.match(ln.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},qn.prototype.handle_token=function(t,e){t.type===pn.START_EXPR?this.handle_start_expr(t):t.type===pn.END_EXPR?this.handle_end_expr(t):t.type===pn.START_BLOCK?this.handle_start_block(t):t.type===pn.END_BLOCK?this.handle_end_block(t):t.type===pn.WORD||t.type===pn.RESERVED?this.handle_word(t):t.type===pn.SEMICOLON?this.handle_semicolon(t):t.type===pn.STRING?this.handle_string(t):t.type===pn.EQUALS?this.handle_equals(t):t.type===pn.OPERATOR?this.handle_operator(t):t.type===pn.COMMA?this.handle_comma(t):t.type===pn.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===pn.COMMENT?this.handle_comment(t,e):t.type===pn.DOT?this.handle_dot(t):t.type===pn.EOF?this.handle_eof(t):(t.type,pn.UNKNOWN,this.handle_unknown(t,e))},qn.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&An(this._flags.mode);if(t.comments_before)for(var o=t.comments_before.next();o;)this.handle_whitespace_and_comments(o,e),this.handle_token(o,e),o=t.comments_before.next();if(n)for(var s=0;s<i;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var a=1;a<i;a+=1)this.print_newline(!0,e)}};var Tn=["async","break","continue","return","throw","yield"];qn.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(hn(this._flags.last_token.text,un)||hn(t.text,un)){var n=hn(this._flags.last_token.text,un)&&hn(this._options.operator_position,fn)||hn(t.text,un);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(bn(this._flags.last_token,Tn))return;this._output.set_wrap_point()}}},qn.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==pn.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==xn||this._flags.if_block&&mn(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},qn.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||An(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},qn.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===pn.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},qn.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},qn.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},qn.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},qn.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===xn&&Ln(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},qn.prototype.start_of_object_property=function(){return this._flags.parent.mode===_n&&this._flags.mode===xn&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||bn(this._flags.last_token,["get","set"]))},qn.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||bn(this._flags.last_token,["var","let","const"])&&t.type===pn.WORD)||mn(this._flags.last_token,"do"))||!(this._flags.parent.mode===_n&&this._flags.mode===xn)&&bn(this._flags.last_token,Tn)&&!t.newlines)||mn(this._flags.last_token,"else")&&!(mn(t,"if")&&!t.comments_before))||this._flags.last_token.type===pn.END_EXPR&&(this._previous_flags.mode===Sn||this._previous_flags.mode===kn))||this._flags.last_token.type===pn.WORD&&this._flags.mode===yn&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==pn.WORD&&t.type!==pn.RESERVED)||this._flags.mode===_n&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||bn(this._flags.last_token,["get","set"])))&&(this.set_mode(xn),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,bn(t,["do","for","if","while"])),!0)},qn.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=Cn;if("["===t.text){if(this._flags.last_token.type===pn.WORD||")"===this._flags.last_token.text)return bn(this._flags.last_token,dn)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=wn,An(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),hn(this._flags.last_token.type,[pn.START_EXPR,pn.END_EXPR,pn.WORD,pn.OPERATOR,pn.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===pn.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=Sn):hn(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=kn):hn(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(hn(this._flags.last_token.text,dn)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===pn.EQUALS||this._flags.last_token.type===pn.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===pn.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);bn(i,["async","function"])||"*"===i.text&&bn(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===_n&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===pn.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(hn(this._last_last_text,["function","yield"])||this._flags.mode===_n&&hn(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===pn.START_BLOCK?this.print_newline():this._flags.last_token.type!==pn.END_EXPR&&this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==pn.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},qn.prototype.handle_end_expr=function(t){for(;this._flags.mode===xn;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&An(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==pn.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),Ln(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===kn&&(this._previous_flags.mode=Cn,this._flags.do_block=!1,this._flags.do_while=!1)},qn.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===pn.END_EXPR?(this.set_mode(yn),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(yn):i&&(hn(i.text,[":",","])&&hn(e.type,[pn.STRING,pn.WORD,pn.RESERVED])||hn(e.text,["get","set","..."])&&hn(i.type,[pn.WORD,pn.RESERVED]))?hn(this._last_last_text,["class","interface"])?this.set_mode(yn):this.set_mode(_n):this._flags.last_token.type===pn.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(yn):hn(this._flags.last_token.type,[pn.EQUALS,pn.START_EXPR,pn.COMMA,pn.OPERATOR])||bn(this._flags.last_token,["return","throw","import","default"])?this.set_mode(_n):this.set_mode(yn);var n=!e.comments_before&&"}"===e.text,o=n&&"function"===this._flags.last_word&&this._flags.last_token.type===pn.END_EXPR;if(this._options.brace_preserve_inline){var s=0,a=null;this._flags.inline_frame=!0;do{if(s+=1,(a=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==pn.EOF&&(a.type!==pn.END_BLOCK||a.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==pn.OPERATOR&&(o||this._flags.last_token.type===pn.EQUALS||bn(this._flags.last_token,gn)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!An(this._previous_flags.mode)||this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.COMMA||((this._flags.last_token.type===pn.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===pn.COMMA||this._flags.last_token.type===pn.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==pn.OPERATOR&&this._flags.last_token.type!==pn.START_EXPR&&(this._flags.last_token.type!==pn.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},qn.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===xn;)this.restore_mode();var e=this._flags.last_token.type===pn.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(An(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},qn.prototype.handle_word=function(t){if(t.type===pn.RESERVED)if(hn(t.text,["set","get"])&&this._flags.mode!==_n)t.type=pn.WORD;else if("import"===t.text&&"("===this._tokens.peek().text)t.type=pn.WORD;else if(hn(t.text,["as","from"])&&!this._flags.import_block)t.type=pn.WORD;else if(this._flags.mode===_n){":"===this._tokens.peek().text&&(t.type=pn.WORD)}if(this.start_of_statement(t)?bn(this._flags.last_token,["var","let","const"])&&t.type===pn.WORD&&(this._flags.declaration_statement=!0):!t.newlines||En(this._flags.mode)||this._flags.last_token.type===pn.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===pn.EQUALS||!this._options.preserve_newlines&&bn(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(mn(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&mn(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===xn;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&bn(t,["case","default"]))return this.print_newline(),this._flags.last_token.type!==pn.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==pn.COMMA&&this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.EQUALS&&this._flags.last_token.type!==pn.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),mn(t,"function"))return(hn(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!hn(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==pn.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD?bn(this._flags.last_token,["get","set","new","export"])||bn(this._flags.last_token,Tn)||mn(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===pn.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!En(this._flags.mode)&&!An(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===pn.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":bn(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===pn.SEMICOLON&&this._flags.mode===yn?e="NEWLINE":this._flags.last_token.type===pn.SEMICOLON&&En(this._flags.mode)?e="SPACE":this._flags.last_token.type===pn.STRING?e="NEWLINE":this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD||"*"===this._flags.last_token.text&&(hn(this._last_last_text,["function","yield"])||this._flags.mode===_n&&hn(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===pn.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===pn.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),bn(t,dn)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),bn(t,["else","catch","finally"]))?(this._flags.last_token.type!==pn.END_BLOCK||this._previous_flags.mode!==yn||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?bn(this._flags.last_token,gn)||"declare"===this._flags.last_token.text&&bn(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==pn.END_EXPR?this._flags.last_token.type===pn.START_EXPR&&bn(t,["var","let","const"])||":"===this._flags.last_token.text||(mn(t,"if")&&mn(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):bn(t,dn)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&An(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==pn.WORD&&t.previous.type!==pn.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===pn.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&mn(t,"from")&&(this._flags.import_block=!1))},qn.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==xn||this._flags.if_block&&mn(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},qn.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==pn.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===pn.COMMA||this._flags.last_token.type===pn.START_EXPR||this._flags.last_token.type===pn.EQUALS||this._flags.last_token.type===pn.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==pn.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},qn.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},qn.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(En(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===_n||this._flags.mode===xn&&this._flags.parent.mode===_n?(this._flags.mode===xn&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},qn.prototype.handle_operator=function(t){var e="*"===t.text&&(bn(this._flags.last_token,["function","yield"])||hn(this._flags.last_token.type,[pn.START_BLOCK,pn.COMMA,pn.END_BLOCK,pn.SEMICOLON])),i=hn(t.text,["-","+"])&&(hn(this._flags.last_token.type,[pn.START_BLOCK,pn.START_EXPR,pn.EQUALS,pn.OPERATOR])||hn(this._flags.last_token.text,dn)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(bn(this._flags.last_token,gn))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==pn.DOT)if("::"!==t.text){if(this._flags.last_token.type===pn.OPERATOR&&hn(this._options.operator_position,fn)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==pn.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var o=!0,s=!0,a=!1;if(":"===t.text?0===this._flags.ternary_depth?o=!1:(this._flags.ternary_depth-=1,a=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&hn(t.text,un)){var l=":"===t.text,r=l&&a,c=l&&!a;switch(this._options.operator_position){case vn.before_newline:return this._output.space_before_token=!c,this.print_token(t),l&&!r||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case vn.after_newline:return this._output.space_before_token=!0,!l||r?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case vn.preserve_newline:return c||this.allow_wrap_or_preserved_newline(t),o=!(this._output.just_added_newline()||c),this._output.space_before_token=o,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),o=!1;var d=this._tokens.peek();s=d&&hn(d.type,[pn.WORD,pn.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),o=this._flags.last_token.type===pn.START_BLOCK,s=!1):(hn(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==pn.COMMA&&this._flags.last_token.type!==pn.START_EXPR||this.allow_wrap_or_preserved_newline(t),o=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&En(this._flags.mode)&&(o=!0),this._flags.last_token.type===pn.RESERVED?o=!0:this._flags.last_token.type===pn.END_EXPR?o=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===pn.OPERATOR&&(o=hn(t.text,["--","-","++","+"])&&hn(this._flags.last_token.text,["--","-","++","+"]),hn(t.text,["+","-"])&&hn(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==yn||this._flags.inline_frame)&&this._flags.mode!==xn||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||o,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},qn.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):ln.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},qn.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(ln.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),o=!1,s=!1,a=t.whitespace_before,l=a.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),s=function(t,e){for(var i,n=0,o=t.length;n<o;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,a),o&&(this._flags.alignment=1),i=0;i<n.length;i++)o?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):s&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(l))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},qn.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},qn.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),bn(this._flags.last_token,gn)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},qn.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},qn.prototype.handle_eof=function(t){for(;this._flags.mode===xn;)this.restore_mode();this.handle_whitespace_and_comments(t)},Ge.Beautifier=qn;var Mn=Ge.Beautifier,On=si.Options;Ye.exports=function(t,e){return new Mn(t,e).beautify()},Ye.exports.defaultOptions=function(){return new On};var In={exports:{}},$n={},Rn={},Bn=ai.Options;function Pn(t){Bn.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}Pn.prototype=new Bn,Rn.Options=Pn;var Nn=Rn.Options,zn=Xe.Output,Dn=mi.InputScanner,Hn=new(0,Mi.Directives)(/\/\*/,/\*\//),jn=/\r\n|[\r\n]/,Fn=/\r\n|[\r\n]/g,Un=/\s/,Wn=/(?:\s|\n)+/g,Yn=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,Gn=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function Xn(t,e){this._source_text=t||"",this._options=new Nn(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}Xn.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},Xn.prototype.eatWhitespace=function(t){for(var e=Un.test(this._input.peek()),i=0;Un.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},Xn.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},Xn.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},Xn.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},Xn.prototype.indent=function(){this._indentLevel++},Xn.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},Xn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&jn.test(t||"")&&(e=t.match(jn)[0]));var i=(t=t.replace(Fn,"\n")).match(/^[\t ]*/)[0];this._output=new zn(this._options,i),this._input=new Dn(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,o,s=0,a=!1,l=!1,r=!1,c=!1,d=!1,u=this._ch;n=""!==this._input.read(Wn),o=u,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),u=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var p=this._input.read(Yn),h=Hn.get_directives(p);h&&"start"===h.ignore&&(p+=Hn.readIgnored(this._input)),this.print_string(p),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(Gn)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var m=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);m.match(/[ :]$/)&&(m=this.eatString(": ").replace(/\s$/,""),this.print_string(m),this._output.space_before_token=!0),"extend"===(m=m.replace(/\s$/,""))?c=!0:"import"===m&&(d=!0),m in this.NESTED_AT_RULE?(this._nestedLevel+=1,m in this.CONDITIONAL_GROUP_RULE&&(r=!0)):a||0!==s||-1===m.indexOf(":")||(l=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(l&&(l=!1,this.outdent()),r?(r=!1,a=this._indentLevel>=this._nestedLevel):a=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&a&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===o&&this._output.trim(!0),d=!1,c=!1,l&&(this.outdent(),l=!1),this.print_string(this._ch),a=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!a&&!r||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||c||0!==s?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),l||(l=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===s?(l&&(this.outdent(),l=!1),c=!1,d=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),s++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),s&&(s--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),this.eatWhitespace(),s++,this.indent()):")"===this._ch?(s&&(s--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||l||0!==s||d||c?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||l||0!==s?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),Un.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(n),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&Un.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},$n.Beautifier=Xn;var Vn=$n.Beautifier,Kn=Rn.Options;In.exports=function(t,e){return new Vn(t,e).beautify()},In.exports.defaultOptions=function(){return new Kn};var Zn={exports:{}},Qn={},Jn={},to=ai.Options;function eo(t){to.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}eo.prototype=new to,Jn.Options=eo;var io={},no=vi.Tokenizer,oo=vi.TOKEN,so=Mi.Directives,ao=Ii.TemplatablePattern,lo=_i.Pattern,ro={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:oo.START,RAW:oo.RAW,EOF:oo.EOF},co=new so(/<\!--/,/-->/),uo=function(t,e){no.call(this,t,e),this._current_tag_name="";var i=new ao(this._input).read_options(this._options),n=new lo(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(o).until_after(o)}};(uo.prototype=new no)._is_comment=function(t){return!1},uo.prototype._is_opening=function(t){return t.type===ro.TAG_OPEN},uo.prototype._is_closing=function(t,e){return t.type===ro.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},uo.prototype._reset=function(){this._current_tag_name=""},uo.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(ro.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(ro.UNKNOWN,this._input.next())},uo.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=co.get_directives(i))&&"start"===n.ignore&&(i+=co.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(ro.COMMENT,i)).directives=n));return e},uo.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(ro.COMMENT,i)).directives=null)}return e},uo.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(ro.TAG_OPEN,i)),n},uo.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(ro.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(ro.TAG_OPEN,i))),n},uo.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(ro.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(ro.TAG_CLOSE,"}}"))),n},uo.prototype._read_attribute=function(t,e,i){var n=null,o="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(ro.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(ro.VALUE,s)}else(o=this.__patterns.attribute.read())&&(n=e.type===ro.EQUALS?this._create_token(ro.VALUE,o):this._create_token(ro.ATTRIBUTE,o));return n},uo.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},uo.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===ro.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var o=e.opened.text.substr(1).toLowerCase();if("script"===o||"style"===o){var s=this._read_comment_or_cdata(t);if(s)return s.type=ro.TEXT,s;n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(ro.TEXT,n):null},uo.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(ro.TEXT,e)},io.Tokenizer=uo,io.TOKEN=ro;var po=Jn.Options,ho=Xe.Output,mo=io.Tokenizer,bo=io.TOKEN,go=/\r\n|[\r\n]/,vo=/\r\n|[\r\n]/g,fo=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new ho(t,e)};fo.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},fo.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},fo.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},fo.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},fo.prototype.print_preserved_newlines=function(t){var e=0;t.type!==bo.TEXT&&t.previous.type!==bo.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},fo.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},fo.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},fo.prototype.print_newline=function(t){this._output.add_new_line(t)},fo.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},fo.prototype.indent=function(){this.indent_level++},fo.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var yo=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==bo.EOF&&t.closed!==i;){if(i.type===bo.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===bo.EQUALS&&i.next.next&&i.next.next.type===bo.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function xo(t,e){return-1!==e.indexOf(t)}function _o(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function wo(t){this._printer=t,this._current_frame=null}function So(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var o=new po(e,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}wo.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},wo.prototype.record_tag=function(t){var e=new _o(this._current_frame,t,this._printer.indent_level);this._current_frame=e},wo.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},wo.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},wo.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},wo.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},So.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&go.test(t)&&(e=t.match(go)[0]));var i=(t=t.replace(vo,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},o=new ko,s=new fo(this._options,i),a=new mo(t,this._options).tokenize();this._tag_stack=new wo(s);for(var l=null,r=a.next();r.type!==bo.EOF;)r.type===bo.TAG_OPEN||r.type===bo.COMMENT?o=l=this._handle_tag_open(s,r,o,n):r.type===bo.ATTRIBUTE||r.type===bo.EQUALS||r.type===bo.VALUE||r.type===bo.TEXT&&!o.tag_complete?l=this._handle_inside_tag(s,r,o,a):r.type===bo.TAG_CLOSE?l=this._handle_tag_close(s,r,o):r.type===bo.TEXT?l=this._handle_text(s,r,o):s.add_raw_token(r),n=l,r=a.next();return s._output.get_code(e)},So.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},So.prototype._handle_inside_tag=function(t,e,i,n){var o=i.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===bo.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===bo.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===bo.EQUALS||e.type===bo.VALUE&&e.previous.type===bo.EQUALS)&&t.set_space_before_token(!1),e.type===bo.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),o=o||0!==e.newlines),this._is_wrap_attributes_force)){var a=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var l,r=!0,c=0;do{if((l=n.peek(c)).type===bo.ATTRIBUTE){r=!1;break}c+=1}while(c<4&&l.type!==bo.EOF&&l.type!==bo.TAG_CLOSE);a=!r}a&&(t.print_newline(!1),o=!0)}t.print_token(e),o=o||t.previous_token_wrapped(),i.has_wrapped_attrs=o}return s},So.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},So.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var o,s=e.text,a=1,l="",r="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?o=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?o=this._css_beautify:"html"===i.custom_beautifier_name&&(o=function(t,e){return new So(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?a=0:"separate"===this._options.indent_scripts&&(a=-t.indent_level);var c=t.get_full_indent(a);if(s=s.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var d=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!d)return void t.add_raw_token(e);l=c+d[1]+"\n",s=d[4],d[5]&&(r=c+d[5]),s=s.replace(/\n[ \t]*$/,""),(d[2]||-1!==d[3].indexOf("\n"))&&(d=d[3].match(/[ \t]+$/))&&(e.whitespace_before=d[0])}if(s)if(o){var u=function(){this.eol="\n"};u.prototype=this._options.raw_options,s=o(c+s,new u)}else{var p=e.whitespace_before;p&&(s=s.replace(new RegExp("\n("+p+")?","g"),"\n")),s=c+s.replace(/\n/g,"\n"+c)}l&&(s=s?l+s+"\n"+r:l+r),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},So.prototype._handle_tag_open=function(t,e,i,n){var o=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==bo.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,o,i,n),o.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=e.text.length+1),o.tag_complete||o.is_unformatted||(t.alignment_size=o.alignment_size),o};var ko=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===bo.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};So.prototype._get_tag_open_token=function(t){var e=new ko(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||xo(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&xo(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&xo(e.tag_check,this._options.content_unformatted),e.is_inline_element=xo(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},So.prototype._set_tag_position=function(t,e,i,n,o){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=yo(i.tag_check,e)))),xo(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&o.type===bo.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var s=!1;s=(s=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(o.type===bo.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==o.type,(i.is_content_unformatted||i.is_unformatted)&&(s=!1),s&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===o.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},So.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Co=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],Lo=["a","audio","del","ins","map","noscript","video"];So.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Co.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==Lo.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},Qn.Beautifier=So;var Ao=Qn.Beautifier,Eo=Jn.Options;Zn.exports=function(t,e,i,n){return new Ao(t,e,i,n).beautify()},Zn.exports.defaultOptions=function(){return new Eo};var qo=Ye.exports,To=In.exports,Mo=Zn.exports;function Oo(t,e,i,n){return Mo(t,e,i=i||qo,n=n||To)}Oo.defaultOptions=Mo.defaultOptions,We.js=qo,We.css=To,We.html=Oo,function(t){!function(t){var e=We;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(t)}(Ue);var Io=Ue.exports;function $o(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ro(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Bo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ro(Object(i),!0).forEach((function(e){$o(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ro(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Po(t,e){if(null==t)return{};var i,n,o=function(t,e){if(null==t)return{};var i,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function No(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function zo(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Do(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ho(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Do(Object(i),!0).forEach((function(e){zo(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Do(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function jo(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}function Fo(t){return function e(){for(var i=this,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return o.length>=t.length?t.apply(this,o):function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e.apply(i,[].concat(o,n))}}}function Uo(t){return{}.toString.call(t).includes("Object")}function Wo(t){return"function"==typeof t}var Yo=Fo((function(t,e){throw new Error(t[e]||t.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),Go={changes:function(t,e){return Uo(e)||Yo("changeType"),Object.keys(e).some((function(e){return i=t,n=e,!Object.prototype.hasOwnProperty.call(i,n);var i,n}))&&Yo("changeField"),e},selector:function(t){Wo(t)||Yo("selectorType")},handler:function(t){Wo(t)||Uo(t)||Yo("handlerType"),Uo(t)&&Object.values(t).some((function(t){return!Wo(t)}))&&Yo("handlersType")},initial:function(t){var e;t||Yo("initialIsRequired"),Uo(t)||Yo("initialType"),e=t,Object.keys(e).length||Yo("initialContent")}};function Xo(t,e){return Wo(e)?e(t.current):e}function Vo(t,e){return t.current=Ho(Ho({},t.current),e),e}function Ko(t,e,i){return Wo(e)?e(t.current):Object.keys(i).forEach((function(i){var n;return null===(n=e[i])||void 0===n?void 0:n.call(e,t.current[i])})),i}var Zo={create:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Go.initial(t),Go.handler(e);var i={current:t},n=Fo(Ko)(i,e),o=Fo(Vo)(i),s=Fo(Go.changes)(t),a=Fo(Xo)(i);function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return Go.selector(t),t(i.current)}function r(t){jo(n,o,s,a)(t)}return[l,r]}};var Qo,Jo={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},ts=(Qo=function(t,e){throw new Error(t[e]||t.default)},function t(){for(var e=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=Qo.length?Qo.apply(this,n):function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t.apply(e,[].concat(n,o))}})(Jo),es={config:function(t){var e;return t||ts("configIsRequired"),e=t,{}.toString.call(e).includes("Object")||ts("configType"),t.urls?(console.warn(Jo.deprecation),{paths:{vs:t.urls.monacoBase}}):t}};function is(t,e){return Object.keys(e).forEach((function(i){e[i]instanceof Object&&t[i]&&Object.assign(e[i],is(t[i],e[i]))})),Bo(Bo({},t),e)}var ns={type:"cancelation",msg:"operation is manually canceled"};function os(t){var e=!1,i=new Promise((function(i,n){t.then((function(t){return e?n(ns):i(t)})),t.catch(n)}));return i.cancel=function(){return e=!0},i}var ss,as,ls=Zo.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),rs=(as=2,function(t){if(Array.isArray(t))return t}(ss=ls)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,o=!1,s=void 0;try{for(var a,l=t[Symbol.iterator]();!(n=(a=l.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){o=!0,s=t}finally{try{n||null==l.return||l.return()}finally{if(o)throw s}}return i}}(ss,as)||function(t,e){if(t){if("string"==typeof t)return No(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?No(t,e):void 0}}(ss,as)||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.")}()),cs=rs[0],ds=rs[1];function us(t){return document.body.appendChild(t)}function ps(t){var e=cs((function(t){return{config:t.config,reject:t.reject}})),i=function(t){var e=document.createElement("script");return t&&(e.src=t),e}("".concat(e.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=e.reject,i}function hs(){var t=cs((function(t){return{config:t.config,resolve:t.resolve,reject:t.reject}})),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],(function(e){ms(e),t.resolve(e)}),(function(e){t.reject(e)}))}function ms(t){cs().monaco||ds({monaco:t})}var bs=new Promise((function(t,e){return ds({resolve:t,reject:e})})),gs={config:function(t){var e=es.config(t),i=e.monaco,n=Po(e,["monaco"]);ds((function(t){return{config:is(t.config,n),monaco:i}}))},init:function(){var t=cs((function(t){return{monaco:t.monaco,isInitialized:t.isInitialized,resolve:t.resolve}}));if(!t.isInitialized){if(ds({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),os(bs);if(window.monaco&&window.monaco.editor)return ms(window.monaco),t.resolve(window.monaco),os(bs);!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(us,ps)(hs)}return os(bs)},__getMonacoInstance:function(){return cs((function(t){return t.monaco}))}};const vs=new je;let fs={};class ys{constructor(t){this.builder=t;const e=this.builder.util,i=this.builder.builderStuff;let n=i.querySelector(".viewhtml");if(!n){const t=`<div class="is-modal viewhtml" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content">\n <textarea class="tabSupport" style="width:100%;height:calc(100% - 50px);border:none;margin:0;box-sizing:border-box;"></textarea>\n <div class="is-modal-footer" style="border-top:1px solid ${this.builder.styleSeparatorColor};width:100%;height:50px;position:absolute;left:0;bottom:0;overflow:hidden;text-align:right">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlmonaco" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.blockCodeEditorWidth};max-width:${this.builder.blockCodeEditorMaxWidth};padding:0">\n <textarea style="position:absolute;display:none;"></textarea>\n <div class="input-code-editor" style="width:100%;height:${this.builder.blockCodeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlexternal" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.codeEditorWidth};max-width:${this.builder.codeEditorMaxWidth};padding:0">\n <div class="input-code-editor" style="width:100%;height:${this.builder.codeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n \n `;vs.appendHtml(i,t),n=i.querySelector(".viewhtml");let o=i.querySelector(".viewhtmlmonaco"),s=i.querySelector(".viewhtmlexternal"),a=n.querySelector(".input-ok");vs.addEventListener(a,"click",(()=>{this.applyHtml(n)})),a=n.querySelector(".input-cancel"),vs.addEventListener(a,"click",(()=>{this.builder.hideModal(n)})),a=o.querySelector(".input-ok"),vs.addEventListener(a,"click",(()=>{this.applyHtml(o)})),a=o.querySelector(".input-cancel"),vs.addEventListener(a,"click",(()=>{this.builder.hideModal(o)})),a=s.querySelector(".input-ok"),vs.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-ok");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(s)})),a=s.querySelector(".input-cancel"),vs.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-cancel");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(s)}))}}applyHtml(t){const e=this.builder.util;let i=this.builder.codeEditorMode,n=this.builder.codeEditorArea;this.builder.uo.saveForUndo();let o=t.querySelector("textarea").value;if("code"===i){let i=this.builder.activeCodeBlock;i.setAttribute("data-html",encodeURIComponent(o)),o=o.replace(/{id}/g,e.makeId());for(let t=1;t<=20;t++)o=o.replace("[%HTML"+t+"%]",void 0===i.getAttribute("data-html-"+t)?"":decodeURIComponent(i.getAttribute("data-html-"+t)));i.innerHTML="";let n=document.createRange();n.setStart(i,0),i.appendChild(n.createContextualFragment(o));let s=this.builder.doc.querySelector(".builder-active");return s&&this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),this.builder.hideModal(t),void e.hideControls()}if(o=this.fromViewToActual(o),"cell"===i){e.cellSelected().innerHTML=o;let t=this.builder.doc.querySelector(".builder-active");t&&this.builder.applyBehaviorOn(t),this.builder.opts.onChange(),this.builder.opts.onRender()}if("row"===i){let t,i=e.cellSelected();if(t=i?i.parentNode:e.rowSelected(),!t)return;t.innerHTML=o;let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender()}if("full"===i){n.innerHTML="";let t=document.createRange();t.setStart(n,0),n.appendChild(t.createContextualFragment(o)),this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender(),e.clearActiveCell()}e.clearControls(),this.builder.hideModal(t)}viewHtmlExternal(){const t=this.builder.util,e=this.builder.builderStuff.querySelector(".viewhtmlexternal");document.activeElement&&(this.elmFocus=document.activeElement),t.showModal(e,!0,(()=>{this.elmFocus&&this.elmFocus.focus()}),!1),e.querySelector(".input-code-editor").style.opacity=.01,this._viewHtmlExternal()}_viewHtmlExternal(){const t=document.querySelector("textarea[data-source-active]");let e=this.builder.builderStuff.querySelector(".viewhtmlexternal").querySelector(".input-code-editor");if(!e.querySelector(".monaco-editor"))return gs.init().then((t=>{this.builder.monaco=t,e.getAttribute("data-mode-id")||(this.builder.codeEditorExternal=t.editor.create(e,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""})),this.builder.codeEditorExternal.onDidChangeModelContent((()=>{document.querySelector("textarea[data-source-active]").value=this.builder.codeEditorExternal.getModel().getValue()}))})),void setTimeout((()=>{this._viewHtmlExternal()}),100);const i=this.builder.monaco.editor.createModel(t.value,"html");this.builder.codeEditorExternal.setModel(i),e.style.opacity=""}view(t,e,i){const n=this.builder.util,o=this.builder.builderStuff;let s;s=this.builder.opts.htmlSyntaxHighlighting?o.querySelector(".viewhtmlmonaco"):o.querySelector(".viewhtml");let a=s.querySelector(".is-modal-content"),l=s.querySelector(".input-code-editor");l.style.opacity=.01,"full"===t?(a.style.width=this.builder.codeEditorWidth,a.style.maxWidth=this.builder.codeEditorMaxWidth,l.style.height=this.builder.codeEditorHeight):(a.style.width=this.builder.blockCodeEditorWidth,a.style.maxWidth=this.builder.blockCodeEditorMaxWidth,l.style.height=this.builder.blockCodeEditorHeight),n.showModal(s,!0,(()=>{i&&(i.removeAttribute("data-focus"),i.focus())})),i&&i.setAttribute("data-focus",!0),this._view(t,e)}_view(t,e){const i=this.builder.util,n=this.builder.builderStuff;let o;if(this.builder.opts.htmlSyntaxHighlighting){o=n.querySelector(".viewhtmlmonaco");let i=o.querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return gs.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditor=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""}));let e=o.querySelector("textarea");this.builder.codeEditor.onDidChangeModelContent((()=>{e.value=this.builder.codeEditor.getModel().getValue()}))})),void setTimeout((()=>{this._view(t,e)}),100)}else o=n.querySelector(".viewhtml");let s=o.querySelector("textarea");if("cell"===t){const t=i.cellSelected();if(!t)return;let e=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,e.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1}if("row"===t){let t,e=i.cellSelected();if(t=e?e.parentNode:i.rowSelected(),!t)return;let n=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,n.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1,vs.removeClass(t,"row-outline")}if("full"===t){if(e);else{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);if(t.length>1){const n=i.cellSelected();e=n?n.parentNode.parentNode:t[0]}else e=t[0];if(""!==this.builder.opts.page){const t=this.builder.doc.querySelector(this.builder.opts.page);t&&(e=t)}}let t=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,this.builder.shortenHTML?t.value=this.readHtml(e,!0):t.value=this.readHtml(e,!1),this.builder.cleanHtmlFormatting=!1}if(this.builder.opts.htmlSyntaxHighlighting){const t=this.builder.monaco.editor.createModel(s.value,"html");this.builder.codeEditor.setModel(t)}let a=n.querySelector(".is-pop.columnmore");a&&(a.style.display="");let l=n.querySelector(".is-pop.rowmore");l&&(l.style.display=""),this.builder.codeEditorMode=t,this.builder.codeEditorArea=e,o.querySelector(".input-code-editor").style.opacity=""}fromViewToActual(t){for(var e in fs)t=t.replace(e,fs[e]);return t}readHtml(t,e,i,n){if(this.builder.opts.absolutePath){let e=t.querySelectorAll("a");Array.prototype.forEach.call(e,(t=>{let e=t.href;t.setAttribute("href",e)}));let i=t.querySelectorAll("img");Array.prototype.forEach.call(i,(t=>{let e=t.src;t.setAttribute("src",e)}))}this.builder.cleanHtmlFormatting;const o=this.builder.util;let s,a=document.createElement("div");a.innerHTML=t.innerHTML;let l=a.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(l,(t=>{let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{if(i.closest(".glide__slide--clone"))return;let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}))})),l=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(l,(t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,o.makeId()),t.innerHTML=e;let i=t.querySelectorAll("[data-subblock]");var n=1;Array.prototype.forEach.call(i,(e=>{e.innerHTML=void 0===t.getAttribute("data-html-"+n)?"":decodeURIComponent(t.getAttribute("data-html-"+n)),n++}))})),e&&(fs={},l=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(l,(t=>{let e=o.makeId();fs[e]=t.getAttribute("data-html"),t.setAttribute("data-html",e);for(let i=1;i<=20;i++)void 0!==t.getAttribute("data-html-"+i)&&(e=o.makeId(),fs[e]=t.getAttribute("data-html-"+i),t.getAttribute("data-html-"+i,e));void 0!==t.getAttribute("data-settings")&&(e=o.makeId(),fs[e]=t.getAttribute("data-settings"),t.getAttribute("data-settings",e))}))),this.builder.makeAbsolute){const t=t=>{let e=document.createElement("img");return e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl")},e=t=>{let e=document.createElement("img");e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl");let i=window.location.href.substring(0,window.location.href.lastIndexOf("/"));return t.replace(i,"[%PATH%]")},i=(e,i)=>{if(e.hasAttribute(i)){if("video"!==e.parentNode.tagName.toLowerCase()&&"audio"!==e.parentNode.tagName.toLowerCase())return;let n=e.getAttribute(i);n=t(n),e.setAttribute(i,`${n}`)}};let n=a.querySelectorAll("img");Array.prototype.forEach.call(n,(t=>{let e=t.src;t.setAttribute("src",e)})),a.querySelectorAll("*").forEach((n=>{if(n.style.backgroundImage){let t=n.style.backgroundImage;if(-1!==t.indexOf("url(")){let i=t.slice(4,-1).replace(/["']/g,"");i=e(i),n.style.backgroundImage=`url(${i})`}}if(i(n,"src"),i(n,"data-default"),i(n,"data-240"),i(n,"data-360"),i(n,"data-480"),i(n,"data-540"),i(n,"data-720"),i(n,"data-1080"),i(n,"data-1440"),i(n,"data-2160"),n.hasAttribute("href")&&"link"===n.tagName.toLowerCase()){let e=n.getAttribute("href");e=t(e),n.setAttribute("href",`${e}`)}}))}let r=a.querySelectorAll(".is-builder");Array.prototype.forEach.call(r,(t=>{t.style.transform="",t.style.WebkitTransform="",t.style.MozTransform="",t.removeAttribute("data-sort"),vs.removeClass(t,"builder-active");vs.elementChildren(t).forEach((t=>{vs.elementChildren(t).forEach((t=>{t.style.cursor=""}))}))}));vs.elementChildren(a).forEach((t=>{t.style.cursor="";vs.elementChildren(t).forEach((t=>{t.style.cursor=""}))}));let c=a.querySelectorAll(".sortable-chosen");vs.removeClasses(c,"sortable-chosen"),c=a.querySelectorAll(".sortable-ghost"),vs.removeClasses(c,"sortable-ghost"),c=a.querySelectorAll(".elm-active"),vs.removeClasses(c,"elm-active"),c=a.querySelectorAll(".elm-inspected"),vs.removeClasses(c,"elm-inspected"),c=a.querySelectorAll(".cell-active"),vs.removeClasses(c,"cell-active"),c=a.querySelectorAll(".row-active"),vs.removeClasses(c,"row-active"),c=a.querySelectorAll(".row-outline"),vs.removeClasses(c,"row-outline"),c=a.querySelectorAll(".is-builder"),vs.removeClasses(c,"is-builder"),c=a.querySelectorAll(".row-outline"),vs.removeClasses(c,"row-outline"),c=a.querySelectorAll("[data-click]"),vs.removeAttributes(c,"data-click"),c=a.querySelectorAll("[contenteditable]"),vs.removeAttributes(c,"contenteditable"),c=a.querySelectorAll("[draggridoutline]"),vs.removeAttributes(c,"draggridoutline"),c=a.querySelectorAll("[between-blocks-left]"),vs.removeAttributes(c,"between-blocks-left"),c=a.querySelectorAll("[between-blocks-center]"),vs.removeAttributes(c,"between-blocks-center"),c=a.querySelectorAll("[hideelementhighlight]"),vs.removeAttributes(c,"hideelementhighlight"),c=a.querySelectorAll("[data-module-active]"),vs.removeAttributes(c,"data-module-active"),c=a.querySelectorAll("[draggable]"),vs.removeAttributes(c,"draggable"),c=a.querySelectorAll("[data-animated]"),vs.removeAttributes(c,"data-animated"),c=a.querySelectorAll("[data-saveforundo]"),vs.removeAttributes(c,"data-saveforundo"),c=a.querySelectorAll("[hidesnippetaddtool]"),vs.removeAttributes(c,"hidesnippetaddtool"),c=a.querySelectorAll("[gray]"),vs.removeAttributes(c,"gray"),c=a.querySelectorAll("[rowoutline]"),vs.removeAttributes(c,"rowoutline"),c=a.querySelectorAll("[hidecolumntool]"),vs.removeAttributes(c,"hidecolumntool"),c=a.querySelectorAll("[grayoutline]"),vs.removeAttributes(c,"grayoutline"),c=a.querySelectorAll("[hideoutline]"),vs.removeAttributes(c,"hideoutline"),c=a.querySelectorAll("[leftrowtool]"),vs.removeAttributes(c,"leftrowtool"),c=a.querySelectorAll("[minimal]"),vs.removeAttributes(c,"minimal"),c=a.querySelectorAll("[clean]"),vs.removeAttributes(c,"clean"),c=a.querySelectorAll("[grideditor]"),vs.removeAttributes(c,"grideditor"),c=a.querySelectorAll("[gridoutline]"),vs.removeAttributes(c,"gridoutline"),vs.removeElements(a.querySelectorAll(".is-row-tool")),vs.removeElements(a.querySelectorAll(".is-col-tool")),vs.removeElements(a.querySelectorAll(".is-rowadd-tool")),vs.removeElements(a.querySelectorAll(".ovl")),vs.removeElements(a.querySelectorAll(".row-add-initial")),c=a.querySelectorAll(".aos-init"),vs.removeClasses(c,"aos-init"),c=a.querySelectorAll(".aos-animate"),vs.removeClasses(c,"aos-animate"),c=a.querySelectorAll(".skrollable"),vs.removeClasses(c,"skrollable"),c=a.querySelectorAll(".skrollable-after"),vs.removeClasses(c,"skrollable-after"),c=a.querySelectorAll(".skrollable-before"),vs.removeClasses(c,"skrollable-before"),c=a.querySelectorAll(".skrollable-between"),vs.removeClasses(c,"skrollable-between"),c=a.querySelectorAll(".is-inview"),vs.removeClasses(c,"is-inview");let d=a.querySelectorAll('[class=""]');Array.prototype.forEach.call(d,(t=>{t.removeAttribute("class")}));let u=a.querySelectorAll(".is-row-overlay");Array.prototype.forEach.call(u,(t=>{t.hasAttribute("style")||t.parentNode.removeChild(t)})),vs.removeEmptyStyle(a),c=a.querySelectorAll("[data-keep]"),vs.removeAttributes(c,"data-keep");let p=a.querySelectorAll("a");if(Array.prototype.forEach.call(p,(t=>{"inline-block"===t.style.display&&1===t.parentNode.childElementCount&&"span"===t.parentNode.tagName.toLowerCase()&&(t.parentNode.outerHTML=t.parentNode.innerHTML)})),n){a.querySelectorAll("[data-html]").forEach((t=>{t.innerHTML=""}))}if(s="",i){let t=a.querySelectorAll(".is-dummy");vs.removeElements(t),t=a.querySelectorAll("[data-scroll]"),vs.removeAttributes(t,"data-scroll"),t=a.querySelectorAll("[data-scroll-once]"),vs.removeAttributes(t,"data-scroll-once"),this.builder.shortenOutput&&(t=a.querySelectorAll("[data-noedit]"),vs.removeAttributes(t,"data-noedit"),t=a.querySelectorAll("[data-module]"),vs.removeAttributes(t,"data-module"),t=a.querySelectorAll("[data-module-desc]"),vs.removeAttributes(t,"data-module-desc"),t=a.querySelectorAll("[data-dialog-width]"),vs.removeAttributes(t,"data-dialog-width"),t=a.querySelectorAll("[data-dialog-height]"),vs.removeAttributes(t,"data-dialog-height"),t=a.querySelectorAll("[data-html]"),vs.removeAttributes(t,"data-html"),t=a.querySelectorAll("[data-settings]"),vs.removeAttributes(t,"data-settings"),t=a.querySelectorAll("[data-html-1]"),vs.removeAttributes(t,"data-html-1"),t=a.querySelectorAll("[data-html-2]"),vs.removeAttributes(t,"data-html-2"),t=a.querySelectorAll("[data-html-3]"),vs.removeAttributes(t,"data-html-3"),t=a.querySelectorAll("[data-html-4]"),vs.removeAttributes(t,"data-html-4"),t=a.querySelectorAll("[data-html-5]"),vs.removeAttributes(t,"data-html-5"),t=a.querySelectorAll("[data-html-6]"),vs.removeAttributes(t,"data-html-6"),t=a.querySelectorAll("[data-html-7]"),vs.removeAttributes(t,"data-html-7"),t=a.querySelectorAll("[data-html-8]"),vs.removeAttributes(t,"data-html-8"),t=a.querySelectorAll("[data-html-9]"),vs.removeAttributes(t,"data-html-9"),t=a.querySelectorAll("[data-html-10]"),vs.removeAttributes(t,"data-html-10"),t=a.querySelectorAll("[data-html-12]"),vs.removeAttributes(t,"data-html-12"),t=a.querySelectorAll("[data-html-13]"),vs.removeAttributes(t,"data-html-13"),t=a.querySelectorAll("[data-html-14]"),vs.removeAttributes(t,"data-html-14"),t=a.querySelectorAll("[data-html-15]"),vs.removeAttributes(t,"data-html-15"),t=a.querySelectorAll("[data-html-16]"),vs.removeAttributes(t,"data-html-16"),t=a.querySelectorAll("[data-html-17]"),vs.removeAttributes(t,"data-html-17"),t=a.querySelectorAll("[data-html-18]"),vs.removeAttributes(t,"data-html-18"),t=a.querySelectorAll("[data-html-19]"),vs.removeAttributes(t,"data-html-19"),t=a.querySelectorAll("[data-html-20]"),vs.removeAttributes(t,"data-html-20"),t=a.querySelectorAll("[data-html-21]"),vs.removeAttributes(t,"data-html-21"),t=a.querySelectorAll("[data-html-21]"),vs.removeAttributes(t,"data-html-21"),t=a.querySelectorAll("[data-html-22]"),vs.removeAttributes(t,"data-html-22"),t=a.querySelectorAll("[data-html-23]"),vs.removeAttributes(t,"data-html-23"),t=a.querySelectorAll("[data-html-24]"),vs.removeAttributes(t,"data-html-24"),t=a.querySelectorAll("[data-html-25]"),vs.removeAttributes(t,"data-html-25")),t=a.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]"),Array.prototype.forEach.call(t,(t=>{t.style.transition="",t.style.transform="",t.style.opacity=""})),t=a.querySelectorAll(".is-animated"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"animated"),vs.removeClass(t,"pulse"),vs.removeClass(t,"bounceIn"),vs.removeClass(t,"fadeIn"),vs.removeClass(t,"fadeOut"),vs.removeClass(t,"fadeInDown"),vs.removeClass(t,"fadeInLeft"),vs.removeClass(t,"fadeInRight"),vs.removeClass(t,"fadeInUp"),vs.removeClass(t,"flipInX"),vs.removeClass(t,"flipInY"),vs.removeClass(t,"slideInUp"),vs.removeClass(t,"slideInDown"),vs.removeClass(t,"slideInLeft"),vs.removeClass(t,"slideInRight"),vs.removeClass(t,"zoomIn"),t.style.animationDelay="",t.style.transitionDelay="",t.style.transitionDuration="",t.style.transitionTimingFunction="",t.style.transitionProperty=""}));let e=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(e,(t=>{t.removeAttribute("style")})),t=a.querySelectorAll(".is-appeared"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"is-appeared")})),t=a.querySelectorAll(".box-active"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"box-active")})),t=a.querySelectorAll(".section-active"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"section-active")})),t=a.querySelectorAll(".section-select"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"section-select")})),t=a.querySelectorAll(".box-select"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"box-select")})),t=a.querySelectorAll(".is-section-tool"),vs.removeElements(t),t=a.querySelectorAll(".is-box-tool"),vs.removeElements(t),t=a.querySelectorAll(".is-box-info"),vs.removeElements(t),t=a.querySelectorAll(".is-section-info"),vs.removeElements(t);var h="",m="",b="";vs.elementChildren(a).forEach((t=>{let e=t;if(vs.hasClass(e,"is-section")){var i="";e.getAttribute("class")&&(i=' class="'+e.getAttribute("class")+'"');var n=e.cloneNode(!0),o=n.outerHTML;s+=o,-1===i.indexOf("is-static")?h+=o+"\n\n":m+=o+"\n\n"}else o=(n=e.cloneNode(!0)).outerHTML,s+=o,b+=o}));let i=document.querySelector("[data-contentbox]"),n=!1;i&&(n=i.settings.disableStaticSection),n||(s=h+m+b),s=a.innerHTML.trim(),s=s.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}else{let t=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(t,(t=>{t.removeAttribute("style")})),this.builder.shortenOutput&&(c=a.querySelectorAll("[data-noedit]"),vs.removeAttributes(c,"data-noedit"),c=a.querySelectorAll("[data-module]"),vs.removeAttributes(c,"data-module"),c=a.querySelectorAll("[data-module-desc]"),vs.removeAttributes(c,"data-module-desc"),c=a.querySelectorAll("[data-dialog-width]"),vs.removeAttributes(c,"data-dialog-width"),c=a.querySelectorAll("[data-dialog-height]"),vs.removeAttributes(c,"data-dialog-height"),c=a.querySelectorAll("[data-html]"),vs.removeAttributes(c,"data-html"),c=a.querySelectorAll("[data-settings]"),vs.removeAttributes(c,"data-settings"),c=a.querySelectorAll("[data-html-1]"),vs.removeAttributes(c,"data-html-1"),c=a.querySelectorAll("[data-html-2]"),vs.removeAttributes(c,"data-html-2"),c=a.querySelectorAll("[data-html-3]"),vs.removeAttributes(c,"data-html-3"),c=a.querySelectorAll("[data-html-4]"),vs.removeAttributes(c,"data-html-4"),c=a.querySelectorAll("[data-html-5]"),vs.removeAttributes(c,"data-html-5"),c=a.querySelectorAll("[data-html-6]"),vs.removeAttributes(c,"data-html-6"),c=a.querySelectorAll("[data-html-7]"),vs.removeAttributes(c,"data-html-7"),c=a.querySelectorAll("[data-html-8]"),vs.removeAttributes(c,"data-html-8"),c=a.querySelectorAll("[data-html-9]"),vs.removeAttributes(c,"data-html-9"),c=a.querySelectorAll("[data-html-10]"),vs.removeAttributes(c,"data-html-10"),c=a.querySelectorAll("[data-html-12]"),vs.removeAttributes(c,"data-html-12"),c=a.querySelectorAll("[data-html-13]"),vs.removeAttributes(c,"data-html-13"),c=a.querySelectorAll("[data-html-14]"),vs.removeAttributes(c,"data-html-14"),c=a.querySelectorAll("[data-html-15]"),vs.removeAttributes(c,"data-html-15"),c=a.querySelectorAll("[data-html-16]"),vs.removeAttributes(c,"data-html-16"),c=a.querySelectorAll("[data-html-17]"),vs.removeAttributes(c,"data-html-17"),c=a.querySelectorAll("[data-html-18]"),vs.removeAttributes(c,"data-html-18"),c=a.querySelectorAll("[data-html-19]"),vs.removeAttributes(c,"data-html-19"),c=a.querySelectorAll("[data-html-20]"),vs.removeAttributes(c,"data-html-20"),c=a.querySelectorAll("[data-html-21]"),vs.removeAttributes(c,"data-html-21"),c=a.querySelectorAll("[data-html-21]"),vs.removeAttributes(c,"data-html-21"),c=a.querySelectorAll("[data-html-22]"),vs.removeAttributes(c,"data-html-22"),c=a.querySelectorAll("[data-html-23]"),vs.removeAttributes(c,"data-html-23"),c=a.querySelectorAll("[data-html-24]"),vs.removeAttributes(c,"data-html-24"),c=a.querySelectorAll("[data-html-25]"),vs.removeAttributes(c,"data-html-25")),s=a.innerHTML.trim(),s=s.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}let g=Io.html;return s=g(s),s=s.replace(/(\r\n|\r|\n){3,}/g,"$1\n"),s}beautify(t){return t=(t=(0,Io.html)(t)).replace(/(\r\n|\r|\n){3,}/g,"$1\n")}}class xs{constructor(t){this.builder=t;const e=this.builder.dom;this.dom=e,this.undoList=[]}readStyles(){if(this.builder.opts.undoContainerOnly)return"";let t,e,i="",n=this.builder.doc.getElementsByTagName("link");for(t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")&&(i+=n[t].outerHTML);for(n=this.builder.doc.getElementsByTagName("link"),t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")||-1!==e.indexOf("type-")&&(i+=n[t].outerHTML);return i}writeStyles(t){const e=this.dom;if(this.builder.opts.undoContainerOnly)return;let i,n,o=this.builder.doc.getElementsByTagName("link");for(i=0;i<o.length;i++)n=o[i].href.toLowerCase(),(-1!==n.indexOf("basetype-")||-1!==n.indexOf("type-"))&&o[i].parentNode.removeChild(o[i]);let s=this.builder.doc.getElementsByTagName("head")[0];e.appendHtml(s,t)}readHtml(){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);let e="";return Array.prototype.forEach.call(t,(t=>{e+=t.innerHTML+"####|####"})),e=e.substr(0,e.length-9),e}return this.builder.doc.querySelector(this.builder.opts.page).innerHTML}cleaning(t){const e=this.dom;let i=t.querySelectorAll(".is-builder");Array.prototype.forEach.call(i,(t=>{t.removeAttribute("data-sort")}));let n=t.querySelectorAll("[data-click]");e.removeAttributes(n,"data-click"),e.removeElements(t.querySelectorAll(".is-row-tool")),e.removeElements(t.querySelectorAll(".is-rowadd-tool")),e.removeElements(t.querySelectorAll(".is-col-tool")),e.removeElements(t.querySelectorAll(".ovl")),e.removeElements(t.querySelectorAll(".row-add-initial")),n=t.querySelectorAll(".is-section-tool"),e.removeElements(n)}writeHtml(t){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){const e=this.builder.doc.querySelectorAll(this.builder.opts.container);let i=0;Array.prototype.forEach.call(e,(e=>{var n=document.createRange();e.innerHTML="",e.appendChild(n.createContextualFragment(t.split("####|####")[i])),this.cleaning(e),this.builder.applyBehaviorOn(e),i++}))}else{let i=this.builder.doc.querySelector(this.builder.opts.page);var e=document.createRange();i.innerHTML="",i.appendChild(e.createContextualFragment(t)),this.cleaning(i)}this.builder.opts.onRender()}saveForUndo(t){if(this.builder.onBeforeSaveForUndo&&this.builder.onBeforeSaveForUndo(),this.builder.undoRedoStyles){if(this.undoList[120]){let e=this.undoList[120][0].split("###$###")[1];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}}else if(this.undoList[120]){let e=this.undoList[120][0];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}if(this.builder.saveForUndoCheck=!0===t,this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=" "+this.readStyles()+"###$###"+this.readHtml();this.undoList[120]=[t,null]}else this.undoList[120]=[this.readHtml(),null]}doUndo(){const t=this.dom;if(!this.undoList[120])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[99]=this.undoList[100],this.undoList[100]=this.undoList[101],this.undoList[101]=this.undoList[102],this.undoList[102]=this.undoList[103],this.undoList[103]=this.undoList[104],this.undoList[104]=this.undoList[105],this.undoList[105]=this.undoList[106],this.undoList[106]=this.undoList[107],this.undoList[107]=this.undoList[108],this.undoList[108]=this.undoList[109],this.undoList[109]=this.undoList[110],this.undoList[110]=this.undoList[111],this.undoList[111]=this.undoList[112],this.undoList[112]=this.undoList[113],this.undoList[113]=this.undoList[114],this.undoList[114]=this.undoList[115],this.undoList[115]=this.undoList[116],this.undoList[116]=this.undoList[117],this.undoList[117]=this.undoList[118],this.undoList[118]=this.undoList[119],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[119]=[i,null],i=this.undoList[120][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[119]=[this.readHtml(),null];let t=this.undoList[120][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[120]=this.undoList[121],this.undoList[121]=this.undoList[122],this.undoList[122]=this.undoList[123],this.undoList[123]=this.undoList[124],this.undoList[124]=this.undoList[125],this.undoList[125]=this.undoList[126],this.undoList[126]=this.undoList[127],this.undoList[127]=this.undoList[128],this.undoList[128]=this.undoList[129],this.undoList[129]=this.undoList[130],this.undoList[130]=this.undoList[131],this.undoList[131]=this.undoList[132],this.undoList[132]=this.undoList[133],this.undoList[133]=this.undoList[134],this.undoList[134]=this.undoList[135],this.undoList[135]=this.undoList[136],this.undoList[136]=this.undoList[137],this.undoList[137]=this.undoList[138],this.undoList[138]=this.undoList[139],this.undoList[139]=this.undoList[140],this.undoList[140]=this.undoList[141];const e=new He(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onUndo&&this.builder.opts.onUndo(),this.builder.undoRedoInProcess=!1}doRedo(){const t=this.dom;if(!this.undoList[119])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[141]=this.undoList[140],this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[120]=[i,null],i=this.undoList[119][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[120]=[this.readHtml(),null];let t=this.undoList[119][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[119]=this.undoList[118],this.undoList[118]=this.undoList[117],this.undoList[117]=this.undoList[116],this.undoList[116]=this.undoList[115],this.undoList[115]=this.undoList[114],this.undoList[114]=this.undoList[113],this.undoList[113]=this.undoList[112],this.undoList[112]=this.undoList[111],this.undoList[111]=this.undoList[110],this.undoList[110]=this.undoList[109],this.undoList[109]=this.undoList[108],this.undoList[108]=this.undoList[107],this.undoList[107]=this.undoList[106],this.undoList[106]=this.undoList[105],this.undoList[105]=this.undoList[104],this.undoList[104]=this.undoList[103],this.undoList[103]=this.undoList[102],this.undoList[102]=this.undoList[101],this.undoList[101]=this.undoList[100],this.undoList[100]=this.undoList[99],this.undoList[99]=null;const e=new He(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onRedo&&this.builder.opts.onRedo(),this.builder.undoRedoInProcess=!1}}
20
+ */function O(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function I(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?O(Object(i),!0).forEach((function(e){R(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):O(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function $(t){return $="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)}function R(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function B(){return B=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},B.apply(this,arguments)}function P(t,e){if(null==t)return{};var i,n,o=function(t,e){if(null==t)return{};var i,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function N(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var z=N(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),D=N(/Edge/i),H=N(/firefox/i),j=N(/safari/i)&&!N(/chrome/i)&&!N(/android/i),F=N(/iP(ad|od|hone)/i),U=N(/chrome/i)&&N(/android/i),W={capture:!1,passive:!1};function Y(t,e,i){t.addEventListener(e,i,!z&&W)}function G(t,e,i){t.removeEventListener(e,i,!z&&W)}function X(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function V(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function K(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&X(t,e):X(t,e))||n&&t===i)return t;if(t===i)break}while(t=V(t))}return null}var Z,Q=/\s+/g;function J(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(Q," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(Q," ")}}function tt(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function et(t,e){var i="";if("string"==typeof t)i=t;else do{var n=tt(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(i)}function it(t,e,i){if(t){var n=t.getElementsByTagName(e),o=0,s=n.length;if(i)for(;o<s;o++)i(n[o],o);return n}return[]}function nt(){var t=document.scrollingElement;return t||document.documentElement}function ot(t,e,i,n,o){if(t.getBoundingClientRect||t===window){var s,a,l,r,c,d,u;if(t!==window&&t.parentNode&&t!==nt()?(a=(s=t.getBoundingClientRect()).top,l=s.left,r=s.bottom,c=s.right,d=s.height,u=s.width):(a=0,l=0,r=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||i)&&t!==window&&(o=o||t.parentNode,!z))do{if(o&&o.getBoundingClientRect&&("none"!==tt(o,"transform")||i&&"static"!==tt(o,"position"))){var p=o.getBoundingClientRect();a-=p.top+parseInt(tt(o,"border-top-width")),l-=p.left+parseInt(tt(o,"border-left-width")),r=a+s.height,c=l+s.width;break}}while(o=o.parentNode);if(n&&t!==window){var h=et(o||t),m=h&&h.a,b=h&&h.d;h&&(r=(a/=b)+(d/=b),c=(l/=m)+(u/=m))}return{top:a,left:l,bottom:r,right:c,width:u,height:d}}}function st(t,e,i){for(var n=dt(t,!0),o=ot(t)[e];n;){var s=ot(n)[i];if(!("top"===i||"left"===i?o>=s:o<=s))return n;if(n===nt())break;n=dt(n,!1)}return!1}function at(t,e,i,n){for(var o=0,s=0,a=t.children;s<a.length;){if("none"!==a[s].style.display&&a[s]!==he.ghost&&(n||a[s]!==he.dragged)&&K(a[s],i.draggable,t,!1)){if(o===e)return a[s];o++}s++}return null}function lt(t,e){for(var i=t.lastElementChild;i&&(i===he.ghost||"none"===tt(i,"display")||e&&!X(i,e));)i=i.previousElementSibling;return i||null}function rt(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===he.clone||e&&!X(t,e)||i++;return i}function ct(t){var e=0,i=0,n=nt();if(t)do{var o=et(t),s=o.a,a=o.d;e+=t.scrollLeft*s,i+=t.scrollTop*a}while(t!==n&&(t=t.parentNode));return[e,i]}function dt(t,e){if(!t||!t.getBoundingClientRect)return nt();var i=t,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var o=tt(i);if(i.clientWidth<i.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!i.getBoundingClientRect||i===document.body)return nt();if(n||e)return i;n=!0}}}while(i=i.parentNode);return nt()}function ut(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function pt(t,e){return function(){if(!Z){var i=arguments,n=this;1===i.length?t.call(n,i[0]):t.apply(n,i),Z=setTimeout((function(){Z=void 0}),e)}}}function ht(t,e,i){t.scrollLeft+=e,t.scrollTop+=i}function mt(t){var e=window.Polymer,i=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):i?i(t).clone(!0)[0]:t.cloneNode(!0)}var bt="Sortable"+(new Date).getTime();function gt(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==tt(t,"display")&&t!==he.ghost){e.push({target:t,rect:ot(t)});var i=I({},e[e.length-1].rect);if(t.thisAnimationDuration){var n=et(t,!0);n&&(i.top-=n.f,i.left-=n.e)}t.fromRect=i}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var i in t)if(t.hasOwnProperty(i))for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[i][n])return Number(i);return-1}(e,{target:t}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof i&&i());var o=!1,s=0;e.forEach((function(t){var e=0,i=t.target,a=i.fromRect,l=ot(i),r=i.prevFromRect,c=i.prevToRect,d=t.rect,u=et(i,!0);u&&(l.top-=u.f,l.left-=u.e),i.toRect=l,i.thisAnimationDuration&&ut(r,l)&&!ut(a,l)&&(d.top-l.top)/(d.left-l.left)==(a.top-l.top)/(a.left-l.left)&&(e=function(t,e,i,n){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))*n.animation}(d,r,c,n.options)),ut(l,a)||(i.prevFromRect=a,i.prevToRect=l,e||(e=n.options.animation),n.animate(i,d,l,e)),e&&(o=!0,s=Math.max(s,e),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout((function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null}),e),i.thisAnimationDuration=e)})),clearTimeout(t),o?t=setTimeout((function(){"function"==typeof i&&i()}),s):"function"==typeof i&&i(),e=[]},animate:function(t,e,i,n){if(n){tt(t,"transition",""),tt(t,"transform","");var o=et(this.el),s=o&&o.a,a=o&&o.d,l=(e.left-i.left)/(s||1),r=(e.top-i.top)/(a||1);t.animatingX=!!l,t.animatingY=!!r,tt(t,"transform","translate3d("+l+"px,"+r+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),tt(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),tt(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){tt(t,"transition",""),tt(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),n)}}}}var vt=[],ft={initializeByDefault:!0},yt={mount:function(t){for(var e in ft)ft.hasOwnProperty(e)&&!(e in t)&&(t[e]=ft[e]);vt.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),vt.push(t)},pluginEvent:function(t,e,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var o=t+"Global";vt.forEach((function(n){e[n.pluginName]&&(e[n.pluginName][o]&&e[n.pluginName][o](I({sortable:e},i)),e.options[n.pluginName]&&e[n.pluginName][t]&&e[n.pluginName][t](I({sortable:e},i)))}))},initializePlugins:function(t,e,i,n){for(var o in vt.forEach((function(n){var o=n.pluginName;if(t.options[o]||n.initializeByDefault){var s=new n(t,e,t.options);s.sortable=t,s.options=t.options,t[o]=s,B(i,s.defaults)}})),t.options)if(t.options.hasOwnProperty(o)){var s=this.modifyOption(t,o,t.options[o]);void 0!==s&&(t.options[o]=s)}},getEventProperties:function(t,e){var i={};return vt.forEach((function(n){"function"==typeof n.eventProperties&&B(i,n.eventProperties.call(e[n.pluginName],t))})),i},modifyOption:function(t,e,i){var n;return vt.forEach((function(o){t[o.pluginName]&&o.optionListeners&&"function"==typeof o.optionListeners[e]&&(n=o.optionListeners[e].call(t[o.pluginName],i))})),n}};var xt=["evt"],_t=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,o=P(i,xt);yt.pluginEvent.bind(he)(t,e,I({dragEl:St,parentEl:kt,ghostEl:Ct,rootEl:Lt,nextEl:At,lastDownEl:Et,cloneEl:qt,cloneHidden:Tt,dragStarted:Ft,putSortable:Bt,activeSortable:he.active,originalEvent:n,oldIndex:Mt,oldDraggableIndex:It,newIndex:Ot,newDraggableIndex:$t,hideGhostForTarget:ce,unhideGhostForTarget:de,cloneNowHidden:function(){Tt=!0},cloneNowShown:function(){Tt=!1},dispatchSortableEvent:function(t){wt({sortable:e,name:t,originalEvent:n})}},o))};function wt(t){!function(t){var e=t.sortable,i=t.rootEl,n=t.name,o=t.targetEl,s=t.cloneEl,a=t.toEl,l=t.fromEl,r=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,u=t.newDraggableIndex,p=t.originalEvent,h=t.putSortable,m=t.extraEventProperties;if(e=e||i&&i[bt]){var b,g=e.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||z||D?(b=document.createEvent("Event")).initEvent(n,!0,!0):b=new CustomEvent(n,{bubbles:!0,cancelable:!0}),b.to=a||i,b.from=l||i,b.item=o||i,b.clone=s,b.oldIndex=r,b.newIndex=c,b.oldDraggableIndex=d,b.newDraggableIndex=u,b.originalEvent=p,b.pullMode=h?h.lastPutMode:void 0;var f=I(I({},m),yt.getEventProperties(n,e));for(var y in f)b[y]=f[y];i&&i.dispatchEvent(b),g[v]&&g[v].call(e,b)}}(I({putSortable:Bt,cloneEl:qt,targetEl:St,rootEl:Lt,oldIndex:Mt,oldDraggableIndex:It,newIndex:Ot,newDraggableIndex:$t},t))}var St,kt,Ct,Lt,At,Et,qt,Tt,Mt,Ot,It,$t,Rt,Bt,Pt,Nt,zt,Dt,Ht,jt,Ft,Ut,Wt,Yt,Gt,Xt=!1,Vt=!1,Kt=[],Zt=!1,Qt=!1,Jt=[],te=!1,ee=[],ie="undefined"!=typeof document,ne=F,oe=D||z?"cssFloat":"float",se=ie&&!U&&!F&&"draggable"in document.createElement("div"),ae=function(){if(ie){if(z)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),le=function(t,e){var i=tt(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=at(t,0,e),s=at(t,1,e),a=o&&tt(o),l=s&&tt(s),r=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ot(o).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ot(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&"none"!==a.float){var d="left"===a.float?"left":"right";return!s||"both"!==l.clear&&l.clear!==d?"horizontal":"vertical"}return o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||r>=n&&"none"===i[oe]||s&&"none"===i[oe]&&r+c>n)?"vertical":"horizontal"},re=function(t){function e(t,i){return function(n,o,s,a){var l=n.options.group.name&&o.options.group.name&&n.options.group.name===o.options.group.name;if(null==t&&(i||l))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,o,s,a),i)(n,o,s,a);var r=(i?n:o).options.group.name;return!0===t||"string"==typeof t&&t===r||t.join&&t.indexOf(r)>-1}}var i={},n=t.group;n&&"object"==$(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},ce=function(){!ae&&Ct&&tt(Ct,"display","none")},de=function(){!ae&&Ct&&tt(Ct,"display","")};ie&&!U&&document.addEventListener("click",(function(t){if(Vt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Vt=!1,!1}),!0);var ue=function(t){if(St){t=t.touches?t.touches[0]:t;var e=(o=t.clientX,s=t.clientY,Kt.some((function(t){var e=t[bt].options.emptyInsertThreshold;if(e&&!lt(t)){var i=ot(t),n=o>=i.left-e&&o<=i.right+e,l=s>=i.top-e&&s<=i.bottom+e;return n&&l?a=t:void 0}})),a);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[bt]._onDragOver(i)}}var o,s,a},pe=function(t){St&&St.parentNode[bt]._isOutsideThisEl(t.target)};function he(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=B({},e),t[bt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return le(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==he.supportPointer&&"PointerEvent"in window&&!j,emptyInsertThreshold:5};for(var n in yt.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var o in re(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&se,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Y(t,"pointerdown",this._onTapStart):(Y(t,"mousedown",this._onTapStart),Y(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Y(t,"dragover",this),Y(t,"dragenter",this)),Kt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),B(this,gt())}function me(t,e,i,n,o,s,a,l){var r,c,d=t[bt],u=d.options.onMove;return!window.CustomEvent||z||D?(r=document.createEvent("Event")).initEvent("move",!0,!0):r=new CustomEvent("move",{bubbles:!0,cancelable:!0}),r.to=e,r.from=t,r.dragged=i,r.draggedRect=n,r.related=o||e,r.relatedRect=s||ot(e),r.willInsertAfter=l,r.originalEvent=a,t.dispatchEvent(r),u&&(c=u.call(d,r,a)),c}function be(t){t.draggable=!1}function ge(){te=!1}function ve(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function fe(t){return setTimeout(t,0)}function ye(t){return clearTimeout(t)}he.prototype={constructor:he,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Ut=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,St):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,o=n.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,r=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=n.filter;if(function(t){ee.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&ee.push(n)}}(i),!St&&!(/mousedown|pointerdown/.test(s)&&0!==t.button||n.disabled)&&!r.isContentEditable&&(this.nativeDraggable||!j||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=K(l,n.draggable,i,!1))&&l.animated||Et===l)){if(Mt=rt(l),It=rt(l,n.draggable),"function"==typeof c){if(c.call(this,t,l,this))return wt({sortable:e,rootEl:r,name:"filter",targetEl:l,toEl:i,fromEl:i}),_t("filter",e,{evt:t}),void(o&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(n){if(n=K(r,n.trim(),i,!1))return wt({sortable:e,rootEl:n,name:"filter",targetEl:l,fromEl:i,toEl:i}),_t("filter",e,{evt:t}),!0}))))return void(o&&t.cancelable&&t.preventDefault());n.handle&&!K(r,n.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,i){var n,o=this,s=o.el,a=o.options,l=s.ownerDocument;if(i&&!St&&i.parentNode===s){var r=ot(i);if(Lt=s,kt=(St=i).parentNode,At=St.nextSibling,Et=i,Rt=a.group,he.dragged=St,Pt={target:St,clientX:(e||t).clientX,clientY:(e||t).clientY},Ht=Pt.clientX-r.left,jt=Pt.clientY-r.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,St.style["will-change"]="all",n=function(){_t("delayEnded",o,{evt:t}),he.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!H&&o.nativeDraggable&&(St.draggable=!0),o._triggerDragStart(t,e),wt({sortable:o,name:"choose",originalEvent:t}),J(St,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){it(St,t.trim(),be)})),Y(l,"dragover",ue),Y(l,"mousemove",ue),Y(l,"touchmove",ue),Y(l,"mouseup",o._onDrop),Y(l,"touchend",o._onDrop),Y(l,"touchcancel",o._onDrop),H&&this.nativeDraggable&&(this.options.touchStartThreshold=4,St.draggable=!0),_t("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(D||z))n();else{if(he.eventCanceled)return void this._onDrop();Y(l,"mouseup",o._disableDelayedDrag),Y(l,"touchend",o._disableDelayedDrag),Y(l,"touchcancel",o._disableDelayedDrag),Y(l,"mousemove",o._delayedDragTouchMoveHandler),Y(l,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&Y(l,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(n,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){St&&be(St),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;G(t,"mouseup",this._disableDelayedDrag),G(t,"touchend",this._disableDelayedDrag),G(t,"touchcancel",this._disableDelayedDrag),G(t,"mousemove",this._delayedDragTouchMoveHandler),G(t,"touchmove",this._delayedDragTouchMoveHandler),G(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Y(document,"pointermove",this._onTouchMove):Y(document,e?"touchmove":"mousemove",this._onTouchMove):(Y(St,"dragend",this),Y(Lt,"dragstart",this._onDragStart));try{document.selection?fe((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Xt=!1,Lt&&St){_t("dragStarted",this,{evt:e}),this.nativeDraggable&&Y(document,"dragover",pe);var i=this.options;!t&&J(St,i.dragClass,!1),J(St,i.ghostClass,!0),he.active=this,t&&this._appendGhost(),wt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Nt){this._lastX=Nt.clientX,this._lastY=Nt.clientY,ce();for(var t=document.elementFromPoint(Nt.clientX,Nt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Nt.clientX,Nt.clientY))!==e;)e=t;if(St.parentNode[bt]._isOutsideThisEl(t),e)do{if(e[bt]){if(e[bt]._onDragOver({clientX:Nt.clientX,clientY:Nt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);de()}},_onTouchMove:function(t){if(Pt){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,o=t.touches?t.touches[0]:t,s=Ct&&et(Ct,!0),a=Ct&&s&&s.a,l=Ct&&s&&s.d,r=ne&&Gt&&ct(Gt),c=(o.clientX-Pt.clientX+n.x)/(a||1)+(r?r[0]-Jt[0]:0)/(a||1),d=(o.clientY-Pt.clientY+n.y)/(l||1)+(r?r[1]-Jt[1]:0)/(l||1);if(!he.active&&!Xt){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(Ct){s?(s.e+=c-(zt||0),s.f+=d-(Dt||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");tt(Ct,"webkitTransform",u),tt(Ct,"mozTransform",u),tt(Ct,"msTransform",u),tt(Ct,"transform",u),zt=c,Dt=d,Nt=o}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Ct){var t=this.options.fallbackOnBody?document.body:Lt,e=ot(St,!0,ne,!0,t),i=this.options;if(ne){for(Gt=t;"static"===tt(Gt,"position")&&"none"===tt(Gt,"transform")&&Gt!==document;)Gt=Gt.parentNode;Gt!==document.body&&Gt!==document.documentElement?(Gt===document&&(Gt=nt()),e.top+=Gt.scrollTop,e.left+=Gt.scrollLeft):Gt=nt(),Jt=ct(Gt)}J(Ct=St.cloneNode(!0),i.ghostClass,!1),J(Ct,i.fallbackClass,!0),J(Ct,i.dragClass,!0),tt(Ct,"transition",""),tt(Ct,"transform",""),tt(Ct,"box-sizing","border-box"),tt(Ct,"margin",0),tt(Ct,"top",e.top),tt(Ct,"left",e.left),tt(Ct,"width",e.width),tt(Ct,"height",e.height),tt(Ct,"opacity","0.8"),tt(Ct,"position",ne?"absolute":"fixed"),tt(Ct,"zIndex","100000"),tt(Ct,"pointerEvents","none"),he.ghost=Ct,t.appendChild(Ct),tt(Ct,"transform-origin",Ht/parseInt(Ct.style.width)*100+"% "+jt/parseInt(Ct.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,n=t.dataTransfer,o=i.options;_t("dragStart",this,{evt:t}),he.eventCanceled?this._onDrop():(_t("setupClone",this),he.eventCanceled||((qt=mt(St)).removeAttribute("id"),qt.draggable=!1,qt.style["will-change"]="",this._hideClone(),J(qt,this.options.chosenClass,!1),he.clone=qt),i.cloneId=fe((function(){_t("clone",i),he.eventCanceled||(i.options.removeCloneOnHide||Lt.insertBefore(qt,St),i._hideClone(),wt({sortable:i,name:"clone"}))})),!e&&J(St,o.dragClass,!0),e?(Vt=!0,i._loopId=setInterval(i._emulateDragOver,50)):(G(document,"mouseup",i._onDrop),G(document,"touchend",i._onDrop),G(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",o.setData&&o.setData.call(i,n,St)),Y(document,"drop",i),tt(St,"transform","translateZ(0)")),Xt=!0,i._dragStartId=fe(i._dragStarted.bind(i,e,t)),Y(document,"selectstart",i),Ft=!0,j&&tt(document.body,"user-select","none"))},_onDragOver:function(t){var e,i,n,o,s=this.el,a=t.target,l=this.options,r=l.group,c=he.active,d=Rt===r,u=l.sort,p=Bt||c,h=this,m=!1;if(!te){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),a=K(a,l.draggable,s,!0),q("dragOver"),he.eventCanceled)return m;if(St.contains(t.target)||a.animated&&a.animatingX&&a.animatingY||h._ignoreWhileAnimating===a)return M(!1);if(Vt=!1,c&&!l.disabled&&(d?u||(n=kt!==Lt):Bt===this||(this.lastPutMode=Rt.checkPull(this,c,St,t))&&r.checkPut(this,c,St,t))){if(o="vertical"===this._getDirection(t,a),e=ot(St),q("dragOverValid"),he.eventCanceled)return m;if(n)return kt=Lt,T(),this._hideClone(),q("revert"),he.eventCanceled||(At?Lt.insertBefore(St,At):Lt.appendChild(St)),M(!0);var b=lt(s,l.draggable);if(!b||function(t,e,i){var n=ot(lt(i.el,i.options.draggable)),o=10;return e?t.clientX>n.right+o||t.clientX<=n.right&&t.clientY>n.bottom&&t.clientX>=n.left:t.clientX>n.right&&t.clientY>n.top||t.clientX<=n.right&&t.clientY>n.bottom+o}(t,o,this)&&!b.animated){if(b===St)return M(!1);if(b&&s===t.target&&(a=b),a&&(i=ot(a)),!1!==me(Lt,s,St,e,a,i,t,!!a))return T(),b&&b.nextSibling?s.insertBefore(St,b.nextSibling):s.appendChild(St),kt=s,O(),M(!0)}else if(b&&function(t,e,i){var n=ot(at(i.el,0,i.options,!0)),o=10;return e?t.clientX<n.left-o||t.clientY<n.top&&t.clientX<n.right:t.clientY<n.top-o||t.clientY<n.bottom&&t.clientX<n.left}(t,o,this)){var g=at(s,0,l,!0);if(g===St)return M(!1);if(i=ot(a=g),!1!==me(Lt,s,St,e,a,i,t,!1))return T(),s.insertBefore(St,g),kt=s,O(),M(!0)}else if(a.parentNode===s){i=ot(a);var v,f,y,x=St.parentNode!==s,_=!function(t,e,i){var n=i?t.left:t.top,o=i?t.right:t.bottom,s=i?t.width:t.height,a=i?e.left:e.top,l=i?e.right:e.bottom,r=i?e.width:e.height;return n===a||o===l||n+s/2===a+r/2}(St.animated&&St.toRect||e,a.animated&&a.toRect||i,o),w=o?"top":"left",S=st(a,"top","top")||st(St,"top","top"),k=S?S.scrollTop:void 0;if(Ut!==a&&(f=i[w],Zt=!1,Qt=!_&&l.invertSwap||x),v=function(t,e,i,n,o,s,a,l){var r=n?t.clientY:t.clientX,c=n?i.height:i.width,d=n?i.top:i.left,u=n?i.bottom:i.right,p=!1;if(!a)if(l&&Yt<c*o){if(!Zt&&(1===Wt?r>d+c*s/2:r<u-c*s/2)&&(Zt=!0),Zt)p=!0;else if(1===Wt?r<d+Yt:r>u-Yt)return-Wt}else if(r>d+c*(1-o)/2&&r<u-c*(1-o)/2)return function(t){return rt(St)<rt(t)?1:-1}(e);if((p=p||a)&&(r<d+c*s/2||r>u-c*s/2))return r>d+c/2?1:-1;return 0}(t,a,i,o,_?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Qt,Ut===a),0!==v){var C=rt(St);do{C-=v,y=kt.children[C]}while(y&&("none"===tt(y,"display")||y===Ct))}if(0===v||y===a)return M(!1);Ut=a,Wt=v;var L=a.nextElementSibling,A=!1,E=me(Lt,s,St,e,a,i,t,A=1===v);if(!1!==E)return 1!==E&&-1!==E||(A=1===E),te=!0,setTimeout(ge,30),T(),A&&!L?s.appendChild(St):a.parentNode.insertBefore(St,A?L:a),S&&ht(S,0,k-S.scrollTop),kt=St.parentNode,void 0===f||Qt||(Yt=Math.abs(f-ot(a)[w])),O(),M(!0)}if(s.contains(St))return M(!1)}return!1}function q(l,r){_t(l,h,I({evt:t,isOwner:d,axis:o?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:u,fromSortable:p,target:a,completed:M,onMove:function(i,n){return me(Lt,s,St,e,i,ot(i),t,n)},changed:O},r))}function T(){q("dragOverAnimationCapture"),h.captureAnimationState(),h!==p&&p.captureAnimationState()}function M(e){return q("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(h),h!==p&&(J(St,Bt?Bt.options.ghostClass:c.options.ghostClass,!1),J(St,l.ghostClass,!0)),Bt!==h&&h!==he.active?Bt=h:h===he.active&&Bt&&(Bt=null),p===h&&(h._ignoreWhileAnimating=a),h.animateAll((function(){q("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(a===St&&!St.animated||a===s&&!a.animated)&&(Ut=null),l.dragoverBubble||t.rootEl||a===document||(St.parentNode[bt]._isOutsideThisEl(t.target),!e&&ue(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function O(){Ot=rt(St),$t=rt(St,l.draggable),wt({sortable:h,name:"change",toEl:s,newIndex:Ot,newDraggableIndex:$t,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){G(document,"mousemove",this._onTouchMove),G(document,"touchmove",this._onTouchMove),G(document,"pointermove",this._onTouchMove),G(document,"dragover",ue),G(document,"mousemove",ue),G(document,"touchmove",ue)},_offUpEvents:function(){var t=this.el.ownerDocument;G(t,"mouseup",this._onDrop),G(t,"touchend",this._onDrop),G(t,"pointerup",this._onDrop),G(t,"touchcancel",this._onDrop),G(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;Ot=rt(St),$t=rt(St,i.draggable),_t("drop",this,{evt:t}),kt=St&&St.parentNode,Ot=rt(St),$t=rt(St,i.draggable),he.eventCanceled||(Xt=!1,Qt=!1,Zt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ye(this.cloneId),ye(this._dragStartId),this.nativeDraggable&&(G(document,"drop",this),G(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),j&&tt(document.body,"user-select",""),tt(St,"transform",""),t&&(Ft&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),Ct&&Ct.parentNode&&Ct.parentNode.removeChild(Ct),(Lt===kt||Bt&&"clone"!==Bt.lastPutMode)&&qt&&qt.parentNode&&qt.parentNode.removeChild(qt),St&&(this.nativeDraggable&&G(St,"dragend",this),be(St),St.style["will-change"]="",Ft&&!Xt&&J(St,Bt?Bt.options.ghostClass:this.options.ghostClass,!1),J(St,this.options.chosenClass,!1),wt({sortable:this,name:"unchoose",toEl:kt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Lt!==kt?(Ot>=0&&(wt({rootEl:kt,name:"add",toEl:kt,fromEl:Lt,originalEvent:t}),wt({sortable:this,name:"remove",toEl:kt,originalEvent:t}),wt({rootEl:kt,name:"sort",toEl:kt,fromEl:Lt,originalEvent:t}),wt({sortable:this,name:"sort",toEl:kt,originalEvent:t})),Bt&&Bt.save()):Ot!==Mt&&Ot>=0&&(wt({sortable:this,name:"update",toEl:kt,originalEvent:t}),wt({sortable:this,name:"sort",toEl:kt,originalEvent:t})),he.active&&(null!=Ot&&-1!==Ot||(Ot=Mt,$t=It),wt({sortable:this,name:"end",toEl:kt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){_t("nulling",this),Lt=St=kt=Ct=At=qt=Et=Tt=Pt=Nt=Ft=Ot=$t=Mt=It=Ut=Wt=Bt=Rt=he.dragged=he.ghost=he.clone=he.active=null,ee.forEach((function(t){t.checked=!0})),ee.length=zt=Dt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":St&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,o=i.length,s=this.options;n<o;n++)K(t=i[n],s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||ve(t));return e},sort:function(t,e){var i={},n=this.el;this.toArray().forEach((function(t,e){var o=n.children[e];K(o,this.options.draggable,n,!1)&&(i[t]=o)}),this),e&&this.captureAnimationState(),t.forEach((function(t){i[t]&&(n.removeChild(i[t]),n.appendChild(i[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return K(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(void 0===e)return i[t];var n=yt.modifyOption(this,t,e);i[t]=void 0!==n?n:e,"group"===t&&re(i)},destroy:function(){_t("destroy",this);var t=this.el;t[bt]=null,G(t,"mousedown",this._onTapStart),G(t,"touchstart",this._onTapStart),G(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(G(t,"dragover",this),G(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Kt.splice(Kt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Tt){if(_t("hideClone",this),he.eventCanceled)return;tt(qt,"display","none"),this.options.removeCloneOnHide&&qt.parentNode&&qt.parentNode.removeChild(qt),Tt=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(Tt){if(_t("showClone",this),he.eventCanceled)return;St.parentNode!=Lt||this.options.group.revertClone?At?Lt.insertBefore(qt,At):Lt.appendChild(qt):Lt.insertBefore(qt,St),this.options.group.revertClone&&this.animate(St,qt),tt(qt,"display",""),Tt=!1}}else this._hideClone()}},ie&&Y(document,"touchmove",(function(t){(he.active||Xt)&&t.cancelable&&t.preventDefault()})),he.utils={on:Y,off:G,css:tt,find:it,is:function(t,e){return!!K(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},throttle:pt,closest:K,toggleClass:J,clone:mt,index:rt,nextTick:fe,cancelNextTick:ye,detectDirection:le,getChild:at},he.get=function(t){return t[bt]},he.mount=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e[0].constructor===Array&&(e=e[0]),e.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(he.utils=I(I({},he.utils),t.utils)),yt.mount(t)}))},he.create=function(t,e){return new he(t,e)},he.version="1.15.0";var xe,_e,we,Se,ke,Ce,Le=[],Ae=!1;function Ee(){Le.forEach((function(t){clearInterval(t.pid)})),Le=[]}function qe(){clearInterval(Ce)}var Te=pt((function(t,e,i,n){if(e.scroll){var o,s=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,l=e.scrollSensitivity,r=e.scrollSpeed,c=nt(),d=!1;_e!==i&&(_e=i,Ee(),xe=e.scroll,o=e.scrollFn,!0===xe&&(xe=dt(i,!0)));var u=0,p=xe;do{var h=p,m=ot(h),b=m.top,g=m.bottom,v=m.left,f=m.right,y=m.width,x=m.height,_=void 0,w=void 0,S=h.scrollWidth,k=h.scrollHeight,C=tt(h),L=h.scrollLeft,A=h.scrollTop;h===c?(_=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX||"visible"===C.overflowX),w=x<k&&("auto"===C.overflowY||"scroll"===C.overflowY||"visible"===C.overflowY)):(_=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX),w=x<k&&("auto"===C.overflowY||"scroll"===C.overflowY));var E=_&&(Math.abs(f-s)<=l&&L+y<S)-(Math.abs(v-s)<=l&&!!L),q=w&&(Math.abs(g-a)<=l&&A+x<k)-(Math.abs(b-a)<=l&&!!A);if(!Le[u])for(var T=0;T<=u;T++)Le[T]||(Le[T]={});Le[u].vx==E&&Le[u].vy==q&&Le[u].el===h||(Le[u].el=h,Le[u].vx=E,Le[u].vy=q,clearInterval(Le[u].pid),0==E&&0==q||(d=!0,Le[u].pid=setInterval(function(){n&&0===this.layer&&he.active._onTouchMove(ke);var e=Le[this.layer].vy?Le[this.layer].vy*r:0,i=Le[this.layer].vx?Le[this.layer].vx*r:0;"function"==typeof o&&"continue"!==o.call(he.dragged.parentNode[bt],i,e,t,ke,Le[this.layer].el)||ht(Le[this.layer].el,i,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&p!==c&&(p=dt(p,!1)));Ae=d}}),30),Me=function(t){var e=t.originalEvent,i=t.putSortable,n=t.dragEl,o=t.activeSortable,s=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var r=i||o;a();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(c.clientX,c.clientY);l(),r&&!r.el.contains(d)&&(s("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function Oe(){}function Ie(){}Oe.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=at(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),i&&i.animateAll()},drop:Me},B(Oe,{pluginName:"revertOnSpill"}),Ie.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:Me},B(Ie,{pluginName:"removeOnSpill"}),he.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?Y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Y(document,"pointermove",this._handleFallbackAutoScroll):e.touches?Y(document,"touchmove",this._handleFallbackAutoScroll):Y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?G(document,"dragover",this._handleAutoScroll):(G(document,"pointermove",this._handleFallbackAutoScroll),G(document,"touchmove",this._handleFallbackAutoScroll),G(document,"mousemove",this._handleFallbackAutoScroll)),qe(),Ee(),clearTimeout(Z),Z=void 0},nulling:function(){ke=_e=xe=Ae=Ce=we=Se=null,Le.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var i=this,n=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(n,o);if(ke=t,e||this.options.forceAutoScrollFallback||D||z||j){Te(t,this.options,s,e);var a=dt(s,!0);!Ae||Ce&&n===we&&o===Se||(Ce&&qe(),Ce=setInterval((function(){var s=dt(document.elementFromPoint(n,o),!0);s!==a&&(a=s,Ee()),Te(t,i.options,s,e)}),10),we=n,Se=o)}else{if(!this.options.bubbleScroll||dt(s,!0)===nt())return void Ee();Te(t,this.options,dt(s,!1),!1)}}},B(t,{pluginName:"scroll",initializeByDefault:!0})}),he.mount(Ie,Oe);class $e{constructor(t,e){this.builder=e,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="choices">\n <select class="inp-category">\n </select>\n </div>\n\n <div class="div-blocks">\n\n </div>\n `;t.insertAdjacentHTML("beforeend",n),this.blocks=t.querySelector(".div-blocks");t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()}));const o=this.builder.snippetCategories,s=document.querySelector(".inp-category");o.forEach((t=>{const e=document.createElement("option");e.value=t[0],e.innerHTML=t[1],s.appendChild(e)})),this.category=new m(s,{removeItemButton:!1,itemSelectText:"",allowHTML:!0,searchEnabled:!1,shouldSort:!1}),s.addEventListener("change",(t=>{this.filterBlocks(t.detail.value)})),this.renderBlocks()}filterBlocks(t){const e=window.data_basic,n=this.builder.snippetPath;let o=this.blocks.querySelectorAll(".snippet-item"),s=!1;Array.prototype.forEach.call(o,(e=>{e.getAttribute("data-cat")===t&&(s=!0)})),s||e.snippets.forEach((e=>{if(e.category===t){let t='<div class="snippet-item" data-id="'+e.id+'" data-cat="'+e.category+'"><img alt="'+i("Snippet")+'" src="'+n+e.thumbnail+'"><span class="is-overlay"></span></div>';this.blocks.insertAdjacentHTML("beforeend",t)}})),t&&(o.forEach((t=>t.classList.add("hide"))),o.forEach((e=>{e.getAttribute("data-cat")===t&&e.classList.remove("hide")})))}renderBlocks(){const t=window.data_basic;if(!t)return void setTimeout((()=>{this.renderBlocks()}),100);const e=this.builder.snippetPath;let n=t.snippets,o=this.builder.slider;if("slick"===o){const e=t=>"glide"!==t.type;t.snippets=n.filter(e)}else if("glide"===o){const e=t=>"slick"!==t.type;t.snippets=n.filter(e)}else if("all"===o);else{const e=t=>"glide"!==t.type&&"slick"!==t.type;t.snippets=n.filter(e)}let s,a=1;t.snippets.forEach((t=>{if(t.id=a,t.category===this.builder.defaultSnippetCategory+""){let n='<div class="snippet-item" data-id="'+t.id+'" data-cat="'+t.category+'"><img alt="'+i("Snippet")+'" src="'+e+t.thumbnail+'"><span class="is-overlay"></span></div>';this.blocks.insertAdjacentHTML("beforeend",n)}a++})),new he(this.blocks,{group:{name:"shared",pull:"clone",put:!1},sort:!1,animation:150,onChoose:()=>{const t='\n <style id="css-scale">\n .sortable-ghost {\n height: 50px;\n }\n .sortable-ghost * {\n display: none\n }\n </style>\n ';if(this.builder.editor.iframe){const e=this.builder.editor.contentStuff.querySelector("#css-scale");e&&e.parentNode.removeChild(e),this.builder.editor.contentStuff.insertAdjacentHTML("afterbegin",t)}else{const e=this.builder.editor.builderStuff.querySelector("#css-scale");e&&e.parentNode.removeChild(e),this.builder.editor.builderStuff.insertAdjacentHTML("afterbegin",t)}this.builder.editor.sectionDropSetup()},onMove:()=>{let t=this.builder.doc.querySelector(".row-add-initial");t&&(t.style.display="none")},onStart:()=>{s=null;const t=this.builder.doc.querySelector(".builder-active");t&&(s=t,s.classList.remove("builder-active")),this.builder.editor.uo.saveForUndo();let e=document.querySelector(".is-sidebar-overlay");e&&(e.style.display="none")},onEnd:()=>{let t=document.querySelector(".is-sidebar-overlay");t&&(t.style.display="block"),this.builder.editor.util.checkEmpty();let e=this.builder.doc.querySelector(".row-add-initial");e&&(e.style.display=""),s&&s.classList.remove("builder-active"),this.builder.editor.sortableOnPage&&this.builder.editor.sortableOnPage.destroy()}})}open(){this.dialog.style.display="flex"}close(){this.dialog.style.display=""}}class Re{constructor(t,e){this.builder=e,this.section=this.builder.section,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="submain">\n\n <div class="part-breadcrumb mt-3"></div>\n\n <div class="part-element label mt-2">${i("Element")}</div>\n\n <div class="flex">\n <div style="width:auto">\n <div class="label mt-3">${i("Background Color")}:</div>\n <div class="group">\n <button title="${i("Color")}" class="btn-bgcolor is-btn-color"></button>\n </div>\n </div>\n <div>\n <div class="label mt-3">${i("Gradient")}:</div>\n <div class="group">\n <button title="${i("Gradient")}" class="btn-gradient is-btn-color"></button>\n </div>\n </div>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Width")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-width">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Height")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-height">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Max Width")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-maxwidth">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Max Height")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-maxheight">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Min Width")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-minwidth">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Min Height")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-minheight">\n </label>\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent2">\n ${i("Spacing")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent2" aria-hidden="true">\n \n <div class="subpanel">\n\n <div class="label mt-2 subtitle">${i("Padding")}:</div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Top")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-paddingtop">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Bottom")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-paddingbottom">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Left")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-paddingleft">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Right")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-paddingright">\n </label>\n </div>\n\n <div class="label subtitle mt-5">${i("Margin")}:</div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Top")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-margintop">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Bottom")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-marginbottom">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Left")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-marginleft">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Right")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-marginright">\n </label>\n </div>\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent3">\n ${i("Text")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent3" aria-hidden="true">\n \n <div class="subpanel">\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Text Color")}:</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-textcolor is-btn-color"></button>\n </div>\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Font Size")}:</span>\n <a class="btn-fontunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-fontsize">\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Text Align")}:</span>\n <select class="inp-textalign">\n <option value=""></option>\n <option value="left">${i("Left")}</option>\n <option value="center">${i("Center")}</option>\n <option value="right">${i("Right")}</option>\n <option value="justify">${i("Full")}</option>\n </select>\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Line Height")}:</span>\n <a class="btn-paraunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-lineheight">\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Font Weight")}:</span>\n <select class="inp-fontweight">\n <option value=""></option>\n <option value="100">100</option>\n <option value="200">200</option>\n <option value="300">300</option>\n <option value="400">400</option>\n <option value="500">500</option>\n <option value="600">600</option>\n <option value="700">700</option>\n <option value="800">800</option>\n <option value="900">900</option>\n <option value="bold">${i("Bold")}</option>\n <option value="normal">${i("Normal")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">${i("Font Style")}:</span>\n <select class="inp-fontstyle">\n <option value=""></option>\n <option value="italic">${i("Italic")}</option>\n <option value="normal">${i("Normal")}</option>\n </select>\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Text Transform")}:</span>\n <select class="inp-texttransform">\n <option value=""></option>\n <option value="uppercase">${i("Uppercase")}</option>\n <option value="lowercase">${i("Lowercase")}</option>\n <option value="capitalize">${i("Capitalize")}</option>\n <option value="none">${i("None")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">${i("Text Decoration")}:</span>\n <select class="inp-textdecoration">\n <option value=""></option>\n <option value="underline">${i("Underline")}</option>\n <option value="line-through">${i("Line Through")}</option>\n <option value="overline">${i("Overline")}</option>\n <option value="none">${i("None")}</option>\n </select>\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Letter Spacing")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-letterspacing" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n <label class="std">\n <span class="label">${i("Word Spacing")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-wordspacing" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n </div>\n\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent4">\n ${i("Border")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent4" aria-hidden="true">\n \n <div class="subpanel">\n\n <div class="label subtitle mt-2">${i("Border")}:</div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Width")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-borderwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-borderstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-bordercolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n <div class="label subtitle">${i("Individual Sides")}:</div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Top")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-bordertopwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-bordertopstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-bordertopcolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Bottom")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-borderbottomwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-borderbottomstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-borderbottomcolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Left")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-borderleftwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-borderleftstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-borderleftcolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n <div class="flex">\n <label class="unit" style="width:80px;margin-right:12px;">\n <div>\n <span class="label">${i("Right")}:</span>\n <a class="btn-unit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-borderrightwidth" style="width:80px">\n </label>\n <label class="std" style="margin-right:12px;">\n <span class="label">&nbsp;</span>\n <select class="inp-borderrightstyle" style="width:80px">\n <option value=""></option>\n <option value="solid">${i("Solid")}</option>\n <option value="dashed">${i("Dashed")}</option>\n <option value="dotted">${i("Dotted")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-borderrightcolor is-btn-color"></button>\n </div>\n </label>\n </div>\n\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent5">\n ${i("Corners")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent5" aria-hidden="true">\n \n <div class="subpanel">\n\n <div class="label subtitle mt-2">${i("Corners")}:</div>\n\n <label class="std">\n <span class="label mt-3">${i("Border Radius")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-borderradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n \n <div class="label subtitle mt-5">${i("Individual Corners")}:</div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("Top Left")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-bordertopleftradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n <label class="std">\n <span class="label">${i("Top Right")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-bordertoprightradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n </div>\n\n <div class="flex">\n <label class="std">\n <span class="label">${i("bottom Left")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-borderbottomleftradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n <label class="std">\n <span class="label">${i("bottom Right")}:</span>\n <div style="align-items:center;">\n <input type="text" class="inp-borderbottomrightradius" style="width:80px">&nbsp;\n <span>px</span>\n </div>\n </label>\n </div>\n </div>\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent6">\n ${i("Shadow")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content " id="elmcontent6" aria-hidden="true">\n\n <div class="subpanel">\n\n <div class="label subtitle mt-2">${i("Shadow")}:</div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("x Offset")}:</span>\n <a class="btn-simpleunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-shadowxoffset">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("y Offset")}:</span>\n <a class="btn-simpleunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-shadowyoffset">\n </label>\n </div>\n\n <div class="flex">\n <label class="unit">\n <div>\n <span class="label">${i("Blur")}:</span>\n <a class="btn-simpleunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-shadowblur">\n </label>\n <label class="unit">\n <div>\n <span class="label">${i("Spread")}:</span>\n <a class="btn-simpleunit" href="#" role="button">px</a>\n </div>\n <input type="text" class="inp-shadowspread">\n </label>\n </div>\n\n <label class="std">\n <span class="label">${i("Shadow Color")}:</span>\n <div class="group">\n <button title="${i("Color")}" class="btn-shadowcolor is-btn-color"></button>\n </div>\n </label>\n\n <div class="flex" style="justify-content:space-between">\n <label class="std">\n <span class="label">${i("Type")}:</span>\n <select class="inp-shadowtype" style="width:80px">\n <option value="">${i("Outset")}</option>\n <option value="inset">${i("Inset")}</option>\n </select>\n </label>\n <label class="std">\n <span class="label">&nbsp;</span>\n <div class="group">\n <button title="${i("Clean")}" class="btn-clean-shadow"><svg><use xlink:href="#icon-eraser"></use></svg></button>\n </div>\n </label>\n </div>\n\n <div class="group mt-5">\n <button title="${i("More")}" class="btn-shadow" style="width:221px">${i("More")}</button>\n </div>\n \n </div>\n\n </div>\n\n \x3c!--\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent7">${i("Display")}</button>\n <div class="accordion-content subpanel" id="elmcontent7" aria-hidden="true">\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent8">${i("Position")}</button>\n <div class="accordion-content subpanel" id="elmcontent8" aria-hidden="true">\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent8">${i("Effects")}</button>\n <div class="accordion-content subpanel" id="elmcontent8" aria-hidden="true">\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent9">${i("Attributes")}</button>\n <div class="accordion-content subpanel" id="elmcontent9" aria-hidden="true">\n\n </div>\n --\x3e\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent10">\n ${i("Responsive")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content" id="elmcontent10" aria-hidden="true">\n\n <div class="subpanel">\n\n <div class="div-target">\n <button title="${i("Desktop")}" class="on" data-device="">\n <svg><use xlink:href="#icon-device-desktop"></use></svg>\n </button>\n <button title="${i("Laptop/Tablet (Landscape)")}" data-device="md">\n <svg style="transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>\n </button>\n <button title="${i("Tablet (Portrait)")}" data-device="sm">\n <svg><use xlink:href="#icon-device-tablet"></use></svg>\n </button>\n <button title="${i("Mobile")}" data-device="xs">\n <svg><use xlink:href="#icon-device-mobile"></use></svg>\n </button>\n </div>\n\n <div class="label mt-3">${i("Visibility")}:</div>\n <div class="group">\n <button title="${i("Visible")}" data-visibility="on" style="width: 105px">\n <svg><use xlink:href="#icon-eye"></use></svg>\n <span>${i("Visible")}</span>\n </button>\n <button title="${i("Hidden")}" data-visibility="" style="width: 105px">\n <svg><use xlink:href="#icon-eye-off"></use></svg>\n <span>${i("Hidden")}</span>\n </button>\n </div>\n </div>\n\n </div>\n\n <button class="accordion-item" aria-expanded="false" aria-controls="elmcontent11">\n ${i("More")}\n <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>\n </button>\n <div class="accordion-content last" id="elmcontent11" aria-hidden="true">\n\n <div class="subpanel">\n <label class="label mt-2">\n <div>${i("Add ID")}:</div>\n <input type="text" class="inp-elm-id" onkeypress="return /[0-9a-zA-Z_]/i.test(event.key)">\n </label>\n\n <label class="label">\n <div>${i("Add Css Classes")}:</div>\n <input type="text" class="inp-elm-classes">\n </label>\n </div>\n\n </div>\n\n <div class="panel-pop unit-1" tabIndex="-1" aria-hidden="true">\n <button title="px">px</button>\n <button title="px">%</button>\n <button title="vw">vw</button>\n <button title="vw">vh</button>\n <button title="em">em</button>\n <button title="rem">rem</button>\n </div>\n\n <div class="panel-pop unit-2" tabIndex="-1" aria-hidden="true">\n <button title="px">px</button>\n <button title="pt">pt</button>\n <button title="em">em</button>\n <button title="vw">vw</button>\n <button title="vh">vh</button>\n <button title="%">%</button>\n <button title="vmin" style="width:59px">vmin</button>\n <button title="vmax" style="width:59px">vmax</button>\n </div>\n\n <div class="panel-pop unit-3" tabIndex="-1" aria-hidden="true">\n <button title="">-</button>\n <button title="px">px</button>\n <button title="pt">pt</button>\n <button title="em">em</button>\n <button title="rem">rem</button>\n <button title="%">%</button>\n </div>\n\n <div class="panel-pop unit-4" tabIndex="-1" aria-hidden="true" style="width:90px">\n <button title="px">px</button>\n <button title="em">em</button>\n </div>\n\n `;t.insertAdjacentHTML("beforeend",n),this.breadcrumb=t.querySelector(".part-breadcrumb"),this.element=t.querySelector(".part-element"),this.unit=t.querySelector(".panel-pop.unit-1"),this.unitFont=t.querySelector(".panel-pop.unit-2"),this.unitPara=t.querySelector(".panel-pop.unit-3"),this.unitSimple=t.querySelector(".panel-pop.unit-4");let o;t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()})),t.querySelectorAll(".btn-unit").forEach((t=>t.addEventListener("click",(e=>{this.builder.controlpanel.showPop(this.unit,(()=>{t.focus()}),t),this.unitButton=t,e.preventDefault()})))),t.querySelectorAll(".btn-fontunit").forEach((t=>t.addEventListener("click",(e=>{this.builder.controlpanel.showPop(this.unitFont,(()=>{t.focus()}),t),this.unitButton=t,e.preventDefault()})))),t.querySelectorAll(".btn-paraunit").forEach((t=>t.addEventListener("click",(e=>{this.builder.controlpanel.showPop(this.unitPara,(()=>{t.focus()}),t),this.unitButton=t,e.preventDefault()})))),t.querySelectorAll(".btn-simpleunit").forEach((t=>t.addEventListener("click",(e=>{this.builder.controlpanel.showPop(this.unitSimple,(()=>{t.focus()}),t),this.unitButton=t,e.preventDefault()})))),t.querySelectorAll("input").forEach((t=>{t.classList.contains("inp-elm-id")||t.classList.contains("inp-elm-classes")||t.addEventListener("input",(()=>{clearTimeout(o),o=setTimeout((()=>{this.applyStyle(t)}),600)}))})),t.querySelectorAll("select").forEach((t=>t.addEventListener("change",(()=>{this.applyStyle(t)})))),this.unit.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(()=>{this.unitButton.innerText=t.innerText,this.builder.controlpanel.hidePop(this.unit);const e=this.unitButton.parentNode.parentNode.querySelector("input");this.applyStyle(e)}))})),this.unitFont.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(()=>{this.unitButton.innerText=t.innerText,this.builder.controlpanel.hidePop(this.unitFont);const e=this.unitButton.parentNode.parentNode.querySelector("input");this.applyStyle(e)}))})),this.unitPara.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(()=>{this.unitButton.innerText=t.innerText,this.builder.controlpanel.hidePop(this.unitPara);const e=this.unitButton.parentNode.parentNode.querySelector("input");this.applyStyle(e)}))})),this.unitSimple.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(()=>{this.unitButton.innerText=t.innerText,this.builder.controlpanel.hidePop(this.unitSimple);const e=this.unitButton.parentNode.parentNode.querySelector("input");this.applyStyle(e)}))}));const s=(e,i)=>{const n=t.querySelector(i);n.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.inspectedElement;let i=n.style.backgroundColor;this.builder.editor.colorpicker().open((i=>{t.style[e]=i,n.style.backgroundColor=i,this.builder.onChange()}),i)}))};s("background-color",".btn-bgcolor"),s("color",".btn-textcolor"),s("border-color",".btn-bordercolor"),s("border-top-color",".btn-bordertopcolor"),s("border-bottom-color",".btn-borderbottomcolor"),s("border-left-color",".btn-borderleftcolor"),s("border-right-color",".btn-borderrightcolor");const a=t.querySelector(".btn-shadowcolor");a.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);let t=a.style.backgroundColor;this.builder.editor.colorpicker().open((t=>{this.setBoxShadow(),a.style.backgroundColor=t,this.builder.onChange()}),t)}));t.querySelector(".btn-shadow").addEventListener("click",(()=>{this.builder.controlpanel.objDialogShadow.open()}));t.querySelector(".btn-clean-shadow").addEventListener("click",(()=>{this.inspectedElement.style.boxShadow="",this.refresh()}));const l=t.querySelector(".btn-gradient");l.addEventListener("click",(()=>{this.builder.editor.saveForUndo(!0);const t=this.inspectedElement;this.builder.editor.gradientpicker().open(t,(()=>{this.builder.onChange(),l.style.backgroundImage=t.style.backgroundImage}))}));const r=t.querySelector(".div-target"),c=r.querySelectorAll("[data-device]");c.forEach((t=>{t.addEventListener("click",(()=>{c.forEach((t=>t.classList.remove("on"))),t.classList.add("on"),this.refresh()}))}));const d=t.querySelectorAll("[data-visibility]");d.forEach((t=>{t.addEventListener("click",(()=>{const e=t.getAttribute("data-visibility"),i=this.getDeviceTarget(r);this.setVisibility(e,i),d.forEach((t=>t.classList.remove("on"))),t.classList.add("on")}))}));const u=t.querySelector(".inp-elm-id");u.addEventListener("change",(()=>{this.builder.editor.saveForUndo();const t=this.inspectedElement;""!==u.value?t.setAttribute("id",u.value):t.removeAttribute("id"),this.builder.onChange()}));const p=t.querySelector(".inp-elm-classes");p.addEventListener("change",(()=>{this.builder.editor.saveForUndo();const t=this.inspectedElement;let e=[],i=t.getAttribute("data-class");i&&(e=i.split(" "));let n=[],o=p.value;n=o.split(" "),e.forEach((e=>{n.includes(e)||t.classList.remove(e)})),n.forEach((e=>{""!==e&&t.classList.add(e)})),t.setAttribute("data-class",o),""===t.getAttribute("data-class")&&t.removeAttribute("data-class"),this.builder.onChange()})),u.addEventListener("keyup",(()=>{const t=this.inspectedElement;""!==u.value?t.setAttribute("id",u.value):t.removeAttribute("id")}))}getState(){let t=this.builder.controlpanel.activeElement;t&&t.classList?this.inspect(t):this.close()}applyStyle(t){this.builder.editor.saveForUndo();let e=t.classList;e.contains("inp-width")&&this.setStyle("width",".inp-width"),e.contains("inp-height")&&this.setStyle("height",".inp-height"),e.contains("inp-maxwidth")&&this.setStyle("max-width",".inp-maxwidth"),e.contains("inp-maxheight")&&this.setStyle("max-height",".inp-maxheight"),e.contains("inp-minwidth")&&this.setStyle("min-width",".inp-minwidth"),e.contains("inp-minheight")&&this.setStyle("min-height",".inp-minheight"),e.contains("inp-paddingtop")&&this.setStyle("padding-top",".inp-paddingtop"),e.contains("inp-paddingbottom")&&this.setStyle("padding-bottom",".inp-paddingbottom"),e.contains("inp-paddingleft")&&this.setStyle("padding-left",".inp-paddingleft"),e.contains("inp-paddingright")&&this.setStyle("padding-right",".inp-paddingright"),e.contains("inp-margintop")&&this.setStyle("margin-top",".inp-margintop"),e.contains("inp-marginbottom")&&this.setStyle("margin-bottom",".inp-marginbottom"),e.contains("inp-marginleft")&&this.setStyle("margin-left",".inp-marginleft"),e.contains("inp-marginright")&&this.setStyle("margin-right",".inp-marginright"),e.contains("inp-fontsize")&&this.setStyle("font-size",".inp-fontsize"),e.contains("inp-lineheight")&&this.setStyle("line-height",".inp-lineheight"),e.contains("inp-letterspacing")&&this.setStylePX("letter-spacing",".inp-letterspacing"),e.contains("inp-wordspacing")&&this.setStylePX("word-spacing",".inp-wordspacing"),e.contains("inp-borderwidth")&&this.setStyle("border-width",".inp-borderwidth"),e.contains("inp-bordertopwidth")&&this.setStyle("border-top-width",".inp-bordertopwidth"),e.contains("inp-borderbottomwidth")&&this.setStyle("border-bottom-width",".inp-borderbottomwidth"),e.contains("inp-borderleftwidth")&&this.setStyle("border-left-width",".inp-borderleftwidth"),e.contains("inp-borderrightwidth")&&this.setStyle("border-right-width",".inp-borderrightwidth"),e.contains("inp-borderradius")&&this.setStylePX("border-radius",".inp-borderradius"),e.contains("inp-bordertopleftradius")&&this.setStylePX("border-top-left-radius",".inp-bordertopleftradius"),e.contains("inp-bordertoprightradius")&&this.setStylePX("border-top-right-radius",".inp-bordertoprightradius"),e.contains("inp-borderbottomleftradius")&&this.setStylePX("border-bottom-left-radius",".inp-borderbottomleftradius"),e.contains("inp-borderbottomrightradius")&&this.setStylePX("border-bottom-right-radius",".inp-borderbottomrightradius"),(e.contains("inp-shadowxoffset")||e.contains("inp-shadowyoffset")||e.contains("inp-shadowblur")||e.contains("inp-shadowspread")||e.contains("inp-shadowtype"))&&this.setBoxShadow(),e.contains("inp-textalign")&&this.setStyleSelect("text-align",".inp-textalign"),e.contains("inp-fontweight")&&this.setStyleSelect("font-weight",".inp-fontweight"),e.contains("inp-fontstyle")&&this.setStyleSelect("font-style",".inp-fontstyle"),e.contains("inp-texttransform")&&this.setStyleSelect("text-transform",".inp-texttransform"),e.contains("inp-textdecoration")&&this.setStyleSelect("text-decoration",".inp-textdecoration"),e.contains("inp-borderstyle")&&this.setStyleSelect("border-style",".inp-borderstyle"),e.contains("inp-bordertopstyle")&&this.setStyleSelect("border-top-style",".inp-bordertopstyle"),e.contains("inp-borderbottomstyle")&&this.setStyleSelect("border-bottom-style",".inp-borderbottomstyle"),e.contains("inp-borderleftstyle")&&this.setStyleSelect("border-left-style",".inp-borderleftstyle"),e.contains("inp-borderrightstyle")&&this.setStyleSelect("border-right-style",".inp-borderrightstyle"),this.builder.onChange(),(e.contains("inp-borderwidth")||e.contains("inp-bordertopwidth")||e.contains("inp-borderbottomwidth")||e.contains("inp-borderleftwidth")||e.contains("inp-borderrightwidth")||e.contains("inp-borderradius")||e.contains("inp-bordertopleftradius")||e.contains("inp-bordertoprightradius")||e.contains("inp-borderbottomleftradius")||e.contains("inp-borderbottomrightradius"))&&this.refresh()}refresh(){this.getStyle("width",".inp-width"),this.getStyle("height",".inp-height"),this.getStyle("max-width",".inp-maxwidth"),this.getStyle("max-height",".inp-maxheight"),this.getStyle("min-width",".inp-minwidth"),this.getStyle("min-height",".inp-minheight"),this.getStyle("padding-top",".inp-paddingtop"),this.getStyle("padding-bottom",".inp-paddingbottom"),this.getStyle("padding-left",".inp-paddingleft"),this.getStyle("padding-right",".inp-paddingright"),this.getStyle("margin-top",".inp-margintop"),this.getStyle("margin-bottom",".inp-marginbottom"),this.getStyle("margin-left",".inp-marginleft"),this.getStyle("margin-right",".inp-marginright"),this.getStyle("font-size",".inp-fontsize"),this.getStyle("line-height",".inp-lineheight"),this.getStylePX("letter-spacing",".inp-letterspacing"),this.getStylePX("word-spacing",".inp-wordspacing"),this.getStyle("border-width",".inp-borderwidth"),this.getStyle("border-top-width",".inp-bordertopwidth"),this.getStyle("border-bottom-width",".inp-borderbottomwidth"),this.getStyle("border-left-width",".inp-borderleftwidth"),this.getStyle("border-right-width",".inp-borderrightwidth"),this.getStylePX("border-radius",".inp-borderradius"),this.getStylePX("border-top-left-radius",".inp-bordertopleftradius"),this.getStylePX("border-top-right-radius",".inp-bordertoprightradius"),this.getStylePX("border-bottom-left-radius",".inp-borderbottomleftradius"),this.getStylePX("border-bottom-right-radius",".inp-borderbottomrightradius"),this.getBoxShadow(),this.getStyleSelect("text-align",".inp-textalign"),this.getStyleSelect("font-weight",".inp-fontweight"),this.getStyleSelect("font-style",".inp-fontstyle"),this.getStyleSelect("text-transform",".inp-texttransform"),this.getStyleSelect("text-decoration",".inp-textdecoration"),this.getStyleSelect("border-style",".inp-borderstyle"),this.getStyleSelect("border-top-style",".inp-bordertopstyle"),this.getStyleSelect("border-bottom-style",".inp-borderbottomstyle"),this.getStyleSelect("border-left-style",".inp-borderleftstyle"),this.getStyleSelect("border-right-style",".inp-borderrightstyle");const t=this.inspectedElement,e=this.dialog,i=e.querySelector(".btn-bgcolor");let n=t.style.backgroundColor;i.style.backgroundColor=n||"";const o=e.querySelector(".btn-gradient");t.style.backgroundImage?o.style.backgroundImage=t.style.backgroundImage:o.style.backgroundImage="";const s=e.querySelector(".btn-textcolor");let a=t.style.color;s.style.backgroundColor=a||"";const l=e.querySelector(".btn-bordercolor");let r=t.style.borderColor;l.style.backgroundColor=r||"";const c=e.querySelector(".btn-bordertopcolor");let d=t.style.borderTopColor;c.style.backgroundColor=d||"";const u=e.querySelector(".btn-borderbottomcolor");let p=t.style.borderBottomColor;u.style.backgroundColor=p||"";const h=e.querySelector(".btn-borderleftcolor");let m=t.style.borderLeftColor;h.style.backgroundColor=m||"";const b=e.querySelector(".btn-borderrightcolor");let g=t.style.borderRightColor;b.style.backgroundColor=g||"",this.realtimeVisibility(t);const v=t.getAttribute("id"),f=e.querySelector(".inp-elm-id");f.value=v||"";const y=t.getAttribute("data-class"),x=e.querySelector(".inp-elm-classes");x.value=y||""}inspect(t){this.inspectedElement=t,this.builder.doc.querySelectorAll(".elm-inspected").forEach((t=>t.classList.remove("elm-inspected"))),t.classList.add("elm-inspected");this.breadcrumbRender(t)?this.refresh():this.close()}getStyle(t,e){const i=this.inspectedElement,n=this.parseStyle(i,t),o=this.dialog.querySelector(e),s=o.parentNode.querySelector(".btn-unit,.btn-fontunit,.btn-paraunit,.btn-simpleunit");"line-height"===t&&""===n.unit?(i.classList.contains("leading-05")&&(o.value="0.5",s.innerText="-"),i.classList.contains("leading-06")&&(o.value="0.6",s.innerText="-"),i.classList.contains("leading-07")&&(o.value="0.7",s.innerText="-"),i.classList.contains("leading-08")&&(o.value="0.8",s.innerText="-"),i.classList.contains("leading-09")&&(o.value="0.9",s.innerText="-"),i.classList.contains("leading-none")&&(o.value="1",s.innerText="-"),i.classList.contains("leading-11")&&(o.value="1.1",s.innerText="-"),i.classList.contains("leading-12")&&(o.value="1.2",s.innerText="-"),i.classList.contains("leading-tight")&&(o.value="1.25",s.innerText="-"),i.classList.contains("leading-13")&&(o.value="1.3",s.innerText="-"),i.classList.contains("leading-snug")&&(o.value="1.375",s.innerText="-"),i.classList.contains("leading-14")&&(o.value="1.4",s.innerText="-"),i.classList.contains("leading-normal")&&(o.value="1.5",s.innerText="-"),i.classList.contains("leading-16")&&(o.value="1.6",s.innerText="-"),i.classList.contains("leading-relaxed")&&(o.value="1.625",s.innerText="-"),i.classList.contains("leading-17")&&(o.value="1.7",s.innerText="-"),i.classList.contains("leading-18")&&(o.value="1.8",s.innerText="-"),i.classList.contains("leading-19")&&(o.value="1.9",s.innerText="-"),i.classList.contains("leading-loose")&&(o.value="2",s.innerText="-"),i.classList.contains("leading-21")&&(o.value="2.1",s.innerText="-"),i.classList.contains("leading-22")&&(o.value="2.2",s.innerText="-"),i.classList.contains("leading-23")&&(o.value="2.3",s.innerText="-"),i.classList.contains("leading-24")&&(o.value="2.4",s.innerText="-"),i.classList.contains("leading-25")&&(o.value="2.5",s.innerText="-"),i.classList.contains("leading-26")&&(o.value="2.6",s.innerText="-"),i.classList.contains("leading-27")&&(o.value="2.7",s.innerText="-"),i.classList.contains("leading-28")&&(o.value="2.8",s.innerText="-"),i.classList.contains("leading-29")&&(o.value="2.9",s.innerText="-"),i.classList.contains("leading-30")&&(o.value="3",s.innerText="-")):(o.value=n.value,s.innerText=n.unit?n.unit:"-")}setStyle(t,e){const i=this.inspectedElement,n=this.dialog.querySelector(e),o=n.parentNode.querySelector(".btn-unit,.btn-fontunit,.btn-paraunit,.btn-simpleunit"),s=n.value;let a=o.innerText;if("-"===a&&(a=""),"line-height"===t){const t=this.builder.cssClasses.leading;for(let e=0;e<Object.keys(t).length;e++){let n=Object.values(t)[e];i.classList.remove(n)}}i.style[t]=s?`${s+a}`:""}setStylePX(t,e){const i=this.inspectedElement,n=this.dialog.querySelector(e).value;"border-radius"===t?setTimeout((()=>{i.style[t]=n?n+"px":""}),10):i.style[t]=n?n+"px":"",i.style[t]=n?n+"px":""}getStylePX(t,e){const i=this.inspectedElement,n=this.parseStyle(i,t),o=this.dialog.querySelector(e);"px"===n.unit?o.value=n.value:o.value=""}getBoxShadow(){const t=this.inspectedElement,e=this.parseBoxShadow(t),i=this.dialog,n=i.querySelector(".inp-shadowxoffset"),o=n.parentNode.querySelector(".btn-simpleunit"),s=i.querySelector(".inp-shadowyoffset"),a=s.parentNode.querySelector(".btn-simpleunit"),l=i.querySelector(".inp-shadowblur"),r=l.parentNode.querySelector(".btn-simpleunit"),c=i.querySelector(".inp-shadowspread"),d=c.parentNode.querySelector(".btn-simpleunit"),u=i.querySelector(".btn-shadowcolor"),p=i.querySelector(".inp-shadowtype");if(n.value="",o.innerText="px",s.value="",a.innerText="px",l.value="",r.innerText="px",c.value="",d.innerText="px",u.style.backgroundColor="",p.value="",e.color){n.value=e.xoffset.value,o.innerText=e.xoffset.unit,s.value=e.yoffset.value,a.innerText=e.yoffset.unit,l.value=e.blur.value,r.innerText=e.blur.unit,c.value=e.spread.value,d.innerText=e.spread.unit,u.style.backgroundColor=e.color,p.value=e.type;let t=e.color;u.style.backgroundColor=t||""}}setBoxShadow(){const t=this.inspectedElement,e=this.dialog,i=e.querySelector(".inp-shadowxoffset"),n=i.parentNode.querySelector(".btn-simpleunit"),o=e.querySelector(".inp-shadowyoffset"),s=o.parentNode.querySelector(".btn-simpleunit"),a=e.querySelector(".inp-shadowblur"),l=a.parentNode.querySelector(".btn-simpleunit"),r=e.querySelector(".inp-shadowspread"),c=r.parentNode.querySelector(".btn-simpleunit"),d=e.querySelector(".btn-shadowcolor"),u=e.querySelector(".inp-shadowtype"),p=i.value?i.value+n.innerText:"0px",h=o.value?o.value+s.innerText:"0px",m=a.value?a.value+l.innerText:"0px",b=r.value?r.value+c.innerText:"0px",g=d.style.backgroundColor||"rgba(0, 0, 0, 0.08)",v=u.value;if("0px"!==p||"0px"!==h){const e=[];"inset"===v&&e.push("inset"),e.push(`${p} ${h} ${m} ${b} ${g}`);const i=e.join(" ");t.style.boxShadow=i}else t.style.boxShadow=""}parseStyle(t,e){const i=t.style[e],n=i.match(/^([0-9.]+)(px|vw|vh|em|rem|pt|vmin|vmax|%)$/);if("line-height"===e){if(n){return{value:n[1],unit:n[2]}}return{value:i,unit:""}}if(n){return{value:n[1],unit:n[2]}}return{value:"",unit:"px"}}getValUnit(t){const e=t.match(/^([0-9.]+)(px|vw|vh|em|rem|pt|vmin|vmax|%)$/);if(e){return{value:e[1],unit:e[2]}}return{value:"",unit:"px"}}parseBoxShadow(t){let e=t.style.boxShadow;const i={};if(-1!==e.indexOf("inset")?(i.type="inset",e=e.replace("inset","")):i.type="",""!==e){if(-1!==e.indexOf("rgb")){let t=e.substr(e.indexOf("rgb"));t=t.substr(0,t.indexOf(")")+1),i.color=t;let n=e.split("rgb")[1].indexOf(")");e=e.split("rgb")[0]+e.split("rgb")[1].substr(n+2)}let t=e.split(" "),n=t.length,o=1;for(let e=0;e<n;e++)1===o&&(i.xoffset=this.getValUnit(t[e])),2===o&&(i.yoffset=this.getValUnit(t[e])),3===o&&(i.blur=this.getValUnit(t[e])),i.spread=4===o?this.getValUnit(t[e]):{value:"0",unit:"px"},o++}return i}setStyleSelect(t,e){const i=this.inspectedElement,n=this.dialog.querySelector(e).value;i.style[t]=n,"text-align"===t&&(i.classList.remove("text-left"),i.classList.remove("text-right"),i.classList.remove("text-center"),i.classList.remove("text-justify"))}getStyleSelect(t,e){const i=this.inspectedElement;let n=i.style[t];const o=this.dialog.querySelector(e);o.value=n,"text-align"===t&&(i.classList.contains("text-left")&&(o.value="left"),i.classList.contains("text-right")&&(o.value="right"),i.classList.contains("text-center")&&(o.value="center"),i.classList.contains("text-justify")&&(o.value="justify"))}breadcrumbRender(t){let e="",i=t,n=0;const o=[];for(;i&&!i.classList.contains("is-container");){let t=i.tagName.toLowerCase();i.parentNode&&i.parentNode.classList.contains("is-container")&&(t="Row"),i.parentNode&&i.parentNode.parentNode&&i.parentNode.parentNode.classList.contains("is-container")&&(t="Column"),o.push({index:n,element:i,html:`<a href="#" data-value="${n}">${t}</a>`}),n++,i=i.parentNode}if(!i)return this.close(),!1;for(let t=o.length-1;t>0;t--)e+=o[t].html+'<svg class="is-icon-flex"><use xlink:href="#icon-right"></use></svg>';this.breadcrumb.innerHTML=e;let s;return this.breadcrumb.querySelectorAll("a").forEach((t=>{t.addEventListener("click",(e=>{const i=t.getAttribute("data-value"),n=o[i].element;this.inspect(n),e.preventDefault(),e.stopImmediatePropagation()}))})),s=t.parentNode&&t.parentNode.classList.contains("is-container")?"Row":t.parentNode&&t.parentNode.parentNode&&t.parentNode.parentNode.classList.contains("is-container")?"Column":t.tagName.toLowerCase(),this.element.innerHTML=s,!0}setVisibility(t,e){let i=this.inspectedElement;i.classList.remove("hideonmobile"),this.builder.editor.saveForUndo();const n=(t,e)=>t.querySelectorAll(`.${e}-hidden`).length>0;"on"===t?"xs"===e?i.classList.remove("xs-hidden"):"sm"===e?(i.classList.remove("sm-hidden"),n(i.parentNode,"sm")||i.parentNode.classList.remove("sm-autofit")):"md"===e?(i.classList.remove("md-hidden"),n(i.parentNode,"md")||i.parentNode.classList.remove("md-autofit")):""===e&&(i.classList.remove("desktop-hidden"),n(i.parentNode,"desktop")||i.parentNode.classList.remove("desktop-autofit")):"xs"===e?i.classList.add("xs-hidden"):"sm"===e?(i.classList.add("sm-hidden"),i.parentNode.classList.add("sm-autofit")):"md"===e?(i.classList.add("md-hidden"),i.parentNode.classList.add("md-autofit")):""===e&&(i.classList.add("desktop-hidden"),i.parentNode.classList.add("desktop-autofit")),this.builder.onChange()}getDeviceTarget(t){return t.querySelector("button.on").getAttribute("data-device")}realtimeVisibility(t){const e=this.dialog,i=e.querySelector(".div-target"),n=this.getDeviceTarget(i);let o=!1;o="xs"===n?t.classList.contains("xs-hidden"):"sm"===n?t.classList.contains("sm-hidden"):"md"===n?t.classList.contains("md-hidden"):t.classList.contains("desktop-hidden"),e.querySelectorAll("[data-visibility]").forEach((t=>t.classList.remove("on"))),o?e.querySelector('[data-visibility=""]').classList.add("on"):e.querySelector('[data-visibility="on"]').classList.add("on")}open(){this.dialog.style.display="flex",this.getState()}close(){this.dialog.style.display=""}}class Be{constructor(t,e){this.builder=e,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="submain">\n\n <div class="label" style="font-size:18px">${i("Shadow")}</div>\n\n <div class="div-shadow-list">\n\n <button data-shadow="rgba(0, 0, 0, 0.3) 0px 1px 3px 0px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 3px 0px">1</button>\n <button data-shadow="rgba(0, 0, 0, 0.15) 0px 1px 5px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.15) 0px 1px 5px">2</button>\n <button data-shadow="rgba(0, 0, 0, 0.16) 0px 3px 6px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px">3</button>\n <button data-shadow="rgba(0, 0, 0, 0.22) 0px 10px 10px -5px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.22) 0px 10px 10px -5px">4</button>\n <button data-shadow="rgba(0, 0, 0, 0.19) 0px 10px 20px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px">5</button>\n <button data-shadow="rgba(0, 0, 0, 0.21) 0px 5px 6px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.21) 0px 5px 6px">6</button>\n <button data-shadow="rgba(0, 0, 0, 0.25) 0px 14px 28px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px">7</button>\n <button data-shadow="rgba(0, 0, 0, 0.19) 0px 6px 20px 0px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.19) 0px 6px 20px 0px">8</button>\n <button data-shadow="rgba(0, 0, 0, 0.08) 4px 17px 20px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.08) 4px 17px 20px">9</button>\n <button data-shadow="rgba(0, 0, 0, 0.12) 0px 11px 35px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.12) 0px 11px 35px">10</button>\n <button data-shadow="rgba(0, 0, 0, 0.06) 17px 17px 0px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.06) 17px 17px 0px">11</button>\n <button data-shadow="rgba(0, 0, 0, 0.1) 0px 0px 40px inset" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 40px inset">12</button>\n <button data-shadow="rgba(22, 22, 22, 0.2) 2em 2em 5em" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgba(22, 22, 22, 0.2) 2em 2em 5em">13</button>\n <button data-shadow="rgb(0 0 0 / 24%) 30px 30px 45px" title="${i("Apply Shadow")}" type="button" style="box-shadow: rgb(0 0 0 / 24%) 30px 30px 45px">14</button>\n\n </div>\n\n <div class="group mt-4">\n <button title="${i("Clear")}" class="btn-clean-shadow"><svg><use xlink:href="#icon-eraser"></use></svg></button>\n </div>\n </div>\n `;t.insertAdjacentHTML("beforeend",n),this.dialog=t;t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()}));t.querySelectorAll("[data-shadow]").forEach((t=>{t.addEventListener("click",(()=>{this.builder.editor.saveForUndo();this.builder.controlpanel.objDialogElement.inspectedElement.style.boxShadow=t.getAttribute("data-shadow"),this.builder.controlpanel.objDialogElement.refresh(),this.builder.onChange()}))}));t.querySelector(".btn-clean-shadow").addEventListener("click",(()=>{this.builder.controlpanel.objDialogElement.inspectedElement.style.boxShadow="",this.builder.controlpanel.objDialogElement.refresh()}))}open(){this.dialog.style.display="flex"}close(){this.dialog.style.display=""}}class Pe{constructor(t,e){this.builder=e,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="submain">\n <div class="label" style="font-size:18px">${i("Background Image Adjustments")}</div>\n\n <div class="div-target" style="margin-top:20px">\n <button title="${i("Desktop")}" class="on" data-device="">\n <svg><use xlink:href="#icon-device-desktop"></use></svg>\n </button>\n <button title="${i("Laptop/Tablet (Landscape)")}" data-device="md">\n <svg style="transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>\n </button>\n <button title="${i("Tablet (Portrait)")}" data-device="sm">\n <svg><use xlink:href="#icon-device-tablet"></use></svg>\n </button>\n <button title="${i("Mobile")}" data-device="xs">\n <svg><use xlink:href="#icon-device-mobile"></use></svg>\n </button>\n </div>\n\n <div class="label mt-3">${i("Scale")}:</div>\n <div style="padding-top:4px">\n <input type="range" min="100" max="500" value="0" class="inp-scale-slider is-rangeslider">\n </div>\n\n <div class="label mt-3">${i("Horizontal")}:</div>\n <div style="padding-top:4px">\n <input type="range" min="0" max="100" value="0" class="inp-hor-slider is-rangeslider">\n </div>\n\n <div class="label mt-3">${i("Vertical")}:</div>\n <div style="padding-top:4px">\n <input type="range" min="0" max="100" value="0" class="inp-vert-slider is-rangeslider">\n </div>\n\n <div class="group mt-5">\n <button title="${i("Clean")}" class="btn-reset"><svg><use xlink:href="#icon-eraser"></use></svg></button>\n </div>\n </div>\n `;t.insertAdjacentHTML("beforeend",n);t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()}));const o=t.querySelector(".div-target"),s=o.querySelectorAll("[data-device]");s.forEach((t=>{t.addEventListener("click",(()=>{if(s.forEach((t=>t.classList.remove("on"))),t.classList.add("on"),this.builder.iframePanel){const t=this.getDeviceTarget(o);"xs"===t?this.builder.iframePanel.setScreenMode("mobile"):"sm"===t?this.builder.iframePanel.setScreenMode("tablet"):"md"===t?this.builder.iframePanel.setScreenMode("tablet-landscape"):this.builder.iframePanel.setScreenMode("desktop")}this.getState()}))}));const a=t.querySelector(".inp-scale-slider");a.onfocus=()=>{this.builder.editor.saveForUndo(!0)},a.oninput=()=>{const t=this.getDeviceTarget(o);let e=a.value,i=this.element;if("xs"===t){let t=i.getAttribute("data-bg-xs");t||(t="");let e=document.createElement("div");e.style.cssText=t,e.style.backgroundSize="cover",i.setAttribute("data-bg-xs",e.style.cssText),i.style.backgroundSize="cover"}else if("sm"===t){let t=i.getAttribute("data-bg-sm");t||(t="");let e=document.createElement("div");e.style.cssText=t,e.style.backgroundSize="cover",i.setAttribute("data-bg-sm",e.style.cssText),i.style.backgroundSize="cover"}else if("md"===t){let t=i.getAttribute("data-bg-md");t||(t="");let e=document.createElement("div");e.style.cssText=t,e.style.backgroundSize="cover",i.setAttribute("data-bg-md",e.style.cssText),i.style.backgroundSize="cover"}else{let t=i.getAttribute("data-bg-lg");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundSize=e+"%",i.setAttribute("data-bg-lg",n.style.cssText),i.style.backgroundSize=e+"%"}i.style.left="",i.style.top="",i.style.width="",i.style.height="",i.removeAttribute("data-x"),i.removeAttribute("data-y"),i.removeAttribute("data-scale")},a.onchange=()=>{const t=this.getDeviceTarget(o);("xs"===t||"sm"===t||"md"===t)&&(a.value=0),this.builder.onChange()};const l=t.querySelector(".inp-hor-slider");l.onfocus=()=>{this.builder.editor.saveForUndo(!0)},l.oninput=()=>{const t=this.getDeviceTarget(o);let e=l.value,i=this.element;if("xs"===t){let t=i.getAttribute("data-bg-xs");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionX=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-xs",n.style.cssText)}else if("sm"===t){let t=i.getAttribute("data-bg-sm");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionX=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-sm",n.style.cssText)}else if("md"===t){let t=i.getAttribute("data-bg-md");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionX=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-md",n.style.cssText)}else{let t=i.getAttribute("data-bg-lg");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionX=e+"%",i.setAttribute("data-bg-lg",n.style.cssText)}i.style.backgroundPositionX=e+"%",i.style.left="",i.style.top="",i.style.width="",i.style.height="",i.removeAttribute("data-x"),i.removeAttribute("data-y"),i.removeAttribute("data-scale")},l.onchange=()=>{this.builder.onChange()};const r=t.querySelector(".inp-vert-slider");r.onfocus=()=>{this.builder.editor.saveForUndo(!0)},r.oninput=()=>{const t=this.getDeviceTarget(o);let e=r.value,i=this.element;if("xs"===t){let t=i.getAttribute("data-bg-xs");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionY=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-xs",n.style.cssText)}else if("sm"===t){let t=i.getAttribute("data-bg-sm");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionY=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-sm",n.style.cssText)}else if("md"===t){let t=i.getAttribute("data-bg-md");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionY=e+"%",n.style.backgroundSize="cover",i.setAttribute("data-bg-md",n.style.cssText)}else{let t=i.getAttribute("data-bg-lg");t||(t="");let n=document.createElement("div");n.style.cssText=t,n.style.backgroundPositionY=e+"%",i.setAttribute("data-bg-lg",n.style.cssText)}i.style.backgroundPositionY=e+"%",i.style.left="",i.style.top="",i.style.width="",i.style.height="",i.removeAttribute("data-x"),i.removeAttribute("data-y"),i.removeAttribute("data-scale")},r.onchange=()=>{this.builder.onChange()};t.querySelector(".btn-reset").addEventListener("click",(()=>{this.resetImage()}))}getState(){this.realtimeImageAdjust()}getDeviceTarget(t){return t.querySelector("button.on").getAttribute("data-device")}realtimeImageAdjust(){let t=this.element;const e=this.dialog,i=e.querySelector(".div-target");if(this.builder.iframePanel){i.querySelectorAll("[data-device]").forEach((t=>t.classList.remove("on")));let t=this.builder.screenMode;"mobile"===t?i.querySelector('[data-device="xs"]').classList.add("on"):"tablet"===t?i.querySelector('[data-device="sm"]').classList.add("on"):"tablet-landscape"===t?i.querySelector('[data-device="md"]').classList.add("on"):i.querySelector('[data-device=""]').classList.add("on")}const n=this.getDeviceTarget(i),o=e.querySelector(".inp-scale-slider"),s=e.querySelector(".inp-hor-slider"),a=e.querySelector(".inp-vert-slider");o.value=100,s.value=50,a.value=60,o.disabled=!1,(t.classList.contains("cell-active")||t.classList.contains("is-row-overlay"))&&(s.value=0,a.value=0);let l=document.createElement("div");if("xs"===n){let e=t.getAttribute("data-bg-xs");e||(e=""),l.style.cssText=e,o.disabled=!0,o.style.opacity=.6}else if("sm"===n){let e=t.getAttribute("data-bg-sm");e||(e=""),l.style.cssText=e,o.disabled=!0,o.style.opacity=.6}else if("md"===n){let e=t.getAttribute("data-bg-md");e||(e=""),l.style.cssText=e,o.disabled=!0,o.style.opacity=.6}else{let e=t.getAttribute("data-bg-lg");e||(e=""),l.style.cssText=e,o.disabled=!1,o.style.opacity=""}if(l.style.backgroundSize){let t,e=l.style.backgroundSize;t=isNaN(parseInt(e))?100:parseInt(e),-1!==e.indexOf("%")&&(o.value=t)}if(l.style.backgroundPositionX){let t,e=l.style.backgroundPositionX;t=isNaN(parseInt(e))?0:parseInt(e),-1!==e.indexOf("%")&&(s.value=t)}if(l.style.backgroundPositionY){let t,e=l.style.backgroundPositionY;t=isNaN(parseInt(e))?0:parseInt(e),-1!==e.indexOf("%")&&(a.value=t)}}resetImage(){let t=this.element;const e=this.dialog,i=e.querySelector(".inp-scale-slider"),n=e.querySelector(".inp-hor-slider"),o=e.querySelector(".inp-vert-slider");n.value=50,o.value=60,i.value=0,(t.classList.contains("cell-active")||t.classList.contains("is-row-overlay"))&&(n.value=0,o.value=0),t.style.backgroundPositionX="",t.style.backgroundPositionY="",t.style.backgroundSize="cover",t.style.left="",t.style.top="",t.style.width="",t.style.height="",t.removeAttribute("data-x"),t.removeAttribute("data-y"),t.removeAttribute("data-scale"),t.removeAttribute("data-bg-xs"),t.removeAttribute("data-bg-sm"),t.removeAttribute("data-bg-md"),t.removeAttribute("data-bg-lg")}saveOri(){let t=this.element;const e=document.createElement("div");e.style.backgroundPositionX=t.style.backgroundPositionX,e.style.backgroundPositionY=t.style.backgroundPositionY,e.style.backgroundSize=t.style.backgroundSize,t.hasAttribute("data-bg-lg")||t.setAttribute("data-bg-lg",e.style.cssText)}open(t){this.dialog.style.display="flex",this.element=t,this.saveOri(),this.getState()}close(){this.dialog.style.display=""}}class Ne{constructor(){this.modal=null,this.focusableElements=[],this.previouslyFocusedElement=null,this.clickOutsideModal=this.clickOutsideModal.bind(this),this.handleEscKey=this.handleEscKey.bind(this)}showModal(t){this.modal=t,this.modal?(this.focusableElements=Array.from(this.modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')),this.previouslyFocusedElement=document.activeElement,this.modal.style.display="block",this.modal.setAttribute("aria-hidden","false"),document.addEventListener("click",this.clickOutsideModal),document.addEventListener("keydown",this.handleEscKey),this.focusableElements.length>0&&this.focusableElements[0].focus()):console.error("Modal element not found.")}clickOutsideModal(t){const e=this.modal.querySelector(".modal-content");"block"!==this.modal.style.display||e.contains(t.target)||t.target===this.previouslyFocusedElement||this.closeModal()}closeModal(){this.modal&&"block"===this.modal.style.display&&(this.modal.style.display="none",this.modal.setAttribute("aria-hidden","true"),document.removeEventListener("click",this.clickOutsideModal),document.removeEventListener("keydown",this.handleEscKey),this.previouslyFocusedElement&&this.previouslyFocusedElement.focus())}handleEscKey(t){"Escape"===t.key&&this.closeModal()}}class ze{constructor(t,e){this.builder=e,this.dialog=t;let n=`\n <button class="btn-back" tabindex="-1" title="${i("Close")}"><svg class="is-icon-flex"><use xlink:href="#icon-arrow-back"></use></svg></button>\n \n <div class="submain">\n\n <div class="label" style="font-size:18px">${i("Settings")}</div>\n\n <div class="label">${i("Paste")}:</div>\n <select class="inp-paste">\n <option value="html-without-styles">${i("HTML (without styles)")}</option>\n <option value="html">${i("HTML (with styles)")}</option>\n <option value="text">${i("Text only")}</option>\n </select>\n\n <div class="label">${i("HTML View")}:</div>\n <select class="inp-htmlview">\n <option value="shorten">${i("Shorten HTML")}</option>\n <option value="actual">${i("Actual")}</option>\n </select>\n\n <div class="label">${i("Theme")}:</div>\n <div class="group">\n <button type="button" title="${i("Light")}" data-theme="light" style="background:#fff;border:rgb(132 132 132 / 16%) 1px solid;"></button>\n <button type="button" title="${i("Dark")}" data-theme="dark" style="background:#000;border:rgba(0,0,0,0.15) 1px solid;"></button>\n </div>\n\n </div>\n `;t.insertAdjacentHTML("beforeend",n),this.dialog=t;const o=t.querySelector(".inp-paste");o.addEventListener("change",(()=>{const t=o.value;this.builder.editor.paste=t,localStorage.setItem("_pasteresult",t)}));const s=t.querySelector(".inp-htmlview");s.addEventListener("change",(()=>{const t=s.value;this.builder.editor.shortenHTML="shorten"===t,localStorage.setItem("_htmlview",t)}));t.querySelectorAll("[data-theme]").forEach((t=>{t.addEventListener("click",(()=>{const e=t.getAttribute("data-theme");if("light"===e&&(this.builder.editor.setUIColor(""),localStorage.setItem("_theme",0)),"dark"===e){const t=this.builder.themes[1][2];this.builder.editor.setUIColor("dark",t),localStorage.setItem("_theme",1)}this.builder.controlpanel.controlPanel.querySelectorAll("iframe").forEach((t=>{let i=t.contentDocument||t.contentWindow.document;"dark"===e?i.body.classList.add("dark"):i.body.classList.remove("dark")}))}))}));t.querySelector(".btn-back").addEventListener("click",(()=>{this.close()}))}getState(){const t=this.dialog;if(null!==localStorage.getItem("_pasteresult")&&(this.builder.editor.paste=localStorage.getItem("_pasteresult")),null!==localStorage.getItem("_htmlview")){let t=localStorage.getItem("_htmlview");this.builder.editor.shortenHTML="shorten"===t}t.querySelector(".inp-paste").value=this.builder.editor.paste;const e=t.querySelector(".inp-htmlview");this.builder.editor.shortenHTML?e.value="shorten":e.value="actual"}open(){this.dialog.style.display="flex",this.getState()}close(){this.dialog.style.display=""}}class De{constructor(t){this.builder=t;let e=document.querySelector("#_newbox");e||(e=document.createElement("div"),e.id="_newbox",e.classList.add("builder-ui"),e.style.height="0px",e.style.float="left",e.style.marginTop="-100px",document.body.appendChild(e),e=document.querySelector("#_newbox")),this.builderStuff=e;let n=e.querySelector(".is-controlpanel");if(!n){let t=`\n <div class="is-controlpanel keep-selection is-side scroll-darker">\n\n <div class="is-devpanel">\n <button class="btn-close tooltip" title="${i("Close")}">\n <svg style="width:22px;height:22px;"><use xlink:href="#icon-close-right"></use></svg>\n </button>\n <div class="flex">\n <button class="btn-blocks tooltip" title="${i("Blocks")}" style="display:none">\n <svg><use xlink:href="#icon-plus2"></use></svg>\n </button>\n\n ${this.builder.undoRedoButtons?`\n <button class="btn-undo tooltip" title="${i("Undo")}">\n <svg style="width:14px;height:14px"><use xlink:href="#ion-ios-undo"></use></svg>\n </button>\n <button class="btn-redo tooltip" title="${i("Redo")}">\n <svg style="width:14px;height:14px"><use xlink:href="#ion-ios-redo"></use></svg>\n </button>\n `:""}\n\n <button class="btn-code tooltip" title="${i("Code")}" style="display:none">\n <svg><use xlink:href="#icon-code"></use></svg>\n </button>\n\n ${this.builder.toggleDeviceButton?`\n <button class="btn-toggledevice tooltip" title="${i("Toggle Device Toolbar")}">\n <svg><use xlink:href="#icon-devices"></use></svg>\n </button>\n `:""}\n \n <button class="btn-more tooltip" title="${i("More")}">\n <svg><use xlink:href="#icon-dots"></use></svg>\n </button>\n </div>\n </div>\n \n <div class="panelnav">\n <div class="part-breadcrumb"></div>\n <h3 class="part-title"></h3>\n <div class="part-empty">${i("No Selection.")}</div>\n </div>\n\n <div class="panel-code"></div>\n <div class="panel-text"></div>\n <div class="panel-image"></div>\n <div class="panel-video"></div>\n <div class="panel-icon"></div>\n <div class="panel-audio"></div>\n <div class="panel-iframe"></div>\n <div class="panel-spacer"></div>\n <div class="panel-column"></div>\n <div class="panel-row"></div>\n <div class="panel-container"></div>\n <div class="panel-box"></div>\n <div class="panel-section"></div>\n\n <div class="panel-dialog icons"></div>\n <div class="panel-dialog spacingfull"></div>\n <div class="panel-dialog spacingcontainer"></div>\n <div class="panel-dialog blocks"></div>\n <div class="panel-dialog element"></div>\n <div class="panel-dialog imageadjust"></div>\n <div class="panel-dialog settings"></div>\n <div class="panel-dialog shadow"></div>\n\n <div class="panel-pop more" tabIndex="-1" aria-hidden="true">\n \x3c!--<button class="btn-preferences" title="${i("Preferences")}">${i("Preferences")}</button>--\x3e\n <button class="btn-settings" title="${i("Settings")}">${i("Settings")}</button>\n <div class="label label-plugins text-center" style="display:none">\n ${i("Plugins")}:\n </div>\n <div class="plugins"></div>\n </div>\n\n <div class="is-modal modal-settings" aria-hidden="true">\n <div class="modal-content">\n <div style="padding:30px">\n <p>Modal content goes here.</p>\n </div>\n </div>\n </div>\n\n </div>\n\n `;e.insertAdjacentHTML("beforeend",t),n=e.querySelector(".is-controlpanel")}this.controlPanel=n,this.modal=new Ne,this.panelText=n.querySelector(".panel-text"),this.panelImage=n.querySelector(".panel-image"),this.panelVideo=n.querySelector(".panel-video"),this.panelAudio=n.querySelector(".panel-audio"),this.panelIframe=n.querySelector(".panel-iframe"),this.panelSpacer=n.querySelector(".panel-spacer"),this.panelIcon=n.querySelector(".panel-icon"),this.panelCode=n.querySelector(".panel-code"),this.panelColumn=n.querySelector(".panel-column"),this.panelRow=n.querySelector(".panel-row"),this.panelContainer=n.querySelector(".panel-container"),this.panelBox=n.querySelector(".panel-box"),this.panelSection=n.querySelector(".panel-section"),this.breadcrumb=n.querySelector(".part-breadcrumb"),this.title=n.querySelector(".part-title"),this.empty=n.querySelector(".part-empty"),this.dialogIcons=n.querySelector(".panel-dialog.icons"),this.dialogSpacingColumn=n.querySelector(".panel-dialog.spacingfull"),this.dialogSpacingContainer=n.querySelector(".panel-dialog.spacingcontainer"),this.dialogBlocks=n.querySelector(".panel-dialog.blocks"),this.dialogElement=n.querySelector(".panel-dialog.element"),this.dialogShadow=n.querySelector(".panel-dialog.shadow"),this.dialogImageAdjust=n.querySelector(".panel-dialog.imageadjust"),this.dialogSettings=n.querySelector(".panel-dialog.settings"),this.more=n.querySelector(".panel-pop.more"),this.objDialogIcons=new q(this.dialogIcons,this.builder),this.objDialogSpacingColumn=new T(this.dialogSpacingColumn,this.builder),this.objDialogSpacingContainer=new M(this.dialogSpacingContainer,this.builder),this.objDialogBlocks=new $e(this.dialogBlocks,this.builder),this.objDialogElement=new Re(this.dialogElement,this.builder),this.objDialogShadow=new Be(this.dialogShadow,this.builder),this.objDialogImageAdjust=new Pe(this.dialogImageAdjust,this.builder),this.objDialogSettings=new ze(this.dialogSettings,this.builder),this.objPanelText=new v(this.panelText,this.builder),this.objPanelImage=new f(this.panelImage,this.builder),this.objPanelVideo=new y(this.panelVideo,this.builder),this.objPanelAudio=new x(this.panelAudio,this.builder),this.objPanelIframe=new _(this.panelIframe,this.builder),this.objPanelSpacer=new w(this.panelSpacer,this.builder),this.objPanelIcon=new S(this.panelIcon,this.builder),this.objPanelCode=new k(this.panelCode,this.builder),this.objPanelColumn=new A(this.panelColumn,this.builder),this.objPanelRow=new E(this.panelRow,this.builder),this.objPanelBox=new C(this.panelBox,this.builder),this.objPanelSection=new L(this.panelSection,this.builder);let o=this.builder.onPageContentClick;this.builder.onPageContentClick=t=>{o&&o.call(this),this.builder.controlPanel&&!document.body.classList.contains("controlpanel")&&this.open(),document.body.classList.contains("controlpanel")&&this.clickContent(t)};n.querySelector(".btn-close").addEventListener("click",(()=>{this.close()}));const s=n.querySelector(".btn-toggledevice");!this.builder.iframeSrc&&s&&(s.style.display="none"),s&&s.addEventListener("click",(()=>{this.toggleDevice()}));const a=n.querySelector(".btn-undo");a&&a.addEventListener("click",(()=>{this.builder.editor.undo()}));const l=n.querySelector(".btn-redo");l&&l.addEventListener("click",(()=>{this.builder.editor.redo()}));const r=n.querySelector(".btn-code");r&&r.addEventListener("click",(()=>{this.builder.sidebar.viewHtml()}));const c=n.querySelector(".btn-blocks");c&&c.addEventListener("click",(()=>{this.objDialogBlocks.open()}));const d=n.querySelector(".btn-more");d&&d.addEventListener("click",(()=>{this.showPop(this.more,(()=>{d.focus()}),d,12,-6)}));const u=n.querySelector(".btn-inspect");u&&u.addEventListener("click",(()=>{this.objDialogElement.open(),this.hidePop(this.more)}));n.querySelector(".btn-settings").addEventListener("click",(()=>{this.objDialogSettings.open(),this.hidePop(this.more)}));n.querySelectorAll(".btn-device").forEach((t=>{this.builder.iframeSrc||(t.style.display="none"),t.addEventListener("click",(()=>{const t=this.builder.screenMode;"desktop"===t?this.builder.iframePanel.setScreenMode("tablet-landscape"):"tablet-landscape"===t?this.builder.iframePanel.setScreenMode("tablet"):"tablet"===t?this.builder.iframePanel.setScreenMode("mobile"):("mobile"===t||"fullview"===t)&&this.builder.iframePanel.setScreenMode("desktop")}))}));n.querySelectorAll(".accordion-item").forEach((t=>{const e=t.nextElementSibling;e.style.display="none",t.addEventListener("click",(()=>{"false"===e.getAttribute("aria-hidden")?(t.setAttribute("aria-expanded","false"),e.setAttribute("aria-hidden","true"),setTimeout((()=>{e.style.display="none"}),250)):(e.style.display="",setTimeout((()=>{t.setAttribute("aria-expanded","true"),e.setAttribute("aria-hidden","false")}),1))}))}))}clearPreview(){this.objPanelImage.clear(),this.objPanelVideo.clear(),this.objPanelAudio.clear(),this.objPanelIframe.clear(),this.objPanelColumn.clear(),this.objPanelRow.clear(),this.objPanelBox.clear()}editorReady(){this.objPanelText.editorReady(),this.objPanelImage.editorReady(),this.objPanelVideo.editorReady(),this.objPanelAudio.editorReady(),this.objPanelIframe.editorReady(),this.objPanelSpacer.editorReady(),this.objPanelIcon.editorReady(),this.objPanelCode.editorReady(),this.builder.editor.onSelectChange=()=>{document.body.classList.contains("controlpanel")&&(this.activeColumn=this.builder.doc.querySelector(".cell-active"),this.activeColumn?this.select("column"):this.select("box"),this.closeDialogs(),this.clearPreview())},this.builder.onSelectChange=()=>{document.body.classList.contains("controlpanel")&&(this.select(""),this.builder.activeBox?this.select("box"):this.select(""),this.closeDialogs())},this.builder.editor.controlpanel=this,this.showTooltip()}closeDialogs(){this.objDialogIcons.close(),this.objDialogSpacingColumn.close(),this.objDialogSpacingContainer.close(),this.objDialogBlocks.close(),this.objDialogElement.close(),this.objDialogShadow.close(),this.objDialogImageAdjust.close()}closeContentDialogs(){this.objDialogIcons.close(),this.objDialogSpacingColumn.close(),this.objDialogElement.close(),this.objDialogShadow.close(),this.objDialogImageAdjust.close()}toggleDevice(){if(this.builder.iframeSrc&&!this.builder.controlPanel){"fullview"!==this.builder.screenMode?this.builder.iframePanel.setScreenMode("fullview"):this.builder.iframePanel.setScreenMode("desktop")}else if(this.builder.iframeSrc&&this.builder.controlPanel){const t=this.controlPanel.querySelector(".btn-toggledevice");"fullview"!==this.builder.screenMode?(this.builder.iframePanel.setScreenMode("fullview"),t.classList.remove("on")):(this.builder.iframePanel.setScreenMode("desktop"),t.classList.add("on"))}}open(){document.body.classList.add("controlpanel"),this.builder.win.noRender=!0,this.builder.wrapperEl.style.transition="all ease 0.3s",setTimeout((()=>{this.builder.wrapperEl.style.transition=""}),300),this.getActive(),this.activeElement?this.select("element"):this.activeElement||this.activeColumn||this.activeRow||!this.activeBox?this.select(""):this.select("box"),this.repositionTool()}close(){document.body.classList.remove("controlpanel"),this.builder.wrapperEl.style.transition="all ease 0.3s",setTimeout((()=>{this.builder.wrapperEl.style.transition=""}),300),this.repositionTool()}repositionTool(){if(this.activeRow){const t=this.activeRow.querySelector(".is-col-tool"),e=this.activeRow.querySelector(".is-row-tool");t.style.opacity="0",e.style.opacity="0",setTimeout((()=>{this.builder.editor.util.repositionColumnTool(),t.style.opacity="",e.style.opacity="",this.builder.editor.elmTool.pos()}),600)}let t=this.builder.editor.activeImage,e=this.builder.editor.activeModule;if(t&&e)this.builder.editor.element.image.hideImageTool(),setTimeout((()=>{this.panelImage.classList.remove("active")}),1),setTimeout((()=>{this.builder.editor.util.refreshModuleLayout(e)}),600);else if(t){const t=document.querySelector("#divImageTool"),e=document.querySelector("#divImageResizer"),i=document.querySelector(".moveable-control-box");t.style.opacity="0",e.style.opacity="0",i.style.opacity="0",setTimeout((()=>{t.style.opacity="",e.style.opacity="",i.style.opacity="",this.builder.editor.element.image.repositionImageTool()}),600)}}getActive(){let t,e,i=this.builder.editor.inspectedElement,n=this.builder.editor.activeCol;n?(t=n.parentNode,e=t.parentNode):(i=null,t=null,e=null);let o,s=this.builder.activeBox;s&&(o=s.closest(".is-section")),this.activeElement=i,this.activeColumn=n,this.activeRow=t,this.activeContainer=e,this.activeBox=s,this.activeSection=o}clickContent(){this.hidePop(this.more),this.getActive(),this.objDialogIcons.close(),this.activeBox||this.objDialogContainer.close(),this.activeColumn||this.objDialogSpacingColumn.close(),this.objDialogImageAdjust.close(),this.activeElement&&this.select("element"),this.activeElement||this.activeColumn||this.activeRow||!this.activeBox||this.select("box")}breadcrumbRender(t){let e='<svg class="is-icon-flex"><use xlink:href="#icon-right"></use></svg>',n=`<a href="#" data-value="section">${i("Section")}</a>`,o=`<a href="#" data-value="box">${i("Box")}</a>`,s=`<a href="#" data-value="row">${i("Row")}</a>`,a=`<a href="#" data-value="column">${i("Column")}</a>`,l="";"element"===t?l=`<div>${n} ${e} ${o} ${e}</div><div>${s} ${e} ${a} ${e}</div>`:"column"===t?l=`<div>${n} ${e} ${o} ${e}</div><div>${s} ${e}`:"row"===t||"container"===t?l=`<div>${n} ${e} ${o} ${e}</div>`:"box"===t?l=`<div>${n} ${e}</div>`:"section"===t&&(l=""),this.breadcrumb.innerHTML=l;this.breadcrumb.querySelectorAll("a").forEach((t=>{t.addEventListener("click",(e=>{const i=t.getAttribute("data-value");this.select(i,!0),e.preventDefault(),e.stopImmediatePropagation()}))}))}animSelection(t){t.classList.add("selection-active"),setTimeout((()=>{t.style.transition="",t.classList.remove("selection-active")}),1e3)}select(t,e){if("column"===t&!this.activeColumn&&this.activeBox)this.select("box");else{if(""===t)return this.breadcrumb.innerHTML="",this.title.innerHTML="",this.title.style.display="none",this.empty.style.display="",void this.hidePanels();if(this.title.style.display="",this.empty.style.display="none",this.builder.selectWhat=t,this.showPanel(t),"column"===t&&(this.builder.editor.hideElementTools(),e&&this.animSelection(this.activeColumn)),"row"===t&&(this.activeRow.classList.remove("row-outline"),this.builder.editor.util.hideColumnTool(),this.builder.editor.hideElementTools(),e&&this.animSelection(this.activeRow)),"container"===t&&(this.builder.editor.util.clearActiveCell(),this.builder.editor.util.clearPops(),this.builder.wrapperEl.classList.remove("hard-select"),this.activeContainer.style.transition="none",this.activeContainer.classList.add("container-select"),e&&this.animSelection(this.activeContainer)),"box"===t){let t=this.activeBox,i=this.activeSection;this.builder.editor.util.clearActiveCell(),this.builder.editor.util.clearPops(),this.builder.editor.hideElementTools(),this.closeContentDialogs(),this.builder.wrapperEl.classList.add("hard-select"),this.builder.wrapperEl.classList.remove("is-clean-edit"),t.classList.add("box-select"),this.builder.activeBox=t,i.classList.add("section-select"),this.builder.activeSection=i,this.builder.positionTool(t),e&&this.animSelection(this.activeBox)}if("section"===t){let t=this.activeBox,i=this.activeSection;this.builder.editor.util.clearActiveCell(),this.builder.editor.util.clearPops(),this.builder.editor.hideElementTools(),this.closeContentDialogs(),this.builder.wrapperEl.classList.add("hard-select"),this.builder.wrapperEl.classList.remove("is-clean-edit"),t.classList.add("box-select"),this.builder.activeBox=t,i.classList.add("section-select"),this.builder.activeSection=i,this.builder.positionTool(t),e&&this.animSelection(this.activeSection)}}}hidePanels(){this.panelText.classList.remove("active"),this.panelImage.classList.remove("active"),this.panelVideo.classList.remove("active"),this.panelAudio.classList.remove("active"),this.panelIframe.classList.remove("active"),this.panelSpacer.classList.remove("active"),this.panelIcon.classList.remove("active"),this.panelCode.classList.remove("active"),this.panelColumn.classList.remove("active"),this.panelRow.classList.remove("active"),this.panelContainer.classList.remove("active"),this.panelBox.classList.remove("active"),this.panelSection.classList.remove("active")}refresh(){this.what&&document.body.classList.contains("controlpanel")&&this.showPanel(this.what)}showPanel(t){if(this.what=t,this.hidePanels(),this.clearPreview(),this.breadcrumbRender(t),"element"===t)if(this.activeElement.classList.contains("ovl")&&this.activeElement.parentNode.querySelector("audio")?this.activeElement=this.activeElement.parentNode.querySelector("audio"):this.activeElement.classList.contains("ovl")&&(this.activeElement=this.activeElement.parentNode.querySelector("iframe")),this.activeElement.closest("[data-html]")&&!this.activeElement.closest("[data-subblock]")){let t="",e=this.activeElement.closest("[data-module]");if(e){let n=e.getAttribute("data-module-desc");t=i(n||"Module")}else t=i("Code");this.title.innerHTML=t,this.panelCode.classList.add("active"),this.objPanelCode.getState()}else if(this.activeElement.closest("[data-noedit]")&&!this.activeElement.closest("[data-html]")){let t=i("Locked");this.title.innerHTML=t}else{if(this.activeElement.querySelector(".icon")&&this.activeElement.childElementCount,"img"===this.activeElement.tagName.toLowerCase()){let t=i("Image");this.title.innerHTML=t,this.panelImage.classList.add("active"),this.objPanelImage.getState()}else if("video"===this.activeElement.tagName.toLowerCase()){let t=i("Video");this.title.innerHTML=t,this.panelVideo.classList.add("active"),this.objPanelVideo.getState()}else if("audio"===this.activeElement.tagName.toLowerCase()){let t=i("Audio");this.title.innerHTML=t,this.panelAudio.classList.add("active"),this.objPanelAudio.getState()}else if(this.activeElement.classList.contains("spacer")){let t=i("Spacer");this.title.innerHTML=t,this.panelSpacer.classList.add("active"),this.objPanelSpacer.getState()}else if("iframe"===this.activeElement.tagName.toLowerCase()){let t="",e=this.activeElement.getAttribute("src");e=e.toLowerCase(),t=e.includes("youtube")||e.includes("vimeo")?i("Video"):e.includes("google.com/maps")?i("Map"):i("IFrame"),this.title.innerHTML=t,this.panelIframe.classList.add("active"),this.objPanelIframe.getState()}else if("i"===this.activeElement.tagName.toLowerCase()&&this.activeElement.classList.contains("icon")){let t=i("Icon");this.title.innerHTML=t,this.panelIcon.classList.add("active"),this.objPanelIcon.getState()}else{let t=i("Text");this.title.innerHTML=t,this.panelText.classList.add("active"),this.objPanelText.getState()}if(this.activeElement.closest("[data-subblock]")){let t="",e=this.activeElement.closest("[data-html]").getAttribute("data-module-desc");t=i(e||"Module"),this.title.innerHTML=t,this.panelCode.classList.add("active"),this.objPanelCode.getState()}}if("column"===t)if(this.activeColumn.closest("[data-noedit]")&&!this.activeColumn.closest("[data-html]")){let t=i("Column - Locked");this.title.innerHTML=t}else{let t=i("Column");this.title.innerHTML=t,this.panelColumn.classList.add("active"),this.objPanelColumn.getState()}if("row"===t){let t=i("Row");this.title.innerHTML=t,this.panelRow.classList.add("active"),this.objPanelRow.getState()}if("container"===t){let t=i("Container");this.title.innerHTML=t,this.panelContainer.classList.add("active")}if("box"===t){let t=i("Box");this.title.innerHTML=t,this.panelBox.classList.add("active"),this.objPanelBox.getState()}if("section"===t){let t=i("Section");this.title.innerHTML=t,this.panelSection.classList.add("active"),this.objPanelSection.getState()}"flex"===this.dialogSpacingColumn.style.display&&this.objDialogSpacingColumn.getState(),"flex"===this.dialogSpacingContainer.style.display&&this.objDialogSpacingContainer.getState(),"flex"===this.dialogElement.style.display&&this.objDialogElement.getState(),"flex"===this.dialogImageAdjust.style.display&&this.objDialogImageAdjust.getState()}showTooltip(){let t=document.querySelector(".is-controlpanel").querySelectorAll(".tooltip");Array.prototype.forEach.call(t,(t=>{t.setAttribute("data-title",t.getAttribute("title")),this.builder.editor.tooltip.set(t)}))}showPop(t,e,i,n=0,o=0){document.querySelectorAll(".panel-pop").forEach((t=>{this.hidePop(t)})),t.style.display="flex",t.setAttribute("aria-hidden",!1),t.focus({preventScroll:!0}),this.builder.editor.util.setupTabKeys(t),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e())},this.handlePopKeyDown=i=>{27===i.keyCode&&(this.hidePop(t),e&&e())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("click",this.handlePopClickOut);let s=i.getBoundingClientRect().top+22,a=i.getBoundingClientRect().left-t.offsetWidth+i.offsetWidth+6;t.style.top=`${s+n}px`,t.style.left=`${a+o}px`}hidePop(t){t.style.display="",t.setAttribute("aria-hidden",!0),t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("click",this.handlePopClickOut)}}class He{constructor(t){this.builder=t,this.dom=this.builder.dom}cellSelected(){return this.builder.doc.querySelector(".cell-active")}rowSelected(){return this.builder.doc.querySelector(".row-active")}builderStuff(){return document.querySelector("#_cbhtml")}cellNext(t){const e=this.dom;let i=t.nextElementSibling;return i?e.hasClass(i,"is-row-tool")||e.hasClass(i,"is-col-tool")||e.hasClass(i,"is-rowadd-tool")||e.hasClass(i,"is-row-overlay")?null:i:null}out(t){if(this.builder){let e=this.builder.opts.lang[t];return e||(this.builder.checkLang&&console.log(t),t)}return t}showMessage(t,e,i){const n=this.dom;let o="";o=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n <button title="${this.out("Ok")}" class="input-ok classic">${this.out("Ok")}</button>\n </div>\n </div>`;const s=this.builder.builderStuff;let a=s.querySelector(".modalmessage");a||(n.appendHtml(s,o),a=s.querySelector(".modalmessage")),this.showModal(a,!1,(()=>{a.parentNode.removeChild(a),i&&i()}));let l=a.querySelector(".modalmessage .input-ok");n.addEventListener(l,"click",(()=>{this.hideModal(a),a.parentNode&&a.parentNode.removeChild(a),i&&i()})),l.focus(),e&&l.classList.add("focus-outline")}showChoice(t,e,i){const n=this.dom;let o="";o=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n\n <div style="display:flex;">\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary" style="width:100%;margin-right:4px;">${this.out("Cancel")}</button>\n <button title="${e}" class="input-ok classic-primary" style="width:100%">${e}</button>\n </div>\n </div>\n </div>`;const s=this.builder.builderStuff;let a=s.querySelector(".modalmessage");a||(n.appendHtml(s,o),a=s.querySelector(".modalmessage")),this.showModal(a,!1,(()=>{a.parentNode.removeChild(a),i(!1)}));let l=a.querySelector(".modalmessage .input-cancel");n.addEventListener(l,"click",(()=>{this.hideModal(a),a.parentNode.removeChild(a),i(!1)})),l.focus();let r=a.querySelector(".modalmessage .input-ok");n.addEventListener(r,"click",(()=>{this.hideModal(a),a.parentNode.removeChild(a),i(!0)}))}confirm(t,e,i,n,o){if(!this.builder.deleteConfirm&&!o)return void e(!0);const s=this.dom;let a="";a=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Delete")}" class="input-ok classic focus-warning">${this.out("Delete")}</button>\n </div>\n </div>`,i&&(a=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary">${this.out("Cancel")}</button>\n <button title="${n}" class="input-ok classic-primary">${n}</button>\n </div>\n </div>`);const l=this.builder.builderStuff;let r=l.querySelector(".is-confirm");r||(s.appendHtml(l,a),r=l.querySelector(".is-confirm")),this.showModal(r,!1,(()=>{r.parentNode.removeChild(r),e(!1)}),!0);let c=r.querySelector(".is-confirm .input-ok");s.addEventListener(c,"click",(()=>{this.hideModal(r),r.parentNode.removeChild(r),e(!0)}));let d=r.querySelector(".is-confirm .input-cancel");s.addEventListener(d,"click",(t=>{this.hideModal(r),r.parentNode.removeChild(r),e(!1),t.preventDefault(),t.stopImmediatePropagation()}))}showRtePop(t,e,i){const n=this.dom;t.style.display="flex",e&&e(),n.removeClass(t,"deactive"),n.addClass(t,"active");const o=e=>{t.contains(e.target)||i.contains(e.target)||e.target.closest(".pickcolormore")||(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))},s=e=>{27===e.keyCode&&(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))};t.addEventListener("keydown",s),document.addEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",o)}hideRtePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),e.addClass(t,"deactive")}clearAllEventListener(t){for(let e=0;e<10;e++)t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",this.handlePopClickOut)}showPop(t,e,i){const n=this.dom;let o=document.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(o,(e=>{e!==t&&(e.style.display="",n.removeClass(e,"active"),e.setAttribute("aria-hidden",!0))})),this.clearAllEventListener(t),t.style.display="flex",n.addClass(t,"active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e())},this.handlePopKeyDown=i=>{27===i.keyCode&&(this.hidePop(t),e&&e())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",this.handlePopClickOut)}hidePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),this.clearAllEventListener(t)}setupTabKeys(t){let e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0],n=e[e.length-1];n.addEventListener("keydown",(n=>{9!==n.which||n.shiftKey||(n.preventDefault(),e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])'),i=e[0],i.focus())})),i.addEventListener("keydown",(t=>{9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}));t.querySelectorAll("iframe").forEach((t=>{t.addEventListener("focus",(()=>{const e=t.contentWindow.document.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0];i&&i.focus()}))}))}showModal(t,e,i,n,o){const s=this.dom;s.addClass(t,"active"),t.setAttribute("aria-hidden",!1),o&&(document.body.style.overflow="hidden");const a=e=>{if(27===e.keyCode){o&&(document.body.style.overflow=""),s.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",a);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()}};t.addEventListener("keydown",a);let l=t.querySelector(".is-tab-content.active");l?(l.focus(),this.builder.tabs.setupTabKey(l)):(this.setupTabKeys(t),t.focus());let r=!1;if(this.builder?this.builder.opts.animateModal&&(r=!0,n||(r=!1)):n&&(r=!0),r&&this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.style.transform=`scale(${this.builder.opts.zoom-.02})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom-.02})`,t.style.MozTransform=`scale(${this.builder.opts.zoom-.02})`,t.setAttribute("scaled-down","1")}))}const c=t.querySelector(".is-modal-overlay");if(c&&c.parentNode.removeChild(c),!t.querySelector(".is-modal-overlay")){let n;if(n=e?'<div class="is-modal-overlay overlay-stay"></div>':'<div class="is-modal-overlay"></div>',t.insertAdjacentHTML("afterbegin",n),!e){let e=t.querySelector(".is-modal-overlay");s.addEventListener(e,"click",(()=>{o&&(document.body.style.overflow=""),this.hideModal(t),t.removeEventListener("keydown",a);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()}))}}const d=()=>{o&&(document.body.style.overflow=""),s.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",a);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",d),i&&i()},u=t.querySelector(".is-modal-close");u&&s.addEventListener(u,"click",d)}_hideModal(t){let e=t.querySelector(".is-modal-overlay");e?e.classList.contains("overlay-stay")?(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1}))):e.click():(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1})))}hideModal(t){if(t.setAttribute("aria-hidden",!0),this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.getAttribute("scaled-down")&&(t.style.transform=`scale(${this.builder.opts.zoom})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom})`,t.style.MozTransform=`scale(${this.builder.opts.zoom})`,t.removeAttribute("scaled-down"))}))}this.dom.removeClass(t,"active"),t.style.display=""}refreshModuleLayout(t){let e;t.style.height?e=t.style.height:t.style.height=`${t.offsetHeight}px`,t.style.opacity=0;let i=decodeURIComponent(t.getAttribute("data-html"));i=i.replace(/{id}/g,this.builder.util.makeId()),t.innerHTML="";let n=document.createRange();n.setStart(t,0),t.appendChild(n.createContextualFragment(i));let o=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(o,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s)),e.contentEditable=!0),s++})),setTimeout((()=>{t.style.height=e||"",t.style.opacity=""}),100)}removeColClasses(t){t.classList.remove("full"),t.classList.remove("two-third"),t.classList.remove("two-fourth"),t.classList.remove("two-fifth"),t.classList.remove("two-sixth"),t.classList.remove("half"),t.classList.remove("third"),t.classList.remove("fourth"),t.classList.remove("fifth"),t.classList.remove("sixth"),t.classList.remove("seventh"),t.classList.remove("eighth"),t.classList.remove("ninth"),t.classList.remove("tenth"),t.classList.remove("eleventh"),t.classList.remove("twelfth")}getAllColumns(t){let e=[];const i=this.dom;return i.elementChildren(t).forEach((t=>{i.hasClass(t,"is-row-tool")||i.hasClass(t,"is-col-tool")||i.hasClass(t,"is-rowadd-tool")||i.hasClass(t,"is-row-overlay")||e.push(t)})),e}fixLayout(t){const e=this.dom;let i=!1,n=!1;if(Array.from(t.children).map((e=>{e.classList.contains("is-row-tool")||e.classList.contains("is-col-tool")||e.classList.contains("is-rowadd-tool")||(e.getAttribute("data-html")?(e.style.width||(e.style.width="50%",e.style.flex="0 0 auto"),1===this.getAllColumns(t).length&&(e.style.width="",e.style.flex="")):(e.style.width="",e.style.flex=""),e.classList.contains("sm-hidden")&&(i=!0),e.classList.contains("md-hidden")&&(n=!0))})),i?t.classList.add("sm-autofit"):t.classList.remove("sm-autofit"),n?t.classList.add("md-autofit"):t.classList.remove("md-autofit"),this.builder.useDefaultGrid){return e.elementChildren(t).forEach((t=>{e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay")||this.removeColClasses(t)})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}let o=3;t.querySelector(".is-row-overlay")&&(o=4);const s=t.childElementCount-o,a=this.builder.opts.row;let l=this.builder.opts.cols;const r=this.builder.opts.colequal;if(r.length>0){return e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){for(let i=0;i<=l.length-1;i++)e.removeClass(t,l[i]);for(let i=0;i<=r.length-1;i++)if(r[i].length===s){e.addClass(t,r[i][0]);break}1===s&&e.addClass(t,l[l.length-1])}})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}if(""!==a&&l.length>0){let i=0;e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){-1!==t.className.indexOf("col-md-")||(-1!==t.className.indexOf("col-sm-")?l=["col-sm-1","col-sm-2","col-sm-3","col-sm-4","col-sm-5","col-sm-6","col-sm-7","col-sm-8","col-sm-9","col-sm-10","col-sm-11","col-sm-12"]:-1!==t.className.indexOf("col-xs-")?l=["col-xs-1","col-xs-2","col-xs-3","col-xs-4","col-xs-5","col-xs-6","col-xs-7","col-xs-8","col-xs-9","col-xs-10","col-xs-11","col-xs-12"]:-1!==t.className.indexOf("col-lg-")?l=["col-lg-1","col-lg-2","col-lg-3","col-lg-4","col-lg-5","col-lg-6","col-lg-7","col-lg-8","col-lg-9","col-lg-10","col-lg-11","col-lg-12"]:-1!==t.className.indexOf("col-xl-")?l=["col-xl-1","col-xl-2","col-xl-3","col-xl-4","col-xl-5","col-xl-6","col-xl-7","col-xl-8","col-xl-9","col-xl-10","col-xl-11","col-xl-12"]:-1!==t.className.indexOf("col-xxl-")&&(l=["col-xxl-1","col-xxl-2","col-xxl-3","col-xxl-4","col-xxl-5","col-xxl-6","col-xxl-7","col-xxl-8","col-xxl-9","col-xxl-10","col-xxl-11","col-xxl-12"])),i++;for(var n=0;n<=l.length-1;n++)e.removeClass(t,l[n]);1===s&&e.addClass(t,l[11]),2===s&&e.addClass(t,l[5]),3===s&&e.addClass(t,l[3]),4===s&&e.addClass(t,l[2]),5===s&&(5===i?e.addClass(t,l[3]):e.addClass(t,l[1])),6===s&&e.addClass(t,l[1]),7===s&&(i>=6?e.addClass(t,l[0]):e.addClass(t,l[1])),8===s&&(i>=5?e.addClass(t,l[0]):e.addClass(t,l[1])),9===s&&(i>=4?e.addClass(t,l[0]):e.addClass(t,l[1])),10===s&&(i>=3?e.addClass(t,l[0]):e.addClass(t,l[1])),11===s&&(i>=2?e.addClass(t,l[0]):e.addClass(t,l[1])),12===s&&e.addClass(t,l[0])}}))}Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}addContent(t,e,i){const n=this.dom;this.builder.opts.onAdd&&(t=this.builder.opts.onAdd(t));const o=this.cellSelected();let s;if(o)s=o.parentNode;else{if(s=this.builder.doc.querySelector(".row-active"),!s)return;e="row"}if("cell"===e||"cell-left"===e||"cell-right"===e){let a=4;this.builder.maxColumns&&(a=this.builder.maxColumns);let l,r=3;if(s.querySelector(".is-row-overlay")&&(r=4),s.childElementCount>=a+r)return alert(this.out("You have reached the maximum number of columns")),!1;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){let e=this.builder.opts.cellFormat,i=e.indexOf("</");t=e.substring(0,i)+t+e.substring(i),l=this.createElementFromHTML(t)}else{l=o.cloneNode(!0),l.removeAttribute("data-noedit"),l.removeAttribute("data-protected"),l.removeAttribute("data-module"),l.removeAttribute("data-module-desc"),l.removeAttribute("data-dialog-width"),l.removeAttribute("data-html"),l.removeAttribute("data-settings");for(let t=1;t<=20;t++)l.removeAttribute("data-html-"+t);l.removeAttribute("data-noedit"),n.removeClass(l,"cell-active"),n.removeClass(l,"is-light-text"),n.removeClass(l,"is-dark-text"),n.removeClass(l,"padding-0"),n.removeClass(l,"p-0"),l.removeAttribute("data-click"),l.removeAttribute("style"),i&&l.setAttribute(i,""),l.innerHTML=t}s.insertBefore(l,o),"cell"!==e&&"cell-right"!==e||n.moveAfter(l,o);let c=this.builder.doc.querySelector(".builder-active");c&&this.builder.applyBehaviorOn(c),this.fixLayout(s),l.click()}if("row"===e){let e,o;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){e=this.htmlToElement(this.builder.opts.rowFormat);let s=this.builder.opts.cellFormat,a=s.indexOf("</");t=s.substring(0,a)+t+s.substring(a);let l=n.elementChildren(e);for(;l.length>0&&(l=l[0],n.elementChildren(l).length>0);)l=n.elementChildren(l);l.innerHTML=t,o=l.firstChild,i&&o.setAttribute(i,"")}else o=n.createElement("div"),n.addClass(o,this.builder.opts.cols[this.builder.opts.cols.length-1]),o.innerHTML=t,i&&o.setAttribute(i,""),e=n.createElement("div"),n.addClass(e,this.builder.opts.row),n.appendChild(e,o);s.parentNode.insertBefore(e,s),n.moveAfter(e,s);let a=this.builder.doc.querySelector(".builder-active");a&&this.builder.applyBehaviorOn(a),o.click()}if("elm"===e){let e=this.builder.activeElement;if(!e)return;this.builder.uo.saveForUndo();let i=e;i.insertAdjacentHTML("afterend",t);let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n);let o=i.nextElementSibling;if("img"===o.tagName.toLowerCase()){let t=setInterval((()=>{o.complete&&(o.click(),clearInterval(t))}),30)}else o.click();let s=this.builder.builderStuff.querySelector(".quickadd");this.hidePop(s)}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}htmlToElement(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}addSnippet(t,e,i){this.builder.uo.saveForUndo();const n=this.dom;let o,s,a,l=!1;const r=this.builder.builderStuff.querySelector(".quickadd").getAttribute("data-mode");if(!e||"cell"!==r&&"cell-left"!==r&&"cell-right"!==r){if(e&&"row"===r){let e;if(a=document.createElement("div"),a.className=this.builder.opts.cols[this.builder.opts.cols.length-1],a.innerHTML=t,i&&a.setAttribute("data-noedit",""),o=document.createElement("div"),o.className=this.builder.opts.row,o.appendChild(a),s=this.builder.cellSelected(),s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(l=!0)),l){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}e.parentNode.insertBefore(o,e),n.moveAfter(o,e);let r=this.builder.doc.querySelector(".builder-active");r||(r=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(r),a.click(),o.className=o.className.replace("row-outline",""),this.builder.util.hideColumnTool()}else{if(e)return void(i?this.addContent(t,r,"data-noedit"):this.addContent(t,r));{var c=document.createElement("div");c.innerHTML=t;var d=c.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(d,(e=>{t=(t=(t=decodeURIComponent(e.getAttribute("data-html"))).replace(/{id}/g,this.makeId())).replace(/<script>/g,""+(this.builder.nonce?`<script nonce="${this.builder.nonce}">`:"<script>"));for(var i=1;i<=20;i++)t=t.replace("[%HTML"+i+"%]",void 0===e.getAttribute("data-html-"+i)?"":decodeURIComponent(e.getAttribute("data-html-"+i)));e.innerHTML=t})),1===c.childNodes.length&&1===c.childNodes[0].childNodes.length&&("cell"===r||"cell-left"===r||"cell-right"===r)){const t=this.cellSelected();let e=t.parentNode,i=4;if(this.builder.maxColumns&&(i=this.builder.maxColumns),e.querySelector(".is-row-overlay")){if(e.childElementCount>=i+4)return alert(this.out("You have reached the maximum number of columns")),!1}else if(e.childElementCount>=i+3)return alert(this.out("You have reached the maximum number of columns")),!1;this.builder.uo.saveForUndo();let n=c.childNodes[0].childNodes[0];var u=document.createRange();t.parentNode.insertBefore(u.createContextualFragment(n.outerHTML),t),"cell"!==r&&"cell-right"!==r||(t.parentNode.insertBefore(t.previousElementSibling,t),t.parentNode.insertBefore(t,t.previousElementSibling));let o=this.builder.doc.querySelector(".builder-active");return o||(o=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(o),this.fixLayout(e),"cell"===r||"cell-right"===r?t.nextElementSibling.click():t.previousElementSibling.click(),this.builder.opts.onChange(),void this.builder.opts.onRender()}let e;if(s=this.builder.activeCol,s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(l=!0)),l){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}u=document.createRange(),e.parentNode.insertBefore(u.createContextualFragment(c.innerHTML),e.nextSibling),o=c.childNodes[0],o=e.nextElementSibling;let i=this.builder.doc.querySelector(".builder-active");i||(i=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(i),a=o.querySelector("div"),a&&a.click(),o.className=o.className.replace("row-outline",""),this.builder.util.hideColumnTool()}}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}else i?this.addContent(t,r,"data-noedit"):this.addContent(t,r)}clearActiveCell(){const t=this.builder.builderStuff;if(!t)return;if(t.getAttribute("preventDevault"))return void setTimeout((()=>{t.removeAttribute("preventDevault")}),30);let e=this.builder.doc.getElementsByClassName("cell-active");for(;e.length;)e[0].classList.remove("cell-active");for(e=this.builder.doc.getElementsByClassName("row-outline");e.length;)e[0].classList.remove("row-outline");for(e=this.builder.doc.getElementsByClassName("row-active");e.length;)e[0].classList.remove("row-active");for(e=this.builder.doc.getElementsByClassName("builder-active");e.length;)e[0].classList.remove("builder-active");this.builder.activeCol=null,this.builder.dom.removeClass(this.builder.doc.body,"content-edit")}clearAfterUndoRedo(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none",this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null;const n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(e=>{t.removeClass(e,"icon-active")})),this.builder.activeIcon=null;let o=e.querySelector(".is-rte-tool").querySelectorAll("button");Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"on")})),o=e.querySelector(".is-elementrte-tool").querySelectorAll("button"),Array.prototype.forEach.call(o,(e=>{t.removeClass(e,"on")}));let s=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(s,(t=>{t.style.display=""}))}hidePops(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}));let n=e.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(n,(e=>{e.style.transition="all 200ms ease",setTimeout((()=>{e.style.opacity="0"}),10),setTimeout((()=>{e.style.display="",t.removeClass(e,"active"),e.style.opacity="",e.style.transition=""}),200)}));const o=document.querySelector(".moveable-control-box"),s=document.querySelector("#divImageResizer");o&&!s.getAttribute("data-resizing")&&(o.style.display="none")}hideControls(){const t=this.dom;let e=this.builder.builderStuff.querySelectorAll(".is-tool");Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(e=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none"}clearActiveElement(t){const e=this.dom,i=this.builder.builderStuff,n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"icon-active")}));let o=this.builder.doc.querySelectorAll(".elm-inspected");if(Array.prototype.forEach.call(o,(t=>{e.removeClass(t,"elm-inspected")})),o=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(o,(t=>{e.removeClass(t,"elm-active")})),this.builder.doc.querySelector(".is-element-tool").style.display="",this.builder.doc.querySelector("#divLinkTool").style.display="",this.builder.activeIcon=null,this.builder.inspectedElement=null,this.builder.activeElement=null,t){let t=i.querySelector(".is-rte-tool");t&&(t.style.display="none");let e=i.querySelector(".is-elementrte-tool");e&&(e.style.display="flex");let n=i.querySelector(".rte-more-options");n&&(n.style.display="");let o=i.querySelector(".elementrte-more-options");o&&(o.style.display="");let s=e.querySelectorAll("button[data-align]");Array.prototype.forEach.call(s,(t=>{t.style.display="none"})),this.builder.rte.positionToolbar()}}clearPops(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;if(e.getAttribute("preventDevault"))return void setTimeout((()=>{e.removeAttribute("preventDevault")}),30);let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none";let n=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(n,(t=>{t.style.display="block"}));let o=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(o,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}clearControls(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;if(e.getAttribute("preventDevault"))return void setTimeout((()=>{e.removeAttribute("preventDevault")}),30);let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable.updateRect(),document.querySelector(".moveable-control-box").style.display="none",this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.activeImage=null;const n=this.builder.doc.querySelectorAll(".icon-active");Array.prototype.forEach.call(n,(e=>{t.removeClass(e,"icon-active")})),this.builder.activeIcon=null;let o=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(o,(t=>{t.style.display="block"}));var s=e.querySelectorAll(".is-side.elementstyles");Array.prototype.forEach.call(s,(e=>{t.removeClass(e,"active")}));let a=this.builder.doc.querySelectorAll("[data-saveforundo]");if(Array.prototype.forEach.call(a,(t=>{t.removeAttribute("data-saveforundo")})),a=this.builder.doc.querySelectorAll(".elm-inspected"),Array.prototype.forEach.call(a,(e=>{t.removeClass(e,"elm-inspected")})),"auto"===this.builder.toolbarDisplay){let t=e.querySelector(".is-rte-tool");t&&(t.style.display="none");let i=e.querySelector(".is-elementrte-tool");i&&(i.style.display="none");let n=e.querySelector(".rte-more-options");n&&(n.style.display="");let o=e.querySelector(".elementrte-more-options");o&&(o.style.display="")}a=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(a,(e=>{t.removeClass(e,"elm-active")}));let l=e.querySelectorAll(".is-rte-pop");Array.prototype.forEach.call(l,(e=>{e.style.display="",t.removeClass(e,"active"),t.removeClass(e,"deactive")}));let r=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(r,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}makeId(){let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<2;i++)t+=e.charAt(Math.floor(Math.random()*e.length));let i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<5;t++)i+=n.charAt(Math.floor(Math.random()*n.length));return t+i}getSelection(){if(this.builder.dom.getSelectedBlocks().length>0)this.builder.selectionMulti=!0;else{this.builder.selectionMulti=!1;const t=this.builder.win.getSelection(),e=this.builder.dom.getElm();if(!e)return;if(e&&e.innerText===t.toString().trim()||""===t.toString().trim()){this.builder.selectionElm=e;let t=e.closest("a");this.builder.activeLink=t||null}else this.builder.selectionText=t,this.builder.activeLink=null}}saveSelection(){if(this.builder.win.getSelection){let t=this.builder.win.getSelection();if(t.getRangeAt&&t.rangeCount){let e=[];for(let i=0,n=t.rangeCount;i<n;++i)e.push(t.getRangeAt(i));return this.builder.selection=e,e}}else if(this.builder.doc.selection&&this.builder.doc.selection.createRange)return this.builder.selection=this.builder.doc.selection.createRange(),this.builder.doc.selection.createRange();return this.builder.selection=null,null}restoreSelection(){let t=this.builder.selection;if(t)if(this.builder.win.getSelection){let o=this.builder.win.getSelection();if(this.builder.doc.body.createTextRange){var e=this.builder.doc.body.createTextRange();e.collapse(),e.select()}else this.builder.win.getSelection?this.builder.win.getSelection().empty?this.builder.win.getSelection().empty():this.builder.win.getSelection().removeAllRanges&&this.builder.win.getSelection().removeAllRanges():this.builder.doc.selection&&this.builder.doc.selection.empty();for(var i=0,n=t.length;i<n;++i)o.addRange(t[i])}else this.builder.doc.selection&&t.select&&t.select()}cleanHTML(t,e){let i,n=t.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g," "),o=new RegExp("\x3c!--(.*?)--\x3e","g");n=n.replace(o,""),i=e?new RegExp("<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>","gi"):new RegExp("<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>","gi"),n=n.replace(i,"");let s,a=["style","script","applet","embed","noframes","noscript"];for(let t=0;t<a.length;t++)i=new RegExp("<"+a[t]+".*?"+a[t]+"(.*?)>","gi"),n=n.replace(i,"");s=e?["style","start"]:["start"];for(let t=0;t<s.length;t++){let e=new RegExp(" "+s[t]+'="(.*?)"',"gi");n=n.replace(e,"")}return n=n.replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,""),n=n.replace(/<(\/?)s>/gi,"<$1strike>"),n=n.replace(/&nbsp;/gi," "),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\);/gi,""),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\)/gi,""),n}checkEmpty(){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{this.checkEmptyOn(t)}))}checkEmptyOn(t){const e=this.dom,i=e.elementChildren(t);let n=!0;if(i.forEach((t=>{e.hasClass(t,"row-add-initial")||e.hasClass(t,"dummy-space")||"link"!==t.tagName.toLowerCase()&&(n=!1)})),n){let i=t.querySelector(".row-add-initial");i||(t.innerHTML=`<button type="button" class="row-add-initial">${this.out("Empty")}<br><span class="block">${this.out("+ Click to add content")}</span></div>`,i=t.querySelector(".row-add-initial")),i.addEventListener("click",(()=>{this.clearActiveCell();const n=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"builder-active")})),e.addClass(t,"builder-active"),e.addClass(i,"row-active");let o=this.builder.builderStuff.querySelector(".quickadd");o.querySelector(".is-pop-tabs").style.display="none";const s=window.innerHeight,a=this.getElementPosition(i);let l=a.top,r=a.left,c=a.scaleX,d=a.scaleY;r+=i.offsetWidth*(c*this.builder.opts.zoom)/2-11,l-=i.offsetHeight-i.offsetHeight*d,o.style.display="flex",this.showPop(o,!1,i);const u=o.offsetWidth,p=o.offsetHeight;s-l>p?(l=l+i.offsetHeight*this.builder.opts.zoom-19,o.style.top=l+window.pageYOffset+27+"px",o.style.left=r-u/2+7+"px",e.removeClass(o,"arrow-bottom"),e.removeClass(o,"arrow-right"),e.removeClass(o,"arrow-left"),e.removeClass(o,"center"),e.addClass(o,"arrow-top"),e.addClass(o,"center")):(o.style.top=l+window.pageYOffset-p-8+"px",o.style.left=r-u/2+7+"px",e.removeClass(o,"arrow-top"),e.removeClass(o,"arrow-right"),e.removeClass(o,"arrow-left"),e.removeClass(o,"center"),e.addClass(o,"arrow-bottom"),e.addClass(o,"center")),o.setAttribute("data-mode","row")}))}else{let e=t.querySelector(".row-add-initial");e&&e.parentNode.removeChild(e)}}clearPreferences(){localStorage.removeItem("_theme"),localStorage.removeItem("_zoom"),localStorage.removeItem("_buildermode"),localStorage.removeItem("_editingtoolbar"),localStorage.removeItem("_editingtoolbardisplay"),localStorage.removeItem("_hidecelltool"),localStorage.removeItem("_rowtool"),localStorage.removeItem("_hideelementtool"),localStorage.removeItem("_hidesnippetaddtool"),localStorage.removeItem("_outlinemode"),localStorage.removeItem("_hiderowcoloutline"),localStorage.removeItem("_outlinestyle"),localStorage.removeItem("_hideelementhighlight"),localStorage.removeItem("_opensnippets"),localStorage.removeItem("_toolstyle"),localStorage.removeItem("_snippetssidebardisplay"),localStorage.removeItem("_htmlview"),localStorage.removeItem("_pasteresult"),localStorage.removeItem("_livepreview"),localStorage.removeItem("_dictation"),localStorage.removeItem("_mic"),localStorage.removeItem("_autosendcommand"),localStorage.removeItem("_disclaimershown"),localStorage.removeItem("_temp"),localStorage.removeItem("_top_p"),localStorage.removeItem("_autosend_delay"),localStorage.removeItem("_auto_editblock"),localStorage.removeItem("_command_lang"),localStorage.removeItem("_ai_panel_open"),localStorage.removeItem("_scrollableeditor"),localStorage.removeItem("_animatedsorting"),localStorage.removeItem("_addbuttonplace"),localStorage.removeItem("_hiderowtool"),localStorage.removeItem("_dragwithouthandle"),localStorage.removeItem("_advancedhtmleditor"),localStorage.removeItem("_hidecolhtmleditor"),localStorage.removeItem("_hiderowhtmleditor"),localStorage.removeItem("_sampleshown")}pasteHtmlAtCaret(t,e){var i,n;if(this.restoreSelection(),this.builder.win.getSelection){if(!this.builder.activeCol)return;if((i=this.builder.win.getSelection()).getRangeAt&&i.rangeCount){(n=i.getRangeAt(0)).deleteContents();var o=this.builder.doc.createElement("div");o.innerHTML=t;for(var s,a,l=this.builder.doc.createDocumentFragment();s=o.firstChild;)a=l.appendChild(s);var r=l.firstChild;n.insertNode(l),a&&((n=n.cloneRange()).setStartAfter(a),e?n.setStartBefore(r):n.collapse(!0),i.removeAllRanges(),this.builder.isTouchSupport||i.addRange(n))}}else if((i=this.builder.doc.selection)&&"Control"!==i.type){if(!this.builder.activeCol)return;var c=i.createRange();c.collapse(!0),i.createRange().pasteHTML(t),e&&((n=i.createRange()).setEndPoint("StartToStart",c),this.builder.isTouchSupport||n.select())}}refreshModule(){let t=this.builder.activeModule;if(!t)return;let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}));let n=decodeURIComponent(t.getAttribute("data-html"));n=n.replace(/{id}/g,this.makeId()),t.innerHTML="";var o=document.createRange();o.setStart(t,0),t.appendChild(o.createContextualFragment(n)),i=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(i,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s))),s++})),this.repositionColumnTool(!0),this.builder.onRefreshTool&&this.builder.onRefreshTool()}repositionColumnTool(){let t=this.builder.activeCol;if(!t)return;let e=t.parentNode;if(t.parentNode||(e=this.rowSelected()),this.colTool=e.querySelector(".is-col-tool"),!this.colTool)return;t.parentNode||(this.colTool.style.display="none"),this.colTool.style.left=t.offsetLeft+"px";const i=this.builder.builderStuff.querySelector(".columnmore.active");if(i){const t=this.colTool.querySelector(".cell-more");i.classList.add("transition1"),setTimeout((()=>{const e=this.getElementPosition(t);let n=e.top,o=e.left;i.style.top=n+35+"px",i.style.left=o-7+"px",setTimeout((()=>{i.classList.remove("transition1")}),300)}),30)}}hideColumnTool(){this.builder.doc.querySelectorAll(".is-col-tool").forEach((t=>{t.style.display="none"}))}isTouchSupport(){return!!window.matchMedia("(pointer: coarse)").matches}detectIE(){return!!document.documentMode}LightenDarkenColor(t,e){var i=!1;"#"===t[0]&&(t=t.slice(1),i=!0);var n=parseInt(t,16),o=(n>>16)+e;o>255?o=255:o<0&&(o=0);var s=(n>>8&255)+e;s>255?s=255:s<0&&(s=0);var a=(255&n)+e;return a>255?a=255:a<0&&(a=0),(i?"#":"")+String("000000"+(a|s<<8|o<<16).toString(16)).slice(-6)}getUIStyles(){this.dom.appendHtml(this.builder.builderStuff,'\n <input type="text" class="style-helper-input" style="display:none;">\n <label class="style-helper-label" style="display:none;"></label>\n <button class="style-helper-button-classic classic" style="display:none;"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <select class="style-helper-select" style="display:none;"><option value=""></option></select>\n\n <div class="style-helper modal-color"></div>\n <div class="style-helper modal-background"></div>\n <div class="style-helper button-pickcolor-border"></div>\n <div class="style-helper button-pickcolor-background"></div>\n\n <button class="style-helper base"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <div class="style-helper base on"></div>\n <div class="style-helper base hover"></div>\n\n <div class="style-helper snippet-color"></div>\n <div class="style-helper snippet-background"></div>\n <div class="style-helper snippet-tabs-background"></div>\n <div class="style-helper snippet-tab-item-background"></div>\n <div class="style-helper snippet-tab-item-background-active"></div>\n <div class="style-helper snippet-tab-item-background-hover"></div>\n <div class="style-helper snippet-tab-item-color"></div>\n\n <div class="style-helper snippet-more-item-background"></div>\n <div class="style-helper snippet-more-item-background-active"></div>\n <div class="style-helper snippet-more-item-background-hover"></div>\n <div class="style-helper snippet-more-item-color"></div>\n\n <div class="style-helper tabs-background"></div>\n <div class="style-helper tab-item-active-border-bottom"></div>\n <div class="style-helper tab-item-color"></div>\n <div class="style-helper tabs-more-background"></div>\n <div class="style-helper tabs-more-border"></div>\n <div class="style-helper tabs-more-item-color"></div>\n <div class="style-helper tabs-more-item-background-hover"></div>\n <div class="style-helper separator-color"></div>\n <div class="style-helper outline-color"></div>\n ');const t=(t,e)=>{const i=this.builder.builderStuff.querySelector(".style-helper"+t);return window.getComputedStyle(i,null).getPropertyValue(e)},e=this.builder.builderStuff.querySelector(".style-helper-input"),i=this.builder.builderStuff.querySelector(".style-helper-label"),n=this.builder.builderStuff.querySelector(".style-helper-select"),o=this.builder.builderStuff.querySelector(".style-helper-button-classic");this.builder.styleModalColor=t(".modal-color","background-color"),this.builder.styleModalBackground=t(".modal-background","background-color"),this.builder.styleButtonPickColorBorder=t(".button-pickcolor-border","border"),this.builder.styleButtonPickColorBackground=t(".button-pickcolor-background","background-color"),this.builder.styleToolBackground=t(".base","background-color"),this.builder.styleButtonColor=t(".base","color"),this.builder.styleButtonSvgFill=(()=>{const t=this.builder.builderStuff.querySelector(".style-helper.base");return window.getComputedStyle(t.querySelector("svg"),null).getPropertyValue("fill")})(),this.builder.styleButtonBackgroundHover=t(".base.hover","background-color"),this.builder.styleSnippetColor=t(".snippet-color","background-color"),this.builder.styleSnippetBackground=t(".snippet-background","background-color"),this.builder.styleSnippetTabsBackground=t(".snippet-tabs-background","background-color"),this.builder.styleSnippetTabItemBackground=t(".snippet-tab-item-background","background-color"),this.builder.styleSnippetTabItemBackgroundActive=t(".snippet-tab-item-background-active","background-color"),this.builder.styleSnippetTabItemBackgroundHover=t(".snippet-tab-item-background-hover","background-color"),this.builder.styleSnippetTabItemColor=t(".snippet-tab-item-color","background-color"),this.builder.styleSnippetMoreItemBackground=t(".snippet-more-item-background","background-color"),this.builder.styleSnippetMoreItemBackgroundActive=t(".snippet-more-item-background-active","background-color"),this.builder.styleSnippetMoreItemBackgroundHover=t(".snippet-more-item-background-hover","background-color"),this.builder.styleSnippetMoreItemColor=t(".snippet-more-item-color","background-color"),this.builder.styleTabsBackground=t(".tabs-background","background-color"),this.builder.styleTabItemBorderBottomActive=t(".tab-item-active-border-bottom","border"),this.builder.styleTabItemColor=t(".tab-item-color","background-color"),this.builder.styleTabsMoreBackground=t(".tabs-more-background","background-color"),this.builder.styleTabsMoreBorder=t(".tabs-more-border","border"),this.builder.styleTabsMoreItemColor=t(".tabs-more-item-color","background-color"),this.builder.styleTabsMoreBackgroundHover=t(".tabs-more-item-background-hover","background-color"),this.builder.styleSeparatorColor=t(".separator-color","background-color"),this.builder.styleOutlineColor=t(".outline-color","background-color"),this.builder.styleSelectBackground=window.getComputedStyle(n,null).getPropertyValue("background-color"),this.builder.styleSelectColor=window.getComputedStyle(n,null).getPropertyValue("color"),this.builder.styleSelectOptionBackground=window.getComputedStyle(n.querySelector("option"),null).getPropertyValue("background-color"),this.builder.styleInputBackground=window.getComputedStyle(e,null).getPropertyValue("background-color"),this.builder.styleInputBorderBottom=window.getComputedStyle(e,null).getPropertyValue("border-bottom"),this.builder.styleInputColor=window.getComputedStyle(e,null).getPropertyValue("color"),this.builder.styleLabelColor=window.getComputedStyle(i,null).getPropertyValue("color"),this.builder.styleButtonClassicBackground=window.getComputedStyle(o,null).getPropertyValue("background-color"),this.builder.styleButtonClassicColor=window.getComputedStyle(o,null).getPropertyValue("color"),this.builder.styleButtonClassicBackgroundHover=this.getUIStyleValue(o,"hover","background-color"),this.builder.styleDark=!1,this.builder.styleColored=!1,this.builder.styleColoredDark=!1,this.builder.styleLight=!1,document.body.getAttribute("class")&&(-1!==document.body.getAttribute("class").indexOf("colored-dark")?this.builder.styleColoredDark=!0:-1!==document.body.getAttribute("class").indexOf("dark")?this.builder.styleDark=!0:-1!==document.body.getAttribute("class").indexOf("colored")?this.builder.styleColored=!0:-1!==document.body.getAttribute("class").indexOf("light")&&(this.builder.styleLight=!0))}getUIStyleValue(t,e,i){const n=this.dom;n.addClass(t,e);let o=window.getComputedStyle(t,null).getPropertyValue(i);return n.removeClass(t,e),o}getFontFamilyStyle(t){return`\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n `}refreshFontFamilyStyle1(){let t=this.builder.rte.rteFontFamilyOptions.querySelector("iframe").contentWindow.document;t.querySelector("#mainstyle").innerHTML=this.getFontFamilyStyle(),this.builder.styleDark?t.body.setAttribute("class","dark"):this.builder.styleColored?t.body.className="colored":this.builder.styleColoredDark?t.body.className="colored-dark":this.builder.styleLight?t.body.className="light":t.body.className=""}refreshFontFamilyStyle2(){let t=this.builder.builderStuff.querySelector(".is-modal.pickfontfamily").querySelector("iframe").contentWindow.document;t.querySelector("#mainstyle").innerHTML=this.getFontFamilyStyle(!0),this.builder.styleDark?t.body.setAttribute("class","dark"):this.builder.styleColored?t.body.className="colored":this.builder.styleColoredDark?t.body.className="colored-dark":this.builder.styleLight?t.body.className="light":t.body.className=""}getFontPreview(){let t=this.builder.fontAssetPath,e="";return e=`\n <li role="option" tabindex="0" data-provider="" data-font-family="" style="font-size:12px;padding:10px 7px;box-sizing:border-box;"><div></div>\n <span style="z-index:1;position: relative;pointer-events: none;">${this.out("None")}</span>\n </li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Arial, sans-serif"><div></div><img src="${t}arial.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="courier"><div></div><img src="${t}courier.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Georgia, serif"><div></div><img src="${t}georgia.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="monospace"><div></div><img src="${t}monospace.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="sans-serif"><div></div><img src="${t}sans_serif.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="serif"><div></div><img src="${t}serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Abel, sans-serif"><div></div><img src="${t}abel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Abril Fatface"><div></div><img src="${t}abril_fatface.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Advent Pro, sans-serif" data-font-style="wght@100;200;300;400;500;600;700"><div></div><img src="${t}advent_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Aladin, cursive"><div></div><img src="${t}aladin.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}alegreya.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya Sans SC, sans-serif" data-font-style="ital,wght@0,100;0,300;0,400;0,500;0,700;0,800;0,900;1,100;1,300;1,400;1,500;1,700;1,800;1,900"><div></div><img src="${t}alegreya_sans_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alegreya SC, serif" data-font-style="ital,wght@0,400;0,500;0,700;0,800;0,900;1,400;1,500;1,700;1,800;1,900"><div></div><img src="${t}alegreya_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Alice, serif"><div></div><img src="${t}alice.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Allerta Stencil, sans-serif"><div></div><img src="${t}allerta_stencil.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Allura, cursive"><div></div><img src="${t}allura.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Almendra Display, cursive"><div></div><img src="${t}almendra_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Amatic SC, cursive" data-font-style="wght@400;700"><div></div><img src="${t}amatic_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Andika, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}andika.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Anonymous Pro, monospace" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}anonymous_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Architects Daughter, cursive"><div></div><img style="transform:scale(1.1);" src="${t}architects_daughter.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Arimo, sans-serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700"><div></div><img src="${t}arimo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Arsenal, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}arsenal.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Assistant" data-font-style="wght@200;300;400;500;600;700;800"><div></div><img src="${t}assistant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Aubrey, cursive"><div></div><img src="${t}aubrey.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Anton, sans-serif"><div></div><img src="${t}anton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Archivo Narrow, sans-serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700"><div></div><img src="${t}archivo_narrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bad Script, cursive"><div></div><img src="${t}bad_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="BenchNine, sans-serif" data-font-style="wght@300;400;700"><div></div><img src="${t}benchNine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bevan, cursive"><div></div><img src="${t}bevan.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bigelow Rules, cursive"><div></div><img src="${t}bigelow_rules.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bilbo, cursive"><div></div><img src="${t}bilbo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bonbon, cursive"><div></div><img src="${t}bonbon.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Bowlby One SC, cursive"><div></div><img src="${t}bowlby_one_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cabin Condensed, sans-serif" data-font-style="wght@400;500;600;700"><div></div><img src="${t}cabin_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Carrois Gothic SC, sans-serif"><div></div><img src="${t}carrois_gothic_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Caveat, cursive" data-font-style="wght@400;500;600;700"><div></div><img src="${t}caveat.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Chewy, cursive"><div></div><img src="${t}chewy.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cinzel, serif" data-font-style="wght@400;500;600;700;800;900"><div></div><img src="${t}cinzel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Comfortaa, cursive" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}comfortaa.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Concert One, cursive"><div></div><img src="${t}concert_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant, serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}cormorant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Garamond, serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}cormorant_garamond.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Infant, serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}cormorant_infant.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant SC, serif" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}cormorant_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cormorant Unicase, serif" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}cormorant_unicase.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cousine" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}cousine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Crafty Girls, cursive"><div></div><img src="${t}crafty_girls.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cuprum, sans-serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700"><div></div><img src="${t}cuprum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Cutive Mono, monospace"><div></div><img src="${t}cutive_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Devonshire, cursive"><div></div><img src="${t}devonshire.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Didact Gothic, sans-serif"><div></div><img src="${t}didact_gothic.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Diplomata SC, cursive"><div></div><img src="${t}diplomata_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Dosis, sans-serif" data-font-style="wght@200;300;400;500;600;700;800"><div></div><img src="${t}dosis.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="EB Garamond, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}eb_garamond.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="El Messiri, sans-serif" data-font-style="wght@400;500;600;700"><div></div><img src="${t}el_messiri.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Elsie, cursive" data-font-style="wght@400;900"><div></div><img src="${t}elsie.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Encode Sans, sans-serif" data-font-style="wght@100;200;300;400;500;600;700;800;900"><div></div><img src="${t}encode_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Exo, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}exo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'Exo 2', sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900" data-font-display="swap"><div></div><img src="${t}exo_2.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Felipa, cursive"><div></div><img src="${t}felipa.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Code, monospace" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}fira_code.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Mono, monospace" data-font-style="wght@400;500;700"><div></div><img src="${t}fira_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}fira_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans Condensed, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}fira_sans_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fira Sans Extra Condensed, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}fira_sans_extra_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fjalla One, sans-serif"><div></div><img src="${t}fjalla_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Forum, cursive"><div></div><img src="${t}forum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Frank Ruhl Libre" data-font-style="wght@300;400;500;700;900"><div></div><img src="${t}frank_ruhl_libre.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Fredericka the Great, cursive"><div></div><img src="${t}fredericka_the_great.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gabriela, serif"><div></div><img src="${t}gabriela.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gilda Display, serif"><div></div><img src="${t}gilda_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Give You Glory, cursive"><div></div><img style="transform:scale(1.3);" src="${t}give_you_glory.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Gruppo, cursive"><div></div><img src="${t}gruppo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Handlee, cursive"><div></div><img src="${t}handlee.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Happy Monkey, cursive"><div></div><img src="${t}happy_monkey.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Hind" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}hind.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Mono, monospace" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}ibm_plex_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Sans, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}ibm_plex_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="IBM Plex Serif, serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}ibm_plex_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Iceland, cursive"><div></div><img src="${t}iceland.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Inconsolata, monospace" data-font-style="wght@200;300;400;500;600;700;800;900"><div></div><img src="${t}inconsolata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Josefin Sans, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}josefin_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Istok Web, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}istok_web.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Julee, cursive"><div></div><img src="${t}julee.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Julius Sans One, sans-serif"><div></div><img src="${t}julius_sans_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Junge, serif"><div></div><img src="${t}junge.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Jura, sans-serif" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}jura.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Just Me Again Down Here, cursive"><div></div><img style="transform:scale(1.1);" src="${t}just_me_again_down_here.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kaushan Script, cursive"><div></div><img src="${t}kaushan_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kelly Slab, cursive"><div></div><img src="${t}kelly_slab.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kite One, sans-serif"><div></div><img src="${t}kite_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kosugi, sans-serif"><div></div><img src="${t}kosugi.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kosugi Maru, sans-serif"><div></div><img src="${t}kosugi_maru.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Kurale, serif"><div></div><img src="${t}kurale.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lato, sans-serif" data-font-style="ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900"><div></div><img src="${t}lato.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ledger, serif" data-font-display="swap"><div></div><img src="${t}ledger.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lekton, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400"><div></div><img src="${t}lekton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Life Savers, cursive" data-font-style="wght@400;700;800"><div></div><img src="${t}life_savers.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Literata, serif" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}literata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lobster, cursive"><div></div><img src="${t}lobster.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lobster Two, cursive" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}lobster_two.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Londrina Shadow, cursive"><div></div><img src="${t}londrina_shadow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lora, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700"><div></div><img src="${t}lora.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Lovers Quarrel, cursive"><div></div><img style="transform:scale(1.1);" src="${t}lovers_quarrel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'M PLUS 1p', sans-serif" data-font-style="wght@100;300;400;500;700;800;900" data-font-display="swap"><div></div><img src="${t}m_plus_1p.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'M PLUS Rounded 1c', sans-serif" data-font-style="wght@100;300;400;500;700;800;900" data-font-display="swap"><div></div><img src="${t}m_plus_rounded_1c.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Macondo, cursive"><div></div><img src="${t}macondo.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Marcellus SC, serif"><div></div><img src="${t}marcellus_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Marck Script, cursive"><div></div><img src="${t}marck_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Martel, serif" data-font-style="wght@200;300;400;600;700;800;900"><div></div><img src="${t}martel.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Maven Pro, sans-serif"><div></div><img src="${t}maven_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Merriweather, serif" data-font-style="ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900"><div></div><img src="${t}merriweather.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Merriweather Sans" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}merriweather_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Mogra, cursive"><div></div><img src="${t}mogra.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Monoton, cursive"><div></div><img src="${t}monoton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montez, cursive"><div></div><img src="${t}montez.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}montserrat.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat Alternates, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}montserrat_alternates.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Montserrat Subrayada, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}montserrat_subrayada.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Neucha, cursive"><div></div><img src="${t}neucha.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Neuton, serif" data-font-style="ital,wght@0,200;0,300;0,400;0,700;0,800;1,400"><div></div><img src="${t}neuton.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nixie One, cursive"><div></div><img src="${t}nixie_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nothing You Could Do, cursive"><div></div><img style="transform:scale(1.1);" src="${t}nothing_you_could_do.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Sans, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}noto_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Sans SC, sans-serif" data-font-style="wght@100;300;400;500;700;900"><div></div><img src="${t}noto_sans_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Serif, serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}noto_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Noto Serif TC, serif" data-font-style="wght@200;300;400;500;600;700;900"><div></div><img src="${t}noto_serif_tc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Nunito, sans-serif" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;0,1000;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900;1,1000"><div></div><img src="${t}nunito.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Old Standard TT, serif" data-font-style="ital,wght@0,400;0,700;1,400"><div></div><img src="${t}old_standard_tt.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Open Sans, sans-serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}open_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oranienbaum, serif"><div></div><img src="${t}oranienbaum.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oswald, sans-serif" data-font-style="wght@200;300;400;500;600;700"><div></div><img src="${t}oswald.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Oxygen, sans-serif" data-font-style="wght@300;400;700"><div></div><img src="${t}oxygen.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pacifico, cursive"><div></div><img src="${t}pacifico.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pangolin, cursive"><div></div><img src="${t}pangolin.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Passion One, cursive" data-font-style="wght@400;700;900"><div></div><img src="${t}passion_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pathway Gothic One, sans-serif"><div></div><img src="${t}pathway_gothic_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pattaya, sans-serif"><div></div><img src="${t}pattaya.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Petit Formal Script, cursive"><div></div><img style="transform:scale(1.1);" src="${t}petit_formal_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Philosopher, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}philosopher.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Play, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}play.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Playfair Display, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}playfair_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Playfair Display SC, serif" data-font-style="ital,wght@0,400;0,700;0,900;1,400;1,700;1,900"><div></div><img src="${t}playfair_display_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Podkova, serif" data-font-style="wght@400;500;600;700;800"><div></div><img src="${t}podkova.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Poiret One, cursive"><div></div><img src="${t}poiret_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Pompiere, cursive"><div></div><img style="transform:scale(1.1);" src="${t}pompiere.png"></li>\n `,e+=`<li role="option" tabindex="0" data-provider="google" data-font-family="Poppins, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}poppins.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Prata, serif"><div></div><img src="${t}prata.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="'Press Start 2P', cursive"><div></div><img src="${t}press_start_2p.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Prosto One, cursive"><div></div><img src="${t}prosto_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Mono, monospace"><div></div><img src="${t}pt_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}pt_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans Caption, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}pt_sans_caption.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Sans Narrow, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}pt_sans_narrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Serif, serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}pt_serif.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="PT Serif Caption, serif" data-font-style="ital@0;1"><div></div><img src="${t}pt_serif_caption.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quattrocento Sans, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}quattrocento_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quattrocento, serif" data-font-style="wght@400;700"><div></div><img src="${t}quattrocento.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Quicksand, sans-serif" data-font-style="wght@300;400;500;600;700"><div></div><img src="${t}quicksand.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Qwigley, cursive"><div></div><img src="${t}qwigley.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Raleway, sans-serif" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}raleway.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Raleway Dots, sans-serif"><div></div><img src="${t}raleway_dots.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Redressed, cursive"><div></div><img src="${t}redressed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ribeye Marrow, cursive"><div></div><img src="${t}ribeye_marrow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Righteous, cursive"><div></div><img src="${t}righteous.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto, sans-serif" data-font-style="ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900"><div></div><img src="${t}roboto.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Condensed, sans-serif" data-font-style="ital,wght@0,300;0,400;0,700;1,300;1,400;1,700"><div></div><img src="${t}roboto_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Mono, monospace" data-font-style="ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"><div></div><img src="${t}roboto_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Roboto Slab, serif" data-font-style="wght@100;200;300;400;500;600;700;800;900"><div></div><img src="${t}roboto_slab.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rochester, cursive"><div></div><img src="${t}rochester.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rouge Script, cursive"><div></div><img src="${t}rouge_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rubik, sans-serif" data-font-style="ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}rubik.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Rubik Mono One, sans-serif"><div></div><img src="${t}rubik_mono_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ruslan Display, cursive"><div></div><img src="${t}ruslan_display.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Russo One, sans-serif"><div></div><img src="${t}russo_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sacramento, cursive"><div></div><img src="${t}sacramento.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sanchez, serif" data-font-style="ital@0;1"><div></div><img src="${t}sanchez.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Satisfy, cursive"><div></div><img src="${t}satisfy.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Sawarabi Gothic, sans-serif"><div></div><img src="${t}sawarabi_gothic.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Scada, sans-serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}scada.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Seaweed Script, cursive"><div></div><img src="${t}seaweed_script.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Seymour One, sans-serif"><div></div><img src="${t}seymour_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Shadows Into Light Two, cursive"><div></div><img src="${t}shadows_into_light_two.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Six Caps, sans-serif"><div></div><img src="${t}six_caps.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Snowburst One, cursive"><div></div><img src="${t}snowburst_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Source Code Pro, monospace" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}source_code_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Source Sans Pro, sans-serif" data-font-style="ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900"><div></div><img src="${t}source_sans_pro.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Special Elite, cursive"><div></div><img src="${t}special_elite.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Spectral, serif" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}spectral.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Spectral SC, serif" data-font-style="ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800"><div></div><img src="${t}spectral_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Squada One, cursive"><div></div><img src="${t}squada_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Stalinist One, cursive"><div></div><img src="${t}stalinist_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Stint Ultra Expanded, cursive"><div></div><img src="${t}stint_ultra_expanded.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Syncopate, sans-serif" data-font-style="wght@400;700"><div></div><img src="${t}syncopate.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tangerine, cursive" data-font-style="wght@400;700"><div></div><img src="${t}tangerine.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tenor Sans, sans-serif"><div></div><img src="${t}tenor_sans.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Tinos, serif" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}tinos.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu, sans-serif" data-font-style="ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700"><div></div><img src="${t}ubuntu.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu Condensed, sans-serif"><div></div><img src="${t}ubuntu_condensed.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Ubuntu Mono, monospace" data-font-style="ital,wght@0,400;0,700;1,400;1,700"><div></div><img src="${t}ubuntu_mono.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Underdog, cursive"><div></div><img src="${t}underdog.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="UnifrakturMaguntia, cursive"><div></div><img src="${t}unifrakturmaguntia.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vast Shadow, cursive"><div></div><img src="${t}vast_shadow.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Viga, sans-serif"><div></div><img src="${t}viga.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vollkorn, serif" data-font-style="ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900"><div></div><img src="${t}vollkorn.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Vollkorn SC, serif" data-font-style="wght@400;600;700;900"><div></div><img src="${t}vollkorn_sc.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Voltaire, sans-serif"><div></div><img src="${t}voltaire.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Wire One, sans-serif"><div></div><img src="${t}wire_one.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Yanone Kaffeesatz, sans-serif" data-font-style="wght@200;300;400;500;600;700"><div></div><img src="${t}yanone_kaffeesatz.png"></li>\n <li role="option" tabindex="0" data-provider="google" data-font-family="Yeseva One, cursive"><div></div><img src="${t}yeseva_one.png"></li>\n `,e}getFontFamilyHTML(t){return`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title>Fonts</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style id="mainstyle">\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n </style>\n\n </head>\n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <ul id="divFontList">\n ${this.getFontPreview()}\n </ul>\n\n <script${this.builder.nonce?` nonce="${this.builder.nonce}"`:""}>\n\n const close = () => {\n parent.focus();\n\n let pop = parent.document.querySelector('.rte-fontfamily-options.active, .pickfontfamily.active');\n if(pop) {\n pop.classList.remove('active');\n pop.classList.add('deactive');\n }\n }\n\n const setValue = (item) => {\n let provider = item.getAttribute('data-provider');\n let fontfamily = item.getAttribute('data-font-family');\n let fontstyle = item.getAttribute('data-font-style');\n let fontdisplay = item.getAttribute('data-font-display');\n parent._cb.setFont(fontfamily, fontstyle, fontdisplay, provider);\n\n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.classList.remove('on');\n });\n item.classList.add('on');\n }\n\n const handleItemClick = (e) => {\n e.preventDefault();\n\n let item = e.target;\n setValue(item);\n }\n\n const handleItemKeyDown = (e) => {\n e.preventDefault();\n\n if(e.keyCode === 38 && e.target.previousElementSibling) { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling) { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 27) { // escape key\n close();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n setValue(e.target);\n }\n }\n \n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.addEventListener('keydown', handleItemKeyDown);\n elm.addEventListener('click', handleItemClick);\n });\n <\/script>\n \n </body>\n </html>\n \n \n `}getFontFamilyEmail(t){let e=this.builder.fontAssetPath;return`\n <!DOCTYPE HTML>\n <html>\n <head>\n <meta charset="utf-8">\n <title>Fonts</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content=""> \n <style>\n html, body {height:100%}\n body {overflow:hidden;margin:0;\n font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;\n font-size:100%; \n line-height:1.7;\n }\n #divFontList {margin:0;padding:0 0 9px 9px;height:100%;overflow-y:scroll !important;box-sizing:border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n #divFontList > li {width:100%;cursor:pointer;overflow:hidden;text-align:center;position:relative;\n display: flex;\n align-items: center;\n justify-content: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n outline:none;\n }\n #divFontList > li img {margin:7px 5px 7px 5px;max-width: 230px;max-height: 27px;pointer-events: none;}\n #divFontList > li div {position:absolute;top:0;left:0;width:100%;height:100%;}\n\n #divFontList > li > div {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n // z-index: 1;\n pointer-events: none;}\n\n #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n #divFontList > li > div:after {\n // background: rgba(0, 0, 0, 0.04); \n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n opacity: 0;\n }\n #divFontList > li:hover > div:after,\n #divFontList > li:focus > div:after {\n opacity: 1;\n }\n #divFontList > li.on > div:after {\n opacity: 1;\n }\n\n ${this.builder.styleDark||this.builder.styleColoredDark||this.builder.styleColore?"":"\n #divFontList > li img {\n mix-blend-mode: multiply;\n }\n "}\n\n .dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n filter: invert(1);\n }\n .dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n \n .colored-dark #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored-dark #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored-dark #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n .colored #divFontList > li img {\n ${t?"":"mix-blend-mode: screen;"};\n ${t?"":"filter: invert(1);"};\n }\n .colored #divFontList > li {\n color: ${t?this.builder.styleModalColor:this.builder.styleButtonColor};\n background: ${t?this.builder.styleModalBackground:this.builder.styleToolBackground};\n }\n .colored #divFontList > li > div:after {\n background: ${t?this.builder.styleButtonClassicBackgroundHover:this.builder.styleButtonBackgroundHover};\n }\n\n\n /* Scrollbar for toolbar/RTE and modal */\n\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.3) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgba(255, 255, 255, 0.3);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n </style>\n\n </head>\n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <ul id="divFontList">\n <li role="option" tabindex="0" data-provider="" data-font-family="" style="font-size:12px;padding:10px 7px;box-sizing:border-box;"><div></div>\n <span style="z-index:1;position: relative;pointer-events: none;">${this.out("None")}</span>\n </li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Arial, sans-serif"><div></div><img src="${e}arial.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="courier"><div></div><img src="${e}courier.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="Georgia, serif"><div></div><img src="${e}georgia.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="monospace"><div></div><img src="${e}monospace.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="sans-serif"><div></div><img src="${e}sans_serif.png"></li>\n <li role="option" tabindex="0" data-provider="" data-font-family="serif"><div></div><img src="${e}serif.png"></li>\n </ul>\n\n <script>\n\n const close = () => {\n parent.focus();\n\n let pop = parent.document.querySelector('.is-rte-pop.active');\n if(pop) {\n pop.classList.remove('active');\n pop.classList.add('deactive');\n }\n }\n\n const setValue = (item) => {\n let provider = item.getAttribute('data-provider');\n let fontfamily = item.getAttribute('data-font-family');\n let fontstyle = item.getAttribute('data-font-style');\n let fontdisplay = item.getAttribute('data-font-display');\n parent._cb.setFont(fontfamily, fontstyle, fontdisplay, provider);\n\n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.classList.remove('on');\n });\n item.classList.add('on');\n }\n\n const handleItemClick = (e) => {\n e.preventDefault();\n\n let item = e.target;\n setValue(item);\n }\n\n const handleItemKeyDown = (e) => {\n e.preventDefault();\n\n if(e.keyCode === 38 && e.target.previousElementSibling) { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling) { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 27) { // escape key\n close();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n setValue(e.target);\n }\n }\n \n let elms = document.querySelectorAll('#divFontList > li');\n elms.forEach(elm=>{\n elm.addEventListener('keydown', handleItemKeyDown);\n elm.addEventListener('click', handleItemClick);\n });\n <\/script>\n \n </body>\n </html>\n \n \n `}getPageTemplate(t){let e="";return e=""===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"tailwind"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content-tailwind.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <link rel="stylesheet" href="[%PATH%]/assets/frameworks/tailwindcss/styles.css">\n \x3c!-- To build your own, please see: https://tailwindcss.com/docs/installation --\x3e\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"bootstrap"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {margin: 140px auto; max-width: 800px; width:100%; padding:0 35px; box-sizing: border-box;}\n /* Bootstrap css adjustment to enable column drag to resize */\n .row > *,\n .column {\n max-width: unset !important;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"foundation"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation.min.css">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation-float.min.css">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"[%CONTENT%]",e}getElementPosition(t){const e=this.builder.iframe;let i,n,o,s;if(this.builder.iframe){let a=document.querySelector(".is-content-view");a||(a=e.parentNode);const l=window.getComputedStyle(a).transform;if("none"!==l){const t=l.match(/matrix\(([0-9., -]+)\)/)[1].split(",");o=parseFloat(t[0]),s=parseFloat(t[3])}else o=1,s=1;const r=e.getBoundingClientRect();i=t.getBoundingClientRect().top*s+r.top,n=t.getBoundingClientRect().left*o+r.left}else i=t.getBoundingClientRect().top,n=t.getBoundingClientRect().left,o=1,s=1;return{top:i,left:n,scaleX:o,scaleY:s}}}class je{constructor(t){this.builder=t}getScale(t){let e=window.getComputedStyle(t).transform.split("(")[1];e=e.split(")")[0],e=e.split(",");let i=e[0],n=e[1];return Math.sqrt(i*i+n*n)}createElement(t){return document.createElement(t)}appendChild(t,e){t&&t.appendChild(e)}appendHtml(t,e){t&&t.insertAdjacentHTML("beforeend",e)}addEventListener(t,e,i){t&&t.addEventListener(e,i)}addClass(t,e){t&&(this.hasClass(t,e)||(0===t.classList.length?t.className=e:t.className=t.className+" "+e,t.className=t.className.replace(/ +/g," ")))}removeClass(t,e){if(t&&t.classList.length>0){let i,n,o,s,a=e.split(" ");for(i=0,o=a.length;i<o;++i){if(!a[i])continue;let e=a[i],o="",l=t.className.split(" ");for(n=0,s=l.length;n<s;++n)l[n]&&l[n]!==e&&(o+=l[n]+" ");t.className=o.trim()}""===t.className&&t.removeAttribute("class")}}removeClassesByPrefix(t,e){t.classList&&t.classList.forEach((i=>{0===i.indexOf(e)&&this.removeClass(t,i)}))}hasClass(t,e){return!!t&&(!!t.className&&(" "+t.className+" ").indexOf(" "+e+" ")>-1)}moveAfter(t,e){e.parentNode.insertBefore(t,e),e.parentNode.insertBefore(e,e.previousElementSibling)}elementChildren(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}getElementOffset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset,width:e.width,height:e.height}}parentsHasClass(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(this.hasClass(t,e))return!0;t=t.parentNode}}parentsHasId(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.id===e)return!0;t=t.parentNode}}parentsHasTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return!0;t=t.parentNode}}parentsHasAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return!0}catch(t){}t=t.parentNode}}getParentByTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return t;t=t.parentNode}}getParentByAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return t}catch(t){}t=t.parentNode}}parentsHasElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return!0}}getParentElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return t}}removeClasses(t,e){for(let i=0;i<t.length;i++)t[i].classList.remove(e)}removeAttributes(t,e){for(let i=0;i<t.length;i++)t[i].removeAttribute(e)}removeElements(t){Array.prototype.forEach.call(t,(t=>{t.parentNode.removeChild(t)}))}moveCursorToElement(t){var e,i;window.getSelection&&this.builder.doc.createRange?((i=this.builder.doc.createRange()).selectNodeContents(t),i.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(i)):this.builder.doc.body.createTextRange&&((i=this.builder.doc.body.createTextRange()).moveToElementText(t),i.collapse(!1),i.select())}selectElementContents(t){var e=this.builder.doc.createRange();e.selectNodeContents(t);var i=this.builder.win.getSelection();i.removeAllRanges(),i.addRange(e)}getSelected(){if(this.builder.win.getSelection)return this.builder.win.getSelection().toString();if(this.builder.doc.getSelection)return this.builder.doc.getSelection().toString();var t=this.builder.doc.selection&&this.builder.doc.selection.createRange();return!!t.text&&t.text}checkEditable(){try{var t,e;return this.builder.win.getSelection?t=3===(e=this.builder.win.getSelection().getRangeAt(0).commonAncestorContainer).nodeType?e.parentNode:e:this.builder.doc.selection&&(e=this.builder.doc.selection.createRange(),t=this.builder.doc.selection.createRange().parentElement()),!!this.parentsHasAttribute(t,"contenteditable")}catch(t){return!1}}textSelection(){const t=this.getSelection().anchorNode;if(!t)return!1;return t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement}getStyle(t,e){return window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue(e):t.style[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]}observeElement(t,e,i,n=0){let o=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(o,e)){let s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,{get:function(){return s.get.apply(this,arguments)},set:function(){let t=this[e];s.set.apply(this,arguments);let o=this[e];"function"==typeof i&&setTimeout(i.bind(this,t,o),n)}})}}baseName(t){if("string"==typeof t){var e=t.split(".");return e.splice(0,e.length-1).join(".")}}doFunction(t,e,i){if(e(t),i){let i=Array.prototype.slice.call(t.getElementsByTagName("*"));for(var n=0;n<i.length;n++)e(i[n])}}execCommand(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((t=>{i(!0,t)}));else{const n=this.builder.win.getSelection(),o=this.getElm();if(!o)return void(i&&i(!1));let s;s=o&&o.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelection(t,e,o):this.replaceSelection(t,e,n,o),i&&i(!0,s)}}updateSelection(t,e,i){return i.style[t]=this.getStyleValue(i,t,e),this.checkStyleIfSameAsParent(i,t),this.cleanChildren(t,i),this.cleanUnusedSpan(i),i}replaceSelection(t,e,i,n){const o=i.getRangeAt(0),s=o.extractContents(),a=this.createSpan(n,t,e);return a.appendChild(s),this.cleanChildren(t,a),this.cleanUnusedSpan(a),o.insertNode(a),i.selectAllChildren(a),this.checkStyleIfSameAsParent(a,t),a}checkStyleIfSameAsParent(t,e){if(t.parentNode&&(t.parentNode.style[e]===t.style[e]||window.getComputedStyle(t.parentNode,null).getPropertyValue(e)===t.style[e])){t.style[e]="",""!==t.getAttribute("style")&&null!==t.style||t.removeAttribute("style");let i=0===t.attributes.length||1===t.attributes.length&&t.hasAttribute("data-keep");if("span"===t.nodeName.toLowerCase()&&i){const e=document.createTextNode(t.textContent);t.parentElement.replaceChild(e,t)}}}createSpan(t,e,i){const n=document.createElement("span");return n.style[e]=this.getStyleValue(t,e,i),n}findParentStyle(t,e){if("HTML"===t.nodeName.toUpperCase()||"BODY"===t.nodeName.toUpperCase())return null;if(!t.parentNode)return null;if(null!==t.style[e]&&void 0!==t.style[e]&&""!==t.style[e])return t;this.findParentStyle(t.parentNode,e)}getStyleValue(t,e,i){if("font-weight"===e||"font-style"===e||"text-decoration"===e||"text-transform"===e){let n,o=this.findParentStyle(t,e);if(o&&(n=o.style[e]),i===n){t.style[e]="";let o=window.getComputedStyle(t,null).getPropertyValue(e);t.style[e]=n,i=o}}return i}getParentBlock(t){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if("inline"!==this.getStyle(t,"display"))return t;t=t.parentNode}}execCommandClass(t,e,i=!0,n){const o=this.getSelectedBlocks();if(o.length>0)o.forEach((i=>{for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i)}));else{const o=this.builder.win.getSelection();let s=this.getElm();if(!s)return;const a=s&&s.innerText===o.toString().trim();(i||a||""===o.toString().trim())&&("block"===n&&"inline"===this.getStyle(s,"display")&&(s=this.getParentBlock(s)),this.updateSelectionClass(t,e,s))}}updateSelectionClass(t,e,i){for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}return""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i),i}cleanChildrenClass(t,e){if(!t.hasChildNodes())return;Array.from(t.children).map((t=>{for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];this.removeClass(t,n)}}));const i=Array.from(t.children).map((t=>this.cleanChildrenClass(t,e)));i&&i.length}getSelectedBlocks(){let t=!1,e=this.builder.win.getSelection(),i=[];if(!e.isCollapsed){let t=e.getRangeAt(0),n=t.commonAncestorContainer;const o=e=>{if(e.nodeType===Node.ELEMENT_NODE&&t.intersectsNode(e)&&i.push(e),e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)o(e.childNodes[t])};o(n),i.length>0&&i[0]===n&&i.shift()}let n=[];const o=["p","h1","h2","h3","h4","h5","h6","div","pre","td","th"];return i.forEach((e=>{const i=e.tagName.toLowerCase();o.includes(i)&&(t=!0,n.push(e))})),2===n.length&&n[0].innerText.trim()===e.toString().trim()&&n.pop(),t?n:[]}execCommandToggle(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((n=>{if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t||this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t||this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n)}));else{const n=this.builder.win.getSelection(),o=this.getElm();if(!o)return;o&&o.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelectionToggle(t,e,i,o):this.replaceSelectionToggle(t,e,i,n,o)}}getElm(){const t=this.builder.win.getSelection();if(!t)return!1;const e=t.anchorNode;if(!e)return!1;return e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement}updateSelectionToggle(t,e,i,n){if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0);parseInt(window.getComputedStyle(n,null).getPropertyValue("font-weight"))>=500&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t?this.addClass(n,i.fontWeight.defaultNormal):this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t?this.addClass(n,i.fontStyle.normal):this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}return this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n),n}replaceSelectionToggle(t,e,i,n,o){const s=n.getRangeAt(0),a=s.extractContents(),l=document.createElement("span");if("fontWeight"===t){let t=!1;o.closest(`.${i.fontWeight.defaultBold}`)&&(t=!0,this.hasClass(o,i.fontWeight.defaultNormal)&&(t=!1));parseInt(window.getComputedStyle(o,null).getPropertyValue("font-weight"))>=500&&(t=!0),t?this.addClass(l,i.fontWeight.defaultNormal):this.addClass(l,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;o.closest(`.${i.fontStyle.italic}`)&&(t=!0,this.hasClass(o,i.fontStyle.normal)&&(t=!1)),t?this.addClass(l,i.fontStyle.normal):this.addClass(l,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;o.closest(`.${i.textDecoration.underline}`)&&(t=!0),t||this.addClass(l,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;o.closest(`.${i.textDecoration.linethrough}`)&&(t=!0),t||this.addClass(l,i.textDecoration.linethrough)}if("textTransform"===t){let t="";o.closest(`.${i.textTransform.uppercase}`)&&(t="uppercase"),this.removeClass(l,i.textTransform.uppercase),this.removeClass(l,i.textTransform.lowercase),this.removeClass(l,i.textTransform.capitalize),this.removeClass(l,i.textTransform.normal),""===t&&this.addClass(l,i.textTransform.uppercase)}if("extend"===t){let t=!1;o.closest(`.${i.extend[e]}`)&&(t=!0),t||this.addClass(l,i.extend[e])}return l.appendChild(a),this.cleanChildrenToggle(t,e,l,i),this.cleanUnusedSpan(l),s.insertNode(l),n.selectAllChildren(l),l}cleanChildrenToggle(t,e,i,n){if(!i.hasChildNodes())return;"fontWeight"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontWeight.thin),this.removeClass(t,n.fontWeight.extralight),this.removeClass(t,n.fontWeight.light),this.removeClass(t,n.fontWeight.normal),this.removeClass(t,n.fontWeight.medium),this.removeClass(t,n.fontWeight.semibold),this.removeClass(t,n.fontWeight.bold),this.removeClass(t,n.fontWeight.extrabold),this.removeClass(t,n.fontWeight.black)})),"fontStyle"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontStyle.italic),this.removeClass(t,n.fontStyle.normal)})),"textUnderline"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textLinethrough"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textTransform"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textTransform.uppercase),this.removeClass(t,n.textTransform.lowercase),this.removeClass(t,n.textTransform.capitalize),this.removeClass(t,n.textTransform.normal)})),"clean"===t&&Array.from(i.children).map((t=>{t.className="",t.style.cssText=""})),"extend"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.extend[e])}));const o=Array.from(i.children).map((i=>this.cleanChildrenToggle(t,e,i,n)));o&&o.length}getSelection(){return this.builder.win&&this.builder.win.getSelection?this.builder.win.getSelection():this.builder.doc&&this.builder.doc.getSelection?this.builder.doc.getSelection():this.builder.doc&&this.builder.doc.selection?this.builder.doc.selection.createRange().text:null}cleanChildren(t,e){if(!e.hasChildNodes())return;const i=Array.from(e.children).filter((e=>void 0!==e.style[t]&&""!==e.style[t.style]));i&&i.length>0&&i.forEach((e=>{e.style[t]="",""!==e.getAttribute("style")&&null!==e.style||e.removeAttribute("style")}));const n=Array.from(e.children).map((e=>this.cleanChildren(t,e)));n&&n.length}addCssClass(t,e,i){this.removeCssClasses(t,i),this.addClass(t,e)}removeCssClasses(t,e){for(let i=0;i<Object.keys(e).length;i++){const n=Object.values(e)[i];this.removeClass(t,n)}}removeEmptyStyle(t){if(!t.hasChildNodes())return;const e=Array.from(t.children).filter((t=>t.getAttribute("style")));e&&e.length>0&&e.forEach((t=>{""!==t.getAttribute("style").trim()&&null!==t.style||t.removeAttribute("style")}));const i=Array.from(t.children).map((t=>this.removeEmptyStyle(t)));i&&i.length}cleanClassSize(t,e){if(!t.hasChildNodes())return;const i=Array.from(t.children).filter((t=>this.hasClass(t,e)));i&&i.length>0&&i.forEach((t=>{this.removeClass(t,e)}));const n=Array.from(t.children).map((t=>this.cleanClassSize(t,e)));n&&n.length}removeFormat(){const t=this.getSelection();if(!t)return;const e=t.anchorNode;if(!e)return;const i=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement;i&&i.innerText===t.toString().trim()||""===t.toString().trim()?this.cleanElement(i):this.cleanSelection(t)}cleanElement(t){t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)})),t.querySelectorAll("*").forEach((t=>{t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)}))})),this.cleanUnusedSpan(t)}cleanSelection(t){const e=t.getRangeAt(0),i=e.extractContents(),n=document.createElement("span");n.appendChild(i),e.insertNode(n),t.selectAllChildren(n),this.cleanElement(n)}cleanUnusedSpan(t){let e=t.querySelectorAll("span");const i=Array.prototype.filter;let n=i.call(e,(t=>0===t.attributes.length));n&&n.length>0&&n.forEach((t=>{t.outerHTML=t.innerHTML})),e=t.querySelectorAll("span"),i.call(e,(t=>{""===t.innerHTML&&t.parentNode.removeChild(t)})),e=t.querySelectorAll("span"),n=i.call(e,(t=>0===t.attributes.length)),n&&n.length>0&&this.cleanUnusedSpan(t)}contentReformat(t,e){this.replaceTag(t,"b",e.fontWeight.defaultBold),this.replaceTag(t,"i",e.fontStyle.italic),this.replaceTag(t,"u",e.textDecoration.underline),this.replaceTag(t,"strike",e.textDecoration.linethrough),this.replaceInline(t,"font-weight","normal",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","bold",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","600",e.fontWeight.semibold),this.replaceInline(t,"text-align","left",e.textAlign.left),this.replaceInline(t,"text-align","right",e.textAlign.right),this.replaceInline(t,"text-align","center",e.textAlign.center),this.replaceInline(t,"text-align","justify",e.textAlign.justify),this.replaceInline(t,"display","flex",e.display.flex),this.replaceInline(t,"justiify-content","flex-start",e.justifyContent.start),this.replaceInline(t,"justiify-content","flex-end",e.justifyContent.end),this.replaceInline(t,"justiify-content","center",e.justifyContent.center),this.replaceInline(t,"justiify-content","space-between",e.justifyContent.between),this.replaceInline(t,"flex-direction","column",e.flexDirection.column),this.replaceInline(t,"flex-direction","row",e.flexDirection.row),this.replaceInline(t,"align-items","flex-start",e.alignItems.start),this.replaceInline(t,"align-items","flex-end",e.alignItems.end),this.replaceInline(t,"align-items","center",e.alignItems.center),this.replaceInline(t,"text-transform","uppercase",e.textTransform.uppercase),this.replaceInline(t,"text-transform","lowercase",e.textTransform.lowercase),this.replaceInline(t,"text-transform","none",e.textTransform.normal),this.replaceInline(t,"line-height","1",e.leading.leading_10),this.replaceInline(t,"line-height","1.1",e.leading.leading_11),this.replaceInline(t,"line-height","1.2",e.leading.leading_12),this.replaceInline(t,"line-height","1.25",e.leading.leading_125),this.replaceInline(t,"line-height","1.3",e.leading.leading_13),this.replaceInline(t,"line-height","1.375",e.leading.leading_1375),this.replaceInline(t,"line-height","1.4",e.leading.leading_14),this.replaceInline(t,"line-height","1.5",e.leading.leading_15),this.replaceInline(t,"line-height","1.6",e.leading.leading_16),this.replaceInline(t,"line-height","1.625",e.leading.leading_1625),this.replaceInline(t,"line-height","1.7",e.leading.leading_17),this.replaceInline(t,"line-height","1.8",e.leading.leading_18),this.replaceInline(t,"line-height","1.9",e.leading.leading_19),this.replaceInline(t,"line-height","2",e.leading.leading_20),this.replaceInline(t,"line-height","2.1",e.leading.leading_21),this.replaceInline(t,"line-height","2.2",e.leading.leading_22)}replaceTag(t,e,i){let n=t.querySelectorAll(e);let o=Array.prototype.filter.call(n,(t=>0===t.attributes.length));o&&o.length>0&&o.forEach((t=>{const e=document.createElement("span");e.setAttribute("class",i),e.innerHTML=t.innerHTML,t.outerHTML=e.outerHTML}))}replaceInline(t,e,i,n){t.querySelectorAll("*").forEach((t=>{"justiify-content"===e?t.style.justifyContent===`${i}`&&(this.addClass(t,n),t.style.justifyContent=""):t.style[e]===`${i}`&&(this.addClass(t,n),t.style[e]="")}))}}var Fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ue={exports:{}},We={},Ye={exports:{}},Ge={},Xe={};function Ve(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function Ke(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function Ze(t,e){this.__indent_cache=new Ke(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new Ve(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}Ve.prototype.clone_empty=function(){var t=new Ve(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},Ve.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},Ve.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},Ve.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},Ve.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},Ve.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},Ve.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},Ve.prototype.is_empty=function(){return 0===this.__items.length},Ve.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},Ve.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},Ve.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},Ve.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},Ve.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},Ve.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},Ve.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},Ke.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},Ke.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},Ke.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},Ke.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},Ze.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},Ze.prototype.get_line_number=function(){return this.__lines.length},Ze.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},Ze.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},Ze.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},Ze.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},Ze.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},Ze.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},Ze.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},Ze.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},Ze.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},Ze.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},Ze.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},Ze.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},Ze.prototype.just_added_newline=function(){return this.current_line.is_empty()},Ze.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},Ze.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new Ve(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},Xe.Output=Ze;var Qe={};Qe.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var Je,ti,ei,ii,ni,oi={};ti="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",ii="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",ni="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(ei="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",(Je=oi).identifier=new RegExp(ni+"(?:\\\\u[0-9a-fA-F]{4}|[\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f])*","g"),Je.identifierStart=new RegExp(ni),Je.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+ti+ei+ii+"])+"),Je.newline=/[\n\r\u2028\u2029]/,Je.lineBreak=new RegExp("\r\n|"+Je.newline.source),Je.allLineBreaks=new RegExp(Je.lineBreak.source,"g");var si={},ai={};function li(t,e){this.raw_options=ri(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function ri(t,e){var i,n={};for(i in t=ci(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function ci(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}li.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},li.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},li.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},li.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},li.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},li.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},li.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},ai.Options=li,ai.normalizeOpts=ci,ai.mergeOpts=ri;var di=ai.Options,ui=["before-newline","after-newline","preserve-newline"];function pi(t){di.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",ui),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}pi.prototype=new di,si.Options=pi;var hi={},mi={},bi=RegExp.prototype.hasOwnProperty("sticky");function gi(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}gi.prototype.restart=function(){this.__position=0},gi.prototype.back=function(){this.__position>0&&(this.__position-=1)},gi.prototype.hasNext=function(){return this.__position<this.__input_length},gi.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},gi.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},gi.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||bi&&t.sticky||i.index!==e&&(i=null),i},gi.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},gi.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},gi.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},gi.prototype.read=function(t,e,i){var n,o="";return t&&(n=this.match(t))&&(o+=n[0]),!e||!n&&t||(o+=this.readUntil(e,i)),o},gi.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var o=t.exec(this.__input);return o?(n=o.index,e&&(n+=o[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},gi.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},gi.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&bi&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},gi.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},gi.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},gi.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},mi.InputScanner=gi;var vi={},fi={};function yi(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}yi.prototype.restart=function(){this.__position=0},yi.prototype.isEmpty=function(){return 0===this.__tokens_length},yi.prototype.hasNext=function(){return this.__position<this.__tokens_length},yi.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},yi.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},yi.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},fi.TokenStream=yi;var xi={},_i={};function wi(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}wi.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},wi.prototype.read_match=function(){return this._input.match(this._match_pattern)},wi.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},wi.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},wi.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},wi.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},wi.prototype._create=function(){return new wi(this._input,this)},wi.prototype._update=function(){},_i.Pattern=wi;var Si=_i.Pattern;function ki(t,e){Si.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}ki.prototype=new Si,ki.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},ki.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},ki.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},ki.prototype._create=function(){return new ki(this._input,this)},ki.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],o=t.exec(e);o;)n.push(e.substring(i,o.index)),i=o.index+o[0].length,o=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},xi.WhitespacePattern=ki;var Ci=mi.InputScanner,Li=Qe.Token,Ai=fi.TokenStream,Ei=xi.WhitespacePattern,qi={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},Ti=function(t,e){this._input=new Ci(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new Ei(this._input)};Ti.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new Ai,this._reset();for(var e=new Li(qi.START,""),i=null,n=[],o=new Ai;e.type!==qi.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)o.add(t),t=this._get_next_token(e,i);o.isEmpty()||(t.comments_before=o,o=new Ai),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},Ti.prototype._is_first_token=function(){return this.__tokens.isEmpty()},Ti.prototype._reset=function(){},Ti.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(qi.RAW,i):this._create_token(qi.EOF,"")},Ti.prototype._is_comment=function(t){return!1},Ti.prototype._is_opening=function(t){return!1},Ti.prototype._is_closing=function(t,e){return!1},Ti.prototype._create_token=function(t,e){return new Li(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},Ti.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},vi.Tokenizer=Ti,vi.TOKEN=qi;var Mi={};function Oi(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Oi.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},Oi.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},Mi.Directives=Oi;var Ii={},$i=_i.Pattern,Ri={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function Bi(t,e){$i.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},Ri),this._excluded=Object.assign({},Ri),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new $i(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}Bi.prototype=new $i,Bi.prototype._create=function(){return new Bi(this._input,this)},Bi.prototype._update=function(){this.__set_templated_pattern()},Bi.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},Bi.prototype.read_options=function(t){var e=this._create();for(var i in Ri)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},Bi.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},Bi.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},Bi.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},Bi.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},Ii.TemplatablePattern=Bi;var Pi=mi.InputScanner,Ni=vi.Tokenizer,zi=vi.TOKEN,Di=Mi.Directives,Hi=oi,ji=_i.Pattern,Fi=Ii.TemplatablePattern;function Ui(t,e){return-1!==e.indexOf(t)}var Wi={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:zi.START,RAW:zi.RAW,EOF:zi.EOF},Yi=new Di(/\/\*/,/\*\//),Gi=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,Xi=/[0-9]/,Vi=/[^\d\.]/,Ki=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),Zi=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";Zi=(Zi="\\?\\.(?!\\d) "+(Zi=Zi.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var Qi,Ji=new RegExp(Zi),tn="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),en=tn.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),nn=new RegExp("^(?:"+en.join("|")+")$"),on=function(t,e){Ni.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new ji(this._input),n=new Fi(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(Hi.identifier).matching(Hi.identifierMatch),number:i.matching(Gi),punct:i.matching(Ji),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(Hi.lineBreak),shebang:i.starting_with(/#!/).until_after(Hi.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(on.prototype=new Ni)._is_comment=function(t){return t.type===Wi.COMMENT||t.type===Wi.BLOCK_COMMENT||t.type===Wi.UNKNOWN},on.prototype._is_opening=function(t){return t.type===Wi.START_BLOCK||t.type===Wi.START_EXPR},on.prototype._is_closing=function(t,e){return(t.type===Wi.END_BLOCK||t.type===Wi.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},on.prototype._reset=function(){Qi=!1},on.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(Wi.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(Wi.UNKNOWN,this._input.next())},on.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(Hi.allLineBreaks,"\n"),t.type!==Wi.DOT&&(t.type!==Wi.RESERVED||"set"!==t.text&&"get"!==t.text)&&nn.test(e)?"in"===e||"of"===e?this._create_token(Wi.OPERATOR,e):this._create_token(Wi.RESERVED,e):this._create_token(Wi.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(Wi.WORD,e):void 0},on.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(Wi.START_EXPR,t):")"===t||"]"===t?e=this._create_token(Wi.END_EXPR,t):"{"===t?e=this._create_token(Wi.START_BLOCK,t):"}"===t?e=this._create_token(Wi.END_BLOCK,t):";"===t?e=this._create_token(Wi.SEMICOLON,t):"."===t&&Vi.test(this._input.peek(1))?e=this._create_token(Wi.DOT,t):","===t&&(e=this._create_token(Wi.COMMA,t)),e&&this._input.next(),e},on.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(Wi.EQUALS,t):"?."===t?this._create_token(Wi.DOT,t):this._create_token(Wi.OPERATOR,t)},on.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(Wi.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(Wi.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(Xi)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(Wi.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(Hi.newline);)e+=this._input.next();return Qi=!0,this._create_token(Wi.COMMENT,e)}}else if(Qi&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return Qi=!1,this._create_token(Wi.COMMENT,e);return null},on.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=Yi.get_directives(i);n&&"start"===n.ignore&&(i+=Yi.readIgnored(this._input)),i=i.replace(Hi.allLineBreaks,"\n"),(e=this._create_token(Wi.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(Wi.COMMENT,i))}return e},on.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new Pi(t),o=null;for(;n.hasNext();)if((o=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=o[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())o=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}o=n.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return t;if((i=parseInt(o[1],16))>126&&i<=255&&0===o[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+o[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(Hi.allLineBreaks,"\n"),this._create_token(Wi.STRING,e)}return null},on.prototype._allow_regexp_or_xml=function(t){return t.type===Wi.RESERVED&&Ui(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===Wi.END_EXPR&&")"===t.text&&t.opened.previous.type===Wi.RESERVED&&Ui(t.opened.previous.text,["if","while","for"])||Ui(t.type,[Wi.COMMENT,Wi.START_EXPR,Wi.START_BLOCK,Wi.START,Wi.END_BLOCK,Wi.OPERATOR,Wi.EQUALS,Wi.EOF,Wi.SEMICOLON,Wi.COMMA])},on.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,o=!1;this._input.hasNext()&&(n||o||this._input.peek()!==t)&&!this._input.testChar(Hi.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(Hi.identifier)),this._create_token(Wi.STRING,i)}return null},on.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var o=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===o.indexOf("{"),a=0;n;){var l=!!n[1],r=n[2];if(!(!!n[n.length-1]||"![CDATA["===r.slice(0,8))&&(r===o||s&&r.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(l?--a:++a),i+=n[0],a<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(Hi.allLineBreaks,"\n"),this._create_token(Wi.STRING,i)}}return null},on.prototype._read_string_recursive=function(t,e,i){var n,o;"'"===t?o=this.__patterns.single_quote:'"'===t?o=this.__patterns.double_quote:"`"===t?o=this.__patterns.template_text:"}"===t&&(o=this.__patterns.template_expression);for(var s=o.read(),a="";this._input.hasNext();){if((a=this._input.next())===t||!e&&Hi.newline.test(a)){this._input.back();break}"\\"===a&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),a+=this._input.next()):i&&("${"===i&&"$"===a&&"{"===this._input.peek()&&(a+=this._input.next()),i===a&&(a+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(a+=this._input.next()))),s+=a+=o.read()}return s},hi.Tokenizer=on,hi.TOKEN=Wi,hi.positionable_operators=Ki.slice(),hi.line_starters=tn.slice();var sn=Xe.Output,an=Qe.Token,ln=oi,rn=si.Options,cn=hi.Tokenizer,dn=hi.line_starters,un=hi.positionable_operators,pn=hi.TOKEN;function hn(t,e){return-1!==e.indexOf(t)}function mn(t,e){return t&&t.type===pn.RESERVED&&t.text===e}function bn(t,e){return t&&t.type===pn.RESERVED&&hn(t.text,e)}var gn=["case","return","do","if","throw","else","await","break","continue","async"],vn=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),fn=[vn.before_newline,vn.preserve_newline],yn="BlockStatement",xn="Statement",_n="ObjectLiteral",wn="ArrayLiteral",Sn="ForInitializer",kn="Conditional",Cn="Expression";function Ln(t,e){e.multiline_frame||e.mode===Sn||e.mode===kn||t.remove_indent(e.start_line_index)}function An(t){return t===wn}function En(t){return hn(t,[Cn,Sn,kn])}function qn(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new rn(e)}qn.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new an(pn.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},qn.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new sn(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(yn);var i=new cn(t,this._options);return this._tokens=i.tokenize(),t},qn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&ln.lineBreak.test(t||"")&&(e=t.match(ln.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},qn.prototype.handle_token=function(t,e){t.type===pn.START_EXPR?this.handle_start_expr(t):t.type===pn.END_EXPR?this.handle_end_expr(t):t.type===pn.START_BLOCK?this.handle_start_block(t):t.type===pn.END_BLOCK?this.handle_end_block(t):t.type===pn.WORD||t.type===pn.RESERVED?this.handle_word(t):t.type===pn.SEMICOLON?this.handle_semicolon(t):t.type===pn.STRING?this.handle_string(t):t.type===pn.EQUALS?this.handle_equals(t):t.type===pn.OPERATOR?this.handle_operator(t):t.type===pn.COMMA?this.handle_comma(t):t.type===pn.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===pn.COMMENT?this.handle_comment(t,e):t.type===pn.DOT?this.handle_dot(t):t.type===pn.EOF?this.handle_eof(t):(t.type,pn.UNKNOWN,this.handle_unknown(t,e))},qn.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&An(this._flags.mode);if(t.comments_before)for(var o=t.comments_before.next();o;)this.handle_whitespace_and_comments(o,e),this.handle_token(o,e),o=t.comments_before.next();if(n)for(var s=0;s<i;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var a=1;a<i;a+=1)this.print_newline(!0,e)}};var Tn=["async","break","continue","return","throw","yield"];qn.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(hn(this._flags.last_token.text,un)||hn(t.text,un)){var n=hn(this._flags.last_token.text,un)&&hn(this._options.operator_position,fn)||hn(t.text,un);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(bn(this._flags.last_token,Tn))return;this._output.set_wrap_point()}}},qn.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==pn.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==xn||this._flags.if_block&&mn(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},qn.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||An(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},qn.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===pn.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},qn.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},qn.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},qn.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},qn.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===xn&&Ln(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},qn.prototype.start_of_object_property=function(){return this._flags.parent.mode===_n&&this._flags.mode===xn&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||bn(this._flags.last_token,["get","set"]))},qn.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||bn(this._flags.last_token,["var","let","const"])&&t.type===pn.WORD)||mn(this._flags.last_token,"do"))||!(this._flags.parent.mode===_n&&this._flags.mode===xn)&&bn(this._flags.last_token,Tn)&&!t.newlines)||mn(this._flags.last_token,"else")&&!(mn(t,"if")&&!t.comments_before))||this._flags.last_token.type===pn.END_EXPR&&(this._previous_flags.mode===Sn||this._previous_flags.mode===kn))||this._flags.last_token.type===pn.WORD&&this._flags.mode===yn&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==pn.WORD&&t.type!==pn.RESERVED)||this._flags.mode===_n&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||bn(this._flags.last_token,["get","set"])))&&(this.set_mode(xn),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,bn(t,["do","for","if","while"])),!0)},qn.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=Cn;if("["===t.text){if(this._flags.last_token.type===pn.WORD||")"===this._flags.last_token.text)return bn(this._flags.last_token,dn)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=wn,An(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),hn(this._flags.last_token.type,[pn.START_EXPR,pn.END_EXPR,pn.WORD,pn.OPERATOR,pn.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===pn.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=Sn):hn(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=kn):hn(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(hn(this._flags.last_token.text,dn)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===pn.EQUALS||this._flags.last_token.type===pn.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===pn.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);bn(i,["async","function"])||"*"===i.text&&bn(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===_n&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===pn.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(hn(this._last_last_text,["function","yield"])||this._flags.mode===_n&&hn(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===pn.START_BLOCK?this.print_newline():this._flags.last_token.type!==pn.END_EXPR&&this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==pn.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},qn.prototype.handle_end_expr=function(t){for(;this._flags.mode===xn;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&An(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==pn.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),Ln(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===kn&&(this._previous_flags.mode=Cn,this._flags.do_block=!1,this._flags.do_while=!1)},qn.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===pn.END_EXPR?(this.set_mode(yn),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(yn):i&&(hn(i.text,[":",","])&&hn(e.type,[pn.STRING,pn.WORD,pn.RESERVED])||hn(e.text,["get","set","..."])&&hn(i.type,[pn.WORD,pn.RESERVED]))?hn(this._last_last_text,["class","interface"])?this.set_mode(yn):this.set_mode(_n):this._flags.last_token.type===pn.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(yn):hn(this._flags.last_token.type,[pn.EQUALS,pn.START_EXPR,pn.COMMA,pn.OPERATOR])||bn(this._flags.last_token,["return","throw","import","default"])?this.set_mode(_n):this.set_mode(yn);var n=!e.comments_before&&"}"===e.text,o=n&&"function"===this._flags.last_word&&this._flags.last_token.type===pn.END_EXPR;if(this._options.brace_preserve_inline){var s=0,a=null;this._flags.inline_frame=!0;do{if(s+=1,(a=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(a.type!==pn.EOF&&(a.type!==pn.END_BLOCK||a.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==pn.OPERATOR&&(o||this._flags.last_token.type===pn.EQUALS||bn(this._flags.last_token,gn)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!An(this._previous_flags.mode)||this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.COMMA||((this._flags.last_token.type===pn.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===pn.COMMA||this._flags.last_token.type===pn.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==pn.OPERATOR&&this._flags.last_token.type!==pn.START_EXPR&&(this._flags.last_token.type!==pn.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},qn.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===xn;)this.restore_mode();var e=this._flags.last_token.type===pn.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(An(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},qn.prototype.handle_word=function(t){if(t.type===pn.RESERVED)if(hn(t.text,["set","get"])&&this._flags.mode!==_n)t.type=pn.WORD;else if("import"===t.text&&"("===this._tokens.peek().text)t.type=pn.WORD;else if(hn(t.text,["as","from"])&&!this._flags.import_block)t.type=pn.WORD;else if(this._flags.mode===_n){":"===this._tokens.peek().text&&(t.type=pn.WORD)}if(this.start_of_statement(t)?bn(this._flags.last_token,["var","let","const"])&&t.type===pn.WORD&&(this._flags.declaration_statement=!0):!t.newlines||En(this._flags.mode)||this._flags.last_token.type===pn.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===pn.EQUALS||!this._options.preserve_newlines&&bn(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(mn(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&mn(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===xn;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&bn(t,["case","default"]))return this.print_newline(),this._flags.last_token.type!==pn.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==pn.COMMA&&this._flags.last_token.type!==pn.START_EXPR&&this._flags.last_token.type!==pn.EQUALS&&this._flags.last_token.type!==pn.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),mn(t,"function"))return(hn(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!hn(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==pn.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD?bn(this._flags.last_token,["get","set","new","export"])||bn(this._flags.last_token,Tn)||mn(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===pn.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!En(this._flags.mode)&&!An(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===pn.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":bn(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===pn.SEMICOLON&&this._flags.mode===yn?e="NEWLINE":this._flags.last_token.type===pn.SEMICOLON&&En(this._flags.mode)?e="SPACE":this._flags.last_token.type===pn.STRING?e="NEWLINE":this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD||"*"===this._flags.last_token.text&&(hn(this._last_last_text,["function","yield"])||this._flags.mode===_n&&hn(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===pn.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===pn.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),bn(t,dn)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),bn(t,["else","catch","finally"]))?(this._flags.last_token.type!==pn.END_BLOCK||this._previous_flags.mode!==yn||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?bn(this._flags.last_token,gn)||"declare"===this._flags.last_token.text&&bn(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==pn.END_EXPR?this._flags.last_token.type===pn.START_EXPR&&bn(t,["var","let","const"])||":"===this._flags.last_token.text||(mn(t,"if")&&mn(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):bn(t,dn)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&An(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==pn.WORD&&t.previous.type!==pn.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===pn.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&mn(t,"from")&&(this._flags.import_block=!1))},qn.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==xn||this._flags.if_block&&mn(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},qn.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==pn.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===pn.RESERVED||this._flags.last_token.type===pn.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===pn.COMMA||this._flags.last_token.type===pn.START_EXPR||this._flags.last_token.type===pn.EQUALS||this._flags.last_token.type===pn.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==pn.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},qn.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},qn.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(En(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===_n||this._flags.mode===xn&&this._flags.parent.mode===_n?(this._flags.mode===xn&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},qn.prototype.handle_operator=function(t){var e="*"===t.text&&(bn(this._flags.last_token,["function","yield"])||hn(this._flags.last_token.type,[pn.START_BLOCK,pn.COMMA,pn.END_BLOCK,pn.SEMICOLON])),i=hn(t.text,["-","+"])&&(hn(this._flags.last_token.type,[pn.START_BLOCK,pn.START_EXPR,pn.EQUALS,pn.OPERATOR])||hn(this._flags.last_token.text,dn)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(bn(this._flags.last_token,gn))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==pn.DOT)if("::"!==t.text){if(this._flags.last_token.type===pn.OPERATOR&&hn(this._options.operator_position,fn)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==pn.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var o=!0,s=!0,a=!1;if(":"===t.text?0===this._flags.ternary_depth?o=!1:(this._flags.ternary_depth-=1,a=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&hn(t.text,un)){var l=":"===t.text,r=l&&a,c=l&&!a;switch(this._options.operator_position){case vn.before_newline:return this._output.space_before_token=!c,this.print_token(t),l&&!r||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case vn.after_newline:return this._output.space_before_token=!0,!l||r?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case vn.preserve_newline:return c||this.allow_wrap_or_preserved_newline(t),o=!(this._output.just_added_newline()||c),this._output.space_before_token=o,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),o=!1;var d=this._tokens.peek();s=d&&hn(d.type,[pn.WORD,pn.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),o=this._flags.last_token.type===pn.START_BLOCK,s=!1):(hn(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==pn.COMMA&&this._flags.last_token.type!==pn.START_EXPR||this.allow_wrap_or_preserved_newline(t),o=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&En(this._flags.mode)&&(o=!0),this._flags.last_token.type===pn.RESERVED?o=!0:this._flags.last_token.type===pn.END_EXPR?o=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===pn.OPERATOR&&(o=hn(t.text,["--","-","++","+"])&&hn(this._flags.last_token.text,["--","-","++","+"]),hn(t.text,["+","-"])&&hn(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==yn||this._flags.inline_frame)&&this._flags.mode!==xn||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||o,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},qn.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):ln.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},qn.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(ln.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),o=!1,s=!1,a=t.whitespace_before,l=a.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),s=function(t,e){for(var i,n=0,o=t.length;n<o;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,a),o&&(this._flags.alignment=1),i=0;i<n.length;i++)o?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):s&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(l))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},qn.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},qn.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),bn(this._flags.last_token,gn)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},qn.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},qn.prototype.handle_eof=function(t){for(;this._flags.mode===xn;)this.restore_mode();this.handle_whitespace_and_comments(t)},Ge.Beautifier=qn;var Mn=Ge.Beautifier,On=si.Options;Ye.exports=function(t,e){return new Mn(t,e).beautify()},Ye.exports.defaultOptions=function(){return new On};var In={exports:{}},$n={},Rn={},Bn=ai.Options;function Pn(t){Bn.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}Pn.prototype=new Bn,Rn.Options=Pn;var Nn=Rn.Options,zn=Xe.Output,Dn=mi.InputScanner,Hn=new(0,Mi.Directives)(/\/\*/,/\*\//),jn=/\r\n|[\r\n]/,Fn=/\r\n|[\r\n]/g,Un=/\s/,Wn=/(?:\s|\n)+/g,Yn=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,Gn=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function Xn(t,e){this._source_text=t||"",this._options=new Nn(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}Xn.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},Xn.prototype.eatWhitespace=function(t){for(var e=Un.test(this._input.peek()),i=0;Un.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},Xn.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},Xn.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},Xn.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},Xn.prototype.indent=function(){this._indentLevel++},Xn.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},Xn.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&jn.test(t||"")&&(e=t.match(jn)[0]));var i=(t=t.replace(Fn,"\n")).match(/^[\t ]*/)[0];this._output=new zn(this._options,i),this._input=new Dn(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,o,s=0,a=!1,l=!1,r=!1,c=!1,d=!1,u=this._ch;n=""!==this._input.read(Wn),o=u,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),u=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var p=this._input.read(Yn),h=Hn.get_directives(p);h&&"start"===h.ignore&&(p+=Hn.readIgnored(this._input)),this.print_string(p),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(Gn)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var m=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);m.match(/[ :]$/)&&(m=this.eatString(": ").replace(/\s$/,""),this.print_string(m),this._output.space_before_token=!0),"extend"===(m=m.replace(/\s$/,""))?c=!0:"import"===m&&(d=!0),m in this.NESTED_AT_RULE?(this._nestedLevel+=1,m in this.CONDITIONAL_GROUP_RULE&&(r=!0)):a||0!==s||-1===m.indexOf(":")||(l=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(l&&(l=!1,this.outdent()),r?(r=!1,a=this._indentLevel>=this._nestedLevel):a=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&a&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===o&&this._output.trim(!0),d=!1,c=!1,l&&(this.outdent(),l=!1),this.print_string(this._ch),a=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!a&&!r||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||c||0!==s?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),l||(l=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===s?(l&&(this.outdent(),l=!1),c=!1,d=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),s++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),s&&(s--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),this.eatWhitespace(),s++,this.indent()):")"===this._ch?(s&&(s--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||l||0!==s||d||c?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||l||0!==s?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),Un.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(n),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&Un.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},$n.Beautifier=Xn;var Vn=$n.Beautifier,Kn=Rn.Options;In.exports=function(t,e){return new Vn(t,e).beautify()},In.exports.defaultOptions=function(){return new Kn};var Zn={exports:{}},Qn={},Jn={},to=ai.Options;function eo(t){to.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}eo.prototype=new to,Jn.Options=eo;var io={},no=vi.Tokenizer,oo=vi.TOKEN,so=Mi.Directives,ao=Ii.TemplatablePattern,lo=_i.Pattern,ro={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:oo.START,RAW:oo.RAW,EOF:oo.EOF},co=new so(/<\!--/,/-->/),uo=function(t,e){no.call(this,t,e),this._current_tag_name="";var i=new ao(this._input).read_options(this._options),n=new lo(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(o).until_after(o)}};(uo.prototype=new no)._is_comment=function(t){return!1},uo.prototype._is_opening=function(t){return t.type===ro.TAG_OPEN},uo.prototype._is_closing=function(t,e){return t.type===ro.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},uo.prototype._reset=function(){this._current_tag_name=""},uo.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(ro.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(ro.UNKNOWN,this._input.next())},uo.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=co.get_directives(i))&&"start"===n.ignore&&(i+=co.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(ro.COMMENT,i)).directives=n));return e},uo.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(ro.COMMENT,i)).directives=null)}return e},uo.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(ro.TAG_OPEN,i)),n},uo.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(ro.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(ro.TAG_OPEN,i))),n},uo.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(ro.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(ro.TAG_CLOSE,"}}"))),n},uo.prototype._read_attribute=function(t,e,i){var n=null,o="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(ro.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(ro.VALUE,s)}else(o=this.__patterns.attribute.read())&&(n=e.type===ro.EQUALS?this._create_token(ro.VALUE,o):this._create_token(ro.ATTRIBUTE,o));return n},uo.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},uo.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===ro.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var o=e.opened.text.substr(1).toLowerCase();if("script"===o||"style"===o){var s=this._read_comment_or_cdata(t);if(s)return s.type=ro.TEXT,s;n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(ro.TEXT,n):null},uo.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(ro.TEXT,e)},io.Tokenizer=uo,io.TOKEN=ro;var po=Jn.Options,ho=Xe.Output,mo=io.Tokenizer,bo=io.TOKEN,go=/\r\n|[\r\n]/,vo=/\r\n|[\r\n]/g,fo=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new ho(t,e)};fo.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},fo.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},fo.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},fo.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},fo.prototype.print_preserved_newlines=function(t){var e=0;t.type!==bo.TEXT&&t.previous.type!==bo.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},fo.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},fo.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},fo.prototype.print_newline=function(t){this._output.add_new_line(t)},fo.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},fo.prototype.indent=function(){this.indent_level++},fo.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var yo=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==bo.EOF&&t.closed!==i;){if(i.type===bo.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===bo.EQUALS&&i.next.next&&i.next.next.type===bo.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function xo(t,e){return-1!==e.indexOf(t)}function _o(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function wo(t){this._printer=t,this._current_frame=null}function So(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var o=new po(e,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}wo.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},wo.prototype.record_tag=function(t){var e=new _o(this._current_frame,t,this._printer.indent_level);this._current_frame=e},wo.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},wo.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},wo.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},wo.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},So.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&go.test(t)&&(e=t.match(go)[0]));var i=(t=t.replace(vo,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},o=new ko,s=new fo(this._options,i),a=new mo(t,this._options).tokenize();this._tag_stack=new wo(s);for(var l=null,r=a.next();r.type!==bo.EOF;)r.type===bo.TAG_OPEN||r.type===bo.COMMENT?o=l=this._handle_tag_open(s,r,o,n):r.type===bo.ATTRIBUTE||r.type===bo.EQUALS||r.type===bo.VALUE||r.type===bo.TEXT&&!o.tag_complete?l=this._handle_inside_tag(s,r,o,a):r.type===bo.TAG_CLOSE?l=this._handle_tag_close(s,r,o):r.type===bo.TEXT?l=this._handle_text(s,r,o):s.add_raw_token(r),n=l,r=a.next();return s._output.get_code(e)},So.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},So.prototype._handle_inside_tag=function(t,e,i,n){var o=i.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===bo.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===bo.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===bo.EQUALS||e.type===bo.VALUE&&e.previous.type===bo.EQUALS)&&t.set_space_before_token(!1),e.type===bo.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),o=o||0!==e.newlines),this._is_wrap_attributes_force)){var a=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var l,r=!0,c=0;do{if((l=n.peek(c)).type===bo.ATTRIBUTE){r=!1;break}c+=1}while(c<4&&l.type!==bo.EOF&&l.type!==bo.TAG_CLOSE);a=!r}a&&(t.print_newline(!1),o=!0)}t.print_token(e),o=o||t.previous_token_wrapped(),i.has_wrapped_attrs=o}return s},So.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},So.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var o,s=e.text,a=1,l="",r="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?o=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?o=this._css_beautify:"html"===i.custom_beautifier_name&&(o=function(t,e){return new So(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?a=0:"separate"===this._options.indent_scripts&&(a=-t.indent_level);var c=t.get_full_indent(a);if(s=s.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var d=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!d)return void t.add_raw_token(e);l=c+d[1]+"\n",s=d[4],d[5]&&(r=c+d[5]),s=s.replace(/\n[ \t]*$/,""),(d[2]||-1!==d[3].indexOf("\n"))&&(d=d[3].match(/[ \t]+$/))&&(e.whitespace_before=d[0])}if(s)if(o){var u=function(){this.eol="\n"};u.prototype=this._options.raw_options,s=o(c+s,new u)}else{var p=e.whitespace_before;p&&(s=s.replace(new RegExp("\n("+p+")?","g"),"\n")),s=c+s.replace(/\n/g,"\n"+c)}l&&(s=s?l+s+"\n"+r:l+r),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},So.prototype._handle_tag_open=function(t,e,i,n){var o=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==bo.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,o,i,n),o.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=e.text.length+1),o.tag_complete||o.is_unformatted||(t.alignment_size=o.alignment_size),o};var ko=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===bo.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};So.prototype._get_tag_open_token=function(t){var e=new ko(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||xo(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&xo(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&xo(e.tag_check,this._options.content_unformatted),e.is_inline_element=xo(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},So.prototype._set_tag_position=function(t,e,i,n,o){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=yo(i.tag_check,e)))),xo(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&o.type===bo.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var s=!1;s=(s=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(o.type===bo.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==o.type,(i.is_content_unformatted||i.is_unformatted)&&(s=!1),s&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===o.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},So.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Co=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],Lo=["a","audio","del","ins","map","noscript","video"];So.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Co.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==Lo.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},Qn.Beautifier=So;var Ao=Qn.Beautifier,Eo=Jn.Options;Zn.exports=function(t,e,i,n){return new Ao(t,e,i,n).beautify()},Zn.exports.defaultOptions=function(){return new Eo};var qo=Ye.exports,To=In.exports,Mo=Zn.exports;function Oo(t,e,i,n){return Mo(t,e,i=i||qo,n=n||To)}Oo.defaultOptions=Mo.defaultOptions,We.js=qo,We.css=To,We.html=Oo,function(t){!function(t){var e=We;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(t)}(Ue);var Io=Ue.exports;function $o(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ro(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Bo(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ro(Object(i),!0).forEach((function(e){$o(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ro(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Po(t,e){if(null==t)return{};var i,n,o=function(t,e){if(null==t)return{};var i,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function No(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function zo(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Do(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ho(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Do(Object(i),!0).forEach((function(e){zo(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Do(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function jo(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}function Fo(t){return function e(){for(var i=this,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return o.length>=t.length?t.apply(this,o):function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e.apply(i,[].concat(o,n))}}}function Uo(t){return{}.toString.call(t).includes("Object")}function Wo(t){return"function"==typeof t}var Yo=Fo((function(t,e){throw new Error(t[e]||t.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),Go={changes:function(t,e){return Uo(e)||Yo("changeType"),Object.keys(e).some((function(e){return i=t,n=e,!Object.prototype.hasOwnProperty.call(i,n);var i,n}))&&Yo("changeField"),e},selector:function(t){Wo(t)||Yo("selectorType")},handler:function(t){Wo(t)||Uo(t)||Yo("handlerType"),Uo(t)&&Object.values(t).some((function(t){return!Wo(t)}))&&Yo("handlersType")},initial:function(t){var e;t||Yo("initialIsRequired"),Uo(t)||Yo("initialType"),e=t,Object.keys(e).length||Yo("initialContent")}};function Xo(t,e){return Wo(e)?e(t.current):e}function Vo(t,e){return t.current=Ho(Ho({},t.current),e),e}function Ko(t,e,i){return Wo(e)?e(t.current):Object.keys(i).forEach((function(i){var n;return null===(n=e[i])||void 0===n?void 0:n.call(e,t.current[i])})),i}var Zo={create:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Go.initial(t),Go.handler(e);var i={current:t},n=Fo(Ko)(i,e),o=Fo(Vo)(i),s=Fo(Go.changes)(t),a=Fo(Xo)(i);function l(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return Go.selector(t),t(i.current)}function r(t){jo(n,o,s,a)(t)}return[l,r]}};var Qo,Jo={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},ts=(Qo=function(t,e){throw new Error(t[e]||t.default)},function t(){for(var e=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=Qo.length?Qo.apply(this,n):function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t.apply(e,[].concat(n,o))}})(Jo),es={config:function(t){var e;return t||ts("configIsRequired"),e=t,{}.toString.call(e).includes("Object")||ts("configType"),t.urls?(console.warn(Jo.deprecation),{paths:{vs:t.urls.monacoBase}}):t}};function is(t,e){return Object.keys(e).forEach((function(i){e[i]instanceof Object&&t[i]&&Object.assign(e[i],is(t[i],e[i]))})),Bo(Bo({},t),e)}var ns={type:"cancelation",msg:"operation is manually canceled"};function os(t){var e=!1,i=new Promise((function(i,n){t.then((function(t){return e?n(ns):i(t)})),t.catch(n)}));return i.cancel=function(){return e=!0},i}var ss,as,ls=Zo.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),rs=(as=2,function(t){if(Array.isArray(t))return t}(ss=ls)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,o=!1,s=void 0;try{for(var a,l=t[Symbol.iterator]();!(n=(a=l.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){o=!0,s=t}finally{try{n||null==l.return||l.return()}finally{if(o)throw s}}return i}}(ss,as)||function(t,e){if(t){if("string"==typeof t)return No(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?No(t,e):void 0}}(ss,as)||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.")}()),cs=rs[0],ds=rs[1];function us(t){return document.body.appendChild(t)}function ps(t){var e=cs((function(t){return{config:t.config,reject:t.reject}})),i=function(t){var e=document.createElement("script");return t&&(e.src=t),e}("".concat(e.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=e.reject,i}function hs(){var t=cs((function(t){return{config:t.config,resolve:t.resolve,reject:t.reject}})),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],(function(e){ms(e),t.resolve(e)}),(function(e){t.reject(e)}))}function ms(t){cs().monaco||ds({monaco:t})}var bs=new Promise((function(t,e){return ds({resolve:t,reject:e})})),gs={config:function(t){var e=es.config(t),i=e.monaco,n=Po(e,["monaco"]);ds((function(t){return{config:is(t.config,n),monaco:i}}))},init:function(){var t=cs((function(t){return{monaco:t.monaco,isInitialized:t.isInitialized,resolve:t.resolve}}));if(!t.isInitialized){if(ds({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),os(bs);if(window.monaco&&window.monaco.editor)return ms(window.monaco),t.resolve(window.monaco),os(bs);!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(us,ps)(hs)}return os(bs)},__getMonacoInstance:function(){return cs((function(t){return t.monaco}))}};const vs=new je;let fs={};class ys{constructor(t){this.builder=t;const e=this.builder.util,i=this.builder.builderStuff;let n=i.querySelector(".viewhtml");if(!n){const t=`<div class="is-modal viewhtml" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content">\n <textarea class="tabSupport" style="width:100%;height:calc(100% - 50px);border:none;margin:0;box-sizing:border-box;"></textarea>\n <div class="is-modal-footer" style="border-top:1px solid ${this.builder.styleSeparatorColor};width:100%;height:50px;position:absolute;left:0;bottom:0;overflow:hidden;text-align:right">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlmonaco" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.blockCodeEditorWidth};max-width:${this.builder.blockCodeEditorMaxWidth};padding:0">\n <textarea style="position:absolute;display:none;"></textarea>\n <div class="input-code-editor" style="width:100%;height:${this.builder.blockCodeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlexternal" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.codeEditorWidth};max-width:${this.builder.codeEditorMaxWidth};padding:0">\n <div class="input-code-editor" style="width:100%;height:${this.builder.codeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n \n `;vs.appendHtml(i,t),n=i.querySelector(".viewhtml");let o=i.querySelector(".viewhtmlmonaco"),s=i.querySelector(".viewhtmlexternal"),a=n.querySelector(".input-ok");vs.addEventListener(a,"click",(()=>{this.applyHtml(n)})),a=n.querySelector(".input-cancel"),vs.addEventListener(a,"click",(()=>{this.builder.hideModal(n)})),a=o.querySelector(".input-ok"),vs.addEventListener(a,"click",(()=>{this.applyHtml(o)})),a=o.querySelector(".input-cancel"),vs.addEventListener(a,"click",(()=>{this.builder.hideModal(o)})),a=s.querySelector(".input-ok"),vs.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-ok");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(s)})),a=s.querySelector(".input-cancel"),vs.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-cancel");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(s)}))}}applyHtml(t){const e=this.builder.util;let i=this.builder.codeEditorMode,n=this.builder.codeEditorArea;this.builder.uo.saveForUndo();let o=t.querySelector("textarea").value;if("code"===i){let i=this.builder.activeCodeBlock;i.setAttribute("data-html",encodeURIComponent(o)),o=o.replace(/{id}/g,e.makeId());for(let t=1;t<=20;t++)o=o.replace("[%HTML"+t+"%]",void 0===i.getAttribute("data-html-"+t)?"":decodeURIComponent(i.getAttribute("data-html-"+t)));i.innerHTML="";let n=document.createRange();n.setStart(i,0),i.appendChild(n.createContextualFragment(o));let s=this.builder.doc.querySelector(".builder-active");return s&&this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),this.builder.hideModal(t),void e.hideControls()}if(o=this.fromViewToActual(o),"cell"===i){e.cellSelected().innerHTML=o;let t=this.builder.doc.querySelector(".builder-active");t&&this.builder.applyBehaviorOn(t),this.builder.opts.onChange(),this.builder.opts.onRender()}if("row"===i){let t,i=e.cellSelected();if(t=i?i.parentNode:e.rowSelected(),!t)return;t.innerHTML=o;let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender()}if("full"===i){n.innerHTML="";let t=document.createRange();t.setStart(n,0),n.appendChild(t.createContextualFragment(o)),this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender(),e.clearActiveCell()}e.clearControls(),this.builder.hideModal(t)}viewHtmlExternal(){const t=this.builder.util,e=this.builder.builderStuff.querySelector(".viewhtmlexternal");document.activeElement&&(this.elmFocus=document.activeElement),t.showModal(e,!0,(()=>{this.elmFocus&&this.elmFocus.focus()}),!1),e.querySelector(".input-code-editor").style.opacity=.01,this._viewHtmlExternal()}_viewHtmlExternal(){const t=document.querySelector("textarea[data-source-active]");let e=this.builder.builderStuff.querySelector(".viewhtmlexternal").querySelector(".input-code-editor");if(!e.querySelector(".monaco-editor"))return gs.init().then((t=>{this.builder.monaco=t,e.getAttribute("data-mode-id")||(this.builder.codeEditorExternal=t.editor.create(e,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""})),this.builder.codeEditorExternal.onDidChangeModelContent((()=>{document.querySelector("textarea[data-source-active]").value=this.builder.codeEditorExternal.getModel().getValue()}))})),void setTimeout((()=>{this._viewHtmlExternal()}),100);const i=this.builder.monaco.editor.createModel(t.value,"html");this.builder.codeEditorExternal.setModel(i),e.style.opacity=""}view(t,e,i){const n=this.builder.util,o=this.builder.builderStuff;let s;s=this.builder.opts.htmlSyntaxHighlighting?o.querySelector(".viewhtmlmonaco"):o.querySelector(".viewhtml");let a=s.querySelector(".is-modal-content"),l=s.querySelector(".input-code-editor");l.style.opacity=.01,"full"===t?(a.style.width=this.builder.codeEditorWidth,a.style.maxWidth=this.builder.codeEditorMaxWidth,l.style.height=this.builder.codeEditorHeight):(a.style.width=this.builder.blockCodeEditorWidth,a.style.maxWidth=this.builder.blockCodeEditorMaxWidth,l.style.height=this.builder.blockCodeEditorHeight),n.showModal(s,!0,(()=>{i&&(i.removeAttribute("data-focus"),i.focus())})),i&&i.setAttribute("data-focus",!0),this._view(t,e)}_view(t,e){const i=this.builder.util,n=this.builder.builderStuff;let o;if(this.builder.opts.htmlSyntaxHighlighting){o=n.querySelector(".viewhtmlmonaco");let i=o.querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return gs.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditor=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""}));let e=o.querySelector("textarea");this.builder.codeEditor.onDidChangeModelContent((()=>{e.value=this.builder.codeEditor.getModel().getValue()}))})),void setTimeout((()=>{this._view(t,e)}),100)}else o=n.querySelector(".viewhtml");let s=o.querySelector("textarea");if("cell"===t){const t=i.cellSelected();if(!t)return;let e=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,e.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1}if("row"===t){let t,e=i.cellSelected();if(t=e?e.parentNode:i.rowSelected(),!t)return;let n=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,n.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1,vs.removeClass(t,"row-outline")}if("full"===t){if(e);else{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);if(t.length>1){const n=i.cellSelected();e=n?n.parentNode.parentNode:t[0]}else e=t[0];if(""!==this.builder.opts.page){const t=this.builder.doc.querySelector(this.builder.opts.page);t&&(e=t)}}let t=o.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,this.builder.shortenHTML?t.value=this.readHtml(e,!0):t.value=this.readHtml(e,!1),this.builder.cleanHtmlFormatting=!1}if(this.builder.opts.htmlSyntaxHighlighting){const t=this.builder.monaco.editor.createModel(s.value,"html");this.builder.codeEditor.setModel(t)}let a=n.querySelector(".is-pop.columnmore");a&&(a.style.display="");let l=n.querySelector(".is-pop.rowmore");l&&(l.style.display=""),this.builder.codeEditorMode=t,this.builder.codeEditorArea=e,o.querySelector(".input-code-editor").style.opacity=""}fromViewToActual(t){for(var e in fs)t=t.replace(e,fs[e]);return t}readHtml(t,e,i,n){if(this.builder.opts.absolutePath){let e=t.querySelectorAll("a");Array.prototype.forEach.call(e,(t=>{let e=t.href;t.setAttribute("href",e)}));let i=t.querySelectorAll("img");Array.prototype.forEach.call(i,(t=>{let e=t.src;t.setAttribute("src",e)}))}this.builder.cleanHtmlFormatting;const o=this.builder.util;let s,a=document.createElement("div");a.innerHTML=t.innerHTML;let l=a.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(l,(t=>{let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{if(i.closest(".glide__slide--clone"))return;let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}))})),l=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(l,(t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,o.makeId()),t.innerHTML=e;let i=t.querySelectorAll("[data-subblock]");var n=1;Array.prototype.forEach.call(i,(e=>{e.innerHTML=void 0===t.getAttribute("data-html-"+n)?"":decodeURIComponent(t.getAttribute("data-html-"+n)),n++}))})),e&&(fs={},l=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(l,(t=>{let e=o.makeId();fs[e]=t.getAttribute("data-html"),t.setAttribute("data-html",e);for(let i=1;i<=20;i++)void 0!==t.getAttribute("data-html-"+i)&&(e=o.makeId(),fs[e]=t.getAttribute("data-html-"+i),t.getAttribute("data-html-"+i,e));void 0!==t.getAttribute("data-settings")&&(e=o.makeId(),fs[e]=t.getAttribute("data-settings"),t.getAttribute("data-settings",e))}))),this.builder.makeAbsolute){const t=t=>{let e=document.createElement("img");return e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl")},e=t=>{let e=document.createElement("img");e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl");let i=window.location.href.substring(0,window.location.href.lastIndexOf("/"));return t.replace(i,"[%PATH%]")},i=(e,i)=>{if(e.hasAttribute(i)){if("video"!==e.parentNode.tagName.toLowerCase()&&"audio"!==e.parentNode.tagName.toLowerCase())return;let n=e.getAttribute(i);n=t(n),e.setAttribute(i,`${n}`)}};let n=a.querySelectorAll("img");Array.prototype.forEach.call(n,(t=>{let e=t.src;t.setAttribute("src",e)})),a.querySelectorAll("*").forEach((n=>{if(n.style.backgroundImage){let t=n.style.backgroundImage;if(-1!==t.indexOf("url(")){let i=t.slice(4,-1).replace(/["']/g,"");i=e(i),n.style.backgroundImage=`url(${i})`}}if(i(n,"src"),i(n,"data-default"),i(n,"data-240"),i(n,"data-360"),i(n,"data-480"),i(n,"data-540"),i(n,"data-720"),i(n,"data-1080"),i(n,"data-1440"),i(n,"data-2160"),n.hasAttribute("href")&&"link"===n.tagName.toLowerCase()){let e=n.getAttribute("href");e=t(e),n.setAttribute("href",`${e}`)}}))}let r=a.querySelectorAll(".is-builder");Array.prototype.forEach.call(r,(t=>{t.style.transform="",t.style.WebkitTransform="",t.style.MozTransform="",t.removeAttribute("data-sort"),vs.removeClass(t,"builder-active");vs.elementChildren(t).forEach((t=>{vs.elementChildren(t).forEach((t=>{t.style.cursor=""}))}))}));vs.elementChildren(a).forEach((t=>{t.style.cursor="";vs.elementChildren(t).forEach((t=>{t.style.cursor=""}))}));let c=a.querySelectorAll(".sortable-chosen");vs.removeClasses(c,"sortable-chosen"),c=a.querySelectorAll(".sortable-ghost"),vs.removeClasses(c,"sortable-ghost"),c=a.querySelectorAll(".elm-active"),vs.removeClasses(c,"elm-active"),c=a.querySelectorAll(".elm-inspected"),vs.removeClasses(c,"elm-inspected"),c=a.querySelectorAll(".cell-active"),vs.removeClasses(c,"cell-active"),c=a.querySelectorAll(".row-active"),vs.removeClasses(c,"row-active"),c=a.querySelectorAll(".row-outline"),vs.removeClasses(c,"row-outline"),c=a.querySelectorAll(".is-builder"),vs.removeClasses(c,"is-builder"),c=a.querySelectorAll(".row-outline"),vs.removeClasses(c,"row-outline"),c=a.querySelectorAll("[data-click]"),vs.removeAttributes(c,"data-click"),c=a.querySelectorAll("[contenteditable]"),vs.removeAttributes(c,"contenteditable"),c=a.querySelectorAll("[draggridoutline]"),vs.removeAttributes(c,"draggridoutline"),c=a.querySelectorAll("[between-blocks-left]"),vs.removeAttributes(c,"between-blocks-left"),c=a.querySelectorAll("[between-blocks-center]"),vs.removeAttributes(c,"between-blocks-center"),c=a.querySelectorAll("[hideelementhighlight]"),vs.removeAttributes(c,"hideelementhighlight"),c=a.querySelectorAll("[data-module-active]"),vs.removeAttributes(c,"data-module-active"),c=a.querySelectorAll("[draggable]"),vs.removeAttributes(c,"draggable"),c=a.querySelectorAll("[data-animated]"),vs.removeAttributes(c,"data-animated"),c=a.querySelectorAll("[data-saveforundo]"),vs.removeAttributes(c,"data-saveforundo"),c=a.querySelectorAll("[hidesnippetaddtool]"),vs.removeAttributes(c,"hidesnippetaddtool"),c=a.querySelectorAll("[gray]"),vs.removeAttributes(c,"gray"),c=a.querySelectorAll("[rowoutline]"),vs.removeAttributes(c,"rowoutline"),c=a.querySelectorAll("[hidecolumntool]"),vs.removeAttributes(c,"hidecolumntool"),c=a.querySelectorAll("[grayoutline]"),vs.removeAttributes(c,"grayoutline"),c=a.querySelectorAll("[hideoutline]"),vs.removeAttributes(c,"hideoutline"),c=a.querySelectorAll("[leftrowtool]"),vs.removeAttributes(c,"leftrowtool"),c=a.querySelectorAll("[minimal]"),vs.removeAttributes(c,"minimal"),c=a.querySelectorAll("[clean]"),vs.removeAttributes(c,"clean"),c=a.querySelectorAll("[grideditor]"),vs.removeAttributes(c,"grideditor"),c=a.querySelectorAll("[gridoutline]"),vs.removeAttributes(c,"gridoutline"),vs.removeElements(a.querySelectorAll(".is-row-tool")),vs.removeElements(a.querySelectorAll(".is-col-tool")),vs.removeElements(a.querySelectorAll(".is-rowadd-tool")),vs.removeElements(a.querySelectorAll(".ovl")),vs.removeElements(a.querySelectorAll(".row-add-initial")),c=a.querySelectorAll(".aos-init"),vs.removeClasses(c,"aos-init"),c=a.querySelectorAll(".aos-animate"),vs.removeClasses(c,"aos-animate"),c=a.querySelectorAll(".skrollable"),vs.removeClasses(c,"skrollable"),c=a.querySelectorAll(".skrollable-after"),vs.removeClasses(c,"skrollable-after"),c=a.querySelectorAll(".skrollable-before"),vs.removeClasses(c,"skrollable-before"),c=a.querySelectorAll(".skrollable-between"),vs.removeClasses(c,"skrollable-between"),c=a.querySelectorAll(".is-inview"),vs.removeClasses(c,"is-inview");let d=a.querySelectorAll('[class=""]');Array.prototype.forEach.call(d,(t=>{t.removeAttribute("class")}));let u=a.querySelectorAll(".is-row-overlay");Array.prototype.forEach.call(u,(t=>{t.hasAttribute("style")||t.parentNode.removeChild(t)})),vs.removeEmptyStyle(a),c=a.querySelectorAll("[data-keep]"),vs.removeAttributes(c,"data-keep");let p=a.querySelectorAll("a");if(Array.prototype.forEach.call(p,(t=>{"inline-block"===t.style.display&&1===t.parentNode.childElementCount&&"span"===t.parentNode.tagName.toLowerCase()&&(t.parentNode.outerHTML=t.parentNode.innerHTML)})),n){a.querySelectorAll("[data-html]").forEach((t=>{t.innerHTML=""}))}if(s="",i){let t=a.querySelectorAll(".is-dummy");vs.removeElements(t),t=a.querySelectorAll("[data-scroll]"),vs.removeAttributes(t,"data-scroll"),t=a.querySelectorAll("[data-scroll-once]"),vs.removeAttributes(t,"data-scroll-once"),this.builder.shortenOutput&&(t=a.querySelectorAll("[data-noedit]"),vs.removeAttributes(t,"data-noedit"),t=a.querySelectorAll("[data-module]"),vs.removeAttributes(t,"data-module"),t=a.querySelectorAll("[data-module-desc]"),vs.removeAttributes(t,"data-module-desc"),t=a.querySelectorAll("[data-dialog-width]"),vs.removeAttributes(t,"data-dialog-width"),t=a.querySelectorAll("[data-dialog-height]"),vs.removeAttributes(t,"data-dialog-height"),t=a.querySelectorAll("[data-html]"),vs.removeAttributes(t,"data-html"),t=a.querySelectorAll("[data-settings]"),vs.removeAttributes(t,"data-settings"),t=a.querySelectorAll("[data-html-1]"),vs.removeAttributes(t,"data-html-1"),t=a.querySelectorAll("[data-html-2]"),vs.removeAttributes(t,"data-html-2"),t=a.querySelectorAll("[data-html-3]"),vs.removeAttributes(t,"data-html-3"),t=a.querySelectorAll("[data-html-4]"),vs.removeAttributes(t,"data-html-4"),t=a.querySelectorAll("[data-html-5]"),vs.removeAttributes(t,"data-html-5"),t=a.querySelectorAll("[data-html-6]"),vs.removeAttributes(t,"data-html-6"),t=a.querySelectorAll("[data-html-7]"),vs.removeAttributes(t,"data-html-7"),t=a.querySelectorAll("[data-html-8]"),vs.removeAttributes(t,"data-html-8"),t=a.querySelectorAll("[data-html-9]"),vs.removeAttributes(t,"data-html-9"),t=a.querySelectorAll("[data-html-10]"),vs.removeAttributes(t,"data-html-10"),t=a.querySelectorAll("[data-html-12]"),vs.removeAttributes(t,"data-html-12"),t=a.querySelectorAll("[data-html-13]"),vs.removeAttributes(t,"data-html-13"),t=a.querySelectorAll("[data-html-14]"),vs.removeAttributes(t,"data-html-14"),t=a.querySelectorAll("[data-html-15]"),vs.removeAttributes(t,"data-html-15"),t=a.querySelectorAll("[data-html-16]"),vs.removeAttributes(t,"data-html-16"),t=a.querySelectorAll("[data-html-17]"),vs.removeAttributes(t,"data-html-17"),t=a.querySelectorAll("[data-html-18]"),vs.removeAttributes(t,"data-html-18"),t=a.querySelectorAll("[data-html-19]"),vs.removeAttributes(t,"data-html-19"),t=a.querySelectorAll("[data-html-20]"),vs.removeAttributes(t,"data-html-20"),t=a.querySelectorAll("[data-html-21]"),vs.removeAttributes(t,"data-html-21"),t=a.querySelectorAll("[data-html-21]"),vs.removeAttributes(t,"data-html-21"),t=a.querySelectorAll("[data-html-22]"),vs.removeAttributes(t,"data-html-22"),t=a.querySelectorAll("[data-html-23]"),vs.removeAttributes(t,"data-html-23"),t=a.querySelectorAll("[data-html-24]"),vs.removeAttributes(t,"data-html-24"),t=a.querySelectorAll("[data-html-25]"),vs.removeAttributes(t,"data-html-25")),t=a.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]"),Array.prototype.forEach.call(t,(t=>{t.style.transition="",t.style.transform="",t.style.opacity=""})),t=a.querySelectorAll(".is-animated"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"animated"),vs.removeClass(t,"pulse"),vs.removeClass(t,"bounceIn"),vs.removeClass(t,"fadeIn"),vs.removeClass(t,"fadeOut"),vs.removeClass(t,"fadeInDown"),vs.removeClass(t,"fadeInLeft"),vs.removeClass(t,"fadeInRight"),vs.removeClass(t,"fadeInUp"),vs.removeClass(t,"flipInX"),vs.removeClass(t,"flipInY"),vs.removeClass(t,"slideInUp"),vs.removeClass(t,"slideInDown"),vs.removeClass(t,"slideInLeft"),vs.removeClass(t,"slideInRight"),vs.removeClass(t,"zoomIn"),t.style.animationDelay="",t.style.transitionDelay="",t.style.transitionDuration="",t.style.transitionTimingFunction="",t.style.transitionProperty=""}));let e=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(e,(t=>{t.removeAttribute("style")})),t=a.querySelectorAll(".is-appeared"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"is-appeared")})),t=a.querySelectorAll(".box-active"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"box-active")})),t=a.querySelectorAll(".section-active"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"section-active")})),t=a.querySelectorAll(".section-select"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"section-select")})),t=a.querySelectorAll(".box-select"),Array.prototype.forEach.call(t,(t=>{vs.removeClass(t,"box-select")})),t=a.querySelectorAll(".is-section-tool"),vs.removeElements(t),t=a.querySelectorAll(".is-box-tool"),vs.removeElements(t),t=a.querySelectorAll(".is-box-info"),vs.removeElements(t),t=a.querySelectorAll(".is-section-info"),vs.removeElements(t);var h="",m="",b="";vs.elementChildren(a).forEach((t=>{let e=t;if(vs.hasClass(e,"is-section")){var i="";e.getAttribute("class")&&(i=' class="'+e.getAttribute("class")+'"');var n=e.cloneNode(!0),o=n.outerHTML;s+=o,-1===i.indexOf("is-static")?h+=o+"\n\n":m+=o+"\n\n"}else o=(n=e.cloneNode(!0)).outerHTML,s+=o,b+=o}));let i=document.querySelector("[data-contentbox]"),n=!1;i&&(n=i.settings.disableStaticSection),n||(s=h+m+b),s=a.innerHTML.trim(),s=s.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}else{let t=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(t,(t=>{t.removeAttribute("style")})),this.builder.shortenOutput&&(c=a.querySelectorAll("[data-noedit]"),vs.removeAttributes(c,"data-noedit"),c=a.querySelectorAll("[data-module]"),vs.removeAttributes(c,"data-module"),c=a.querySelectorAll("[data-module-desc]"),vs.removeAttributes(c,"data-module-desc"),c=a.querySelectorAll("[data-dialog-width]"),vs.removeAttributes(c,"data-dialog-width"),c=a.querySelectorAll("[data-dialog-height]"),vs.removeAttributes(c,"data-dialog-height"),c=a.querySelectorAll("[data-html]"),vs.removeAttributes(c,"data-html"),c=a.querySelectorAll("[data-settings]"),vs.removeAttributes(c,"data-settings"),c=a.querySelectorAll("[data-html-1]"),vs.removeAttributes(c,"data-html-1"),c=a.querySelectorAll("[data-html-2]"),vs.removeAttributes(c,"data-html-2"),c=a.querySelectorAll("[data-html-3]"),vs.removeAttributes(c,"data-html-3"),c=a.querySelectorAll("[data-html-4]"),vs.removeAttributes(c,"data-html-4"),c=a.querySelectorAll("[data-html-5]"),vs.removeAttributes(c,"data-html-5"),c=a.querySelectorAll("[data-html-6]"),vs.removeAttributes(c,"data-html-6"),c=a.querySelectorAll("[data-html-7]"),vs.removeAttributes(c,"data-html-7"),c=a.querySelectorAll("[data-html-8]"),vs.removeAttributes(c,"data-html-8"),c=a.querySelectorAll("[data-html-9]"),vs.removeAttributes(c,"data-html-9"),c=a.querySelectorAll("[data-html-10]"),vs.removeAttributes(c,"data-html-10"),c=a.querySelectorAll("[data-html-12]"),vs.removeAttributes(c,"data-html-12"),c=a.querySelectorAll("[data-html-13]"),vs.removeAttributes(c,"data-html-13"),c=a.querySelectorAll("[data-html-14]"),vs.removeAttributes(c,"data-html-14"),c=a.querySelectorAll("[data-html-15]"),vs.removeAttributes(c,"data-html-15"),c=a.querySelectorAll("[data-html-16]"),vs.removeAttributes(c,"data-html-16"),c=a.querySelectorAll("[data-html-17]"),vs.removeAttributes(c,"data-html-17"),c=a.querySelectorAll("[data-html-18]"),vs.removeAttributes(c,"data-html-18"),c=a.querySelectorAll("[data-html-19]"),vs.removeAttributes(c,"data-html-19"),c=a.querySelectorAll("[data-html-20]"),vs.removeAttributes(c,"data-html-20"),c=a.querySelectorAll("[data-html-21]"),vs.removeAttributes(c,"data-html-21"),c=a.querySelectorAll("[data-html-21]"),vs.removeAttributes(c,"data-html-21"),c=a.querySelectorAll("[data-html-22]"),vs.removeAttributes(c,"data-html-22"),c=a.querySelectorAll("[data-html-23]"),vs.removeAttributes(c,"data-html-23"),c=a.querySelectorAll("[data-html-24]"),vs.removeAttributes(c,"data-html-24"),c=a.querySelectorAll("[data-html-25]"),vs.removeAttributes(c,"data-html-25")),s=a.innerHTML.trim(),s=s.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}let g=Io.html;return s=g(s),s=s.replace(/(\r\n|\r|\n){3,}/g,"$1\n"),s}beautify(t){return t=(t=(0,Io.html)(t)).replace(/(\r\n|\r|\n){3,}/g,"$1\n")}}class xs{constructor(t){this.builder=t;const e=this.builder.dom;this.dom=e,this.undoList=[]}readStyles(){if(this.builder.opts.undoContainerOnly)return"";let t,e,i="",n=this.builder.doc.getElementsByTagName("link");for(t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")&&(i+=n[t].outerHTML);for(n=this.builder.doc.getElementsByTagName("link"),t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")||-1!==e.indexOf("type-")&&(i+=n[t].outerHTML);return i}writeStyles(t){const e=this.dom;if(this.builder.opts.undoContainerOnly)return;let i,n,o=this.builder.doc.getElementsByTagName("link");for(i=0;i<o.length;i++)n=o[i].href.toLowerCase(),(-1!==n.indexOf("basetype-")||-1!==n.indexOf("type-"))&&o[i].parentNode.removeChild(o[i]);let s=this.builder.doc.getElementsByTagName("head")[0];e.appendHtml(s,t)}readHtml(){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);let e="";return Array.prototype.forEach.call(t,(t=>{e+=t.innerHTML+"####|####"})),e=e.substr(0,e.length-9),e}return this.builder.doc.querySelector(this.builder.opts.page).innerHTML}cleaning(t){const e=this.dom;let i=t.querySelectorAll(".is-builder");Array.prototype.forEach.call(i,(t=>{t.removeAttribute("data-sort")}));let n=t.querySelectorAll("[data-click]");e.removeAttributes(n,"data-click"),e.removeElements(t.querySelectorAll(".is-row-tool")),e.removeElements(t.querySelectorAll(".is-rowadd-tool")),e.removeElements(t.querySelectorAll(".is-col-tool")),e.removeElements(t.querySelectorAll(".ovl")),e.removeElements(t.querySelectorAll(".row-add-initial")),n=t.querySelectorAll(".is-section-tool"),e.removeElements(n)}writeHtml(t){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){const e=this.builder.doc.querySelectorAll(this.builder.opts.container);let i=0;Array.prototype.forEach.call(e,(e=>{var n=document.createRange();e.innerHTML="",e.appendChild(n.createContextualFragment(t.split("####|####")[i])),this.cleaning(e),this.builder.applyBehaviorOn(e),i++}))}else{let i=this.builder.doc.querySelector(this.builder.opts.page);var e=document.createRange();i.innerHTML="",i.appendChild(e.createContextualFragment(t)),this.cleaning(i)}this.builder.opts.onRender()}saveForUndo(t){if(this.builder.onBeforeSaveForUndo&&this.builder.onBeforeSaveForUndo(),this.builder.undoRedoStyles){if(this.undoList[120]){let e=this.undoList[120][0].split("###$###")[1];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}}else if(this.undoList[120]){let e=this.undoList[120][0];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}if(this.builder.saveForUndoCheck=!0===t,this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=" "+this.readStyles()+"###$###"+this.readHtml();this.undoList[120]=[t,null]}else this.undoList[120]=[this.readHtml(),null]}doUndo(){const t=this.dom;if(!this.undoList[120])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[99]=this.undoList[100],this.undoList[100]=this.undoList[101],this.undoList[101]=this.undoList[102],this.undoList[102]=this.undoList[103],this.undoList[103]=this.undoList[104],this.undoList[104]=this.undoList[105],this.undoList[105]=this.undoList[106],this.undoList[106]=this.undoList[107],this.undoList[107]=this.undoList[108],this.undoList[108]=this.undoList[109],this.undoList[109]=this.undoList[110],this.undoList[110]=this.undoList[111],this.undoList[111]=this.undoList[112],this.undoList[112]=this.undoList[113],this.undoList[113]=this.undoList[114],this.undoList[114]=this.undoList[115],this.undoList[115]=this.undoList[116],this.undoList[116]=this.undoList[117],this.undoList[117]=this.undoList[118],this.undoList[118]=this.undoList[119],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[119]=[i,null],i=this.undoList[120][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[119]=[this.readHtml(),null];let t=this.undoList[120][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[120]=this.undoList[121],this.undoList[121]=this.undoList[122],this.undoList[122]=this.undoList[123],this.undoList[123]=this.undoList[124],this.undoList[124]=this.undoList[125],this.undoList[125]=this.undoList[126],this.undoList[126]=this.undoList[127],this.undoList[127]=this.undoList[128],this.undoList[128]=this.undoList[129],this.undoList[129]=this.undoList[130],this.undoList[130]=this.undoList[131],this.undoList[131]=this.undoList[132],this.undoList[132]=this.undoList[133],this.undoList[133]=this.undoList[134],this.undoList[134]=this.undoList[135],this.undoList[135]=this.undoList[136],this.undoList[136]=this.undoList[137],this.undoList[137]=this.undoList[138],this.undoList[138]=this.undoList[139],this.undoList[139]=this.undoList[140],this.undoList[140]=this.undoList[141];const e=new He(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onUndo&&this.builder.opts.onUndo(),this.builder.undoRedoInProcess=!1}doRedo(){const t=this.dom;if(!this.undoList[119])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[141]=this.undoList[140],this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[120]=[i,null],i=this.undoList[119][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[120]=[this.readHtml(),null];let t=this.undoList[119][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[119]=this.undoList[118],this.undoList[118]=this.undoList[117],this.undoList[117]=this.undoList[116],this.undoList[116]=this.undoList[115],this.undoList[115]=this.undoList[114],this.undoList[114]=this.undoList[113],this.undoList[113]=this.undoList[112],this.undoList[112]=this.undoList[111],this.undoList[111]=this.undoList[110],this.undoList[110]=this.undoList[109],this.undoList[109]=this.undoList[108],this.undoList[108]=this.undoList[107],this.undoList[107]=this.undoList[106],this.undoList[106]=this.undoList[105],this.undoList[105]=this.undoList[104],this.undoList[104]=this.undoList[103],this.undoList[103]=this.undoList[102],this.undoList[102]=this.undoList[101],this.undoList[101]=this.undoList[100],this.undoList[100]=this.undoList[99],this.undoList[99]=null;const e=new He(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let i=this.builder.doc.querySelector("[data-saveforundo]");if(i){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{i.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onRedo&&this.builder.opts.onRedo(),this.builder.undoRedoInProcess=!1}}
21
21
  /*!
22
22
  Ionicons
23
23
  License: MIT