@themarioga/grid-editor 8.8.0 → 8.8.1

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.
@@ -1,4 +1,4 @@
1
- (()=>{function _(i,u){return i?Array.prototype.slice.call(i.querySelectorAll(u)):[]}function T(i,u){return i?i.querySelector(u):null}function xe(i,u){if(!i)return[];var p=_(i,u);return i.nodeType===1&&i.matches(u)&&p.unshift(i),p}function V(i,u){return i?Array.prototype.filter.call(i.children,function(p){return!u||p.matches(u)}):[]}function M(i,u){return V(i,u)[0]||null}function J(i,u,p){var s=i&&i.nodeType===1?i.closest(u):null;return s&&p&&s!==p&&!p.contains(s)?null:s}function _e(i,u){return!!i&&i.nodeType===1&&i.matches(u)}function ze(i){return!!i&&document.documentElement.contains(i)}function ao(i,u){for(var p=[],s=i.nextElementSibling;s;s=s.nextElementSibling)(!u||s.matches(u))&&p.push(s);return p}function lo(i,u){for(var p=[],s=i.parentElement;s&&s!==u;s=s.parentElement)p.push(s);return p}function ba(i){var u=document.createElement("template");return u.innerHTML=i,Array.prototype.slice.call(u.content.childNodes)}function G(i){for(var u=ba(i.trim()),p=0;p<u.length;p++)if(u[p].nodeType===1)return u[p];return null}function v(i,u,p){var s=document.createElement(i);return Object.keys(u||{}).forEach(function(f){var x=u[f];x!=null&&x!==!1&&s.setAttribute(f,x)}),p!=null&&(s.textContent=p),s}function it(i,u){return i.innerHTML=u==null?"":String(u),i}function C(i,u){return Be(u).forEach(function(p){i.classList.add(p)}),i}function O(i,u){return Be(u).forEach(function(p){i.classList.remove(p)}),i}function z(i,u,p){return Be(u).forEach(function(s){p===void 0?i.classList.toggle(s):i.classList.toggle(s,!!p)}),i}function w(i,u){return!!i&&i.nodeType===1&&i.classList.contains(u)}function Be(i){return String(i||"").split(/\s+/).filter(Boolean)}function at(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function lt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function zt(i,u){return Object.keys(u).forEach(function(p){var s=u[p];s==null?i.removeAttribute(p):i.setAttribute(p,s)}),i}function ke(i,u){return Object.keys(u).forEach(function(p){var s=u[p];typeof s=="number"&&!wa[p]&&(s=s+"px"),i.style.setProperty(p,s==null?"":String(s))}),i}var wa={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},ot={};function ya(i){var u=i.nodeName;if(!ot[u]){var p=document.body.appendChild(document.createElement(u));ot[u]=getComputedStyle(p).display,p.remove(),ot[u]==="none"&&(ot[u]="block")}return ot[u]}function je(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=ya(i)),i}function pe(i){return i.style.display="none",i}function Rn(i,u){return u===void 0&&(u=!jt(i)),u?je(i):pe(i)}function jt(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function st(i){return i.getBoundingClientRect().width}function Rt(i){return i.getBoundingClientRect().height}function so(i){var u=getComputedStyle(i);return i.clientHeight-parseFloat(u.paddingTop)-parseFloat(u.paddingBottom)}function Dt(i){var u=i.getBoundingClientRect();return{top:u.top+window.pageYOffset,left:u.left+window.pageXOffset}}function It(i,u){return u.parentNode.insertBefore(i,u.nextSibling),i}function Nt(i){for(var u=i.parentNode;i.firstChild;)u.insertBefore(i.firstChild,i);i.remove()}function uo(i,u){return i.parentNode.insertBefore(u,i),u.appendChild(i),u}function Ve(i,u,p,s,f){var x=function(b){var R=J(b.target,p,i);if(R&&i.contains(R))return s.call(R,b)};return Be(u).forEach(function(b){i.addEventListener(b,x,f)}),x}function ie(i,u,p,s){return Be(u).forEach(function(f){i.addEventListener(f,p,s)}),p}function Dn(i,u,p,s){Be(u).forEach(function(f){i.removeEventListener(f,p,s)})}var Ca=400;function co(i,u,p,s){p=p===void 0?Ca:p;var f=function(){pe(i),s&&s()};if(!jt(i)||!i.animate||p<=0){window.setTimeout(f,0);return}var x=i.animate(u(getComputedStyle(i)),{duration:p,easing:"ease-in-out"}),b=!1,R=function(){b||(b=!0,f())};x.onfinish=R,x.oncancel=R}function ut(i,u,p){typeof u=="function"&&(p=u,u=void 0),i.style.overflow="hidden",co(i,function(s){return[{height:s.height,paddingTop:s.paddingTop,paddingBottom:s.paddingBottom,marginTop:s.marginTop,marginBottom:s.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},u,function(){i.style.removeProperty("overflow"),p&&p()})}function fo(i,u,p,s){i.style.overflow="hidden",co(i,function(f){var x={opacity:f.opacity,height:f.height},b={opacity:0,height:"0px"};return s&&(x.width=f.width,b.width="0px"),[x,b]},u,function(){i.style.removeProperty("overflow"),p&&p()})}var mo={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},addPane:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0},getActiveTarget:{value:!0},setActiveTarget:{}},xa=["appendTo","prependTo","insertAfter","insertBefore"],y=[{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"}],$="all",_a="view.all",In=[$].concat(y.map(function(i){return i.key})),F=12,go=11,Nn=["equal","auto"],Ge=["1","2","3","4","5","6","auto"];function Fn(i,u){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+u}function q(i){return typeof i=="number"}function Re(i,u){return u==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+u}function Q(i){for(var u=0;u<y.length;u++)if(y[u].key===i)return y[u];return null}function po(i){if(i===$)return[y[0]];var u=Q(i);return u?[u]:[]}function dt(i){var u=Q(i);return u?u.labelKey:_a}var De={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1,types:[]},resize:{enabled:!0,tools:!0,handles:"e",balance:"next"},indent:{tools:!0},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},vo={},ka=0,Ft=new WeakMap;function Un(i,u,p){var s=k.locales,f=s[i.locale]||{},x=i.locale_strings||{},b=x[u];return b===void 0&&(b=f[u]),b===void 0&&(b=s.en[u]),b===void 0&&(Ta("locale:"+u,'no string for "'+u+'" in any locale, showing the key'),b=u),b.replace(/\{(\w+)\}/g,function(R,le){return p&&p[le]!==void 0?p[le]:R})}function Aa(i,u){var p=k.locales;return(i.locale_strings||{})[u]!==void 0||(p[i.locale]||{})[u]!==void 0||p.en[u]!==void 0}function U(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Ta(i,u){vo[i]||(vo[i]=!0,U(u))}function Oa(i,u){return Un({locale:"en"},i,u)}function Sa(i){if(typeof i=="string"){var u=document.querySelector(i);if(!u)throw new TypeError("grid-editor: no element matches "+JSON.stringify(i));return u}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 ae(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function ho(){return k.Sortable||window.Sortable||null}function ct(){var i=k.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function Hn(i){var u=document.implementation.createHTMLDocument("").body;u.innerHTML=i;var p=[];return _(u,"*").forEach(function(s){var f=!1;Array.prototype.slice.call(s.attributes).forEach(function(R){R.name.indexOf("data-ge-")===0&&(s.removeAttribute(R.name),f=!0)});var x=(s.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=x.filter(function(R){return R!=="column"&&R.indexOf("ge-")!==0});b.length!==x.length&&(f=!0),b.length?s.setAttribute("class",b.join(" ")):s.removeAttribute("class"),f&&s.tagName==="DIV"&&!s.attributes.length&&p.push(s)}),p.forEach(function(s){Nt(s)}),u.innerHTML}function k(i,u){var p=Sa(i),s=Ft.get(p);if(s)return bo.has(p)||(bo.add(p),U(Oa("warning.already_editing"))),s;if(!(this instanceof k))return new k(p,u);La(this,p,u||{})}var bo=new WeakSet;k.create=function(i,u){return new k(i,u)};k.get=function(i){var u=ae(i);return u&&Ft.get(u)||null};function La(i,u,p){var s=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",toolbar_overflow:"menu",drawer_overflow:"menu",toolbar_groups:!1,active_target:!1,element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:De.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:De.add_column,layout_modes:In.slice(),default_view:$,resize:De.resize,indent:De.indent,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:De.drag},p);Object.keys(De).forEach(function(e){s[e]=Object.assign({},De[e],s[e])});var f,x,b,R,le,Ie,Z,P=s.default_view,N=null,te=null,ve=!1,Ne=null,H=null,ft=null,Ht=function(){},Ut=function(){},se=[],mt={},Wt=null,Wn={},gt=[],wo=++ka,pt=!1,Kn=new WeakMap,Kt=new WeakMap,vt=new WeakMap,Bn=new WeakMap,Bt=new WeakSet,Vt=new AbortController;f=C(u,"ge-canvas");function X(e,t){Wn[e]||(Wn[e]=!0,U(t))}function m(e,t){return Un(s,e,t)}function yo(e){s.locale=e,i.settings=Sn(),Gn(),Ir(),Hr(),nn(),tn(),sr()}var qe=0,Gt=[];function ne(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:f,breakpoint:zn(),source:"api"},n||{})}function D(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 l=new CustomEvent("grideditor:"+a,{detail:t,bubbles:!0,cancelable:!0});f.dispatchEvent(l)||(o=!0)}),n.forEach(function(a){var l=s.callbacks[a.replace(/-/g,"_")];typeof l=="function"&&l(t)===!1&&(o=!0)}),!o}function Y(e){qe++;try{return e()}finally{if(qe--,qe===0)for(;Gt.length;)Gt.shift()()}}function qt(e){if(qe===0){e();return}Gt.push(e)}function re(e,t,n,r){var o=Co(e);return Y(function(){var a=ne(e,t,r);return D("before-add-"+o,a)?(n(),de(),D("after-add-"+o,a),t):null})}function Co(e){return k.containers[e]?"container":e}function Eo(e,t){if(!s.confirm_delete){t();return}Vn(e,{danger:!0},function(n){n&&t()})}function Vn(e,t,n){t=t||{};var r=ct();if(!r){n(window.confirm(e));return}var o=xo(),a=!1,l=T(o,".ge-confirm-ok");Ae&&Ae(null);var d=function(c){Ae===d&&(Ae=null,n(c))};Ae=d,T(o,".modal-title").textContent=t.title||m("confirm.title"),T(o,".ge-confirm-cancel").textContent=t.cancel||m("confirm.cancel"),l.textContent=t.ok||m("confirm.ok"),z(l,"btn-danger",!!t.danger),z(l,"btn-primary",!t.danger),T(o,".ge-confirm-message").textContent=e,l.onclick=function(){a=!0,r.getInstance(o).hide()},he.hidden=function(){d(a)},he.shown=function(){l.focus()},r.getOrCreateInstance(o).show()}var he={hidden:null,shown:null},Ae=null;function xo(){if(N)return N;N=G('<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(N),T(N,".modal-title").textContent=m("confirm.title"),T(N,".btn-close").setAttribute("aria-label",m("confirm.cancel")),T(N,".ge-confirm-cancel").textContent=m("confirm.cancel"),T(N,".ge-confirm-ok").textContent=m("confirm.ok"),qn(N);var e=N;return N.addEventListener("hidden.bs.modal",function(){e===N&&he.hidden&&he.hidden()}),N.addEventListener("shown.bs.modal",function(){e===N&&he.shown&&he.shown()}),N}function Gn(){N&&(he.hidden=null,he.shown=null,Xt(N),N=null,Ae&&Ae(null))}function Xt(e){var t=ct(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!Yt.get(e)&&!w(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 Yt=new WeakMap;function qn(e){ie(e,"show.bs.modal hide.bs.modal",function(){Yt.set(e,!0)}),ie(e,"shown.bs.modal hidden.bs.modal",function(){Yt.set(e,!1)})}function Te(e,t,n,r){Y(function(){var o=ne(e,t,{source:"tool"});D("before-delete",o)&&Eo(n,function(){Y(function(){r(function(){t.remove(),Y(function(){de(),D("after-delete",o)})})})})})}function Jt(e,t,n){if(n=n||P,n!==$){var r=Q(n),o=Ot({size:t,offset:At(e,r)||0});return o.refused||Ue(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=y.some(function(g){return Ot({size:t,offset:At(e,g)||0}).refused});if(a)return null;var l=y[0],d=[],c=[];return y.slice(1).forEach(function(g){var h=Ue(e,g);h!==null&&(d.push({tier:g,size:null}),c.push({breakpoint:g.key,value:h}))}),Ue(e,l)!==t&&d.unshift({tier:l,size:t}),d.length?{writes:d,cleared:c,size:t}:null}function $t(e,t){t.writes.forEach(function(n){Tt(e,n.tier,n.size)}),We(e)}function Qt(e,t){return t&&(e.cleared=t),e}function Zt(e,t,n,r){r=r||P;var o=Qe(e),a=Jt(e,t,r);return a?Y(function(){var l=ne("column",e,Qt({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return D("before-resize",l)?($t(e,a),ce(e),D("after-resize",l),!0):(ce(e),!1)}):!1}function Xn(e,t,n){var r=P===$,o=r?y[0]:Q(P),a=et(e);t=Math.min(Math.max(t,0),go);var l=r?y.slice(1).filter(function(d){return kt(e,d)!==null}):[];return(kt(e,o)||0)===t&&!l.length?!1:Y(function(){var d=ne("column",e,Qt({source:n,from:a,to:t},r?l.map(function(c){return{breakpoint:c.key,value:kt(e,c)}}):null));return D("before-indent",d)?(xn(e,o,t),l.forEach(function(c){xn(e,c,0)}),(r?y:[o]).forEach(function(c){var g=En(e,c);if(q(g)){var h=Ot({size:g,offset:t,leading:"offset"});h.size!==g&&Tt(e,c,h.size)}}),ce(e),D("after-indent",d),!0):!1})}function en(e){var t=e.parentElement;return{parent:t,index:V(t).filter(function(n){return!w(n,"ge-tools-drawer")}).indexOf(e)}}function ue(e){var t=null;if(Object.keys(L).forEach(function(r){var o=L[r];!t&&o.kindOf&&(t=o.kindOf(e))}),t)return t;if(e.getAttribute("data-ge-container"))return e.getAttribute("data-ge-container");var n=null;return Object.keys(S).forEach(function(r){var o=S[r];!n&&o.paneClass&&w(e,o.paneClass)&&(n=o.paneKind)}),n||(w(e,"ge-tab")?"tab":w(e,"ge-accordion-item")?"accordion-item":w(e,"row")?"row":w(e,"column")?"column":w(e,"ge-element")?"element":(w(e,"ge-text-block")&&(e=M(e,".ge-content")||e),w(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(s.source_textarea){var Xe=ae(s.source_textarea).value,Yn=v("div");Yn.innerHTML=Xe,Xe.length>0&&!Yn.querySelector(".row")&&(Xe='<div class="row"><div class="col-lg-12">'+Xe+"</div></div>"),it(u,Xe)}if(u.children.length&&!u.querySelector("div.row")){var _o=V(u),Jn=G('<div class="row"><div class="col-lg-12"></div></div>');u.appendChild(Jn),_o.forEach(function(e){Jn.firstChild.appendChild(e)})}function ko(){Z=v("textarea",{class:"ge-html-output"}),f.parentNode.insertBefore(Z,f),tn(),Si();var e={signal:Vt.signal};if(window.addEventListener("scroll",nr,e),Ve(f,"click",".ge-content",Ko,e),Ve(f,"click",".ge-popup-trigger, [data-ge-popup-target]",function(n){w(f,"ge-editing")&&n.preventDefault()},e),s.active_target){var t=null;f.addEventListener("pointerdown",function(n){t={x:n.clientX,y:n.clientY}},e),f.addEventListener("click",function(n){var r=t;if(t=null,!!w(f,"ge-editing")&&!(r&&Math.abs(n.clientX-r.x)+Math.abs(n.clientY-r.y)>s.drag.threshold)){var o=J(n.target,ur());if(o&&o===H&&(n.target===o||n.target===M(o,".ge-tools-drawer"))){Oe(null);return}Oe(o&&o!==f&&f.contains(o)?o:null)}},e),document.addEventListener("keydown",function(n){if(!(n.key!=="Escape"||!H||K||me)){var r=document.activeElement;r&&(_e(r,"input, textarea, select")||r.isContentEditable)||Oe(null)}},e)}}function Ao(e){!_e(e,".ge-content")||!f.contains(e)||(oe("onContentReady",e),$e(e))}function tn(){x=v("div",{class:"ge-mainControls"}),Z.parentNode.insertBefore(x,Z),b=x.appendChild(v("div",{class:"ge-wrapper ge-top"}));var e=s.toolbar_overflow!=="wrap",t=b;e&&(C(b,"ge-toolbar-menu"),t=b.appendChild(v("div",{class:"ge-toolbar-start"}))),se=[],R=t.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),le=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),s.new_row_layouts.forEach(function(c){var g=!Array.isArray(c),h=v("a",{class:"btn btn-sm btn-light",title:g?m("row.add_row_cols",{columns:c.columns,counts:Uo(c.row_cols)}):m("row.add",{layout:c.join("-")}),"data-ge-toolbar":"row","data-ge-layout":g?JSON.stringify(c):c.join(",")});h.addEventListener("click",function(){if(H){sn(h,"tool");return}var j=Ye(c),Pt=re("row",j,function(){f.appendChild(j)},{parent:f,source:"tool"});Pt&&j.scrollIntoView&&j.scrollIntoView({behavior:"smooth"})}),R.appendChild(h),se.push({button:h,home:R,group:"rows"}),h.appendChild(G('<i class="bi bi-plus"></i>'));var E=g?Wo(c):c,A='<div class="row ge-row-icon">';E.forEach(function(j){A+='<div class="column '+Re(y[0],j)+'"></div>'}),A+="</div>",h.appendChild(G(A))}),t.appendChild(le),Object.keys(S).forEach(function(c){var g=S[c],h=Qn(v("a",{class:"btn btn-sm btn-light ge-add-container"}),m(g.labelKey),g.iconClass);zt(h,{"data-ge-toolbar":"container","data-ge-container-type":c}),h.addEventListener("click",function(){if(H){sn(h,"tool");return}var E=Ke(),A=E.appendChild(Ee(F)),j=A.appendChild(g.create({}));re(c,j,function(){f.appendChild(E)},{parent:f,source:"tool"})}),le.appendChild(h),se.push({button:h,home:le,group:$n(g.group)||"content"})});var n=[];mt={},Object.keys(L).forEach(function(c){mt[c]=Mo(L[c]),mt[c].forEach(function(g,h){var E=jo(c,g,h);g.align==="end"?n.push(E):(le.appendChild(E),se.push({button:E,home:le,group:$n(g.group)||c}))})}),Ie=G('<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>'),Ve(Ie,"click","a",function(){ro(this.getAttribute("data-ge-view"))}),b.appendChild(Ie),s.layout_modes.forEach(function(c){T(Ie,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":c,title:m(dt(c))},m(dt(c))))}),T(Ie,"button").textContent=m(dt(P));var r=b.appendChild(v("div",{class:"btn-group pull-right"}));if(s.edit_source){var o=G('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');o.setAttribute("title",m("tool.edit_source")),z(o,"active btn-danger",ve),o.addEventListener("click",function(){ve?ln():Go(),z(o,"active btn-danger",ve)}),r.appendChild(o)}var a=G('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),l=function(){w(a,"active")||C(f,"ge-editing")};if(a.setAttribute("title",m("tool.preview")),a.addEventListener("mouseenter",function(){O(f,"ge-editing")}),a.addEventListener("click",function(){z(a,"active btn-danger"),l()}),a.addEventListener("mouseleave",l),r.appendChild(a),n.length){var d=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));n.forEach(function(c){d.appendChild(c)})}s.toolbar_groups&&Oo(t),e&&zo(t),Do()}var To=[{name:"rows",labelKey:"group.rows"},{name:"content",labelKey:"group.content"},{name:"elements",labelKey:"group.elements"}];function $n(e){return typeof e=="string"&&e.trim()!==""?e:null}function Oo(e){var t=To.map(function(a){return a.name});if(se.forEach(function(a){t.indexOf(a.group)<0&&t.push(a.group)}),t=t.filter(function(a){return se.some(function(l){return l.group===a})}),t.length<2)return;var n=v("div",{class:"ge-toolbar-groups btn-group",role:"tablist","aria-label":m("group.select")});e.insertBefore(n,e.firstChild);var r=x.appendChild(v("div",{class:"ge-toolbar-stash",hidden:"hidden"}));t.forEach(function(a){var l=n.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary",role:"tab","data-ge-group":a},So(a)));l.addEventListener("click",function(){o(a)})}),o(t.indexOf(Wt)>=0?Wt:t[0]);function o(a){Wt=a,se.forEach(function(l){(l.group===a?l.home:r).appendChild(l.button)}),V(n).forEach(function(l){var d=l.getAttribute("data-ge-group")===a;z(l,"active",d),l.setAttribute("aria-selected",d?"true":"false")}),Ut()}}function So(e){var t="group."+e;if(Aa(s,t))return m(t);var n=se.filter(function(r){return r.group===e})[0];return n.button.getAttribute("title")||e}function Lo(){return se.filter(function(e){return!J(e.button,".ge-toolbar-stash")})}function Mo(e){var t=typeof e.toolbar=="function"?e.toolbar():e.toolbar;return Array.isArray(t)?t:[]}function Po(){if(!(!x||pt)){var e=!!T(x,".gm-preview.active");nn(),tn(),e&&C(T(x,".gm-preview"),"active btn-danger"),nr()}}function nn(){ft&&ft.abort(),ft=null,Ht=function(){},Ut=function(){},x.remove()}function zo(e){var t=G('<div class="ge-toolbar-more"><button type="button" class="btn btn-sm btn-light"><i class="bi bi-three-dots"></i></button><div class="ge-toolbar-overflow"><div class="ge-addRowGroup btn-group"></div><div class="ge-addContainerGroup btn-group"></div></div></div>');e.parentNode.insertBefore(t,e.nextSibling);var n=T(t,"button"),r=T(t,".ge-toolbar-overflow"),o=_(r,".btn-group");function a(A){return A===R?o[0]:o[1]}n.setAttribute("title",m("tool.more")),n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false");var l=ft=new AbortController,d={signal:l.signal};if(n.addEventListener("click",function(){h(!w(t,"ge-open"))}),r.addEventListener("click",function(A){J(A.target,"[data-ge-toolbar]")&&h(!1)}),document.addEventListener("pointerdown",function(A){t.contains(A.target)||h(!1)},d),document.addEventListener("keydown",function(A){A.key==="Escape"&&h(!1)},d),Ht=function(){h(!1)},Ut=E,E(),window.ResizeObserver){var c=!1,g=new window.ResizeObserver(function(){c||(c=!0,window.requestAnimationFrame(function(){c=!1,l.signal.aborted||E()}))});g.observe(b),g.observe(e),l.signal.addEventListener("abort",function(){g.disconnect()})}function h(A){A=A&&w(t,"ge-needed"),z(t,"ge-open",A),n.setAttribute("aria-expanded",A?"true":"false")}function E(){var A=Lo();if(A.forEach(function(io){io.home.appendChild(io.button)}),O(t,"ge-needed"),e.scrollWidth<=e.clientWidth){h(!1);return}C(t,"ge-needed");for(var j=A.length-1;j>=0&&e.scrollWidth>e.clientWidth;j--){var Pt=a(A[j].home);Pt.insertBefore(A[j].button,Pt.firstChild)}}}function Qn(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(G('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function jo(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=t.align==="end"?"btn-primary":"btn-light",l=Qn(v("a",{class:"btn btn-sm "+a+" ge-add-container ge-add-feature"}),o,r);return C(l,t.className||""),zt(l,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),l.addEventListener("click",function(){if(H){sn(l,t.source||"tool");return}var d=t.create();if(d){var c=t.inColumn?rn(d):d,g=re(t.kind,d,function(){f.appendChild(c)},{parent:f,source:t.source||"tool"});g&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}}),l}function Ro(){return s.toolbar_drag==="auto"?s.drag_handle==="drawer":!!s.toolbar_drag}function Do(){var e=_(x,"[data-ge-toolbar]");e.forEach(function(t){O(t,"ge-palette-button"),t.removeEventListener("pointerdown",Zn)}),Ro()&&e.forEach(function(t){C(t,"ge-palette-button"),t.addEventListener("pointerdown",Zn)})}function Zn(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(c){return Math.abs(c.pageX-n)+Math.abs(c.pageY-r)>s.drag.threshold}function l(c){if(!o){if(!a(c))return;o=C(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),Ht(),C(f,"ge-dropping")}ke(o,{left:c.pageX-14,top:c.pageY-14}),No(c.pageX,c.pageY)}function d(c){if(document.removeEventListener("pointermove",l),Dn(document,"pointerup pointercancel",d),!!o){o.remove(),O(f,"ge-dropping"),on();var g=function(E){E.target!==t&&!t.contains(E.target)||(E.preventDefault(),E.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var h=er(c.pageX,c.pageY);h&&tr(t,h)}}document.addEventListener("pointermove",l),ie(document,"pointerup pointercancel",d)}function er(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=J(o,[".column",".ge-canvas"].concat(St("regions")).join(", "));if(!a||a!==f&&!f.contains(a))return null;var l=null;return V(a,kn()).forEach(function(d){if(!l){var c=d.getBoundingClientRect();r<c.top+c.height/2&&(l=d)}}),{region:a,before:l}}function Io(e,t,n){var r=(mt[e.getAttribute("data-ge-feature")]||[])[parseInt(e.getAttribute("data-ge-item"),10)];if(!r)return null;var o=r.create();if(!o)return null;var a=o;if(r.inColumn)_e(t.region,".column")||(a=rn(o));else if(!An(t.region,o)){var l=t.region===f?[]:lo(t.region,f).reverse().concat([t.region]),d=l[0]||null;t={region:f,before:d?d.nextElementSibling:null}}return re(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 rn(e){var t=Ke();return t.appendChild(Ee(F)).appendChild(e),t}function No(e,t){var n=er(e,t);if(!n)return on();Ne||(Ne=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Ne,n.before):n.region.appendChild(Ne)}function on(){Ne&&Ne.remove()}function tr(e,t,n){if(e.getAttribute("data-ge-toolbar")==="feature")return Io(e,t,n);var r=e.getAttribute("data-ge-toolbar")==="container",o=e.getAttribute("data-ge-container-type"),a=r?S[o].create({}):Ho(e.getAttribute("data-ge-layout")),l=a;return r&&!_e(t.region,".column")&&(l=rn(a)),re(r?o:"row",a,function(){t.before?t.before.parentNode.insertBefore(l,t.before):t.region.appendChild(l)},{parent:t.region,source:n||"dragdrop"})}function Fo(){for(var e=[],t=1;t<=F;t++)e.push(String(t));return{name:"col",values:e.concat(Nn),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return Re(Q(n),an(r))},choices:function(){return s.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 Zt(n,r===null?null:an(r),a,o)},blank:function(n,r){var o=r===$?null:_t(n,Q(r));return o?m("utility.col_from_row",{count:Br(o.value)}):null}}}function an(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function Ho(e){return/^\s*\{/.test(e||"")?Ye(JSON.parse(e)):Ye((e||"").split(",").filter(function(t){return t!==""}).map(an))}function Ye(e){var t=Ke();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(Ee(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=Q(r);a&&Ge.indexOf(String(o))!==-1&&C(t,Fn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(Ee(null));return t}function Uo(e){return y.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function Wo(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 nr(){var e=window.pageYOffset;e>Dt(x).top&&e<Dt(f).top+so(f)?w(b,"ge-top")&&(ke(b,{left:Dt(b).left,width:st(b)}),O(b,"ge-top"),C(b,"ge-fixed")):w(b,"ge-fixed")&&(ke(b,{left:"",width:""}),O(b,"ge-fixed"),C(b,"ge-top"))}function Ko(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!fe()&&jt(e)){var t=lr();t.length&&(t.length===1?rr(e,t[0]):Bo(e,t))}}function rr(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):Y(function(){var n=ne("plain",e,{source:"tool",from:"plain",to:t.type});if(!D("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 w(r,"ge-text-block")&&(O(r,"ge-plain-block"),V(r,".ge-tools-drawer").forEach(function(o){o.remove()})),D("after-convert",n),t.edit(e),!0})}function Bo(e,t){var n=w(e.parentElement,"ge-text-block")?e.parentElement:null;n&&or(M(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(){rr(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function or(e,t,n,r){if(fe(),!!e){var o=J(e,".ge-tools-drawer");o&&C(o,"ge-picker-open"),te=e.appendChild(C(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var l=zt(v("a",{class:"ge-size ge-size-flex"}),a.attributes||{});l.setAttribute("title",a.title||a.label),l.textContent=a.label,l.addEventListener("click",function(d){d.preventDefault(),d.stopPropagation(),fe(),a.choose()}),te.appendChild(l)}),ir(r||e)}}function ir(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){te&&!te.matches(":hover")&&fe()},400)},{once:!0})}function ar(){var e={},t=[];return Object.keys(L).forEach(function(n){var r=L[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&X("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 lr(){return ar().filter(function(e){return e.offered!==!1})}function Vo(e){return ar().some(function(t){return t.type===e})}function sr(){Se(),de()}function Go(){Se(),Oe(null),Z.style.height=.8*document.documentElement.clientHeight+"px",Z.value=f.innerHTML,je(Z),pe(f),ve=!0,oe("onSourceOpen",Z)}function ln(){oe("onSourceClose",Z),ve=!1,it(f,Z.value),je(f),de(),pe(Z)}function ur(){return[".column"].concat(St("regions")).join(", ")}function qo(e){return!!e&&e!==f&&f.contains(e)&&_e(e,ur())}function Oe(e){if(e!==H){var t=H;t&&O(t,"ge-active-target"),H=e,e&&w(f,"ge-editing")&&C(e,"ge-active-target"),D("target-change",{canvas:f,target:e,from:t})}}function sn(e,t){var n=tr(e,{region:H,before:null},t);n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth"})}function de(){K&&!ze(K.node)&&Ce(),me&&me.home&&!ze(me.home)&&ge(),Ln(!0),C(f,"ge-editing"),z(f,"ge-drag-drawer",s.drag_handle==="drawer"),Fi();var e=ua();da(e),fa(e),ma(),ki(),Ai(),pi(),oe("onInit"),Gi(),Ji(),no(P),$e(f),H&&!f.contains(H)?Oe(null):H&&C(H,"ge-active-target")}function Se(){Ce(),O(f,"ge-editing ge-drag-drawer ge-dropping"),H&&O(H,"ge-active-target"),oe("onBeforeDeinit"),fe(),on(),ge(),dr(f),wt.clear(),to(f),oe("onDeinit"),bt(f),cr(f),vi(),oa(),Zi(),Ln(!1,f)}function dr(e){_(e,".ge-tools-drawer").forEach(function(t){t.remove()})}function cr(e){_(e,"[data-ge-row-cols]").forEach(function(t){t.removeAttribute("data-ge-row-cols")})}function Xo(){var e=[];return[S,L,W].forEach(function(t){Object.keys(t).forEach(function(n){var r=t[n],o=r.unmark||r.onDeinit||r.onBeforeDeinit;o&&!r.cleanMarkup&&e.push(n)})}),e}function Yo(){for(var e=f.cloneNode(!0),t=new Map,n=new Map,r=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),a=r.currentNode,l=o.currentNode;a&&l;)t.set(l,a),n.set(a,l),a=r.nextNode(),l=o.nextNode();return{root:e,liveOf:function(d){return t.get(d)||null},copyOf:function(d){return n.get(d)||null}}}function fr(){if(ve)return Je();var e=Xo();if(e.length)return e.forEach(function(o){X("snapshot:"+o,'the "'+o+'" plugin has no cleanMarkup, so the canvas leaves editing to be read: open texts and settings panels close')}),Je();var t=Yo(),n=t.root;[n].concat(_(n,".ge-active-target, .ge-settings-target")).forEach(function(o){O(o,"ge-active-target ge-settings-target"),at(o)}),_(n,".ge-drop-marker").forEach(function(o){o.remove()}),dr(n),to(n);var r=null;return[S,L,W].forEach(function(o){Object.keys(o).forEach(function(a){var l=o[a];r||!l.cleanMarkup||l.cleanMarkup(n,t.liveOf)===!1&&(r=a)})}),r?(X("snapshot-refused:"+r,'the "'+r+'" plugin cannot take its marking off a copy right now, so the canvas leaves editing to be read'),Je()):(bt(n),cr(n),_(n,"[data-ge-container]").forEach(kr),gt.forEach(function(o){var a=t.copyOf(o.el);a&&_(a,"[draggable]").forEach(function(l){l.removeAttribute("draggable")})}),Jr(n),Ln(!1,n),We(n),n.innerHTML)}function Je(e){if(e&&e.keepEditing)return fr();Se(),We(f);var t=f.innerHTML;return de(),t}function Jo(e){Se(),We(e);var t=e.outerHTML;return de(),t}function $o(e){return Hn(Je(e))}function Qo(e){ve&&(ln(),x&&_(x,".gm-edit-mode").forEach(function(t){O(t,"active btn-danger")})),Se(),it(f,e),de()}function Zo(){oe("onDestroy"),ve&&ln(),Se(),H=null,Gn(),Ir(),Hr(),nn(),Z.remove(),Vt.abort(),Ft.delete(f),pt=!0}function ei(){var e=ti();dn("grid",{},Fo()),s.row_cols!==!1&&dn("grid",{},Ki());var t=function(r){return!s.plugins||s.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(k.containers).forEach(function(r){t(r)&&(S[r]=k.containers[r](e))}),Object.keys(k.features).forEach(function(r){var o=k.features[r];n(r,o)&&(L[r]=o(e))}),Object.keys(k.utilities).forEach(function(r){t(r)&&(W[r]=k.utilities[r](e),(W[r].families||[]).forEach(function(o){dn(r,W[r],o)}))}),Object.keys(L).forEach(function(r){var o=L[r].methods||{};Object.keys(o).forEach(function(a){Le[a]=o[a]})}),(s.plugins||[]).forEach(function(r){S[r]||L[r]||W[r]||X("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function oe(e,t){[S,L,W].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function ti(){return{canvas:f,settings:s,t:m,warn:U,containerId:mi,defaultRegion:gi,createTool:I,createMoveTool:Pe,addSettingsTool:nt,deleteNode:Te,place:Mt,createPaneControls:bi,makeLabelEditable:wi,labelIn:yi,unwrapLabels:Ci,suspendToggles:Ar,resumeToggles:Tr,emit:D,payloadFor:ne,operate:Y,kindOf:ue,view:zn,viewTiers:function(){return po(P).map(function(e){return e.key})},breakpoints:y.map(function(e){return e.key}),getUtility:wr,setUtility:mn,utilityField:fi,bareStyle:ii,hostStyle:yr,setHostStyle:di,openDialog:Fr,closeDialog:ge,rowFromLayout:Ye,nodeHtml:Jo,snapshotHtml:fr,setHtml:Qo,confirm:Vn,textReady:Ao,attachPicker:Sr,openPicker:or,closePicker:fe,detailsOf:Rr,drawerOf:ni,refreshToolbar:Po,toolbarItems:function(e){return x?_(x,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function ni(e){if(w(e,"ge-content")){var t=e.parentElement;return w(t,"ge-text-block")?M(t,".ge-tools-drawer"):null}return M(e,".ge-tools-drawer")}var be={},ri=".row, .column, .ge-content, .ge-element, [data-ge-container]",Fe="data-ge-preview",un=!1;function dn(e,t,n){var r=n.name||n.prefix;if(be[r]){U('the "'+e+'" plugin declares the utility "'+r+'", which the "'+be[r].plugin+'" plugin already declared: ignored');return}be[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function ht(e,t){return be[e]?be[e].family:(X("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function mr(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!S[t]&&e.appliesTo.indexOf("container")!==-1}function gr(e){return Object.keys(be).map(function(t){return be[t].family}).filter(function(t){return mr(t,e)})}function cn(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function we(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(cn(t,n,t.values[o]))!==-1)return t.values[o];return null}function pr(e,t,n){for(var r=y.indexOf(n)-1;r>=0;r--){var o=we(e,t,y[r]);if(o!==null)return{tier:y[r],value:o}}return null}function vr(e,t,n){var r=we(e,t,n);if(r!==null)return r;var o=pr(e,t,n);return o?o.value:null}function fn(e,t){return y.map(function(n){return{tier:n,value:we(e,t,n)}}).filter(function(n){return n.value!==null})}function hr(e,t,n,r){t.values.forEach(function(o){O(e,cn(t,n,o))}),r!==null&&C(e,cn(t,n,r)),at(e)}function br(e,t,n){return n===$?we(e,t,y[0]):vr(e,t,Q(n))}function oi(e,t,n,r){if(n!==$){var o=Q(n);return we(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],l=[];return fn(e,t).forEach(function(d){d.tier!==y[0]&&(a.push({tier:d.tier,value:null}),l.push({breakpoint:d.tier.key,value:d.value}))}),we(e,t,y[0])!==r&&a.unshift({tier:y[0],value:r}),a.length?{writes:a,cleared:l}:null}function wr(e,t,n){e=ae(e);var r=ht(t,"getUtility");if(!r||!e)return null;var o=n===void 0?P:Pn(n);return o===null?(U("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):br(e,r,o)}function mn(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=ae(e);var o=ht(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?P:Pn(r.view);if(a===null)return U("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 U("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var l=ue(e);if(!mr(o,l))return U('setUtility: "'+t+'" does not apply to a '+l),!1;if(o.write)return o.write(e,n,a,r.source||"api");var d=oi(e,o,a,n);return d?Y(function(){var c=ne(l,e,{family:t,breakpoint:a,tiers:d.writes.map(function(g){return g.tier.key}),from:br(e,o,a),to:n,cleared:d.cleared,source:r.source||"api"});return D("before-utility",c)?(d.writes.forEach(function(g){hr(e,o,g.tier,g.value)}),ce(e),D("after-utility",c),!0):(ce(e),!1)}):!1}function ii(e,t,n){var r=ht(t,"bareStyle");if(e=ae(e),!r||!e)return null;var o=e.getAttribute("class");y.forEach(function(l){hr(e,r,l,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function ce(e){var t=Rr(e);if(t){var n=T(t,".ge-classes");n&&(n.value=bn(e).join(" ")),V(t,".ge-utilities").forEach(function(r){gn(r)})}Er(e),$e(e)}function ai(e){return xe(e,ri)}function $e(e){bt(e),P!==$&&li(e,Q(P)),Wi(e),oe("onRefresh",e)}function li(e,t){ai(e).forEach(function(n){var r=ue(n),o={};gr(r).forEach(function(a){!a.preview||!fn(n,a).length||Object.assign(o,a.preview(vr(n,a,t),n,r))}),r==="column"&&Object.assign(o,Ui(n,t)),Object.keys(W).forEach(function(a){var l=W[a];l.preview&&Object.assign(o,l.preview(n,r,t.key))}),Object.keys(o).length&&si(n,o)})}function si(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(Fe,JSON.stringify(r))}function bt(e){xe(e,"["+Fe+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Fe))||{}}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(Fe),lt(t)})}function ui(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(Fe))||{}}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 yr(e,t){var n=ui(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function di(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=yr(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(Fe);return a&&bt(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),lt(e),a&&$e(e),!0}function ci(e){var t=ue(e),n=gr(t).filter(function(l){return l.panel!==!1}).map(function(l){return Cr(e,l)});if(Object.keys(W).forEach(function(l){var d=W[l],c=d.panel?d.panel(e,t):null;c&&n.push(c)}),!n.length)return null;var r=z(v("div",{class:"ge-utilities"}),"ge-open",un);Bn.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){un=!w(r,"ge-open"),Dr().forEach(function(l){_(l,".ge-utilities").forEach(function(d){z(d,"ge-open",un)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(l){a.appendChild(l)}),gn(r),r}function Cr(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(){mn(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function fi(e,t){var n=ht(t,"utilityField");if(!n)return null;var r=Cr(e,n);return pn(r,e),wt.set(r,e),r}var wt=new Map;function Er(e){wt.forEach(function(t,n){if(!n.isConnected){wt.delete(n);return}e&&t!==e||J(n,".ge-utilities")||pn(n,t)})}function gn(e){var t=Bn.get(e);V(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(dt(P))})}),_(e,".ge-utility").forEach(function(n){pn(n,t)})}function pn(e,t){var n=be[e.getAttribute("data-ge-family")].family,r=M(e,"select"),o=n.choices?n.choices(t,ue(t)):n.values,a,l,d="";if(r.innerHTML="",P===$){a=we(t,n,y[0]),l=m("utility.default");var c=fn(t,n).filter(function(j){return j.tier!==y[0]});c.length&&(d=m("utility.varies",{breakpoints:c.map(function(j){return j.tier.key}).join(", ")}))}else{var g=Q(P),h=pr(t,n,g);a=we(t,n,g),l=h?m("utility.inherit",{value:xr(n,h.value),breakpoint:h.tier.key}):m("utility.default");var E=n.blank?n.blank(t,P):null;E&&a===null&&(l=E)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},l)),o.forEach(function(j){r.appendChild(v("option",{value:j},xr(n,j)))}),r.value=a===null?"":a;var A=M(e,".ge-utility-note");A.textContent=d,Rn(A,d!=="")}function xr(e,t){return e.label?e.label(t):t}var S={},L={},W={},Le={},_r=0;function mi(e){return _r++,"ge-"+e+"-"+_r+"-"+Math.random().toString(36).slice(2,6)}function gi(){var e=Ke();return e.appendChild(Ee(F)),e}function Me(e){return e?e.getAttribute("data-ge-container"):null}function pi(){_(f,"[data-ge-container]").forEach(function(e){var t=Me(e),n=S[t];if(!n){X("container:"+t,'unknown container type "'+t+'"');return}C(e,"ge-container ge-container-"+t),n.mark(e),M(e,".ge-tools-drawer")||hi(e,t,n)})}function vi(){_(f,"[data-ge-container]").forEach(function(e){var t=S[Me(e)];t&&t.unmark(e),kr(e)})}function kr(e){O(e,"ge-container ge-container-"+Me(e)),at(e)}function He(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function yt(e,t){(t||[]).forEach(function(n){I(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function hi(e,t,n){var r=He(e,"ge-tools-drawer ge-container-drawer");Pe(r),nt(r,e,s.container_classes),yt(r,s.container_tools),n.tools&&n.tools(r,e),I(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){Te(t,e,m("confirm.delete_container"),function(o){ut(e,o)})}),n.addPane&&I(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});o&&re(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function bi(e,t,n,r,o){var a=He(e,"ge-tools-drawer ge-pane-drawer");return Pe(a),nt(a,e,s.pane_classes),yt(a,n),I(a,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){Te(t,e,r,function(l){o(l)})}),a}var Ct=["toggle","dismiss","slide","slide-to","ride"];function Ar(e){e&&xe(e,Ct.map(function(t){return"[data-bs-"+t+"]"}).join(", ")).forEach(function(t){Ct.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&&xe(e,Ct.map(function(t){return"[data-ge-bs-"+t+"]"}).join(", ")).forEach(function(t){Ct.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 wi(e){if(!Bt.has(e)){var t=J(e,"[data-bs-toggle], [data-ge-bs-toggle]");Bt.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),Ar(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 yi(e){var t=M(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function Ci(e){_(e,".ge-pane-label").forEach(function(t){Bt.delete(t),Nt(t)})}function Or(e,t){var n=Ee(t);return re("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Ei(e,t){!s.add_column.picker||!e||Sr(e,function(){xi(e,t)})}function Sr(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};ie(e,"mouseenter mousedown",function(){n||te||(n=window.setTimeout(function(){n=null,t()},s.add_column.delay))}),ie(e,"mouseleave mouseup",r)}function xi(e,t){fe();var n=_n(t,ye()),r=J(e,".ge-tools-drawer");r&&C(r,"ge-picker-open"),te=e.appendChild(v("div",{class:"ge-size-picker"})),s.valid_col_sizes.forEach(function(o){var a=v("a",{class:"ge-size","data-ge-size":o,title:_i(o)},q(o)?o:Re(y[0],o));z(a,"ge-size-tight",q(o)&&o>n),z(a,"ge-size-flex",!q(o)),a.addEventListener("click",function(l){l.preventDefault(),l.stopPropagation(),fe(),Or(t,o)}),te.appendChild(a)}),ir(e)}function _i(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function fe(){if(!te)return!1;var e=J(te,".ge-tools-drawer");return e&&O(e,"ge-picker-open"),te.remove(),te=null,!0}function ki(){_(f,".row").forEach(function(e){if(!M(e,".ge-tools-drawer")){var t=He(e,"ge-tools-drawer");Pe(t),nt(t,e,s.row_classes),yt(t,s.row_tools),I(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){Te("row",e,m("confirm.delete_row"),function(n){ut(e,n)})}),I(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){fe()||Or(e,rt(e,ye())?null:s.add_column.size)}),Ei(M(t,".ge-add-column"),e)}})}function Ai(){_(f,".column").forEach(function(e){if(!M(e,".ge-tools-drawer")){var t=He(e,"ge-tools-drawer");Pe(t),s.resize.tools!==!1&&(I(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){Zt(e,n.shiftKey?tt(s.valid_col_sizes):Et(s.valid_col_sizes.filter(q),Ze(e),-1),"tool")}),I(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){Zt(e,n.shiftKey?Ti(e):Et(s.valid_col_sizes.filter(q),Ze(e),1),"tool")})),s.indent.tools!==!1&&(I(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){Xn(e,n.shiftKey?tt(s.valid_col_offsets):Et(s.valid_col_offsets,et(e),-1),"tool")}),I(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){Xn(e,n.shiftKey?Oi(e):Et(s.valid_col_offsets,et(e),1),"tool")})),nt(t,e,s.col_classes),yt(t,s.col_tools),I(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){Te("column",e,m("confirm.delete_column"),function(n){fo(e,400,n,!0)})}),I(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Ke();re("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function ye(){return P===$?y[y.length-1]:Q(P)}function Qe(e){var t=ye();if(_t(e,t))return null;var n=En(e,t);return n===null?F:n}function Ze(e){var t=Qe(e);if(q(t))return t;var n=Math.round(st(e)/Lr(e.parentElement)*F);return Math.min(Math.max(n,1),F)}function Lr(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function et(e){return At(e,ye())||0}function Et(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 tt(e){return e.filter(q).reduce(function(t,n){return Math.min(t,n)},F)}function vn(e){return e.filter(q).reduce(function(t,n){return Math.max(t,n)},0)}function Ti(e){var t=_n(e.parentElement,ye(),e)-et(e);return Math.min(vn(s.valid_col_sizes),Math.max(t,1))}function Oi(e){var t=_n(e.parentElement,ye(),e)-Ze(e);return Math.min(vn(s.valid_col_offsets),Math.max(t,0))}function Pe(e){return s.drag_handle==="drawer"?null:I(e,m("tool.move"),"ge-move","bi bi-arrows-move")}var hn=".ge-tools-drawer:not(.ge-text-drawer):not(.ge-pane-drawer):not(.ge-code-inline)";function Si(){if(s.drawer_overflow==="wrap"||!window.ResizeObserver||!window.MutationObserver)return;var e=new Set,t=null;function n(l){e.add(l),t===null&&(t=window.requestAnimationFrame(r))}function r(){t=null;var l=Array.from(e);e.clear(),l.forEach(function(d){if(!d.isConnected){o.unobserve(d);return}Li(d)})}var o=new window.ResizeObserver(function(l){l.forEach(function(d){n(d.target)})}),a=new window.MutationObserver(function(l){l.forEach(function(d){var c=d.target;if(d.type==="attributes"){var g=c.parentNode;g&&g.nodeType===1&&g.matches(hn)&&n(g);return}if(c.nodeType===1&&c.matches(hn)){n(c);return}d.addedNodes.forEach(function(h){h.nodeType===1&&xe(h,hn).forEach(function(E){C(E,"ge-drawer-fit"),o.observe(E),n(E)})})})});a.observe(f,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),Vt.signal.addEventListener("abort",function(){a.disconnect(),o.disconnect(),t!==null&&window.cancelAnimationFrame(t)})}function Li(e){var t=V(e,"a").filter(function(o){return!w(o,"ge-drawer-more")}),n=w(e,"ge-drawer-expanded");if(O(e,"ge-drawer-overflow ge-drawer-expanded"),t.forEach(function(o){O(o,"ge-tool-overflow")}),!!Mr(e,t)){C(e,"ge-drawer-overflow"),M(e,".ge-drawer-more")||I(e,m("tool.more"),"ge-drawer-more","bi bi-three-dots",function(){z(e,"ge-drawer-expanded")});for(var r=t.length-1;r>=0&&Mr(e,t);r--)C(t[r],"ge-tool-overflow");z(e,"ge-drawer-expanded",n)}}function Mr(e,t){var n=window.getComputedStyle(e),r=e.getBoundingClientRect().right-parseFloat(n.borderRightWidth)-parseFloat(n.paddingRight);return t.some(function(o){var a=o.getClientRects();return a.length>0&&a[0].right>r+.5})}function I(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(l){ie(a,l,o[l])}),a}function bn(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!Mi(t)})}function Mi(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:y.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Pi(e,t){bn(e).forEach(function(n){O(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&C(e,n)}),at(e)}function nt(e,t,n){var r=zi(t,n||[]);Kn.set(t,r),I(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){Ri(t,r,this)});var o=ue(t);return Object.keys(W).forEach(function(a){W[a].drawerTools&&W[a].drawerTools(e,t,o)}),Object.keys(L).forEach(function(a){L[a].drawerTools&&L[a].drawerTools(e,t,o)}),e.appendChild(r)}function zi(e,t){var n=v("div",{class:"ge-details"});n.appendChild(Pr(m("panel.section_general")));var r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(g){var h=v("label",{class:"ge-field"});return h.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(h)},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 l=v("input",{class:"ge-classes form-control form-control-sm",placeholder:m("tool.classes_placeholder"),title:m("tool.classes_title")});l.value=bn(e).join(" "),o(m("panel.classes")).appendChild(l),l.addEventListener("change",function(){Pi(e,this.value),ce(e)});var d=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var h=w(e,g.cssClass),E=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":h?"true":"false"});E.innerHTML=g.label,z(E,"active",h),E.addEventListener("click",function(){z(E,"active"),E.setAttribute("aria-pressed",w(E,"active")?"true":"false"),z(e,g.cssClass,w(E,"active")),ce(e)}),d.appendChild(E)}),ji(e).forEach(function(g){n.appendChild(g)});var c=ci(e);return c&&n.appendChild(c),n}function Pr(e){return v("h6",{class:"ge-section-title"},e)}function ji(e){var t=ue(e),n=jr(),r=[];return[S,L,W].forEach(function(o){Object.keys(o).forEach(function(a){var l=o[a],d=l.panelSection?l.panelSection(e,t):null;if(!(!d||!d.body)){var c=v("div",{class:"ge-panel-section","data-ge-plugin":a});if(n==="offcanvas"||n==="modal")c.appendChild(Pr(m(d.labelKey))),c.appendChild(d.body);else{var g=m(d.labelKey),h=c.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},g));pe(d.body),c.appendChild(d.body),h.addEventListener("click",function(){Fr(d.titleKey?m(d.titleKey,{kind:Ur(e)}):g,d.body,h)})}r.push(c)}})}),r}var zr=["offcanvas","popover","modal","inline"],B={},K=null,xt=new WeakMap;function jr(){return zr.indexOf(s.settings_panel)!==-1?s.settings_panel:(X("settings_panel",'settings_panel "'+s.settings_panel+'" is not one of '+zr.join(", ")+": using offcanvas"),"offcanvas")}function Rr(e){return e&&Kn.get(e)||null}function Dr(){return K&&K.mode!=="inline"?[f,K.details]:[f]}function Ri(e,t,n){var r=jr();if(r==="inline"){Rn(t);return}var o=K&&K.details===t;Ce(),o||Di(r,e,t,n)}function Di(e,t,n,r){var o=Ii(e),a=new AbortController;K={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},T(o,".ge-settings-title").textContent=m("panel.title",{kind:Ur(t)}),T(o,".ge-settings-body").appendChild(n),je(n),C(t,"ge-settings-target");var l={signal:a.signal};if(document.addEventListener("keydown",function(c){c.key==="Escape"&&!me&&Ce()},l),e==="offcanvas"){var d=window.innerWidth<576;z(o,"offcanvas-end",!d),z(o,"offcanvas-bottom",d),O(o,"hiding"),o.getBoundingClientRect(),C(o,"show")}else e==="popover"?(wn(o,r),ie(window,"scroll resize",function(){wn(o,r)},l),window.ResizeObserver&&(K.observer=new window.ResizeObserver(function(){wn(o,r)}),K.observer.observe(n)),ie(document,"mousedown touchstart",function(c){!me&&!o.contains(c.target)&&!r.contains(c.target)&&Ce()},l)):yn(o,function(){K&&K.mode==="modal"&&Ce()})}function Ce(){ge();var e=K;if(e){K=null;var t=B[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(O(t,"show"),C(t,"hiding"),window.setTimeout(function(){O(t,"hiding")},300)):e.mode==="popover"?pe(t):Cn(t),O(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),lt(e.details),e.home&&ze(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 Ii(e){if(B[e])return B[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=G('<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>'),T(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=G('<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>'),T(n,".popover-header").appendChild(t()),pe(n)):(n=G('<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>'),T(n,".modal-header").appendChild(t()),T(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),Ve(n,"click",".ge-settings-close",function(r){r.preventDefault(),Ce()}),B[e]=document.body.appendChild(n),n}function Ir(){Ce(),Object.keys(B).forEach(function(e){e==="modal"?Xt(B[e]):B[e].remove()}),Object.keys(B).forEach(function(e){Nr(B[e])}),B={}}function wn(e,t){if(ze(t)){je(e);var n=t.getBoundingClientRect(),r=8,o=M(e,".popover-body");o.style.removeProperty("max-height");var a=st(e),l=Rt(e),d=window.innerHeight-n.bottom-2*r,c=n.top-2*r,g=l<=d||d>=c,h=g?d:c;l>h&&(ke(o,{"max-height":Math.max(120,h-(l-Rt(o)))}),l=Rt(e));var E=g?n.bottom+r:n.top-r-l,A=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));z(e,"bs-popover-bottom",g),z(e,"bs-popover-top",!g),ke(e,{top:E+window.pageYOffset,left:A+window.pageXOffset}),ke(M(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-A-8,a-24))})}}function yn(e,t){var n=ct(),r=xt.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},xt.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,qn(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"&&Cn(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?yn(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function Cn(e){var t=ct(),n=xt.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),O(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&w(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function Nr(e){var t=xt.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var ee=null,me=null;function Ni(){return ee||(ee=G('<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>'),T(ee,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),T(ee,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),Ve(ee,"click",".ge-dialog-close",function(e){e.preventDefault(),ge()}),document.body.appendChild(ee))}function Fr(e,t,n){ge();var r=Ni(),o=new AbortController;me={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},T(r,".ge-dialog-title").textContent=e,T(r,".ge-dialog-body").appendChild(t),je(t),ct()||document.addEventListener("keydown",function(a){a.key==="Escape"&&ge()},{signal:o.signal}),Object.keys(B).forEach(function(a){C(B[a],"ge-under-dialog")}),yn(r,function(){ge()})}function ge(){var e=me;e&&(me=null,e.listening.abort(),Cn(ee),Object.keys(B).forEach(function(t){O(B[t],"ge-under-dialog")}),pe(e.body),e.home&&ze(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&&ze(e.opener)&&e.opener.focus&&e.opener.focus())}function Hr(){ge(),ee&&(Nr(ee),Xt(ee),ee=null)}function Ur(e){var t=ue(e);if(S[t]&&S[t].labelKey)return m(S[t].labelKey);var n=Object.keys(S).filter(function(r){return S[r].paneKind===t&&S[r].paneLabelKey})[0];if(n)return m(S[n].paneLabelKey);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 Fi(){_(f,'.column, div[class*="col-"], div.col').forEach(function(e){C(e,"column"),!(Bi(e).length||Wr(e.parentElement))&&Tt(e,y[0],F)})}function Wr(e){return w(e,"row")&&y.some(function(t){return Ge.some(function(n){return w(e,Fn(t,n))})})}function rt(e,t){if(!w(e,"row"))return null;for(var n=y.indexOf(t);n>=0;n--)for(var r=0;r<Ge.length;r++)if(w(e,Fn(y[n],Ge[r])))return{tier:n,value:Ge[r]};return null}function Kr(e,t){for(var n=y.indexOf(t);n>=0;n--){var r=Ue(e,y[n]);if(r!==null)return{tier:n,size:r}}return null}function _t(e,t){var n=rt(e.parentElement,t);if(!n)return null;var r=Kr(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function Hi(e){return e.value==="auto"?0:F/parseInt(e.value,10)}function Ui(e,t){var n=_t(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:Wr(e.parentElement)&&!Kr(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function Wi(e){xe(e,".row").forEach(function(t){var n=s.row_cols===!1?null:P===$?rt(t,y[0])||null:rt(t,Q(P));n?t.setAttribute("data-ge-row-cols",Br(n.value)):t.removeAttribute("data-ge-row-cols")})}function Br(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function Ki(){return{name:"row-cols",prefix:"row-cols",values:Ge,appliesTo:["row"],labelKey:"utility.row_cols"}}function Ue(e,t){var n=Gr(e,t.colPrefix);return n!==null?n:w(e,Re(t,"auto"))?"auto":w(e,Re(t,"equal"))?"equal":null}function kt(e,t){return Gr(e,t.offsetPrefix)}function En(e,t){return Vr(e,t,Ue)}function At(e,t){return Vr(e,t,kt)}function Vr(e,t,n){for(var r=y.indexOf(t);r>=0;r--){var o=n(e,y[r]);if(o!==null)return o}return null}function Gr(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function qr(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 Tt(e,t,n){qr(e,t.colPrefix,null),Nn.forEach(function(r){O(e,Re(t,r))}),n!=null&&C(e,Re(t,n))}function xn(e,t,n){qr(e,t.offsetPrefix,n||null)}function Bi(e){return y.filter(function(t){return Ue(e,t)!==null})}function _n(e,t,n){var r=0;return V(e,".column").forEach(function(o){if(!(n&&o===n)){var a=_t(o,t),l=a?Hi(a):En(o,t);r+=(q(l)?l:0)+(At(o,t)||0)}}),F-r}function Ot(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),go),t===null||!q(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),F),t+n<=F?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:F-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function We(e){xe(e,".column").forEach(function(t){ke(t,{width:"",height:"",left:"",top:""}),lt(t)})}function Xr(e){return"ge-"+e+"-"+wo}function kn(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(St("blocks")).join(", ")}function St(e){return Object.keys(L).map(function(t){return L[t][e]||null}).filter(function(t){return t!==null})}function An(e,t){var n=!0;return Object.keys(L).forEach(function(r){var o=L[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function Vi(){return s.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 Lt(e,t){var n=ho();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=s.drag_handle==="drawer",o=Vi(),a=0;e.forEach(function(l){var d=t.group?{name:Xr(t.group)}:{name:Xr(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(d.put=function(c,g,h){return g.options.group.name===d.name&&t.accepts(c.el,h)}),gt.push(n.create(l,Object.assign({group:d,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(c,g){return J(c.target,o,l)?!0:!g||g.parentNode!==l},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:s.drag.animation,delay:s.drag.delay||s.drag.touch_delay,delayOnTouchOnly:!s.drag.delay,touchStartThreshold:s.drag.threshold,scroll:s.drag.scroll,onStart:qi,onEnd:Yi},t.options||{})))})}}function Gi(){if(!ho()){X("sortable_missing",m("error.sortable_missing"));return}Lt(_(f,".row"),{draggable:".column",group:"column"}),Lt([f].concat(_(f,".column")),{draggable:kn(),group:"block",accepts:An});var e=St("regions");e.length&&Lt(_(f,e.join(", ")),{draggable:">"+kn(),group:"block",accepts:An}),oe("onSortable",Lt)}function qi(e){var t=e.item,n=en(t),r=Yr(t),o={from:n,canceled:!1};Kt.set(t,o),Y(function(){var a=D("before-move",ne(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function Yr(e){var t=w(e,"ge-text-block")&&M(e,".ge-content")||e;return{kind:ue(t),node:t}}function Xi(e,t){var n=V(t.parent).filter(function(r){return r!==e&&!w(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function Yi(e){var t=e.item,n=Kt.get(t),r=n?n.from:en(t);if(Kt.delete(t),n&&n.canceled){Xi(t,r);return}var o=en(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=J(t,"[data-ge-container]"),l=S[Me(a)];l&&l.afterPaneMove&&l.afterPaneMove(a,t,r);var d=Yr(t);Y(function(){D("after-move",ne(d.kind,d.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function Ji(){s.resize.enabled&&_(f,".column").forEach(function(e){if(!M(e,".ge-resize-handle")){var t=M(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),$i().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",Qi),e.appendChild(r)})}})}function $i(){return String(s.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function Qi(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=st(n);if(e.preventDefault(),!ea(n))return;C(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function l(g){var h=g.pageX-o;return Math.max(1,a+(r?-h:h))}function d(g){n.style.width=l(g)+"px",ta(n,l(g))}function c(g){t.removeEventListener("pointermove",d),Dn(t,"pointerup pointercancel",c),O(n,"ge-resizing"),na(n,l(g))}t.addEventListener("pointermove",d),ie(t,"pointerup pointercancel",c)}function Zi(){Jr(f)}function Jr(e){_(e,".ge-resize-handle").forEach(function(t){t.remove()}),_(e,".ge-resize-size").forEach(function(t){t.remove()}),We(e)}function $r(e,t){var n=Math.round(t/Lr(e.parentElement)*F),r=Qr(e),o=r?Qe(r):null,a=vt.get(e),l=a?a.units:Ze(e),d=r&&q(o)?l+o-tt(s.valid_col_sizes):F-et(e);return Math.min(Math.max(n,tt(s.valid_col_sizes)),Math.max(d,tt(s.valid_col_sizes)),vn(s.valid_col_sizes))}function Qr(e){return s.resize.balance!=="next"?null:ao(e,".column")[0]||null}function Tn(e,t){var n=M(e,".ge-tools-drawer"),r=n?M(n,".ge-resize-size"):null;r&&(r.textContent=t)}function Zr(e){return(P===$?y[0].colPrefix:ye().colPrefix)+e}function ea(e){var t=Qe(e),n=Y(function(){return D("before-resize",ne("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:Ze(e)};return vt.set(e,r),Tn(e,Zr(r.units)),!0}function ta(e,t){Tn(e,Zr($r(e,t)))}function na(e,t){var n=vt.get(e),r=$r(e,t);if(vt.delete(e),Tn(e,""),We(e),!!n&&r!==n.units){var o=Jt(e,r);o&&Y(function(){$t(e,o),ra(e,r-n.units),ce(e),D("after-resize",ne("column",e,Qt({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function ra(e,t){var n=Qr(e);if(!(!n||!t)){var r=Qe(n);if(q(r)){var o=Jt(n,r-t);o&&($t(n,o),ce(n))}}}function oa(){gt.forEach(function(e){e.destroy()}),gt=[]}function Ke(){return v("div",{class:"row"})}function Mt(e,t,n){var r=null;if(xa.forEach(function(d){r===null&&n&&n[d]!==void 0&&(r=d)}),r===null)return e;var o=ae(n[r]);if(!o)return U(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,l=function(){return re(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):It(e,o)},{parent:a,source:n.source||"api"})};return qe>0?(qt(l),e):l()}function ia(e,t){var n=Ke();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(U("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=Ye(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(Ee(r))}),Mt(n,"row",t)}function aa(e,t){t=t||{};var n=ae(t.appendTo||t.prependTo||null);e===void 0&&n&&rt(n,ye())?e=null:!q(e)&&Nn.indexOf(e)===-1&&(U("createColumn: no column size given, using "+F),e=F);var r=Ee(e,t.offset);return t.content!==void 0&&r.appendChild(va(t.content)),Mt(r,"column",t)}function la(e,t){t=t||{};var n=S[e];return n?Mt(n.create(t),e,t):(U('createContainer: no such container type "'+e+'"'),null)}function On(e,t,n){e=ae(e),n=n||{};var r=S[Me(e)];if(!r||Me(e)!==t)return U("this is not a "+t+" container"),null;var o=r.addPane(e,n);return o?re(r.paneKind,o,function(){},{parent:e,source:"api",container:e}):null}function sa(e,t){e=ae(e);var n=Me(e);return!S[n]||!S[n].addPane?(U("addPane: this is not a container with panes"),null):On(e,n,t)}function Sn(){var e={};return Object.keys(s).forEach(function(t){var n=s[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function Ee(e,t){var n=v("div",{class:"column"}),r=po(P)[0],o=Ot({size:e,offset:t||0,leading:"offset"});return Tt(n,r,o.size===null?e:o.size),xn(n,r,o.offset),n}function Ln(e,t){if(!(!s.custom_filter||!s.custom_filter.length)){var n=typeof s.custom_filter=="string"||typeof s.custom_filter=="function"?[s.custom_filter]:s.custom_filter;Array.prototype.forEach.call(n,function(r){typeof r=="string"&&(r=window[r]),r(t||f,e)})}}function ua(){var e=[".row","[data-ge-container]"];return Object.keys(L).forEach(function(t){var n=L[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function da(e){_(f,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(w(t,"ge-rte-active")||!V(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=w(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],a=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(c){c.nodeType===1&&c.matches(e)?(o.push({text:a},{block:c}),a=[]):a.push(c)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var l=!1,d=r;o.forEach(function(c){var g;if(c.block)g=c.block;else if(ca(c.text))l?(g=Mn(n),c.text.forEach(function(h){g.appendChild(h)})):(c.text.forEach(function(h){t.appendChild(h)}),g=r,l=!0);else return;g!==d&&It(g,d),d=g}),l||r.remove()}})}function ca(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function fa(e){_(f,".column").forEach(function(t){var n=[];V(t).forEach(function(r){_e(r,".ge-tools-drawer, .ge-resize-handle")||(_e(r,".ge-content, .ge-text-block")||r.matches(e)?n=eo(n):n.push(r))}),eo(n)})}function eo(e){if(e.length){var t=It(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 ma(){_(f,".column > .ge-content").forEach(function(e){uo(e,v("div",{class:"ge-text-block"}))}),_(f,".ge-text-block").forEach(function(e){if(!M(e,".ge-tools-drawer")){var t=M(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?Vo(n)||pa(e,n):ga(e)}})}function to(e){_(e,".ge-text-block").forEach(function(t){Nt(t)})}function ga(e){var t=M(e,".ge-content"),n=He(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");C(e,"ge-plain-block"),Pe(n),Object.keys(L).forEach(function(r){L[r].plainTools&&L[r].plainTools(n,t)}),I(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){Te("plain",t,m("confirm.delete_plain"),function(r){ut(e,function(){e.remove(),r()})})})}function pa(e,t){var n=M(e,".ge-content"),r=He(e,"ge-tools-drawer ge-text-drawer");Pe(r),I(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),I(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){Te("text",n,m("confirm.delete_text"),function(o){ut(e,function(){e.remove(),o()})})})}function va(e){var t=lr(),n=Mn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):it(n,e),n}function no(e){P=e,In.forEach(function(t){z(f,"ge-layout-"+t,t===e)}),T(Ie,"button").textContent=m(dt(e))}function Pn(e){return In.indexOf(e)===-1?null:e}function ro(e){var t=Pn(e);if(t===null){U("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=P;no(t),t!==n&&(Dr().forEach(function(r){_(r,".ge-utilities").forEach(function(o){gn(o)})}),Er(null),$e(f),oe("onViewChange",t),D("view-change",{canvas:f,breakpoint:t,from:n,to:t}))}function zn(){return P}function oo(e,t,n){return function(){return Le[e]?Le[e].apply(null,arguments):(X("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}function ha(e){if(!s.active_target){X("active_target","setActiveTarget needs the active_target setting: without it, it does nothing");return}if(e==null){Oe(null);return}var t=ae(e);if(!qo(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);U("setActiveTarget: "+n+" is not a column or a region of the canvas");return}Oe(t)}var jn={getHtml:Je,getPlainHtml:$o,init:function(){qt(de)},reset:function(){qt(sr)},deinit:Se,destroy:Zo,changeView:ro,getView:zn,createRow:ia,createColumn:aa,createText:function(e,t){return Le.createText?Le.createText(e,t):(X("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:oo("createElement","elements","elements"),createSection:oo("createSection","sections","sections"),createContainer:la,addTab:function(e,t){return On(e,"tabs",t)},addAccordionItem:function(e,t){return On(e,"accordion",t)},addPane:sa,setLocale:yo,getUtility:wr,setUtility:mn,getActiveTarget:function(){return s.active_target?H:null},setActiveTarget:ha};Object.keys(jn).forEach(function(e){var t=!!(mo[e]&&mo[e].value);i[e]=function(){if(pt)return X("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?f.innerHTML:e==="getPlainHtml"?Hn(f.innerHTML):t?null:i;var n=jn[e].apply(i,arguments);return t?n:i}}),i.canvas=f,i.settings=Sn(),Ft.set(f,i),ei(),i.settings=Sn(),Object.keys(Le).forEach(function(e){Object.prototype.hasOwnProperty.call(jn,e)||e in i||(i[e]=function(){return pt?(X("destroyed:"+e,m("warning.destroyed",{method:e})),null):Le[e].apply(null,arguments)})}),ko(),de(),k._created.forEach(function(e){e(i)})}k._created=[];k.containers={};k.features={};k.utilities={};k.texts={};k.t=Un;k._plainHtml=Hn;k.Sortable=null;k.bootstrap=null;k.version="8.8.0";k.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
1
+ (()=>{function _(i,u){return i?Array.prototype.slice.call(i.querySelectorAll(u)):[]}function T(i,u){return i?i.querySelector(u):null}function xe(i,u){if(!i)return[];var p=_(i,u);return i.nodeType===1&&i.matches(u)&&p.unshift(i),p}function V(i,u){return i?Array.prototype.filter.call(i.children,function(p){return!u||p.matches(u)}):[]}function M(i,u){return V(i,u)[0]||null}function J(i,u,p){var s=i&&i.nodeType===1?i.closest(u):null;return s&&p&&s!==p&&!p.contains(s)?null:s}function _e(i,u){return!!i&&i.nodeType===1&&i.matches(u)}function ze(i){return!!i&&document.documentElement.contains(i)}function ao(i,u){for(var p=[],s=i.nextElementSibling;s;s=s.nextElementSibling)(!u||s.matches(u))&&p.push(s);return p}function lo(i,u){for(var p=[],s=i.parentElement;s&&s!==u;s=s.parentElement)p.push(s);return p}function ba(i){var u=document.createElement("template");return u.innerHTML=i,Array.prototype.slice.call(u.content.childNodes)}function G(i){for(var u=ba(i.trim()),p=0;p<u.length;p++)if(u[p].nodeType===1)return u[p];return null}function v(i,u,p){var s=document.createElement(i);return Object.keys(u||{}).forEach(function(f){var x=u[f];x!=null&&x!==!1&&s.setAttribute(f,x)}),p!=null&&(s.textContent=p),s}function it(i,u){return i.innerHTML=u==null?"":String(u),i}function C(i,u){return Be(u).forEach(function(p){i.classList.add(p)}),i}function O(i,u){return Be(u).forEach(function(p){i.classList.remove(p)}),i}function z(i,u,p){return Be(u).forEach(function(s){p===void 0?i.classList.toggle(s):i.classList.toggle(s,!!p)}),i}function w(i,u){return!!i&&i.nodeType===1&&i.classList.contains(u)}function Be(i){return String(i||"").split(/\s+/).filter(Boolean)}function at(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function lt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function zt(i,u){return Object.keys(u).forEach(function(p){var s=u[p];s==null?i.removeAttribute(p):i.setAttribute(p,s)}),i}function ke(i,u){return Object.keys(u).forEach(function(p){var s=u[p];typeof s=="number"&&!wa[p]&&(s=s+"px"),i.style.setProperty(p,s==null?"":String(s))}),i}var wa={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},ot={};function ya(i){var u=i.nodeName;if(!ot[u]){var p=document.body.appendChild(document.createElement(u));ot[u]=getComputedStyle(p).display,p.remove(),ot[u]==="none"&&(ot[u]="block")}return ot[u]}function je(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=ya(i)),i}function pe(i){return i.style.display="none",i}function Rn(i,u){return u===void 0&&(u=!jt(i)),u?je(i):pe(i)}function jt(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function st(i){return i.getBoundingClientRect().width}function Rt(i){return i.getBoundingClientRect().height}function so(i){var u=getComputedStyle(i);return i.clientHeight-parseFloat(u.paddingTop)-parseFloat(u.paddingBottom)}function Dt(i){var u=i.getBoundingClientRect();return{top:u.top+window.pageYOffset,left:u.left+window.pageXOffset}}function It(i,u){return u.parentNode.insertBefore(i,u.nextSibling),i}function Nt(i){for(var u=i.parentNode;i.firstChild;)u.insertBefore(i.firstChild,i);i.remove()}function uo(i,u){return i.parentNode.insertBefore(u,i),u.appendChild(i),u}function Ve(i,u,p,s,f){var x=function(b){var R=J(b.target,p,i);if(R&&i.contains(R))return s.call(R,b)};return Be(u).forEach(function(b){i.addEventListener(b,x,f)}),x}function ie(i,u,p,s){return Be(u).forEach(function(f){i.addEventListener(f,p,s)}),p}function Dn(i,u,p,s){Be(u).forEach(function(f){i.removeEventListener(f,p,s)})}var Ca=400;function co(i,u,p,s){p=p===void 0?Ca:p;var f=function(){pe(i),s&&s()};if(!jt(i)||!i.animate||p<=0){window.setTimeout(f,0);return}var x=i.animate(u(getComputedStyle(i)),{duration:p,easing:"ease-in-out"}),b=!1,R=function(){b||(b=!0,f())};x.onfinish=R,x.oncancel=R}function ut(i,u,p){typeof u=="function"&&(p=u,u=void 0),i.style.overflow="hidden",co(i,function(s){return[{height:s.height,paddingTop:s.paddingTop,paddingBottom:s.paddingBottom,marginTop:s.marginTop,marginBottom:s.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},u,function(){i.style.removeProperty("overflow"),p&&p()})}function fo(i,u,p,s){i.style.overflow="hidden",co(i,function(f){var x={opacity:f.opacity,height:f.height},b={opacity:0,height:"0px"};return s&&(x.width=f.width,b.width="0px"),[x,b]},u,function(){i.style.removeProperty("overflow"),p&&p()})}var mo={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},addPane:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0},getActiveTarget:{value:!0},setActiveTarget:{}},xa=["appendTo","prependTo","insertAfter","insertBefore"],y=[{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"}],$="all",_a="view.all",In=[$].concat(y.map(function(i){return i.key})),F=12,go=11,Nn=["equal","auto"],Ge=["1","2","3","4","5","6","auto"];function Fn(i,u){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+u}function q(i){return typeof i=="number"}function Re(i,u){return u==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+u}function Q(i){for(var u=0;u<y.length;u++)if(y[u].key===i)return y[u];return null}function po(i){if(i===$)return[y[0]];var u=Q(i);return u?[u]:[]}function dt(i){var u=Q(i);return u?u.labelKey:_a}var De={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1,types:[]},resize:{enabled:!0,tools:!0,handles:"e",balance:"next"},indent:{tools:!0},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},vo={},ka=0,Ft=new WeakMap;function Un(i,u,p){var s=k.locales,f=s[i.locale]||{},x=i.locale_strings||{},b=x[u];return b===void 0&&(b=f[u]),b===void 0&&(b=s.en[u]),b===void 0&&(Ta("locale:"+u,'no string for "'+u+'" in any locale, showing the key'),b=u),b.replace(/\{(\w+)\}/g,function(R,le){return p&&p[le]!==void 0?p[le]:R})}function Aa(i,u){var p=k.locales;return(i.locale_strings||{})[u]!==void 0||(p[i.locale]||{})[u]!==void 0||p.en[u]!==void 0}function U(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Ta(i,u){vo[i]||(vo[i]=!0,U(u))}function Oa(i,u){return Un({locale:"en"},i,u)}function Sa(i){if(typeof i=="string"){var u=document.querySelector(i);if(!u)throw new TypeError("grid-editor: no element matches "+JSON.stringify(i));return u}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 ae(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function ho(){return k.Sortable||window.Sortable||null}function ct(){var i=k.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function Hn(i){var u=document.implementation.createHTMLDocument("").body;u.innerHTML=i;var p=[];return _(u,"*").forEach(function(s){var f=!1;Array.prototype.slice.call(s.attributes).forEach(function(R){R.name.indexOf("data-ge-")===0&&(s.removeAttribute(R.name),f=!0)});var x=(s.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=x.filter(function(R){return R!=="column"&&R.indexOf("ge-")!==0});b.length!==x.length&&(f=!0),b.length?s.setAttribute("class",b.join(" ")):s.removeAttribute("class"),f&&s.tagName==="DIV"&&!s.attributes.length&&p.push(s)}),p.forEach(function(s){Nt(s)}),u.innerHTML}function k(i,u){var p=Sa(i),s=Ft.get(p);if(s)return bo.has(p)||(bo.add(p),U(Oa("warning.already_editing"))),s;if(!(this instanceof k))return new k(p,u);La(this,p,u||{})}var bo=new WeakSet;k.create=function(i,u){return new k(i,u)};k.get=function(i){var u=ae(i);return u&&Ft.get(u)||null};function La(i,u,p){var s=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",toolbar_overflow:"menu",drawer_overflow:"menu",toolbar_groups:!1,active_target:!1,element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:De.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:De.add_column,layout_modes:In.slice(),default_view:$,resize:De.resize,indent:De.indent,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:De.drag},p);Object.keys(De).forEach(function(e){s[e]=Object.assign({},De[e],s[e])});var f,x,b,R,le,Ie,Z,P=s.default_view,N=null,te=null,ve=!1,Ne=null,H=null,ft=null,Ht=function(){},Ut=function(){},se=[],mt={},Wt=null,Wn={},gt=[],wo=++ka,pt=!1,Kn=new WeakMap,Kt=new WeakMap,vt=new WeakMap,Bn=new WeakMap,Bt=new WeakSet,Vt=new AbortController;f=C(u,"ge-canvas");function X(e,t){Wn[e]||(Wn[e]=!0,U(t))}function m(e,t){return Un(s,e,t)}function yo(e){s.locale=e,i.settings=Sn(),Gn(),Ir(),Hr(),nn(),tn(),sr()}var qe=0,Gt=[];function ne(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:f,breakpoint:zn(),source:"api"},n||{})}function D(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 l=new CustomEvent("grideditor:"+a,{detail:t,bubbles:!0,cancelable:!0});f.dispatchEvent(l)||(o=!0)}),n.forEach(function(a){var l=s.callbacks[a.replace(/-/g,"_")];typeof l=="function"&&l(t)===!1&&(o=!0)}),!o}function Y(e){qe++;try{return e()}finally{if(qe--,qe===0)for(;Gt.length;)Gt.shift()()}}function qt(e){if(qe===0){e();return}Gt.push(e)}function re(e,t,n,r){var o=Co(e);return Y(function(){var a=ne(e,t,r);return D("before-add-"+o,a)?(n(),de(),D("after-add-"+o,a),t):null})}function Co(e){return k.containers[e]?"container":e}function Eo(e,t){if(!s.confirm_delete){t();return}Vn(e,{danger:!0},function(n){n&&t()})}function Vn(e,t,n){t=t||{};var r=ct();if(!r){n(window.confirm(e));return}var o=xo(),a=!1,l=T(o,".ge-confirm-ok");Ae&&Ae(null);var d=function(c){Ae===d&&(Ae=null,n(c))};Ae=d,T(o,".modal-title").textContent=t.title||m("confirm.title"),T(o,".ge-confirm-cancel").textContent=t.cancel||m("confirm.cancel"),l.textContent=t.ok||m("confirm.ok"),z(l,"btn-danger",!!t.danger),z(l,"btn-primary",!t.danger),T(o,".ge-confirm-message").textContent=e,l.onclick=function(){a=!0,r.getInstance(o).hide()},he.hidden=function(){d(a)},he.shown=function(){l.focus()},r.getOrCreateInstance(o).show()}var he={hidden:null,shown:null},Ae=null;function xo(){if(N)return N;N=G('<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(N),T(N,".modal-title").textContent=m("confirm.title"),T(N,".btn-close").setAttribute("aria-label",m("confirm.cancel")),T(N,".ge-confirm-cancel").textContent=m("confirm.cancel"),T(N,".ge-confirm-ok").textContent=m("confirm.ok"),qn(N);var e=N;return N.addEventListener("hidden.bs.modal",function(){e===N&&he.hidden&&he.hidden()}),N.addEventListener("shown.bs.modal",function(){e===N&&he.shown&&he.shown()}),N}function Gn(){N&&(he.hidden=null,he.shown=null,Xt(N),N=null,Ae&&Ae(null))}function Xt(e){var t=ct(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!Yt.get(e)&&!w(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 Yt=new WeakMap;function qn(e){ie(e,"show.bs.modal hide.bs.modal",function(){Yt.set(e,!0)}),ie(e,"shown.bs.modal hidden.bs.modal",function(){Yt.set(e,!1)})}function Te(e,t,n,r){Y(function(){var o=ne(e,t,{source:"tool"});D("before-delete",o)&&Eo(n,function(){Y(function(){r(function(){t.remove(),Y(function(){de(),D("after-delete",o)})})})})})}function Jt(e,t,n){if(n=n||P,n!==$){var r=Q(n),o=Ot({size:t,offset:At(e,r)||0});return o.refused||Ue(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=y.some(function(g){return Ot({size:t,offset:At(e,g)||0}).refused});if(a)return null;var l=y[0],d=[],c=[];return y.slice(1).forEach(function(g){var h=Ue(e,g);h!==null&&(d.push({tier:g,size:null}),c.push({breakpoint:g.key,value:h}))}),Ue(e,l)!==t&&d.unshift({tier:l,size:t}),d.length?{writes:d,cleared:c,size:t}:null}function $t(e,t){t.writes.forEach(function(n){Tt(e,n.tier,n.size)}),We(e)}function Qt(e,t){return t&&(e.cleared=t),e}function Zt(e,t,n,r){r=r||P;var o=Qe(e),a=Jt(e,t,r);return a?Y(function(){var l=ne("column",e,Qt({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return D("before-resize",l)?($t(e,a),ce(e),D("after-resize",l),!0):(ce(e),!1)}):!1}function Xn(e,t,n){var r=P===$,o=r?y[0]:Q(P),a=et(e);t=Math.min(Math.max(t,0),go);var l=r?y.slice(1).filter(function(d){return kt(e,d)!==null}):[];return(kt(e,o)||0)===t&&!l.length?!1:Y(function(){var d=ne("column",e,Qt({source:n,from:a,to:t},r?l.map(function(c){return{breakpoint:c.key,value:kt(e,c)}}):null));return D("before-indent",d)?(xn(e,o,t),l.forEach(function(c){xn(e,c,0)}),(r?y:[o]).forEach(function(c){var g=En(e,c);if(q(g)){var h=Ot({size:g,offset:t,leading:"offset"});h.size!==g&&Tt(e,c,h.size)}}),ce(e),D("after-indent",d),!0):!1})}function en(e){var t=e.parentElement;return{parent:t,index:V(t).filter(function(n){return!w(n,"ge-tools-drawer")}).indexOf(e)}}function ue(e){var t=null;if(Object.keys(L).forEach(function(r){var o=L[r];!t&&o.kindOf&&(t=o.kindOf(e))}),t)return t;if(e.getAttribute("data-ge-container"))return e.getAttribute("data-ge-container");var n=null;return Object.keys(S).forEach(function(r){var o=S[r];!n&&o.paneClass&&w(e,o.paneClass)&&(n=o.paneKind)}),n||(w(e,"ge-tab")?"tab":w(e,"ge-accordion-item")?"accordion-item":w(e,"row")?"row":w(e,"column")?"column":w(e,"ge-element")?"element":(w(e,"ge-text-block")&&(e=M(e,".ge-content")||e),w(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(s.source_textarea){var Xe=ae(s.source_textarea).value,Yn=v("div");Yn.innerHTML=Xe,Xe.length>0&&!Yn.querySelector(".row")&&(Xe='<div class="row"><div class="col-lg-12">'+Xe+"</div></div>"),it(u,Xe)}if(u.children.length&&!u.querySelector("div.row")){var _o=V(u),Jn=G('<div class="row"><div class="col-lg-12"></div></div>');u.appendChild(Jn),_o.forEach(function(e){Jn.firstChild.appendChild(e)})}function ko(){Z=v("textarea",{class:"ge-html-output"}),f.parentNode.insertBefore(Z,f),tn(),Si();var e={signal:Vt.signal};if(window.addEventListener("scroll",nr,e),Ve(f,"click",".ge-content",Ko,e),Ve(f,"click",".ge-popup-trigger, [data-ge-popup-target]",function(n){w(f,"ge-editing")&&n.preventDefault()},e),s.active_target){var t=null;f.addEventListener("pointerdown",function(n){t={x:n.clientX,y:n.clientY}},e),f.addEventListener("click",function(n){var r=t;if(t=null,!!w(f,"ge-editing")&&!(r&&Math.abs(n.clientX-r.x)+Math.abs(n.clientY-r.y)>s.drag.threshold)){var o=J(n.target,ur());if(o&&o===H&&(n.target===o||n.target===M(o,".ge-tools-drawer"))){Oe(null);return}Oe(o&&o!==f&&f.contains(o)?o:null)}},e),document.addEventListener("keydown",function(n){if(!(n.key!=="Escape"||!H||K||me)){var r=document.activeElement;r&&(_e(r,"input, textarea, select")||r.isContentEditable)||Oe(null)}},e)}}function Ao(e){!_e(e,".ge-content")||!f.contains(e)||(oe("onContentReady",e),$e(e))}function tn(){x=v("div",{class:"ge-mainControls"}),Z.parentNode.insertBefore(x,Z),b=x.appendChild(v("div",{class:"ge-wrapper ge-top"}));var e=s.toolbar_overflow!=="wrap",t=b;e&&(C(b,"ge-toolbar-menu"),t=b.appendChild(v("div",{class:"ge-toolbar-start"}))),se=[],R=t.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),le=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),s.new_row_layouts.forEach(function(c){var g=!Array.isArray(c),h=v("a",{class:"btn btn-sm btn-light",title:g?m("row.add_row_cols",{columns:c.columns,counts:Uo(c.row_cols)}):m("row.add",{layout:c.join("-")}),"data-ge-toolbar":"row","data-ge-layout":g?JSON.stringify(c):c.join(",")});h.addEventListener("click",function(){if(H){sn(h,"tool");return}var j=Ye(c),Pt=re("row",j,function(){f.appendChild(j)},{parent:f,source:"tool"});Pt&&j.scrollIntoView&&j.scrollIntoView({behavior:"smooth"})}),R.appendChild(h),se.push({button:h,home:R,group:"rows"}),h.appendChild(G('<i class="bi bi-plus"></i>'));var E=g?Wo(c):c,A='<div class="row ge-row-icon">';E.forEach(function(j){A+='<div class="column '+Re(y[0],j)+'"></div>'}),A+="</div>",h.appendChild(G(A))}),t.appendChild(le),Object.keys(S).forEach(function(c){var g=S[c],h=Qn(v("a",{class:"btn btn-sm btn-light ge-add-container"}),m(g.labelKey),g.iconClass);zt(h,{"data-ge-toolbar":"container","data-ge-container-type":c}),h.addEventListener("click",function(){if(H){sn(h,"tool");return}var E=Ke(),A=E.appendChild(Ee(F)),j=A.appendChild(g.create({}));re(c,j,function(){f.appendChild(E)},{parent:f,source:"tool"})}),le.appendChild(h),se.push({button:h,home:le,group:$n(g.group)||"content"})});var n=[];mt={},Object.keys(L).forEach(function(c){mt[c]=Mo(L[c]),mt[c].forEach(function(g,h){var E=jo(c,g,h);g.align==="end"?n.push(E):(le.appendChild(E),se.push({button:E,home:le,group:$n(g.group)||c}))})}),Ie=G('<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>'),Ve(Ie,"click","a",function(){ro(this.getAttribute("data-ge-view"))}),b.appendChild(Ie),s.layout_modes.forEach(function(c){T(Ie,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":c,title:m(dt(c))},m(dt(c))))}),T(Ie,"button").textContent=m(dt(P));var r=b.appendChild(v("div",{class:"btn-group pull-right"}));if(s.edit_source){var o=G('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');o.setAttribute("title",m("tool.edit_source")),z(o,"active btn-danger",ve),o.addEventListener("click",function(){ve?ln():Go(),z(o,"active btn-danger",ve)}),r.appendChild(o)}var a=G('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),l=function(){w(a,"active")||C(f,"ge-editing")};if(a.setAttribute("title",m("tool.preview")),a.addEventListener("mouseenter",function(){O(f,"ge-editing")}),a.addEventListener("click",function(){z(a,"active btn-danger"),l()}),a.addEventListener("mouseleave",l),r.appendChild(a),n.length){var d=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));n.forEach(function(c){d.appendChild(c)})}s.toolbar_groups&&Oo(t),e&&zo(t),Do()}var To=[{name:"rows",labelKey:"group.rows"},{name:"content",labelKey:"group.content"},{name:"elements",labelKey:"group.elements"}];function $n(e){return typeof e=="string"&&e.trim()!==""?e:null}function Oo(e){var t=To.map(function(a){return a.name});if(se.forEach(function(a){t.indexOf(a.group)<0&&t.push(a.group)}),t=t.filter(function(a){return se.some(function(l){return l.group===a})}),t.length<2)return;var n=v("div",{class:"ge-toolbar-groups btn-group",role:"tablist","aria-label":m("group.select")});e.insertBefore(n,e.firstChild);var r=x.appendChild(v("div",{class:"ge-toolbar-stash",hidden:"hidden"}));t.forEach(function(a){var l=n.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary",role:"tab","data-ge-group":a},So(a)));l.addEventListener("click",function(){o(a)})}),o(t.indexOf(Wt)>=0?Wt:t[0]);function o(a){Wt=a,se.forEach(function(l){(l.group===a?l.home:r).appendChild(l.button)}),V(n).forEach(function(l){var d=l.getAttribute("data-ge-group")===a;z(l,"active",d),l.setAttribute("aria-selected",d?"true":"false")}),Ut()}}function So(e){var t="group."+e;if(Aa(s,t))return m(t);var n=se.filter(function(r){return r.group===e})[0];return n.button.getAttribute("title")||e}function Lo(){return se.filter(function(e){return!J(e.button,".ge-toolbar-stash")})}function Mo(e){var t=typeof e.toolbar=="function"?e.toolbar():e.toolbar;return Array.isArray(t)?t:[]}function Po(){if(!(!x||pt)){var e=!!T(x,".gm-preview.active");nn(),tn(),e&&C(T(x,".gm-preview"),"active btn-danger"),nr()}}function nn(){ft&&ft.abort(),ft=null,Ht=function(){},Ut=function(){},x.remove()}function zo(e){var t=G('<div class="ge-toolbar-more"><button type="button" class="btn btn-sm btn-light"><i class="bi bi-three-dots"></i></button><div class="ge-toolbar-overflow"><div class="ge-addRowGroup btn-group"></div><div class="ge-addContainerGroup btn-group"></div></div></div>');e.parentNode.insertBefore(t,e.nextSibling);var n=T(t,"button"),r=T(t,".ge-toolbar-overflow"),o=_(r,".btn-group");function a(A){return A===R?o[0]:o[1]}n.setAttribute("title",m("tool.more")),n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false");var l=ft=new AbortController,d={signal:l.signal};if(n.addEventListener("click",function(){h(!w(t,"ge-open"))}),r.addEventListener("click",function(A){J(A.target,"[data-ge-toolbar]")&&h(!1)}),document.addEventListener("pointerdown",function(A){t.contains(A.target)||h(!1)},d),document.addEventListener("keydown",function(A){A.key==="Escape"&&h(!1)},d),Ht=function(){h(!1)},Ut=E,E(),window.ResizeObserver){var c=!1,g=new window.ResizeObserver(function(){c||(c=!0,window.requestAnimationFrame(function(){c=!1,l.signal.aborted||E()}))});g.observe(b),g.observe(e),l.signal.addEventListener("abort",function(){g.disconnect()})}function h(A){A=A&&w(t,"ge-needed"),z(t,"ge-open",A),n.setAttribute("aria-expanded",A?"true":"false")}function E(){var A=Lo();if(A.forEach(function(io){io.home.appendChild(io.button)}),O(t,"ge-needed"),e.scrollWidth<=e.clientWidth){h(!1);return}C(t,"ge-needed");for(var j=A.length-1;j>=0&&e.scrollWidth>e.clientWidth;j--){var Pt=a(A[j].home);Pt.insertBefore(A[j].button,Pt.firstChild)}}}function Qn(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(G('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function jo(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=t.align==="end"?"btn-primary":"btn-light",l=Qn(v("a",{class:"btn btn-sm "+a+" ge-add-container ge-add-feature"}),o,r);return C(l,t.className||""),zt(l,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),l.addEventListener("click",function(){if(H){sn(l,t.source||"tool");return}var d=t.create();if(d){var c=t.inColumn?rn(d):d,g=re(t.kind,d,function(){f.appendChild(c)},{parent:f,source:t.source||"tool"});g&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}}),l}function Ro(){return s.toolbar_drag==="auto"?s.drag_handle==="drawer":!!s.toolbar_drag}function Do(){var e=_(x,"[data-ge-toolbar]");e.forEach(function(t){O(t,"ge-palette-button"),t.removeEventListener("pointerdown",Zn)}),Ro()&&e.forEach(function(t){C(t,"ge-palette-button"),t.addEventListener("pointerdown",Zn)})}function Zn(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(c){return Math.abs(c.pageX-n)+Math.abs(c.pageY-r)>s.drag.threshold}function l(c){if(!o){if(!a(c))return;o=C(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),Ht(),C(f,"ge-dropping")}ke(o,{left:c.pageX-14,top:c.pageY-14}),No(c.pageX,c.pageY)}function d(c){if(document.removeEventListener("pointermove",l),Dn(document,"pointerup pointercancel",d),!!o){o.remove(),O(f,"ge-dropping"),on();var g=function(E){E.target!==t&&!t.contains(E.target)||(E.preventDefault(),E.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var h=er(c.pageX,c.pageY);h&&tr(t,h)}}document.addEventListener("pointermove",l),ie(document,"pointerup pointercancel",d)}function er(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=J(o,[".column",".ge-canvas"].concat(St("regions")).join(", "));if(!a||a!==f&&!f.contains(a))return null;var l=null;return V(a,kn()).forEach(function(d){if(!l){var c=d.getBoundingClientRect();r<c.top+c.height/2&&(l=d)}}),{region:a,before:l}}function Io(e,t,n){var r=(mt[e.getAttribute("data-ge-feature")]||[])[parseInt(e.getAttribute("data-ge-item"),10)];if(!r)return null;var o=r.create();if(!o)return null;var a=o;if(r.inColumn)_e(t.region,".column")||(a=rn(o));else if(!An(t.region,o)){var l=t.region===f?[]:lo(t.region,f).reverse().concat([t.region]),d=l[0]||null;t={region:f,before:d?d.nextElementSibling:null}}return re(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 rn(e){var t=Ke();return t.appendChild(Ee(F)).appendChild(e),t}function No(e,t){var n=er(e,t);if(!n)return on();Ne||(Ne=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Ne,n.before):n.region.appendChild(Ne)}function on(){Ne&&Ne.remove()}function tr(e,t,n){if(e.getAttribute("data-ge-toolbar")==="feature")return Io(e,t,n);var r=e.getAttribute("data-ge-toolbar")==="container",o=e.getAttribute("data-ge-container-type"),a=r?S[o].create({}):Ho(e.getAttribute("data-ge-layout")),l=a;return r&&!_e(t.region,".column")&&(l=rn(a)),re(r?o:"row",a,function(){t.before?t.before.parentNode.insertBefore(l,t.before):t.region.appendChild(l)},{parent:t.region,source:n||"dragdrop"})}function Fo(){for(var e=[],t=1;t<=F;t++)e.push(String(t));return{name:"col",values:e.concat(Nn),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return Re(Q(n),an(r))},choices:function(){return s.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 Zt(n,r===null?null:an(r),a,o)},blank:function(n,r){var o=r===$?null:_t(n,Q(r));return o?m("utility.col_from_row",{count:Br(o.value)}):null}}}function an(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function Ho(e){return/^\s*\{/.test(e||"")?Ye(JSON.parse(e)):Ye((e||"").split(",").filter(function(t){return t!==""}).map(an))}function Ye(e){var t=Ke();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(Ee(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=Q(r);a&&Ge.indexOf(String(o))!==-1&&C(t,Fn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(Ee(null));return t}function Uo(e){return y.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function Wo(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 nr(){var e=window.pageYOffset;e>Dt(x).top&&e<Dt(f).top+so(f)?w(b,"ge-top")&&(ke(b,{left:Dt(b).left,width:st(b)}),O(b,"ge-top"),C(b,"ge-fixed")):w(b,"ge-fixed")&&(ke(b,{left:"",width:""}),O(b,"ge-fixed"),C(b,"ge-top"))}function Ko(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!fe()&&jt(e)){var t=lr();t.length&&(t.length===1?rr(e,t[0]):Bo(e,t))}}function rr(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):Y(function(){var n=ne("plain",e,{source:"tool",from:"plain",to:t.type});if(!D("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 w(r,"ge-text-block")&&(O(r,"ge-plain-block"),V(r,".ge-tools-drawer").forEach(function(o){o.remove()})),D("after-convert",n),t.edit(e),!0})}function Bo(e,t){var n=w(e.parentElement,"ge-text-block")?e.parentElement:null;n&&or(M(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(){rr(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function or(e,t,n,r){if(fe(),!!e){var o=J(e,".ge-tools-drawer");o&&C(o,"ge-picker-open"),te=e.appendChild(C(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var l=zt(v("a",{class:"ge-size ge-size-flex"}),a.attributes||{});l.setAttribute("title",a.title||a.label),l.textContent=a.label,l.addEventListener("click",function(d){d.preventDefault(),d.stopPropagation(),fe(),a.choose()}),te.appendChild(l)}),ir(r||e)}}function ir(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){te&&!te.matches(":hover")&&fe()},400)},{once:!0})}function ar(){var e={},t=[];return Object.keys(L).forEach(function(n){var r=L[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&X("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 lr(){return ar().filter(function(e){return e.offered!==!1})}function Vo(e){return ar().some(function(t){return t.type===e})}function sr(){Se(),de()}function Go(){Se(),Oe(null),Z.style.height=.8*document.documentElement.clientHeight+"px",Z.value=f.innerHTML,je(Z),pe(f),ve=!0,oe("onSourceOpen",Z)}function ln(){oe("onSourceClose",Z),ve=!1,it(f,Z.value),je(f),de(),pe(Z)}function ur(){return[".column"].concat(St("regions")).join(", ")}function qo(e){return!!e&&e!==f&&f.contains(e)&&_e(e,ur())}function Oe(e){if(e!==H){var t=H;t&&O(t,"ge-active-target"),H=e,e&&w(f,"ge-editing")&&C(e,"ge-active-target"),D("target-change",{canvas:f,target:e,from:t})}}function sn(e,t){var n=tr(e,{region:H,before:null},t);n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth"})}function de(){K&&!ze(K.node)&&Ce(),me&&me.home&&!ze(me.home)&&ge(),Ln(!0),C(f,"ge-editing"),z(f,"ge-drag-drawer",s.drag_handle==="drawer"),Fi();var e=ua();da(e),fa(e),ma(),ki(),Ai(),pi(),oe("onInit"),Gi(),Ji(),no(P),$e(f),H&&!f.contains(H)?Oe(null):H&&C(H,"ge-active-target")}function Se(){Ce(),O(f,"ge-editing ge-drag-drawer ge-dropping"),H&&O(H,"ge-active-target"),oe("onBeforeDeinit"),fe(),on(),ge(),dr(f),wt.clear(),to(f),oe("onDeinit"),bt(f),cr(f),vi(),oa(),Zi(),Ln(!1,f)}function dr(e){_(e,".ge-tools-drawer").forEach(function(t){t.remove()})}function cr(e){_(e,"[data-ge-row-cols]").forEach(function(t){t.removeAttribute("data-ge-row-cols")})}function Xo(){var e=[];return[S,L,W].forEach(function(t){Object.keys(t).forEach(function(n){var r=t[n],o=r.unmark||r.onDeinit||r.onBeforeDeinit;o&&!r.cleanMarkup&&e.push(n)})}),e}function Yo(){for(var e=f.cloneNode(!0),t=new Map,n=new Map,r=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),a=r.currentNode,l=o.currentNode;a&&l;)t.set(l,a),n.set(a,l),a=r.nextNode(),l=o.nextNode();return{root:e,liveOf:function(d){return t.get(d)||null},copyOf:function(d){return n.get(d)||null}}}function fr(){if(ve)return Je();var e=Xo();if(e.length)return e.forEach(function(o){X("snapshot:"+o,'the "'+o+'" plugin has no cleanMarkup, so the canvas leaves editing to be read: open texts and settings panels close')}),Je();var t=Yo(),n=t.root;[n].concat(_(n,".ge-active-target, .ge-settings-target")).forEach(function(o){O(o,"ge-active-target ge-settings-target"),at(o)}),_(n,".ge-drop-marker").forEach(function(o){o.remove()}),dr(n),to(n);var r=null;return[S,L,W].forEach(function(o){Object.keys(o).forEach(function(a){var l=o[a];r||!l.cleanMarkup||l.cleanMarkup(n,t.liveOf)===!1&&(r=a)})}),r?(X("snapshot-refused:"+r,'the "'+r+'" plugin cannot take its marking off a copy right now, so the canvas leaves editing to be read'),Je()):(bt(n),cr(n),_(n,"[data-ge-container]").forEach(kr),gt.forEach(function(o){var a=t.copyOf(o.el);a&&_(a,"[draggable]").forEach(function(l){l.removeAttribute("draggable")})}),Jr(n),Ln(!1,n),We(n),n.innerHTML)}function Je(e){if(e&&e.keepEditing)return fr();Se(),We(f);var t=f.innerHTML;return de(),t}function Jo(e){Se(),We(e);var t=e.outerHTML;return de(),t}function $o(e){return Hn(Je(e))}function Qo(e){ve&&(ln(),x&&_(x,".gm-edit-mode").forEach(function(t){O(t,"active btn-danger")})),Se(),it(f,e),de()}function Zo(){oe("onDestroy"),ve&&ln(),Se(),H=null,Gn(),Ir(),Hr(),nn(),Z.remove(),Vt.abort(),Ft.delete(f),pt=!0}function ei(){var e=ti();dn("grid",{},Fo()),s.row_cols!==!1&&dn("grid",{},Ki());var t=function(r){return!s.plugins||s.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(k.containers).forEach(function(r){t(r)&&(S[r]=k.containers[r](e))}),Object.keys(k.features).forEach(function(r){var o=k.features[r];n(r,o)&&(L[r]=o(e))}),Object.keys(k.utilities).forEach(function(r){t(r)&&(W[r]=k.utilities[r](e),(W[r].families||[]).forEach(function(o){dn(r,W[r],o)}))}),Object.keys(L).forEach(function(r){var o=L[r].methods||{};Object.keys(o).forEach(function(a){Le[a]=o[a]})}),(s.plugins||[]).forEach(function(r){S[r]||L[r]||W[r]||X("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function oe(e,t){[S,L,W].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function ti(){return{canvas:f,settings:s,t:m,warn:U,containerId:mi,defaultRegion:gi,createTool:I,createMoveTool:Pe,addSettingsTool:nt,deleteNode:Te,place:Mt,createPaneControls:bi,makeLabelEditable:wi,labelIn:yi,unwrapLabels:Ci,suspendToggles:Ar,resumeToggles:Tr,emit:D,payloadFor:ne,operate:Y,kindOf:ue,view:zn,viewTiers:function(){return po(P).map(function(e){return e.key})},breakpoints:y.map(function(e){return e.key}),getUtility:wr,setUtility:mn,utilityField:fi,bareStyle:ii,hostStyle:yr,setHostStyle:di,openDialog:Fr,closeDialog:ge,rowFromLayout:Ye,nodeHtml:Jo,snapshotHtml:fr,setHtml:Qo,confirm:Vn,textReady:Ao,attachPicker:Sr,openPicker:or,closePicker:fe,detailsOf:Rr,drawerOf:ni,refreshToolbar:Po,toolbarItems:function(e){return x?_(x,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function ni(e){if(w(e,"ge-content")){var t=e.parentElement;return w(t,"ge-text-block")?M(t,".ge-tools-drawer"):null}return M(e,".ge-tools-drawer")}var be={},ri=".row, .column, .ge-content, .ge-element, [data-ge-container]",Fe="data-ge-preview",un=!1;function dn(e,t,n){var r=n.name||n.prefix;if(be[r]){U('the "'+e+'" plugin declares the utility "'+r+'", which the "'+be[r].plugin+'" plugin already declared: ignored');return}be[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function ht(e,t){return be[e]?be[e].family:(X("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function mr(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!S[t]&&e.appliesTo.indexOf("container")!==-1}function gr(e){return Object.keys(be).map(function(t){return be[t].family}).filter(function(t){return mr(t,e)})}function cn(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function we(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(cn(t,n,t.values[o]))!==-1)return t.values[o];return null}function pr(e,t,n){for(var r=y.indexOf(n)-1;r>=0;r--){var o=we(e,t,y[r]);if(o!==null)return{tier:y[r],value:o}}return null}function vr(e,t,n){var r=we(e,t,n);if(r!==null)return r;var o=pr(e,t,n);return o?o.value:null}function fn(e,t){return y.map(function(n){return{tier:n,value:we(e,t,n)}}).filter(function(n){return n.value!==null})}function hr(e,t,n,r){t.values.forEach(function(o){O(e,cn(t,n,o))}),r!==null&&C(e,cn(t,n,r)),at(e)}function br(e,t,n){return n===$?we(e,t,y[0]):vr(e,t,Q(n))}function oi(e,t,n,r){if(n!==$){var o=Q(n);return we(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],l=[];return fn(e,t).forEach(function(d){d.tier!==y[0]&&(a.push({tier:d.tier,value:null}),l.push({breakpoint:d.tier.key,value:d.value}))}),we(e,t,y[0])!==r&&a.unshift({tier:y[0],value:r}),a.length?{writes:a,cleared:l}:null}function wr(e,t,n){e=ae(e);var r=ht(t,"getUtility");if(!r||!e)return null;var o=n===void 0?P:Pn(n);return o===null?(U("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):br(e,r,o)}function mn(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=ae(e);var o=ht(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?P:Pn(r.view);if(a===null)return U("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 U("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var l=ue(e);if(!mr(o,l))return U('setUtility: "'+t+'" does not apply to a '+l),!1;if(o.write)return o.write(e,n,a,r.source||"api");var d=oi(e,o,a,n);return d?Y(function(){var c=ne(l,e,{family:t,breakpoint:a,tiers:d.writes.map(function(g){return g.tier.key}),from:br(e,o,a),to:n,cleared:d.cleared,source:r.source||"api"});return D("before-utility",c)?(d.writes.forEach(function(g){hr(e,o,g.tier,g.value)}),ce(e),D("after-utility",c),!0):(ce(e),!1)}):!1}function ii(e,t,n){var r=ht(t,"bareStyle");if(e=ae(e),!r||!e)return null;var o=e.getAttribute("class");y.forEach(function(l){hr(e,r,l,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function ce(e){var t=Rr(e);if(t){var n=T(t,".ge-classes");n&&(n.value=bn(e).join(" ")),V(t,".ge-utilities").forEach(function(r){gn(r)})}Er(e),$e(e)}function ai(e){return xe(e,ri)}function $e(e){bt(e),P!==$&&li(e,Q(P)),Wi(e),oe("onRefresh",e)}function li(e,t){ai(e).forEach(function(n){var r=ue(n),o={};gr(r).forEach(function(a){!a.preview||!fn(n,a).length||Object.assign(o,a.preview(vr(n,a,t),n,r))}),r==="column"&&Object.assign(o,Ui(n,t)),Object.keys(W).forEach(function(a){var l=W[a];l.preview&&Object.assign(o,l.preview(n,r,t.key))}),Object.keys(o).length&&si(n,o)})}function si(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(Fe,JSON.stringify(r))}function bt(e){xe(e,"["+Fe+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Fe))||{}}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(Fe),lt(t)})}function ui(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(Fe))||{}}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 yr(e,t){var n=ui(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function di(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=yr(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(Fe);return a&&bt(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),lt(e),a&&$e(e),!0}function ci(e){var t=ue(e),n=gr(t).filter(function(l){return l.panel!==!1}).map(function(l){return Cr(e,l)});if(Object.keys(W).forEach(function(l){var d=W[l],c=d.panel?d.panel(e,t):null;c&&n.push(c)}),!n.length)return null;var r=z(v("div",{class:"ge-utilities"}),"ge-open",un);Bn.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){un=!w(r,"ge-open"),Dr().forEach(function(l){_(l,".ge-utilities").forEach(function(d){z(d,"ge-open",un)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(l){a.appendChild(l)}),gn(r),r}function Cr(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(){mn(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function fi(e,t){var n=ht(t,"utilityField");if(!n)return null;var r=Cr(e,n);return pn(r,e),wt.set(r,e),r}var wt=new Map;function Er(e){wt.forEach(function(t,n){if(!n.isConnected){wt.delete(n);return}e&&t!==e||J(n,".ge-utilities")||pn(n,t)})}function gn(e){var t=Bn.get(e);V(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(dt(P))})}),_(e,".ge-utility").forEach(function(n){pn(n,t)})}function pn(e,t){var n=be[e.getAttribute("data-ge-family")].family,r=M(e,"select"),o=n.choices?n.choices(t,ue(t)):n.values,a,l,d="";if(r.innerHTML="",P===$){a=we(t,n,y[0]),l=m("utility.default");var c=fn(t,n).filter(function(j){return j.tier!==y[0]});c.length&&(d=m("utility.varies",{breakpoints:c.map(function(j){return j.tier.key}).join(", ")}))}else{var g=Q(P),h=pr(t,n,g);a=we(t,n,g),l=h?m("utility.inherit",{value:xr(n,h.value),breakpoint:h.tier.key}):m("utility.default");var E=n.blank?n.blank(t,P):null;E&&a===null&&(l=E)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},l)),o.forEach(function(j){r.appendChild(v("option",{value:j},xr(n,j)))}),r.value=a===null?"":a;var A=M(e,".ge-utility-note");A.textContent=d,Rn(A,d!=="")}function xr(e,t){return e.label?e.label(t):t}var S={},L={},W={},Le={},_r=0;function mi(e){return _r++,"ge-"+e+"-"+_r+"-"+Math.random().toString(36).slice(2,6)}function gi(){var e=Ke();return e.appendChild(Ee(F)),e}function Me(e){return e?e.getAttribute("data-ge-container"):null}function pi(){_(f,"[data-ge-container]").forEach(function(e){var t=Me(e),n=S[t];if(!n){X("container:"+t,'unknown container type "'+t+'"');return}C(e,"ge-container ge-container-"+t),n.mark(e),M(e,".ge-tools-drawer")||hi(e,t,n)})}function vi(){_(f,"[data-ge-container]").forEach(function(e){var t=S[Me(e)];t&&t.unmark(e),kr(e)})}function kr(e){O(e,"ge-container ge-container-"+Me(e)),at(e)}function He(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function yt(e,t){(t||[]).forEach(function(n){I(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function hi(e,t,n){var r=He(e,"ge-tools-drawer ge-container-drawer");Pe(r),nt(r,e,s.container_classes),yt(r,s.container_tools),n.tools&&n.tools(r,e),I(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){Te(t,e,m("confirm.delete_container"),function(o){ut(e,o)})}),n.addPane&&I(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});o&&re(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function bi(e,t,n,r,o){var a=He(e,"ge-tools-drawer ge-pane-drawer");return Pe(a),nt(a,e,s.pane_classes),yt(a,n),I(a,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){Te(t,e,r,function(l){o(l)})}),a}var Ct=["toggle","dismiss","slide","slide-to","ride"];function Ar(e){e&&xe(e,Ct.map(function(t){return"[data-bs-"+t+"]"}).join(", ")).forEach(function(t){Ct.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&&xe(e,Ct.map(function(t){return"[data-ge-bs-"+t+"]"}).join(", ")).forEach(function(t){Ct.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 wi(e){if(!Bt.has(e)){var t=J(e,"[data-bs-toggle], [data-ge-bs-toggle]");Bt.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),Ar(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 yi(e){var t=M(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function Ci(e){_(e,".ge-pane-label").forEach(function(t){Bt.delete(t),Nt(t)})}function Or(e,t){var n=Ee(t);return re("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Ei(e,t){!s.add_column.picker||!e||Sr(e,function(){xi(e,t)})}function Sr(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};ie(e,"mouseenter mousedown",function(){n||te||(n=window.setTimeout(function(){n=null,t()},s.add_column.delay))}),ie(e,"mouseleave mouseup",r)}function xi(e,t){fe();var n=_n(t,ye()),r=J(e,".ge-tools-drawer");r&&C(r,"ge-picker-open"),te=e.appendChild(v("div",{class:"ge-size-picker"})),s.valid_col_sizes.forEach(function(o){var a=v("a",{class:"ge-size","data-ge-size":o,title:_i(o)},q(o)?o:Re(y[0],o));z(a,"ge-size-tight",q(o)&&o>n),z(a,"ge-size-flex",!q(o)),a.addEventListener("click",function(l){l.preventDefault(),l.stopPropagation(),fe(),Or(t,o)}),te.appendChild(a)}),ir(e)}function _i(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function fe(){if(!te)return!1;var e=J(te,".ge-tools-drawer");return e&&O(e,"ge-picker-open"),te.remove(),te=null,!0}function ki(){_(f,".row").forEach(function(e){if(!M(e,".ge-tools-drawer")){var t=He(e,"ge-tools-drawer");Pe(t),nt(t,e,s.row_classes),yt(t,s.row_tools),I(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){Te("row",e,m("confirm.delete_row"),function(n){ut(e,n)})}),I(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){fe()||Or(e,rt(e,ye())?null:s.add_column.size)}),Ei(M(t,".ge-add-column"),e)}})}function Ai(){_(f,".column").forEach(function(e){if(!M(e,".ge-tools-drawer")){var t=He(e,"ge-tools-drawer");Pe(t),s.resize.tools!==!1&&(I(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){Zt(e,n.shiftKey?tt(s.valid_col_sizes):Et(s.valid_col_sizes.filter(q),Ze(e),-1),"tool")}),I(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){Zt(e,n.shiftKey?Ti(e):Et(s.valid_col_sizes.filter(q),Ze(e),1),"tool")})),s.indent.tools!==!1&&(I(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){Xn(e,n.shiftKey?tt(s.valid_col_offsets):Et(s.valid_col_offsets,et(e),-1),"tool")}),I(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){Xn(e,n.shiftKey?Oi(e):Et(s.valid_col_offsets,et(e),1),"tool")})),nt(t,e,s.col_classes),yt(t,s.col_tools),I(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){Te("column",e,m("confirm.delete_column"),function(n){fo(e,400,n,!0)})}),I(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Ke();re("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function ye(){return P===$?y[y.length-1]:Q(P)}function Qe(e){var t=ye();if(_t(e,t))return null;var n=En(e,t);return n===null?F:n}function Ze(e){var t=Qe(e);if(q(t))return t;var n=Math.round(st(e)/Lr(e.parentElement)*F);return Math.min(Math.max(n,1),F)}function Lr(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function et(e){return At(e,ye())||0}function Et(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 tt(e){return e.filter(q).reduce(function(t,n){return Math.min(t,n)},F)}function vn(e){return e.filter(q).reduce(function(t,n){return Math.max(t,n)},0)}function Ti(e){var t=_n(e.parentElement,ye(),e)-et(e);return Math.min(vn(s.valid_col_sizes),Math.max(t,1))}function Oi(e){var t=_n(e.parentElement,ye(),e)-Ze(e);return Math.min(vn(s.valid_col_offsets),Math.max(t,0))}function Pe(e){return s.drag_handle==="drawer"?null:I(e,m("tool.move"),"ge-move","bi bi-arrows-move")}var hn=".ge-tools-drawer:not(.ge-text-drawer):not(.ge-pane-drawer):not(.ge-code-inline)";function Si(){if(s.drawer_overflow==="wrap"||!window.ResizeObserver||!window.MutationObserver)return;var e=new Set,t=null;function n(l){e.add(l),t===null&&(t=window.requestAnimationFrame(r))}function r(){t=null;var l=Array.from(e);e.clear(),l.forEach(function(d){if(!d.isConnected){o.unobserve(d);return}Li(d)})}var o=new window.ResizeObserver(function(l){l.forEach(function(d){n(d.target)})}),a=new window.MutationObserver(function(l){l.forEach(function(d){var c=d.target;if(d.type==="attributes"){var g=c.parentNode;g&&g.nodeType===1&&g.matches(hn)&&n(g);return}if(c.nodeType===1&&c.matches(hn)){n(c);return}d.addedNodes.forEach(function(h){h.nodeType===1&&xe(h,hn).forEach(function(E){C(E,"ge-drawer-fit"),o.observe(E),n(E)})})})});a.observe(f,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),Vt.signal.addEventListener("abort",function(){a.disconnect(),o.disconnect(),t!==null&&window.cancelAnimationFrame(t)})}function Li(e){var t=V(e,"a").filter(function(o){return!w(o,"ge-drawer-more")}),n=w(e,"ge-drawer-expanded");if(O(e,"ge-drawer-overflow ge-drawer-expanded"),t.forEach(function(o){O(o,"ge-tool-overflow")}),!!Mr(e,t)){C(e,"ge-drawer-overflow"),M(e,".ge-drawer-more")||I(e,m("tool.more"),"ge-drawer-more","bi bi-three-dots",function(){z(e,"ge-drawer-expanded")});for(var r=t.length-1;r>=0&&Mr(e,t);r--)C(t[r],"ge-tool-overflow");z(e,"ge-drawer-expanded",n)}}function Mr(e,t){var n=window.getComputedStyle(e),r=e.getBoundingClientRect().right-parseFloat(n.borderRightWidth)-parseFloat(n.paddingRight);return t.some(function(o){var a=o.getClientRects();return a.length>0&&a[0].right>r+.5})}function I(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(l){ie(a,l,o[l])}),a}function bn(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!Mi(t)})}function Mi(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:y.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Pi(e,t){bn(e).forEach(function(n){O(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&C(e,n)}),at(e)}function nt(e,t,n){var r=zi(t,n||[]);Kn.set(t,r),I(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){Ri(t,r,this)});var o=ue(t);return Object.keys(W).forEach(function(a){W[a].drawerTools&&W[a].drawerTools(e,t,o)}),Object.keys(L).forEach(function(a){L[a].drawerTools&&L[a].drawerTools(e,t,o)}),e.appendChild(r)}function zi(e,t){var n=v("div",{class:"ge-details"});n.appendChild(Pr(m("panel.section_general")));var r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(g){var h=v("label",{class:"ge-field"});return h.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(h)},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 l=v("input",{class:"ge-classes form-control form-control-sm",placeholder:m("tool.classes_placeholder"),title:m("tool.classes_title")});l.value=bn(e).join(" "),o(m("panel.classes")).appendChild(l),l.addEventListener("change",function(){Pi(e,this.value),ce(e)});var d=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var h=w(e,g.cssClass),E=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":h?"true":"false"});E.innerHTML=g.label,z(E,"active",h),E.addEventListener("click",function(){z(E,"active"),E.setAttribute("aria-pressed",w(E,"active")?"true":"false"),z(e,g.cssClass,w(E,"active")),ce(e)}),d.appendChild(E)}),ji(e).forEach(function(g){n.appendChild(g)});var c=ci(e);return c&&n.appendChild(c),n}function Pr(e){return v("h6",{class:"ge-section-title"},e)}function ji(e){var t=ue(e),n=jr(),r=[];return[S,L,W].forEach(function(o){Object.keys(o).forEach(function(a){var l=o[a],d=l.panelSection?l.panelSection(e,t):null;if(!(!d||!d.body)){var c=v("div",{class:"ge-panel-section","data-ge-plugin":a});if(n==="offcanvas"||n==="modal")c.appendChild(Pr(m(d.labelKey))),c.appendChild(d.body);else{var g=m(d.labelKey),h=c.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},g));pe(d.body),c.appendChild(d.body),h.addEventListener("click",function(){Fr(d.titleKey?m(d.titleKey,{kind:Ur(e)}):g,d.body,h)})}r.push(c)}})}),r}var zr=["offcanvas","popover","modal","inline"],B={},K=null,xt=new WeakMap;function jr(){return zr.indexOf(s.settings_panel)!==-1?s.settings_panel:(X("settings_panel",'settings_panel "'+s.settings_panel+'" is not one of '+zr.join(", ")+": using offcanvas"),"offcanvas")}function Rr(e){return e&&Kn.get(e)||null}function Dr(){return K&&K.mode!=="inline"?[f,K.details]:[f]}function Ri(e,t,n){var r=jr();if(r==="inline"){Rn(t);return}var o=K&&K.details===t;Ce(),o||Di(r,e,t,n)}function Di(e,t,n,r){var o=Ii(e),a=new AbortController;K={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},T(o,".ge-settings-title").textContent=m("panel.title",{kind:Ur(t)}),T(o,".ge-settings-body").appendChild(n),je(n),C(t,"ge-settings-target");var l={signal:a.signal};if(document.addEventListener("keydown",function(c){c.key==="Escape"&&!me&&Ce()},l),e==="offcanvas"){var d=window.innerWidth<576;z(o,"offcanvas-end",!d),z(o,"offcanvas-bottom",d),O(o,"hiding"),o.getBoundingClientRect(),C(o,"show")}else e==="popover"?(wn(o,r),ie(window,"scroll resize",function(){wn(o,r)},l),window.ResizeObserver&&(K.observer=new window.ResizeObserver(function(){wn(o,r)}),K.observer.observe(n)),ie(document,"mousedown touchstart",function(c){!me&&!o.contains(c.target)&&!r.contains(c.target)&&Ce()},l)):yn(o,function(){K&&K.mode==="modal"&&Ce()})}function Ce(){ge();var e=K;if(e){K=null;var t=B[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(O(t,"show"),C(t,"hiding"),window.setTimeout(function(){O(t,"hiding")},300)):e.mode==="popover"?pe(t):Cn(t),O(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),lt(e.details),e.home&&ze(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 Ii(e){if(B[e])return B[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=G('<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>'),T(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=G('<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>'),T(n,".popover-header").appendChild(t()),pe(n)):(n=G('<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>'),T(n,".modal-header").appendChild(t()),T(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),Ve(n,"click",".ge-settings-close",function(r){r.preventDefault(),Ce()}),B[e]=document.body.appendChild(n),n}function Ir(){Ce(),Object.keys(B).forEach(function(e){e==="modal"?Xt(B[e]):B[e].remove()}),Object.keys(B).forEach(function(e){Nr(B[e])}),B={}}function wn(e,t){if(ze(t)){je(e);var n=t.getBoundingClientRect(),r=8,o=M(e,".popover-body");o.style.removeProperty("max-height");var a=st(e),l=Rt(e),d=window.innerHeight-n.bottom-2*r,c=n.top-2*r,g=l<=d||d>=c,h=g?d:c;l>h&&(ke(o,{"max-height":Math.max(120,h-(l-Rt(o)))}),l=Rt(e));var E=g?n.bottom+r:n.top-r-l,A=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));z(e,"bs-popover-bottom",g),z(e,"bs-popover-top",!g),ke(e,{top:E+window.pageYOffset,left:A+window.pageXOffset}),ke(M(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-A-8,a-24))})}}function yn(e,t){var n=ct(),r=xt.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},xt.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,qn(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"&&Cn(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?yn(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function Cn(e){var t=ct(),n=xt.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),O(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&w(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function Nr(e){var t=xt.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var ee=null,me=null;function Ni(){return ee||(ee=G('<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>'),T(ee,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),T(ee,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),Ve(ee,"click",".ge-dialog-close",function(e){e.preventDefault(),ge()}),document.body.appendChild(ee))}function Fr(e,t,n){ge();var r=Ni(),o=new AbortController;me={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},T(r,".ge-dialog-title").textContent=e,T(r,".ge-dialog-body").appendChild(t),je(t),ct()||document.addEventListener("keydown",function(a){a.key==="Escape"&&ge()},{signal:o.signal}),Object.keys(B).forEach(function(a){C(B[a],"ge-under-dialog")}),yn(r,function(){ge()})}function ge(){var e=me;e&&(me=null,e.listening.abort(),Cn(ee),Object.keys(B).forEach(function(t){O(B[t],"ge-under-dialog")}),pe(e.body),e.home&&ze(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&&ze(e.opener)&&e.opener.focus&&e.opener.focus())}function Hr(){ge(),ee&&(Nr(ee),Xt(ee),ee=null)}function Ur(e){var t=ue(e);if(S[t]&&S[t].labelKey)return m(S[t].labelKey);var n=Object.keys(S).filter(function(r){return S[r].paneKind===t&&S[r].paneLabelKey})[0];if(n)return m(S[n].paneLabelKey);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 Fi(){_(f,'.column, div[class*="col-"], div.col').forEach(function(e){C(e,"column"),!(Bi(e).length||Wr(e.parentElement))&&Tt(e,y[0],F)})}function Wr(e){return w(e,"row")&&y.some(function(t){return Ge.some(function(n){return w(e,Fn(t,n))})})}function rt(e,t){if(!w(e,"row"))return null;for(var n=y.indexOf(t);n>=0;n--)for(var r=0;r<Ge.length;r++)if(w(e,Fn(y[n],Ge[r])))return{tier:n,value:Ge[r]};return null}function Kr(e,t){for(var n=y.indexOf(t);n>=0;n--){var r=Ue(e,y[n]);if(r!==null)return{tier:n,size:r}}return null}function _t(e,t){var n=rt(e.parentElement,t);if(!n)return null;var r=Kr(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function Hi(e){return e.value==="auto"?0:F/parseInt(e.value,10)}function Ui(e,t){var n=_t(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:Wr(e.parentElement)&&!Kr(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function Wi(e){xe(e,".row").forEach(function(t){var n=s.row_cols===!1?null:P===$?rt(t,y[0])||null:rt(t,Q(P));n?t.setAttribute("data-ge-row-cols",Br(n.value)):t.removeAttribute("data-ge-row-cols")})}function Br(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function Ki(){return{name:"row-cols",prefix:"row-cols",values:Ge,appliesTo:["row"],labelKey:"utility.row_cols"}}function Ue(e,t){var n=Gr(e,t.colPrefix);return n!==null?n:w(e,Re(t,"auto"))?"auto":w(e,Re(t,"equal"))?"equal":null}function kt(e,t){return Gr(e,t.offsetPrefix)}function En(e,t){return Vr(e,t,Ue)}function At(e,t){return Vr(e,t,kt)}function Vr(e,t,n){for(var r=y.indexOf(t);r>=0;r--){var o=n(e,y[r]);if(o!==null)return o}return null}function Gr(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function qr(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 Tt(e,t,n){qr(e,t.colPrefix,null),Nn.forEach(function(r){O(e,Re(t,r))}),n!=null&&C(e,Re(t,n))}function xn(e,t,n){qr(e,t.offsetPrefix,n||null)}function Bi(e){return y.filter(function(t){return Ue(e,t)!==null})}function _n(e,t,n){var r=0;return V(e,".column").forEach(function(o){if(!(n&&o===n)){var a=_t(o,t),l=a?Hi(a):En(o,t);r+=(q(l)?l:0)+(At(o,t)||0)}}),F-r}function Ot(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),go),t===null||!q(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),F),t+n<=F?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:F-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function We(e){xe(e,".column").forEach(function(t){ke(t,{width:"",height:"",left:"",top:""}),lt(t)})}function Xr(e){return"ge-"+e+"-"+wo}function kn(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(St("blocks")).join(", ")}function St(e){return Object.keys(L).map(function(t){return L[t][e]||null}).filter(function(t){return t!==null})}function An(e,t){var n=!0;return Object.keys(L).forEach(function(r){var o=L[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function Vi(){return s.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 Lt(e,t){var n=ho();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=s.drag_handle==="drawer",o=Vi(),a=0;e.forEach(function(l){var d=t.group?{name:Xr(t.group)}:{name:Xr(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(d.put=function(c,g,h){return g.options.group.name===d.name&&t.accepts(c.el,h)}),gt.push(n.create(l,Object.assign({group:d,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(c,g){return J(c.target,o,l)?!0:!g||g.parentNode!==l},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:s.drag.animation,delay:s.drag.delay||s.drag.touch_delay,delayOnTouchOnly:!s.drag.delay,touchStartThreshold:s.drag.threshold,scroll:s.drag.scroll,onStart:qi,onEnd:Yi},t.options||{})))})}}function Gi(){if(!ho()){X("sortable_missing",m("error.sortable_missing"));return}Lt(_(f,".row"),{draggable:".column",group:"column"}),Lt([f].concat(_(f,".column")),{draggable:kn(),group:"block",accepts:An});var e=St("regions");e.length&&Lt(_(f,e.join(", ")),{draggable:">"+kn(),group:"block",accepts:An}),oe("onSortable",Lt)}function qi(e){var t=e.item,n=en(t),r=Yr(t),o={from:n,canceled:!1};Kt.set(t,o),Y(function(){var a=D("before-move",ne(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function Yr(e){var t=w(e,"ge-text-block")&&M(e,".ge-content")||e;return{kind:ue(t),node:t}}function Xi(e,t){var n=V(t.parent).filter(function(r){return r!==e&&!w(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function Yi(e){var t=e.item,n=Kt.get(t),r=n?n.from:en(t);if(Kt.delete(t),n&&n.canceled){Xi(t,r);return}var o=en(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=J(t,"[data-ge-container]"),l=S[Me(a)];l&&l.afterPaneMove&&l.afterPaneMove(a,t,r);var d=Yr(t);Y(function(){D("after-move",ne(d.kind,d.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function Ji(){s.resize.enabled&&_(f,".column").forEach(function(e){if(!M(e,".ge-resize-handle")){var t=M(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),$i().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",Qi),e.appendChild(r)})}})}function $i(){return String(s.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function Qi(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=st(n);if(e.preventDefault(),!ea(n))return;C(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function l(g){var h=g.pageX-o;return Math.max(1,a+(r?-h:h))}function d(g){n.style.width=l(g)+"px",ta(n,l(g))}function c(g){t.removeEventListener("pointermove",d),Dn(t,"pointerup pointercancel",c),O(n,"ge-resizing"),na(n,l(g))}t.addEventListener("pointermove",d),ie(t,"pointerup pointercancel",c)}function Zi(){Jr(f)}function Jr(e){_(e,".ge-resize-handle").forEach(function(t){t.remove()}),_(e,".ge-resize-size").forEach(function(t){t.remove()}),We(e)}function $r(e,t){var n=Math.round(t/Lr(e.parentElement)*F),r=Qr(e),o=r?Qe(r):null,a=vt.get(e),l=a?a.units:Ze(e),d=r&&q(o)?l+o-tt(s.valid_col_sizes):F-et(e);return Math.min(Math.max(n,tt(s.valid_col_sizes)),Math.max(d,tt(s.valid_col_sizes)),vn(s.valid_col_sizes))}function Qr(e){return s.resize.balance!=="next"?null:ao(e,".column")[0]||null}function Tn(e,t){var n=M(e,".ge-tools-drawer"),r=n?M(n,".ge-resize-size"):null;r&&(r.textContent=t)}function Zr(e){return(P===$?y[0].colPrefix:ye().colPrefix)+e}function ea(e){var t=Qe(e),n=Y(function(){return D("before-resize",ne("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:Ze(e)};return vt.set(e,r),Tn(e,Zr(r.units)),!0}function ta(e,t){Tn(e,Zr($r(e,t)))}function na(e,t){var n=vt.get(e),r=$r(e,t);if(vt.delete(e),Tn(e,""),We(e),!!n&&r!==n.units){var o=Jt(e,r);o&&Y(function(){$t(e,o),ra(e,r-n.units),ce(e),D("after-resize",ne("column",e,Qt({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function ra(e,t){var n=Qr(e);if(!(!n||!t)){var r=Qe(n);if(q(r)){var o=Jt(n,r-t);o&&($t(n,o),ce(n))}}}function oa(){gt.forEach(function(e){e.destroy()}),gt=[]}function Ke(){return v("div",{class:"row"})}function Mt(e,t,n){var r=null;if(xa.forEach(function(d){r===null&&n&&n[d]!==void 0&&(r=d)}),r===null)return e;var o=ae(n[r]);if(!o)return U(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,l=function(){return re(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):It(e,o)},{parent:a,source:n.source||"api"})};return qe>0?(qt(l),e):l()}function ia(e,t){var n=Ke();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(U("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=Ye(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(Ee(r))}),Mt(n,"row",t)}function aa(e,t){t=t||{};var n=ae(t.appendTo||t.prependTo||null);e===void 0&&n&&rt(n,ye())?e=null:!q(e)&&Nn.indexOf(e)===-1&&(U("createColumn: no column size given, using "+F),e=F);var r=Ee(e,t.offset);return t.content!==void 0&&r.appendChild(va(t.content)),Mt(r,"column",t)}function la(e,t){t=t||{};var n=S[e];return n?Mt(n.create(t),e,t):(U('createContainer: no such container type "'+e+'"'),null)}function On(e,t,n){e=ae(e),n=n||{};var r=S[Me(e)];if(!r||Me(e)!==t)return U("this is not a "+t+" container"),null;var o=r.addPane(e,n);return o?re(r.paneKind,o,function(){},{parent:e,source:"api",container:e}):null}function sa(e,t){e=ae(e);var n=Me(e);return!S[n]||!S[n].addPane?(U("addPane: this is not a container with panes"),null):On(e,n,t)}function Sn(){var e={};return Object.keys(s).forEach(function(t){var n=s[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function Ee(e,t){var n=v("div",{class:"column"}),r=po(P)[0],o=Ot({size:e,offset:t||0,leading:"offset"});return Tt(n,r,o.size===null?e:o.size),xn(n,r,o.offset),n}function Ln(e,t){if(!(!s.custom_filter||!s.custom_filter.length)){var n=typeof s.custom_filter=="string"||typeof s.custom_filter=="function"?[s.custom_filter]:s.custom_filter;Array.prototype.forEach.call(n,function(r){typeof r=="string"&&(r=window[r]),r(t||f,e)})}}function ua(){var e=[".row","[data-ge-container]"];return Object.keys(L).forEach(function(t){var n=L[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function da(e){_(f,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(w(t,"ge-rte-active")||!V(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=w(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],a=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(c){c.nodeType===1&&c.matches(e)?(o.push({text:a},{block:c}),a=[]):a.push(c)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var l=!1,d=r;o.forEach(function(c){var g;if(c.block)g=c.block;else if(ca(c.text))l?(g=Mn(n),c.text.forEach(function(h){g.appendChild(h)})):(c.text.forEach(function(h){t.appendChild(h)}),g=r,l=!0);else return;g!==d&&It(g,d),d=g}),l||r.remove()}})}function ca(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function fa(e){_(f,".column").forEach(function(t){var n=[];V(t).forEach(function(r){_e(r,".ge-tools-drawer, .ge-resize-handle")||(_e(r,".ge-content, .ge-text-block")||r.matches(e)?n=eo(n):n.push(r))}),eo(n)})}function eo(e){if(e.length){var t=It(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 ma(){_(f,".column > .ge-content").forEach(function(e){uo(e,v("div",{class:"ge-text-block"}))}),_(f,".ge-text-block").forEach(function(e){if(!M(e,".ge-tools-drawer")){var t=M(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?Vo(n)||pa(e,n):ga(e)}})}function to(e){_(e,".ge-text-block").forEach(function(t){Nt(t)})}function ga(e){var t=M(e,".ge-content"),n=He(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");C(e,"ge-plain-block"),Pe(n),Object.keys(L).forEach(function(r){L[r].plainTools&&L[r].plainTools(n,t)}),I(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){Te("plain",t,m("confirm.delete_plain"),function(r){ut(e,function(){e.remove(),r()})})})}function pa(e,t){var n=M(e,".ge-content"),r=He(e,"ge-tools-drawer ge-text-drawer");Pe(r),I(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),I(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){Te("text",n,m("confirm.delete_text"),function(o){ut(e,function(){e.remove(),o()})})})}function va(e){var t=lr(),n=Mn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):it(n,e),n}function no(e){P=e,In.forEach(function(t){z(f,"ge-layout-"+t,t===e)}),T(Ie,"button").textContent=m(dt(e))}function Pn(e){return In.indexOf(e)===-1?null:e}function ro(e){var t=Pn(e);if(t===null){U("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=P;no(t),t!==n&&(Dr().forEach(function(r){_(r,".ge-utilities").forEach(function(o){gn(o)})}),Er(null),$e(f),oe("onViewChange",t),D("view-change",{canvas:f,breakpoint:t,from:n,to:t}))}function zn(){return P}function oo(e,t,n){return function(){return Le[e]?Le[e].apply(null,arguments):(X("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}function ha(e){if(!s.active_target){X("active_target","setActiveTarget needs the active_target setting: without it, it does nothing");return}if(e==null){Oe(null);return}var t=ae(e);if(!qo(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);U("setActiveTarget: "+n+" is not a column or a region of the canvas");return}Oe(t)}var jn={getHtml:Je,getPlainHtml:$o,init:function(){qt(de)},reset:function(){qt(sr)},deinit:Se,destroy:Zo,changeView:ro,getView:zn,createRow:ia,createColumn:aa,createText:function(e,t){return Le.createText?Le.createText(e,t):(X("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:oo("createElement","elements","elements"),createSection:oo("createSection","sections","sections"),createContainer:la,addTab:function(e,t){return On(e,"tabs",t)},addAccordionItem:function(e,t){return On(e,"accordion",t)},addPane:sa,setLocale:yo,getUtility:wr,setUtility:mn,getActiveTarget:function(){return s.active_target?H:null},setActiveTarget:ha};Object.keys(jn).forEach(function(e){var t=!!(mo[e]&&mo[e].value);i[e]=function(){if(pt)return X("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?f.innerHTML:e==="getPlainHtml"?Hn(f.innerHTML):t?null:i;var n=jn[e].apply(i,arguments);return t?n:i}}),i.canvas=f,i.settings=Sn(),Ft.set(f,i),ei(),i.settings=Sn(),Object.keys(Le).forEach(function(e){Object.prototype.hasOwnProperty.call(jn,e)||e in i||(i[e]=function(){return pt?(X("destroyed:"+e,m("warning.destroyed",{method:e})),null):Le[e].apply(null,arguments)})}),ko(),de(),k._created.forEach(function(e){e(i)})}k._created=[];k.containers={};k.features={};k.utilities={};k.texts={};k.t=Un;k._plainHtml=Hn;k.Sortable=null;k.bootstrap=null;k.version="8.8.1";k.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
2
2
  (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
3
3
  (hold shift for min)`,"tool.column_wider":`Make column wider
4
4
  (hold shift for max)`,"tool.indent_decrease":`Decrease indent
@@ -467,6 +467,10 @@ GridEditor.containers.tabs = function(ge) {
467
467
  all(container, ".ge-tab-pane").forEach(function(pane) {
468
468
  removeClass(pane, "ge-tab-pane");
469
469
  });
470
+ all(container, ".ge-tab").forEach(function(tab) {
471
+ removeClass(tab, "ge-tab");
472
+ dropEmptyClass(tab);
473
+ });
470
474
  ge.unwrapLabels(container);
471
475
  },
472
476
  // The same, on a copy of the canvas: unmark only touches markup
@@ -471,6 +471,10 @@
471
471
  all(container, ".ge-tab-pane").forEach(function(pane) {
472
472
  removeClass(pane, "ge-tab-pane");
473
473
  });
474
+ all(container, ".ge-tab").forEach(function(tab) {
475
+ removeClass(tab, "ge-tab");
476
+ dropEmptyClass(tab);
477
+ });
474
478
  ge.unwrapLabels(container);
475
479
  },
476
480
  // The same, on a copy of the canvas: unmark only touches markup
@@ -1 +1 @@
1
- (()=>{var x=window.GridEditor;if(!x||typeof x.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function p(t,l){return t?Array.prototype.slice.call(t.querySelectorAll(l)):[]}function g(t,l){return t?t.querySelector(l):null}function F(t,l){if(!t)return[];var o=p(t,l);return t.nodeType===1&&t.matches(l)&&o.unshift(t),o}function w(t,l){return t?Array.prototype.filter.call(t.children,function(o){return!l||o.matches(l)}):[]}function j(t,l){return w(t,l)[0]||null}function f(t,l,o){var c=document.createElement(t);return Object.keys(l||{}).forEach(function(h){var d=l[h];d!=null&&d!==!1&&c.setAttribute(h,d)}),o!=null&&(c.textContent=o),c}function b(t,l){return L(l).forEach(function(o){t.classList.add(o)}),t}function m(t,l){return L(l).forEach(function(o){t.classList.remove(o)}),t}function M(t,l,o){return L(l).forEach(function(c){o===void 0?t.classList.toggle(c):t.classList.toggle(c,!!o)}),t}function O(t,l){return!!t&&t.nodeType===1&&t.classList.contains(l)}function L(t){return String(t||"").split(/\s+/).filter(Boolean)}function k(t){return t.getAttribute("class")||t.removeAttribute("class"),t}function V(t){return t.style.display="none",t}function Y(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}var X=400;function $(t,l,o,c){o=o===void 0?X:o;var h=function(){V(t),c&&c()};if(!Y(t)||!t.animate||o<=0){window.setTimeout(h,0);return}var d=t.animate(l(getComputedStyle(t)),{duration:o,easing:"ease-in-out"}),y=!1,_=function(){y||(y=!0,h())};d.onfinish=_,d.oncancel=_}function G(t,l,o){$(t,function(c){return[{opacity:c.opacity},{opacity:0}]},l,o)}Object.assign(x.locales.en,{"container.add_tabs":"Tabs","container.add_tab":"Add tab","container.tab_label":"Tab {number}","confirm.delete_tab":"Delete this tab and everything in it?","container.tabs_section":"Tabs","container.tabs_style":"Style","container.tabs_style_tabs":"Tabs","container.tabs_style_pills":"Pills","container.tabs_style_underline":"Underline","container.tabs_width":"Width","container.tabs_width_natural":"Natural","container.tabs_width_fill":"Fill","container.tabs_width_justified":"Justified","container.tabs_align":"Alignment","container.tabs_align_start":"Start","container.tabs_align_center":"Center","container.tabs_align_end":"End","container.tabs_layout":"Layout","container.tabs_layout_horizontal":"Horizontal","container.tabs_layout_vertical":"Vertical","container.tabs_layout_vertical_from":"Vertical from {breakpoint}"});var A={tabs:"nav-tabs",pills:"nav-pills",underline:"nav-underline"},C={natural:null,fill:"nav-fill",justified:"nav-justified"},E={start:null,center:"justify-content-center",end:"justify-content-end"},K={variant:"tabs",width:"natural",align:"start",vertical:!1},B={variant:{labelKey:"container.tabs_style",choices:[{value:"tabs",labelKey:"container.tabs_style_tabs"},{value:"pills",labelKey:"container.tabs_style_pills"},{value:"underline",labelKey:"container.tabs_style_underline"}]},width:{labelKey:"container.tabs_width",choices:[{value:"natural",labelKey:"container.tabs_width_natural"},{value:"fill",labelKey:"container.tabs_width_fill"},{value:"justified",labelKey:"container.tabs_width_justified"}]},align:{labelKey:"container.tabs_align",choices:[{value:"start",labelKey:"container.tabs_align_start"},{value:"center",labelKey:"container.tabs_align_center"},{value:"end",labelKey:"container.tabs_align_end"}]},vertical:{labelKey:"container.tabs_layout"}},Z=0,S="data-ge-tabs-layout";function N(t){return Object.keys(t).map(function(l){return t[l]}).filter(Boolean)}x.containers.tabs=function(t){var l=[];function o(n){return j(n,".nav")}function c(){return t.breakpoints.slice(1)}function h(n){return n===!0?"":"-"+n}function d(n){var e=h(n);return{container:["d"+e+"-flex","align-items"+e+"-start"],strip:["flex"+e+"-column","me"+e+"-3"]}}function y(){return[!0].concat(c())}function _(n){var e=o(n),a=function(s,i){return!!s&&O(s,i)},r=function(s,i){return Object.keys(s).filter(function(v){return s[v]&&a(e,s[v])})[0]||i},u=y().filter(function(s){var i=d(s);return a(n,i.container[0])&&a(e,i.strip[0])})[0];return{variant:r(A,"tabs"),width:r(C,"natural"),align:r(E,"start"),vertical:u===void 0?!1:u}}function H(n,e,a){var r=o(n);if(r){if(e==="variant"&&(m(r,N(A).join(" ")),b(r,A[a])),(e==="width"||e==="vertical")&&(m(r,N(C).join(" ")),e==="width"&&C[a]&&b(r,C[a])),(e==="align"||e==="vertical"||e==="width"&&a!=="natural")&&(m(r,N(E).join(" ")),e==="align"&&E[a]&&b(r,E[a])),e==="vertical"&&(y().forEach(function(s){var i=d(s);m(n,i.container.join(" ")),m(r,i.strip.join(" "))}),r.removeAttribute("aria-orientation"),a!==!1)){var u=d(a);b(n,u.container.join(" ")),b(r,u.strip.join(" ")),r.setAttribute("aria-orientation","vertical")}k(n)}}function P(n){return n==="variant"?Object.keys(A):n==="width"?Object.keys(C):n==="align"?Object.keys(E):[!1].concat(y())}function J(n,e){var a=t.settings.tabs||{},r=n[e]!==void 0?n[e]:a[e];return r===void 0?K[e]:P(e).indexOf(r)!==-1?r:(t.warn("tabs: "+JSON.stringify(r)+" is not a "+e+", which takes "+JSON.stringify(P(e))+": "+JSON.stringify(K[e])+" is used"),K[e])}function W(n){var e=_(n).vertical;return e===!1?null:t.view()==="all"?(n.removeAttribute(S),/flex$/.test(getComputedStyle(n).display)?"vertical":"horizontal"):e===!0||t.breakpoints.indexOf(t.view())>=t.breakpoints.indexOf(e)?"vertical":"horizontal"}function D(n){var e=W(n);e?n.setAttribute(S,e):n.removeAttribute(S)}function I(n,e,a){var r=f("div",{class:"ge-tabs-variant"}),u="ge-tabs-variant-"+ ++Z;r.appendChild(f("label",{class:"form-label",for:u},t.t(n)));var s=r.appendChild(f("select",{class:"form-select form-select-sm",id:u}));return e.forEach(function(i){s.appendChild(f("option",{value:i.value},i.label))}),s.addEventListener("change",function(){a(s.value)}),{box:r,field:s}}function q(n){var e=f("div",{class:"ge-tabs-variants"}),a={};function r(i,v){H(n,i,v),D(n),s()}function u(i){return B[i].choices.map(function(v){return{value:v.value,label:t.t(v.labelKey)}})}["variant","width","align"].forEach(function(i){a[i]=I(B[i].labelKey,u(i),function(v){r(i,v)})}),a.vertical=I(B.vertical.labelKey,[{value:"false",label:t.t("container.tabs_layout_horizontal")},{value:"true",label:t.t("container.tabs_layout_vertical")}].concat(c().map(function(i){return{value:i,label:t.t("container.tabs_layout_vertical_from",{breakpoint:i})}})),function(i){r("vertical",i==="true"?!0:i==="false"?!1:i)}),["variant","width","align","vertical"].forEach(function(i){a[i].box.setAttribute("data-ge-tabs-variant",i),e.appendChild(a[i].box)});function s(){var i=_(n);a.variant.field.value=i.variant,a.width.field.value=i.width,a.align.field.value=i.align,a.vertical.field.value=String(i.vertical),a.width.field.disabled=i.vertical!==!1,a.align.field.disabled=i.vertical!==!1||i.width!=="natural"}return s(),l.push({container:n,element:e,render:s}),e}function R(n,e){e=e||{};var a=o(n),r=g(n,":scope > .tab-content"),u=t.containerId("tab"),s=w(a,".nav-item").length+1,i=a.appendChild(f("li",{class:"nav-item ge-tab",role:"presentation"})),v=i.appendChild(f("button",{class:"nav-link",type:"button",role:"tab","data-bs-toggle":"tab","data-bs-target":"#"+u,"aria-controls":u}));v.appendChild(f("span",{class:"ge-pane-label"},e.label||t.t("container.tab_label",{number:s})));var T=r.appendChild(f("div",{class:"tab-pane fade",role:"tabpanel",tabindex:"0",id:u}));return T.appendChild(t.defaultRegion()),(e.activate||s===1)&&U(n,T),T}function U(n,e){var a=e.getAttribute("id");p(n,":scope > .tab-content > .tab-pane").forEach(function(r){m(r,"show active")}),b(e,"show active"),p(o(n)||n,".nav-link").forEach(function(r){var u=r.getAttribute("data-bs-target")==="#"+a;M(r,"active",u),r.setAttribute("aria-selected",u?"true":"false")})}function z(n,e){var a=g(e,".nav-link"),r=a?a.getAttribute("data-bs-target"):null;return r?g(n,r):null}return{labelKey:"container.add_tabs",onSortable:function(n){n(p(t.canvas,".ge-container-tabs").map(o).filter(Boolean),{draggable:".ge-tab"})},addPaneKey:"container.add_tab",paneKind:"tab",create:function(n){var e=f("div",{"data-ge-container":"tabs"}),a=n.labels||[],r=n.tabs||a.length||2;e.appendChild(f("ul",{class:"nav nav-tabs",role:"tablist"})),e.appendChild(f("div",{class:"tab-content"})),["variant","width","align","vertical"].forEach(function(s){H(e,s,J(n,s))});for(var u=0;u<r;u++)R(e,{label:a[u]});return e},addPane:R,mark:function(n){p(n,":scope > .tab-content > .tab-pane").forEach(function(e){b(e,"ge-tab-pane")}),w(o(n)||n,".nav-item").forEach(function(e){b(e,"ge-tab");var a=g(e,".nav-link");a&&t.makeLabelEditable(t.labelIn(a)),!j(e,".ge-tools-drawer")&&t.createPaneControls(e,"tab",t.settings.tab_tools,t.t("confirm.delete_tab"),function(r){var u=z(n,e),s=O(u,"active");G(e,200,function(){u&&u.remove(),r();var i=g(n,":scope > .tab-content > .tab-pane");s&&i&&U(n,i)})})})},unmark:function(n){t.resumeToggles(n),n.removeAttribute(S),p(n,".ge-tab-pane").forEach(function(e){m(e,"ge-tab-pane")}),t.unwrapLabels(n)},cleanMarkup:function(n){var e=this;p(n,'[data-ge-container="tabs"]').forEach(function(a){e.unmark(a)})},panelSection:function(n,e){return e!=="tabs"||!o(n)?null:{labelKey:"container.tabs_section",body:q(n)}},onRefresh:function(n){F(n,'[data-ge-container="tabs"]').forEach(D),l=l.filter(function(e){return e.element.isConnected}),l.forEach(function(e){(e.container===n||n.contains(e.container))&&e.render()})},onDeinit:function(){l=[]},afterPaneMove:function(n){var e=g(n,":scope > .tab-content");w(o(n)||n,".nav-item").forEach(function(a){var r=z(n,a);r&&e.appendChild(r)})}}};})();
1
+ (()=>{var x=window.GridEditor;if(!x||typeof x.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function b(e,l){return e?Array.prototype.slice.call(e.querySelectorAll(l)):[]}function g(e,l){return e?e.querySelector(l):null}function M(e,l){if(!e)return[];var o=b(e,l);return e.nodeType===1&&e.matches(l)&&o.unshift(e),o}function C(e,l){return e?Array.prototype.filter.call(e.children,function(o){return!l||o.matches(l)}):[]}function j(e,l){return C(e,l)[0]||null}function f(e,l,o){var c=document.createElement(e);return Object.keys(l||{}).forEach(function(h){var d=l[h];d!=null&&d!==!1&&c.setAttribute(h,d)}),o!=null&&(c.textContent=o),c}function p(e,l){return L(l).forEach(function(o){e.classList.add(o)}),e}function m(e,l){return L(l).forEach(function(o){e.classList.remove(o)}),e}function k(e,l,o){return L(l).forEach(function(c){o===void 0?e.classList.toggle(c):e.classList.toggle(c,!!o)}),e}function O(e,l){return!!e&&e.nodeType===1&&e.classList.contains(l)}function L(e){return String(e||"").split(/\s+/).filter(Boolean)}function K(e){return e.getAttribute("class")||e.removeAttribute("class"),e}function V(e){return e.style.display="none",e}function Y(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}var X=400;function $(e,l,o,c){o=o===void 0?X:o;var h=function(){V(e),c&&c()};if(!Y(e)||!e.animate||o<=0){window.setTimeout(h,0);return}var d=e.animate(l(getComputedStyle(e)),{duration:o,easing:"ease-in-out"}),y=!1,_=function(){y||(y=!0,h())};d.onfinish=_,d.oncancel=_}function G(e,l,o){$(e,function(c){return[{opacity:c.opacity},{opacity:0}]},l,o)}Object.assign(x.locales.en,{"container.add_tabs":"Tabs","container.add_tab":"Add tab","container.tab_label":"Tab {number}","confirm.delete_tab":"Delete this tab and everything in it?","container.tabs_section":"Tabs","container.tabs_style":"Style","container.tabs_style_tabs":"Tabs","container.tabs_style_pills":"Pills","container.tabs_style_underline":"Underline","container.tabs_width":"Width","container.tabs_width_natural":"Natural","container.tabs_width_fill":"Fill","container.tabs_width_justified":"Justified","container.tabs_align":"Alignment","container.tabs_align_start":"Start","container.tabs_align_center":"Center","container.tabs_align_end":"End","container.tabs_layout":"Layout","container.tabs_layout_horizontal":"Horizontal","container.tabs_layout_vertical":"Vertical","container.tabs_layout_vertical_from":"Vertical from {breakpoint}"});var A={tabs:"nav-tabs",pills:"nav-pills",underline:"nav-underline"},w={natural:null,fill:"nav-fill",justified:"nav-justified"},E={start:null,center:"justify-content-center",end:"justify-content-end"},B={variant:"tabs",width:"natural",align:"start",vertical:!1},N={variant:{labelKey:"container.tabs_style",choices:[{value:"tabs",labelKey:"container.tabs_style_tabs"},{value:"pills",labelKey:"container.tabs_style_pills"},{value:"underline",labelKey:"container.tabs_style_underline"}]},width:{labelKey:"container.tabs_width",choices:[{value:"natural",labelKey:"container.tabs_width_natural"},{value:"fill",labelKey:"container.tabs_width_fill"},{value:"justified",labelKey:"container.tabs_width_justified"}]},align:{labelKey:"container.tabs_align",choices:[{value:"start",labelKey:"container.tabs_align_start"},{value:"center",labelKey:"container.tabs_align_center"},{value:"end",labelKey:"container.tabs_align_end"}]},vertical:{labelKey:"container.tabs_layout"}},Z=0,S="data-ge-tabs-layout";function H(e){return Object.keys(e).map(function(l){return e[l]}).filter(Boolean)}x.containers.tabs=function(e){var l=[];function o(n){return j(n,".nav")}function c(){return e.breakpoints.slice(1)}function h(n){return n===!0?"":"-"+n}function d(n){var t=h(n);return{container:["d"+t+"-flex","align-items"+t+"-start"],strip:["flex"+t+"-column","me"+t+"-3"]}}function y(){return[!0].concat(c())}function _(n){var t=o(n),a=function(s,i){return!!s&&O(s,i)},r=function(s,i){return Object.keys(s).filter(function(v){return s[v]&&a(t,s[v])})[0]||i},u=y().filter(function(s){var i=d(s);return a(n,i.container[0])&&a(t,i.strip[0])})[0];return{variant:r(A,"tabs"),width:r(w,"natural"),align:r(E,"start"),vertical:u===void 0?!1:u}}function P(n,t,a){var r=o(n);if(r){if(t==="variant"&&(m(r,H(A).join(" ")),p(r,A[a])),(t==="width"||t==="vertical")&&(m(r,H(w).join(" ")),t==="width"&&w[a]&&p(r,w[a])),(t==="align"||t==="vertical"||t==="width"&&a!=="natural")&&(m(r,H(E).join(" ")),t==="align"&&E[a]&&p(r,E[a])),t==="vertical"&&(y().forEach(function(s){var i=d(s);m(n,i.container.join(" ")),m(r,i.strip.join(" "))}),r.removeAttribute("aria-orientation"),a!==!1)){var u=d(a);p(n,u.container.join(" ")),p(r,u.strip.join(" ")),r.setAttribute("aria-orientation","vertical")}K(n)}}function D(n){return n==="variant"?Object.keys(A):n==="width"?Object.keys(w):n==="align"?Object.keys(E):[!1].concat(y())}function J(n,t){var a=e.settings.tabs||{},r=n[t]!==void 0?n[t]:a[t];return r===void 0?B[t]:D(t).indexOf(r)!==-1?r:(e.warn("tabs: "+JSON.stringify(r)+" is not a "+t+", which takes "+JSON.stringify(D(t))+": "+JSON.stringify(B[t])+" is used"),B[t])}function W(n){var t=_(n).vertical;return t===!1?null:e.view()==="all"?(n.removeAttribute(S),/flex$/.test(getComputedStyle(n).display)?"vertical":"horizontal"):t===!0||e.breakpoints.indexOf(e.view())>=e.breakpoints.indexOf(t)?"vertical":"horizontal"}function I(n){var t=W(n);t?n.setAttribute(S,t):n.removeAttribute(S)}function R(n,t,a){var r=f("div",{class:"ge-tabs-variant"}),u="ge-tabs-variant-"+ ++Z;r.appendChild(f("label",{class:"form-label",for:u},e.t(n)));var s=r.appendChild(f("select",{class:"form-select form-select-sm",id:u}));return t.forEach(function(i){s.appendChild(f("option",{value:i.value},i.label))}),s.addEventListener("change",function(){a(s.value)}),{box:r,field:s}}function q(n){var t=f("div",{class:"ge-tabs-variants"}),a={};function r(i,v){P(n,i,v),I(n),s()}function u(i){return N[i].choices.map(function(v){return{value:v.value,label:e.t(v.labelKey)}})}["variant","width","align"].forEach(function(i){a[i]=R(N[i].labelKey,u(i),function(v){r(i,v)})}),a.vertical=R(N.vertical.labelKey,[{value:"false",label:e.t("container.tabs_layout_horizontal")},{value:"true",label:e.t("container.tabs_layout_vertical")}].concat(c().map(function(i){return{value:i,label:e.t("container.tabs_layout_vertical_from",{breakpoint:i})}})),function(i){r("vertical",i==="true"?!0:i==="false"?!1:i)}),["variant","width","align","vertical"].forEach(function(i){a[i].box.setAttribute("data-ge-tabs-variant",i),t.appendChild(a[i].box)});function s(){var i=_(n);a.variant.field.value=i.variant,a.width.field.value=i.width,a.align.field.value=i.align,a.vertical.field.value=String(i.vertical),a.width.field.disabled=i.vertical!==!1,a.align.field.disabled=i.vertical!==!1||i.width!=="natural"}return s(),l.push({container:n,element:t,render:s}),t}function U(n,t){t=t||{};var a=o(n),r=g(n,":scope > .tab-content"),u=e.containerId("tab"),s=C(a,".nav-item").length+1,i=a.appendChild(f("li",{class:"nav-item ge-tab",role:"presentation"})),v=i.appendChild(f("button",{class:"nav-link",type:"button",role:"tab","data-bs-toggle":"tab","data-bs-target":"#"+u,"aria-controls":u}));v.appendChild(f("span",{class:"ge-pane-label"},t.label||e.t("container.tab_label",{number:s})));var T=r.appendChild(f("div",{class:"tab-pane fade",role:"tabpanel",tabindex:"0",id:u}));return T.appendChild(e.defaultRegion()),(t.activate||s===1)&&z(n,T),T}function z(n,t){var a=t.getAttribute("id");b(n,":scope > .tab-content > .tab-pane").forEach(function(r){m(r,"show active")}),p(t,"show active"),b(o(n)||n,".nav-link").forEach(function(r){var u=r.getAttribute("data-bs-target")==="#"+a;k(r,"active",u),r.setAttribute("aria-selected",u?"true":"false")})}function F(n,t){var a=g(t,".nav-link"),r=a?a.getAttribute("data-bs-target"):null;return r?g(n,r):null}return{labelKey:"container.add_tabs",onSortable:function(n){n(b(e.canvas,".ge-container-tabs").map(o).filter(Boolean),{draggable:".ge-tab"})},addPaneKey:"container.add_tab",paneKind:"tab",create:function(n){var t=f("div",{"data-ge-container":"tabs"}),a=n.labels||[],r=n.tabs||a.length||2;t.appendChild(f("ul",{class:"nav nav-tabs",role:"tablist"})),t.appendChild(f("div",{class:"tab-content"})),["variant","width","align","vertical"].forEach(function(s){P(t,s,J(n,s))});for(var u=0;u<r;u++)U(t,{label:a[u]});return t},addPane:U,mark:function(n){b(n,":scope > .tab-content > .tab-pane").forEach(function(t){p(t,"ge-tab-pane")}),C(o(n)||n,".nav-item").forEach(function(t){p(t,"ge-tab");var a=g(t,".nav-link");a&&e.makeLabelEditable(e.labelIn(a)),!j(t,".ge-tools-drawer")&&e.createPaneControls(t,"tab",e.settings.tab_tools,e.t("confirm.delete_tab"),function(r){var u=F(n,t),s=O(u,"active");G(t,200,function(){u&&u.remove(),r();var i=g(n,":scope > .tab-content > .tab-pane");s&&i&&z(n,i)})})})},unmark:function(n){e.resumeToggles(n),n.removeAttribute(S),b(n,".ge-tab-pane").forEach(function(t){m(t,"ge-tab-pane")}),b(n,".ge-tab").forEach(function(t){m(t,"ge-tab"),K(t)}),e.unwrapLabels(n)},cleanMarkup:function(n){var t=this;b(n,'[data-ge-container="tabs"]').forEach(function(a){t.unmark(a)})},panelSection:function(n,t){return t!=="tabs"||!o(n)?null:{labelKey:"container.tabs_section",body:q(n)}},onRefresh:function(n){M(n,'[data-ge-container="tabs"]').forEach(I),l=l.filter(function(t){return t.element.isConnected}),l.forEach(function(t){(t.container===n||n.contains(t.container))&&t.render()})},onDeinit:function(){l=[]},afterPaneMove:function(n){var t=g(n,":scope > .tab-content");C(o(n)||n,".nav-item").forEach(function(a){var r=F(n,a);r&&t.appendChild(r)})}}};})();