@themarioga/grid-editor 8.0.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +19 -2
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +9 -0
- package/dist/grideditor.d.ts +18 -1
- package/dist/grideditor.esm.js +147 -32
- package/dist/grideditor.jquery.js +3 -1
- package/dist/grideditor.jquery.min.js +1 -1
- package/dist/grideditor.jquery.min.js.map +2 -2
- package/dist/grideditor.js +147 -32
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +2 -2
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +1 -0
- package/dist/locales/grideditor.es.js +1 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.inline-style.esm.js +9 -0
- package/dist/plugins/grideditor.inline-style.js +9 -0
- package/dist/plugins/grideditor.inline-style.min.js +3 -3
- package/dist/plugins/grideditor.inline-style.min.js.map +3 -3
- package/docs/events.md +7 -0
- package/docs/locale-keys.md +1 -0
- package/package.json +1 -1
- package/src/js/grideditor.jquery.js +2 -0
- package/src/js/grideditor.js +139 -27
- package/src/js/inline-style/fields.js +10 -0
- package/src/js/locales/grideditor.es.js +1 -0
- package/src/js/plugins/grideditor.inline-style.js +1 -0
- package/src/less/grideditor.less +10 -0
- package/types/grideditor.d.ts +18 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* grid-editor 8.
|
|
2
|
+
* grid-editor 8.2.0 bundled with SortableJS.
|
|
3
3
|
*
|
|
4
4
|
* grid-editor: MIT, https://github.com/themarioga/grid-editor
|
|
5
5
|
* SortableJS: MIT, https://github.com/SortableJS/Sortable
|
|
6
6
|
*/
|
|
7
7
|
/*! Sortable 1.15.6 - MIT | git://github.com/SortableJS/Sortable.git */
|
|
8
8
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function e(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function I(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?e(Object(i),!0).forEach(function(t){var e,n;e=o,t=i[n=t],n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}function o(t){return(o="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 a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,o=arguments[e];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function i(t,e){if(null==t)return{};var n,o=function(t,e){if(null==t)return{};for(var n,o={},i=Object.keys(t),r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(t),r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n]);return o}function r(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var y=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),w=t(/Edge/i),s=t(/firefox/i),u=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),c=t(/iP(ad|od|hone)/i),n=t(/chrome/i)&&t(/android/i),d={capture:!1,passive:!1};function h(t,e,n){t.addEventListener(e,n,!y&&d)}function p(t,e,n){t.removeEventListener(e,n,!y&&d)}function f(t,e){if(e&&(">"===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}}function g(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function P(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&f(t,e)||o&&t===n)return t}while(t!==n&&(t=g(t)))}return null}var m,v=/\s+/g;function k(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(v," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(v," ")))}function R(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=!(e in o||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=n+("string"==typeof n?"":"px")}}function b(t,e){var n="";if("string"==typeof t)n=t;else do{var o=R(t,"transform")}while(o&&"none"!==o&&(n=o+" "+n),!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function D(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function O(){var t=document.scrollingElement;return t||document.documentElement}function X(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,l,s,c,u,d=t!==window&&t.parentNode&&t!==O()?(a=(r=t.getBoundingClientRect()).top,l=r.left,s=r.bottom,c=r.right,u=r.height,r.width):(l=a=0,s=window.innerHeight,c=window.innerWidth,u=window.innerHeight,window.innerWidth);if((e||n)&&t!==window&&(i=i||t.parentNode,!y))do{if(i&&i.getBoundingClientRect&&("none"!==R(i,"transform")||n&&"static"!==R(i,"position"))){var h=i.getBoundingClientRect();a-=h.top+parseInt(R(i,"border-top-width")),l-=h.left+parseInt(R(i,"border-left-width")),s=a+r.height,c=l+r.width;break}}while(i=i.parentNode);return o&&t!==window&&(o=(e=b(i||t))&&e.a,t=e&&e.d,e&&(s=(a/=t)+(u/=t),c=(l/=o)+(d/=o))),{top:a,left:l,bottom:s,right:c,width:d,height:u}}}function Y(t,e,n){for(var o=M(t,!0),i=X(t)[e];o;){var r=X(o)[n];if(!("top"===n||"left"===n?r<=i:i<=r))return o;if(o===O())break;o=M(o,!1)}return!1}function B(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if("none"!==a[r].style.display&&a[r]!==jt.ghost&&(o||a[r]!==jt.dragged)&&P(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function F(t,e){for(var n=t.lastElementChild;n&&(n===jt.ghost||"none"===R(n,"display")||e&&!f(n,e));)n=n.previousElementSibling;return n||null}function j(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===jt.clone||e&&!f(t,e)||n++;return n}function E(t){var e=0,n=0,o=O();if(t)do{var i=b(t),r=i.a,i=i.d}while(e+=t.scrollLeft*r,n+=t.scrollTop*i,t!==o&&(t=t.parentNode));return[e,n]}function M(t,e){if(!t||!t.getBoundingClientRect)return O();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=R(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return O();if(o||e)return n;o=!0}}}while(n=n.parentNode);return O()}function S(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 _(e,n){return function(){var t;m||(1===(t=arguments).length?e.call(this,t[0]):e.apply(this,t),m=setTimeout(function(){m=void 0},n))}}function H(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function C(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function T(t,e){R(t,"position","absolute"),R(t,"top",e.top),R(t,"left",e.left),R(t,"width",e.width),R(t,"height",e.height)}function x(t){R(t,"position",""),R(t,"top",""),R(t,"left",""),R(t,"width",""),R(t,"height","")}function L(n,o,i){var r={};return Array.from(n.children).forEach(function(t){var e;P(t,o.draggable,n,!1)&&!t.animated&&t!==i&&(e=X(t),r.left=Math.min(null!==(t=r.left)&&void 0!==t?t:1/0,e.left),r.top=Math.min(null!==(t=r.top)&&void 0!==t?t:1/0,e.top),r.right=Math.max(null!==(t=r.right)&&void 0!==t?t:-1/0,e.right),r.bottom=Math.max(null!==(t=r.bottom)&&void 0!==t?t:-1/0,e.bottom))}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var K="Sortable"+(new Date).getTime();function A(){var e,o=[];return{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){var e,n;"none"!==R(t,"display")&&t!==jt.ghost&&(o.push({target:t,rect:X(t)}),e=I({},o[o.length-1].rect),!t.thisAnimationDuration||(n=b(t,!0))&&(e.top-=n.f,e.left-=n.e),t.fromRect=e)})},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var c=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof t&&t());var u=!1,d=0;o.forEach(function(t){var e=0,n=t.target,o=n.fromRect,i=X(n),r=n.prevFromRect,a=n.prevToRect,l=t.rect,s=b(n,!0);s&&(i.top-=s.f,i.left-=s.e),n.toRect=i,n.thisAnimationDuration&&S(r,i)&&!S(o,i)&&(l.top-i.top)/(l.left-i.left)==(o.top-i.top)/(o.left-i.left)&&(t=l,s=r,r=a,a=c.options,e=Math.sqrt(Math.pow(s.top-t.top,2)+Math.pow(s.left-t.left,2))/Math.sqrt(Math.pow(s.top-r.top,2)+Math.pow(s.left-r.left,2))*a.animation),S(i,o)||(n.prevFromRect=o,n.prevToRect=i,e=e||c.options.animation,c.animate(n,l,i,e)),e&&(u=!0,d=Math.max(d,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},e),n.thisAnimationDuration=e)}),clearTimeout(e),u?e=setTimeout(function(){"function"==typeof t&&t()},d):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){var i,r;o&&(R(t,"transition",""),R(t,"transform",""),i=(r=b(this.el))&&r.a,r=r&&r.d,i=(e.left-n.left)/(i||1),r=(e.top-n.top)/(r||1),t.animatingX=!!i,t.animatingY=!!r,R(t,"transform","translate3d("+i+"px,"+r+"px,0)"),this.forRepaintDummy=t.offsetWidth,R(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),R(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){R(t,"transition",""),R(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},o))}}}var N=[],W={initializeByDefault:!0},z={mount:function(e){for(var t in W)!W.hasOwnProperty(t)||t in e||(e[t]=W[t]);N.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),N.push(e)},pluginEvent:function(e,n,o){var t=this;this.eventCanceled=!1,o.cancel=function(){t.eventCanceled=!0};var i=e+"Global";N.forEach(function(t){n[t.pluginName]&&(n[t.pluginName][i]&&n[t.pluginName][i](I({sortable:n},o)),n.options[t.pluginName]&&n[t.pluginName][e]&&n[t.pluginName][e](I({sortable:n},o)))})},initializePlugins:function(n,o,i,t){for(var e in N.forEach(function(t){var e=t.pluginName;(n.options[e]||t.initializeByDefault)&&((t=new t(n,o,n.options)).sortable=n,t.options=n.options,n[e]=t,a(i,t.defaults))}),n.options){var r;n.options.hasOwnProperty(e)&&(void 0!==(r=this.modifyOption(n,e,n.options[e]))&&(n.options[e]=r))}},getEventProperties:function(e,n){var o={};return N.forEach(function(t){"function"==typeof t.eventProperties&&a(o,t.eventProperties.call(n[t.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return N.forEach(function(t){e[t.pluginName]&&t.optionListeners&&"function"==typeof t.optionListeners[n]&&(i=t.optionListeners[n].call(e[t.pluginName],o))}),i}};function G(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[K]){var g,m=e.options,t="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||y||w?(g=document.createEvent("Event")).initEvent(o,!0,!0):g=new CustomEvent(o,{bubbles:!0,cancelable:!0}),g.to=a||n,g.from=l||n,g.item=i||n,g.clone=r,g.oldIndex=s,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var v,b=I(I({},f),z.getEventProperties(o,e));for(v in b)g[v]=b[v];n&&n.dispatchEvent(g),m[t]&&m[t].call(e,g)}}function U(t,e){var n=(o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).evt,o=i(o,q);z.pluginEvent.bind(jt)(t,e,I({dragEl:Z,parentEl:$,ghostEl:Q,rootEl:J,nextEl:tt,lastDownEl:et,cloneEl:nt,cloneHidden:ot,dragStarted:mt,putSortable:ct,activeSortable:jt.active,originalEvent:n,oldIndex:it,oldDraggableIndex:at,newIndex:rt,newDraggableIndex:lt,hideGhostForTarget:Xt,unhideGhostForTarget:Yt,cloneNowHidden:function(){ot=!0},cloneNowShown:function(){ot=!1},dispatchSortableEvent:function(t){V({sortable:e,name:t,originalEvent:n})}},o))}var q=["evt"];function V(t){G(I({putSortable:ct,cloneEl:nt,targetEl:Z,rootEl:J,oldIndex:it,oldDraggableIndex:at,newIndex:rt,newDraggableIndex:lt},t))}var Z,$,Q,J,tt,et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,pt,ft,gt,mt,vt,bt,yt,wt,Dt=!1,Et=!1,St=[],_t=!1,Ct=!1,Tt=[],xt=!1,Ot=[],Mt="undefined"!=typeof document,At=c,Nt=w||y?"cssFloat":"float",It=Mt&&!n&&!c&&"draggable"in document.createElement("div"),Pt=function(){if(Mt){if(y)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),kt=function(t,e){var n=R(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=B(t,0,e),r=B(t,1,e),a=i&&R(i),l=r&&R(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+X(i).width,t=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+X(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){e="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==e?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||o<=s&&"none"===n[Nt]||r&&"none"===n[Nt]&&o<s+t)?"vertical":"horizontal"},Rt=function(t){function l(r,a){return function(t,e,n,o){var i=t.options.group.name&&e.options.group.name&&t.options.group.name===e.options.group.name;if(null==r&&(a||i))return!0;if(null==r||!1===r)return!1;if(a&&"clone"===r)return r;if("function"==typeof r)return l(r(t,e,n,o),a)(t,e,n,o);e=(a?t:e).options.group.name;return!0===r||"string"==typeof r&&r===e||r.join&&-1<r.indexOf(e)}}var e={},n=t.group;n&&"object"==o(n)||(n={name:n}),e.name=n.name,e.checkPull=l(n.pull,!0),e.checkPut=l(n.put),e.revertClone=n.revertClone,t.group=e},Xt=function(){!Pt&&Q&&R(Q,"display","none")},Yt=function(){!Pt&&Q&&R(Q,"display","")};Mt&&!n&&document.addEventListener("click",function(t){if(Et)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Et=!1},!0);function Bt(t){if(Z){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,St.some(function(t){var e=t[K].options.emptyInsertThreshold;if(e&&!F(t)){var n=X(t),o=i>=n.left-e&&i<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return o&&e?a=t:void 0}}),a);if(e){var n,o={};for(n in t)t.hasOwnProperty(n)&&(o[n]=t[n]);o.target=o.rootEl=e,o.preventDefault=void 0,o.stopPropagation=void 0,e[K]._onDragOver(o)}}var i,r,a}function Ft(t){Z&&Z.parentNode[K]._isOutsideThisEl(t.target)}function jt(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=a({},e),t[K]=this;var n,o,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 kt(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!==jt.supportPointer&&"PointerEvent"in window&&(!u||c),emptyInsertThreshold:5};for(n in z.initializePlugins(this,t,i),i)n in e||(e[n]=i[n]);for(o in Rt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&It,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?h(t,"pointerdown",this._onTapStart):(h(t,"mousedown",this._onTapStart),h(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(t,"dragover",this),h(t,"dragenter",this)),St.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,A())}function Ht(t,e,n,o,i,r,a,l){var s,c,u=t[K],d=u.options.onMove;return!window.CustomEvent||y||w?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||X(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),c=d?d.call(u,s,a):c}function Lt(t){t.draggable=!1}function Kt(){xt=!1}function Wt(t){return setTimeout(t,0)}function zt(t){return clearTimeout(t)}jt.prototype={constructor:jt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(vt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter;if(!function(t){Ot.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Ot.push(o)}}(o),!Z&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=P(l,t.draggable,o,!1))&&l.animated||et===l)){if(it=j(l),at=j(l,t.draggable),"function"==typeof c){if(c.call(this,e,l,this))return V({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),U("filter",n,{evt:e}),void(i&&e.preventDefault())}else if(c=c&&c.split(",").some(function(t){if(t=P(s,t.trim(),o,!1))return V({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),U("filter",n,{evt:e}),!0}))return void(i&&e.preventDefault());t.handle&&!P(s,t.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;n&&!Z&&n.parentNode===r&&(o=X(n),J=r,$=(Z=n).parentNode,tt=Z.nextSibling,et=n,st=a.group,ut={target:jt.dragged=Z,clientX:(e||t).clientX,clientY:(e||t).clientY},ft=ut.clientX-o.left,gt=ut.clientY-o.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Z.style["will-change"]="all",o=function(){U("delayEnded",i,{evt:t}),jt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(Z.draggable=!0),i._triggerDragStart(t,e),V({sortable:i,name:"choose",originalEvent:t}),k(Z,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){D(Z,t.trim(),Lt)}),h(l,"dragover",Bt),h(l,"mousemove",Bt),h(l,"touchmove",Bt),a.supportPointer?(h(l,"pointerup",i._onDrop),this.nativeDraggable||h(l,"pointercancel",i._onDrop)):(h(l,"mouseup",i._onDrop),h(l,"touchend",i._onDrop),h(l,"touchcancel",i._onDrop)),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),U("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(w||y)?o():jt.eventCanceled?this._onDrop():(a.supportPointer?(h(l,"pointerup",i._disableDelayedDrag),h(l,"pointercancel",i._disableDelayedDrag)):(h(l,"mouseup",i._disableDelayedDrag),h(l,"touchend",i._disableDelayedDrag),h(l,"touchcancel",i._disableDelayedDrag)),h(l,"mousemove",i._delayedDragTouchMoveHandler),h(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&h(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Lt(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._disableDelayedDrag),p(t,"touchend",this._disableDelayedDrag),p(t,"touchcancel",this._disableDelayedDrag),p(t,"pointerup",this._disableDelayedDrag),p(t,"pointercancel",this._disableDelayedDrag),p(t,"mousemove",this._delayedDragTouchMoveHandler),p(t,"touchmove",this._delayedDragTouchMoveHandler),p(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?h(document,"pointermove",this._onTouchMove):h(document,e?"touchmove":"mousemove",this._onTouchMove):(h(Z,"dragend",this),h(J,"dragstart",this._onDragStart));try{document.selection?Wt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;Dt=!1,J&&Z?(U("dragStarted",this,{evt:e}),this.nativeDraggable&&h(document,"dragover",Ft),n=this.options,t||k(Z,n.dragClass,!1),k(Z,n.ghostClass,!0),jt.active=this,t&&this._appendGhost(),V({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(dt){this._lastX=dt.clientX,this._lastY=dt.clientY,Xt();for(var t=document.elementFromPoint(dt.clientX,dt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(dt.clientX,dt.clientY))!==e;)e=t;if(Z.parentNode[K]._isOutsideThisEl(t),e)do{if(e[K])if(e[K]._onDragOver({clientX:dt.clientX,clientY:dt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=g(t=e));Yt()}},_onTouchMove:function(t){if(ut){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Q&&b(Q,!0),a=Q&&r&&r.a,l=Q&&r&&r.d,e=At&&wt&&E(wt),a=(i.clientX-ut.clientX+o.x)/(a||1)+(e?e[0]-Tt[0]:0)/(a||1),l=(i.clientY-ut.clientY+o.y)/(l||1)+(e?e[1]-Tt[1]:0)/(l||1);if(!jt.active&&!Dt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}Q&&(r?(r.e+=a-(ht||0),r.f+=l-(pt||0)):r={a:1,b:0,c:0,d:1,e:a,f:l},r="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")"),R(Q,"webkitTransform",r),R(Q,"mozTransform",r),R(Q,"msTransform",r),R(Q,"transform",r),ht=a,pt=l,dt=i),t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Q){var t=this.options.fallbackOnBody?document.body:J,e=X(Z,!0,At,!0,t),n=this.options;if(At){for(wt=t;"static"===R(wt,"position")&&"none"===R(wt,"transform")&&wt!==document;)wt=wt.parentNode;wt!==document.body&&wt!==document.documentElement?(wt===document&&(wt=O()),e.top+=wt.scrollTop,e.left+=wt.scrollLeft):wt=O(),Tt=E(wt)}k(Q=Z.cloneNode(!0),n.ghostClass,!1),k(Q,n.fallbackClass,!0),k(Q,n.dragClass,!0),R(Q,"transition",""),R(Q,"transform",""),R(Q,"box-sizing","border-box"),R(Q,"margin",0),R(Q,"top",e.top),R(Q,"left",e.left),R(Q,"width",e.width),R(Q,"height",e.height),R(Q,"opacity","0.8"),R(Q,"position",At?"absolute":"fixed"),R(Q,"zIndex","100000"),R(Q,"pointerEvents","none"),jt.ghost=Q,t.appendChild(Q),R(Q,"transform-origin",ft/parseInt(Q.style.width)*100+"% "+gt/parseInt(Q.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;U("dragStart",this,{evt:t}),jt.eventCanceled?this._onDrop():(U("setupClone",this),jt.eventCanceled||((nt=C(Z)).removeAttribute("id"),nt.draggable=!1,nt.style["will-change"]="",this._hideClone(),k(nt,this.options.chosenClass,!1),jt.clone=nt),n.cloneId=Wt(function(){U("clone",n),jt.eventCanceled||(n.options.removeCloneOnHide||J.insertBefore(nt,Z),n._hideClone(),V({sortable:n,name:"clone"}))}),e||k(Z,i.dragClass,!0),e?(Et=!0,n._loopId=setInterval(n._emulateDragOver,50)):(p(document,"mouseup",n._onDrop),p(document,"touchend",n._onDrop),p(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,Z)),h(document,"drop",n),R(Z,"transform","translateZ(0)")),Dt=!0,n._dragStartId=Wt(n._dragStarted.bind(n,e,t)),h(document,"selectstart",n),mt=!0,window.getSelection().removeAllRanges(),u&&R(document.body,"user-select","none"))},_onDragOver:function(n){var o,i,r,t,e,a=this.el,l=n.target,s=this.options,c=s.group,u=jt.active,d=st===c,h=s.sort,p=ct||u,f=this,g=!1;if(!xt){if(void 0!==n.preventDefault&&n.cancelable&&n.preventDefault(),l=P(l,s.draggable,a,!0),O("dragOver"),jt.eventCanceled)return g;if(Z.contains(n.target)||l.animated&&l.animatingX&&l.animatingY||f._ignoreWhileAnimating===l)return A(!1);if(Et=!1,u&&!s.disabled&&(d?h||(i=$!==J):ct===this||(this.lastPutMode=st.checkPull(this,u,Z,n))&&c.checkPut(this,u,Z,n))){if(r="vertical"===this._getDirection(n,l),o=X(Z),O("dragOverValid"),jt.eventCanceled)return g;if(i)return $=J,M(),this._hideClone(),O("revert"),jt.eventCanceled||(tt?J.insertBefore(Z,tt):J.appendChild(Z)),A(!0);var m=F(a,s.draggable);if(m&&(S=n,c=r,x=X(F((E=this).el,E.options.draggable)),E=L(E.el,E.options,Q),!(c?S.clientX>E.right+10||S.clientY>x.bottom&&S.clientX>x.left:S.clientY>E.bottom+10||S.clientX>x.right&&S.clientY>x.top)||m.animated)){if(m&&(t=n,e=r,C=X(B((_=this).el,0,_.options,!0)),_=L(_.el,_.options,Q),e?t.clientX<_.left-10||t.clientY<C.top&&t.clientX<C.right:t.clientY<_.top-10||t.clientY<C.bottom&&t.clientX<C.left)){var v=B(a,0,s,!0);if(v===Z)return A(!1);if(D=X(l=v),!1!==Ht(J,a,Z,o,l,D,n,!1))return M(),a.insertBefore(Z,v),$=a,N(),A(!0)}else if(l.parentNode===a){var b,y,w,D=X(l),E=Z.parentNode!==a,S=(S=Z.animated&&Z.toRect||o,x=l.animated&&l.toRect||D,_=(e=r)?S.left:S.top,t=e?S.right:S.bottom,C=e?S.width:S.height,v=e?x.left:x.top,S=e?x.right:x.bottom,x=e?x.width:x.height,!(_===v||t===S||_+C/2===v+x/2)),_=r?"top":"left",C=Y(l,"top","top")||Y(Z,"top","top"),v=C?C.scrollTop:void 0;if(vt!==l&&(y=D[_],_t=!1,Ct=!S&&s.invertSwap||E),0!==(b=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,t=o?n.top:n.left,o=o?n.bottom:n.right,n=!1;if(!a)if(l&&yt<c*i){if(_t=!_t&&(1===bt?t+c*r/2<s:s<o-c*r/2)?!0:_t)n=!0;else if(1===bt?s<t+yt:o-yt<s)return-bt}else if(t+c*(1-i)/2<s&&s<o-c*(1-i)/2)return function(t){return j(Z)<j(t)?1:-1}(e);if((n=n||a)&&(s<t+c*r/2||o-c*r/2<s))return t+c/2<s?1:-1;return 0}(n,l,D,r,S?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Ct,vt===l)))for(var T=j(Z);(w=$.children[T-=b])&&("none"===R(w,"display")||w===Q););if(0===b||w===l)return A(!1);bt=b;var x=(vt=l).nextElementSibling,E=!1,S=Ht(J,a,Z,o,l,D,n,E=1===b);if(!1!==S)return 1!==S&&-1!==S||(E=1===S),xt=!0,setTimeout(Kt,30),M(),E&&!x?a.appendChild(Z):l.parentNode.insertBefore(Z,E?x:l),C&&H(C,0,v-C.scrollTop),$=Z.parentNode,void 0===y||Ct||(yt=Math.abs(y-X(l)[_])),N(),A(!0)}}else{if(m===Z)return A(!1);if((l=m&&a===n.target?m:l)&&(D=X(l)),!1!==Ht(J,a,Z,o,l,D,n,!!l))return M(),m&&m.nextSibling?a.insertBefore(Z,m.nextSibling):a.appendChild(Z),$=a,N(),A(!0)}if(a.contains(Z))return A(!1)}return!1}function O(t,e){U(t,f,I({evt:n,isOwner:d,axis:r?"vertical":"horizontal",revert:i,dragRect:o,targetRect:D,canSort:h,fromSortable:p,target:l,completed:A,onMove:function(t,e){return Ht(J,a,Z,o,t,X(t),n,e)},changed:N},e))}function M(){O("dragOverAnimationCapture"),f.captureAnimationState(),f!==p&&p.captureAnimationState()}function A(t){return O("dragOverCompleted",{insertion:t}),t&&(d?u._hideClone():u._showClone(f),f!==p&&(k(Z,(ct||u).options.ghostClass,!1),k(Z,s.ghostClass,!0)),ct!==f&&f!==jt.active?ct=f:f===jt.active&&ct&&(ct=null),p===f&&(f._ignoreWhileAnimating=l),f.animateAll(function(){O("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(l===Z&&!Z.animated||l===a&&!l.animated)&&(vt=null),s.dragoverBubble||n.rootEl||l===document||(Z.parentNode[K]._isOutsideThisEl(n.target),t||Bt(n)),!s.dragoverBubble&&n.stopPropagation&&n.stopPropagation(),g=!0}function N(){rt=j(Z),lt=j(Z,s.draggable),V({sortable:f,name:"change",toEl:a,newIndex:rt,newDraggableIndex:lt,originalEvent:n})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){p(document,"mousemove",this._onTouchMove),p(document,"touchmove",this._onTouchMove),p(document,"pointermove",this._onTouchMove),p(document,"dragover",Bt),p(document,"mousemove",Bt),p(document,"touchmove",Bt)},_offUpEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._onDrop),p(t,"touchend",this._onDrop),p(t,"pointerup",this._onDrop),p(t,"pointercancel",this._onDrop),p(t,"touchcancel",this._onDrop),p(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;rt=j(Z),lt=j(Z,n.draggable),U("drop",this,{evt:t}),$=Z&&Z.parentNode,rt=j(Z),lt=j(Z,n.draggable),jt.eventCanceled||(_t=Ct=Dt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),zt(this.cloneId),zt(this._dragStartId),this.nativeDraggable&&(p(document,"drop",this),p(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),u&&R(document.body,"user-select",""),R(Z,"transform",""),t&&(mt&&(t.cancelable&&t.preventDefault(),n.dropBubble||t.stopPropagation()),Q&&Q.parentNode&&Q.parentNode.removeChild(Q),(J===$||ct&&"clone"!==ct.lastPutMode)&&nt&&nt.parentNode&&nt.parentNode.removeChild(nt),Z&&(this.nativeDraggable&&p(Z,"dragend",this),Lt(Z),Z.style["will-change"]="",mt&&!Dt&&k(Z,(ct||this).options.ghostClass,!1),k(Z,this.options.chosenClass,!1),V({sortable:this,name:"unchoose",toEl:$,newIndex:null,newDraggableIndex:null,originalEvent:t}),J!==$?(0<=rt&&(V({rootEl:$,name:"add",toEl:$,fromEl:J,originalEvent:t}),V({sortable:this,name:"remove",toEl:$,originalEvent:t}),V({rootEl:$,name:"sort",toEl:$,fromEl:J,originalEvent:t}),V({sortable:this,name:"sort",toEl:$,originalEvent:t})),ct&&ct.save()):rt!==it&&0<=rt&&(V({sortable:this,name:"update",toEl:$,originalEvent:t}),V({sortable:this,name:"sort",toEl:$,originalEvent:t})),jt.active&&(null!=rt&&-1!==rt||(rt=it,lt=at),V({sortable:this,name:"end",toEl:$,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){U("nulling",this),J=Z=$=Q=tt=nt=et=ot=ut=dt=mt=rt=lt=it=at=vt=bt=ct=st=jt.dragged=jt.ghost=jt.clone=jt.active=null,Ot.forEach(function(t){t.checked=!0}),Ot.length=ht=pt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Z&&(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=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)P(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||function(t){var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;for(;n--;)o+=e.charCodeAt(n);return o.toString(36)}(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach(function(t,e){e=o.children[e];P(e,this.options.draggable,o,!1)&&(n[t]=e)},this),e&&this.captureAnimationState(),t.forEach(function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return P(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=z.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Rt(n)},destroy:function(){U("destroy",this);var t=this.el;t[K]=null,p(t,"mousedown",this._onTapStart),p(t,"touchstart",this._onTapStart),p(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(p(t,"dragover",this),p(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),St.splice(St.indexOf(this.el),1),this.el=t=null},_hideClone:function(){ot||(U("hideClone",this),jt.eventCanceled||(R(nt,"display","none"),this.options.removeCloneOnHide&&nt.parentNode&&nt.parentNode.removeChild(nt),ot=!0))},_showClone:function(t){"clone"===t.lastPutMode?ot&&(U("showClone",this),jt.eventCanceled||(Z.parentNode!=J||this.options.group.revertClone?tt?J.insertBefore(nt,tt):J.appendChild(nt):J.insertBefore(nt,Z),this.options.group.revertClone&&this.animate(Z,nt),R(nt,"display",""),ot=!1)):this._hideClone()}},Mt&&h(document,"touchmove",function(t){(jt.active||Dt)&&t.cancelable&&t.preventDefault()}),jt.utils={on:h,off:p,css:R,find:D,is:function(t,e){return!!P(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:_,closest:P,toggleClass:k,clone:C,index:j,nextTick:Wt,cancelNextTick:zt,detectDirection:kt,getChild:B,expando:K},jt.get=function(t){return t[K]},jt.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(e=e[0].constructor===Array?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&&(jt.utils=I(I({},jt.utils),t.utils)),z.mount(t)})},jt.create=function(t,e){return new jt(t,e)};var Gt,Ut,qt,Vt,Zt,$t,Qt=[],Jt=!(jt.version="1.15.6");function te(){Qt.forEach(function(t){clearInterval(t.pid)}),Qt=[]}function ee(){clearInterval($t)}var ne,oe=_(function(n,t,e,o){if(t.scroll){var i,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,c=O(),u=!1;Ut!==e&&(Ut=e,te(),Gt=t.scroll,i=t.scrollFn,!0===Gt&&(Gt=M(e,!0)));var d=0,h=Gt;do{var p=h,f=X(p),g=f.top,m=f.bottom,v=f.left,b=f.right,y=f.width,w=f.height,D=void 0,E=void 0,S=p.scrollWidth,_=p.scrollHeight,C=R(p),T=p.scrollLeft,f=p.scrollTop,E=p===c?(D=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX||"visible"===C.overflowX),w<_&&("auto"===C.overflowY||"scroll"===C.overflowY||"visible"===C.overflowY)):(D=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX),w<_&&("auto"===C.overflowY||"scroll"===C.overflowY)),T=D&&(Math.abs(b-r)<=l&&T+y<S)-(Math.abs(v-r)<=l&&!!T),f=E&&(Math.abs(m-a)<=l&&f+w<_)-(Math.abs(g-a)<=l&&!!f);if(!Qt[d])for(var x=0;x<=d;x++)Qt[x]||(Qt[x]={});Qt[d].vx==T&&Qt[d].vy==f&&Qt[d].el===p||(Qt[d].el=p,Qt[d].vx=T,Qt[d].vy=f,clearInterval(Qt[d].pid),0==T&&0==f||(u=!0,Qt[d].pid=setInterval(function(){o&&0===this.layer&&jt.active._onTouchMove(Zt);var t=Qt[this.layer].vy?Qt[this.layer].vy*s:0,e=Qt[this.layer].vx?Qt[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(jt.dragged.parentNode[K],e,t,n,Zt,Qt[this.layer].el)||H(Qt[this.layer].el,e,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==c&&(h=M(h,!1)));Jt=u}},30),n=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,t=t.unhideGhostForTarget;e&&(i=n||i,a(),e=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,e=document.elementFromPoint(e.clientX,e.clientY),t(),i&&!i.el.contains(e)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n})))};function ie(){}function re(){}ie.prototype={startIndex:null,dragStart:function(t){t=t.oldDraggableIndex;this.startIndex=t},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();t=B(this.sortable.el,this.startIndex,this.options);t?this.sortable.el.insertBefore(e,t):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:n},a(ie,{pluginName:"revertOnSpill"}),re.prototype={onSpill:function(t){var e=t.dragEl,t=t.putSortable||this.sortable;t.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),t.animateAll()},drop:n},a(re,{pluginName:"removeOnSpill"});var ae,le,se,ce,ue,de=[],he=[],pe=!1,fe=!1,ge=!1;function me(n,o){he.forEach(function(t,e){e=o.children[t.sortableIndex+(n?Number(e):0)];e?o.insertBefore(t,e):o.appendChild(t)})}function ve(){de.forEach(function(t){t!==se&&t.parentNode&&t.parentNode.removeChild(t)})}return jt.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){t=t.originalEvent;this.sortable.nativeDraggable?h(document,"dragover",this._handleAutoScroll):this.options.supportPointer?h(document,"pointermove",this._handleFallbackAutoScroll):t.touches?h(document,"touchmove",this._handleFallbackAutoScroll):h(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){t=t.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?p(document,"dragover",this._handleAutoScroll):(p(document,"pointermove",this._handleFallbackAutoScroll),p(document,"touchmove",this._handleFallbackAutoScroll),p(document,"mousemove",this._handleFallbackAutoScroll)),ee(),te(),clearTimeout(m),m=void 0},nulling:function(){Zt=Ut=Gt=Jt=$t=qt=Vt=null,Qt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(e,n){var o,i=this,r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,t=document.elementFromPoint(r,a);Zt=e,n||this.options.forceAutoScrollFallback||w||y||u?(oe(e,this.options,t,n),o=M(t,!0),!Jt||$t&&r===qt&&a===Vt||($t&&ee(),$t=setInterval(function(){var t=M(document.elementFromPoint(r,a),!0);t!==o&&(o=t,te()),oe(e,i.options,t,n)},10),qt=r,Vt=a)):this.options.bubbleScroll&&M(t,!0)!==O()?oe(e,this.options,M(t,!1),!1):te()}},a(t,{pluginName:"scroll",initializeByDefault:!0})}),jt.mount(re,ie),jt.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){t=t.dragEl;ne=t},dragOverValid:function(t){var e=t.completed,n=t.target,o=t.onMove,i=t.activeSortable,r=t.changed,a=t.cancel;i.options.swap&&(t=this.sortable.el,i=this.options,n&&n!==t&&(t=ne,ne=!1!==o(n)?(k(n,i.swapClass,!0),n):null,t&&t!==ne&&k(t,i.swapClass,!1)),r(),e(!0),a())},drop:function(t){var e,n,o=t.activeSortable,i=t.putSortable,r=t.dragEl,a=i||this.sortable,l=this.options;ne&&k(ne,l.swapClass,!1),ne&&(l.swap||i&&i.options.swap)&&r!==ne&&(a.captureAnimationState(),a!==o&&o.captureAnimationState(),n=ne,t=(e=r).parentNode,l=n.parentNode,t&&l&&!t.isEqualNode(n)&&!l.isEqualNode(e)&&(i=j(e),r=j(n),t.isEqualNode(l)&&i<r&&r++,t.insertBefore(n,t.children[i]),l.insertBefore(e,l.children[r])),a.animateAll(),a!==o&&o.animateAll())},nulling:function(){ne=null}},a(t,{pluginName:"swap",eventProperties:function(){return{swapItem:ne}}})}),jt.mount(new function(){function t(o){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));o.options.avoidImplicitDeselect||(o.options.supportPointer?h(document,"pointerup",this._deselectMultiDrag):(h(document,"mouseup",this._deselectMultiDrag),h(document,"touchend",this._deselectMultiDrag))),h(document,"keydown",this._checkKeyDown),h(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(t,e){var n="";de.length&&le===o?de.forEach(function(t,e){n+=(e?", ":"")+t.textContent}):n=e.textContent,t.setData("Text",n)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){t=t.dragEl;se=t},delayEnded:function(){this.isMultiDrag=~de.indexOf(se)},setupClone:function(t){var e=t.sortable,t=t.cancel;if(this.isMultiDrag){for(var n=0;n<de.length;n++)he.push(C(de[n])),he[n].sortableIndex=de[n].sortableIndex,he[n].draggable=!1,he[n].style["will-change"]="",k(he[n],this.options.selectedClass,!1),de[n]===se&&k(he[n],this.options.chosenClass,!1);e._hideClone(),t()}},clone:function(t){var e=t.sortable,n=t.rootEl,o=t.dispatchSortableEvent,t=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||de.length&&le===e&&(me(!0,n),o("clone"),t()))},showClone:function(t){var e=t.cloneNowShown,n=t.rootEl,t=t.cancel;this.isMultiDrag&&(me(!1,n),he.forEach(function(t){R(t,"display","")}),e(),ue=!1,t())},hideClone:function(t){var e=this,n=(t.sortable,t.cloneNowHidden),t=t.cancel;this.isMultiDrag&&(he.forEach(function(t){R(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)}),n(),ue=!0,t())},dragStartGlobal:function(t){t.sortable;!this.isMultiDrag&&le&&le.multiDrag._deselectMultiDrag(),de.forEach(function(t){t.sortableIndex=j(t)}),de=de.sort(function(t,e){return t.sortableIndex-e.sortableIndex}),ge=!0},dragStarted:function(t){var e,n=this,t=t.sortable;this.isMultiDrag&&(this.options.sort&&(t.captureAnimationState(),this.options.animation&&(de.forEach(function(t){t!==se&&R(t,"position","absolute")}),e=X(se,!1,!0,!0),de.forEach(function(t){t!==se&&T(t,e)}),pe=fe=!0)),t.animateAll(function(){pe=fe=!1,n.options.animation&&de.forEach(function(t){x(t)}),n.options.sort&&ve()}))},dragOver:function(t){var e=t.target,n=t.completed,t=t.cancel;fe&&~de.indexOf(e)&&(n(!1),t())},revert:function(t){var n,o,e=t.fromSortable,i=t.rootEl,r=t.sortable,a=t.dragRect;1<de.length&&(de.forEach(function(t){r.addAnimationState({target:t,rect:fe?X(t):a}),x(t),t.fromRect=a,e.removeAnimationState(t)}),fe=!1,n=!this.options.removeCloneOnHide,o=i,de.forEach(function(t,e){e=o.children[t.sortableIndex+(n?Number(e):0)];e?o.insertBefore(t,e):o.appendChild(t)}))},dragOverCompleted:function(t){var e,n=t.sortable,o=t.isOwner,i=t.insertion,r=t.activeSortable,a=t.parentEl,l=t.putSortable,t=this.options;i&&(o&&r._hideClone(),pe=!1,t.animation&&1<de.length&&(fe||!o&&!r.options.sort&&!l)&&(e=X(se,!1,!0,!0),de.forEach(function(t){t!==se&&(T(t,e),a.appendChild(t))}),fe=!0),o||(fe||ve(),1<de.length?(o=ue,r._showClone(n),r.options.animation&&!ue&&o&&he.forEach(function(t){r.addAnimationState({target:t,rect:ce}),t.fromRect=ce,t.thisAnimationDuration=null})):r._showClone(n)))},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,t=t.activeSortable;de.forEach(function(t){t.thisAnimationDuration=null}),t.options.animation&&!n&&t.multiDrag.isMultiDrag&&(ce=a({},e),e=b(se,!0),ce.top-=e.f,ce.left-=e.e)},dragOverAnimationComplete:function(){fe&&(fe=!1,ve())},drop:function(t){var o,i,r,a,n,e,l,s=t.originalEvent,c=t.rootEl,u=t.parentEl,d=t.sortable,h=t.dispatchSortableEvent,p=t.oldIndex,t=t.putSortable,f=t||this.sortable;s&&(o=this.options,i=u.children,ge||(o.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),k(se,o.selectedClass,!~de.indexOf(se)),~de.indexOf(se)?(de.splice(de.indexOf(se),1),ae=null,G({sortable:d,rootEl:c,name:"deselect",targetEl:se,originalEvent:s})):(de.push(se),G({sortable:d,rootEl:c,name:"select",targetEl:se,originalEvent:s}),s.shiftKey&&ae&&d.el.contains(ae)?(r=j(ae),a=j(se),~r&&~a&&r!==a&&function(){for(var e,t=r<a?(e=r,a):(e=a,r+1),n=o.filter;e<t;e++)~de.indexOf(i[e])||P(i[e],o.draggable,u,!1)&&(n&&("function"==typeof n?n.call(d,s,i[e],d):n.split(",").some(function(t){return P(i[e],t.trim(),u,!1)}))||(k(i[e],o.selectedClass,!0),de.push(i[e]),G({sortable:d,rootEl:c,name:"select",targetEl:i[e],originalEvent:s})))}()):ae=se,le=f)),ge&&this.isMultiDrag&&(fe=!1,(u[K].options.sort||u!==c)&&1<de.length&&(n=X(se),e=j(se,":not(."+this.options.selectedClass+")"),!pe&&o.animation&&(se.thisAnimationDuration=null),f.captureAnimationState(),pe||(o.animation&&(se.fromRect=n,de.forEach(function(t){var e;t.thisAnimationDuration=null,t!==se&&(e=fe?X(t):n,t.fromRect=e,f.addAnimationState({target:t,rect:e}))})),ve(),de.forEach(function(t){i[e]?u.insertBefore(t,i[e]):u.appendChild(t),e++}),p===j(se)&&(l=!1,de.forEach(function(t){t.sortableIndex!==j(t)&&(l=!0)}),l&&(h("update"),h("sort")))),de.forEach(function(t){x(t)}),f.animateAll()),le=f),(c===u||t&&"clone"!==t.lastPutMode)&&he.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)}))},nullingGlobal:function(){this.isMultiDrag=ge=!1,he.length=0},destroyGlobal:function(){this._deselectMultiDrag(),p(document,"pointerup",this._deselectMultiDrag),p(document,"mouseup",this._deselectMultiDrag),p(document,"touchend",this._deselectMultiDrag),p(document,"keydown",this._checkKeyDown),p(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==ge&&ge||le!==this.sortable||t&&P(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;de.length;){var e=de[0];k(e,this.options.selectedClass,!1),de.shift(),G({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},a(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[K];e&&e.options.multiDrag&&!~de.indexOf(t)&&(le&&le!==e&&(le.multiDrag._deselectMultiDrag(),le=e),k(t,e.options.selectedClass,!0),de.push(t))},deselect:function(t){var e=t.parentNode[K],n=de.indexOf(t);e&&e.options.multiDrag&&~n&&(k(t,e.options.selectedClass,!1),de.splice(n,1))}},eventProperties:function(){var n=this,o=[],i=[];return de.forEach(function(t){var e;o.push({multiDragElement:t,index:t.sortableIndex}),e=fe&&t!==se?-1:fe?j(t,":not(."+n.options.selectedClass+")"):j(t),i.push({multiDragElement:t,index:e})}),{items:r(de),clones:[].concat(he),oldIndicies:o,newIndicies:i}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),jt});
|
|
9
|
-
(()=>{function k(i,s){return i?Array.prototype.slice.call(i.querySelectorAll(s)):[]}function O(i,s){return i?i.querySelector(s):null}function Ee(i,s){if(!i)return[];var p=k(i,s);return i.nodeType===1&&i.matches(s)&&p.unshift(i),p}function J(i,s){return i?Array.prototype.filter.call(i.children,function(p){return!s||p.matches(s)}):[]}function T(i,s){return J(i,s)[0]||null}function Z(i,s,p){var l=i&&i.nodeType===1?i.closest(s):null;return l&&p&&l!==p&&!p.contains(l)?null:l}function De(i,s){return!!i&&i.nodeType===1&&i.matches(s)}function xe(i){return!!i&&document.documentElement.contains(i)}function zr(i,s){for(var p=[],l=i.nextElementSibling;l;l=l.nextElementSibling)(!s||l.matches(s))&&p.push(l);return p}function jr(i,s){for(var p=[],l=i.parentElement;l&&l!==s;l=l.parentElement)p.push(l);return p}function zi(i){var s=document.createElement("template");return s.innerHTML=i,Array.prototype.slice.call(s.content.childNodes)}function B(i){for(var s=zi(i.trim()),p=0;p<s.length;p++)if(s[p].nodeType===1)return s[p];return null}function v(i,s,p){var l=document.createElement(i);return Object.keys(s||{}).forEach(function(d){var E=s[d];E!=null&&E!==!1&&l.setAttribute(d,E)}),p!=null&&(l.textContent=p),l}function bt(i,s){return i.innerHTML=s==null?"":String(s),i}function x(i,s){return Re(s).forEach(function(p){i.classList.add(p)}),i}function L(i,s){return Re(s).forEach(function(p){i.classList.remove(p)}),i}function I(i,s,p){return Re(s).forEach(function(l){p===void 0?i.classList.toggle(l):i.classList.toggle(l,!!p)}),i}function y(i,s){return!!i&&i.nodeType===1&&i.classList.contains(s)}function Re(i){return String(i||"").split(/\s+/).filter(Boolean)}function wt(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function et(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function yt(i,s){return Object.keys(s).forEach(function(p){var l=s[p];l==null?i.removeAttribute(p):i.setAttribute(p,l)}),i}function ve(i,s){return Object.keys(s).forEach(function(p){var l=s[p];typeof l=="number"&&!ji[p]&&(l=l+"px"),i.style.setProperty(p,l==null?"":String(l))}),i}var ji={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},Ze={};function Ii(i){var s=i.nodeName;if(!Ze[s]){var p=document.body.appendChild(document.createElement(s));Ze[s]=getComputedStyle(p).display,p.remove(),Ze[s]==="none"&&(Ze[s]="block")}return Ze[s]}function _e(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=Ii(i)),i}function le(i){return i.style.display="none",i}function mn(i,s){return s===void 0&&(s=!Ct(i)),s?_e(i):le(i)}function Ct(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function tt(i){return i.getBoundingClientRect().width}function Et(i){return i.getBoundingClientRect().height}function Ir(i){var s=getComputedStyle(i);return i.clientHeight-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)}function xt(i){var s=i.getBoundingClientRect();return{top:s.top+window.pageYOffset,left:s.left+window.pageXOffset}}function _t(i,s){return s.parentNode.insertBefore(i,s.nextSibling),i}function kt(i){for(var s=i.parentNode;i.firstChild;)s.insertBefore(i.firstChild,i);i.remove()}function Dr(i,s){return i.parentNode.insertBefore(s,i),s.appendChild(i),s}function Ne(i,s,p,l,d){var E=function(b){var j=Z(b.target,p,i);if(j&&i.contains(j))return l.call(j,b)};return Re(s).forEach(function(b){i.addEventListener(b,E,d)}),E}function ee(i,s,p,l){return Re(s).forEach(function(d){i.addEventListener(d,p,l)}),p}function pn(i,s,p,l){Re(s).forEach(function(d){i.removeEventListener(d,p,l)})}var Di=400;function Rr(i,s,p,l){p=p===void 0?Di:p;var d=function(){le(i),l&&l()};if(!Ct(i)||!i.animate||p<=0){window.setTimeout(d,0);return}var E=i.animate(s(getComputedStyle(i)),{duration:p,easing:"ease-in-out"}),b=!1,j=function(){b||(b=!0,d())};E.onfinish=j,E.oncancel=j}function nt(i,s,p){typeof s=="function"&&(p=s,s=void 0),i.style.overflow="hidden",Rr(i,function(l){return[{height:l.height,paddingTop:l.paddingTop,paddingBottom:l.paddingBottom,marginTop:l.marginTop,marginBottom:l.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},s,function(){i.style.removeProperty("overflow"),p&&p()})}function Nr(i,s,p,l){i.style.overflow="hidden",Rr(i,function(d){var E={opacity:d.opacity,height:d.height},b={opacity:0,height:"0px"};return l&&(E.width=d.width,b.width="0px"),[E,b]},s,function(){i.style.removeProperty("overflow"),p&&p()})}var Ur={getHtml:{value:!0},getPlainHtml:{value:!0},init:{},deinit:{},reset:{},destroy:{},changeView:{},getView:{value:!0},createRow:{value:!0},createColumn:{value:!0},createElement:{value:!0},createText:{value:!0},createSection:{value:!0},createContainer:{value:!0},addTab:{value:!0},addAccordionItem:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0}},Ni=["appendTo","prependTo","insertAfter","insertBefore"],h=[{key:"xs",infix:"",colPrefix:"col-",offsetPrefix:"offset-",min:0,preview:400,labelKey:"view.xs"},{key:"sm",infix:"sm",colPrefix:"col-sm-",offsetPrefix:"offset-sm-",min:576,preview:576,labelKey:"view.sm"},{key:"md",infix:"md",colPrefix:"col-md-",offsetPrefix:"offset-md-",min:768,preview:768,labelKey:"view.md"},{key:"lg",infix:"lg",colPrefix:"col-lg-",offsetPrefix:"offset-lg-",min:992,preview:992,labelKey:"view.lg"},{key:"xl",infix:"xl",colPrefix:"col-xl-",offsetPrefix:"offset-xl-",min:1200,preview:1200,labelKey:"view.xl"},{key:"xxl",infix:"xxl",colPrefix:"col-xxl-",offsetPrefix:"offset-xxl-",min:1400,preview:null,labelKey:"view.xxl"}],V="all",Ui="view.all",gn=[V].concat(h.map(function(i){return i.key})),z=12,Fr=11,vn=["equal","auto"],Ue=["1","2","3","4","5","6","auto"];function hn(i,s){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+s}function H(i){return typeof i=="number"}function ke(i,s){return s==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+s}function q(i){for(var s=0;s<h.length;s++)if(h[s].key===i)return h[s];return null}function Hr(i){if(i===V)return[h[0]];var s=q(i);return s?[s]:[]}function rt(i){var s=q(i);return s?s.labelKey:Ui}var Fe={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1},resize:{enabled:!0,handles:"e",balance:"next"},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},Kr={},Fi=0,At=new WeakMap;function wn(i,s,p){var l=C.locales,d=l[i.locale]||{},E=i.locale_strings||{},b=E[s];return b===void 0&&(b=d[s]),b===void 0&&(b=l.en[s]),b===void 0&&(Hi("locale:"+s,'no string for "'+s+'" in any locale, showing the key'),b=s),b.replace(/\{(\w+)\}/g,function(j,be){return p&&p[be]!==void 0?p[be]:j})}function N(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Hi(i,s){Kr[i]||(Kr[i]=!0,N(s))}function Ki(i,s){return wn({locale:"en"},i,s)}function Wi(i){if(typeof i=="string"){var s=document.querySelector(i);if(!s)throw new TypeError("grid-editor: no element matches "+JSON.stringify(i));return s}if(i&&i.nodeType===1)return i;throw new TypeError("grid-editor: the target is an element or a selector, not "+(i===null?"null":typeof i))}function he(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function Wr(){return C.Sortable||window.Sortable||null}function ot(){var i=C.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function bn(i){var s=document.implementation.createHTMLDocument("").body;s.innerHTML=i;var p=[];return k(s,"*").forEach(function(l){var d=!1;Array.prototype.slice.call(l.attributes).forEach(function(j){j.name.indexOf("data-ge-")===0&&(l.removeAttribute(j.name),d=!0)});var E=(l.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=E.filter(function(j){return j!=="column"&&j.indexOf("ge-")!==0});b.length!==E.length&&(d=!0),b.length?l.setAttribute("class",b.join(" ")):l.removeAttribute("class"),d&&l.tagName==="DIV"&&!l.attributes.length&&p.push(l)}),p.forEach(function(l){kt(l)}),s.innerHTML}function C(i,s){var p=Wi(i),l=At.get(p);if(l)return Br.has(p)||(Br.add(p),N(Ki("warning.already_editing"))),l;if(!(this instanceof C))return new C(p,s);Bi(this,p,s||{})}var Br=new WeakSet;C.create=function(i,s){return new C(i,s)};C.get=function(i){var s=he(i);return s&&At.get(s)||null};function Bi(i,s,p){var l=Object.assign({new_row_layouts:[[12],[6,6],[4,4,4],[3,3,3,3],[2,2,2,2,2,2],[2,8,2],[4,8],[8,4]],row_classes:[],col_classes:[],col_tools:[],row_tools:[],drag_handle:"tool",toolbar_drag:"auto",element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Fe.elements,custom_filter:"",valid_col_sizes:[1,2,3,4,5,6,7,8,9,10,11,12,"equal","auto"],valid_col_offsets:[0,1,2,3,4,5,6,7,8,9,10,11],add_column:Fe.add_column,layout_modes:gn.slice(),default_view:V,resize:Fe.resize,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:Fe.drag},p);Object.keys(Fe).forEach(function(e){l[e]=Object.assign({},Fe[e],l[e])});var d,E,b,j,be,Ae,G,S=l.default_view,R=null,Y=null,Se=!1,Te=null,yn={},St=[],Vr=++Fi,Cn=!1,En=new WeakMap,Tt=new WeakMap,it=new WeakMap,xn=new WeakMap,Ot=new WeakSet,_n=new AbortController;d=x(s,"ge-canvas");function te(e,t){yn[e]||(yn[e]=!0,N(t))}function m(e,t){return wn(l,e,t)}function qr(e){l.locale=e,i.settings=un(),kn(),dr(),mr(),E.remove(),Ln(),Un()}var He=0,Lt=[];function $(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:d,breakpoint:fn(),source:"api"},n||{})}function M(e,t){var n=[e],r=e.replace(/^(before|after)-add-.+$/,"$1-add");r!==e&&n.push(r);var o=!1;return n.forEach(function(a){var u=new CustomEvent("grideditor:"+a,{detail:t,bubbles:!0,cancelable:!0});d.dispatchEvent(u)||(o=!0)}),n.forEach(function(a){var u=l.callbacks[a.replace(/-/g,"_")];typeof u=="function"&&u(t)===!1&&(o=!0)}),!o}function K(e){He++;try{return e()}finally{if(He--,He===0)for(;Lt.length;)Lt.shift()()}}function Mt(e){if(He===0){e();return}Lt.push(e)}function Q(e,t,n,r){var o=Gr(e);return K(function(){var a=$(e,t,r);return M("before-add-"+o,a)?(n(),ue(),M("after-add-"+o,a),t):null})}function Gr(e){return C.containers[e]?"container":e}function Xr(e,t){if(!l.confirm_delete){t();return}var n=ot();if(!n){window.confirm(e)&&t();return}var r=Jr(),o=!1;O(r,".ge-confirm-message").textContent=e,O(r,".ge-confirm-ok").onclick=function(){o=!0,n.getInstance(r).hide()},se.hidden=function(){o&&t()},se.shown=function(){O(r,".ge-confirm-ok").focus()},n.getOrCreateInstance(r).show()}var se={hidden:null,shown:null};function Jr(){return R||(R=B('<div class="modal fade ge-confirm" tabindex="-1" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h5 class="modal-title"></h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body"><p class="ge-confirm-message"></p></div><div class="modal-footer"><button type="button" class="btn btn-secondary ge-confirm-cancel" data-bs-dismiss="modal"></button><button type="button" class="btn btn-danger ge-confirm-ok"></button></div></div></div></div>'),document.body.appendChild(R),O(R,".modal-title").textContent=m("confirm.title"),O(R,".btn-close").setAttribute("aria-label",m("confirm.cancel")),O(R,".ge-confirm-cancel").textContent=m("confirm.cancel"),O(R,".ge-confirm-ok").textContent=m("confirm.ok"),An(R),R.addEventListener("hidden.bs.modal",function(){se.hidden&&se.hidden()}),R.addEventListener("shown.bs.modal",function(){se.shown&&se.shown()}),R)}function kn(){R&&(se.hidden=null,se.shown=null,Pt(R),R=null)}function Pt(e){var t=ot(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!zt.get(e)&&!y(e,"show")){o();return}e.addEventListener("hidden.bs.modal",o,{once:!0}),e.addEventListener("shown.bs.modal",function(){n.hide()},{once:!0}),n.hide()}var zt=new WeakMap;function An(e){ee(e,"show.bs.modal hide.bs.modal",function(){zt.set(e,!0)}),ee(e,"shown.bs.modal hidden.bs.modal",function(){zt.set(e,!1)})}function we(e,t,n,r){K(function(){var o=$(e,t,{source:"tool"});M("before-delete",o)&&Xr(n,function(){K(function(){r(function(){t.remove(),K(function(){ue(),M("after-delete",o)})})})})})}function jt(e,t,n){if(n=n||S,n!==V){var r=q(n),o=gt({size:t,offset:mt(e,r)||0});return o.refused||ze(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=h.some(function(g){return gt({size:t,offset:mt(e,g)||0}).refused});if(a)return null;var u=h[0],c=[],f=[];return h.slice(1).forEach(function(g){var w=ze(e,g);w!==null&&(c.push({tier:g,size:null}),f.push({breakpoint:g.key,value:w}))}),ze(e,u)!==t&&c.unshift({tier:u,size:t}),c.length?{writes:c,cleared:f,size:t}:null}function It(e,t){t.writes.forEach(function(n){pt(e,n.tier,n.size)}),Qe(e)}function Dt(e,t){return t&&(e.cleared=t),e}function Rt(e,t,n,r){r=r||S;var o=qe(e),a=jt(e,t,r);return a?K(function(){var u=$("column",e,Dt({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return M("before-resize",u)?(It(e,a),oe(e),M("after-resize",u),!0):(oe(e),!1)}):!1}function Sn(e,t,n){var r=S===V,o=r?h[0]:q(S),a=Xe(e);t=Math.min(Math.max(t,0),Fr);var u=r?h.slice(1).filter(function(c){return ft(e,c)!==null}):[];return(ft(e,o)||0)===t&&!u.length?!1:K(function(){var c=$("column",e,Dt({source:n,from:a,to:t},r?u.map(function(f){return{breakpoint:f.key,value:ft(e,f)}}):null));return M("before-indent",c)?(nn(e,o,t),u.forEach(function(f){nn(e,f,0)}),(r?h:[o]).forEach(function(f){var g=tn(e,f);if(H(g)){var w=gt({size:g,offset:t,leading:"offset"});w.size!==g&&pt(e,f,w.size)}}),oe(e),M("after-indent",c),!0):!1})}function Nt(e){var t=e.parentElement;return{parent:t,index:J(t).filter(function(n){return!y(n,"ge-tools-drawer")}).indexOf(e)}}function ne(e){var t=null;return Object.keys(A).forEach(function(n){var r=A[n];!t&&r.kindOf&&(t=r.kindOf(e))}),t||(e.getAttribute("data-ge-container")?e.getAttribute("data-ge-container"):y(e,"ge-tab")?"tab":y(e,"ge-accordion-item")?"accordion-item":y(e,"row")?"row":y(e,"column")?"column":y(e,"ge-element")?"element":(y(e,"ge-text-block")&&(e=T(e,".ge-content")||e),y(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(l.source_textarea){var Ke=he(l.source_textarea).value,Tn=v("div");Tn.innerHTML=Ke,Ke.length>0&&!Tn.querySelector(".row")&&(Ke='<div class="row"><div class="col-lg-12">'+Ke+"</div></div>"),bt(s,Ke)}if(s.children.length&&!s.querySelector("div.row")){var Yr=J(s),On=B('<div class="row"><div class="col-lg-12"></div></div>');s.appendChild(On),Yr.forEach(function(e){On.firstChild.appendChild(e)})}function $r(){G=v("textarea",{class:"ge-html-output"}),d.parentNode.insertBefore(G,d),Ln();var e={signal:_n.signal};window.addEventListener("scroll",uo,e),Ne(d,"click",".ge-content",co,e),Ne(d,"click",".ge-popup-trigger, [data-ge-popup-target]",function(t){y(d,"ge-editing")&&t.preventDefault()},e)}function Qr(e){!De(e,".ge-content")||!d.contains(e)||(re("onContentReady",e),Be(e))}function Ln(){E=v("div",{class:"ge-mainControls"}),G.parentNode.insertBefore(E,G),b=E.appendChild(v("div",{class:"ge-wrapper ge-top"})),j=b.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),be=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),l.new_row_layouts.forEach(function(u){var c=!Array.isArray(u),f=v("a",{class:"btn btn-sm btn-primary",title:c?m("row.add_row_cols",{columns:u.columns,counts:lo(u.row_cols)}):m("row.add",{layout:u.join("-")}),"data-ge-toolbar":"row","data-ge-layout":c?JSON.stringify(u):u.join(",")});f.addEventListener("click",function(){var _=We(u),Ce=Q("row",_,function(){d.appendChild(_)},{parent:d,source:"tool"});Ce&&_.scrollIntoView&&_.scrollIntoView({behavior:"smooth"})}),j.appendChild(f),f.appendChild(B('<i class="bi bi-plus"></i>'));var g=c?so(u):u,w='<div class="row ge-row-icon">';g.forEach(function(_){w+='<div class="column '+ke(h[0],_)+'"></div>'}),w+="</div>",f.appendChild(B(w))}),b.appendChild(be),Object.keys(D).forEach(function(u){var c=D[u],f=Mn(v("a",{class:"btn btn-sm btn-primary ge-add-container"}),m(c.labelKey),c.iconClass);yt(f,{"data-ge-toolbar":"container","data-ge-container-type":u}),f.addEventListener("click",function(){var g=je(),w=g.appendChild(ge(z)),_=w.appendChild(c.create({}));Q(u,_,function(){d.appendChild(g)},{parent:d,source:"tool"})}),be.appendChild(f)});var e=[];Object.keys(A).forEach(function(u){(A[u].toolbar||[]).forEach(function(c,f){var g=Zr(u,c,f);c.align==="end"?e.push(g):be.appendChild(g)})}),Ae=B('<div class="dropdown pull-right ge-layout-mode"><button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown"></button><div class="dropdown-menu" role="menu"></div></div>'),Ne(Ae,"click","a",function(){Lr(this.getAttribute("data-ge-view"))}),b.appendChild(Ae),l.layout_modes.forEach(function(u){O(Ae,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":u,title:m(rt(u))},m(rt(u))))}),O(Ae,"button").textContent=m(rt(S));var t=b.appendChild(v("div",{class:"btn-group pull-right"}));if(l.edit_source){var n=B('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');n.setAttribute("title",m("tool.edit_source")),I(n,"active btn-danger",Se),n.addEventListener("click",function(){Se?Fn():po(),I(n,"active btn-danger",Se)}),t.appendChild(n)}var r=B('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),o=function(){y(r,"active")||x(d,"ge-editing")};if(r.setAttribute("title",m("tool.preview")),r.addEventListener("mouseenter",function(){L(d,"ge-editing")}),r.addEventListener("click",function(){I(r,"active btn-danger"),o()}),r.addEventListener("mouseleave",o),t.appendChild(r),e.length){var a=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));e.forEach(function(u){a.appendChild(u)})}to()}function Mn(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(B('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function Zr(e,t,n){var r=t.iconClass||(t.align==="end"?"bi bi-plus":null),o=typeof t.label=="function"?t.label():t.label||m(t.labelKey),a=Mn(v("a",{class:"btn btn-sm btn-primary ge-add-container ge-add-feature"}),o,r);return x(a,t.className||""),yt(a,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),a.addEventListener("click",function(){var u=t.create(),c=t.inColumn?Ut(u):u,f=Q(t.kind,u,function(){d.appendChild(c)},{parent:d,source:t.source||"tool"});f&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}),a}function eo(){return l.toolbar_drag==="auto"?l.drag_handle==="drawer":!!l.toolbar_drag}function to(){var e=k(E,"[data-ge-toolbar]");e.forEach(function(t){L(t,"ge-palette-button"),t.removeEventListener("pointerdown",Pn)}),eo()&&e.forEach(function(t){x(t,"ge-palette-button"),t.addEventListener("pointerdown",Pn)})}function Pn(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(f){return Math.abs(f.pageX-n)+Math.abs(f.pageY-r)>l.drag.threshold}function u(f){if(!o){if(!a(f))return;o=x(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),x(d,"ge-dropping")}ve(o,{left:f.pageX-14,top:f.pageY-14}),ro(f.pageX,f.pageY)}function c(f){if(document.removeEventListener("pointermove",u),pn(document,"pointerup pointercancel",c),!!o){o.remove(),L(d,"ge-dropping"),Ft();var g=function(_){_.target!==t&&!t.contains(_.target)||(_.preventDefault(),_.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var w=zn(f.pageX,f.pageY);w&&oo(t,w)}}document.addEventListener("pointermove",u),ee(document,"pointerup pointercancel",c)}function zn(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=Z(o,[".column",".ge-canvas"].concat(an("regions")).join(", "));if(!a||a!==d&&!d.contains(a))return null;var u=null;return J(a,on()).forEach(function(c){if(!u){var f=c.getBoundingClientRect();r<f.top+f.height/2&&(u=c)}}),{region:a,before:u}}function no(e,t){var n=A[e.getAttribute("data-ge-feature")].toolbar[parseInt(e.getAttribute("data-ge-item"),10)],r=n.create(),o=r;if(n.inColumn)De(t.region,".column")||(o=Ut(r));else if(!ln(t.region,r)){var a=t.region===d?[]:jr(t.region,d).reverse().concat([t.region]),u=a[0]||null;t={region:d,before:u?u.nextElementSibling:null}}return Q(n.kind,r,function(){t.before?t.before.parentNode.insertBefore(o,t.before):t.region.appendChild(o)},{parent:t.region,source:n.source||"dragdrop"})}function Ut(e){var t=je();return t.appendChild(ge(z)).appendChild(e),t}function ro(e,t){var n=zn(e,t);if(!n)return Ft();Te||(Te=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Te,n.before):n.region.appendChild(Te)}function Ft(){Te&&Te.remove()}function oo(e,t){if(e.getAttribute("data-ge-toolbar")==="feature")return no(e,t);var n=e.getAttribute("data-ge-toolbar")==="container",r=e.getAttribute("data-ge-container-type"),o=n?D[r].create({}):ao(e.getAttribute("data-ge-layout")),a=o;return n&&!De(t.region,".column")&&(a=Ut(o)),Q(n?r:"row",o,function(){t.before?t.before.parentNode.insertBefore(a,t.before):t.region.appendChild(a)},{parent:t.region,source:"dragdrop"})}function io(){for(var e=[],t=1;t<=z;t++)e.push(String(t));return{name:"col",values:e.concat(vn),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return ke(q(n),Ht(r))},choices:function(){return l.valid_col_sizes.map(String)},label:function(n){return n==="equal"?m("utility.col_equal"):n==="auto"?m("utility.col_auto"):n},write:function(n,r,o,a){return Rt(n,r===null?null:Ht(r),a,o)},blank:function(n,r){var o=r===V?null:ct(n,q(r));return o?m("utility.col_from_row",{count:hr(o.value)}):null}}}function Ht(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function ao(e){return/^\s*\{/.test(e||"")?We(JSON.parse(e)):We((e||"").split(",").filter(function(t){return t!==""}).map(Ht))}function We(e){var t=je();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(ge(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=q(r);a&&Ue.indexOf(String(o))!==-1&&x(t,hn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(ge(null));return t}function lo(e){return h.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function so(e){var t=1;return Object.keys(e.row_cols||{}).forEach(function(n){var r=e.row_cols[n];r!=="auto"&&(t=Math.max(t,parseInt(r,10)||1))}),Array.apply(null,Array(Math.min(t,e.columns||t))).map(function(){return"equal"})}function uo(){var e=window.pageYOffset;e>xt(E).top&&e<xt(d).top+Ir(d)?y(b,"ge-top")&&(ve(b,{left:xt(b).left,width:tt(b)}),L(b,"ge-top"),x(b,"ge-fixed")):y(b,"ge-fixed")&&(ve(b,{left:"",width:""}),L(b,"ge-fixed"),x(b,"ge-top"))}function co(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!ie()&&Ct(e)){var t=Nn();t.length&&(t.length===1?jn(e,t[0]):fo(e,t))}}function jn(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):K(function(){var n=$("plain",e,{source:"tool",from:"plain",to:t.type});if(!M("before-convert",n))return!1;x(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return y(r,"ge-text-block")&&(L(r,"ge-plain-block"),J(r,".ge-tools-drawer").forEach(function(o){o.remove()})),M("after-convert",n),t.edit(e),!0})}function fo(e,t){var n=y(e.parentElement,"ge-text-block")?e.parentElement:null;n&&In(T(n,".ge-tools-drawer"),t.map(function(r){return{label:r.label,title:m("tool.convert_type",{editor:r.label}),attributes:{"data-ge-content-type":r.type},choose:function(){jn(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function In(e,t,n,r){if(ie(),!!e){var o=Z(e,".ge-tools-drawer");o&&x(o,"ge-picker-open"),Y=e.appendChild(x(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var u=yt(v("a",{class:"ge-size ge-size-flex"}),a.attributes||{});u.setAttribute("title",a.title||a.label),u.textContent=a.label,u.addEventListener("click",function(c){c.preventDefault(),c.stopPropagation(),ie(),a.choose()}),Y.appendChild(u)}),Dn(r||e)}}function Dn(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){Y&&!Y.matches(":hover")&&ie()},400)},{once:!0})}function Rn(){var e={},t=[];return Object.keys(A).forEach(function(n){var r=A[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&te("text-type:"+o.type,'the "'+n+'" plugin declares the text type "'+o.type+'", which the "'+e[o.type]+'" plugin already declares: ignored');return}e[o.type]=n,t.push(o)})}),t}function Nn(){return Rn().filter(function(e){return e.offered!==!1})}function mo(e){return Rn().some(function(t){return t.type===e})}function Un(){Oe(),ue()}function po(){Oe(),G.style.height=.8*document.documentElement.clientHeight+"px",G.value=d.innerHTML,_e(G),le(d),Se=!0,re("onSourceOpen",G)}function Fn(){re("onSourceClose",G),Se=!1,bt(d,G.value),_e(d),ue(),le(G)}function ue(){F&&!xe(F.node)&&me(),pe&&pe.home&&!xe(pe.home)&&ae(),Sr(!0),x(d,"ge-editing"),I(d,"ge-drag-drawer",l.drag_handle==="drawer"),ti();var e=_i();ki(e),Si(e),Ti(),Wo(),Bo(),zo(),re("onInit"),si(),fi(),Or(S),Be(d)}function Oe(){me(),L(d,"ge-editing ge-drag-drawer ge-dropping"),re("onBeforeDeinit"),ie(),Ft(),ae(),k(d,".ge-tools-drawer").forEach(function(e){e.remove()}),lt.clear(),Oi(),re("onDeinit"),Gt(d),k(d,"[data-ge-row-cols]").forEach(function(e){e.removeAttribute("data-ge-row-cols")}),jo(),yi(),gi(),Sr(!1)}function Hn(){Oe(),Qe(d);var e=d.innerHTML;return ue(),e}function go(e){Oe(),Qe(e);var t=e.outerHTML;return ue(),t}function vo(){return bn(Hn())}function ho(){Se&&Fn(),Oe(),kn(),dr(),mr(),E.remove(),G.remove(),_n.abort(),At.delete(d),Cn=!0}function bo(){var e=wo();Wt("grid",{},io()),l.row_cols!==!1&&Wt("grid",{},ii());var t=function(r){return!l.plugins||l.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(C.containers).forEach(function(r){t(r)&&(D[r]=C.containers[r](e))}),Object.keys(C.features).forEach(function(r){var o=C.features[r];n(r,o)&&(A[r]=o(e))}),Object.keys(C.utilities).forEach(function(r){t(r)&&(W[r]=C.utilities[r](e),(W[r].families||[]).forEach(function(o){Wt(r,W[r],o)}))}),Object.keys(A).forEach(function(r){var o=A[r].methods||{};Object.keys(o).forEach(function(a){Ve[a]=o[a]})}),(l.plugins||[]).forEach(function(r){D[r]||A[r]||W[r]||te("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function re(e,t){[D,A,W].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function wo(){return{canvas:d,settings:l,t:m,warn:N,containerId:Mo,defaultRegion:Po,createTool:P,createMoveTool:ye,addSettingsTool:Ye,deleteNode:we,place:ht,createPaneControls:Do,makeLabelEditable:Ro,labelIn:No,unwrapLabels:Uo,suspendToggles:er,resumeToggles:tr,emit:M,payloadFor:$,operate:K,kindOf:ne,view:fn,viewTiers:function(){return Hr(S).map(function(e){return e.key})},breakpoints:h.map(function(e){return e.key}),getUtility:Xn,setUtility:qt,utilityField:Lo,bareStyle:xo,hostStyle:Jn,setHostStyle:To,openDialog:fr,closeDialog:ae,rowFromLayout:We,nodeHtml:go,textReady:Qr,attachPicker:rr,openPicker:In,closePicker:ie,detailsOf:sr,drawerOf:yo,toolbarItems:function(e){return E?k(E,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function yo(e){if(y(e,"ge-content")){var t=e.parentElement;return y(t,"ge-text-block")?T(t,".ge-tools-drawer"):null}return T(e,".ge-tools-drawer")}var de={},Co=".row, .column, .ge-content, .ge-element, [data-ge-container]",Le="data-ge-preview",Kt=!1;function Wt(e,t,n){var r=n.name||n.prefix;if(de[r]){N('the "'+e+'" plugin declares the utility "'+r+'", which the "'+de[r].plugin+'" plugin already declared: ignored');return}de[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function at(e,t){return de[e]?de[e].family:(te("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function Kn(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!D[t]&&e.appliesTo.indexOf("container")!==-1}function Wn(e){return Object.keys(de).map(function(t){return de[t].family}).filter(function(t){return Kn(t,e)})}function Bt(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function ce(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(Bt(t,n,t.values[o]))!==-1)return t.values[o];return null}function Bn(e,t,n){for(var r=h.indexOf(n)-1;r>=0;r--){var o=ce(e,t,h[r]);if(o!==null)return{tier:h[r],value:o}}return null}function Vn(e,t,n){var r=ce(e,t,n);if(r!==null)return r;var o=Bn(e,t,n);return o?o.value:null}function Vt(e,t){return h.map(function(n){return{tier:n,value:ce(e,t,n)}}).filter(function(n){return n.value!==null})}function qn(e,t,n,r){t.values.forEach(function(o){L(e,Bt(t,n,o))}),r!==null&&x(e,Bt(t,n,r)),wt(e)}function Gn(e,t,n){return n===V?ce(e,t,h[0]):Vn(e,t,q(n))}function Eo(e,t,n,r){if(n!==V){var o=q(n);return ce(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],u=[];return Vt(e,t).forEach(function(c){c.tier!==h[0]&&(a.push({tier:c.tier,value:null}),u.push({breakpoint:c.tier.key,value:c.value}))}),ce(e,t,h[0])!==r&&a.unshift({tier:h[0],value:r}),a.length?{writes:a,cleared:u}:null}function Xn(e,t,n){e=he(e);var r=at(t,"getUtility");if(!r||!e)return null;var o=n===void 0?S:cn(n);return o===null?(N("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):Gn(e,r,o)}function qt(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=he(e);var o=at(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?S:cn(r.view);if(a===null)return N("setUtility("+JSON.stringify(r.view)+"): no such layout mode"),!1;if(n=n==null||n===""?null:String(n),n!==null&&o.values.indexOf(n)===-1)return N("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var u=ne(e);if(!Kn(o,u))return N('setUtility: "'+t+'" does not apply to a '+u),!1;if(o.write)return o.write(e,n,a,r.source||"api");var c=Eo(e,o,a,n);return c?K(function(){var f=$(u,e,{family:t,breakpoint:a,tiers:c.writes.map(function(g){return g.tier.key}),from:Gn(e,o,a),to:n,cleared:c.cleared,source:r.source||"api"});return M("before-utility",f)?(c.writes.forEach(function(g){qn(e,o,g.tier,g.value)}),oe(e),M("after-utility",f),!0):(oe(e),!1)}):!1}function xo(e,t,n){var r=at(t,"bareStyle");if(e=he(e),!r||!e)return null;var o=e.getAttribute("class");h.forEach(function(u){qn(e,r,u,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function oe(e){var t=sr(e);if(t){var n=O(t,".ge-classes");n&&(n.value=$t(e).join(" ")),J(t,".ge-utilities").forEach(function(r){Xt(r)})}$n(e),Be(e)}function _o(e){return Ee(e,Co)}function Be(e){Gt(e),S!==V&&ko(e,q(S)),oi(e),re("onRefresh",e)}function ko(e,t){_o(e).forEach(function(n){var r=ne(n),o={};Wn(r).forEach(function(a){!a.preview||!Vt(n,a).length||Object.assign(o,a.preview(Vn(n,a,t),n,r))}),r==="column"&&Object.assign(o,ri(n,t)),Object.keys(W).forEach(function(a){var u=W[a];u.preview&&Object.assign(o,u.preview(n,r,t.key))}),Object.keys(o).length&&Ao(n,o)})}function Ao(e,t){var n=e.style,r={};Object.keys(t).forEach(function(o){r[o]=[n.getPropertyValue(o),n.getPropertyPriority(o)],n.setProperty(o,String(t[o]),"important")}),e.setAttribute(Le,JSON.stringify(r))}function Gt(e){Ee(e,"["+Le+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Le))||{}}catch(o){}Object.keys(r).forEach(function(o){var a=r[o];a&&a[0]?n.setProperty(o,a[0],a[1]):n.removeProperty(o)}),t.removeAttribute(Le),et(t)})}function So(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(Le))||{}}catch(r){}return Object.keys(n).forEach(function(r){var o=n[r];o&&o[0]?t.style.setProperty(r,o[0],o[1]):t.style.removeProperty(r)}),t.style}function Jn(e,t){var n=So(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function To(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=Jn(e,t).priority),n!==""){var o=document.createElement("div").style;if(o.setProperty(t,n,r||""),o.getPropertyValue(t)==="")return!1}var a=e.hasAttribute(Le);return a&&Gt(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),et(e),a&&Be(e),!0}function Oo(e){var t=ne(e),n=Wn(t).filter(function(u){return u.panel!==!1}).map(function(u){return Yn(e,u)});if(Object.keys(W).forEach(function(u){var c=W[u],f=c.panel?c.panel(e,t):null;f&&n.push(f)}),!n.length)return null;var r=I(v("div",{class:"ge-utilities"}),"ge-open",Kt);xn.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){Kt=!y(r,"ge-open"),ur().forEach(function(u){k(u,".ge-utilities").forEach(function(c){I(c,"ge-open",Kt)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(u){a.appendChild(u)}),Xt(r),r}function Yn(e,t){var n=v("label",{class:"ge-utility","data-ge-family":t.name});n.appendChild(v("span",{class:"ge-utility-label"},t.labelKey?m(t.labelKey):t.name));var r=n.appendChild(v("select",{class:"form-select form-select-sm"}));return r.addEventListener("change",function(){qt(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function Lo(e,t){var n=at(t,"utilityField");if(!n)return null;var r=Yn(e,n);return Jt(r,e),lt.set(r,e),r}var lt=new Map;function $n(e){lt.forEach(function(t,n){if(!n.isConnected){lt.delete(n);return}e&&t!==e||Z(n,".ge-utilities")||Jt(n,t)})}function Xt(e){var t=xn.get(e);J(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(rt(S))})}),k(e,".ge-utility").forEach(function(n){Jt(n,t)})}function Jt(e,t){var n=de[e.getAttribute("data-ge-family")].family,r=T(e,"select"),o=n.choices?n.choices(t,ne(t)):n.values,a,u,c="";if(r.innerHTML="",S===V){a=ce(t,n,h[0]),u=m("utility.default");var f=Vt(t,n).filter(function(Ie){return Ie.tier!==h[0]});f.length&&(c=m("utility.varies",{breakpoints:f.map(function(Ie){return Ie.tier.key}).join(", ")}))}else{var g=q(S),w=Bn(t,n,g);a=ce(t,n,g),u=w?m("utility.inherit",{value:Qn(n,w.value),breakpoint:w.tier.key}):m("utility.default");var _=n.blank?n.blank(t,S):null;_&&a===null&&(u=_)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},u)),o.forEach(function(Ie){r.appendChild(v("option",{value:Ie},Qn(n,Ie)))}),r.value=a===null?"":a;var Ce=T(e,".ge-utility-note");Ce.textContent=c,mn(Ce,c!=="")}function Qn(e,t){return e.label?e.label(t):t}var D={},A={},W={},Ve={},Zn=0;function Mo(e){return Zn++,"ge-"+e+"-"+Zn+"-"+Math.random().toString(36).slice(2,6)}function Po(){var e=je();return e.appendChild(ge(z)),e}function Me(e){return e?e.getAttribute("data-ge-container"):null}function zo(){k(d,"[data-ge-container]").forEach(function(e){var t=Me(e),n=D[t];if(!n){te("container:"+t,'unknown container type "'+t+'"');return}x(e,"ge-container ge-container-"+t),n.mark(e),T(e,".ge-tools-drawer")||Io(e,t,n)})}function jo(){k(d,"[data-ge-container]").forEach(function(e){var t=D[Me(e)];t&&t.unmark(e),L(e,"ge-container ge-container-"+Me(e)),wt(e)})}function Pe(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function st(e,t){(t||[]).forEach(function(n){P(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function Io(e,t,n){var r=Pe(e,"ge-tools-drawer ge-container-drawer");ye(r),Ye(r,e,l.container_classes),st(r,l.container_tools),n.tools&&n.tools(r,e),P(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){we(t,e,m("confirm.delete_container"),function(o){nt(e,o)})}),n.addPane&&P(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});Q(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function Do(e,t,n,r,o){var a=Pe(e,"ge-tools-drawer ge-pane-drawer");return ye(a),Ye(a,e,l.pane_classes),st(a,n),P(a,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){we(t,e,r,function(u){o(u)})}),a}function er(e){e&&Ee(e,"[data-bs-toggle], [data-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-bs-"+n);r!==null&&(t.setAttribute("data-ge-bs-"+n,r),t.removeAttribute("data-bs-"+n))})})}function tr(e){e&&Ee(e,"[data-ge-bs-toggle], [data-ge-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-ge-bs-"+n);r!==null&&(t.setAttribute("data-bs-"+n,r),t.removeAttribute("data-ge-bs-"+n))})})}function Ro(e){if(!Ot.has(e)){var t=Z(e,"[data-bs-toggle], [data-ge-bs-toggle]");Ot.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),er(t),e.setAttribute("contenteditable","true"),e.focus(),window.getSelection().selectAllChildren(e)}),e.addEventListener("keydown",function(n){e.getAttribute("contenteditable")==="true"&&n.key==="Enter"&&(n.preventDefault(),e.blur())}),e.addEventListener("blur",function(){e.removeAttribute("contenteditable"),tr(t)})}}function No(e){var t=T(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function Uo(e){k(e,".ge-pane-label").forEach(function(t){Ot.delete(t),kt(t)})}function nr(e,t){var n=ge(t);return Q("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Fo(e,t){!l.add_column.picker||!e||rr(e,function(){Ho(e,t)})}function rr(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};ee(e,"mouseenter mousedown",function(){n||Y||(n=window.setTimeout(function(){n=null,t()},l.add_column.delay))}),ee(e,"mouseleave mouseup",r)}function Ho(e,t){ie();var n=rn(t,fe()),r=Z(e,".ge-tools-drawer");r&&x(r,"ge-picker-open"),Y=e.appendChild(v("div",{class:"ge-size-picker"})),l.valid_col_sizes.forEach(function(o){var a=v("a",{class:"ge-size","data-ge-size":o,title:Ko(o)},H(o)?o:ke(h[0],o));I(a,"ge-size-tight",H(o)&&o>n),I(a,"ge-size-flex",!H(o)),a.addEventListener("click",function(u){u.preventDefault(),u.stopPropagation(),ie(),nr(t,o)}),Y.appendChild(a)}),Dn(e)}function Ko(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function ie(){if(!Y)return!1;var e=Z(Y,".ge-tools-drawer");return e&&L(e,"ge-picker-open"),Y.remove(),Y=null,!0}function Wo(){k(d,".row").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=Pe(e,"ge-tools-drawer");ye(t),Ye(t,e,l.row_classes),st(t,l.row_tools),P(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){we("row",e,m("confirm.delete_row"),function(n){nt(e,n)})}),P(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){ie()||nr(e,$e(e,fe())?null:l.add_column.size)}),Fo(T(t,".ge-add-column"),e)}})}function Bo(){k(d,".column").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=Pe(e,"ge-tools-drawer");ye(t),P(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){Rt(e,n.shiftKey?Je(l.valid_col_sizes):ut(l.valid_col_sizes.filter(H),Ge(e),-1),"tool")}),P(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){Rt(e,n.shiftKey?Vo(e):ut(l.valid_col_sizes.filter(H),Ge(e),1),"tool")}),P(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){Sn(e,n.shiftKey?Je(l.valid_col_offsets):ut(l.valid_col_offsets,Xe(e),-1),"tool")}),P(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){Sn(e,n.shiftKey?qo(e):ut(l.valid_col_offsets,Xe(e),1),"tool")}),Ye(t,e,l.col_classes),st(t,l.col_tools),P(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){we("column",e,m("confirm.delete_column"),function(n){Nr(e,400,n,!0)})}),P(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=je();Q("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function fe(){return S===V?h[h.length-1]:q(S)}function qe(e){var t=fe();if(ct(e,t))return null;var n=tn(e,t);return n===null?z:n}function Ge(e){var t=qe(e);if(H(t))return t;var n=Math.round(tt(e)/or(e.parentElement)*z);return Math.min(Math.max(n,1),z)}function or(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function Xe(e){return mt(e,fe())||0}function ut(e,t,n){var r=e.indexOf(t);return r===-1?e.reduce(function(o,a){return Math.abs(a-t)<Math.abs(o-t)?a:o},e[0]):e[Math.min(Math.max(r+n,0),e.length-1)]}function Je(e){return e.filter(H).reduce(function(t,n){return Math.min(t,n)},z)}function Yt(e){return e.filter(H).reduce(function(t,n){return Math.max(t,n)},0)}function Vo(e){var t=rn(e.parentElement,fe(),e)-Xe(e);return Math.min(Yt(l.valid_col_sizes),Math.max(t,1))}function qo(e){var t=rn(e.parentElement,fe(),e)-Ge(e);return Math.min(Yt(l.valid_col_offsets),Math.max(t,0))}function ye(e){return l.drag_handle==="drawer"?null:P(e,m("tool.move"),"ge-move","bi bi-arrows-move")}function P(e,t,n,r,o){var a=v("a",{title:t,class:n});return a.appendChild(v("i",{class:r})),e.appendChild(a),typeof o=="function"&&a.addEventListener("click",o),o&&typeof o=="object"&&Object.keys(o).forEach(function(u){ee(a,u,o[u])}),a}function $t(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!Go(t)})}function Go(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:h.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Xo(e,t){$t(e).forEach(function(n){L(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&x(e,n)}),wt(e)}function Ye(e,t,n){var r=Jo(t,n||[]);En.set(t,r),P(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){$o(t,r,this)});var o=ne(t);return Object.keys(W).forEach(function(a){W[a].drawerTools&&W[a].drawerTools(e,t,o)}),Object.keys(A).forEach(function(a){A[a].drawerTools&&A[a].drawerTools(e,t,o)}),e.appendChild(r)}function Jo(e,t){var n=v("div",{class:"ge-details"});n.appendChild(ir(m("panel.section_general")));var r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(g){var w=v("label",{class:"ge-field"});return w.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(w)},a=v("input",{class:"ge-id form-control form-control-sm",placeholder:m("tool.id_placeholder"),title:m("tool.id_title")});a.value=e.getAttribute("id")||"",o(m("panel.id")).appendChild(a),a.addEventListener("change",function(){this.value===""?e.removeAttribute("id"):e.setAttribute("id",this.value)});var u=v("input",{class:"ge-classes form-control form-control-sm",placeholder:m("tool.classes_placeholder"),title:m("tool.classes_title")});u.value=$t(e).join(" "),o(m("panel.classes")).appendChild(u),u.addEventListener("change",function(){Xo(e,this.value),oe(e)});var c=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var w=y(e,g.cssClass),_=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:g.title?g.title:m("tool.toggle_class",{label:g.label}),"aria-pressed":w?"true":"false"});_.innerHTML=g.label,I(_,"active",w),_.addEventListener("click",function(){I(_,"active"),_.setAttribute("aria-pressed",y(_,"active")?"true":"false"),I(e,g.cssClass,y(_,"active")),oe(e)}),c.appendChild(_)}),Yo(e).forEach(function(g){n.appendChild(g)});var f=Oo(e);return f&&n.appendChild(f),n}function ir(e){return v("h6",{class:"ge-section-title"},e)}function Yo(e){var t=ne(e),n=lr(),r=[];return[D,A,W].forEach(function(o){Object.keys(o).forEach(function(a){var u=o[a],c=u.panelSection?u.panelSection(e,t):null;if(!(!c||!c.body)){var f=v("div",{class:"ge-panel-section","data-ge-plugin":a});if(n==="offcanvas"||n==="modal")f.appendChild(ir(m(c.labelKey))),f.appendChild(c.body);else{var g=m(c.labelKey),w=f.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},g));le(c.body),f.appendChild(c.body),w.addEventListener("click",function(){fr(c.titleKey?m(c.titleKey,{kind:pr(e)}):g,c.body,w)})}r.push(f)}})}),r}var ar=["offcanvas","popover","modal","inline"],U={},F=null,dt=new WeakMap;function lr(){return ar.indexOf(l.settings_panel)!==-1?l.settings_panel:(te("settings_panel",'settings_panel "'+l.settings_panel+'" is not one of '+ar.join(", ")+": using offcanvas"),"offcanvas")}function sr(e){return e&&En.get(e)||null}function ur(){return F&&F.mode!=="inline"?[d,F.details]:[d]}function $o(e,t,n){var r=lr();if(r==="inline"){mn(t);return}var o=F&&F.details===t;me(),o||Qo(r,e,t,n)}function Qo(e,t,n,r){var o=Zo(e),a=new AbortController;F={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},O(o,".ge-settings-title").textContent=m("panel.title",{kind:pr(t)}),O(o,".ge-settings-body").appendChild(n),_e(n),x(t,"ge-settings-target");var u={signal:a.signal};if(document.addEventListener("keydown",function(f){f.key==="Escape"&&!pe&&me()},u),e==="offcanvas"){var c=window.innerWidth<576;I(o,"offcanvas-end",!c),I(o,"offcanvas-bottom",c),L(o,"hiding"),o.getBoundingClientRect(),x(o,"show")}else e==="popover"?(Qt(o,r),ee(window,"scroll resize",function(){Qt(o,r)},u),window.ResizeObserver&&(F.observer=new window.ResizeObserver(function(){Qt(o,r)}),F.observer.observe(n)),ee(document,"mousedown touchstart",function(f){!pe&&!o.contains(f.target)&&!r.contains(f.target)&&me()},u)):Zt(o,function(){F&&F.mode==="modal"&&me()})}function me(){ae();var e=F;if(e){F=null;var t=U[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(L(t,"show"),x(t,"hiding"),window.setTimeout(function(){L(t,"hiding")},300)):e.mode==="popover"?le(t):en(t),L(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),et(e.details),e.home&&xe(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.details,e.next):e.home.appendChild(e.details):e.details.remove()}}function Zo(e){if(U[e])return U[e];var t=function(){return v("button",{type:"button",class:"btn-close ge-settings-close","aria-label":m("panel.close")})},n;return e==="offcanvas"?(n=B('<div class="offcanvas offcanvas-end ge-settings-panel ge-settings-offcanvas" tabindex="-1" role="dialog"><div class="offcanvas-header"><h5 class="offcanvas-title ge-settings-title"></h5></div><div class="offcanvas-body ge-settings-body"></div></div>'),O(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=B('<div class="popover bs-popover-bottom ge-settings-panel ge-settings-popover" role="dialog"><div class="popover-arrow"></div><div class="popover-header"><span class="ge-settings-title"></span></div><div class="popover-body ge-settings-body"></div></div>'),O(n,".popover-header").appendChild(t()),le(n)):(n=B('<div class="modal fade ge-settings-panel ge-settings-modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-settings-title"></h5></div><div class="modal-body ge-settings-body"></div><div class="modal-footer"></div></div></div></div>'),O(n,".modal-header").appendChild(t()),O(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),Ne(n,"click",".ge-settings-close",function(r){r.preventDefault(),me()}),U[e]=document.body.appendChild(n),n}function dr(){me(),Object.keys(U).forEach(function(e){e==="modal"?Pt(U[e]):U[e].remove()}),Object.keys(U).forEach(function(e){cr(U[e])}),U={}}function Qt(e,t){if(xe(t)){_e(e);var n=t.getBoundingClientRect(),r=8,o=T(e,".popover-body");o.style.removeProperty("max-height");var a=tt(e),u=Et(e),c=window.innerHeight-n.bottom-2*r,f=n.top-2*r,g=u<=c||c>=f,w=g?c:f;u>w&&(ve(o,{"max-height":Math.max(120,w-(u-Et(o)))}),u=Et(e));var _=g?n.bottom+r:n.top-r-u,Ce=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));I(e,"bs-popover-bottom",g),I(e,"bs-popover-top",!g),ve(e,{top:_+window.pageYOffset,left:Ce+window.pageXOffset}),ve(T(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-Ce-8,a-24))})}}function Zt(e,t){var n=ot(),r=dt.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},dt.set(e,r)),r.dismissed=t,!n){r.backdrop||(r.backdrop=v("div",{class:"modal-backdrop fade show ge-settings-backdrop"}),r.backdrop.addEventListener("click",function(){r.dismissed()}),document.body.appendChild(r.backdrop)),x(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var o=n.getOrCreateInstance(e);r.watched||(r.watched=!0,An(e),e.addEventListener("hide.bs.modal",function(){r.wanted==="open"&&(r.wanted="closed",r.busy=!0)}),e.addEventListener("shown.bs.modal",function(){r.busy=!1,r.wanted==="closed"&&en(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?Zt(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function en(e){var t=ot(),n=dt.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),L(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&y(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function cr(e){var t=dt.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var X=null,pe=null;function ei(){return X||(X=B('<div class="modal fade ge-dialog" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-dialog-title"></h5></div><div class="modal-body ge-dialog-body"></div><div class="modal-footer"></div></div></div></div>'),O(X,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),O(X,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),Ne(X,"click",".ge-dialog-close",function(e){e.preventDefault(),ae()}),document.body.appendChild(X))}function fr(e,t,n){ae();var r=ei(),o=new AbortController;pe={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},O(r,".ge-dialog-title").textContent=e,O(r,".ge-dialog-body").appendChild(t),_e(t),ot()||document.addEventListener("keydown",function(a){a.key==="Escape"&&ae()},{signal:o.signal}),Object.keys(U).forEach(function(a){x(U[a],"ge-under-dialog")}),Zt(r,function(){ae()})}function ae(){var e=pe;e&&(pe=null,e.listening.abort(),en(X),Object.keys(U).forEach(function(t){L(U[t],"ge-under-dialog")}),le(e.body),e.home&&xe(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.body,e.next):e.home.appendChild(e.body):e.body.remove(),e.opener&&xe(e.opener)&&e.opener.focus&&e.opener.focus())}function mr(){ae(),X&&(cr(X),Pt(X),X=null)}function pr(e){var t=ne(e);if(D[t]&&D[t].labelKey)return m(D[t].labelKey);switch(t){case"row":return m("panel.kind_row");case"column":return m("panel.kind_column");case"text":return m("panel.kind_text");case"element":return m("panel.kind_element");case"section":return m("panel.kind_section");case"tab":return m("panel.kind_tab");case"accordion-item":return m("panel.kind_accordion_item");default:return t}}function ti(){k(d,'.column, div[class*="col-"], div.col').forEach(function(e){x(e,"column"),!(ai(e).length||gr(e.parentElement))&&pt(e,h[0],z)})}function gr(e){return y(e,"row")&&h.some(function(t){return Ue.some(function(n){return y(e,hn(t,n))})})}function $e(e,t){if(!y(e,"row"))return null;for(var n=h.indexOf(t);n>=0;n--)for(var r=0;r<Ue.length;r++)if(y(e,hn(h[n],Ue[r])))return{tier:n,value:Ue[r]};return null}function vr(e,t){for(var n=h.indexOf(t);n>=0;n--){var r=ze(e,h[n]);if(r!==null)return{tier:n,size:r}}return null}function ct(e,t){var n=$e(e.parentElement,t);if(!n)return null;var r=vr(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function ni(e){return e.value==="auto"?0:z/parseInt(e.value,10)}function ri(e,t){var n=ct(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:gr(e.parentElement)&&!vr(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function oi(e){Ee(e,".row").forEach(function(t){var n=l.row_cols===!1?null:S===V?$e(t,h[0])||null:$e(t,q(S));n?t.setAttribute("data-ge-row-cols",hr(n.value)):t.removeAttribute("data-ge-row-cols")})}function hr(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function ii(){return{name:"row-cols",prefix:"row-cols",values:Ue,appliesTo:["row"],labelKey:"utility.row_cols"}}function ze(e,t){var n=wr(e,t.colPrefix);return n!==null?n:y(e,ke(t,"auto"))?"auto":y(e,ke(t,"equal"))?"equal":null}function ft(e,t){return wr(e,t.offsetPrefix)}function tn(e,t){return br(e,t,ze)}function mt(e,t){return br(e,t,ft)}function br(e,t,n){for(var r=h.indexOf(t);r>=0;r--){var o=n(e,h[r]);if(o!==null)return o}return null}function wr(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function yr(e,t,n){var r=(e.getAttribute("class")||"").split(/\s+/).filter(function(o){return o!==""&&!new RegExp("^"+t+"\\d+$").test(o)});n!==null&&r.push(t+n),e.setAttribute("class",r.join(" "))}function pt(e,t,n){yr(e,t.colPrefix,null),vn.forEach(function(r){L(e,ke(t,r))}),n!=null&&x(e,ke(t,n))}function nn(e,t,n){yr(e,t.offsetPrefix,n||null)}function ai(e){return h.filter(function(t){return ze(e,t)!==null})}function rn(e,t,n){var r=0;return J(e,".column").forEach(function(o){if(!(n&&o===n)){var a=ct(o,t),u=a?ni(a):tn(o,t);r+=(H(u)?u:0)+(mt(o,t)||0)}}),z-r}function gt(e){var t=e.size===null||e.size===void 0?null:e.size,n=e.offset===null||e.offset===void 0?0:e.offset;return n=Math.min(Math.max(n,0),Fr),t===null||!H(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),z),t+n<=z?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:z-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function Qe(e){Ee(e,".column").forEach(function(t){ve(t,{width:"",height:"",left:"",top:""}),et(t)})}function Cr(e){return"ge-"+e+"-"+Vr}function on(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(an("blocks")).join(", ")}function an(e){return Object.keys(A).map(function(t){return A[t][e]||null}).filter(function(t){return t!==null})}function ln(e,t){var n=!0;return Object.keys(A).forEach(function(r){var o=A[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function li(){return l.drag_handle==="drawer"?".ge-tools-drawer > a:not(.ge-text-info):not(.ge-element-info), .ge-details, input, textarea, button, select, option":"input, textarea, button, select, option"}function vt(e,t){var n=Wr();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=l.drag_handle==="drawer",o=li(),a=0;e.forEach(function(u){var c=t.group?{name:Cr(t.group)}:{name:Cr(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(c.put=function(f,g,w){return g.options.group.name===c.name&&t.accepts(f.el,w)}),St.push(n.create(u,Object.assign({group:c,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(f,g){return Z(f.target,o,u)?!0:!g||g.parentNode!==u},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:l.drag.animation,delay:l.drag.delay||l.drag.touch_delay,delayOnTouchOnly:!l.drag.delay,touchStartThreshold:l.drag.threshold,scroll:l.drag.scroll,onStart:ui,onEnd:ci},t.options||{})))})}}function si(){if(!Wr()){te("sortable_missing",m("error.sortable_missing"));return}vt(k(d,".row"),{draggable:".column",group:"column"}),vt([d].concat(k(d,".column")),{draggable:on(),group:"block",accepts:ln});var e=an("regions");e.length&&vt(k(d,e.join(", ")),{draggable:">"+on(),group:"block",accepts:ln}),re("onSortable",vt)}function ui(e){var t=e.item,n=Nt(t),r=Er(t),o={from:n,canceled:!1};Tt.set(t,o),K(function(){var a=M("before-move",$(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function Er(e){var t=y(e,"ge-text-block")&&T(e,".ge-content")||e;return{kind:ne(t),node:t}}function di(e,t){var n=J(t.parent).filter(function(r){return r!==e&&!y(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function ci(e){var t=e.item,n=Tt.get(t),r=n?n.from:Nt(t);if(Tt.delete(t),n&&n.canceled){di(t,r);return}var o=Nt(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=Z(t,"[data-ge-container]"),u=D[Me(a)];u&&u.afterPaneMove&&u.afterPaneMove(a,t,r);var c=Er(t);K(function(){M("after-move",$(c.kind,c.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function fi(){l.resize.enabled&&k(d,".column").forEach(function(e){if(!T(e,".ge-resize-handle")){var t=T(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),mi().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",pi),e.appendChild(r)})}})}function mi(){return String(l.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function pi(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=tt(n);if(e.preventDefault(),!vi(n))return;x(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function u(g){var w=g.pageX-o;return Math.max(1,a+(r?-w:w))}function c(g){n.style.width=u(g)+"px",hi(n,u(g))}function f(g){t.removeEventListener("pointermove",c),pn(t,"pointerup pointercancel",f),L(n,"ge-resizing"),bi(n,u(g))}t.addEventListener("pointermove",c),ee(t,"pointerup pointercancel",f)}function gi(){k(d,".ge-resize-handle").forEach(function(e){e.remove()}),k(d,".ge-resize-size").forEach(function(e){e.remove()}),Qe(d)}function xr(e,t){var n=Math.round(t/or(e.parentElement)*z),r=_r(e),o=r?qe(r):null,a=it.get(e),u=a?a.units:Ge(e),c=r&&H(o)?u+o-Je(l.valid_col_sizes):z-Xe(e);return Math.min(Math.max(n,Je(l.valid_col_sizes)),Math.max(c,Je(l.valid_col_sizes)),Yt(l.valid_col_sizes))}function _r(e){return l.resize.balance!=="next"?null:zr(e,".column")[0]||null}function sn(e,t){var n=T(e,".ge-tools-drawer"),r=n?T(n,".ge-resize-size"):null;r&&(r.textContent=t)}function kr(e){return(S===V?h[0].colPrefix:fe().colPrefix)+e}function vi(e){var t=qe(e),n=K(function(){return M("before-resize",$("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:Ge(e)};return it.set(e,r),sn(e,kr(r.units)),!0}function hi(e,t){sn(e,kr(xr(e,t)))}function bi(e,t){var n=it.get(e),r=xr(e,t);if(it.delete(e),sn(e,""),Qe(e),!!n&&r!==n.units){var o=jt(e,r);o&&K(function(){It(e,o),wi(e,r-n.units),oe(e),M("after-resize",$("column",e,Dt({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function wi(e,t){var n=_r(e);if(!(!n||!t)){var r=qe(n);if(H(r)){var o=jt(n,r-t);o&&(It(n,o),oe(n))}}}function yi(){St.forEach(function(e){e.destroy()}),St=[]}function je(){return v("div",{class:"row"})}function ht(e,t,n){var r=null;if(Ni.forEach(function(c){r===null&&n&&n[c]!==void 0&&(r=c)}),r===null)return e;var o=he(n[r]);if(!o)return N(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,u=function(){return Q(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):_t(e,o)},{parent:a,source:n.source||"api"})};return He>0?(Mt(u),e):u()}function Ci(e,t){var n=je();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(N("createRow: the layout is an array of column sizes, as in [8, 4], or { row_cols, columns }. Making an empty row instead."),e=[]),e&&!Array.isArray(e)&&(n=We(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(ge(r))}),ht(n,"row",t)}function Ei(e,t){t=t||{};var n=he(t.appendTo||t.prependTo||null);e===void 0&&n&&$e(n,fe())?e=null:!H(e)&&vn.indexOf(e)===-1&&(N("createColumn: no column size given, using "+z),e=z);var r=ge(e,t.offset);return t.content!==void 0&&r.appendChild(Pi(t.content)),ht(r,"column",t)}function xi(e,t){t=t||{};var n=D[e];return n?ht(n.create(t),e,t):(N('createContainer: no such container type "'+e+'"'),null)}function Ar(e,t,n){e=he(e),n=n||{};var r=D[Me(e)];if(!r||Me(e)!==t)return N("this is not a "+t+" container"),null;var o=r.addPane(e,n);return Q(r.paneKind,o,function(){},{parent:e,source:"api",container:e})}function un(){var e={};return Object.keys(l).forEach(function(t){var n=l[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function ge(e,t){var n=v("div",{class:"column"}),r=Hr(S)[0],o=gt({size:e,offset:t||0,leading:"offset"});return pt(n,r,o.size===null?e:o.size),nn(n,r,o.offset),n}function Sr(e){if(!(!l.custom_filter||!l.custom_filter.length)){var t=typeof l.custom_filter=="string"||typeof l.custom_filter=="function"?[l.custom_filter]:l.custom_filter;Array.prototype.forEach.call(t,function(n){typeof n=="string"&&(n=window[n]),n(d,e)})}}function _i(){var e=[".row","[data-ge-container]"];return Object.keys(A).forEach(function(t){var n=A[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function ki(e){k(d,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(y(t,"ge-rte-active")||!J(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=y(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],a=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(f){f.nodeType===1&&f.matches(e)?(o.push({text:a},{block:f}),a=[]):a.push(f)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var u=!1,c=r;o.forEach(function(f){var g;if(f.block)g=f.block;else if(Ai(f.text))u?(g=dn(n),f.text.forEach(function(w){g.appendChild(w)})):(f.text.forEach(function(w){t.appendChild(w)}),g=r,u=!0);else return;g!==c&&_t(g,c),c=g}),u||r.remove()}})}function Ai(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function Si(e){k(d,".column").forEach(function(t){var n=[];J(t).forEach(function(r){De(r,".ge-tools-drawer, .ge-resize-handle")||(De(r,".ge-content, .ge-text-block")||r.matches(e)?n=Tr(n):n.push(r))}),Tr(n)})}function Tr(e){if(e.length){var t=_t(dn(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function dn(e){var t=v("div",{class:"ge-content"});return e&&(x(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function Ti(){k(d,".column > .ge-content").forEach(function(e){Dr(e,v("div",{class:"ge-text-block"}))}),k(d,".ge-text-block").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=T(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?mo(n)||Mi(e,n):Li(e)}})}function Oi(){k(d,".ge-text-block").forEach(function(e){kt(e)})}function Li(e){var t=T(e,".ge-content"),n=Pe(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");x(e,"ge-plain-block"),ye(n),Object.keys(A).forEach(function(r){A[r].plainTools&&A[r].plainTools(n,t)}),P(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){we("plain",t,m("confirm.delete_plain"),function(r){nt(e,function(){e.remove(),r()})})})}function Mi(e,t){var n=T(e,".ge-content"),r=Pe(e,"ge-tools-drawer ge-text-drawer");ye(r),P(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),P(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){we("text",n,m("confirm.delete_text"),function(o){nt(e,function(){e.remove(),o()})})})}function Pi(e){var t=Nn(),n=dn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):bt(n,e),n}function Or(e){S=e,gn.forEach(function(t){I(d,"ge-layout-"+t,t===e)}),O(Ae,"button").textContent=m(rt(e))}function cn(e){return gn.indexOf(e)===-1?null:e}function Lr(e){var t=cn(e);if(t===null){N("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=S;Or(t),t!==n&&(ur().forEach(function(r){k(r,".ge-utilities").forEach(function(o){Xt(o)})}),$n(null),Be(d),re("onViewChange",t),M("view-change",{canvas:d,breakpoint:t,from:n,to:t}))}function fn(){return S}function Mr(e,t,n){return function(){return Ve[e]?Ve[e].apply(null,arguments):(te("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}var Pr={getHtml:Hn,getPlainHtml:vo,init:function(){Mt(ue)},reset:function(){Mt(Un)},deinit:Oe,destroy:ho,changeView:Lr,getView:fn,createRow:Ci,createColumn:Ei,createText:function(e,t){return Ve.createText?Ve.createText(e,t):(te("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:Mr("createElement","elements","elements"),createSection:Mr("createSection","sections","sections"),createContainer:xi,addTab:function(e,t){return Ar(e,"tabs",t)},addAccordionItem:function(e,t){return Ar(e,"accordion",t)},setLocale:qr,getUtility:Xn,setUtility:qt};Object.keys(Pr).forEach(function(e){var t=!!(Ur[e]&&Ur[e].value);i[e]=function(){if(Cn)return te("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?d.innerHTML:e==="getPlainHtml"?bn(d.innerHTML):t?null:i;var n=Pr[e].apply(i,arguments);return t?n:i}}),i.canvas=d,i.settings=un(),At.set(d,i),bo(),i.settings=un(),$r(),ue(),C._created.forEach(function(e){e(i)})}C._created=[];C.containers={};C.features={};C.utilities={};C.texts={};C.t=wn;C._plainHtml=bn;C.Sortable=null;C.bootstrap=null;C.version="8.0.0";C.locales={en:{"tool.move":"Move","tool.settings":"Settings","tool.add_row":"Add row","tool.delete_text":"Remove text","tool.delete_plain":"Remove content","tool.convert_type":"Edit as {editor} text","text.no_editor":'No text editor "{type}" is loaded: this text can be moved and deleted, not edited',"tool.add_column":`Add column
|
|
9
|
+
(()=>{function k(i,s){return i?Array.prototype.slice.call(i.querySelectorAll(s)):[]}function O(i,s){return i?i.querySelector(s):null}function _e(i,s){if(!i)return[];var g=k(i,s);return i.nodeType===1&&i.matches(s)&&g.unshift(i),g}function J(i,s){return i?Array.prototype.filter.call(i.children,function(g){return!s||g.matches(s)}):[]}function T(i,s){return J(i,s)[0]||null}function Z(i,s,g){var l=i&&i.nodeType===1?i.closest(s):null;return l&&g&&l!==g&&!g.contains(l)?null:l}function be(i,s){return!!i&&i.nodeType===1&&i.matches(s)}function ke(i){return!!i&&document.documentElement.contains(i)}function Nr(i,s){for(var g=[],l=i.nextElementSibling;l;l=l.nextElementSibling)(!s||l.matches(s))&&g.push(l);return g}function Ur(i,s){for(var g=[],l=i.parentElement;l&&l!==s;l=l.parentElement)g.push(l);return g}function Ui(i){var s=document.createElement("template");return s.innerHTML=i,Array.prototype.slice.call(s.content.childNodes)}function V(i){for(var s=Ui(i.trim()),g=0;g<s.length;g++)if(s[g].nodeType===1)return s[g];return null}function v(i,s,g){var l=document.createElement(i);return Object.keys(s||{}).forEach(function(d){var x=s[d];x!=null&&x!==!1&&l.setAttribute(d,x)}),g!=null&&(l.textContent=g),l}function Ct(i,s){return i.innerHTML=s==null?"":String(s),i}function C(i,s){return Fe(s).forEach(function(g){i.classList.add(g)}),i}function L(i,s){return Fe(s).forEach(function(g){i.classList.remove(g)}),i}function I(i,s,g){return Fe(s).forEach(function(l){g===void 0?i.classList.toggle(l):i.classList.toggle(l,!!g)}),i}function y(i,s){return!!i&&i.nodeType===1&&i.classList.contains(s)}function Fe(i){return String(i||"").split(/\s+/).filter(Boolean)}function Et(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function nt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function xt(i,s){return Object.keys(s).forEach(function(g){var l=s[g];l==null?i.removeAttribute(g):i.setAttribute(g,l)}),i}function we(i,s){return Object.keys(s).forEach(function(g){var l=s[g];typeof l=="number"&&!Fi[g]&&(l=l+"px"),i.style.setProperty(g,l==null?"":String(l))}),i}var Fi={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},tt={};function Hi(i){var s=i.nodeName;if(!tt[s]){var g=document.body.appendChild(document.createElement(s));tt[s]=getComputedStyle(g).display,g.remove(),tt[s]==="none"&&(tt[s]="block")}return tt[s]}function Ae(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=Hi(i)),i}function ue(i){return i.style.display="none",i}function vn(i,s){return s===void 0&&(s=!_t(i)),s?Ae(i):ue(i)}function _t(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function rt(i){return i.getBoundingClientRect().width}function kt(i){return i.getBoundingClientRect().height}function Fr(i){var s=getComputedStyle(i);return i.clientHeight-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)}function At(i){var s=i.getBoundingClientRect();return{top:s.top+window.pageYOffset,left:s.left+window.pageXOffset}}function St(i,s){return s.parentNode.insertBefore(i,s.nextSibling),i}function Tt(i){for(var s=i.parentNode;i.firstChild;)s.insertBefore(i.firstChild,i);i.remove()}function Hr(i,s){return i.parentNode.insertBefore(s,i),s.appendChild(i),s}function He(i,s,g,l,d){var x=function(b){var j=Z(b.target,g,i);if(j&&i.contains(j))return l.call(j,b)};return Fe(s).forEach(function(b){i.addEventListener(b,x,d)}),x}function ne(i,s,g,l){return Fe(s).forEach(function(d){i.addEventListener(d,g,l)}),g}function hn(i,s,g,l){Fe(s).forEach(function(d){i.removeEventListener(d,g,l)})}var Ki=400;function Kr(i,s,g,l){g=g===void 0?Ki:g;var d=function(){ue(i),l&&l()};if(!_t(i)||!i.animate||g<=0){window.setTimeout(d,0);return}var x=i.animate(s(getComputedStyle(i)),{duration:g,easing:"ease-in-out"}),b=!1,j=function(){b||(b=!0,d())};x.onfinish=j,x.oncancel=j}function ot(i,s,g){typeof s=="function"&&(g=s,s=void 0),i.style.overflow="hidden",Kr(i,function(l){return[{height:l.height,paddingTop:l.paddingTop,paddingBottom:l.paddingBottom,marginTop:l.marginTop,marginBottom:l.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},s,function(){i.style.removeProperty("overflow"),g&&g()})}function Wr(i,s,g,l){i.style.overflow="hidden",Kr(i,function(d){var x={opacity:d.opacity,height:d.height},b={opacity:0,height:"0px"};return l&&(x.width=d.width,b.width="0px"),[x,b]},s,function(){i.style.removeProperty("overflow"),g&&g()})}var Br={getHtml:{value:!0},getPlainHtml:{value:!0},init:{},deinit:{},reset:{},destroy:{},changeView:{},getView:{value:!0},createRow:{value:!0},createColumn:{value:!0},createElement:{value:!0},createText:{value:!0},createSection:{value:!0},createContainer:{value:!0},addTab:{value:!0},addAccordionItem:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0},getActiveTarget:{value:!0},setActiveTarget:{}},Bi=["appendTo","prependTo","insertAfter","insertBefore"],h=[{key:"xs",infix:"",colPrefix:"col-",offsetPrefix:"offset-",min:0,preview:400,labelKey:"view.xs"},{key:"sm",infix:"sm",colPrefix:"col-sm-",offsetPrefix:"offset-sm-",min:576,preview:576,labelKey:"view.sm"},{key:"md",infix:"md",colPrefix:"col-md-",offsetPrefix:"offset-md-",min:768,preview:768,labelKey:"view.md"},{key:"lg",infix:"lg",colPrefix:"col-lg-",offsetPrefix:"offset-lg-",min:992,preview:992,labelKey:"view.lg"},{key:"xl",infix:"xl",colPrefix:"col-xl-",offsetPrefix:"offset-xl-",min:1200,preview:1200,labelKey:"view.xl"},{key:"xxl",infix:"xxl",colPrefix:"col-xxl-",offsetPrefix:"offset-xxl-",min:1400,preview:null,labelKey:"view.xxl"}],q="all",Vi="view.all",bn=[q].concat(h.map(function(i){return i.key})),z=12,Vr=11,wn=["equal","auto"],Ke=["1","2","3","4","5","6","auto"];function yn(i,s){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+s}function K(i){return typeof i=="number"}function Se(i,s){return s==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+s}function X(i){for(var s=0;s<h.length;s++)if(h[s].key===i)return h[s];return null}function qr(i){if(i===q)return[h[0]];var s=X(i);return s?[s]:[]}function it(i){var s=X(i);return s?s.labelKey:Vi}var Te={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1},resize:{enabled:!0,tools:!0,handles:"e",balance:"next"},indent:{tools:!0},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},Xr={},qi=0,Ot=new WeakMap;function En(i,s,g){var l=E.locales,d=l[i.locale]||{},x=i.locale_strings||{},b=x[s];return b===void 0&&(b=d[s]),b===void 0&&(b=l.en[s]),b===void 0&&(Xi("locale:"+s,'no string for "'+s+'" in any locale, showing the key'),b=s),b.replace(/\{(\w+)\}/g,function(j,ye){return g&&g[ye]!==void 0?g[ye]:j})}function N(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Xi(i,s){Xr[i]||(Xr[i]=!0,N(s))}function Gi(i,s){return En({locale:"en"},i,s)}function Yi(i){if(typeof i=="string"){var s=document.querySelector(i);if(!s)throw new TypeError("grid-editor: no element matches "+JSON.stringify(i));return s}if(i&&i.nodeType===1)return i;throw new TypeError("grid-editor: the target is an element or a selector, not "+(i===null?"null":typeof i))}function de(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function Gr(){return E.Sortable||window.Sortable||null}function at(){var i=E.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function Cn(i){var s=document.implementation.createHTMLDocument("").body;s.innerHTML=i;var g=[];return k(s,"*").forEach(function(l){var d=!1;Array.prototype.slice.call(l.attributes).forEach(function(j){j.name.indexOf("data-ge-")===0&&(l.removeAttribute(j.name),d=!0)});var x=(l.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=x.filter(function(j){return j!=="column"&&j.indexOf("ge-")!==0});b.length!==x.length&&(d=!0),b.length?l.setAttribute("class",b.join(" ")):l.removeAttribute("class"),d&&l.tagName==="DIV"&&!l.attributes.length&&g.push(l)}),g.forEach(function(l){Tt(l)}),s.innerHTML}function E(i,s){var g=Yi(i),l=Ot.get(g);if(l)return Yr.has(g)||(Yr.add(g),N(Gi("warning.already_editing"))),l;if(!(this instanceof E))return new E(g,s);Ji(this,g,s||{})}var Yr=new WeakSet;E.create=function(i,s){return new E(i,s)};E.get=function(i){var s=de(i);return s&&Ot.get(s)||null};function Ji(i,s,g){var l=Object.assign({new_row_layouts:[[12],[6,6],[4,4,4],[3,3,3,3],[2,2,2,2,2,2],[2,8,2],[4,8],[8,4]],row_classes:[],col_classes:[],col_tools:[],row_tools:[],drag_handle:"tool",toolbar_drag:"auto",active_target:!1,element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Te.elements,custom_filter:"",valid_col_sizes:[1,2,3,4,5,6,7,8,9,10,11,12,"equal","auto"],valid_col_offsets:[0,1,2,3,4,5,6,7,8,9,10,11],add_column:Te.add_column,layout_modes:bn.slice(),default_view:q,resize:Te.resize,indent:Te.indent,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:Te.drag},g);Object.keys(Te).forEach(function(e){l[e]=Object.assign({},Te[e],l[e])});var d,x,b,j,ye,Oe,G,S=l.default_view,U=null,$=null,Le=!1,Me=null,D=null,xn={},Lt=[],Jr=++qi,_n=!1,kn=new WeakMap,Mt=new WeakMap,lt=new WeakMap,An=new WeakMap,Pt=new WeakSet,Sn=new AbortController;d=C(s,"ge-canvas");function ee(e,t){xn[e]||(xn[e]=!0,N(t))}function m(e,t){return En(l,e,t)}function $r(e){l.locale=e,i.settings=fn(),Tn(),pr(),br(),x.remove(),zn(),Wn()}var We=0,zt=[];function Q(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:d,breakpoint:pn(),source:"api"},n||{})}function M(e,t){var n=[e],r=e.replace(/^(before|after)-add-.+$/,"$1-add");r!==e&&n.push(r);var o=!1;return n.forEach(function(a){var u=new CustomEvent("grideditor:"+a,{detail:t,bubbles:!0,cancelable:!0});d.dispatchEvent(u)||(o=!0)}),n.forEach(function(a){var u=l.callbacks[a.replace(/-/g,"_")];typeof u=="function"&&u(t)===!1&&(o=!0)}),!o}function W(e){We++;try{return e()}finally{if(We--,We===0)for(;zt.length;)zt.shift()()}}function jt(e){if(We===0){e();return}zt.push(e)}function te(e,t,n,r){var o=Qr(e);return W(function(){var a=Q(e,t,r);return M("before-add-"+o,a)?(n(),fe(),M("after-add-"+o,a),t):null})}function Qr(e){return E.containers[e]?"container":e}function Zr(e,t){if(!l.confirm_delete){t();return}var n=at();if(!n){window.confirm(e)&&t();return}var r=eo(),o=!1;O(r,".ge-confirm-message").textContent=e,O(r,".ge-confirm-ok").onclick=function(){o=!0,n.getInstance(r).hide()},ce.hidden=function(){o&&t()},ce.shown=function(){O(r,".ge-confirm-ok").focus()},n.getOrCreateInstance(r).show()}var ce={hidden:null,shown:null};function eo(){return U||(U=V('<div class="modal fade ge-confirm" tabindex="-1" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h5 class="modal-title"></h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body"><p class="ge-confirm-message"></p></div><div class="modal-footer"><button type="button" class="btn btn-secondary ge-confirm-cancel" data-bs-dismiss="modal"></button><button type="button" class="btn btn-danger ge-confirm-ok"></button></div></div></div></div>'),document.body.appendChild(U),O(U,".modal-title").textContent=m("confirm.title"),O(U,".btn-close").setAttribute("aria-label",m("confirm.cancel")),O(U,".ge-confirm-cancel").textContent=m("confirm.cancel"),O(U,".ge-confirm-ok").textContent=m("confirm.ok"),On(U),U.addEventListener("hidden.bs.modal",function(){ce.hidden&&ce.hidden()}),U.addEventListener("shown.bs.modal",function(){ce.shown&&ce.shown()}),U)}function Tn(){U&&(ce.hidden=null,ce.shown=null,It(U),U=null)}function It(e){var t=at(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!Dt.get(e)&&!y(e,"show")){o();return}e.addEventListener("hidden.bs.modal",o,{once:!0}),e.addEventListener("shown.bs.modal",function(){n.hide()},{once:!0}),n.hide()}var Dt=new WeakMap;function On(e){ne(e,"show.bs.modal hide.bs.modal",function(){Dt.set(e,!0)}),ne(e,"shown.bs.modal hidden.bs.modal",function(){Dt.set(e,!1)})}function Ce(e,t,n,r){W(function(){var o=Q(e,t,{source:"tool"});M("before-delete",o)&&Zr(n,function(){W(function(){r(function(){t.remove(),W(function(){fe(),M("after-delete",o)})})})})})}function Rt(e,t,n){if(n=n||S,n!==q){var r=X(n),o=ht({size:t,offset:pt(e,r)||0});return o.refused||Re(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=h.some(function(p){return ht({size:t,offset:pt(e,p)||0}).refused});if(a)return null;var u=h[0],c=[],f=[];return h.slice(1).forEach(function(p){var w=Re(e,p);w!==null&&(c.push({tier:p,size:null}),f.push({breakpoint:p.key,value:w}))}),Re(e,u)!==t&&c.unshift({tier:u,size:t}),c.length?{writes:c,cleared:f,size:t}:null}function Nt(e,t){t.writes.forEach(function(n){vt(e,n.tier,n.size)}),et(e)}function Ut(e,t){return t&&(e.cleared=t),e}function Ft(e,t,n,r){r=r||S;var o=Ge(e),a=Rt(e,t,r);return a?W(function(){var u=Q("column",e,Ut({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return M("before-resize",u)?(Nt(e,a),ie(e),M("after-resize",u),!0):(ie(e),!1)}):!1}function Ln(e,t,n){var r=S===q,o=r?h[0]:X(S),a=Je(e);t=Math.min(Math.max(t,0),Vr);var u=r?h.slice(1).filter(function(c){return gt(e,c)!==null}):[];return(gt(e,o)||0)===t&&!u.length?!1:W(function(){var c=Q("column",e,Ut({source:n,from:a,to:t},r?u.map(function(f){return{breakpoint:f.key,value:gt(e,f)}}):null));return M("before-indent",c)?(ln(e,o,t),u.forEach(function(f){ln(e,f,0)}),(r?h:[o]).forEach(function(f){var p=an(e,f);if(K(p)){var w=ht({size:p,offset:t,leading:"offset"});w.size!==p&&vt(e,f,w.size)}}),ie(e),M("after-indent",c),!0):!1})}function Ht(e){var t=e.parentElement;return{parent:t,index:J(t).filter(function(n){return!y(n,"ge-tools-drawer")}).indexOf(e)}}function re(e){var t=null;return Object.keys(A).forEach(function(n){var r=A[n];!t&&r.kindOf&&(t=r.kindOf(e))}),t||(e.getAttribute("data-ge-container")?e.getAttribute("data-ge-container"):y(e,"ge-tab")?"tab":y(e,"ge-accordion-item")?"accordion-item":y(e,"row")?"row":y(e,"column")?"column":y(e,"ge-element")?"element":(y(e,"ge-text-block")&&(e=T(e,".ge-content")||e),y(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(l.source_textarea){var Be=de(l.source_textarea).value,Mn=v("div");Mn.innerHTML=Be,Be.length>0&&!Mn.querySelector(".row")&&(Be='<div class="row"><div class="col-lg-12">'+Be+"</div></div>"),Ct(s,Be)}if(s.children.length&&!s.querySelector("div.row")){var to=J(s),Pn=V('<div class="row"><div class="col-lg-12"></div></div>');s.appendChild(Pn),to.forEach(function(e){Pn.firstChild.appendChild(e)})}function no(){G=v("textarea",{class:"ge-html-output"}),d.parentNode.insertBefore(G,d),zn();var e={signal:Sn.signal};if(window.addEventListener("scroll",go,e),He(d,"click",".ge-content",po,e),He(d,"click",".ge-popup-trigger, [data-ge-popup-target]",function(n){y(d,"ge-editing")&&n.preventDefault()},e),l.active_target){var t=null;d.addEventListener("pointerdown",function(n){t={x:n.clientX,y:n.clientY}},e),d.addEventListener("click",function(n){var r=t;if(t=null,!!y(d,"ge-editing")&&!(r&&Math.abs(n.clientX-r.x)+Math.abs(n.clientY-r.y)>l.drag.threshold)){var o=Z(n.target,Vn());Pe(o&&o!==d&&d.contains(o)?o:null)}},e),document.addEventListener("keydown",function(n){if(!(n.key!=="Escape"||!D||F||le)){var r=document.activeElement;r&&(be(r,"input, textarea, select")||r.isContentEditable)||Pe(null)}},e)}}function ro(e){!be(e,".ge-content")||!d.contains(e)||(oe("onContentReady",e),qe(e))}function zn(){x=v("div",{class:"ge-mainControls"}),G.parentNode.insertBefore(x,G),b=x.appendChild(v("div",{class:"ge-wrapper ge-top"})),j=b.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),ye=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),l.new_row_layouts.forEach(function(u){var c=!Array.isArray(u),f=v("a",{class:"btn btn-sm btn-primary",title:c?m("row.add_row_cols",{columns:u.columns,counts:fo(u.row_cols)}):m("row.add",{layout:u.join("-")}),"data-ge-toolbar":"row","data-ge-layout":c?JSON.stringify(u):u.join(",")});f.addEventListener("click",function(){if(D){Vt(f,"tool");return}var _=Ve(u),xe=te("row",_,function(){d.appendChild(_)},{parent:d,source:"tool"});xe&&_.scrollIntoView&&_.scrollIntoView({behavior:"smooth"})}),j.appendChild(f),f.appendChild(V('<i class="bi bi-plus"></i>'));var p=c?mo(u):u,w='<div class="row ge-row-icon">';p.forEach(function(_){w+='<div class="column '+Se(h[0],_)+'"></div>'}),w+="</div>",f.appendChild(V(w))}),b.appendChild(ye),Object.keys(R).forEach(function(u){var c=R[u],f=jn(v("a",{class:"btn btn-sm btn-primary ge-add-container"}),m(c.labelKey),c.iconClass);xt(f,{"data-ge-toolbar":"container","data-ge-container-type":u}),f.addEventListener("click",function(){if(D){Vt(f,"tool");return}var p=Ne(),w=p.appendChild(he(z)),_=w.appendChild(c.create({}));te(u,_,function(){d.appendChild(p)},{parent:d,source:"tool"})}),ye.appendChild(f)});var e=[];Object.keys(A).forEach(function(u){(A[u].toolbar||[]).forEach(function(c,f){var p=oo(u,c,f);c.align==="end"?e.push(p):ye.appendChild(p)})}),Oe=V('<div class="dropdown pull-right ge-layout-mode"><button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown"></button><div class="dropdown-menu" role="menu"></div></div>'),He(Oe,"click","a",function(){Ir(this.getAttribute("data-ge-view"))}),b.appendChild(Oe),l.layout_modes.forEach(function(u){O(Oe,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":u,title:m(it(u))},m(it(u))))}),O(Oe,"button").textContent=m(it(S));var t=b.appendChild(v("div",{class:"btn-group pull-right"}));if(l.edit_source){var n=V('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');n.setAttribute("title",m("tool.edit_source")),I(n,"active btn-danger",Le),n.addEventListener("click",function(){Le?Bn():bo(),I(n,"active btn-danger",Le)}),t.appendChild(n)}var r=V('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),o=function(){y(r,"active")||C(d,"ge-editing")};if(r.setAttribute("title",m("tool.preview")),r.addEventListener("mouseenter",function(){L(d,"ge-editing")}),r.addEventListener("click",function(){I(r,"active btn-danger"),o()}),r.addEventListener("mouseleave",o),t.appendChild(r),e.length){var a=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));e.forEach(function(u){a.appendChild(u)})}ao()}function jn(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(V('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function oo(e,t,n){var r=t.iconClass||(t.align==="end"?"bi bi-plus":null),o=typeof t.label=="function"?t.label():t.label||m(t.labelKey),a=jn(v("a",{class:"btn btn-sm btn-primary ge-add-container ge-add-feature"}),o,r);return C(a,t.className||""),xt(a,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),a.addEventListener("click",function(){if(D){Vt(a,t.source||"tool");return}var u=t.create(),c=t.inColumn?Kt(u):u,f=te(t.kind,u,function(){d.appendChild(c)},{parent:d,source:t.source||"tool"});f&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}),a}function io(){return l.toolbar_drag==="auto"?l.drag_handle==="drawer":!!l.toolbar_drag}function ao(){var e=k(x,"[data-ge-toolbar]");e.forEach(function(t){L(t,"ge-palette-button"),t.removeEventListener("pointerdown",In)}),io()&&e.forEach(function(t){C(t,"ge-palette-button"),t.addEventListener("pointerdown",In)})}function In(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(f){return Math.abs(f.pageX-n)+Math.abs(f.pageY-r)>l.drag.threshold}function u(f){if(!o){if(!a(f))return;o=C(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),C(d,"ge-dropping")}we(o,{left:f.pageX-14,top:f.pageY-14}),so(f.pageX,f.pageY)}function c(f){if(document.removeEventListener("pointermove",u),hn(document,"pointerup pointercancel",c),!!o){o.remove(),L(d,"ge-dropping"),Wt();var p=function(_){_.target!==t&&!t.contains(_.target)||(_.preventDefault(),_.stopImmediatePropagation())};window.addEventListener("click",p,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",p,{capture:!0})},0);var w=Dn(f.pageX,f.pageY);w&&Rn(t,w)}}document.addEventListener("pointermove",u),ne(document,"pointerup pointercancel",c)}function Dn(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=Z(o,[".column",".ge-canvas"].concat(bt("regions")).join(", "));if(!a||a!==d&&!d.contains(a))return null;var u=null;return J(a,un()).forEach(function(c){if(!u){var f=c.getBoundingClientRect();r<f.top+f.height/2&&(u=c)}}),{region:a,before:u}}function lo(e,t,n){var r=A[e.getAttribute("data-ge-feature")].toolbar[parseInt(e.getAttribute("data-ge-item"),10)],o=r.create(),a=o;if(r.inColumn)be(t.region,".column")||(a=Kt(o));else if(!dn(t.region,o)){var u=t.region===d?[]:Ur(t.region,d).reverse().concat([t.region]),c=u[0]||null;t={region:d,before:c?c.nextElementSibling:null}}return te(r.kind,o,function(){t.before?t.before.parentNode.insertBefore(a,t.before):t.region.appendChild(a)},{parent:t.region,source:r.source||n||"dragdrop"})}function Kt(e){var t=Ne();return t.appendChild(he(z)).appendChild(e),t}function so(e,t){var n=Dn(e,t);if(!n)return Wt();Me||(Me=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Me,n.before):n.region.appendChild(Me)}function Wt(){Me&&Me.remove()}function Rn(e,t,n){if(e.getAttribute("data-ge-toolbar")==="feature")return lo(e,t,n);var r=e.getAttribute("data-ge-toolbar")==="container",o=e.getAttribute("data-ge-container-type"),a=r?R[o].create({}):co(e.getAttribute("data-ge-layout")),u=a;return r&&!be(t.region,".column")&&(u=Kt(a)),te(r?o:"row",a,function(){t.before?t.before.parentNode.insertBefore(u,t.before):t.region.appendChild(u)},{parent:t.region,source:n||"dragdrop"})}function uo(){for(var e=[],t=1;t<=z;t++)e.push(String(t));return{name:"col",values:e.concat(wn),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return Se(X(n),Bt(r))},choices:function(){return l.valid_col_sizes.map(String)},label:function(n){return n==="equal"?m("utility.col_equal"):n==="auto"?m("utility.col_auto"):n},write:function(n,r,o,a){return Ft(n,r===null?null:Bt(r),a,o)},blank:function(n,r){var o=r===q?null:mt(n,X(r));return o?m("utility.col_from_row",{count:Er(o.value)}):null}}}function Bt(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function co(e){return/^\s*\{/.test(e||"")?Ve(JSON.parse(e)):Ve((e||"").split(",").filter(function(t){return t!==""}).map(Bt))}function Ve(e){var t=Ne();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(he(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=X(r);a&&Ke.indexOf(String(o))!==-1&&C(t,yn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(he(null));return t}function fo(e){return h.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function mo(e){var t=1;return Object.keys(e.row_cols||{}).forEach(function(n){var r=e.row_cols[n];r!=="auto"&&(t=Math.max(t,parseInt(r,10)||1))}),Array.apply(null,Array(Math.min(t,e.columns||t))).map(function(){return"equal"})}function go(){var e=window.pageYOffset;e>At(x).top&&e<At(d).top+Fr(d)?y(b,"ge-top")&&(we(b,{left:At(b).left,width:rt(b)}),L(b,"ge-top"),C(b,"ge-fixed")):y(b,"ge-fixed")&&(we(b,{left:"",width:""}),L(b,"ge-fixed"),C(b,"ge-top"))}function po(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!ae()&&_t(e)){var t=Kn();t.length&&(t.length===1?Nn(e,t[0]):vo(e,t))}}function Nn(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):W(function(){var n=Q("plain",e,{source:"tool",from:"plain",to:t.type});if(!M("before-convert",n))return!1;C(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return y(r,"ge-text-block")&&(L(r,"ge-plain-block"),J(r,".ge-tools-drawer").forEach(function(o){o.remove()})),M("after-convert",n),t.edit(e),!0})}function vo(e,t){var n=y(e.parentElement,"ge-text-block")?e.parentElement:null;n&&Un(T(n,".ge-tools-drawer"),t.map(function(r){return{label:r.label,title:m("tool.convert_type",{editor:r.label}),attributes:{"data-ge-content-type":r.type},choose:function(){Nn(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function Un(e,t,n,r){if(ae(),!!e){var o=Z(e,".ge-tools-drawer");o&&C(o,"ge-picker-open"),$=e.appendChild(C(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var u=xt(v("a",{class:"ge-size ge-size-flex"}),a.attributes||{});u.setAttribute("title",a.title||a.label),u.textContent=a.label,u.addEventListener("click",function(c){c.preventDefault(),c.stopPropagation(),ae(),a.choose()}),$.appendChild(u)}),Fn(r||e)}}function Fn(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){$&&!$.matches(":hover")&&ae()},400)},{once:!0})}function Hn(){var e={},t=[];return Object.keys(A).forEach(function(n){var r=A[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&ee("text-type:"+o.type,'the "'+n+'" plugin declares the text type "'+o.type+'", which the "'+e[o.type]+'" plugin already declares: ignored');return}e[o.type]=n,t.push(o)})}),t}function Kn(){return Hn().filter(function(e){return e.offered!==!1})}function ho(e){return Hn().some(function(t){return t.type===e})}function Wn(){ze(),fe()}function bo(){ze(),Pe(null),G.style.height=.8*document.documentElement.clientHeight+"px",G.value=d.innerHTML,Ae(G),ue(d),Le=!0,oe("onSourceOpen",G)}function Bn(){oe("onSourceClose",G),Le=!1,Ct(d,G.value),Ae(d),fe(),ue(G)}function Vn(){return[".column"].concat(bt("regions")).join(", ")}function wo(e){return!!e&&e!==d&&d.contains(e)&&be(e,Vn())}function Pe(e){if(e!==D){var t=D;t&&L(t,"ge-active-target"),D=e,e&&y(d,"ge-editing")&&C(e,"ge-active-target"),M("target-change",{canvas:d,target:e,from:t})}}function Vt(e,t){var n=Rn(e,{region:D,before:null},t);n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth"})}function fe(){F&&!ke(F.node)&&ve(),le&&le.home&&!ke(le.home)&&se(),Pr(!0),C(d,"ge-editing"),I(d,"ge-drag-drawer",l.drag_handle==="drawer"),ai();var e=Oi();Li(e),Pi(e),zi(),Go(),Yo(),No(),oe("onInit"),mi(),hi(),jr(S),qe(d),D&&!d.contains(D)?Pe(null):D&&C(D,"ge-active-target")}function ze(){ve(),L(d,"ge-editing ge-drag-drawer ge-dropping"),D&&L(D,"ge-active-target"),oe("onBeforeDeinit"),ae(),Wt(),se(),k(d,".ge-tools-drawer").forEach(function(e){e.remove()}),ut.clear(),ji(),oe("onDeinit"),$t(d),k(d,"[data-ge-row-cols]").forEach(function(e){e.removeAttribute("data-ge-row-cols")}),Uo(),ki(),yi(),Pr(!1)}function qn(){ze(),et(d);var e=d.innerHTML;return fe(),e}function yo(e){ze(),et(e);var t=e.outerHTML;return fe(),t}function Co(){return Cn(qn())}function Eo(){Le&&Bn(),ze(),D=null,Tn(),pr(),br(),x.remove(),G.remove(),Sn.abort(),Ot.delete(d),_n=!0}function xo(){var e=_o();Xt("grid",{},uo()),l.row_cols!==!1&&Xt("grid",{},di());var t=function(r){return!l.plugins||l.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(E.containers).forEach(function(r){t(r)&&(R[r]=E.containers[r](e))}),Object.keys(E.features).forEach(function(r){var o=E.features[r];n(r,o)&&(A[r]=o(e))}),Object.keys(E.utilities).forEach(function(r){t(r)&&(B[r]=E.utilities[r](e),(B[r].families||[]).forEach(function(o){Xt(r,B[r],o)}))}),Object.keys(A).forEach(function(r){var o=A[r].methods||{};Object.keys(o).forEach(function(a){Xe[a]=o[a]})}),(l.plugins||[]).forEach(function(r){R[r]||A[r]||B[r]||ee("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function oe(e,t){[R,A,B].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function _o(){return{canvas:d,settings:l,t:m,warn:N,containerId:Do,defaultRegion:Ro,createTool:P,createMoveTool:Ee,addSettingsTool:Qe,deleteNode:Ce,place:yt,createPaneControls:Ho,makeLabelEditable:Ko,labelIn:Wo,unwrapLabels:Bo,suspendToggles:ir,resumeToggles:ar,emit:M,payloadFor:Q,operate:W,kindOf:re,view:pn,viewTiers:function(){return qr(S).map(function(e){return e.key})},breakpoints:h.map(function(e){return e.key}),getUtility:Zn,setUtility:Jt,utilityField:Io,bareStyle:To,hostStyle:er,setHostStyle:zo,openDialog:hr,closeDialog:se,rowFromLayout:Ve,nodeHtml:yo,textReady:ro,attachPicker:sr,openPicker:Un,closePicker:ae,detailsOf:mr,drawerOf:ko,toolbarItems:function(e){return x?k(x,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function ko(e){if(y(e,"ge-content")){var t=e.parentElement;return y(t,"ge-text-block")?T(t,".ge-tools-drawer"):null}return T(e,".ge-tools-drawer")}var me={},Ao=".row, .column, .ge-content, .ge-element, [data-ge-container]",je="data-ge-preview",qt=!1;function Xt(e,t,n){var r=n.name||n.prefix;if(me[r]){N('the "'+e+'" plugin declares the utility "'+r+'", which the "'+me[r].plugin+'" plugin already declared: ignored');return}me[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function st(e,t){return me[e]?me[e].family:(ee("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function Xn(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!R[t]&&e.appliesTo.indexOf("container")!==-1}function Gn(e){return Object.keys(me).map(function(t){return me[t].family}).filter(function(t){return Xn(t,e)})}function Gt(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function ge(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(Gt(t,n,t.values[o]))!==-1)return t.values[o];return null}function Yn(e,t,n){for(var r=h.indexOf(n)-1;r>=0;r--){var o=ge(e,t,h[r]);if(o!==null)return{tier:h[r],value:o}}return null}function Jn(e,t,n){var r=ge(e,t,n);if(r!==null)return r;var o=Yn(e,t,n);return o?o.value:null}function Yt(e,t){return h.map(function(n){return{tier:n,value:ge(e,t,n)}}).filter(function(n){return n.value!==null})}function $n(e,t,n,r){t.values.forEach(function(o){L(e,Gt(t,n,o))}),r!==null&&C(e,Gt(t,n,r)),Et(e)}function Qn(e,t,n){return n===q?ge(e,t,h[0]):Jn(e,t,X(n))}function So(e,t,n,r){if(n!==q){var o=X(n);return ge(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],u=[];return Yt(e,t).forEach(function(c){c.tier!==h[0]&&(a.push({tier:c.tier,value:null}),u.push({breakpoint:c.tier.key,value:c.value}))}),ge(e,t,h[0])!==r&&a.unshift({tier:h[0],value:r}),a.length?{writes:a,cleared:u}:null}function Zn(e,t,n){e=de(e);var r=st(t,"getUtility");if(!r||!e)return null;var o=n===void 0?S:gn(n);return o===null?(N("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):Qn(e,r,o)}function Jt(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=de(e);var o=st(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?S:gn(r.view);if(a===null)return N("setUtility("+JSON.stringify(r.view)+"): no such layout mode"),!1;if(n=n==null||n===""?null:String(n),n!==null&&o.values.indexOf(n)===-1)return N("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var u=re(e);if(!Xn(o,u))return N('setUtility: "'+t+'" does not apply to a '+u),!1;if(o.write)return o.write(e,n,a,r.source||"api");var c=So(e,o,a,n);return c?W(function(){var f=Q(u,e,{family:t,breakpoint:a,tiers:c.writes.map(function(p){return p.tier.key}),from:Qn(e,o,a),to:n,cleared:c.cleared,source:r.source||"api"});return M("before-utility",f)?(c.writes.forEach(function(p){$n(e,o,p.tier,p.value)}),ie(e),M("after-utility",f),!0):(ie(e),!1)}):!1}function To(e,t,n){var r=st(t,"bareStyle");if(e=de(e),!r||!e)return null;var o=e.getAttribute("class");h.forEach(function(u){$n(e,r,u,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function ie(e){var t=mr(e);if(t){var n=O(t,".ge-classes");n&&(n.value=tn(e).join(" ")),J(t,".ge-utilities").forEach(function(r){Qt(r)})}nr(e),qe(e)}function Oo(e){return _e(e,Ao)}function qe(e){$t(e),S!==q&&Lo(e,X(S)),ui(e),oe("onRefresh",e)}function Lo(e,t){Oo(e).forEach(function(n){var r=re(n),o={};Gn(r).forEach(function(a){!a.preview||!Yt(n,a).length||Object.assign(o,a.preview(Jn(n,a,t),n,r))}),r==="column"&&Object.assign(o,si(n,t)),Object.keys(B).forEach(function(a){var u=B[a];u.preview&&Object.assign(o,u.preview(n,r,t.key))}),Object.keys(o).length&&Mo(n,o)})}function Mo(e,t){var n=e.style,r={};Object.keys(t).forEach(function(o){r[o]=[n.getPropertyValue(o),n.getPropertyPriority(o)],n.setProperty(o,String(t[o]),"important")}),e.setAttribute(je,JSON.stringify(r))}function $t(e){_e(e,"["+je+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(je))||{}}catch(o){}Object.keys(r).forEach(function(o){var a=r[o];a&&a[0]?n.setProperty(o,a[0],a[1]):n.removeProperty(o)}),t.removeAttribute(je),nt(t)})}function Po(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(je))||{}}catch(r){}return Object.keys(n).forEach(function(r){var o=n[r];o&&o[0]?t.style.setProperty(r,o[0],o[1]):t.style.removeProperty(r)}),t.style}function er(e,t){var n=Po(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function zo(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=er(e,t).priority),n!==""){var o=document.createElement("div").style;if(o.setProperty(t,n,r||""),o.getPropertyValue(t)==="")return!1}var a=e.hasAttribute(je);return a&&$t(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),nt(e),a&&qe(e),!0}function jo(e){var t=re(e),n=Gn(t).filter(function(u){return u.panel!==!1}).map(function(u){return tr(e,u)});if(Object.keys(B).forEach(function(u){var c=B[u],f=c.panel?c.panel(e,t):null;f&&n.push(f)}),!n.length)return null;var r=I(v("div",{class:"ge-utilities"}),"ge-open",qt);An.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){qt=!y(r,"ge-open"),gr().forEach(function(u){k(u,".ge-utilities").forEach(function(c){I(c,"ge-open",qt)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(u){a.appendChild(u)}),Qt(r),r}function tr(e,t){var n=v("label",{class:"ge-utility","data-ge-family":t.name});n.appendChild(v("span",{class:"ge-utility-label"},t.labelKey?m(t.labelKey):t.name));var r=n.appendChild(v("select",{class:"form-select form-select-sm"}));return r.addEventListener("change",function(){Jt(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function Io(e,t){var n=st(t,"utilityField");if(!n)return null;var r=tr(e,n);return Zt(r,e),ut.set(r,e),r}var ut=new Map;function nr(e){ut.forEach(function(t,n){if(!n.isConnected){ut.delete(n);return}e&&t!==e||Z(n,".ge-utilities")||Zt(n,t)})}function Qt(e){var t=An.get(e);J(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(it(S))})}),k(e,".ge-utility").forEach(function(n){Zt(n,t)})}function Zt(e,t){var n=me[e.getAttribute("data-ge-family")].family,r=T(e,"select"),o=n.choices?n.choices(t,re(t)):n.values,a,u,c="";if(r.innerHTML="",S===q){a=ge(t,n,h[0]),u=m("utility.default");var f=Yt(t,n).filter(function(Ue){return Ue.tier!==h[0]});f.length&&(c=m("utility.varies",{breakpoints:f.map(function(Ue){return Ue.tier.key}).join(", ")}))}else{var p=X(S),w=Yn(t,n,p);a=ge(t,n,p),u=w?m("utility.inherit",{value:rr(n,w.value),breakpoint:w.tier.key}):m("utility.default");var _=n.blank?n.blank(t,S):null;_&&a===null&&(u=_)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},u)),o.forEach(function(Ue){r.appendChild(v("option",{value:Ue},rr(n,Ue)))}),r.value=a===null?"":a;var xe=T(e,".ge-utility-note");xe.textContent=c,vn(xe,c!=="")}function rr(e,t){return e.label?e.label(t):t}var R={},A={},B={},Xe={},or=0;function Do(e){return or++,"ge-"+e+"-"+or+"-"+Math.random().toString(36).slice(2,6)}function Ro(){var e=Ne();return e.appendChild(he(z)),e}function Ie(e){return e?e.getAttribute("data-ge-container"):null}function No(){k(d,"[data-ge-container]").forEach(function(e){var t=Ie(e),n=R[t];if(!n){ee("container:"+t,'unknown container type "'+t+'"');return}C(e,"ge-container ge-container-"+t),n.mark(e),T(e,".ge-tools-drawer")||Fo(e,t,n)})}function Uo(){k(d,"[data-ge-container]").forEach(function(e){var t=R[Ie(e)];t&&t.unmark(e),L(e,"ge-container ge-container-"+Ie(e)),Et(e)})}function De(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function dt(e,t){(t||[]).forEach(function(n){P(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function Fo(e,t,n){var r=De(e,"ge-tools-drawer ge-container-drawer");Ee(r),Qe(r,e,l.container_classes),dt(r,l.container_tools),n.tools&&n.tools(r,e),P(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){Ce(t,e,m("confirm.delete_container"),function(o){ot(e,o)})}),n.addPane&&P(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});te(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function Ho(e,t,n,r,o){var a=De(e,"ge-tools-drawer ge-pane-drawer");return Ee(a),Qe(a,e,l.pane_classes),dt(a,n),P(a,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){Ce(t,e,r,function(u){o(u)})}),a}function ir(e){e&&_e(e,"[data-bs-toggle], [data-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-bs-"+n);r!==null&&(t.setAttribute("data-ge-bs-"+n,r),t.removeAttribute("data-bs-"+n))})})}function ar(e){e&&_e(e,"[data-ge-bs-toggle], [data-ge-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-ge-bs-"+n);r!==null&&(t.setAttribute("data-bs-"+n,r),t.removeAttribute("data-ge-bs-"+n))})})}function Ko(e){if(!Pt.has(e)){var t=Z(e,"[data-bs-toggle], [data-ge-bs-toggle]");Pt.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),ir(t),e.setAttribute("contenteditable","true"),e.focus(),window.getSelection().selectAllChildren(e)}),e.addEventListener("keydown",function(n){e.getAttribute("contenteditable")==="true"&&n.key==="Enter"&&(n.preventDefault(),e.blur())}),e.addEventListener("blur",function(){e.removeAttribute("contenteditable"),ar(t)})}}function Wo(e){var t=T(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function Bo(e){k(e,".ge-pane-label").forEach(function(t){Pt.delete(t),Tt(t)})}function lr(e,t){var n=he(t);return te("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Vo(e,t){!l.add_column.picker||!e||sr(e,function(){qo(e,t)})}function sr(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};ne(e,"mouseenter mousedown",function(){n||$||(n=window.setTimeout(function(){n=null,t()},l.add_column.delay))}),ne(e,"mouseleave mouseup",r)}function qo(e,t){ae();var n=sn(t,pe()),r=Z(e,".ge-tools-drawer");r&&C(r,"ge-picker-open"),$=e.appendChild(v("div",{class:"ge-size-picker"})),l.valid_col_sizes.forEach(function(o){var a=v("a",{class:"ge-size","data-ge-size":o,title:Xo(o)},K(o)?o:Se(h[0],o));I(a,"ge-size-tight",K(o)&&o>n),I(a,"ge-size-flex",!K(o)),a.addEventListener("click",function(u){u.preventDefault(),u.stopPropagation(),ae(),lr(t,o)}),$.appendChild(a)}),Fn(e)}function Xo(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function ae(){if(!$)return!1;var e=Z($,".ge-tools-drawer");return e&&L(e,"ge-picker-open"),$.remove(),$=null,!0}function Go(){k(d,".row").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=De(e,"ge-tools-drawer");Ee(t),Qe(t,e,l.row_classes),dt(t,l.row_tools),P(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){Ce("row",e,m("confirm.delete_row"),function(n){ot(e,n)})}),P(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){ae()||lr(e,Ze(e,pe())?null:l.add_column.size)}),Vo(T(t,".ge-add-column"),e)}})}function Yo(){k(d,".column").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=De(e,"ge-tools-drawer");Ee(t),l.resize.tools!==!1&&(P(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){Ft(e,n.shiftKey?$e(l.valid_col_sizes):ct(l.valid_col_sizes.filter(K),Ye(e),-1),"tool")}),P(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){Ft(e,n.shiftKey?Jo(e):ct(l.valid_col_sizes.filter(K),Ye(e),1),"tool")})),l.indent.tools!==!1&&(P(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){Ln(e,n.shiftKey?$e(l.valid_col_offsets):ct(l.valid_col_offsets,Je(e),-1),"tool")}),P(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){Ln(e,n.shiftKey?$o(e):ct(l.valid_col_offsets,Je(e),1),"tool")})),Qe(t,e,l.col_classes),dt(t,l.col_tools),P(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){Ce("column",e,m("confirm.delete_column"),function(n){Wr(e,400,n,!0)})}),P(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Ne();te("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function pe(){return S===q?h[h.length-1]:X(S)}function Ge(e){var t=pe();if(mt(e,t))return null;var n=an(e,t);return n===null?z:n}function Ye(e){var t=Ge(e);if(K(t))return t;var n=Math.round(rt(e)/ur(e.parentElement)*z);return Math.min(Math.max(n,1),z)}function ur(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function Je(e){return pt(e,pe())||0}function ct(e,t,n){var r=e.indexOf(t);return r===-1?e.reduce(function(o,a){return Math.abs(a-t)<Math.abs(o-t)?a:o},e[0]):e[Math.min(Math.max(r+n,0),e.length-1)]}function $e(e){return e.filter(K).reduce(function(t,n){return Math.min(t,n)},z)}function en(e){return e.filter(K).reduce(function(t,n){return Math.max(t,n)},0)}function Jo(e){var t=sn(e.parentElement,pe(),e)-Je(e);return Math.min(en(l.valid_col_sizes),Math.max(t,1))}function $o(e){var t=sn(e.parentElement,pe(),e)-Ye(e);return Math.min(en(l.valid_col_offsets),Math.max(t,0))}function Ee(e){return l.drag_handle==="drawer"?null:P(e,m("tool.move"),"ge-move","bi bi-arrows-move")}function P(e,t,n,r,o){var a=v("a",{title:t,class:n});return a.appendChild(v("i",{class:r})),e.appendChild(a),typeof o=="function"&&a.addEventListener("click",o),o&&typeof o=="object"&&Object.keys(o).forEach(function(u){ne(a,u,o[u])}),a}function tn(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!Qo(t)})}function Qo(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:h.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Zo(e,t){tn(e).forEach(function(n){L(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&C(e,n)}),Et(e)}function Qe(e,t,n){var r=ei(t,n||[]);kn.set(t,r),P(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){ni(t,r,this)});var o=re(t);return Object.keys(B).forEach(function(a){B[a].drawerTools&&B[a].drawerTools(e,t,o)}),Object.keys(A).forEach(function(a){A[a].drawerTools&&A[a].drawerTools(e,t,o)}),e.appendChild(r)}function ei(e,t){var n=v("div",{class:"ge-details"});n.appendChild(dr(m("panel.section_general")));var r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(p){var w=v("label",{class:"ge-field"});return w.appendChild(v("span",{class:"ge-field-label"},p)),r.appendChild(w)},a=v("input",{class:"ge-id form-control form-control-sm",placeholder:m("tool.id_placeholder"),title:m("tool.id_title")});a.value=e.getAttribute("id")||"",o(m("panel.id")).appendChild(a),a.addEventListener("change",function(){this.value===""?e.removeAttribute("id"):e.setAttribute("id",this.value)});var u=v("input",{class:"ge-classes form-control form-control-sm",placeholder:m("tool.classes_placeholder"),title:m("tool.classes_title")});u.value=tn(e).join(" "),o(m("panel.classes")).appendChild(u),u.addEventListener("change",function(){Zo(e,this.value),ie(e)});var c=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(p){var w=y(e,p.cssClass),_=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:p.title?p.title:m("tool.toggle_class",{label:p.label}),"aria-pressed":w?"true":"false"});_.innerHTML=p.label,I(_,"active",w),_.addEventListener("click",function(){I(_,"active"),_.setAttribute("aria-pressed",y(_,"active")?"true":"false"),I(e,p.cssClass,y(_,"active")),ie(e)}),c.appendChild(_)}),ti(e).forEach(function(p){n.appendChild(p)});var f=jo(e);return f&&n.appendChild(f),n}function dr(e){return v("h6",{class:"ge-section-title"},e)}function ti(e){var t=re(e),n=fr(),r=[];return[R,A,B].forEach(function(o){Object.keys(o).forEach(function(a){var u=o[a],c=u.panelSection?u.panelSection(e,t):null;if(!(!c||!c.body)){var f=v("div",{class:"ge-panel-section","data-ge-plugin":a});if(n==="offcanvas"||n==="modal")f.appendChild(dr(m(c.labelKey))),f.appendChild(c.body);else{var p=m(c.labelKey),w=f.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},p));ue(c.body),f.appendChild(c.body),w.addEventListener("click",function(){hr(c.titleKey?m(c.titleKey,{kind:wr(e)}):p,c.body,w)})}r.push(f)}})}),r}var cr=["offcanvas","popover","modal","inline"],H={},F=null,ft=new WeakMap;function fr(){return cr.indexOf(l.settings_panel)!==-1?l.settings_panel:(ee("settings_panel",'settings_panel "'+l.settings_panel+'" is not one of '+cr.join(", ")+": using offcanvas"),"offcanvas")}function mr(e){return e&&kn.get(e)||null}function gr(){return F&&F.mode!=="inline"?[d,F.details]:[d]}function ni(e,t,n){var r=fr();if(r==="inline"){vn(t);return}var o=F&&F.details===t;ve(),o||ri(r,e,t,n)}function ri(e,t,n,r){var o=oi(e),a=new AbortController;F={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},O(o,".ge-settings-title").textContent=m("panel.title",{kind:wr(t)}),O(o,".ge-settings-body").appendChild(n),Ae(n),C(t,"ge-settings-target");var u={signal:a.signal};if(document.addEventListener("keydown",function(f){f.key==="Escape"&&!le&&ve()},u),e==="offcanvas"){var c=window.innerWidth<576;I(o,"offcanvas-end",!c),I(o,"offcanvas-bottom",c),L(o,"hiding"),o.getBoundingClientRect(),C(o,"show")}else e==="popover"?(nn(o,r),ne(window,"scroll resize",function(){nn(o,r)},u),window.ResizeObserver&&(F.observer=new window.ResizeObserver(function(){nn(o,r)}),F.observer.observe(n)),ne(document,"mousedown touchstart",function(f){!le&&!o.contains(f.target)&&!r.contains(f.target)&&ve()},u)):rn(o,function(){F&&F.mode==="modal"&&ve()})}function ve(){se();var e=F;if(e){F=null;var t=H[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(L(t,"show"),C(t,"hiding"),window.setTimeout(function(){L(t,"hiding")},300)):e.mode==="popover"?ue(t):on(t),L(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),nt(e.details),e.home&&ke(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.details,e.next):e.home.appendChild(e.details):e.details.remove()}}function oi(e){if(H[e])return H[e];var t=function(){return v("button",{type:"button",class:"btn-close ge-settings-close","aria-label":m("panel.close")})},n;return e==="offcanvas"?(n=V('<div class="offcanvas offcanvas-end ge-settings-panel ge-settings-offcanvas" tabindex="-1" role="dialog"><div class="offcanvas-header"><h5 class="offcanvas-title ge-settings-title"></h5></div><div class="offcanvas-body ge-settings-body"></div></div>'),O(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=V('<div class="popover bs-popover-bottom ge-settings-panel ge-settings-popover" role="dialog"><div class="popover-arrow"></div><div class="popover-header"><span class="ge-settings-title"></span></div><div class="popover-body ge-settings-body"></div></div>'),O(n,".popover-header").appendChild(t()),ue(n)):(n=V('<div class="modal fade ge-settings-panel ge-settings-modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-settings-title"></h5></div><div class="modal-body ge-settings-body"></div><div class="modal-footer"></div></div></div></div>'),O(n,".modal-header").appendChild(t()),O(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),He(n,"click",".ge-settings-close",function(r){r.preventDefault(),ve()}),H[e]=document.body.appendChild(n),n}function pr(){ve(),Object.keys(H).forEach(function(e){e==="modal"?It(H[e]):H[e].remove()}),Object.keys(H).forEach(function(e){vr(H[e])}),H={}}function nn(e,t){if(ke(t)){Ae(e);var n=t.getBoundingClientRect(),r=8,o=T(e,".popover-body");o.style.removeProperty("max-height");var a=rt(e),u=kt(e),c=window.innerHeight-n.bottom-2*r,f=n.top-2*r,p=u<=c||c>=f,w=p?c:f;u>w&&(we(o,{"max-height":Math.max(120,w-(u-kt(o)))}),u=kt(e));var _=p?n.bottom+r:n.top-r-u,xe=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));I(e,"bs-popover-bottom",p),I(e,"bs-popover-top",!p),we(e,{top:_+window.pageYOffset,left:xe+window.pageXOffset}),we(T(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-xe-8,a-24))})}}function rn(e,t){var n=at(),r=ft.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},ft.set(e,r)),r.dismissed=t,!n){r.backdrop||(r.backdrop=v("div",{class:"modal-backdrop fade show ge-settings-backdrop"}),r.backdrop.addEventListener("click",function(){r.dismissed()}),document.body.appendChild(r.backdrop)),C(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var o=n.getOrCreateInstance(e);r.watched||(r.watched=!0,On(e),e.addEventListener("hide.bs.modal",function(){r.wanted==="open"&&(r.wanted="closed",r.busy=!0)}),e.addEventListener("shown.bs.modal",function(){r.busy=!1,r.wanted==="closed"&&on(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?rn(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function on(e){var t=at(),n=ft.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),L(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&y(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function vr(e){var t=ft.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var Y=null,le=null;function ii(){return Y||(Y=V('<div class="modal fade ge-dialog" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-dialog-title"></h5></div><div class="modal-body ge-dialog-body"></div><div class="modal-footer"></div></div></div></div>'),O(Y,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),O(Y,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),He(Y,"click",".ge-dialog-close",function(e){e.preventDefault(),se()}),document.body.appendChild(Y))}function hr(e,t,n){se();var r=ii(),o=new AbortController;le={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},O(r,".ge-dialog-title").textContent=e,O(r,".ge-dialog-body").appendChild(t),Ae(t),at()||document.addEventListener("keydown",function(a){a.key==="Escape"&&se()},{signal:o.signal}),Object.keys(H).forEach(function(a){C(H[a],"ge-under-dialog")}),rn(r,function(){se()})}function se(){var e=le;e&&(le=null,e.listening.abort(),on(Y),Object.keys(H).forEach(function(t){L(H[t],"ge-under-dialog")}),ue(e.body),e.home&&ke(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.body,e.next):e.home.appendChild(e.body):e.body.remove(),e.opener&&ke(e.opener)&&e.opener.focus&&e.opener.focus())}function br(){se(),Y&&(vr(Y),It(Y),Y=null)}function wr(e){var t=re(e);if(R[t]&&R[t].labelKey)return m(R[t].labelKey);switch(t){case"row":return m("panel.kind_row");case"column":return m("panel.kind_column");case"text":return m("panel.kind_text");case"element":return m("panel.kind_element");case"section":return m("panel.kind_section");case"tab":return m("panel.kind_tab");case"accordion-item":return m("panel.kind_accordion_item");default:return t}}function ai(){k(d,'.column, div[class*="col-"], div.col').forEach(function(e){C(e,"column"),!(ci(e).length||yr(e.parentElement))&&vt(e,h[0],z)})}function yr(e){return y(e,"row")&&h.some(function(t){return Ke.some(function(n){return y(e,yn(t,n))})})}function Ze(e,t){if(!y(e,"row"))return null;for(var n=h.indexOf(t);n>=0;n--)for(var r=0;r<Ke.length;r++)if(y(e,yn(h[n],Ke[r])))return{tier:n,value:Ke[r]};return null}function Cr(e,t){for(var n=h.indexOf(t);n>=0;n--){var r=Re(e,h[n]);if(r!==null)return{tier:n,size:r}}return null}function mt(e,t){var n=Ze(e.parentElement,t);if(!n)return null;var r=Cr(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function li(e){return e.value==="auto"?0:z/parseInt(e.value,10)}function si(e,t){var n=mt(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:yr(e.parentElement)&&!Cr(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function ui(e){_e(e,".row").forEach(function(t){var n=l.row_cols===!1?null:S===q?Ze(t,h[0])||null:Ze(t,X(S));n?t.setAttribute("data-ge-row-cols",Er(n.value)):t.removeAttribute("data-ge-row-cols")})}function Er(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function di(){return{name:"row-cols",prefix:"row-cols",values:Ke,appliesTo:["row"],labelKey:"utility.row_cols"}}function Re(e,t){var n=_r(e,t.colPrefix);return n!==null?n:y(e,Se(t,"auto"))?"auto":y(e,Se(t,"equal"))?"equal":null}function gt(e,t){return _r(e,t.offsetPrefix)}function an(e,t){return xr(e,t,Re)}function pt(e,t){return xr(e,t,gt)}function xr(e,t,n){for(var r=h.indexOf(t);r>=0;r--){var o=n(e,h[r]);if(o!==null)return o}return null}function _r(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function kr(e,t,n){var r=(e.getAttribute("class")||"").split(/\s+/).filter(function(o){return o!==""&&!new RegExp("^"+t+"\\d+$").test(o)});n!==null&&r.push(t+n),e.setAttribute("class",r.join(" "))}function vt(e,t,n){kr(e,t.colPrefix,null),wn.forEach(function(r){L(e,Se(t,r))}),n!=null&&C(e,Se(t,n))}function ln(e,t,n){kr(e,t.offsetPrefix,n||null)}function ci(e){return h.filter(function(t){return Re(e,t)!==null})}function sn(e,t,n){var r=0;return J(e,".column").forEach(function(o){if(!(n&&o===n)){var a=mt(o,t),u=a?li(a):an(o,t);r+=(K(u)?u:0)+(pt(o,t)||0)}}),z-r}function ht(e){var t=e.size===null||e.size===void 0?null:e.size,n=e.offset===null||e.offset===void 0?0:e.offset;return n=Math.min(Math.max(n,0),Vr),t===null||!K(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),z),t+n<=z?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:z-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function et(e){_e(e,".column").forEach(function(t){we(t,{width:"",height:"",left:"",top:""}),nt(t)})}function Ar(e){return"ge-"+e+"-"+Jr}function un(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(bt("blocks")).join(", ")}function bt(e){return Object.keys(A).map(function(t){return A[t][e]||null}).filter(function(t){return t!==null})}function dn(e,t){var n=!0;return Object.keys(A).forEach(function(r){var o=A[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function fi(){return l.drag_handle==="drawer"?".ge-tools-drawer > a:not(.ge-text-info):not(.ge-element-info), .ge-details, input, textarea, button, select, option":"input, textarea, button, select, option"}function wt(e,t){var n=Gr();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=l.drag_handle==="drawer",o=fi(),a=0;e.forEach(function(u){var c=t.group?{name:Ar(t.group)}:{name:Ar(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(c.put=function(f,p,w){return p.options.group.name===c.name&&t.accepts(f.el,w)}),Lt.push(n.create(u,Object.assign({group:c,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(f,p){return Z(f.target,o,u)?!0:!p||p.parentNode!==u},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:l.drag.animation,delay:l.drag.delay||l.drag.touch_delay,delayOnTouchOnly:!l.drag.delay,touchStartThreshold:l.drag.threshold,scroll:l.drag.scroll,onStart:gi,onEnd:vi},t.options||{})))})}}function mi(){if(!Gr()){ee("sortable_missing",m("error.sortable_missing"));return}wt(k(d,".row"),{draggable:".column",group:"column"}),wt([d].concat(k(d,".column")),{draggable:un(),group:"block",accepts:dn});var e=bt("regions");e.length&&wt(k(d,e.join(", ")),{draggable:">"+un(),group:"block",accepts:dn}),oe("onSortable",wt)}function gi(e){var t=e.item,n=Ht(t),r=Sr(t),o={from:n,canceled:!1};Mt.set(t,o),W(function(){var a=M("before-move",Q(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function Sr(e){var t=y(e,"ge-text-block")&&T(e,".ge-content")||e;return{kind:re(t),node:t}}function pi(e,t){var n=J(t.parent).filter(function(r){return r!==e&&!y(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function vi(e){var t=e.item,n=Mt.get(t),r=n?n.from:Ht(t);if(Mt.delete(t),n&&n.canceled){pi(t,r);return}var o=Ht(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=Z(t,"[data-ge-container]"),u=R[Ie(a)];u&&u.afterPaneMove&&u.afterPaneMove(a,t,r);var c=Sr(t);W(function(){M("after-move",Q(c.kind,c.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function hi(){l.resize.enabled&&k(d,".column").forEach(function(e){if(!T(e,".ge-resize-handle")){var t=T(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),bi().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",wi),e.appendChild(r)})}})}function bi(){return String(l.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function wi(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=rt(n);if(e.preventDefault(),!Ci(n))return;C(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function u(p){var w=p.pageX-o;return Math.max(1,a+(r?-w:w))}function c(p){n.style.width=u(p)+"px",Ei(n,u(p))}function f(p){t.removeEventListener("pointermove",c),hn(t,"pointerup pointercancel",f),L(n,"ge-resizing"),xi(n,u(p))}t.addEventListener("pointermove",c),ne(t,"pointerup pointercancel",f)}function yi(){k(d,".ge-resize-handle").forEach(function(e){e.remove()}),k(d,".ge-resize-size").forEach(function(e){e.remove()}),et(d)}function Tr(e,t){var n=Math.round(t/ur(e.parentElement)*z),r=Or(e),o=r?Ge(r):null,a=lt.get(e),u=a?a.units:Ye(e),c=r&&K(o)?u+o-$e(l.valid_col_sizes):z-Je(e);return Math.min(Math.max(n,$e(l.valid_col_sizes)),Math.max(c,$e(l.valid_col_sizes)),en(l.valid_col_sizes))}function Or(e){return l.resize.balance!=="next"?null:Nr(e,".column")[0]||null}function cn(e,t){var n=T(e,".ge-tools-drawer"),r=n?T(n,".ge-resize-size"):null;r&&(r.textContent=t)}function Lr(e){return(S===q?h[0].colPrefix:pe().colPrefix)+e}function Ci(e){var t=Ge(e),n=W(function(){return M("before-resize",Q("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:Ye(e)};return lt.set(e,r),cn(e,Lr(r.units)),!0}function Ei(e,t){cn(e,Lr(Tr(e,t)))}function xi(e,t){var n=lt.get(e),r=Tr(e,t);if(lt.delete(e),cn(e,""),et(e),!!n&&r!==n.units){var o=Rt(e,r);o&&W(function(){Nt(e,o),_i(e,r-n.units),ie(e),M("after-resize",Q("column",e,Ut({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function _i(e,t){var n=Or(e);if(!(!n||!t)){var r=Ge(n);if(K(r)){var o=Rt(n,r-t);o&&(Nt(n,o),ie(n))}}}function ki(){Lt.forEach(function(e){e.destroy()}),Lt=[]}function Ne(){return v("div",{class:"row"})}function yt(e,t,n){var r=null;if(Bi.forEach(function(c){r===null&&n&&n[c]!==void 0&&(r=c)}),r===null)return e;var o=de(n[r]);if(!o)return N(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,u=function(){return te(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):St(e,o)},{parent:a,source:n.source||"api"})};return We>0?(jt(u),e):u()}function Ai(e,t){var n=Ne();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(N("createRow: the layout is an array of column sizes, as in [8, 4], or { row_cols, columns }. Making an empty row instead."),e=[]),e&&!Array.isArray(e)&&(n=Ve(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(he(r))}),yt(n,"row",t)}function Si(e,t){t=t||{};var n=de(t.appendTo||t.prependTo||null);e===void 0&&n&&Ze(n,pe())?e=null:!K(e)&&wn.indexOf(e)===-1&&(N("createColumn: no column size given, using "+z),e=z);var r=he(e,t.offset);return t.content!==void 0&&r.appendChild(Ri(t.content)),yt(r,"column",t)}function Ti(e,t){t=t||{};var n=R[e];return n?yt(n.create(t),e,t):(N('createContainer: no such container type "'+e+'"'),null)}function Mr(e,t,n){e=de(e),n=n||{};var r=R[Ie(e)];if(!r||Ie(e)!==t)return N("this is not a "+t+" container"),null;var o=r.addPane(e,n);return te(r.paneKind,o,function(){},{parent:e,source:"api",container:e})}function fn(){var e={};return Object.keys(l).forEach(function(t){var n=l[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function he(e,t){var n=v("div",{class:"column"}),r=qr(S)[0],o=ht({size:e,offset:t||0,leading:"offset"});return vt(n,r,o.size===null?e:o.size),ln(n,r,o.offset),n}function Pr(e){if(!(!l.custom_filter||!l.custom_filter.length)){var t=typeof l.custom_filter=="string"||typeof l.custom_filter=="function"?[l.custom_filter]:l.custom_filter;Array.prototype.forEach.call(t,function(n){typeof n=="string"&&(n=window[n]),n(d,e)})}}function Oi(){var e=[".row","[data-ge-container]"];return Object.keys(A).forEach(function(t){var n=A[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function Li(e){k(d,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(y(t,"ge-rte-active")||!J(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=y(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],a=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(f){f.nodeType===1&&f.matches(e)?(o.push({text:a},{block:f}),a=[]):a.push(f)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var u=!1,c=r;o.forEach(function(f){var p;if(f.block)p=f.block;else if(Mi(f.text))u?(p=mn(n),f.text.forEach(function(w){p.appendChild(w)})):(f.text.forEach(function(w){t.appendChild(w)}),p=r,u=!0);else return;p!==c&&St(p,c),c=p}),u||r.remove()}})}function Mi(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function Pi(e){k(d,".column").forEach(function(t){var n=[];J(t).forEach(function(r){be(r,".ge-tools-drawer, .ge-resize-handle")||(be(r,".ge-content, .ge-text-block")||r.matches(e)?n=zr(n):n.push(r))}),zr(n)})}function zr(e){if(e.length){var t=St(mn(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function mn(e){var t=v("div",{class:"ge-content"});return e&&(C(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function zi(){k(d,".column > .ge-content").forEach(function(e){Hr(e,v("div",{class:"ge-text-block"}))}),k(d,".ge-text-block").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=T(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?ho(n)||Di(e,n):Ii(e)}})}function ji(){k(d,".ge-text-block").forEach(function(e){Tt(e)})}function Ii(e){var t=T(e,".ge-content"),n=De(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");C(e,"ge-plain-block"),Ee(n),Object.keys(A).forEach(function(r){A[r].plainTools&&A[r].plainTools(n,t)}),P(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){Ce("plain",t,m("confirm.delete_plain"),function(r){ot(e,function(){e.remove(),r()})})})}function Di(e,t){var n=T(e,".ge-content"),r=De(e,"ge-tools-drawer ge-text-drawer");Ee(r),P(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),P(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){Ce("text",n,m("confirm.delete_text"),function(o){ot(e,function(){e.remove(),o()})})})}function Ri(e){var t=Kn(),n=mn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):Ct(n,e),n}function jr(e){S=e,bn.forEach(function(t){I(d,"ge-layout-"+t,t===e)}),O(Oe,"button").textContent=m(it(e))}function gn(e){return bn.indexOf(e)===-1?null:e}function Ir(e){var t=gn(e);if(t===null){N("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=S;jr(t),t!==n&&(gr().forEach(function(r){k(r,".ge-utilities").forEach(function(o){Qt(o)})}),nr(null),qe(d),oe("onViewChange",t),M("view-change",{canvas:d,breakpoint:t,from:n,to:t}))}function pn(){return S}function Dr(e,t,n){return function(){return Xe[e]?Xe[e].apply(null,arguments):(ee("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}function Ni(e){if(!l.active_target){ee("active_target","setActiveTarget needs the active_target setting: without it, it does nothing");return}if(e==null){Pe(null);return}var t=de(e);if(!wo(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);N("setActiveTarget: "+n+" is not a column or a region of the canvas");return}Pe(t)}var Rr={getHtml:qn,getPlainHtml:Co,init:function(){jt(fe)},reset:function(){jt(Wn)},deinit:ze,destroy:Eo,changeView:Ir,getView:pn,createRow:Ai,createColumn:Si,createText:function(e,t){return Xe.createText?Xe.createText(e,t):(ee("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:Dr("createElement","elements","elements"),createSection:Dr("createSection","sections","sections"),createContainer:Ti,addTab:function(e,t){return Mr(e,"tabs",t)},addAccordionItem:function(e,t){return Mr(e,"accordion",t)},setLocale:$r,getUtility:Zn,setUtility:Jt,getActiveTarget:function(){return l.active_target?D:null},setActiveTarget:Ni};Object.keys(Rr).forEach(function(e){var t=!!(Br[e]&&Br[e].value);i[e]=function(){if(_n)return ee("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?d.innerHTML:e==="getPlainHtml"?Cn(d.innerHTML):t?null:i;var n=Rr[e].apply(i,arguments);return t?n:i}}),i.canvas=d,i.settings=fn(),Ot.set(d,i),xo(),i.settings=fn(),no(),fe(),E._created.forEach(function(e){e(i)})}E._created=[];E.containers={};E.features={};E.utilities={};E.texts={};E.t=En;E._plainHtml=Cn;E.Sortable=null;E.bootstrap=null;E.version="8.2.0";E.locales={en:{"tool.move":"Move","tool.settings":"Settings","tool.add_row":"Add row","tool.delete_text":"Remove text","tool.delete_plain":"Remove content","tool.convert_type":"Edit as {editor} text","text.no_editor":'No text editor "{type}" is loaded: this text can be moved and deleted, not edited',"tool.add_column":`Add column
|
|
10
10
|
(hold to choose the width)`,"tool.column_size":"{size} of 12","tool.column_equal":"Equal: shares what the row has left","tool.column_auto":"Auto: as wide as its content","tool.delete_row":"Remove row","tool.delete_column":"Remove col","tool.delete_container":"Remove container","tool.delete_pane":"Remove pane","tool.rename":"Double click to rename","tool.column_narrower":`Make column narrower
|
|
11
11
|
(hold shift for min)`,"tool.column_wider":`Make column wider
|
|
12
12
|
(hold shift for max)`,"tool.indent_decrease":`Decrease indent
|
|
13
13
|
(hold shift for none)`,"tool.indent_increase":`Increase indent
|
|
14
|
-
(hold shift for max)`,"tool.edit_source":"Edit Source Code","tool.preview":"Preview","panel.title":"{kind} settings","panel.close":"Close","panel.done":"Done","panel.id":"Id","panel.classes":"Classes","panel.section_general":"Id and classes","panel.kind_row":"Row","panel.kind_column":"Column","panel.kind_element":"Element","panel.kind_section":"Section","panel.kind_tab":"Tab","panel.kind_accordion_item":"Accordion item","tool.id_placeholder":"id","tool.id_title":"Set a unique identifier","tool.classes_placeholder":"classes","tool.classes_title":"Css classes, separated by spaces","tool.toggle_class":'Toggle "{label}" styling',"row.add":"Add row {layout}","row.add_row_cols":"Add a row of {columns} columns, {counts} per row","confirm.title":"Confirm","confirm.ok":"Delete","confirm.cancel":"Cancel","confirm.delete_row":"Delete row?","confirm.delete_column":"Delete column?","confirm.delete_text":"Delete this text?","confirm.delete_plain":"Delete this content?","confirm.delete_container":"Delete this container and everything in it?","view.all":"All sizes","view.xs":"Phone","view.sm":"Tablet","view.md":"Small desktop","view.lg":"Desktop","view.xl":"Large desktop","view.xxl":"Widescreen","utility.section":"Responsive: {view}","utility.col_width":"Width","utility.col_equal":"Equal","utility.col_auto":"Auto","utility.col_from_row":"From the row: {count}","utility.row_cols":"Columns per row","badge.row_cols":"{count} per row","badge.row_cols_auto":"As wide as their content","utility.default":"Default","utility.inherit":"Inherit: {value} (from {breakpoint})","utility.varies":"Changes at {breakpoints}; choosing here replaces that","error.sortable_missing":"SortableJS not available! Make sure you loaded the Sortable js file; dragging is off without it.","warning.already_editing":"This element already has an editor: that one is handed back, with the options it was made with.","warning.destroyed":"{method}() was called on an editor that has been destroyed, and does nothing.","warning.duplicate_build":"grideditor.js was loaded twice: the first GridEditor is kept.","warning.adapter_no_jquery":"grideditor.jquery.js needs jQuery 4, and there is no jQuery on the page: the jQuery API is not there.","error.tinymce_missing":"tinyMCE not available! Make sure you loaded the tinyMCE js file.","error.ckeditor_missing":"CKEditor 5 not available! Make sure you loaded its ckeditor5.umd.js file.","error.summernote_missing":"Summernote not available! Make sure you loaded jQuery and the Summernote js file."}};window.GridEditor?window.console&&window.console.warn&&window.console.warn("grid-editor: "+
|
|
14
|
+
(hold shift for max)`,"tool.edit_source":"Edit Source Code","tool.preview":"Preview","panel.title":"{kind} settings","panel.close":"Close","panel.done":"Done","panel.id":"Id","panel.classes":"Classes","panel.section_general":"Id and classes","panel.kind_row":"Row","panel.kind_column":"Column","panel.kind_element":"Element","panel.kind_section":"Section","panel.kind_tab":"Tab","panel.kind_accordion_item":"Accordion item","tool.id_placeholder":"id","tool.id_title":"Set a unique identifier","tool.classes_placeholder":"classes","tool.classes_title":"Css classes, separated by spaces","tool.toggle_class":'Toggle "{label}" styling',"row.add":"Add row {layout}","row.add_row_cols":"Add a row of {columns} columns, {counts} per row","confirm.title":"Confirm","confirm.ok":"Delete","confirm.cancel":"Cancel","confirm.delete_row":"Delete row?","confirm.delete_column":"Delete column?","confirm.delete_text":"Delete this text?","confirm.delete_plain":"Delete this content?","confirm.delete_container":"Delete this container and everything in it?","view.all":"All sizes","view.xs":"Phone","view.sm":"Tablet","view.md":"Small desktop","view.lg":"Desktop","view.xl":"Large desktop","view.xxl":"Widescreen","utility.section":"Responsive: {view}","utility.col_width":"Width","utility.col_equal":"Equal","utility.col_auto":"Auto","utility.col_from_row":"From the row: {count}","utility.row_cols":"Columns per row","badge.row_cols":"{count} per row","badge.row_cols_auto":"As wide as their content","utility.default":"Default","utility.inherit":"Inherit: {value} (from {breakpoint})","utility.varies":"Changes at {breakpoints}; choosing here replaces that","error.sortable_missing":"SortableJS not available! Make sure you loaded the Sortable js file; dragging is off without it.","warning.already_editing":"This element already has an editor: that one is handed back, with the options it was made with.","warning.destroyed":"{method}() was called on an editor that has been destroyed, and does nothing.","warning.duplicate_build":"grideditor.js was loaded twice: the first GridEditor is kept.","warning.adapter_no_jquery":"grideditor.jquery.js needs jQuery 4, and there is no jQuery on the page: the jQuery API is not there.","error.tinymce_missing":"tinyMCE not available! Make sure you loaded the tinyMCE js file.","error.ckeditor_missing":"CKEditor 5 not available! Make sure you loaded its ckeditor5.umd.js file.","error.summernote_missing":"Summernote not available! Make sure you loaded jQuery and the Summernote js file."}};window.GridEditor?window.console&&window.console.warn&&window.console.warn("grid-editor: "+E.t({locale:"en"},"warning.duplicate_build")):window.GridEditor=E;})();
|
package/dist/grideditor.css
CHANGED
|
@@ -439,6 +439,15 @@
|
|
|
439
439
|
outline: 2px solid var(--bs-primary, #0d6efd);
|
|
440
440
|
outline-offset: 1px;
|
|
441
441
|
}
|
|
442
|
+
/* Where the toolbar's buttons add, with active_target. A node that is both
|
|
443
|
+
shows both: this one a little further out */
|
|
444
|
+
.ge-canvas.ge-editing .ge-active-target {
|
|
445
|
+
outline: 2px dashed var(--bs-success, #198754);
|
|
446
|
+
outline-offset: -2px;
|
|
447
|
+
}
|
|
448
|
+
.ge-canvas.ge-editing .ge-active-target.ge-settings-target {
|
|
449
|
+
box-shadow: 0 0 0 4px var(--bs-success, #198754);
|
|
450
|
+
}
|
|
442
451
|
/* While editing */
|
|
443
452
|
.ge-canvas.ge-editing {
|
|
444
453
|
/* Content area */
|
package/dist/grideditor.d.ts
CHANGED
|
@@ -107,6 +107,8 @@ export interface GridEditorOptions {
|
|
|
107
107
|
text_tools?: HostTool[];
|
|
108
108
|
drag_handle?: 'tool' | 'drawer';
|
|
109
109
|
toolbar_drag?: 'auto' | boolean;
|
|
110
|
+
/** A click in a column or a section makes it where the toolbar's buttons add. Default false. */
|
|
111
|
+
active_target?: boolean;
|
|
110
112
|
/** The plugins to use, of any kind; null is every one loaded. */
|
|
111
113
|
plugins?: string[] | null;
|
|
112
114
|
/** The text editors offered, in order. */
|
|
@@ -124,7 +126,10 @@ export interface GridEditorOptions {
|
|
|
124
126
|
add_column?: { size?: ColumnSize | null; picker?: boolean; delay?: number };
|
|
125
127
|
layout_modes?: View[];
|
|
126
128
|
default_view?: View;
|
|
127
|
-
|
|
129
|
+
/** enabled is the handle on the column's edge, tools the narrower and wider tools in its drawer. */
|
|
130
|
+
resize?: { enabled?: boolean; tools?: boolean; handles?: string; balance?: 'next' | false };
|
|
131
|
+
/** tools is the indent tools in a column's drawer. */
|
|
132
|
+
indent?: { tools?: boolean };
|
|
128
133
|
/** A textarea whose html the canvas starts with. */
|
|
129
134
|
source_textarea?: Target | '';
|
|
130
135
|
edit_source?: boolean;
|
|
@@ -215,6 +220,13 @@ export interface ViewChangePayload {
|
|
|
215
220
|
to: View;
|
|
216
221
|
}
|
|
217
222
|
|
|
223
|
+
/** The active target changed: the column or region the toolbar adds to, or null for the canvas. */
|
|
224
|
+
export interface TargetChangePayload {
|
|
225
|
+
canvas: HTMLElement;
|
|
226
|
+
target: HTMLElement | null;
|
|
227
|
+
from: HTMLElement | null;
|
|
228
|
+
}
|
|
229
|
+
|
|
218
230
|
/** The events, by name, with their payloads. Adding fires a specific name and the generic one. */
|
|
219
231
|
export interface GridEditorEventMap {
|
|
220
232
|
'grideditor:before-add': Payload;
|
|
@@ -252,6 +264,7 @@ export interface GridEditorEventMap {
|
|
|
252
264
|
'grideditor:after-copy': Payload;
|
|
253
265
|
'grideditor:popup-orphan': PopupOrphanPayload;
|
|
254
266
|
'grideditor:view-change': ViewChangePayload;
|
|
267
|
+
'grideditor:target-change': TargetChangePayload;
|
|
255
268
|
}
|
|
256
269
|
|
|
257
270
|
/** An event the editor dispatches on its canvas: a CustomEvent whose detail is the payload. */
|
|
@@ -340,6 +353,10 @@ export declare class GridEditor {
|
|
|
340
353
|
/** Take the editor off: the markup stays, everything else goes. */
|
|
341
354
|
destroy(): this;
|
|
342
355
|
changeView(view: View): this;
|
|
356
|
+
/** The column or region the toolbar adds to, or null. Null without active_target. */
|
|
357
|
+
getActiveTarget(): HTMLElement | null;
|
|
358
|
+
/** Make a column or region, or the first a selector matches, where the toolbar adds; null for none. */
|
|
359
|
+
setActiveTarget(target: HTMLElement | string | null): this;
|
|
343
360
|
getView(): View;
|
|
344
361
|
setLocale(code: string): this;
|
|
345
362
|
createRow(layout?: RowLayout, options?: Placement): HTMLElement | null;
|