formeo 4.1.4 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/demo/assets/css/demo.min.css +1 -1
- package/dist/demo/assets/css/demo.min.css.gz +0 -0
- package/dist/demo/assets/css/formeo.min.css +1 -1
- package/dist/demo/assets/js/demo.min.js +62 -62
- package/dist/demo/assets/js/demo.min.js.gz +0 -0
- package/dist/demo/assets/js/formeo.cjs.js +130 -29
- package/dist/demo/assets/js/formeo.es.js +130 -29
- package/dist/demo/assets/js/formeo.min.cjs.js +2 -2
- package/dist/demo/assets/js/formeo.min.es.js +3 -3
- package/dist/demo/assets/js/formeo.min.js +130 -29
- package/dist/demo/assets/js/formeo.min.umd.js +2 -2
- package/dist/demo/assets/js/formeo.umd.js +130 -29
- package/dist/demo/assets/js/index.min.js +1 -1
- package/dist/demo/assets/js/index.min2.js +1 -1
- package/dist/demo/assets/js/index.min3.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js.gz +0 -0
- package/dist/demo/assets/js/theme-github_light_default.min.js +1 -1
- package/dist/demo/index.html +1 -1
- package/dist/formeo.cjs.js +130 -29
- package/dist/formeo.css +1 -1
- package/dist/formeo.es.js +130 -29
- package/dist/formeo.min.cjs.js +2 -2
- package/dist/formeo.min.css +1 -1
- package/dist/formeo.min.es.js +3 -3
- package/dist/formeo.min.js +130 -29
- package/dist/formeo.min.umd.js +2 -2
- package/dist/formeo.umd.js +130 -29
- package/package.json +2 -2
package/dist/formeo.min.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
formeo - https://formeo.io
|
|
4
|
-
Version: 4.1.
|
|
4
|
+
Version: 4.1.4
|
|
5
5
|
Author: Draggable https://draggable.io
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class e{constructor(e=t){this.langs=Object.create(null),this.loaded=[],this.processConfig(e)}processConfig(e){const{location:n,...o}={...t,...e},i=n.replace(/\/?$/,"/");this.config={location:i,...o};const{override:r,preloaded:s={}}=this.config,a=Object.entries(this.langs).concat(Object.entries(r||s));this.langs=a.reduce(((t,[e,n])=>(t[e]=this.applyLanguage(e,n),t)),{}),this.locale=this.config.locale||this.config.langs[0]}init(t){return this.processConfig({...this.config,...t}),this.setCurrent(this.locale)}addLanguage(t,n={}){n="string"==typeof n?e.processFile(n):n,this.applyLanguage(t,n),this.config.langs.push("locale")}getValue(t,e=this.locale){var n;return(null==(n=this.langs[e])?void 0:n[t])||this.getFallbackValue(t)}getFallbackValue(t){const e=Object.values(this.langs).find((e=>e[t]));return null==e?void 0:e[t]}makeSafe(t){const e={"{":"\\{","}":"\\}","|":"\\|"};return t=t.replace(/[{}|]/g,(t=>e[t])),new RegExp(t,"g")}put(t,e){return this.current[t]=e,e}get(t,e){const n=this;let o=this.getValue(t);if(!o)return;const i=o.match(/\{[^}]+?\}/g);if(e&&i)if("object"==typeof e)for(const r of i){const t=r.substring(1,r.length-1);o=o.replace(n.makeSafe(r),e[t]||"")}else o=o.replace(/\{[^}]+?\}/g,e);return o}static processFile(t){return e.fromFile(t.replace(/\n\n/g,"\n"))}static fromFile(t){const e=t.split("\n"),n={};for(let o,i=0;i<e.length;i++){o=/^(.+?) *?= *?([^\n]+)/.exec(e[i]),o&&(n[o[1]]=o[2].replace(/(^\s+|\s+$)/g,""))}return n}loadLang(t,n=!0){const o=this;return new Promise((function(i,r){if(-1!==o.loaded.indexOf(t)&&n)return o.applyLanguage(o.langs[t]),i(o.langs[t]);return async function(t){try{const e=await fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const n=t.endsWith(".lang")?"text":"json";return await e[n]()}catch(e){throw e}}([o.config.location,t,o.config.extension].join("")).then((n=>{const r=e.processFile(n);return o.applyLanguage(t,r),o.loaded.push(t),i(o.langs[t])})).catch((e=>{const n=o.applyLanguage(t);i(n)}))}))}applyLanguage(t,e={}){const n=this.config.override[t]||{},o=this.langs[t]||{};return this.langs[t]={...o,...e,...n},this.langs[t]}get getLangs(){return this.config.langs}async setCurrent(t="en-US"){return await this.loadLang(t),this.locale=t,this.current=this.langs[t],this.current}}const n=new e;!function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('._3x4ZIcu-{position:absolute;background:#1f2937;color:#fff;padding:.75rem;border-radius:.375rem;max-width:200px;z-index:50;visibility:hidden;opacity:0;transition:opacity .2s;pointer-events:none;left:0;top:0}._3x4ZIcu-.JIt36hCJ{visibility:visible;opacity:1;pointer-events:all}._3x4ZIcu-:before{content:"";position:absolute;width:0;height:0;border:6px solid transparent}._3x4ZIcu-[data-position=top]:before{border-top-color:#1f2937;bottom:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=bottom]:before{border-bottom-color:#1f2937;top:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=left]:before{border-left-color:#1f2937;right:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=right]:before{border-right-color:#1f2937;left:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=top-left]:before{border-top-color:#1f2937;bottom:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=top-right]:before{border-top-color:#1f2937;bottom:-12px;right:12px;left:auto;transform:none}._3x4ZIcu-[data-position=bottom-left]:before{border-bottom-color:#1f2937;top:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=bottom-right]:before{border-bottom-color:#1f2937;top:-12px;right:12px;left:auto;transform:none}')),document.head.appendChild(t)}}catch(e){}}();var o=Object.defineProperty,i=(t,e,n)=>((t,e,n)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n);const r="_3x4ZIcu-",s="JIt36hCJ",a={triggerName:"tooltip"};class l{constructor(t=a){i(this,"triggerName"),i(this,"tooltip"),i(this,"activeTriggerType",null),i(this,"spacing",12),i(this,"handleClick",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}][${e}-type="click"]`);if(n)if(this.isVisible())this.hide();else{const t=n.getAttribute(`${e}`);this.show(n,t),this.activeTriggerType="click"}else this.hide()})),i(this,"handleMouseOver",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}]`);if("click"!==this.activeTriggerType&&"click"!==(null==n?void 0:n.getAttribute(`${e}-type`))){const t=null==n?void 0:n.getAttribute(`${e}`);t&&(this.show(n,t),this.activeTriggerType="hover")}})),i(this,"handleMouseOut",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}]`);"click"!==this.activeTriggerType&&"click"!==(null==n?void 0:n.getAttribute(`${e}-type`))&&this.hide()})),i(this,"handleResize",(()=>{this.isVisible()&&this.hide()})),i(this,"handleScroll",(()=>{this.isVisible()&&this.hide()})),this.triggerName=`data-${t.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${r}`,document.body.appendChild(this.tooltip),this.setupEventListeners()}setupEventListeners(){document.addEventListener("mouseover",this.handleMouseOver),document.addEventListener("mouseout",this.handleMouseOut),document.addEventListener("touchstart",this.handleMouseOver),document.addEventListener("touchend",this.handleMouseOut),document.addEventListener("click",this.handleClick),window.addEventListener("resize",this.handleResize),window.addEventListener("scroll",this.handleScroll,!0)}isVisible(){return this.tooltip.classList.contains(s)}calculatePosition(t){const e=t.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),o=[{name:"top",x:e.left+(e.width-n.width)/2,y:e.top-n.height-this.spacing},{name:"bottom",x:e.left+(e.width-n.width)/2,y:e.bottom+this.spacing},{name:"left",x:e.left-n.width-this.spacing,y:e.top+(e.height-n.height)/2},{name:"right",x:e.right+this.spacing,y:e.top+(e.height-n.height)/2},{name:"top-left",x:e.left,y:e.top-n.height-this.spacing},{name:"top-right",x:e.right-n.width,y:e.top-n.height-this.spacing},{name:"bottom-left",x:e.left,y:e.bottom+this.spacing},{name:"bottom-right",x:e.right-n.width,y:e.bottom+this.spacing}];return o.find((t=>this.fitsInViewport(t,n)))||o[0]}fitsInViewport(t,e){if(!(t.x>=0&&t.y>=0&&t.x+e.width<=window.innerWidth&&t.y+e.height<=window.innerHeight))return!1;return 0===[[t.x,t.y],[t.x+e.width,t.y],[t.x,t.y+e.height],[t.x+e.width,t.y+e.height],[t.x+e.width/2,t.y+e.height/2]].flatMap((([t,e])=>Array.from(document.elementsFromPoint(t,e)))).filter((t=>{if(this.tooltip.contains(t)||t===this.tooltip||t.classList.contains(r)||"none"===getComputedStyle(t).pointerEvents)return!1})).length}show(t,e){this.tooltip.innerHTML=e??"",this.tooltip.classList.add(s);const n=this.calculatePosition(t);this.tooltip.style.left=`${n.x}px`,this.tooltip.style.top=`${n.y}px`,this.tooltip.dataset.position=n.name}hide(){this.tooltip.classList.remove(s),this.activeTriggerType=null}destroy(){document.removeEventListener("mouseover",this.handleMouseOver),document.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("touchstart",this.handleMouseOver),document.removeEventListener("touchend",this.handleMouseOut),document.removeEventListener("click",this.handleClick),window.removeEventListener("resize",this.handleResize),window.removeEventListener("scroll",this.handleScroll,!0),this.tooltip.remove()}}void 0!==window&&(window.SmartTooltip=l);const c="formeo",d="4.1.3";var u,h,p,f,m,g,v,b,y,w,C,E,x,S,O,_,A,N,T,P,j,D,k,L,$,I,M,R,W,F,B,z,U,q,V,H,X,Y,G,Z,J,K,Q,tt,et,nt,ot,it,rt,st,at,lt,ct,dt,ut,ht,pt,ft,mt,gt,vt,bt,yt,wt,Ct,Et,xt,St,Ot,_t,At,Nt,Tt,Pt,jt,Dt,kt,Lt,$t,It,Mt,Rt,Wt,Ft,Bt,zt,Ut,qt,Vt,Ht,Xt,Yt,Gt,Zt,Jt,Kt,Qt,te,ee="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ne(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function oe(){if(f)return p;return f=1,p=function(t,e){return t===e||t!=t&&e!=e}}function ie(){if(g)return m;g=1;var t=oe();return m=function(e,n){for(var o=e.length;o--;)if(t(e[o][0],n))return o;return-1}}function re(){if(_)return O;_=1;var t=h?u:(h=1,u=function(){this.__data__=[],this.size=0}),e=function(){if(b)return v;b=1;var t=ie(),e=Array.prototype.splice;return v=function(n){var o=this.__data__,i=t(o,n);return!(i<0||(i==o.length-1?o.pop():e.call(o,i,1),--this.size,0))}}(),n=function(){if(w)return y;w=1;var t=ie();return y=function(e){var n=this.__data__,o=t(n,e);return o<0?void 0:n[o][1]}}(),o=function(){if(E)return C;E=1;var t=ie();return C=function(e){return t(this.__data__,e)>-1}}(),i=function(){if(S)return x;S=1;var t=ie();return x=function(e,n){var o=this.__data__,i=t(o,e);return i<0?(++this.size,o.push([e,n])):o[i][1]=n,this}}();function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,O=r}function se(){if(I)return $;I=1;var t="object"==typeof ee&&ee&&ee.Object===Object&ⅇreturn $=t}function ae(){if(R)return M;R=1;var t=se(),e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return M=n}function le(){if(F)return W;F=1;var t=ae().Symbol;return W=t}function ce(){if(H)return V;H=1;var t=le(),e=function(){if(z)return B;z=1;var t=le(),e=Object.prototype,n=e.hasOwnProperty,o=e.toString,i=t?t.toStringTag:void 0;return B=function(t){var e=n.call(t,i),r=t[i];try{t[i]=void 0;var s=!0}catch(l){}var a=o.call(t);return s&&(e?t[i]=r:delete t[i]),a}}(),n=function(){if(q)return U;q=1;var t=Object.prototype.toString;return U=function(e){return t.call(e)}}(),o=t?t.toStringTag:void 0;return V=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":o&&o in Object(t)?e(t):n(t)}}function de(){if(Y)return X;return Y=1,X=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}function ue(){if(Z)return G;Z=1;var t=ce(),e=de();return G=function(n){if(!e(n))return!1;var o=t(n);return"[object Function]"==o||"[object GeneratorFunction]"==o||"[object AsyncFunction]"==o||"[object Proxy]"==o}}function he(){if(tt)return Q;tt=1;var t,e=function(){if(K)return J;K=1;var t=ae()["__core-js_shared__"];return J=t}(),n=(t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"";return Q=function(t){return!!n&&n in t}}function pe(){if(nt)return et;nt=1;var t=Function.prototype.toString;return et=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function fe(){if(lt)return at;lt=1;var t=function(){if(it)return ot;it=1;var t=ue(),e=he(),n=de(),o=pe(),i=/^\[object .+?Constructor\]$/,r=Function.prototype,s=Object.prototype,a=r.toString,l=s.hasOwnProperty,c=RegExp("^"+a.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return ot=function(r){return!(!n(r)||e(r))&&(t(r)?c:i).test(o(r))}}(),e=st?rt:(st=1,rt=function(t,e){return null==t?void 0:t[e]});return at=function(n,o){var i=e(n,o);return t(i)?i:void 0}}function me(){if(dt)return ct;dt=1;var t=fe()(ae(),"Map");return ct=t}function ge(){if(ht)return ut;ht=1;var t=fe()(Object,"create");return ut=t}function ve(){if(St)return xt;St=1;var t=function(){if(ft)return pt;ft=1;var t=ge();return pt=function(){this.__data__=t?t(null):{},this.size=0}}(),e=gt?mt:(gt=1,mt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}),n=function(){if(bt)return vt;bt=1;var t=ge(),e=Object.prototype.hasOwnProperty;return vt=function(n){var o=this.__data__;if(t){var i=o[n];return"__lodash_hash_undefined__"===i?void 0:i}return e.call(o,n)?o[n]:void 0}}(),o=function(){if(wt)return yt;wt=1;var t=ge(),e=Object.prototype.hasOwnProperty;return yt=function(n){var o=this.__data__;return t?void 0!==o[n]:e.call(o,n)}}(),i=function(){if(Et)return Ct;Et=1;var t=ge();return Ct=function(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=t&&void 0===n?"__lodash_hash_undefined__":n,this}}();function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,xt=r}function be(){if(Pt)return Tt;Pt=1;var t=Nt?At:(Nt=1,At=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t});return Tt=function(e,n){var o=e.__data__;return t(n)?o["string"==typeof n?"string":"hash"]:o.map}}function ye(){if(Ft)return Wt;Ft=1;var t=function(){if(_t)return Ot;_t=1;var t=ve(),e=re(),n=me();return Ot=function(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}}(),e=function(){if(Dt)return jt;Dt=1;var t=be();return jt=function(e){var n=t(this,e).delete(e);return this.size-=n?1:0,n}}(),n=function(){if(Lt)return kt;Lt=1;var t=be();return kt=function(e){return t(this,e).get(e)}}(),o=function(){if(It)return $t;It=1;var t=be();return $t=function(e){return t(this,e).has(e)}}(),i=function(){if(Rt)return Mt;Rt=1;var t=be();return Mt=function(e,n){var o=t(this,e),i=o.size;return o.set(e,n),this.size+=o.size==i?0:1,this}}();function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,Wt=r}function we(){if(qt)return Ut;qt=1;var t=re(),e=function(){if(N)return A;N=1;var t=re();return A=function(){this.__data__=new t,this.size=0}}(),n=P?T:(P=1,T=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}),o=D?j:(D=1,j=function(t){return this.__data__.get(t)}),i=L?k:(L=1,k=function(t){return this.__data__.has(t)}),r=function(){if(zt)return Bt;zt=1;var t=re(),e=me(),n=ye();return Bt=function(o,i){var r=this.__data__;if(r instanceof t){var s=r.__data__;if(!e||s.length<199)return s.push([o,i]),this.size=++r.size,this;r=this.__data__=new n(s)}return r.set(o,i),this.size=r.size,this}}();function s(e){var n=this.__data__=new t(e);this.size=n.size}return s.prototype.clear=e,s.prototype.delete=n,s.prototype.get=o,s.prototype.has=i,s.prototype.set=r,Ut=s}function Ce(){if(Ht)return Vt;Ht=1;var t=fe(),e=function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return Vt=e}function Ee(){if(Yt)return Xt;Yt=1;var t=Ce();return Xt=function(e,n,o){"__proto__"==n&&t?t(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}}function xe(){if(Zt)return Gt;Zt=1;var t=Ee(),e=oe();return Gt=function(n,o,i){(void 0!==i&&!e(n[o],i)||void 0===i&&!(o in n))&&t(n,o,i)}}function Se(){if(te)return Qt;te=1;var t=(Kt?Jt:(Kt=1,Jt=function(t){return function(e,n,o){for(var i=-1,r=Object(e),s=o(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(r[l],l,r))break}return e}}))();return Qt=t}var Oe,_e,Ae,Ne,Te,Pe,je,De,ke,Le,$e,Ie,Me,Re,We,Fe,Be,ze,Ue,qe,Ve,He,Xe,Ye,Ge,Ze,Je,Ke,Qe,tn,en,nn,on,rn={exports:{}};function sn(){if(Ae)return _e;Ae=1;var t=ae().Uint8Array;return _e=t}function an(){if(je)return Pe;je=1;var t=function(){if(Te)return Ne;Te=1;var t=sn();return Ne=function(e){var n=new e.constructor(e.byteLength);return new t(n).set(new t(e)),n}}();return Pe=function(e,n){var o=n?t(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}}function ln(){if(Me)return Ie;return Me=1,Ie=function(t,e){return function(n){return t(e(n))}}}function cn(){if(We)return Re;We=1;var t=ln()(Object.getPrototypeOf,Object);return Re=t}function dn(){if(Be)return Fe;Be=1;var t=Object.prototype;return Fe=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}}function un(){if(Ue)return ze;Ue=1;var t=function(){if($e)return Le;$e=1;var t=de(),e=Object.create;return Le=function(){function n(){}return function(o){if(!t(o))return{};if(e)return e(o);n.prototype=o;var i=new n;return n.prototype=void 0,i}}()}(),e=cn(),n=dn();return ze=function(o){return"function"!=typeof o.constructor||n(o)?{}:t(e(o))}}function hn(){if(Ve)return qe;return Ve=1,qe=function(t){return null!=t&&"object"==typeof t}}function pn(){if(Ge)return Ye;Ge=1;var t=function(){if(Xe)return He;Xe=1;var t=ce(),e=hn();return He=function(n){return e(n)&&"[object Arguments]"==t(n)}}(),e=hn(),n=Object.prototype,o=n.hasOwnProperty,i=n.propertyIsEnumerable,r=t(function(){return arguments}())?t:function(t){return e(t)&&o.call(t,"callee")&&!i.call(t,"callee")};return Ye=r}function fn(){if(Je)return Ze;Je=1;var t=Array.isArray;return Ze=t}function mn(){if(Qe)return Ke;Qe=1;return Ke=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}}function gn(){if(en)return tn;en=1;var t=ue(),e=mn();return tn=function(n){return null!=n&&e(n.length)&&!t(n)}}var vn,bn,yn,wn,Cn,En,xn,Sn,On,_n={exports:{}};function An(){return yn||(yn=1,t=_n,e=_n.exports,n=ae(),o=bn?vn:(bn=1,vn=function(){return!1}),i=e&&!e.nodeType&&e,r=i&&t&&!t.nodeType&&t,s=r&&r.exports===i?n.Buffer:void 0,a=(s?s.isBuffer:void 0)||o,t.exports=a),_n.exports;var t,e,n,o,i,r,s,a}var Nn,Tn,Pn,jn,Dn,kn,Ln,$n,In,Mn,Rn,Wn,Fn,Bn,zn,Un,qn,Vn,Hn,Xn,Yn,Gn,Zn,Jn,Kn,Qn,to,eo,no,oo,io,ro,so,ao,lo,co,uo,ho,po,fo,mo,go,vo,bo,yo,wo,Co,Eo,xo,So={exports:{}};function Oo(){if(Pn)return Tn;Pn=1;var t=function(){if(xn)return En;xn=1;var t=ce(),e=mn(),n=hn(),o={};return o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,En=function(i){return n(i)&&e(i.length)&&!!o[t(i)]}}(),e=On?Sn:(On=1,Sn=function(t){return function(e){return t(e)}}),n=function(){return Nn||(Nn=1,t=So,e=So.exports,n=se(),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||r&&r.binding&&r.binding("util")}catch(t){}}(),t.exports=s),So.exports;var t,e,n,o,i,r,s}(),o=n&&n.isTypedArray,i=o?e(o):t;return Tn=i}function _o(){if(Dn)return jn;return Dn=1,jn=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}}function Ao(){if(Ln)return kn;Ln=1;var t=Ee(),e=oe(),n=Object.prototype.hasOwnProperty;return kn=function(o,i,r){var s=o[i];n.call(o,i)&&e(s,r)&&(void 0!==r||i in o)||t(o,i,r)}}function No(){if(Fn)return Wn;Fn=1;var t=/^(?:0|[1-9]\d*)$/;return Wn=function(e,n){var o=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==o||"symbol"!=o&&t.test(e))&&e>-1&&e%1==0&&e<n}}function To(){if(zn)return Bn;zn=1;var t=Rn?Mn:(Rn=1,Mn=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}),e=pn(),n=fn(),o=An(),i=No(),r=Oo(),s=Object.prototype.hasOwnProperty;return Bn=function(a,l){var c=n(a),d=!c&&e(a),u=!c&&!d&&o(a),h=!c&&!d&&!u&&r(a),p=c||d||u||h,f=p?t(a.length,String):[],m=f.length;for(var g in a)!l&&!s.call(a,g)||p&&("length"==g||u&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||i(g,m))||f.push(g);return f}}function Po(){if(Hn)return Vn;Hn=1;var t=de(),e=dn(),n=qn?Un:(qn=1,Un=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}),o=Object.prototype.hasOwnProperty;return Vn=function(i){if(!t(i))return n(i);var r=e(i),s=[];for(var a in i)("constructor"!=a||!r&&o.call(i,a))&&s.push(a);return s}}function jo(){if(Yn)return Xn;Yn=1;var t=To(),e=Po(),n=gn();return Xn=function(o){return n(o)?t(o,!0):e(o)}}function Do(){if(Zn)return Gn;Zn=1;var t=function(){if(In)return $n;In=1;var t=Ao(),e=Ee();return $n=function(n,o,i,r){var s=!i;i||(i={});for(var a=-1,l=o.length;++a<l;){var c=o[a],d=r?r(i[c],n[c],c,i,n):void 0;void 0===d&&(d=n[c]),s?e(i,c,d):t(i,c,d)}return i}}(),e=jo();return Gn=function(n){return t(n,e(n))}}function ko(){if(Kn)return Jn;Kn=1;var t,e,n,o,i,r,s,a=xe(),l=(Oe||(Oe=1,t=rn,e=rn.exports,n=ae(),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o?n.Buffer:void 0,s=r?r.allocUnsafe:void 0,t.exports=function(t,e){if(e)return t.slice();var n=t.length,o=s?s(n):new t.constructor(n);return t.copy(o),o}),rn.exports),c=an(),d=ke?De:(ke=1,De=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}),u=un(),h=pn(),p=fn(),f=function(){if(on)return nn;on=1;var t=gn(),e=hn();return nn=function(n){return e(n)&&t(n)}}(),m=An(),g=ue(),v=de(),b=function(){if(Cn)return wn;Cn=1;var t=ce(),e=cn(),n=hn(),o=Function.prototype,i=Object.prototype,r=o.toString,s=i.hasOwnProperty,a=r.call(Object);return wn=function(o){if(!n(o)||"[object Object]"!=t(o))return!1;var i=e(o);if(null===i)return!0;var l=s.call(i,"constructor")&&i.constructor;return"function"==typeof l&&l instanceof l&&r.call(l)==a}}(),y=Oo(),w=_o(),C=Do();return Jn=function(t,e,n,o,i,r,s){var E=w(t,n),x=w(e,n),S=s.get(x);if(S)a(t,n,S);else{var O=r?r(E,x,n+"",t,e,s):void 0,_=void 0===O;if(_){var A=p(x),N=!A&&m(x),T=!A&&!N&&y(x);O=x,A||N||T?p(E)?O=E:f(E)?O=d(E):N?(_=!1,O=l(x,!0)):T?(_=!1,O=c(x,!0)):O=[]:b(x)||h(x)?(O=E,h(E)?O=C(E):v(E)&&!g(E)||(O=u(x))):_=!1}_&&(s.set(x,O),i(O,x,o,r,s),s.delete(x)),a(t,n,O)}}}function Lo(){if(no)return eo;return no=1,eo=function(t){return t}}function $o(){if(so)return ro;so=1;var t=io?oo:(io=1,oo=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}),e=Math.max;return ro=function(n,o,i){return o=e(void 0===o?n.length-1:o,0),function(){for(var r=arguments,s=-1,a=e(r.length-o,0),l=Array(a);++s<a;)l[s]=r[o+s];s=-1;for(var c=Array(o+1);++s<o;)c[s]=r[s];return c[o]=i(l),t(n,this,c)}},ro}function Io(){if(uo)return co;uo=1;var t=lo?ao:(lo=1,ao=function(t){return function(){return t}}),e=Ce(),n=Lo();return co=e?function(n,o){return e(n,"toString",{configurable:!0,enumerable:!1,value:t(o),writable:!0})}:n}function Mo(){if(mo)return fo;mo=1;var t=Io(),e=function(){if(po)return ho;po=1;var t=Date.now;return ho=function(e){var n=0,o=0;return function(){var i=t(),r=16-(i-o);if(o=i,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}},ho}(),n=e(t);return fo=n}function Ro(){if(Co)return wo;Co=1;var t=function(){if(vo)return go;vo=1;var t=Lo(),e=$o(),n=Mo();return go=function(o,i){return n(e(o,i,t),o+"")}}(),e=function(){if(yo)return bo;yo=1;var t=oe(),e=gn(),n=No(),o=de();return bo=function(i,r,s){if(!o(s))return!1;var a=typeof r;return!!("number"==a?e(s)&&n(r,s.length):"string"==a&&r in s)&&t(s[r],i)}}();return wo=function(n){return t((function(t,o){var i=-1,r=o.length,s=r>1?o[r-1]:void 0,a=r>2?o[2]:void 0;for(s=n.length>3&&"function"==typeof s?(r--,s):void 0,a&&e(o[0],o[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var l=o[i];l&&n(t,l,i,s)}return t}))}}const Wo=ne(function(){if(xo)return Eo;xo=1;var t=function(){if(to)return Qn;to=1;var t=we(),e=xe(),n=Se(),o=ko(),i=de(),r=jo(),s=_o();return Qn=function a(l,c,d,u,h){l!==c&&n(c,(function(n,r){if(h||(h=new t),i(n))o(l,c,r,d,a,u,h);else{var p=u?u(s(l,r),n,r+"",l,c,h):void 0;void 0===p&&(p=n),e(l,r,p)}}),r)},Qn}(),e=Ro()((function(e,n,o,i){t(e,n,o,i)}));return Eo=e}()),Fo=()=>crypto.randomUUID().slice(0,8).slice(0,8),Bo=(t="",e)=>{if(!e)return!1;const n=/[|\\{}()[\]^*$+?.]/g;let o="string"==typeof e?[e]:e;o=o.map((t=>"*"===t?"":t.replace(n,"\\$&")));let i=!0;return o.length&&(i=!new RegExp(o.join("|"),"i").exec(t)),i},zo=t=>{const e=t.className?.match(Li);return e&&Di[e[0]]},Uo=t=>Array.from(new Set(t)),qo=t=>t?.attrs?.id||t?.id||Fo(),Vo=(t,e)=>Wo({},t,e,((t,e)=>Array.isArray(t)?null!=e?Uo(t.concat(e)):e:Array.isArray(e)?null!=t?Uo(e.concat(t)):e:void 0)),Ho=t=>{let e;if(null===t||!("object"==typeof t)||t instanceof Promise)return t;if(t instanceof Date)return e=new Date,e.setTime(t.getTime()),e;if(Array.isArray(t)){e=[];for(let n=0,o=t.length;n<o;n++)e[n]=Ho(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=Ho(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},Xo=(t,e)=>t/e*100,Yo=t=>`${t.toString()}%`,Go=Object.create(null,{get:{value:t=>{const e=window.sessionStorage?.getItem(t);try{return JSON.parse(e)}catch(n){return e}}},set:{value:(t,e)=>{try{return window.sessionStorage?.setItem(t,JSON.stringify(e))}catch(n){}}}}),Zo=t=>/^(stage|row|column|field)s./.test(t);function Jo(t,e=Vi){let n;return function(...o){n&&clearTimeout(n),n=setTimeout((()=>t.apply(this,o)),e)}}function Ko(t){return t}function Qo(){}function ti(t=Object.create(null)){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return Object.create(null)}return t}const ei=t=>t?Ho(ti(t)):cr();function ni(t,e,n,o={}){if(!e||!t[n][e])return o;o[`${n}.${e}`]=t[n][e];const i=Wi.get(n);if(i){const r=t[n][e].data?.children||[];for(const e of r)ni(t,e,i,o)}return o}const oi=c,ii=d,ri=oi,si="formeo-sprite",ai=[{name:"cssPreload",src:"//cdnjs.cloudflare.com/ajax/libs/loadCSS/2.0.1/cssrelpreload.min.js"},{name:"mutationObserver",src:"//cdn.jsdelivr.net/npm/mutationobserver-shim/dist/mutationobserver.min.js"},{name:"fetch",src:"https://unpkg.com/unfetch/polyfill"}],li=`../../lib/icons/${si}.svg`,ci=li,di="undefined"!=typeof process&&"development"===process.env?.NODE_ENV||!1?ci:`https://cdn.jsdelivr.net/npm/formeo@${ii}/dist/${si}.svg`,ui=`https://draggable.github.io/formeo/assets/img/${si}.svg`,hi=`https://cdn.jsdelivr.net/npm/formeo@${ii}/dist/formeo.min.css`,pi="f-panel",fi="control-group",mi=`${ri}-stage`,gi=`${ri}-row`,vi=`${ri}-column`,bi=`${ri}-field`,yi="custom-column-widths",wi="column-preset",Ci="resizing-columns",Ei=new Map([[mi,gi],[gi,vi],[vi,bi]]),xi=["stage","row","column","field"],Si=xi.map((t=>`${t}s`));new Map(Si.map(((t,e)=>[t,xi[e]])));const Oi=new RegExp(`^${Si.join("|")}.`),_i=[...xi],Ai=[...Si],Ni=new Map(Ai.map(((t,e)=>[t,_i[e]]))),Ti=_i.reduce(((t,e)=>(t[e]=e,t)),{}),Pi=[{name:"controls",className:fi},{name:"stage",className:mi},{name:"row",className:gi},{name:"column",className:vi},{name:"field",className:bi}],ji={controls:fi,stage:mi,row:gi,column:vi,field:bi},Di=Object.entries(ji).reduce(((t,[e,n])=>(t[n]=e,t)),{}),ki=Object.values(ji),Li=new RegExp(`${ki.join("|")}`,"g"),{childTypeMapVals:$i,childTypeIndexMapVals:Ii}=Pi.reduce(((t,{name:e},n,o)=>{const{name:i}=o[n+1]||{};return i&&(t.childTypeMapVals.push([e,i]),t.childTypeIndexMapVals.push([`${e}s`,`${i}s`])),t}),{childTypeMapVals:[],childTypeIndexMapVals:[]}),Mi=$i.slice().map((t=>t.slice().reverse())).reverse(),Ri=new Map($i),Wi=new Map(Ii),Fi=new Map(Mi.slice()),Bi=new Map([[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]].reduce(((t,e,n)=>(t.push([n,e]),t)),[])),zi=`${oi}-formData`,Ui=`${oi}-locale`,qi=333,Vi=Math.round(166.5),Hi=Math.round(666),Xi="formeoSaved",Yi="formeoUpdated",Gi="formeoOnRender",Zi={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},Ji={equals:"="},Ki=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],Qi=["isChecked","isNotChecked"],tr=["isVisible","isNotVisible"],er=["value"],nr={comparison:Zi,assignment:Ji,logical:{and:"&&",or:"||"}},or="if",ir="then",rr=()=>({[or]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[ir]:[{target:"",targetProperty:"",assignment:"",value:""}]}),sr=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)|(\b[0-9a-f]{8}\b)/g,ar=/\bcol-\w+-\d+/g,lr="f-i-",cr=()=>({id:qo(),stages:{[qo()]:{}},rows:{},columns:{},fields:{}}),dr=["selected","checked"],ur=dr.toReversed(),hr="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map((t=>`\\s${t}\\s`)),pr=new RegExp(`(?!${hr.join("|")})\\w\\S*`,"g"),fr=/\s+/g;function mr(t){if("string"!=typeof t)return t;if(t.trim().match(fr))return t;return t.replace(pr,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const gr=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),vr=t=>{if(Array.isArray(t))return t;const e=/[.[\]]/g,n=[];let o=0,i=e.exec(t);for(;null!==i;)n.push(t.slice(o,i.index)),o=i.index+i[0].length,i=e.exec(t);return o<t.length&&n.push(t.slice(o)),n.filter(Boolean)},br=(t,e="-")=>vr(t).join(e);var yr,wr,Cr,Er,xr,Sr,Or,_r,Ar,Nr,Tr,Pr,jr,Dr,kr,Lr,$r,Ir,Mr,Rr,Wr,Fr,Br,zr;function Ur(){if(wr)return yr;wr=1;var t=ce(),e=hn();return yr=function(n){return"symbol"==typeof n||e(n)&&"[object Symbol]"==t(n)}}function qr(){if(_r)return Or;_r=1;var t=function(){if(Sr)return xr;Sr=1;var t=ye();function e(n,o){if("function"!=typeof n||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");var i=function(){var t=arguments,e=o?o.apply(this,t):t[0],r=i.cache;if(r.has(e))return r.get(e);var s=n.apply(this,t);return i.cache=r.set(e,s)||r,s};return i.cache=new(e.Cache||t),i}return e.Cache=t,xr=e}();return Or=function(e){var n=t(e,(function(t){return 500===o.size&&o.clear(),t})),o=n.cache;return n}}function Vr(){if(Dr)return jr;Dr=1;var t=le(),e=Pr?Tr:(Pr=1,Tr=function(t,e){for(var n=-1,o=null==t?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i}),n=fn(),o=Ur(),i=t?t.prototype:void 0,r=i?i.toString:void 0;return jr=function t(i){if("string"==typeof i)return i;if(n(i))return e(i,t)+"";if(o(i))return r?r.call(i):"";var s=i+"";return"0"==s&&1/i==-1/0?"-0":s},jr}function Hr(){if(Ir)return $r;Ir=1;var t=fn(),e=function(){if(Er)return Cr;Er=1;var t=fn(),e=Ur(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;return Cr=function(i,r){if(t(i))return!1;var s=typeof i;return!("number"!=s&&"symbol"!=s&&"boolean"!=s&&null!=i&&!e(i))||o.test(i)||!n.test(i)||null!=r&&i in Object(r)}}(),n=function(){if(Nr)return Ar;Nr=1;var t=qr(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,o=t((function(t){var o=[];return 46===t.charCodeAt(0)&&o.push(""),t.replace(e,(function(t,e,i,r){o.push(i?r.replace(n,"$1"):e||t)})),o}));return Ar=o}(),o=function(){if(Lr)return kr;Lr=1;var t=Vr();return kr=function(e){return null==e?"":t(e)}}();return $r=function(i,r){return t(i)?i:e(i,r)?[i]:n(o(i))}}function Xr(){if(Rr)return Mr;Rr=1;var t=Ur();return Mr=function(e){if("string"==typeof e||t(e))return e;var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}}const Yr=ne(function(){if(zr)return Br;zr=1;var t=function(){if(Fr)return Wr;Fr=1;var t=Hr(),e=Xr();return Wr=function(n,o){for(var i=0,r=(o=t(o,n)).length;null!=n&&i<r;)n=n[e(o[i++])];return i&&i==r?n:void 0}}();return Br=function(e,n,o){var i=null==e?void 0:t(e,n);return void 0===i?o:i}}());var Gr,Zr,Jr,Kr;var Qr=function(){if(Kr)return Jr;Kr=1;var t=function(){if(Zr)return Gr;Zr=1;var t=Ao(),e=Hr(),n=No(),o=de(),i=Xr();return Gr=function(r,s,a,l){if(!o(r))return r;for(var c=-1,d=(s=e(s,r)).length,u=d-1,h=r;null!=h&&++c<d;){var p=i(s[c]),f=a;if("__proto__"===p||"constructor"===p||"prototype"===p)return r;if(c!=u){var m=h[p];void 0===(f=l?l(m,p,h):void 0)&&(f=o(m)?m:n(s[c+1])?[]:{})}t(h,p,f),h=h[p]}return r}}();return Jr=function(e,n,o){return null==e?e:t(e,n,o)}}();const ts=Yr,es=ne(Qr);function ns(...t){return t.flat().reduce(((t,e)=>(t[e]=e,t)),{})}var os,is,rs,ss,as,ls,cs,ds,us,hs,ps,fs,ms,gs,vs,bs,ys,ws,Cs,Es,xs,Ss,Os,_s,As,Ns,Ts,Ps,js,Ds,ks,Ls,$s,Is,Ms,Rs,Ws,Fs,Bs,zs,Us,qs,Vs,Hs,Xs,Ys,Gs,Zs,Js,Ks,Qs,ta,ea,na;function oa(){if(ls)return as;ls=1;var t=ye(),e=is?os:(is=1,os=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}),n=ss?rs:(ss=1,rs=function(t){return this.__data__.has(t)});function o(e){var n=-1,o=null==e?0:e.length;for(this.__data__=new t;++n<o;)this.add(e[n])}return o.prototype.add=o.prototype.push=e,o.prototype.has=n,as=o}function ia(){if(fs)return ps;fs=1;var t=oa(),e=ds?cs:(ds=1,cs=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}),n=hs?us:(hs=1,us=function(t,e){return t.has(e)});return ps=function(o,i,r,s,a,l){var c=1&r,d=o.length,u=i.length;if(d!=u&&!(c&&u>d))return!1;var h=l.get(o),p=l.get(i);if(h&&p)return h==i&&p==o;var f=-1,m=!0,g=2&r?new t:void 0;for(l.set(o,i),l.set(i,o);++f<d;){var v=o[f],b=i[f];if(s)var y=c?s(b,v,f,i,o,l):s(v,b,f,o,i,l);if(void 0!==y){if(y)continue;m=!1;break}if(g){if(!e(i,(function(t,e){if(!n(g,e)&&(v===t||a(v,t,r,s,l)))return g.push(e)}))){m=!1;break}}else if(v!==b&&!a(v,b,r,s,l)){m=!1;break}}return l.delete(o),l.delete(i),m}}function ra(){if(ws)return ys;ws=1;var t=le(),e=sn(),n=oe(),o=ia(),i=gs?ms:(gs=1,ms=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}),r=bs?vs:(bs=1,vs=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}),s=t?t.prototype:void 0,a=s?s.valueOf:void 0;return ys=function(t,s,l,c,d,u,h){switch(l){case"[object DataView]":if(t.byteLength!=s.byteLength||t.byteOffset!=s.byteOffset)return!1;t=t.buffer,s=s.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=s.byteLength||!u(new e(t),new e(s)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+t,+s);case"[object Error]":return t.name==s.name&&t.message==s.message;case"[object RegExp]":case"[object String]":return t==s+"";case"[object Map]":var p=i;case"[object Set]":var f=1&c;if(p||(p=r),t.size!=s.size&&!f)return!1;var m=h.get(t);if(m)return m==s;c|=2,h.set(t,s);var g=o(p(t),p(s),c,d,u,h);return h.delete(t),g;case"[object Symbol]":if(a)return a.call(t)==a.call(s)}return!1}}function sa(){if(Ss)return xs;Ss=1;var t=Es?Cs:(Es=1,Cs=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}),e=fn();return xs=function(n,o,i){var r=o(n);return e(n)?r:t(r,i(n))}}function aa(){if(Ps)return Ts;Ps=1;var t=_s?Os:(_s=1,Os=function(t,e){for(var n=-1,o=null==t?0:t.length,i=0,r=[];++n<o;){var s=t[n];e(s,n,t)&&(r[i++]=s)}return r}),e=Ns?As:(Ns=1,As=function(){return[]}),n=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols;return Ts=o?function(e){return null==e?[]:(e=Object(e),t(o(e),(function(t){return n.call(e,t)})))}:e}function la(){if(Ls)return ks;Ls=1;var t=dn(),e=function(){if(Ds)return js;Ds=1;var t=ln()(Object.keys,Object);return js=t}(),n=Object.prototype.hasOwnProperty;return ks=function(o){if(!t(o))return e(o);var i=[];for(var r in Object(o))n.call(o,r)&&"constructor"!=r&&i.push(r);return i}}function ca(){if(Rs)return Ms;Rs=1;var t=sa(),e=aa(),n=function(){if(Is)return $s;Is=1;var t=To(),e=la(),n=gn();return $s=function(o){return n(o)?t(o):e(o)}}();return Ms=function(o){return t(o,n,e)}}function da(){if(Zs)return Gs;Zs=1;var t=function(){if(zs)return Bs;zs=1;var t=fe()(ae(),"DataView");return Bs=t}(),e=me(),n=function(){if(qs)return Us;qs=1;var t=fe()(ae(),"Promise");return Us=t}(),o=function(){if(Hs)return Vs;Hs=1;var t=fe()(ae(),"Set");return Vs=t}(),i=function(){if(Ys)return Xs;Ys=1;var t=fe()(ae(),"WeakMap");return Xs=t}(),r=ce(),s=pe(),a="[object Map]",l="[object Promise]",c="[object Set]",d="[object WeakMap]",u="[object DataView]",h=s(t),p=s(e),f=s(n),m=s(o),g=s(i),v=r;return(t&&v(new t(new ArrayBuffer(1)))!=u||e&&v(new e)!=a||n&&v(n.resolve())!=l||o&&v(new o)!=c||i&&v(new i)!=d)&&(v=function(t){var e=r(t),n="[object Object]"==e?t.constructor:void 0,o=n?s(n):"";if(o)switch(o){case h:return u;case p:return a;case f:return l;case m:return c;case g:return d}return e}),Gs=v}function ua(){if(Ks)return Js;Ks=1;var t=we(),e=ia(),n=ra(),o=function(){if(Fs)return Ws;Fs=1;var t=ca(),e=Object.prototype.hasOwnProperty;return Ws=function(n,o,i,r,s,a){var l=1&i,c=t(n),d=c.length;if(d!=t(o).length&&!l)return!1;for(var u=d;u--;){var h=c[u];if(!(l?h in o:e.call(o,h)))return!1}var p=a.get(n),f=a.get(o);if(p&&f)return p==o&&f==n;var m=!0;a.set(n,o),a.set(o,n);for(var g=l;++u<d;){var v=n[h=c[u]],b=o[h];if(r)var y=l?r(b,v,h,o,n,a):r(v,b,h,n,o,a);if(!(void 0===y?v===b||s(v,b,i,r,a):y)){m=!1;break}g||(g="constructor"==h)}if(m&&!g){var w=n.constructor,C=o.constructor;w==C||!("constructor"in n)||!("constructor"in o)||"function"==typeof w&&w instanceof w&&"function"==typeof C&&C instanceof C||(m=!1)}return a.delete(n),a.delete(o),m}}(),i=da(),r=fn(),s=An(),a=Oo(),l="[object Arguments]",c="[object Array]",d="[object Object]",u=Object.prototype.hasOwnProperty;return Js=function(h,p,f,m,g,v){var b=r(h),y=r(p),w=b?c:i(h),C=y?c:i(p),E=(w=w==l?d:w)==d,x=(C=C==l?d:C)==d,S=w==C;if(S&&s(h)){if(!s(p))return!1;b=!0,E=!1}if(S&&!E)return v||(v=new t),b||a(h)?e(h,p,f,m,g,v):n(h,p,w,f,m,g,v);if(!(1&f)){var O=E&&u.call(h,"__wrapped__"),_=x&&u.call(p,"__wrapped__");if(O||_){var A=O?h.value():h,N=_?p.value():p;return v||(v=new t),g(A,N,f,m,v)}}return!!S&&(v||(v=new t),o(h,p,f,m,g,v))}}const ha=ne(function(){if(na)return ea;na=1;var t=function(){if(ta)return Qs;ta=1;var t=ua(),e=hn();return Qs=function n(o,i,r,s,a){return o===i||(null==o||null==i||!e(o)&&!e(i)?o!=o&&i!=i:t(o,i,r,s,n,a))},Qs}();return ea=function(e,n){return t(e,n)}}()),pa=(t,e)=>void 0===t?"added":void 0===e?"removed":ha(t,e)?"unchanged":"changed";class fa{constructor(t,e=Object.create(null)){this.name=t,this.data=e,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(t,e)=>JSON.stringify(t,null,e);get=t=>ts(this.data,t);set(t,e){const n=ts(this.data,t),o=es(this.data,t,e),i=Array.isArray(t)?t.join("."):t,r=Object.keys(this.setCallbacks).filter((t=>new RegExp(t).test(i))),s={newVal:e,oldVal:n,path:t};for(const a of r)for(const t of this.setCallbacks[a])t(s);if(!this.disableEvents){const i={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+t,value:e,data:o,changeType:pa(n,e),src:this.dom};n&&(i.previousValue=n),uu.formeoUpdated(i)}return o}addSetCallback(t,e){this.setCallbacks[t]?this.setCallbacks[t].push(e):this.setCallbacks[t]=[e]}removeSetCallback(t,e){this.setCallbacks[t]=this.setCallbacks[t].filter((t=>t!==e))}add=(t,e=Object.create(null))=>{const{id:n}=e,o=t||n||qo();return this.set(o,e)};remove=t=>{const e=vr(t),n=e.pop(),o=this.get(e);return Array.isArray(o)?o.splice(Number(n),1):o&&delete o[n],o};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=n?.data?n.getData():n,t)),{});setCallbacks={};configVal=Object.create(null)}class ma extends fa{load=t=>{const e=ti(t);this.empty();for(const[n,o]of Object.entries(e))this.add(n,o);return this.data};get=t=>t?ts(this.data,t):this.add();add=(t,e=Object.create(null))=>{const n=t||qo(),o=this.Component({...e,id:n});return this.data[n]=o,this.active=o,o};remove=t=>{if(Array.isArray(t))for(const e of t)this.get(e).remove();else this.get(t).remove();return this.data};delete=t=>(delete this.data[t],t);clearAll=(t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)};set config(t){this.configVal=Vo(this.configVal,Ho(t))}get config(){return this.configVal}conditionMap=new Map}function ga(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function va(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ga(Object(n),!0).forEach((function(e){ya(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ga(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ba(t){return(ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ya(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wa(){return wa=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},wa.apply(this,arguments)}function Ca(t,e){if(null==t)return{};var n,o,i=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Ea(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var xa=Ea(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Sa=Ea(/Edge/i),Oa=Ea(/firefox/i),_a=Ea(/safari/i)&&!Ea(/chrome/i)&&!Ea(/android/i),Aa=Ea(/iP(ad|od|hone)/i),Na=Ea(/chrome/i)&&Ea(/android/i),Ta={capture:!1,passive:!1};function Pa(t,e,n){t.addEventListener(e,n,!xa&&Ta)}function ja(t,e,n){t.removeEventListener(e,n,!xa&&Ta)}function Da(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function ka(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function La(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&Da(t,e):Da(t,e))||o&&t===n)return t;if(t===n)break}while(t=ka(t))}return null}var $a,Ia=/\s+/g;function Ma(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(Ia," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(Ia," ")}}function Ra(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function Wa(t,e){var n="";if("string"==typeof t)n=t;else do{var o=Ra(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Fa(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function Ba(){var t=document.scrollingElement;return t||document.documentElement}function za(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==Ba()?(s=(r=t.getBoundingClientRect()).top,a=r.left,l=r.bottom,c=r.right,d=r.height,u=r.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!xa))do{if(i&&i.getBoundingClientRect&&("none"!==Ra(i,"transform")||n&&"static"!==Ra(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(Ra(i,"border-top-width")),a-=h.left+parseInt(Ra(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=Wa(i||t),f=p&&p.a,m=p&&p.d;p&&(l=(s/=m)+(d/=m),c=(a/=f)+(u/=f))}return{top:s,left:a,bottom:l,right:c,width:u,height:d}}}function Ua(t,e,n){for(var o=Ya(t,!0),i=za(t)[e];o;){if(!(i>=za(o)[n]))return o;if(o===Ba())break;o=Ya(o,!1)}return!1}function qa(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==Kl.ghost&&(o||s[r]!==Kl.dragged)&&La(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function Va(t,e){for(var n=t.lastElementChild;n&&(n===Kl.ghost||"none"===Ra(n,"display")||e&&!Da(n,e));)n=n.previousElementSibling;return n||null}function Ha(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Kl.clone||e&&!Da(t,e)||n++;return n}function Xa(t){var e=0,n=0,o=Ba();if(t)do{var i=Wa(t),r=i.a,s=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*s}while(t!==o&&(t=t.parentNode));return[e,n]}function Ya(t,e){if(!t||!t.getBoundingClientRect)return Ba();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Ra(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return Ba();if(o||e)return n;o=!0}}}while(n=n.parentNode);return Ba()}function Ga(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function Za(t,e){return function(){if(!$a){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),$a=setTimeout((function(){$a=void 0}),e)}}}function Ja(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Ka(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function Qa(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if(La(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=za(i);o.left=Math.min(null!==(r=o.left)&&void 0!==r?r:1/0,c.left),o.top=Math.min(null!==(s=o.top)&&void 0!==s?s:1/0,c.top),o.right=Math.max(null!==(a=o.right)&&void 0!==a?a:-1/0,c.right),o.bottom=Math.max(null!==(l=o.bottom)&&void 0!==l?l:-1/0,c.bottom)}})),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var tl="Sortable"+(new Date).getTime();function el(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==Ra(t,"display")&&t!==Kl.ghost){e.push({target:t,rect:za(t)});var n=va({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=Wa(t,!0);o&&(n.top-=o.f,n.left-=o.e)}t.fromRect=n}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(e,{target:t}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof n&&n());var i=!1,r=0;e.forEach((function(t){var e=0,n=t.target,s=n.fromRect,a=za(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,u=Wa(n,!0);u&&(a.top-=u.f,a.left-=u.e),n.toRect=a,n.thisAnimationDuration&&Ga(l,a)&&!Ga(s,a)&&(d.top-a.top)/(d.left-a.left)==(s.top-a.top)/(s.left-a.left)&&(e=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(d,l,c,o.options)),Ga(a,s)||(n.prevFromRect=s,n.prevToRect=a,e||(e=o.options.animation),o.animate(n,d,a,e)),e&&(i=!0,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),i?t=setTimeout((function(){"function"==typeof n&&n()}),r):"function"==typeof n&&n(),e=[]},animate:function(t,e,n,o){if(o){Ra(t,"transition",""),Ra(t,"transform","");var i=Wa(this.el),r=i&&i.a,s=i&&i.d,a=(e.left-n.left)/(r||1),l=(e.top-n.top)/(s||1);t.animatingX=!!a,t.animatingY=!!l,Ra(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),Ra(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Ra(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){Ra(t,"transition",""),Ra(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var nl=[],ol={initializeByDefault:!0},il={mount:function(t){for(var e in ol)ol.hasOwnProperty(e)&&!(e in t)&&(t[e]=ol[e]);nl.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),nl.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";nl.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](va({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](va({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in nl.forEach((function(o){var i=o.pluginName;if(t.options[i]||o.initializeByDefault){var r=new o(t,e,t.options);r.sortable=t,r.options=t.options,t[i]=r,wa(n,r.defaults)}})),t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);void 0!==r&&(t.options[i]=r)}},getEventProperties:function(t,e){var n={};return nl.forEach((function(o){"function"==typeof o.eventProperties&&wa(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return nl.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var rl=["evt"],sl=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=Ca(n,rl);il.pluginEvent.bind(Kl)(t,e,va({dragEl:ll,parentEl:cl,ghostEl:dl,rootEl:ul,nextEl:hl,lastDownEl:pl,cloneEl:fl,cloneHidden:ml,dragStarted:Nl,putSortable:Cl,activeSortable:Kl.active,originalEvent:o,oldIndex:gl,oldDraggableIndex:bl,newIndex:vl,newDraggableIndex:yl,hideGhostForTarget:Yl,unhideGhostForTarget:Gl,cloneNowHidden:function(){ml=!0},cloneNowShown:function(){ml=!1},dispatchSortableEvent:function(t){al({sortable:e,name:t,originalEvent:o})}},i))};function al(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,s=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,u=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[tl]){var m,g=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||xa||Sa?(m=document.createEvent("Event")).initEvent(o,!0,!0):m=new CustomEvent(o,{bubbles:!0,cancelable:!0}),m.to=s||n,m.from=a||n,m.item=i||n,m.clone=r,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=u,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var b=va(va({},f),il.getEventProperties(o,e));for(var y in b)m[y]=b[y];n&&n.dispatchEvent(m),g[v]&&g[v].call(e,m)}}(va({putSortable:Cl,cloneEl:fl,targetEl:ll,rootEl:ul,oldIndex:gl,oldDraggableIndex:bl,newIndex:vl,newDraggableIndex:yl},t))}var ll,cl,dl,ul,hl,pl,fl,ml,gl,vl,bl,yl,wl,Cl,El,xl,Sl,Ol,_l,Al,Nl,Tl,Pl,jl,Dl,kl=!1,Ll=!1,$l=[],Il=!1,Ml=!1,Rl=[],Wl=!1,Fl=[],Bl="undefined"!=typeof document,zl=Aa,Ul=Sa||xa?"cssFloat":"float",ql=Bl&&!Na&&!Aa&&"draggable"in document.createElement("div"),Vl=function(){if(Bl){if(xa)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Hl=function(t,e){var n=Ra(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=qa(t,0,e),r=qa(t,1,e),s=i&&Ra(i),a=r&&Ra(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+za(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+za(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var d="left"===s.float?"left":"right";return!r||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=o&&"none"===n[Ul]||r&&"none"===n[Ul]&&l+c>o)?"vertical":"horizontal"},Xl=function(t){function e(t,n){return function(o,i,r,s){var a=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,s),n)(o,i,r,s);var l=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==ba(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Yl=function(){!Vl&&dl&&Ra(dl,"display","none")},Gl=function(){!Vl&&dl&&Ra(dl,"display","")};Bl&&!Na&&document.addEventListener("click",(function(t){if(Ll)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ll=!1,!1}),!0);var Zl=function(t){if(ll){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,$l.some((function(t){var e=t[tl].options.emptyInsertThreshold;if(e&&!Va(t)){var n=za(t),o=i>=n.left-e&&i<=n.right+e,a=r>=n.top-e&&r<=n.bottom+e;return o&&a?s=t:void 0}})),s);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[tl]._onDragOver(n)}}var i,r,s},Jl=function(t){ll&&ll.parentNode[tl]._isOutsideThisEl(t.target)};function Kl(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=wa({},e),t[tl]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Hl(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Kl.supportPointer&&"PointerEvent"in window&&!_a,emptyInsertThreshold:5};for(var o in il.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in Xl(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&ql,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Pa(t,"pointerdown",this._onTapStart):(Pa(t,"mousedown",this._onTapStart),Pa(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Pa(t,"dragover",this),Pa(t,"dragenter",this)),$l.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),wa(this,el())}function Ql(t,e,n,o,i,r,s,a){var l,c,d=t[tl],u=d.options.onMove;return!window.CustomEvent||xa||Sa?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=i||e,l.relatedRect=r||za(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),u&&(c=u.call(d,l,s)),c}function tc(t){t.draggable=!1}function ec(){Wl=!1}function nc(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function oc(t){return setTimeout(t,0)}function ic(t){return clearTimeout(t)}Kl.prototype={constructor:Kl,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Tl=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,ll):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=o.filter;if(function(t){Fl.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Fl.push(o)}}(n),!ll&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!_a||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=La(a,o.draggable,n,!1))&&a.animated||pl===a)){if(gl=Ha(a),bl=Ha(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return al({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),sl("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=La(l,o.trim(),n,!1))return al({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),sl("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!La(l,o.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,s=i.options,a=r.ownerDocument;if(n&&!ll&&n.parentNode===r){var l=za(n);if(ul=r,cl=(ll=n).parentNode,hl=ll.nextSibling,pl=n,wl=s.group,Kl.dragged=ll,El={target:ll,clientX:(e||t).clientX,clientY:(e||t).clientY},_l=El.clientX-l.left,Al=El.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,ll.style["will-change"]="all",o=function(){sl("delayEnded",i,{evt:t}),Kl.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Oa&&i.nativeDraggable&&(ll.draggable=!0),i._triggerDragStart(t,e),al({sortable:i,name:"choose",originalEvent:t}),Ma(ll,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Fa(ll,t.trim(),tc)})),Pa(a,"dragover",Zl),Pa(a,"mousemove",Zl),Pa(a,"touchmove",Zl),Pa(a,"mouseup",i._onDrop),Pa(a,"touchend",i._onDrop),Pa(a,"touchcancel",i._onDrop),Oa&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ll.draggable=!0),sl("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Sa||xa))o();else{if(Kl.eventCanceled)return void this._onDrop();Pa(a,"mouseup",i._disableDelayedDrag),Pa(a,"touchend",i._disableDelayedDrag),Pa(a,"touchcancel",i._disableDelayedDrag),Pa(a,"mousemove",i._delayedDragTouchMoveHandler),Pa(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Pa(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,s.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ll&&tc(ll),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;ja(t,"mouseup",this._disableDelayedDrag),ja(t,"touchend",this._disableDelayedDrag),ja(t,"touchcancel",this._disableDelayedDrag),ja(t,"mousemove",this._delayedDragTouchMoveHandler),ja(t,"touchmove",this._delayedDragTouchMoveHandler),ja(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Pa(document,"pointermove",this._onTouchMove):Pa(document,e?"touchmove":"mousemove",this._onTouchMove):(Pa(ll,"dragend",this),Pa(ul,"dragstart",this._onDragStart));try{document.selection?oc((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(kl=!1,ul&&ll){sl("dragStarted",this,{evt:e}),this.nativeDraggable&&Pa(document,"dragover",Jl);var n=this.options;!t&&Ma(ll,n.dragClass,!1),Ma(ll,n.ghostClass,!0),Kl.active=this,t&&this._appendGhost(),al({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(xl){this._lastX=xl.clientX,this._lastY=xl.clientY,Yl();for(var t=document.elementFromPoint(xl.clientX,xl.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(xl.clientX,xl.clientY))!==e;)e=t;if(ll.parentNode[tl]._isOutsideThisEl(t),e)do{if(e[tl]){if(e[tl]._onDragOver({clientX:xl.clientX,clientY:xl.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=ka(e));Gl()}},_onTouchMove:function(t){if(El){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=dl&&Wa(dl,!0),s=dl&&r&&r.a,a=dl&&r&&r.d,l=zl&&Dl&&Xa(Dl),c=(i.clientX-El.clientX+o.x)/(s||1)+(l?l[0]-Rl[0]:0)/(s||1),d=(i.clientY-El.clientY+o.y)/(a||1)+(l?l[1]-Rl[1]:0)/(a||1);if(!Kl.active&&!kl){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(dl){r?(r.e+=c-(Sl||0),r.f+=d-(Ol||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Ra(dl,"webkitTransform",u),Ra(dl,"mozTransform",u),Ra(dl,"msTransform",u),Ra(dl,"transform",u),Sl=c,Ol=d,xl=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!dl){var t=this.options.fallbackOnBody?document.body:ul,e=za(ll,!0,zl,!0,t),n=this.options;if(zl){for(Dl=t;"static"===Ra(Dl,"position")&&"none"===Ra(Dl,"transform")&&Dl!==document;)Dl=Dl.parentNode;Dl!==document.body&&Dl!==document.documentElement?(Dl===document&&(Dl=Ba()),e.top+=Dl.scrollTop,e.left+=Dl.scrollLeft):Dl=Ba(),Rl=Xa(Dl)}Ma(dl=ll.cloneNode(!0),n.ghostClass,!1),Ma(dl,n.fallbackClass,!0),Ma(dl,n.dragClass,!0),Ra(dl,"transition",""),Ra(dl,"transform",""),Ra(dl,"box-sizing","border-box"),Ra(dl,"margin",0),Ra(dl,"top",e.top),Ra(dl,"left",e.left),Ra(dl,"width",e.width),Ra(dl,"height",e.height),Ra(dl,"opacity","0.8"),Ra(dl,"position",zl?"absolute":"fixed"),Ra(dl,"zIndex","100000"),Ra(dl,"pointerEvents","none"),Kl.ghost=dl,t.appendChild(dl),Ra(dl,"transform-origin",_l/parseInt(dl.style.width)*100+"% "+Al/parseInt(dl.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;sl("dragStart",this,{evt:t}),Kl.eventCanceled?this._onDrop():(sl("setupClone",this),Kl.eventCanceled||((fl=Ka(ll)).removeAttribute("id"),fl.draggable=!1,fl.style["will-change"]="",this._hideClone(),Ma(fl,this.options.chosenClass,!1),Kl.clone=fl),n.cloneId=oc((function(){sl("clone",n),Kl.eventCanceled||(n.options.removeCloneOnHide||ul.insertBefore(fl,ll),n._hideClone(),al({sortable:n,name:"clone"}))})),!e&&Ma(ll,i.dragClass,!0),e?(Ll=!0,n._loopId=setInterval(n._emulateDragOver,50)):(ja(document,"mouseup",n._onDrop),ja(document,"touchend",n._onDrop),ja(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,ll)),Pa(document,"drop",n),Ra(ll,"transform","translateZ(0)")),kl=!0,n._dragStartId=oc(n._dragStarted.bind(n,e,t)),Pa(document,"selectstart",n),Nl=!0,_a&&Ra(document.body,"user-select","none"))},_onDragOver:function(t){var e,n,o,i,r=this.el,s=t.target,a=this.options,l=a.group,c=Kl.active,d=wl===l,u=a.sort,h=Cl||c,p=this,f=!1;if(!Wl){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=La(s,a.draggable,r,!0),T("dragOver"),Kl.eventCanceled)return f;if(ll.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return j(!1);if(Ll=!1,c&&!a.disabled&&(d?u||(o=cl!==ul):Cl===this||(this.lastPutMode=wl.checkPull(this,c,ll,t))&&l.checkPut(this,c,ll,t))){if(i="vertical"===this._getDirection(t,s),e=za(ll),T("dragOverValid"),Kl.eventCanceled)return f;if(o)return cl=ul,P(),this._hideClone(),T("revert"),Kl.eventCanceled||(hl?ul.insertBefore(ll,hl):ul.appendChild(ll)),j(!0);var m=Va(r,a.draggable);if(!m||function(t,e,n){var o=za(Va(n.el,n.options.draggable)),i=Qa(n.el,n.options,dl),r=10;return e?t.clientX>i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,i,this)&&!m.animated){if(m===ll)return j(!1);if(m&&r===t.target&&(s=m),s&&(n=za(s)),!1!==Ql(ul,r,ll,e,s,n,t,!!s))return P(),m&&m.nextSibling?r.insertBefore(ll,m.nextSibling):r.appendChild(ll),cl=r,D(),j(!0)}else if(m&&function(t,e,n){var o=za(qa(n.el,0,n.options,!0)),i=Qa(n.el,n.options,dl),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}(t,i,this)){var g=qa(r,0,a,!0);if(g===ll)return j(!1);if(n=za(s=g),!1!==Ql(ul,r,ll,e,s,n,t,!1))return P(),r.insertBefore(ll,g),cl=r,D(),j(!0)}else if(s.parentNode===r){n=za(s);var v,b,y,w=ll.parentNode!==r,C=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,s=n?e.left:e.top,a=n?e.right:e.bottom,l=n?e.width:e.height;return o===s||i===a||o+r/2===s+l/2}(ll.animated&&ll.toRect||e,s.animated&&s.toRect||n,i),E=i?"top":"left",x=Ua(s,"top","top")||Ua(ll,"top","top"),S=x?x.scrollTop:void 0;if(Tl!==s&&(b=n[E],Il=!1,Ml=!C&&a.invertSwap||w),v=function(t,e,n,o,i,r,s,a){var l=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,u=o?n.bottom:n.right,h=!1;if(!s)if(a&&jl<c*i){if(!Il&&(1===Pl?l>d+c*r/2:l<u-c*r/2)&&(Il=!0),Il)h=!0;else if(1===Pl?l<d+jl:l>u-jl)return-Pl}else if(l>d+c*(1-i)/2&&l<u-c*(1-i)/2)return function(t){return Ha(ll)<Ha(t)?1:-1}(e);if((h=h||s)&&(l<d+c*r/2||l>u-c*r/2))return l>d+c/2?1:-1;return 0}(t,s,n,i,C?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Ml,Tl===s),0!==v){var O=Ha(ll);do{O-=v,y=cl.children[O]}while(y&&("none"===Ra(y,"display")||y===dl))}if(0===v||y===s)return j(!1);Tl=s,Pl=v;var _=s.nextElementSibling,A=!1,N=Ql(ul,r,ll,e,s,n,t,A=1===v);if(!1!==N)return 1!==N&&-1!==N||(A=1===N),Wl=!0,setTimeout(ec,30),P(),A&&!_?r.appendChild(ll):s.parentNode.insertBefore(ll,A?_:s),x&&Ja(x,0,S-x.scrollTop),cl=ll.parentNode,void 0===b||Ml||(jl=Math.abs(b-za(s)[E])),D(),j(!0)}if(r.contains(ll))return j(!1)}return!1}function T(a,l){sl(a,p,va({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:u,fromSortable:h,target:s,completed:j,onMove:function(n,o){return Ql(ul,r,ll,e,n,za(n),t,o)},changed:D},l))}function P(){T("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function j(e){return T("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(Ma(ll,Cl?Cl.options.ghostClass:c.options.ghostClass,!1),Ma(ll,a.ghostClass,!0)),Cl!==p&&p!==Kl.active?Cl=p:p===Kl.active&&Cl&&(Cl=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){T("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===ll&&!ll.animated||s===r&&!s.animated)&&(Tl=null),a.dragoverBubble||t.rootEl||s===document||(ll.parentNode[tl]._isOutsideThisEl(t.target),!e&&Zl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function D(){vl=Ha(ll),yl=Ha(ll,a.draggable),al({sortable:p,name:"change",toEl:r,newIndex:vl,newDraggableIndex:yl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){ja(document,"mousemove",this._onTouchMove),ja(document,"touchmove",this._onTouchMove),ja(document,"pointermove",this._onTouchMove),ja(document,"dragover",Zl),ja(document,"mousemove",Zl),ja(document,"touchmove",Zl)},_offUpEvents:function(){var t=this.el.ownerDocument;ja(t,"mouseup",this._onDrop),ja(t,"touchend",this._onDrop),ja(t,"pointerup",this._onDrop),ja(t,"touchcancel",this._onDrop),ja(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;vl=Ha(ll),yl=Ha(ll,n.draggable),sl("drop",this,{evt:t}),cl=ll&&ll.parentNode,vl=Ha(ll),yl=Ha(ll,n.draggable),Kl.eventCanceled||(kl=!1,Ml=!1,Il=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ic(this.cloneId),ic(this._dragStartId),this.nativeDraggable&&(ja(document,"drop",this),ja(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),_a&&Ra(document.body,"user-select",""),Ra(ll,"transform",""),t&&(Nl&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),dl&&dl.parentNode&&dl.parentNode.removeChild(dl),(ul===cl||Cl&&"clone"!==Cl.lastPutMode)&&fl&&fl.parentNode&&fl.parentNode.removeChild(fl),ll&&(this.nativeDraggable&&ja(ll,"dragend",this),tc(ll),ll.style["will-change"]="",Nl&&!kl&&Ma(ll,Cl?Cl.options.ghostClass:this.options.ghostClass,!1),Ma(ll,this.options.chosenClass,!1),al({sortable:this,name:"unchoose",toEl:cl,newIndex:null,newDraggableIndex:null,originalEvent:t}),ul!==cl?(vl>=0&&(al({rootEl:cl,name:"add",toEl:cl,fromEl:ul,originalEvent:t}),al({sortable:this,name:"remove",toEl:cl,originalEvent:t}),al({rootEl:cl,name:"sort",toEl:cl,fromEl:ul,originalEvent:t}),al({sortable:this,name:"sort",toEl:cl,originalEvent:t})),Cl&&Cl.save()):vl!==gl&&vl>=0&&(al({sortable:this,name:"update",toEl:cl,originalEvent:t}),al({sortable:this,name:"sort",toEl:cl,originalEvent:t})),Kl.active&&(null!=vl&&-1!==vl||(vl=gl,yl=bl),al({sortable:this,name:"end",toEl:cl,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){sl("nulling",this),ul=ll=cl=dl=hl=fl=pl=ml=El=xl=Nl=vl=yl=gl=bl=Tl=Pl=Cl=wl=Kl.dragged=Kl.ghost=Kl.clone=Kl.active=null,Fl.forEach((function(t){t.checked=!0})),Fl.length=Sl=Ol=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ll&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)La(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||nc(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];La(i,this.options.draggable,o,!1)&&(n[t]=i)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return La(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=il.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Xl(n)},destroy:function(){sl("destroy",this);var t=this.el;t[tl]=null,ja(t,"mousedown",this._onTapStart),ja(t,"touchstart",this._onTapStart),ja(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(ja(t,"dragover",this),ja(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),$l.splice($l.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!ml){if(sl("hideClone",this),Kl.eventCanceled)return;Ra(fl,"display","none"),this.options.removeCloneOnHide&&fl.parentNode&&fl.parentNode.removeChild(fl),ml=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(ml){if(sl("showClone",this),Kl.eventCanceled)return;ll.parentNode!=ul||this.options.group.revertClone?hl?ul.insertBefore(fl,hl):ul.appendChild(fl):ul.insertBefore(fl,ll),this.options.group.revertClone&&this.animate(ll,fl),Ra(fl,"display",""),ml=!1}}else this._hideClone()}},Bl&&Pa(document,"touchmove",(function(t){(Kl.active||kl)&&t.cancelable&&t.preventDefault()})),Kl.utils={on:Pa,off:ja,css:Ra,find:Fa,is:function(t,e){return!!La(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:Za,closest:La,toggleClass:Ma,clone:Ka,index:Ha,nextTick:oc,cancelNextTick:ic,detectDirection:Hl,getChild:qa,expando:tl},Kl.get=function(t){return t[tl]},Kl.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Kl.utils=va(va({},Kl.utils),t.utils)),il.mount(t)}))},Kl.create=function(t,e){return new Kl(t,e)},Kl.version="1.15.3";var rc,sc,ac,lc,cc,dc,uc=[],hc=!1;function pc(){uc.forEach((function(t){clearInterval(t.pid)})),uc=[]}function fc(){clearInterval(dc)}var mc=Za((function(t,e,n,o){if(e.scroll){var i,r=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=Ba(),d=!1;sc!==n&&(sc=n,pc(),rc=e.scroll,i=e.scrollFn,!0===rc&&(rc=Ya(n,!0)));var u=0,h=rc;do{var p=h,f=za(p),m=f.top,g=f.bottom,v=f.left,b=f.right,y=f.width,w=f.height,C=void 0,E=void 0,x=p.scrollWidth,S=p.scrollHeight,O=Ra(p),_=p.scrollLeft,A=p.scrollTop;p===c?(C=y<x&&("auto"===O.overflowX||"scroll"===O.overflowX||"visible"===O.overflowX),E=w<S&&("auto"===O.overflowY||"scroll"===O.overflowY||"visible"===O.overflowY)):(C=y<x&&("auto"===O.overflowX||"scroll"===O.overflowX),E=w<S&&("auto"===O.overflowY||"scroll"===O.overflowY));var N=C&&(Math.abs(b-r)<=a&&_+y<x)-(Math.abs(v-r)<=a&&!!_),T=E&&(Math.abs(g-s)<=a&&A+w<S)-(Math.abs(m-s)<=a&&!!A);if(!uc[u])for(var P=0;P<=u;P++)uc[P]||(uc[P]={});uc[u].vx==N&&uc[u].vy==T&&uc[u].el===p||(uc[u].el=p,uc[u].vx=N,uc[u].vy=T,clearInterval(uc[u].pid),0==N&&0==T||(d=!0,uc[u].pid=setInterval(function(){o&&0===this.layer&&Kl.active._onTouchMove(cc);var e=uc[this.layer].vy?uc[this.layer].vy*l:0,n=uc[this.layer].vx?uc[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(Kl.dragged.parentNode[tl],n,e,t,cc,uc[this.layer].el)||Ja(uc[this.layer].el,n,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=Ya(h,!1)));hc=d}}),30),gc=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,s=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var l=n||i;s();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function vc(){}function bc(){}vc.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=qa(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:gc},wa(vc,{pluginName:"revertOnSpill"}),bc.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:gc},wa(bc,{pluginName:"removeOnSpill"}),Kl.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?Pa(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Pa(document,"pointermove",this._handleFallbackAutoScroll):e.touches?Pa(document,"touchmove",this._handleFallbackAutoScroll):Pa(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?ja(document,"dragover",this._handleAutoScroll):(ja(document,"pointermove",this._handleFallbackAutoScroll),ja(document,"touchmove",this._handleFallbackAutoScroll),ja(document,"mousemove",this._handleFallbackAutoScroll)),fc(),pc(),clearTimeout($a),$a=void 0},nulling:function(){cc=sc=rc=hc=dc=ac=lc=null,uc.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if(cc=t,e||this.options.forceAutoScrollFallback||Sa||xa||_a){mc(t,this.options,r,e);var s=Ya(r,!0);!hc||dc&&o===ac&&i===lc||(dc&&fc(),dc=setInterval((function(){var r=Ya(document.elementFromPoint(o,i),!0);r!==s&&(s=r,pc()),mc(t,n.options,r,e)}),10),ac=o,lc=i)}else{if(!this.options.bubbleScroll||Ya(r,!0)===Ba())return void pc();mc(t,this.options,Ya(r,!1),!1)}}},wa(t,{pluginName:"scroll",initializeByDefault:!0})}),Kl.mount(bc,vc);const yc={getStyle:(t,e=!1)=>{let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n},fadeOut:(t,e=250)=>{const n=1/(e/60);t.style.opacity=1,function e(){const o=Number(t.style.opacity)-n;o>0?(t.style.opacity=o,window.requestAnimationFrame(e)):t.remove()}()},slideDown:(t,e=250,n=!1)=>{t.style.display="block";const o=yc.getStyle(t),i=Number.parseInt(o.height,10),r=i/(e/60);t.style.height="0px",function e(){const o=Number.parseFloat(t.style.height),s=o+r;o<i?(t.style.height=`${s}px`,window.requestAnimationFrame(e)):(t.style.height="auto",n&&n(t))}()},slideUp:(t,e=250,n=!1)=>{const o=yc.getStyle(t),i=Number.parseInt(o.height,10),r=o.overflow;t.style.overflow="hidden",t.style.height=`${i}px`;const s=o.minHeight;t.style.minHeight="auto";const a=parseFloat(i/(e/60)).toFixed(2);!function e(){const o=Number.parseInt(t.style.height,10)-a;o>0?(t.style.height=`${o}px`,window.requestAnimationFrame(e)):(t.style.overflow=r,t.style.display="none",t.style.minHeight=s,delete t.style.height,n&&n(t))}()},slideToggle:(t,e=250,n="none"===yc.getStyle(t,"display"))=>{n?yc.slideDown(t,e):yc.slideUp(t,e)}},wc=t=>Number.isInteger(Number(t)),Cc=t=>{let e=0,n=t;for(;n?.previousElementSibling;)n=n.previousElementSibling,e++;return e},Ec=(t,e,n)=>{const o=n.split("||"),i=Uo(e).map((e=>t.find((t=>{const n=o.find((e=>!!ts(t,e)));return n&&ts(t,n)===e})))).filter(Boolean).concat(t);return Uo(i)},xc=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},Sc=(t,e)=>{const n=[];return xc(t,((t,o)=>n.push(e(t,o)))),n},Oc={},_c=t=>{if(Oc[t])return Oc[t];const e=({className:"class"}[t]||t).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Oc[t]=e,e},Ac=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),Nc=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Tc={capitalize:Ac,safeAttrName:_c,forEach:xc,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:Sc,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:Cc,isInt:wc,get:ts,orderObjectsBy:Ec,isIE:Nc},Pc={glyphicons:t=>`<span class="glyphicon glyphicon-${t}" aria-hidden="true"></span>`,"font-awesome":t=>{const[e,n]=t.split(" ");return`<i class="${e} fa-${n}"></i>`},fontello:t=>`<i class="${lr}${t}">${t}</i>`},jc=new Set(["input","textarea","select"]),Dc=(t={})=>{let e=t?.attrs?.name||t?.name;if(e)return e;const n=qo(t);let o=t.config?.label||t.attrs?.label||t?.label;return o&&("object"==typeof o&&(o=kc.create(o).textContent),/^<.+>.+<.+>$/gim.test(o)&&(o=(t=>{const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""})(o)),e=`${n}-${gr(((t,e,n="…")=>{if(t.length<=e)return t;const o=t.slice(0,e),i=o.lastIndexOf(" ");let r=`${i>0?o.slice(0,i):o}`;return n&&(r+=n),r})(o,24,null))}`),e||n};const kc=new class{constructor(t=Object.create(null)){this.options=t}set setOptions(t){this.options=Vo(this.options,t)}processElemArg(t){let e,n=t;if("string"==typeof n)return e=n,n={tag:e},n;if(n.attrs){const{tag:t,...o}=n.attrs;if(t)if("string"==typeof t)e=t;else{e=(t.find((t=>!0===t.selected))||t[0]).value}n.attrs=o}return n.tag=e||n.tag||"div",n}render=t=>(t.id=`f-${t.id||qo()}`,this.create(t));create=(t,e=!1)=>{if(!t)return;if(this.isDOMElement(t))return t;const n=this,o=["children","content"],{className:i,options:r,dataset:s,...a}=this.processElemArg(t);let l;o.push("tag");const{tag:c}=a;let d;const u={attrs:{},className:[Tc.get(a,"config.inputWrap")],children:[],config:{}};let h=document.createElement(c);const p={string:t=>{h.innerHTML+=t},object:t=>t&&h.appendChild(n.create(t,e)),node:t=>h.appendChild(t),component:t=>h.appendChild(t.dom),array:t=>{for(const e of t)l=n.childType(e),p[l](e)},function:t=>{t=t(),l=n.childType(t),p[l](t)},undefined:()=>null,boolean:()=>null};if(i&&(a.attrs=Vo(a.attrs,{className:i})),r){const t=this.processOptions(r,a,e);if(!this.holdsContent(h)||"button"===c)return Tc.forEach(t,(t=>{u.children.push(n.create(t,e))})),a.attrs.className&&(u.className=a.attrs.className),u.id=a.id,u.config={...a.config},this.create(u,e);p.array.call(this,t),a.content=void 0,o.push("options")}if(a.attrs&&(n.processAttrs(a,h,e),o.push("attrs")),a.config){if(a.config.label&&(a.config.label&&"button"!==c||["radio","checkbox"].includes(Tc.get(a,"attrs.type")))&&!e){const t=n.label(a);if(!a.config.hideLabel){const e=[t,h];n.labelAfter(a)&&e.reverse(),u.children.push(e)}}o.push("config")}if(a.content||a.children){const t=a.content||a.children;l=n.childType(t),p[l],p[l].call(this,t)}if(s){for(const t in s)Object.hasOwn(s,t)&&(h.dataset[t]="function"==typeof s[t]?s[t]():s[t]);o.push("dataset")}a.action&&(this.actionHandler(h,a.action),o.push("action"));const f=Tc.subtract(o,Object.keys(a));for(d=f.length-1;d>=0;d--)h[f[d]]=a[f[d]];return u.children.length&&(h=this.create(u)),h};onRender=(t,e,n=333)=>{const o=Date.now(),i=()=>{!t.parentElement&&Date.now()-o<n?window.requestAnimationFrame(i):t.parentElement&&e(t)};i()};actionHandler(t,e){const n={onRender:kc.onRender,render:kc.onRender},o=["focus","blur"];return Object.entries(e).map((([e,i])=>(Array.isArray(i)?i:[i]).map((i=>{const r=n[e]||(t=>(e,n)=>e.addEventListener(t,n,o.includes(t)))(e);return r(t,i)}))))}get icons(){if(this.iconSymbols)return this.iconSymbols;const t=document.querySelectorAll(`#${si} svg symbol`);return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(lr,"")]={tag:"svg",attrs:{className:["svg-icon",n=e.id]},children:[{tag:"use",attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink","xlink:href":`#${n}`}}]},t}),{}),this.cachedIcons={},this.iconSymbols}icon(t,e){if(!t)return;const n=`${t}?${new URLSearchParams(e).toString()}`;if(this.cachedIcons?.[n])return this.cachedIcons[n];const o=this.icons[t];if(o){if(e){const t=Vo(o,e);return this.cachedIcons[n]=kc.create(t).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=kc.create(o).outerHTML,this.cachedIcons[n]}return Pc[kc.options.iconFont]?.(t)||t}processAttrs(t,e,n){const{attrs:o={}}=t;if(!n&&!o.name&&null!==o.name&&this.isInput(t.tag)){const n=Dc(t);n&&e.setAttribute("name",n)}for(const i of Object.keys(o)){const t=Tc.safeAttrName(i),n=this.processAttrValue(o[i]);!1!==n&&e.setAttribute(t,n)}}processAttrValue(t){if("function"==typeof t)return t();if("boolean"==typeof t)return t?"":t;let e=t||"";if(Array.isArray(e))if("object"==typeof e[0]){const t=e.filter((t=>!0===t.selected));e=t.length?t[0].value:e[0].value}else e=e.join(" ");return e}toggleElementsByStr=(t,e)=>{const n=[];return kc.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n};elementsContainText=(t,e,n)=>{const o=[];return xc(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());n?.(t,i),i&&o.push(t)})),o};generateOption=({type:t="option",label:e,value:o,i:i=0,selected:r})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:o||`${t}-${i}`,["option"===t?"selected":"checked"]:r||!i},config:{label:e||n.get("labelCount",{label:n.get("option"),count:i})}});processOptions(t,e,n){const{action:o,attrs:i={}}=e,r=i.type||e.tag,s=i.id||e.id;return t.map(((t,a)=>{const{label:l,value:c,...d}=t,u=()=>{const u={tag:"input",attrs:{name:s,type:r,value:c||"",id:`${s}-${a}`,...d},action:o},h={tag:"label",attrs:{for:`${s}-${a}`},children:l},p={children:[u,h],className:[`f-${r}`]};return i.className&&(e.config.inputWrap=i.className),e.config.inline&&p.className.push(`f-${r}-inline`),t.selected&&(u.attrs.checked=!0),n&&(h.attrs.contenteditable=!0),p},h={select:()=>{const e=t.attrs||t,n={attrs:e,...t,...e},{label:o,checked:i,selected:r,attrs:s}=n;return{tag:"option",attrs:{...s,selected:!(!i&&!r)},children:o}},button:t=>{const{type:n,label:o,className:i,id:r}=t;return{...e,attrs:{type:n},className:i,id:r||qo(),options:void 0,children:o,action:e.action}},checkbox:u,radio:u};return h[r]?.(t)}))}holdsContent(t){return-1!==t.outerHTML.indexOf("/")}isBlockInput(t){return!this.isInput(t)&&this.holdsContent(t)}isInput(t){let e=t;return"string"!=typeof e&&(e=e.tagName),jc.has(e)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=Tc.get(t,"attrs.type"),n=Tc.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});label(t,e){const n=Tc.get(t,"attrs.required");let{config:{label:o=""}}=t;const{id:i,attrs:r}=t;"function"==typeof o&&(o=o());const s={tag:"label",attrs:{for:i||r?.id},className:[],children:[o,n&&this.requiredMark()],action:{}};return e&&(s.attrs.for=void 0,s.attrs.contenteditable=!0,s.fMap=e),s}childType(t){return void 0===t?t:[["array",t=>Array.isArray(t)],["node",t=>t instanceof window.Node||t instanceof window.HTMLElement],["component",()=>t?.dom],[typeof t,()=>!0]].find((e=>e[1](t)))[0]}getStyle(t,e=!1){let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n}getElement(t){return{node:()=>t,object:()=>document.getElementById(t.id),string:()=>document.getElementById(t)}[this.childType(t)]()}empty(t){for(;t.firstChild;)this.remove(t.firstChild);return t}removeEmpty=t=>{const e=t.parentElement,n=zo(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length)return this.isStage(e)?this.emptyClass(e):this.removeEmpty(e)};remove(t){const e=zo(t);return e?su.remove(`${e}s.${t.id}`):t.parentElement.removeChild(t)}removeClasses(t,e){const n={string:t=>t.classList.remove(e),array:t=>{for(const n of e)t.classList.remove(n)}};n.object=n.string,Tc.forEach(t,n[this.childType(e)])}addClasses(t,e){const n={string:t=>t.classList.add(e),array:t=>{for(const n of e)t.classList.add(n)}};Tc.forEach(t,n[this.childType(e)])}formGroup(t,e=""){return{className:["f-field-group",e],children:t}}coords(t){const e=t.getBoundingClientRect(),n=document.body.getBoundingClientRect();return{pageX:e.left+e.width/2,pageY:e.top-n.top-e.height/2}}clearStage(t){t.classList.add("removing-all-fields");yc.slideUp(t,600,(()=>{kc.empty(t),t.classList.remove("removing-all-fields"),kc.emptyClass(t),yc.slideDown(t,300)}))}toggleSortable(t,e){let n=e;const o=zo(t);if(!o)return;const i=zo(t.parentElement),r=kc[o].get(t.id).sortable;n||(n=!r.option("disabled")),r.option("disabled",n),i&&["rows","columns","stages"].includes(i)&&this.toggleSortable(t.parentElement,n)}emptyClass(t){const e=t.getElementsByClassName(Ei.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}btnTemplate=({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e});isControls=t=>zo(t)===fi;isStage=t=>zo(t)===mi;isRow=t=>zo(t)===gi;isColumn=t=>zo(t)===vi;isField=t=>zo(t)===bi;asComponent=t=>su[`${zo(t)}s`].get(t.id);isDOMElement(t){return t instanceof window.Element||t instanceof window.HTMLElement||!(!t||"object"!=typeof t||1!==t.nodeType||"string"!=typeof t.nodeName)}},Lc="f-autocomplete",$c=`${Lc}-display-field`,Ic=`${Lc}-list`,Mc="highlight-component",Rc=`${Ic}-item`,Wc=["config.label","config.controlId"],Fc=[...Wc,"config.legend","name"],Bc=t=>Wc.reduce(((e,n)=>e||t.get(n)),null),zc=t=>Fc.reduce(((e,n)=>e||t.get(n)),null)||mr(t.name),Uc=new Map([["condition.source",Bc],["if.condition.source",Bc],["if.condition.target",Bc],["then.condition.target",zc],["condition.target",zc]]),qc=({id:t,...e},n)=>{const{name:o,label:i}=e;if(!o)return i;return Uc.get(n)(e)},Vc=t=>(t.classList.contains(Rc)||(t=t.parentElement),t),Hc=({value:t,textLabel:e,htmlLabel:n,componentType:o,depth:i=0},r)=>{const s={tag:"li",children:n,dataset:{value:t,label:e},className:[Rc,`${Rc}-depth-${i}`,`component-type-${o}`],action:{mousedown:({target:t})=>{t=Vc(t),r.setValue(t),r.selectOption(t),r.hideList()},mouseover:({target:t})=>{t=Vc(t),r.removeHighlight(),r.highlightComponent(t)},mouseleave:({target:t})=>{t=Vc(t),r.removeHighlight()}}};return kc.create(s)},Xc=t=>{const e=t.value,n=[],o=su.flatList(),i=Object.entries(o).reduce(((o,[i,r])=>{const s=qc(r,t.key);if(s){const a=r.name,l={tag:"span",content:` ${mr(a)}`,className:"component-type"},c=`${a}.${s}`;n.push(c);const d=((t,e)=>{const n=t.reduce(((t,n)=>t+(n===e)),0);return n>1?`(${n})`:""})(n,c),u=[`${s} `,{tag:"span",content:d,className:"component-label-count"},l],h=[s,d].join(" ").trim();if(r.isCheckable){const e=((t,e)=>{const n=t.data.options.map(((n,o)=>{const i=`${t.address}.options[${o}]`,r=n.label,s=n.label;return Hc({value:i,textLabel:r,htmlLabel:s,componentType:"option",depth:1},e)}));return kc.create({tag:"ul",attrs:{className:[Ic,"options-list"]},children:n})})(r,t);u.push(e)}const p=(({selectedId:t,...e})=>(e.value===t&&(e.selected=!0),e))({value:i,textLabel:h,htmlLabel:u,componentType:a,selectedId:e});o.push(Hc(p,t))}return o}),[]);return i};class Yc{lastCache=Date.now();optionsCache=null;constructor({key:t,value:e,className:n,onChange:o=Qo}){this.key=t,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=e,this.onChange=o||Qo,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(t,e){if(e in t)return t[e];if(e in t.dom){const n=t.dom[e];return"function"==typeof n?n.bind(t.dom):n}},set:(t,e,n)=>(e in t?t[e]=n:t.dom[e]=n,!0)})}get isAddress(){return Zo(this.value)}get valueComponent(){return Zo(this.value)&&su.getAddress(this.value)}build(){const t=t=>{const e=this.list,n=this.getActiveOption();let o=new Map([[38,()=>{const t=this.getPreviousOption(n);t&&this.selectOption(t)}],[40,()=>{const t=this.getNextOption(n);t&&this.selectOption(t)}],[13,()=>{n&&(this.selectOption(n),this.setValue(n),"none"===e.style.display?this.showList(n):this.hideList()),t.preventDefault()}],[27,()=>{this.hideList()}]]).get(t.keyCode);return o||(o=()=>!1),o()},e={focus:({target:e})=>{this.updateOptions(),e.parentElement.classList.add(`${Lc}-focused`);const n=kc.toggleElementsByStr(this.list.querySelectorAll(`.${Rc}-depth-0`),e.value);e.addEventListener("keydown",t);const o=this.list.querySelector(".active-option")||n[0];this.showList(o)},blur:({target:e})=>{e.parentElement.classList.remove(`${Lc}-focused`),e.removeEventListener("keydown",t),this.hideList()},input:t=>{const{value:e}=t.target,n=kc.toggleElementsByStr(this.list.querySelectorAll("li"),e);if(0===e.length&&this.clearValue(),0===n.length)this.hideList();else{const t=this.getActiveOption()||n[0];this.showList(t)}this.setValue({dataset:{label:e,value:e}})}};return this.displayField=kc.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:$c,value:this.label||this.value,placeholder:n.get(`${this.key}.placeholder`)}}),this.hiddenField=kc.create({tag:"input",attrs:{type:"hidden",className:Lc,value:this.value}}),this.list=kc.create({tag:"ul",attrs:{className:Ic}}),this.clearButton=kc.create({tag:"span",content:kc.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=kc.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[Lc,this.className].flat(),action:{onRender:t=>{this.stage=t.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Zo(this.value))return this.value;const t=this.value&&su.getAddress(this.value);return t&&qc(t,`${this.key}`)||this.value}updateOptions(){let t=this.optionsCache;const e=Date.now();(e-this.lastCache>5*Hi||!t)&&(kc.empty(this.list),t=this.generateOptions(),this.lastCache=e),this.list.children.length||this.list.append(...t)}generateOptions(){return this.optionsCache=Xc(this),this.optionsCache}setListPosition(){const{offsetHeight:t,offsetWidth:e}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),o=this.displayField.getBoundingClientRect(),i={position:"absolute",top:o.y+t-n.y+"px",left:o.x+window.scrollX-n.x+2+"px",width:`${e}px`};Object.assign(this.list.style,i)}showList(t,e=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(t),yc.slideDown(e,Vi)}hideList(t=this.list){yc.slideUp(t,Vi),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(t=this.list){const e=t.querySelector(".active-option");return"none"!==e?.style.display?e:null}getPreviousOption(t){let e=t;do{e=e?e.previousSibling:null}while(null!=e&&"none"===e.style.display);return e}getNextOption(t){let e=t;do{e=e?e.nextSibling:null}while(null!=e&&"none"===e.style.display);return e}selectOption(t,e=this.list){const n=e.querySelectorAll("li");for(const o of n){const{dataset:{value:t}}=o;if(o.classList.remove("active-option"),Zo(t)){const e=su.getAddress(t);e?.dom?.classList.remove(Mc)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(Mc);for(const e of t)e.classList.remove(Mc)}highlightComponent(t){const{dataset:{value:e}}=t;if(Zo(e)){const{componentAddress:t,isOptionAddress:n,optionIndex:o}=vr(e).reduce(((t,e)=>"options"===e?(t.isOptionAddress=!0,t):t.isOptionAddress?(t.optionIndex=+e,t):(t.componentAddress.push(e),t)),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),i=su.getAddress(t);if(i?.dom&&(i.dom.classList.add(Mc),n)){const t=i.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio");t[o]?.classList.add(Mc)}}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(t){const{label:e,value:n}=t.dataset;this.displayField.value=e,this.hiddenField.value=n,this.value=n,this.clearButton.classList.toggle("hidden",!n.length),this.onChange?.({target:this.hiddenField})}}function Gc({key:t,value:e,type:o="text",checked:i}){const r={tag:"input",attrs:{type:o,value:e,placeholder:n.get(`${t}.placeholder`)||mr(t)},className:[t.replace(/\./g,"-")],config:{}};return i&&(r.attrs.checked=!0),r}function Zc(t){const e=n.get(t);if(e)return e;const o=t.split(".");return n.get(o[o.length-1])}const Jc={autocomplete:(...t)=>new Yc(...t).createProxy(),string:({key:t,value:e})=>Gc({key:t,value:e}),boolean:({key:t,value:e})=>Gc({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:!!e}),number:({key:t,value:e})=>Gc({key:t,value:e,type:"number"}),array:({key:t,value:e})=>({tag:"select",attrs:{placeholder:Zc(`placeholder.${t}`)},className:[t.replace(/\./g,"-")],options:e}),object:t=>Object.entries(t).map((([t,e])=>Jc[kc.childType(e)]({key:t,value:e})))},Kc={boolean:(t,e)=>({click:({target:n})=>{if("radio"===n.type){const t=e.data.options.map((t=>({...t,selected:!1})));e.set("options",t)}e.set(t,n.checked),e.updatePreview()}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n),e.debouncedUpdatePreview()}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n)),e.debouncedUpdatePreview()}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n),e.debouncedUpdatePreview()}}),object:()=>({})},Qc="hidden-property",td=/\.options\[\d+\]$/,ed={"if-sourceProperty":ns(er,Qi,tr),"if-targetProperty":ns(er),"then-targetProperty":ns(er,Qi,tr),...Object.entries(nr).reduce(((t,[e,n])=>(t[`if-${e}`]=n,t[`then-${e}`]=n,t)),{})},nd={assignment:id,comparison:id,logical:id,source:({key:t,value:e,onChange:n,conditionType:o})=>Jc.autocomplete({key:`${o}.condition.${t}`,value:e,onChange:n,className:`condition-${t}`}),sourceProperty:id,targetProperty:id,target:t=>nd.source(t),value:({key:t,value:e,onChange:n},o)=>{const i=Jc.string({key:`condition.${t}`,value:e});return i.action={input:n},i}};function od({key:t,value:e,conditionType:o}){const i=ed[`${o}-${t}`];return Object.entries(i||{}).map((([o,i])=>function({fieldName:t,fieldValue:e,key:o,optionValue:i}){return{label:n.get(`${t}.${o}`)||mr(o).toLowerCase(),value:i,selected:i===e}}({fieldName:t,fieldValue:e,key:o,optionValue:i})))}function id({key:t,value:e,onChange:n,conditionType:o}){const i=od({key:t,value:e,conditionType:o}),r=Jc.array({key:`condition.${t}`,value:i});return r.action={change:n},r}const rd={sourceProperty:t=>{const e=t.get("source"),n=t.get("sourceProperty"),o=!!e.value,i=!!e.value.match(td);return cd(i,n),!o},comparison:t=>{const e=t.get("source"),n=t.get("sourceProperty"),o=!!e.value,i=!!e.value.match(td);return!o||i||"value"!==n.value},assignment:t=>{const e=t.get("target"),n=t.get("targetProperty");return!!!e.value||n.value.startsWith("is")},targetProperty:t=>{const e=t.get("target"),n=t.get("targetProperty"),o=!!e.value.match(td);return cd(o,n),i=e.value,!Oi.test(i);var i},target:t=>{const e=t.get("source"),n=t.get("sourceProperty");return!(!n||!!e?.value)||n&&"value"!==n?.value},value:t=>{const e=t.get("target"),n=t.get("targetProperty");return void 0!==n&&(!(!e||e.value)||(o=t.get("comparison"),!!o?.classList.contains(Qc)||(n.value===ad||n.value.startsWith("is"))));var o}},sd=t=>{for(const[e,n]of t){const o=!!rd[e]?.(t)||!1;n.classList.toggle(Qc,o)}},ad="isChecked",ld=t=>t.value.endsWith("Checked"),cd=(t,e)=>{if(t&&ld(e))return null;const n=Array.from(e.querySelectorAll("option")),o=[];for(const i of n){const e=ld(i),n=t?!e:e;n&&o.push(i.value),i.classList.toggle("hidden-option",n)}o.includes(e.value)&&(e.value=t?ad:n.find((t=>!ld(t)))?.value||e.value)};class dd{constructor({conditionValues:t,conditionType:e,conditionCount:n,index:o},i){this.values=new Map(function(t,e=Ki){return e.reduce(((e,n)=>(void 0!==t[n]&&e.push([n,t[n]]),e)),[])}(t)),this.conditionType=e,this.parent=i,this.baseAddress=`${i.address}.${e}`,this.fields=new Map,this.conditionCount=n,this.index=o,this.dom=this.generateDom()}setConditionIndex(t){this.index=t}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const t=su.getAddress(this.baseAddress);t.splice(this.index,1),su.setAddress(this.baseAddress,t),yc.slideUp(this.dom,Vi,(()=>{this.dom.remove()}))}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:n.get(`condition.type.${this.conditionType}`)}}generateDom(){const t=[];for(const[n,o]of this.values){const e=t=>this.onChangeCondition({key:n,target:t.target}),i={key:n,value:o,conditionType:this.conditionType,onChange:e},r=nd[n](i,this.values),s=r.dom||kc.create(r);this.fields.set(n,r.dom?r:s),t.push(s)}const e={children:[this.label(),...t,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:t=>{this.processUiState()}}};return kc.create(e)}generateConditionTypeActionButtons(){const t=[],e="manage-condition-type",o=t=>`${t}-condition-type`,i=kc.btnTemplate({title:n.get(`remove${this.conditionType}Condition`),className:[e,o("remove")],content:kc.icon("minus"),action:{click:()=>this.destroy(),mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}}});t.push(i);const r=kc.btnTemplate({title:n.get(`add${this.conditionType}Condition`),className:[e,o("add")],content:kc.icon("plus"),action:{click:()=>{const t=this.parent.addConditionType(this.conditionType),e={changedProperty:null,dataPath:t.address,value:t.value,src:t.dom};this.updateDataDebounced(e)}}});return t.push(r),t}get value(){return Array.from(this.fields).reduce(((t,[e,n])=>(t[e]=n.value,t)),{})}processUiState(){sd(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=Jo((t=>{uu.formeoUpdated(t),su.setAddress(t.dataPath,t.value)}));onChangeCondition=({key:t,target:e})=>{const n={changedProperty:t,dataPath:this.address,value:this.value,src:e};sd(this.fields),this.updateDataDebounced(n)}}const ud=new Map([["attrs",({itemKey:t})=>t],["options",({itemKey:t,key:e})=>`${t}.${e}`]]),hd=(t,e)=>{if("select"===e.controlId){const n=e.editPanels.get("options"),[o,i]=t?dr:ur,r=n.data.map((({[o]:t,...e})=>({[i]:t,...e})));n.setData(r)}},pd=new Map([["attrs-multiple",t=>({change:({target:e})=>{"select"===t.field.controlId&&hd(e.checked,t.field)}})]]);class fd{constructor({key:t,index:e,field:n,panel:o,data:i}){this.field=n,this.itemKey=t,this.itemIndex=e,this.panel=o,this.panelName=o.name,this.isDisabled=n.isDisabledProp(t,this.panelName),this.isHidden=this.isDisabled&&n.config.panels[this.panelName].hideDisabled,this.isLocked=n.isLockedProp(t,this.panelName),this.address=`${n.indexName}.${n.id}.${t}`,this.itemSlug=br(t),this.conditionTypeWrap=new Map,void 0!==i&&void 0===this.field.get(this.itemKey)&&this.field.set(this.itemKey,i);const r=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&r.push("hidden-property"),this.dom=kc.create({tag:"li",className:r,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const t=this.field.get(this.itemKey);return t?.constructor===Object?Ec(Object.entries(t),dr,"0"):[[this.itemKey,t]]}findOrCreateConditionTypeWrap(t){let e=this.conditionTypeWrap.get(t);return e||(e=kc.create({className:`type-conditions-wrap ${t}-conditions-wrap`}),this.conditionTypeWrap.set(t,e),e)}itemInputs(){const t=kc.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map((([t,e])=>"conditions"===this.panelName?this.generateConditionFields(t,e):this.itemInput(t,e)))});return this.inputs&&this.inputs.replaceWith(t),this.inputs=t,t}addConditionType=(t,e)=>{const n=this.findOrCreateConditionTypeWrap(t);let o=e;if(!o){const[e]=rr()[t],i=n.children.length;"if"===t&&(e.logical="||"),o={conditionValues:e,conditionCount:i,index:i}}const i=new dd({conditionType:t,...o},this);return n.appendChild(i.dom),i};removeConditionType=(t,e)=>{const n=this.conditionTypeWrap.get(t),o=n.children[e];o.destroy(),n.removeChild(o.dom)};generateConditionFields=(t,e)=>(this.conditions=new Map,e.forEach(((n,o)=>{const i=this.addConditionType(t,{index:o,conditionCount:e.length,conditionValues:n});this.conditions.set(o,i)})),this.findOrCreateConditionTypeWrap(t));get itemControls(){if(this.isLocked){return{className:`${this.panelName}-prop-controls prop-controls`,content:[]}}const t={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{yc.slideUp(this.dom,qi,(t=>{this.field.remove(this.itemKey),t.remove(),this.panel.updateProps()}))},mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}},content:kc.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=kc.childType(e)||"string",o=ud.get(this.panelName)?.({itemKey:this.itemKey,key:t})||this.itemKey,i=o.split(".").filter(Number.isNaN).join(".")||t,r=Jc[n]({key:t,value:e}),s=`${this.field.shortId}-${br(o).replace(/-\d+-(selected)/g,"-$1")}`,a={label:"options"!==this.panelName&&(Zc(i)||mr(i)),labelAfter:!1},l={name:"checkbox"===r.attrs.type?`${s}[]`:s};l.disabled=this.isDisabled,l.locked=this.isLocked;const c=pd.get(this.itemSlug)?.(this),d=function(t,e={}){const n={...t};for(const o in e)Object.hasOwn(e,o)&&(Object.hasOwn(n,o)?Array.isArray(n[o])?n[o].push(e[o]):n[o]=[n[o],e[o]]:n[o]=e[o]);return n}(Kc[n](o,this.field),c||{}),u=Vo(Jc[n]({key:t,value:e}),{action:d,attrs:l,config:a});return dr.includes(t)?{className:"f-addon",children:u}:u}}const md={multiple:(t,e)=>{hd(!!t,e)}};class gd{constructor(t,e,n){this.type=kc.childType(t),this.name=e,this.component=n,this.panelConfig=this.getPanelConfig(this.data)}get data(){const t=this.component.get(this.name);return"object"===this.type?Object.entries(t):t}getPanelConfig(t){return this.props=this.createProps(t),this.editButtons=this.createEditButtons(),{config:{label:n.get(`panel.label.${this.name}`)},attrs:{className:`${pi} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(t=this.data){this.editPanelItems=Array.from(t).map(((t,e)=>{const n="array"===this.type,o=n?`[${e}]`:`.${t[0]}`,i=n?t:{[t[0]]:t[1]};return new fd({key:`${this.name}${o}`,data:i,field:this.component,index:e,panel:this})}));const e={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},editGroup:this.name,isSortable:"options"===this.name,content:this.editPanelItems};return kc.create(e)}updateProps(){const t=this.createProps();this.props.replaceWith(t),this.props=t}createEditButtons(){const t=this.name,e=n.get(`panelEditButtons.${t}`),o={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition},i=[];if("conditions"===t){n.current.clearAll||n.put("clearAll","Clear All");const e={...kc.btnTemplate({content:[kc.icon("bin"),n.get("clearAll")],title:n.get("clearAll")}),className:`clear-all-${t}`,action:{click:()=>{this.clearAllItems()}}};i.push(e)}const r={...kc.btnTemplate({content:e,title:e}),className:`add-${t}`,action:{click:e=>{const i={btnCoords:kc.coords(e.target),addAction:o[t]};"attrs"===t&&(i.isDisabled=this.component.isDisabledProp,i.isLocked=this.component.isLockedProp,i.message={attr:n.get(`action.add.${t}.attr`),value:n.get(`action.add.${t}.value`)});const r=mr(t),s=new window.CustomEvent(`onAdd${r}`,{detail:i});mu.add[t](i),document.dispatchEvent(s)}}};i.push(r);return{className:"panel-action-buttons",content:i}}addAttribute=(t,e)=>{let o=e;const i=_c(t),r=`attrs.${i}`;n.current[r]||n.put(r,Ac(t)),"string"==typeof o&&["true","false"].includes(o)&&(o=JSON.parse(o)),this.component.set(`attrs.${t}`,o),md[i]?.(o,this.component);const s=this.props.querySelector(`.${this.component.name}-attrs-${i}`),a=new fd({key:r,data:{[i]:o},field:this.component,panel:this});s?s.replaceWith(a.dom):this.props.appendChild(a.dom),this.component.resizePanelWrap()};addOption=()=>{const t=this.component.data.config.controlId,e=this.component.get("options"),o="select"===t?"option":t,i=n.get("newOptionLabel",{type:o})||"New Option",r=`${this.name}[${this.data.length}]`,s=e[e.length-1],a={...e.length?s:{},label:i};"button"!==t&&(a.value=gr(i));const l=new fd({key:r,data:a,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(l),this.props.appendChild(l.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=t=>{const e=`conditions[${this.component.get("conditions").length}]`,n=new fd({key:e,data:t.template,field:this.component,panel:this});this.props.appendChild(n.dom),this.component.set(e,t.template),this.component.resizePanelWrap()};clearAllItems=()=>{const t="array"===this.type?[]:{},e={type:this.name,removeAction:()=>{this.component.set(this.name,t),this.updateProps()}};mu.remove[this.name](e);const n=mr(this.name),o=new window.CustomEvent(`onRemove${n}`,{detail:e});document.dispatchEvent(o)};setData(t){this.data=t,this.component.set(this.name,t),this.updateProps()}}const vd=Object.freeze({type:"field",displayType:"slider"}),bd=t=>({transform:`translateX(${t?`${t}px`:0})`});class yd{constructor(t){this.opts=Vo(vd,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const e=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const n=new window.ResizeObserver((([{contentRect:{width:t}}])=>{this.currentWidth!==t&&(this.toggleTabbedLayout(),this.currentWidth=t,this.nav.setTranslateX(this.activePanelIndex,!1))})),o=window.setTimeout((()=>{n.observe(e),window.clearTimeout(o)}),Hi)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(kc.getStyle(t,"width"),10)>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||vd.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const t=kc.create({className:"panels",content:this.opts.panels.map((({config:t,...e})=>e))});return"field"===this.opts.type&&this.sortableProperties(t),this.panelsWrap=t,this.panels=t.children,this.currentPanel=this.panels[this.activePanelIndex],t}sortableProperties(t){const e=t.getElementsByClassName("field-edit-group");return Tc.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Kl.create(t,{animation:150,group:{name:`edit-${t.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:t=>{this.propertySave(t.to),this.resizePanels()}})}))}createPanelNavLabels(){const t=this.opts.panels.map((t=>({tag:"h5",action:{click:t=>{const e=Cc(t.target);this.nav.setTranslateX(e,!1),this.nav.groupChange(e)}},content:t.config.label}))),e={className:"panel-labels",content:{content:t}},[n]=t;return n.className="active-tab",kc.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:n.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:kc.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:n.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:kc.icon("triangle-left")};return kc.create({tag:"nav",attrs:{className:"panel-nav"},content:[e,this.labels,t]})}get isTabbed(){return"tabbed"===this.panelDisplay}navActions(){const t={},e=this.currentPanel.parentElement,n=this.labels.firstChild,o=n.children,i=this.currentPanel.parentElement.childNodes;this.activePanelIndex=Cc(this.currentPanel);let r={nav:0,panel:0},s={...r};t.groupChange=t=>(this.activePanelIndex=t,this.currentPanel=i[t],kc.removeClasses(i,"active-panel"),kc.removeClasses(o,"active-tab"),this.currentPanel.classList.add("active-panel"),o[t].classList.add("active-tab"),this.currentPanel);const a=({offset:t,reset:o,duration:i=Vi,animate:r=!this.isTabbed})=>{const a=[bd(s.panel),bd(t.panel)],l=[bd(s.nav),bd(this.isTabbed?0:t.nav)];if(o){const[t]=a,[e]=l;a.push(t),l.push(e)}const c={easing:"ease-in-out",duration:r?i:0,fill:"forwards"},d=e.animate(a,c);n.animate(l,c);const u=()=>{d.removeEventListener("finish",u),o||(s=t)};d.addEventListener("finish",u)};return t.setTranslateX=(t=this.activePanelIndex,o=!0)=>{var i;i=t,r={nav:-n.offsetWidth*i,panel:-e.offsetWidth*i},a({offset:r,animate:o})},t.refresh=(e=this.activePanelIndex)=>{this.activePanelIndex!==e&&t.groupChange(e),t.setTranslateX(this.activePanelIndex,!1),this.resizePanels()},t.nextGroup=()=>{const e=this.activePanelIndex+1;if(e!==i.length){const o=i[e];r={nav:-n.offsetWidth*e,panel:-o.offsetLeft},a({offset:r}),t.groupChange(e)}else r={nav:s.nav-8,panel:s.panel-8},a({offset:r,reset:!0});return this.currentPanel},t.prevGroup=()=>{if(0!==this.activePanelIndex){const e=this.activePanelIndex-1,o=i[e];r={nav:-n.offsetWidth*e,panel:-o.offsetLeft},a({offset:r}),t.groupChange(e)}else r={nav:8,panel:8},a({offset:r,reset:!0})},t}}let wd=null;const Cd=ns(er);class Ed extends fa{constructor(t,e={}){const n={...e,id:e.id||qo()};super(t,n),this.id=n.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=t,this.indexName=`${t}s`,this.config=su[`${this.name}s`].config,Vo(this.config,n.config),this.address=`${this.name}s.${this.id}`,this.dataPath=`${this.address}.`,this.editPanels=new Map,this.eventListeners=new Map,this.initEventHandlers()}initEventHandlers(){this.config.events&&Object.entries(this.config.events).forEach((([t,e])=>{this.addEventListener(t,e)}))}addEventListener(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,[]),this.eventListeners.get(t).push(e)}removeEventListener(t,e){if(!this.eventListeners?.has(t))return;const n=this.eventListeners.get(t),o=n.indexOf(e);o>-1&&n.splice(o,1)}dispatchComponentEvent(t,e={}){const n={component:this,type:t,timestamp:Date.now(),...e};return this.eventListeners?.has(t)&&this.eventListeners.get(t).forEach((t=>{try{"function"==typeof t&&t(n)}catch(e){}})),n}set(t,e){const n=this.get(t),o=super.set(t,e);return n!==e&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:t,oldValue:n,newValue:e}),o}get js(){return this.data}get json(){return this.data}remove=t=>{if(t){const e=vr(t),n=e.pop(),o=this.get(e);return Array.isArray(o)?wc(n)?o.splice(Number(n),1):this.set(e,o.filter((t=>t!==n))):delete o[n],o}if("stage"===this.name)return null;const e=this.parent,n=this.children;return this.dispatchComponentEvent("onRemove",{path:t,parent:e,children:[...n]}),xc(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(su.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),su[`${this.name}s`].delete(this.id)};empty(){const t=this.children.map((t=>(t.remove(),t)));return this.dom.classList.add("empty"),t}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const t=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{su.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),su.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...kc.btnTemplate({content:kc.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>kc.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&kc.icon("component-corner",{className:"bottom-left"}),kc.icon(`handle-${this.name}`),mr(this.name),(this.isColumn||this.isRow)&&kc.icon("component-corner",{className:"bottom-right"})].filter(Boolean)});toggleEdit(t=!this.isEditing){this.isEditing=t;const e=this.dom,n="editing",o=`${n}-${this.name}`,i=this.dom.querySelector(`.${this.name}-edit`);yc.slideToggle(i,qi,t),"field"===this.name&&(yc.slideToggle(this.preview,qi,!t),e.parentElement.classList.toggle(`column-${o}`,t)),e.classList.toggle(n,t),e.classList.toggle(o,t)}get buttons(){if(this.actionButtons)return this.actionButtons;const t={handle:(t=`handle-${this.name}`)=>({...kc.btnTemplate({content:kc.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...kc.btnTemplate({content:kc.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...kc.btnTemplate({content:kc.icon(t)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(t="remove")=>({...kc.btnTemplate({content:kc.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{yc.slideUp(this.dom,qi,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...kc.btnTemplate({content:kc.icon(t)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),"column"===this.name&&this.parent.autoColumnWidths()}}})},{buttons:e,disabled:n}=this.config.actionButtons,o=e.filter((t=>!n.includes(t))).map((e=>t[e]?.()||e));return this.actionButtons=o,this.actionButtons}get index(){return Cc(this.dom)}removeClasses=t=>{const e={string:()=>this.dom.classList.remove(t),array:()=>t.map((t=>this.dom.classList.remove(t)))};return e.object=e.string,e[kc.childType(t)](this.dom)};get parentType(){return Fi.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${ji[t]}`);return e&&kc.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=Ri.get(this.name);return Sc(t,(t=>su.getAddress(`${e}s.${t.id}`))).filter(Boolean)}loadChildren=(t=this.data.children)=>t.map((t=>this.addChild({id:t})));get domChildren(){const t=this.dom.querySelector(".children");return t?t.children:[]}addChild(t={},e=this.domChildren.length){let n=t;"object"!=typeof t&&(n={id:n});const o=this.dom.querySelector(".children"),{id:i=qo()}=n,r=Ri.get(this.name);if(!r)return null;const s=`${r}s`,a=su.getAddress(`${s}.${i}`)||su[s].add(i,n);e>=o.children.length?o.appendChild(a.dom):o.children[e].before(a.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:a,child:a,index:e}),a.dispatchComponentEvent("onAdd",{parent:this,target:a,index:e,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:a});const l=a.get("children");return l?.length&&a.loadChildren(l),this.removeClasses("empty"),this.saveChildOrder(),a}saveChildOrder=()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t};onAdd({from:t,to:e,item:n,newIndex:o}){t.classList.contains(fi)||(t=t.parentElement);const i=zo(t),r=zo(e.parentElement),s=new Map([[-2,()=>{const t=this.addChild({},o).addChild();return t.addChild.bind(t)}],[-1,()=>{const t=this.addChild({},o);return t.addChild.bind(t)}],[0,()=>this.addChild.bind(this)],[1,t=>{const e=Cc(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),a={controls:async()=>{if(!wd){const{default:t}=await Promise.resolve().then((()=>Yd));wd=t}const{controlData:{meta:{id:t},...e}}=wd.get(n.id);es(e,"config.controlId",t);const i=t.startsWith("layout-")?t.replace(/^layout-/,""):"field",r=ts({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${i}`),a=s.get(r)();kc.remove(n);return a(e,o)},row:()=>{const t=(s.get({stage:-1,row:0,column:1}[r])||Ko)();return t?.({id:n.id},o)},column:()=>{const t=(s.get({stage:-2,row:-1}[r])||Ko)();return t?.(n.id)}},l=a[i]?.(n,o);return this.dispatchComponentEvent("onAdd",{from:t,to:e,item:n,newIndex:o,fromType:i,toType:r,addedComponent:l,addedVia:"dragDrop"}),(()=>{this.saveChildOrder(),this.removeClasses("empty")})(),l}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:t}}){return t.classList.contains(vi)&&t.classList.remove("column-editing-field"),"stage"===this.name||this.children.length?(this.emptyClass(),this.saveChildOrder()):this.remove()}onEnd=({to:{parentElement:t},from:{parentElement:e}})=>{t?.classList.remove(`hovering-${zo(t)}`),e?.classList.remove(`hovering-${zo(e)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:t}=this.config;if(!t)return null;t.onRender&&kc.onRender(this.dom,t.onRender)}set config(t){const e=ts(t,"all"),n=ts(this.data,"config.controlId"),o=[e,n&&ts(t,n),ts(t,this.id)].reduce(((t,e)=>e?Vo(t,e):t),this.configVal);this.configVal=o}get config(){return this.configVal}runConditions=()=>{const t=this.get("conditions");if(!t?.length)return null;return t.map((t=>{const e=this.processConditions(t.if),n=this.processResults(t.then);return e.map((t=>this.evaluateConditions(t)&&this.execResults(n)))}))};getComponent(t){const[e,n]=t.split("."),o=su[e];return n===this.id?this:o?.get(n)}value=(t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!Cd[i]].some(Boolean)?t:e?o.set(Cd[i],e):o.get(Cd[i])};getResult=t=>({"=":(t,e,n)=>t.set(e,n)}[t]);processResults=t=>t.map((({operator:t,target:e,value:n})=>{const o=this.getComponent(e);return{target:o,propertyPath:o&&e.split(".").slice(2,e.length).join("."),action:this.getResult(t),value:this.value(n)}}));execResults=t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)};execResult=({target:t,action:e,value:n,_propertyPath:o})=>new Promise(((o,i)=>{try{return o(e(t,n))}catch(r){return i(r)}}));cloneData=()=>{const t={...Ho(this.data),id:qo()};return"field"!==this.name&&(t.children=[]),t};clone=(t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),this.dispatchComponentEvent("onClone",{original:this,clone:e,parent:t}),e};cloneChildren(t){for(const e of this.children)e?.clone(t)}createChildWrap=t=>kc.create({tag:"ul",attrs:{className:"children"},children:t});get isRow(){return this.name===Ti.row}get isColumn(){return this.name===Ti.column}get isField(){return this.name===Ti.field}isDisabledProp=(t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get("config.disabled")).includes(t)};isLockedProp=(t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get("config.locked")).includes(t)};get editWindow(){const t={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},e=this.editPanels.size;return e&&(t.className.push(`panel-count-${e}`),t.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),t.action={onRender:()=>{if(0===e){const t=this.dom.querySelector(".edit-toggle"),e=this.dom.querySelector(`.${this.name}-actions`),n=e.getElementsByTagName("button");e.style.maxWidth=n.length*n[0].clientWidth+"px",kc.remove(t)}else this.resizePanelWrap()}},kc.create(t)}updateEditPanels=()=>{if(!this.config)return null;const t=["object","array"],e=Uo([...this.config.panels.order,...Object.keys(this.data)]),n=["children","config","meta","action","events",...this.config.panels.disabled],o=e.filter((t=>!n.includes(t)));for(const r of o){const e=this.get(r),n=kc.childType(e);if(t.includes(n)){const t=new gd(e,r,this);this.editPanels.set(t.name,t)}}const i={panels:Array.from(this.editPanels.values()).map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"};this.panels=new yd(i),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class xd{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(t){const e=t.querySelector(".children");if(!e)return 0;const n=e.children.length,o=kc.getStyle(e,"gap")||"0px",i=parseFloat(o,10)||0;return this.totalGapWidth=i*(n-1),e.offsetWidth-this.totalGapWidth}validateResizeTarget(t,e){return t&&e&&t.offsetWidth&&e.offsetWidth}onStart(t){if(t.preventDefault(),this.resized=!1,0!==t.button)return;const e=t.target.parentElement,n=e.nextSibling||e.previousSibling,o=e.closest(`.${gi}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(Ci),this.columnPreset=o.querySelector(`.${wi}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(ar,""),n.className=n.className.replace(ar,""),this.colStartWidth=e.offsetWidth,this.sibStartWidth=n.offsetWidth,this.rowWidth=this.getRowWidth(o),this.rowWidth<=0)this.cleanup();else{this.column=e,this.sibling=n,this.row=o;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(i){this.cleanup()}}else this.cleanup()}calculateNewWidths(t){const e=this.colStartWidth+t-this.startX,n=this.sibStartWidth-t+this.startX,o=parseFloat(Xo(e,this.rowWidth)),i=parseFloat(Xo(n,this.rowWidth));return o<10||i<10?null:{colWidth:Yo(o.toFixed(1)),siblingColWidth:Yo(i.toFixed(1))}}onMove(t){t.preventDefault();const{column:e,sibling:n}=this,o="touchmove"===t.type?t.touches[0].clientX:t.clientX,i=this.calculateNewWidths(o);if(!i)return;const{colWidth:r,siblingColWidth:s}=i;e.dataset.colWidth=r,n.dataset.colWidth=s,e.style.width=r,n.style.width=s,this.resized=!0}onStop(){const{column:t,sibling:e}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),su.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),su.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(Ci),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(Ci),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${yi}`);const n=this.row.querySelector(".children").children,o=Sc(n,(t=>Xo(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=kc.create({tag:"option",attrs:{className:yi,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const Sd=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[kc.icon("triangle-down"),kc.icon("triangle-up")]}),Od=()=>({className:"column-edit group-config"});class _d extends Ed{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[vi]}),...t});const e=this.createChildWrap();this.dom=kc.create({tag:"li",className:[vi,"empty"],dataset:{hoverTag:n.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),Od(),Sd(new xd),e]}),this.processConfig(),uu.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Kl.create(e,{animation:150,fallbackClass:"field-moving",group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:t=>{t.from!==t.to&&t.from.classList.remove("hovering-column")},draggable:`.${bi}`,handle:".item-move"})}processConfig(){const t=Tc.get(this.data,"config.width");t&&this.setDomWidth(t)}refreshFieldPanels=()=>{for(const t of this.children)t.panels.nav.refresh()};setDomWidth=t=>{this.dom.dataset.colWidth=t,this.dom.style.width=t};setWidth=t=>(this.setDomWidth(t),this.set("config.width",t))}const Ad={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const Nd=new class extends ma{constructor(t){super("columns",t),this.config={all:Ad}}Component(t){return new _d(t)}};class Td extends Ed{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[gi]}),...t});const e=this.createChildWrap();this.dom=kc.create({tag:"li",className:[gi,"empty"],dataset:{hoverTag:n.get("row"),editingHoverTag:n.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),Kl.create(e,{animation:150,fallbackClass:"column-moving",group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${vi}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:n.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:n.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:n.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:n.get("row.makeInputGroup"),description:n.get("row.makeInputGroupDesc")}},o={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Title"},config:{label:{children:["Row Title",{tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}}]}},action:{input:({target:{value:t}})=>this.set("config.legend",t)},className:""}},i=kc.formGroup([t,o]),r={tag:"label",content:n.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=kc.create(this.columnPresetControlConfig);const s={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},a=[e,"hr",i,"hr",kc.formGroup([r,s],"row")];return kc.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=a.map((t=>kc.create(t)));t.append(...e)}}})}onAdd(...t){super.onAdd(...t),this.autoColumnWidths()}onRemove(...t){super.onRemove(...t),this.autoColumnWidths()}autoColumnWidths=()=>{const t=this.children;if(!t.length)return;const e=Number.parseFloat((100/t.length).toFixed(1))/1;for(const n of t){n.removeClasses(ar);const t=n.dom,o=Yo(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),Vi);document.dispatchEvent(uu.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>kc.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)};setColumnWidths=t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))};get getColumnPresetOptions(){const t=this.children,e=Bi.get(t.length-1)||[],n=t.map((t=>{const e=t.get("config.width")||"";return Number(e.replace("%","")).toFixed(1)})).join(",");if(e.length){const t=e.slice();return!t.find((t=>t.value===n))&&t.push({value:n,label:n.replace(/,/g," | "),className:yi}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:n.get("defineColumnLayout"),className:wi},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const Pd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const jd=new class extends ma{constructor(t){super("rows",t),this.config={all:Pd}}Component(t){return new Td(t)}};class Dd extends Ed{constructor(t){super("stage",{conditions:[rr()],children:[],...t}),this.updateEditPanels(),this.debouncedUpdateEditPanels=Jo(this.updateEditPanels),n.get("Untitled Form"),n.get("Untitled Form"),n.get("Form Title"),n.get("Form novalidate"),n.get("Tags");const e=this.createChildWrap();this.dom=kc.create({attrs:{className:[mi,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),Kl.create(e,{animation:150,fallbackClass:"row-moving",group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{kd.active=this},onSort:this.onSort.bind(this),draggable:`.${gi}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),yc.slideUp(this.dom,qi,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),yc.slideDown(this.dom,qi)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const kd=new class extends ma{constructor(t){super("stages",t),this.config={all:{actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}}}}Component(t){return new Dd(t)}},Ld={js:new Set,css:new Set},$d=(t,e,n=Qo)=>new Promise((o=>fetch(t).then((t=>{if(!t.ok)return o(n(t));o(e?e(t):t)})).catch((t=>n(t))))),Id=(t,e)=>{t.removeEventListener("load",Id),e(t.src)},Md=(t,e)=>{t.removeEventListener("load",Md),e(t.src)},Rd=t=>new Promise(((e,n)=>{if(Ld.js.has(t))return e(t);Ld.js.add(t);const o=kc.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:t},action:{load:()=>Md(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Wd=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(Ld.css.has(t))return e(t);Ld.css.add(t);const o=kc.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Id(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Fd=async(t=di)=>{if(document.getElementById(si))return;const e=async t=>(t=>{let e=document.getElementById(si);return e||(e=kc.create({id:si,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e})(await t.text());return $d(t,e,(()=>$d(ui,e)))},Bd={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Rd(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Wd(t)));return Promise.all(e)}},zd=t=>{const e=Object.entries(t).map((([t,e])=>Bd[t](e)));return Promise.all(e)},Ud=()=>{const t=document.getElementById(si);return"hidden"===window.getComputedStyle(t).visibility};class qd{controlCache=new Set;constructor({events:t={},dependencies:e={},controlAction:n,...o}){this.events=t,this.controlData=o,this.controlAction=n,this.dependencies=e,this.id=o.id||qo()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}get dom(){const{meta:t,config:e}=this.controlData,n=this.i18n(e.label)||e.label,o={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:kc.icon(t.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:t})=>{const e=t.closest(`.${fi}`);return e&&Xd.panels.nav.refresh(Cc(e))},click:({target:t})=>{const e=t.closest(".field-control")?.id;e&&Xd.addElement(e)}}};return kc.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return zd(this.dependencies)}i18n(t,e){const o=n.locale,i=this.definition?.i18n,r=i?.[o]||{};return(r[t]?.()??r[t])||n.get(t,e)}}const Vd=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}});let Hd=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${fi}`);return e&&this.panels.nav.refresh(Cc(e))},click:({target:t})=>{this.addElement(t.parentElement.id)}}}async init(t,e=!1){return await this.applyOptions(t),this.buildDOM(e),this}registerControls(t){return this.controls=[],t.map((t=>{const e="function"==typeof t?new t:new qd(t);return this.add(e),this.controls.push(e.dom),e.promise()}))}groupLabel=t=>n.get(t)||t||"";groupElements(){let t=this.options.groups.slice(),e=this.controls.slice(),n=[];const o=[];return t=Ec(t,this.groupOrder,"id"),t=t.filter((t=>Bo(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:[fi,pi],id:`${t.id}-${fi}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=Uo(e.concat(t.elementOrder));t.elementOrder=n}return e=Ec(e,t.elementOrder,"meta.id"),n.content=e.filter((e=>{const{controlData:n}=this.get(e.id),i=n.meta.id||"";let r=!0;return r=[Bo(i,this.options.disable.elements),n.meta.group===t.id,!o.includes(i)].every((t=>!0===t)),r&&o.push(i),r})),n})),n}add(t=Object.create(null)){const e=Ho(t);return this.data.set(e.id,e),e.controlData.meta.id&&this.data.set(e.controlData.meta.id,e.controlData),e}get(t){return Ho(this.data.get(t))}formActions(){if(!0===this.options.disable.formActions)return null;const t={...kc.btnTemplate({content:[kc.icon("bin"),n.get("clear")],title:n.get("clearAll")}),className:["clear-form"],action:{click:t=>{jd.size?(uu.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:n.get("confirmClearAll"),clearAllAction:()=>{kd.clearAll().then((()=>{const e={src:t.target};uu.formeoCleared(e)}))},btnCoords:kc.coords(t.target)}}),document.dispatchEvent(uu.confirmClearAll)):window.alert(n.get("cannotClearFields"))}}},e={...kc.btnTemplate({content:[kc.icon("floppy-disk"),n.get("save")],title:n.get("save")}),className:["save-form"],action:{click:async({target:t})=>{const{default:e}=await Promise.resolve().then((()=>au)),{formData:n}=e,o={action:()=>{},coords:kc.coords(t),message:"",button:t};return mu.click.btn(o),mu.save.form(n)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:t,saveBtn:e}).reduce(((t,[e,n])=>(this.options.disable.formActions.includes(e)||t.push(n),t)),[])}}buildDOM(t){const e=this.groupElements(),o=this.formActions(),{displayType:i}=this.options.panels;this.panels=new yd({panels:e,type:"controls",displayType:i});const r=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],s=kc.create({className:r,content:[this.panels.panelNav,this.panels.panelsWrap]}),a=["formeo-controls"];t&&a.push("formeo-sticky");const l=kc.create({className:a,content:[s,o]}),c=l.getElementsByClassName("control-group");this.dom=l,this.groups=c;const[d]=c;this.currentGroup=d,this.actions={filter:t=>{const e=""!==t,o=this.controls;let i=s.querySelector(".filtered-term");if(kc.toggleElementsByStr(o,t),e){const e=n.get("controls.filteringTerm",t);l.classList.add("filtered"),i?i.textContent=e:(i=kc.create({tag:"h5",className:"filtered-term",content:e}),s.insertBefore(i,s.firstChild))}else i&&(l.classList.remove("filtered"),i.remove())},addElement:this.addElement,addGroup:t=>{}};for(let n=c.length-1;n>=0;n--){const t=`formeo-controls-${c[n]}`;this.options.sortable||window.localStorage.removeItem(t),Kl.create(c[n],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:async({item:t})=>{const{controlData:e}=this.get(t.id);if(this.options.ghostPreview){const{default:n}=await Promise.resolve().then((()=>Kd));t.innerHTML="",t.appendChild(new n(e).preview)}},onEnd:({from:t,item:e,clone:n})=>{t.contains(n)&&t.replaceChild(e,n)},sort:this.options.sortable,store:{get:()=>{const e=window.localStorage.getItem(t);return e?e.split("|"):[]},set:e=>{const n=e.toArray();window.localStorage.setItem(t,n.join("|"))}}})}return l}layoutTypes={row:()=>kd.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:t=>this.layoutTypes.column().addChild(t)};addElement=t=>{const{meta:{group:e,id:n},...o}=ts(this.get(t),"controlData");return es(o,"config.controlId",n),"layout"===e?this.layoutTypes[n.replace("layout-","")]():this.layoutTypes.field(o)};applyOptions=async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=Vo(Vd,t);this.container=e,this.groupOrder=Uo(o.concat(["common","html","layout"])),this.options=i;const[r,s,a]=await Promise.all([Promise.resolve().then((()=>ku)),Promise.resolve().then((()=>Mu)),Promise.resolve().then((()=>Bu))]),l=[r.default,s.default,a.default].flat();return Promise.all(this.registerControls([...l,...n]))}};const Xd=new Hd,Yd=Object.freeze(Object.defineProperty({__proto__:null,Controls:Hd,default:Xd},Symbol.toStringTag,{value:"Module"})),Gd=new Set(["checkbox","radio"]),Zd=new Set(["radio","checkbox","select-one","select-multiple"]);class Jd extends Ed{constructor(t=Object.create(null)){super("field",{...t}),this.debouncedUpdateEditPanels=Jo(this.updateEditPanels),this.debouncedUpdatePreview=Jo(this.updatePreview),this.label=kc.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const e=this.getActionButtons(),o=this.actionButtons.some((t=>"edit"===t.meta?.id));this.updateEditPanels();const i=kc.create({tag:"li",attrs:{className:bi},id:this.id,children:[this.label,this.getComponentTag(),e,o&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:n.get("field")}});this.dom=i,this.isEditing=!1}get labelConfig(){if(!!this.get("config.hideLabel"))return null;const t=this.get("config.editorLabel")||this.get("config.label"),e=this.get("attrs.required"),n=this.config.label.disableHTML;return{className:"prev-label",children:[{...(()=>{const e={tag:"label",attrs:{}};return n?(e.tag="input",e.attrs.value=t,e):(e.attrs.contenteditable=!0,e.children=t,e)})(),action:{input:({target:{innerHTML:t,innerText:e}})=>{super.set("config.label",n?e:t)}}},e&&kc.requiredMark()]}}setData=(t,e)=>super.set(t,e);set(t,e){const n=this.setData(t,e);return this.debouncedUpdatePreview(),n}updateLabel(){if(!this.label)return null;const t=kc.create(this.labelConfig);this.label.replaceWith(t),this.label=t}updatePreview=()=>{this.updateLabel();const t=this.fieldPreview();this.preview.replaceWith(t),this.preview=t};get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{type:n}=e;if(Zd.has(n)){const t=this.preview.querySelectorAll(":checked"),e=this.get("options"),n=void 0!==e?.[0]?.selected?"selected":"checked",o=e.reduce(((t,e)=>(t[e.value]=e,t[e.value][n]=!1,t)),{});for(const i of t)o[i.value][n]=i.value===o[i.value].value;return super.set("options",Object.values(o)),this.debouncedUpdateEditPanels()}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:({target:t})=>{if(["input","meter","progress","button"].includes(t.tagName.toLowerCase()))return super.set("attrs.value",t.value),this.debouncedUpdateEditPanels();if(t.contentEditable&&!t.type?.startsWith("select-")){const e=t.parentElement.classList;if(e.contains("f-checkbox")||e.contains("f-radio")){const e=t.parentElement,n=Cc(e);return this.setData(`options[${n}].label`,t.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",t.innerHTML||t.value)}}}}fieldPreview(){const{action:t={},...e}=Ho(this.data);e.id=`prev-${this.id}`,e.action=Object.entries(t).reduce(((t,[e,n])=>(t[e]=n.bind(this),t)),{}),this.data?.config.editableContent&&(e.attrs={...e.attrs,contenteditable:!0});const n={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:kc.create(e,!0),action:this.defaultPreviewActions};return kc.create(n,!0)}get isCheckable(){return Gd.has(this.get("config.controlId"))}}const Kd=Object.freeze(Object.defineProperty({__proto__:null,default:Jd},Symbol.toStringTag,{value:"Module"}));const Qd=new class extends ma{constructor(t){super("fields",t),this.config={all:{actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}}}}Component(t){return new Jd(t)}get=t=>{let e=t&&ts(this.data,t);if(!e){const n=Xd.get(t);n&&(e=this.add(null,n.controlData))}return e};getData=()=>Object.entries(this.data).reduce(((t,[e,n])=>{const{conditions:o,...i}=n?.getData()||n;if(o?.length){let t=!0;if(1===o.length){const[e]=o;t=Boolean(e.if[0].source)}t&&(i.conditions=o)}return t[e]=i,t}),{});load=(t=Object.create(null))=>{const e=ti(t);this.empty();for(const[n,o]of Object.entries(e)){const{meta:t,...e}=o;t?.id&&es(e,"config.controlId",t?.id),this.add(n,e)}return this.data}},tu=kd,eu=jd,nu=Nd,ou=Qd,iu=Xd;class ru extends fa{constructor(){super("components"),this.disableEvents=!0,this.stages=tu,this.rows=eu,this.columns=nu,this.fields=ou,this.controls=iu}load=(t,e)=>{this.empty();const n=((t,e=!1)=>t?Ho(ti(t)):e&&Go.get(zi)||cr())(t,e.sessionStorage);this.opts=e,this.set("id",n.id),this.add("stages",tu.load(n.stages)),this.add("rows",eu.load(n.rows)),this.add("columns",nu.load(n.columns)),this.add("fields",ou.load(n.fields));for(const o of Object.values(this.get("stages")))o.loadChildren();return this.data};flatList(){const t={};for(const e of Object.keys(this.data.stages))ni(this.data,e,"stages",t);return t}getChildData=({type:t,id:e})=>{const n=this.get(t,e);if(n)return n.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${ii}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:kd.getData(),rows:jd.getData(),columns:Nd.getData(),fields:Qd.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;tu.config=e,eu.config=n,nu.config=o,ou.config=i}getIndex(t){return this[t]||this[Ni.get(t)]}setAddress(t,e){if(!Zo(t))return;const[n,o,...i]=Array.isArray(t)?t:vr(t),r=this.getIndex(n).get(o);return r?.set(i,e),r}getAddress(t){if(!Zo(t))return;const[e,n,...o]=Array.isArray(t)?t:vr(t),i=this.getIndex(e).get(n);return!o.length||i?o.length?i.get(o):i:void 0}}const su=new ru,au=Object.freeze(Object.defineProperty({__proto__:null,Columns:nu,Components:ru,Controls:iu,Fields:ou,Rows:eu,Stages:tu,default:su},Symbol.toStringTag,{value:"Module"})),lu="no-transition",cu={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onChange:(...t)=>cu.onUpdate(...t),onUpdate:t=>uu.opts?.debug&&void 0,onUpdateStage:t=>uu.opts?.debug&&void 0,onUpdateRow:t=>uu.opts?.debug&&void 0,onUpdateColumn:t=>uu.opts?.debug&&void 0,onUpdateField:t=>uu.opts?.debug&&void 0,onRender:t=>uu.opts?.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},du=({src:t,...e},n=Yi)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:uu.opts?.debug||uu.opts?.bubbles});return o.data=(t||document).dispatchEvent(o),o},uu={init:function(t){return this.opts={...cu,...t},this},formeoSaved:t=>du(t,Xi),formeoUpdated:t=>du(t,Yi),formeoCleared:t=>du(t,"formeoCleared"),formeoOnRender:t=>du(t,Gi),formeoConditionUpdated:t=>du(t,"formeoConditionUpdated")},hu=function(t,e=Hi){let n=0;return function(...o){const i=Date.now();i-n>=e&&(n=i,t.apply(this,o))}}((()=>{uu.opts.onUpdate({timeStamp:window.performance.now(),type:Yi,detail:su.formData})}),Vi);let pu;document.addEventListener(Yi,hu),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;uu.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;uu.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;uu.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;uu.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener(Gi,(t=>{const{timeStamp:e,type:n,detail:o}=t;uu.opts.onRender({timeStamp:e,type:n,detail:o})})),document.addEventListener("confirmClearAll",(t=>{t={timeStamp:t.timeStamp,type:t.type,confirmationMessage:t.detail.confirmationMessage,clearAllAction:t.detail.clearAllAction,btnCoords:t.detail.btnCoords},uu.opts.confirmClearAll(t)})),document.addEventListener(Xi,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};uu.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{uu.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){pu=pu||window.requestAnimationFrame((()=>{pu=!1;for(const t of Object.values(nu.data))t.dom.classList.add(lu),iu.dom.classList.add(lu),iu.panels.nav.refresh(),t.refreshFieldPanels()}))}));const fu={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(n.get("attributeNotPermitted",e||"")),mu.add.attrs(t);let o;e&&(o=String(window.prompt(t.message.value,"")),t.addAction(e,o))},option:t=>{t.addAction()},condition:t=>{t.addAction(t)}},remove:{attrs:t=>{t.removeAction()},options:t=>{t.removeAction()},conditions:t=>{t.removeAction()}},click:{btn:t=>{t.action()}},save:{form:Ko}},mu={init:function(t){const e=Object.keys(fu);return this.opts=e.reduce(((e,n)=>(e[n]={...fu[n],...t[n]},e)),t),this},add:{attrs:t=>mu.opts.add.attr(t),options:t=>mu.opts.add.option(t),conditions:t=>(t.template=t.template||rr(),mu.opts.add.condition(t))},remove:{attrs:t=>mu.opts.remove.attrs(t),options:t=>mu.opts.remove.options(t),conditions:t=>mu.opts.remove.conditions(t)},click:{btn:t=>mu.opts.click.btn(t)},save:{form:t=>(mu.opts.sessionStorage&&Go.set(zi,t),uu.formeoSaved({formData:t}),mu.opts.save.form(t))}};n.addLanguage("en-US",void 0);const gu={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:di,style:hi,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Nc(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}};let vu=class{constructor({formData:t,...e},n){const o=Vo(gu.editor,e),{actions:i,events:r,debug:s,config:a,editorContainer:c,...d}=o;c&&(this.editorContainer="string"==typeof c?document.querySelector(c):c),this.opts=d,kc.setOptions=d,su.config=a,this.userFormData=n||t,this.Components=su,this.dom=kc,uu.init({debug:s,...r}),mu.init({debug:s,sessionStorage:d.sessionStorage,...i}),this.tooltip=new l,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(t={}){this.userFormData=ei(t),this.load(this.userFormData,this.opts)}get json(){return this.Components.json}clear(){this.userFormData=cr(),this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources);const t=[];this.opts.polyfills&&(t=>{const e=Array.isArray(t)?ai.filter((({name:e})=>-1!==t.indexOf(e))):ai;Promise.all(e.map((({src:t})=>Rd(t))))})(this.opts.polyfills),await Fd(this.opts.svgSprite),t.push((async t=>{if(!Ud()&&(await Wd(t),!Ud()))return await Wd("https://draggable.github.io/formeo/assets/css/formeo.min.css")})(this.opts.style)),t.push(n.init({...this.opts.i18n,locale:window.sessionStorage?.getItem(Ui)}));const e=await Promise.all(t);return this.opts.allowEdit&&this.init(),e}init(){return Xd.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=su.get("id"),this.i18n={setLang:t=>{window.sessionStorage?.setItem(Ui,t);n.setCurrent(t).then((()=>{this.init()}),console.error)}},this.opts.onLoad?.(this)}))}load(t=this.userFormData,e=this.opts){this.Components.load(t,e),this.render()}render(){if(!this.controls)return window.requestAnimationFrame((()=>this.render()));if(this.stages=Object.values(su.get("stages")),this.opts.controlOnLeft)for(const e of this.stages)e.dom.style.order=1;const t={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map((({dom:t})=>t))]};n.current.dir&&(t.attrs.dir=n.current.dir,kc.dir=n.current.dir),this.editor=kc.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(kc.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),uu.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(uu.formeoLoaded)}};const bu="f-",yu=t=>"string"==typeof t?document.querySelector(t):t,wu=t=>{const e=t.match(sr);return e?.[0]||t``},Cu=t=>{if(!t)return!1;if(t.hasAttribute("hidden")||t.parentElement.hasAttribute("hidden"))return!1;const e=window.getComputedStyle(t);return!("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)},Eu={isChecked:t=>t.checked,isNotChecked:t=>!t.checked,value:t=>t.value,isVisible:t=>Cu(t),isNotVisible:t=>!Cu(t)},xu={equals:ha,notEquals:(t,e)=>!ha(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},Su=Object.entries(Zi).reduce(((t,[e,n])=>(t[n]=xu[e],t[e]=xu[e],t)),{}),Ou={equals:(t,{targetProperty:e,value:n})=>{t[`_${e}`]=t[e],t[e]=n}},_u=Object.entries(Ji).reduce(((t,[e,n])=>(t[n]=Ou[e],t[e]=Ou[e],t)),{}),Au={isChecked:t=>{t.checked=!0},isNotChecked:t=>{t.checked=!1},value:(t,{assignment:e,...n})=>{const o=_u[e]?.(t,n),i=new Event("input",{bubbles:!0});return t.dispatchEvent(i),o},isNotVisible:t=>{void 0===t?._required&&(t._required=t.required),t.parentElement.setAttribute("hidden",!0),t.required=!1},isVisible:t=>{t.parentElement.removeAttribute("hidden"),t.required=t._required}};let Nu=class{constructor(t,e){const{renderContainer:n,elements:o,formData:i}=(({editorContainer:t,renderContainer:e,formData:n,...o})=>({elements:{},...o,renderContainer:yu(e),editorContainer:yu(t),formData:ei(n)}))(t);this.container=n,this.form=ei(e||i),this.dom=kc,this.components=Object.create(null),this.elements=o}get formData(){return this.form}set formData(t){this.form=ei(t)}get userData(){const t=new FormData(this.renderedForm),e={};for(const[n,o]of t.entries())e[n]?Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]:e[n]=o;return e}set userData(t={}){const e=this.container.querySelector("form");for(const n of Object.keys(t)){const o=e.elements[n];if(o.length&&"checkbox"===o[0].type){const e=Array.isArray(t[n])?t[n]:[t[n]];for(const t of o)t.checked=e.includes(t.value)}else if(o.length&&"radio"===o[0].type)for(const e of o)e.checked=e.value===t[n];else o.type&&(o.value=t[n])}}render(t=this.form){const e=this.getRenderedForm(t),n=this.container.querySelector(".formeo-render");n?n.replaceWith(e):this.container.appendChild(e)}getRenderedForm(t=this.form){this.form=ei(t);const e=document.getElementsByClassName("formeo-render").length,n={tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${e}`,children:this.processedData};return this.renderedForm=kc.render(n),this.applyConditions(),this.renderedForm}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]);prefixId=t=>bu+t;processColumn=({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`});processRows=t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]);cacheComponent=t=>(this.components[wu(t.id)]=t,t);processRow=(t,e="row")=>{const{config:n,id:o}=t,i=[`formeo-${e}-wrap`],r={...t,children:this.processColumns(t.id),id:this.prefixId(o)};this.cacheComponent(r);const s=[{condition:n.legend,result:()=>({tag:n.fieldset?"legend":"h3",children:n.legend})},{condition:!0,result:()=>r},{condition:n.inputGroup,result:()=>this.addButton(o)}].reduce(((t,{condition:e,result:n})=>(e&&t.push(n()),t)),[]);return n.inputGroup&&i.push(`${bu}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:i,children:s}};cloneComponentData=t=>{const{children:e=[],id:n,...o}=this.components[t];return{...o,id:qo(n),children:e?.length&&e.map((({id:t})=>this.cloneComponentData(wu(t))))}};addButton=t=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=kc.create(this.cloneComponentData(t));n.insertBefore(o,n.lastChild);const i=kc.create(kc.btnTemplate({className:"remove-input-group",children:kc.icon("remove"),action:{mouseover:({target:t})=>t.parentElement.classList.add("will-remove"),mouseleave:({target:t})=>t.parentElement.classList.remove("will-remove"),click:({target:t})=>t.parentElement.remove()}}));o.appendChild(i)}}});processColumns=t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t))));processFields=t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const n=e.config?.controlId||e.meta?.id,{action:o={},dependencies:i={}}=this.elements[n]||{};i&&zd(i);const r=Vo({action:o},e);return this.cacheComponent({...r,id:this.prefixId(t)})}));get processedData(){return Object.values(this.form.stages).map((t=>(t.children=this.processRows(t.id),t.className=mi,this.components[wu(t.id)]=t,t)))}handleComponentCondition=(t,e,n)=>{if(t.length){for(const o of t)this.handleComponentCondition(o,e,n);return}const o=Tu(t);o&&t.addEventListener(o,(t=>{if(this.evaluateCondition(e,t))for(const e of n)this.execResult(e,t)}),!1);const i={target:t};if(this.evaluateCondition(e,i))for(const r of n)this.execResult(r,i)};applyConditions=()=>{for(const{conditions:t}of Object.values(this.components))if(t)for(const e of t){const{if:t,then:n}=e;for(const e of t){const{source:t,target:o}=e;if(Zo(t)){const{component:o,options:i}=this.getComponent(t),r=i||o;this.handleComponentCondition(r,e,n)}if(Zo(o)){const{component:t,options:i}=this.getComponent(o),r=i||t;this.handleComponentCondition(r,e,n)}}}};evaluateCondition=({source:t,sourceProperty:e,targetProperty:n,comparison:o,target:i})=>{const r=this.getComponentProperty(t,e);if("boolean"==typeof r)return r;const s=String(Zo(i)?this.getComponentProperty(i,n):i);return Su[o]?.(r,s)};execResult=({target:t,targetProperty:e,assignment:n,value:o})=>{if(Zo(t)){const{component:i,option:r}=this.getComponent(t),s=r||i;Au[e]?.(s,{targetProperty:e,assignment:n,value:o})}};getComponentProperty=(t,e)=>{const{component:n,option:o}=this.getComponent(t),i=o||n;return Eu[e]?.(i)||i[e]};getComponent=t=>{const e={component:null};if(!Zo(t))return null;const[,n,o,i]=vr(t),r=this.renderedForm.querySelector(`#${bu}${n}`);if(!r)return e;if(e.component=r,o){const t=r.querySelectorAll("input"),n=t[i];return e.options=t,e.option=n,e}return e};getComponents=t=>{const e=[],n=t.slice(t.indexOf(".")+1);return e.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),e}};const Tu=t=>{const[e]=[["input",t=>["textarea","text"].includes(t.type)],["change",t=>["select"].includes(t.tagName.toLowerCase())||["checkbox","radio"].includes(t.type)]].find((e=>e[1](t)))||[!1];return e};void 0!==window&&(window.FormeoEditor=vu,window.FormeoRenderer=Nu);const Pu=vu,ju=Nu,Du=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}],ku=Object.freeze(Object.defineProperty({__proto__:null,default:Du},Symbol.toStringTag,{value:"Module"})),Lu=["button","submit","reset"].map((t=>({label:t,value:t})));Lu[0].selected=!0;const $u=({type:t,isMultiple:e=!1,count:o=3})=>Array.from({length:o},((t,e)=>e+1)).map((o=>{const i="checkbox"===t||e?"checked":"selected";return{label:n.get("labelCount",{label:mr(t),count:o}),value:`${t}-${o}`,[i]:!o}}));const Iu=[class extends qd{constructor(t={}){const e={tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:n.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:n.get("button"),type:Lu,className:[{label:"default",value:"",selected:!0},{label:"primary",value:"primary"},{label:"danger",value:"error"},{label:"success",value:"success"},{label:"warning",value:"warning"}]}]};super(Vo(e,t))}},class extends qd{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:n.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends qd{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:n.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends qd{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:n.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends qd{constructor(){super({tag:"textarea",config:{label:n.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends qd{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:n.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends qd{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:n.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends qd{constructor(t={}){const e={tag:"select",config:{label:n.get("controls.form.select")},attrs:{required:!1,className:"",multiple:!1},meta:{group:"common",icon:"select",id:"select"},options:$u({type:"option",isMultiple:t.attrs?.multiple})};super(Vo(e,t))}},class extends qd{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:n.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:$u({type:"checkbox",count:1})})}},class extends qd{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:n.get("controls.form.radio-group"),disabled:["attrs.type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:$u({type:"radio"})})}}],Mu=Object.freeze(Object.defineProperty({__proto__:null,default:Iu},Symbol.toStringTag,{value:"Module"})),Ru=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),Wu="controls.html.header";const Fu=[class extends qd{constructor(){super({tag:Ru[0],attrs:{tag:Ru.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:n.get(Wu),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:n.get(Wu),action:{}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(Wu)}},class extends qd{constructor(){super({tag:"p",attrs:{className:""},config:{label:n.get("controls.html.paragraph"),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"paragraph",id:"paragraph"},content:"Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment."})}},class extends qd{constructor(){super({tag:"hr",config:{label:n.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends qd{constructor(t){super(Vo({tag:"textarea",config:{label:"WYSIWYG",editableContent:!0},meta:{group:"html",icon:"rich-text",id:"tinymce"},attrs:{required:!1},dependencies:{js:"https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"},action:{onRender:t=>{const e=`#${t.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}},controlAction:{click:()=>{},onRender:()=>{}}},t))}}],Bu=Object.freeze(Object.defineProperty({__proto__:null,default:Fu},Symbol.toStringTag,{value:"Module"}));exports.FormeoEditor=Pu,exports.FormeoRenderer=ju;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class e{constructor(e=t){this.langs=Object.create(null),this.loaded=[],this.processConfig(e)}processConfig(e){const{location:n,...o}={...t,...e},i=n.replace(/\/?$/,"/");this.config={location:i,...o};const{override:r,preloaded:s={}}=this.config,a=Object.entries(this.langs).concat(Object.entries(r||s));this.langs=a.reduce(((t,[e,n])=>(t[e]=this.applyLanguage(e,n),t)),{}),this.locale=this.config.locale||this.config.langs[0]}init(t){return this.processConfig({...this.config,...t}),this.setCurrent(this.locale)}addLanguage(t,n={}){n="string"==typeof n?e.processFile(n):n,this.applyLanguage(t,n),this.config.langs.push("locale")}getValue(t,e=this.locale){var n;return(null==(n=this.langs[e])?void 0:n[t])||this.getFallbackValue(t)}getFallbackValue(t){const e=Object.values(this.langs).find((e=>e[t]));return null==e?void 0:e[t]}makeSafe(t){const e={"{":"\\{","}":"\\}","|":"\\|"};return t=t.replace(/[{}|]/g,(t=>e[t])),new RegExp(t,"g")}put(t,e){return this.current[t]=e,e}get(t,e){const n=this;let o=this.getValue(t);if(!o)return;const i=o.match(/\{[^}]+?\}/g);if(e&&i)if("object"==typeof e)for(const r of i){const t=r.substring(1,r.length-1);o=o.replace(n.makeSafe(r),e[t]||"")}else o=o.replace(/\{[^}]+?\}/g,e);return o}static processFile(t){return e.fromFile(t.replace(/\n\n/g,"\n"))}static fromFile(t){const e=t.split("\n"),n={};for(let o,i=0;i<e.length;i++){o=/^(.+?) *?= *?([^\n]+)/.exec(e[i]),o&&(n[o[1]]=o[2].replace(/(^\s+|\s+$)/g,""))}return n}loadLang(t,n=!0){const o=this;return new Promise((function(i,r){if(-1!==o.loaded.indexOf(t)&&n)return o.applyLanguage(o.langs[t]),i(o.langs[t]);return async function(t){try{const e=await fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const n=t.endsWith(".lang")?"text":"json";return await e[n]()}catch(e){throw e}}([o.config.location,t,o.config.extension].join("")).then((n=>{const r=e.processFile(n);return o.applyLanguage(t,r),o.loaded.push(t),i(o.langs[t])})).catch((e=>{const n=o.applyLanguage(t);i(n)}))}))}applyLanguage(t,e={}){const n=this.config.override[t]||{},o=this.langs[t]||{};return this.langs[t]={...o,...e,...n},this.langs[t]}get getLangs(){return this.config.langs}async setCurrent(t="en-US"){return await this.loadLang(t),this.locale=t,this.current=this.langs[t],this.current}}const n=new e;!function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('._3x4ZIcu-{position:absolute;background:#1f2937;color:#fff;padding:.75rem;border-radius:.375rem;max-width:200px;z-index:50;visibility:hidden;opacity:0;transition:opacity .2s;pointer-events:none;left:0;top:0}._3x4ZIcu-.JIt36hCJ{visibility:visible;opacity:1;pointer-events:all}._3x4ZIcu-:before{content:"";position:absolute;width:0;height:0;border:6px solid transparent}._3x4ZIcu-[data-position=top]:before{border-top-color:#1f2937;bottom:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=bottom]:before{border-bottom-color:#1f2937;top:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=left]:before{border-left-color:#1f2937;right:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=right]:before{border-right-color:#1f2937;left:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=top-left]:before{border-top-color:#1f2937;bottom:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=top-right]:before{border-top-color:#1f2937;bottom:-12px;right:12px;left:auto;transform:none}._3x4ZIcu-[data-position=bottom-left]:before{border-bottom-color:#1f2937;top:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=bottom-right]:before{border-bottom-color:#1f2937;top:-12px;right:12px;left:auto;transform:none}')),document.head.appendChild(t)}}catch(e){}}();var o=Object.defineProperty,i=(t,e,n)=>((t,e,n)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n);const r="_3x4ZIcu-",s="JIt36hCJ",a={triggerName:"tooltip"};class l{constructor(t=a){i(this,"triggerName"),i(this,"tooltip"),i(this,"activeTriggerType",null),i(this,"spacing",12),i(this,"handleClick",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}][${e}-type="click"]`);if(n)if(this.isVisible())this.hide();else{const t=n.getAttribute(`${e}`);this.show(n,t),this.activeTriggerType="click"}else this.hide()})),i(this,"handleMouseOver",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}]`);if("click"!==this.activeTriggerType&&"click"!==(null==n?void 0:n.getAttribute(`${e}-type`))){const t=null==n?void 0:n.getAttribute(`${e}`);t&&(this.show(n,t),this.activeTriggerType="hover")}})),i(this,"handleMouseOut",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}]`);"click"!==this.activeTriggerType&&"click"!==(null==n?void 0:n.getAttribute(`${e}-type`))&&this.hide()})),i(this,"handleResize",(()=>{this.isVisible()&&this.hide()})),i(this,"handleScroll",(()=>{this.isVisible()&&this.hide()})),this.triggerName=`data-${t.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${r}`,document.body.appendChild(this.tooltip),this.setupEventListeners()}setupEventListeners(){document.addEventListener("mouseover",this.handleMouseOver),document.addEventListener("mouseout",this.handleMouseOut),document.addEventListener("touchstart",this.handleMouseOver),document.addEventListener("touchend",this.handleMouseOut),document.addEventListener("click",this.handleClick),window.addEventListener("resize",this.handleResize),window.addEventListener("scroll",this.handleScroll,!0)}isVisible(){return this.tooltip.classList.contains(s)}calculatePosition(t){const e=t.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),o=[{name:"top",x:e.left+(e.width-n.width)/2,y:e.top-n.height-this.spacing},{name:"bottom",x:e.left+(e.width-n.width)/2,y:e.bottom+this.spacing},{name:"left",x:e.left-n.width-this.spacing,y:e.top+(e.height-n.height)/2},{name:"right",x:e.right+this.spacing,y:e.top+(e.height-n.height)/2},{name:"top-left",x:e.left,y:e.top-n.height-this.spacing},{name:"top-right",x:e.right-n.width,y:e.top-n.height-this.spacing},{name:"bottom-left",x:e.left,y:e.bottom+this.spacing},{name:"bottom-right",x:e.right-n.width,y:e.bottom+this.spacing}];return o.find((t=>this.fitsInViewport(t,n)))||o[0]}fitsInViewport(t,e){if(!(t.x>=0&&t.y>=0&&t.x+e.width<=window.innerWidth&&t.y+e.height<=window.innerHeight))return!1;return 0===[[t.x,t.y],[t.x+e.width,t.y],[t.x,t.y+e.height],[t.x+e.width,t.y+e.height],[t.x+e.width/2,t.y+e.height/2]].flatMap((([t,e])=>Array.from(document.elementsFromPoint(t,e)))).filter((t=>{if(this.tooltip.contains(t)||t===this.tooltip||t.classList.contains(r)||"none"===getComputedStyle(t).pointerEvents)return!1})).length}show(t,e){this.tooltip.innerHTML=e??"",this.tooltip.classList.add(s);const n=this.calculatePosition(t);this.tooltip.style.left=`${n.x}px`,this.tooltip.style.top=`${n.y}px`,this.tooltip.dataset.position=n.name}hide(){this.tooltip.classList.remove(s),this.activeTriggerType=null}destroy(){document.removeEventListener("mouseover",this.handleMouseOver),document.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("touchstart",this.handleMouseOver),document.removeEventListener("touchend",this.handleMouseOut),document.removeEventListener("click",this.handleClick),window.removeEventListener("resize",this.handleResize),window.removeEventListener("scroll",this.handleScroll,!0),this.tooltip.remove()}}void 0!==window&&(window.SmartTooltip=l);const c="formeo",d="4.1.4";var u,h,p,f,m,g,v,b,y,w,C,E,S,x,O,_,A,T,N,P,j,D,k,L,$,I,M,R,F,W,B,z,U,q,V,H,X,Y,G,Z,J,K,Q,tt,et,nt,ot,it,rt,st,at,lt,ct,dt,ut,ht,pt,ft,mt,gt,vt,bt,yt,wt,Ct,Et,St,xt,Ot,_t,At,Tt,Nt,Pt,jt,Dt,kt,Lt,$t,It,Mt,Rt,Ft,Wt,Bt,zt,Ut,qt,Vt,Ht,Xt,Yt,Gt,Zt,Jt,Kt,Qt,te,ee="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ne(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function oe(){if(f)return p;return f=1,p=function(t,e){return t===e||t!=t&&e!=e}}function ie(){if(g)return m;g=1;var t=oe();return m=function(e,n){for(var o=e.length;o--;)if(t(e[o][0],n))return o;return-1}}function re(){if(_)return O;_=1;var t=h?u:(h=1,u=function(){this.__data__=[],this.size=0}),e=function(){if(b)return v;b=1;var t=ie(),e=Array.prototype.splice;return v=function(n){var o=this.__data__,i=t(o,n);return!(i<0||(i==o.length-1?o.pop():e.call(o,i,1),--this.size,0))}}(),n=function(){if(w)return y;w=1;var t=ie();return y=function(e){var n=this.__data__,o=t(n,e);return o<0?void 0:n[o][1]}}(),o=function(){if(E)return C;E=1;var t=ie();return C=function(e){return t(this.__data__,e)>-1}}(),i=function(){if(x)return S;x=1;var t=ie();return S=function(e,n){var o=this.__data__,i=t(o,e);return i<0?(++this.size,o.push([e,n])):o[i][1]=n,this}}();function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,O=r}function se(){if(I)return $;I=1;var t="object"==typeof ee&&ee&&ee.Object===Object&ⅇreturn $=t}function ae(){if(R)return M;R=1;var t=se(),e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return M=n}function le(){if(W)return F;W=1;var t=ae().Symbol;return F=t}function ce(){if(H)return V;H=1;var t=le(),e=function(){if(z)return B;z=1;var t=le(),e=Object.prototype,n=e.hasOwnProperty,o=e.toString,i=t?t.toStringTag:void 0;return B=function(t){var e=n.call(t,i),r=t[i];try{t[i]=void 0;var s=!0}catch(l){}var a=o.call(t);return s&&(e?t[i]=r:delete t[i]),a}}(),n=function(){if(q)return U;q=1;var t=Object.prototype.toString;return U=function(e){return t.call(e)}}(),o=t?t.toStringTag:void 0;return V=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":o&&o in Object(t)?e(t):n(t)}}function de(){if(Y)return X;return Y=1,X=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}function ue(){if(Z)return G;Z=1;var t=ce(),e=de();return G=function(n){if(!e(n))return!1;var o=t(n);return"[object Function]"==o||"[object GeneratorFunction]"==o||"[object AsyncFunction]"==o||"[object Proxy]"==o}}function he(){if(tt)return Q;tt=1;var t,e=function(){if(K)return J;K=1;var t=ae()["__core-js_shared__"];return J=t}(),n=(t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"";return Q=function(t){return!!n&&n in t}}function pe(){if(nt)return et;nt=1;var t=Function.prototype.toString;return et=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function fe(){if(lt)return at;lt=1;var t=function(){if(it)return ot;it=1;var t=ue(),e=he(),n=de(),o=pe(),i=/^\[object .+?Constructor\]$/,r=Function.prototype,s=Object.prototype,a=r.toString,l=s.hasOwnProperty,c=RegExp("^"+a.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return ot=function(r){return!(!n(r)||e(r))&&(t(r)?c:i).test(o(r))}}(),e=st?rt:(st=1,rt=function(t,e){return null==t?void 0:t[e]});return at=function(n,o){var i=e(n,o);return t(i)?i:void 0}}function me(){if(dt)return ct;dt=1;var t=fe()(ae(),"Map");return ct=t}function ge(){if(ht)return ut;ht=1;var t=fe()(Object,"create");return ut=t}function ve(){if(xt)return St;xt=1;var t=function(){if(ft)return pt;ft=1;var t=ge();return pt=function(){this.__data__=t?t(null):{},this.size=0}}(),e=gt?mt:(gt=1,mt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}),n=function(){if(bt)return vt;bt=1;var t=ge(),e=Object.prototype.hasOwnProperty;return vt=function(n){var o=this.__data__;if(t){var i=o[n];return"__lodash_hash_undefined__"===i?void 0:i}return e.call(o,n)?o[n]:void 0}}(),o=function(){if(wt)return yt;wt=1;var t=ge(),e=Object.prototype.hasOwnProperty;return yt=function(n){var o=this.__data__;return t?void 0!==o[n]:e.call(o,n)}}(),i=function(){if(Et)return Ct;Et=1;var t=ge();return Ct=function(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=t&&void 0===n?"__lodash_hash_undefined__":n,this}}();function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,St=r}function be(){if(Pt)return Nt;Pt=1;var t=Tt?At:(Tt=1,At=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t});return Nt=function(e,n){var o=e.__data__;return t(n)?o["string"==typeof n?"string":"hash"]:o.map}}function ye(){if(Wt)return Ft;Wt=1;var t=function(){if(_t)return Ot;_t=1;var t=ve(),e=re(),n=me();return Ot=function(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}}(),e=function(){if(Dt)return jt;Dt=1;var t=be();return jt=function(e){var n=t(this,e).delete(e);return this.size-=n?1:0,n}}(),n=function(){if(Lt)return kt;Lt=1;var t=be();return kt=function(e){return t(this,e).get(e)}}(),o=function(){if(It)return $t;It=1;var t=be();return $t=function(e){return t(this,e).has(e)}}(),i=function(){if(Rt)return Mt;Rt=1;var t=be();return Mt=function(e,n){var o=t(this,e),i=o.size;return o.set(e,n),this.size+=o.size==i?0:1,this}}();function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,Ft=r}function we(){if(qt)return Ut;qt=1;var t=re(),e=function(){if(T)return A;T=1;var t=re();return A=function(){this.__data__=new t,this.size=0}}(),n=P?N:(P=1,N=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}),o=D?j:(D=1,j=function(t){return this.__data__.get(t)}),i=L?k:(L=1,k=function(t){return this.__data__.has(t)}),r=function(){if(zt)return Bt;zt=1;var t=re(),e=me(),n=ye();return Bt=function(o,i){var r=this.__data__;if(r instanceof t){var s=r.__data__;if(!e||s.length<199)return s.push([o,i]),this.size=++r.size,this;r=this.__data__=new n(s)}return r.set(o,i),this.size=r.size,this}}();function s(e){var n=this.__data__=new t(e);this.size=n.size}return s.prototype.clear=e,s.prototype.delete=n,s.prototype.get=o,s.prototype.has=i,s.prototype.set=r,Ut=s}function Ce(){if(Ht)return Vt;Ht=1;var t=fe(),e=function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return Vt=e}function Ee(){if(Yt)return Xt;Yt=1;var t=Ce();return Xt=function(e,n,o){"__proto__"==n&&t?t(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}}function Se(){if(Zt)return Gt;Zt=1;var t=Ee(),e=oe();return Gt=function(n,o,i){(void 0!==i&&!e(n[o],i)||void 0===i&&!(o in n))&&t(n,o,i)}}function xe(){if(te)return Qt;te=1;var t=(Kt?Jt:(Kt=1,Jt=function(t){return function(e,n,o){for(var i=-1,r=Object(e),s=o(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(r[l],l,r))break}return e}}))();return Qt=t}var Oe,_e,Ae,Te,Ne,Pe,je,De,ke,Le,$e,Ie,Me,Re,Fe,We,Be,ze,Ue,qe,Ve,He,Xe,Ye,Ge,Ze,Je,Ke,Qe,tn,en,nn,on,rn={exports:{}};function sn(){if(Ae)return _e;Ae=1;var t=ae().Uint8Array;return _e=t}function an(){if(je)return Pe;je=1;var t=function(){if(Ne)return Te;Ne=1;var t=sn();return Te=function(e){var n=new e.constructor(e.byteLength);return new t(n).set(new t(e)),n}}();return Pe=function(e,n){var o=n?t(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}}function ln(){if(Me)return Ie;return Me=1,Ie=function(t,e){return function(n){return t(e(n))}}}function cn(){if(Fe)return Re;Fe=1;var t=ln()(Object.getPrototypeOf,Object);return Re=t}function dn(){if(Be)return We;Be=1;var t=Object.prototype;return We=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}}function un(){if(Ue)return ze;Ue=1;var t=function(){if($e)return Le;$e=1;var t=de(),e=Object.create;return Le=function(){function n(){}return function(o){if(!t(o))return{};if(e)return e(o);n.prototype=o;var i=new n;return n.prototype=void 0,i}}()}(),e=cn(),n=dn();return ze=function(o){return"function"!=typeof o.constructor||n(o)?{}:t(e(o))}}function hn(){if(Ve)return qe;return Ve=1,qe=function(t){return null!=t&&"object"==typeof t}}function pn(){if(Ge)return Ye;Ge=1;var t=function(){if(Xe)return He;Xe=1;var t=ce(),e=hn();return He=function(n){return e(n)&&"[object Arguments]"==t(n)}}(),e=hn(),n=Object.prototype,o=n.hasOwnProperty,i=n.propertyIsEnumerable,r=t(function(){return arguments}())?t:function(t){return e(t)&&o.call(t,"callee")&&!i.call(t,"callee")};return Ye=r}function fn(){if(Je)return Ze;Je=1;var t=Array.isArray;return Ze=t}function mn(){if(Qe)return Ke;Qe=1;return Ke=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}}function gn(){if(en)return tn;en=1;var t=ue(),e=mn();return tn=function(n){return null!=n&&e(n.length)&&!t(n)}}var vn,bn,yn,wn,Cn,En,Sn,xn,On,_n={exports:{}};function An(){return yn||(yn=1,t=_n,e=_n.exports,n=ae(),o=bn?vn:(bn=1,vn=function(){return!1}),i=e&&!e.nodeType&&e,r=i&&t&&!t.nodeType&&t,s=r&&r.exports===i?n.Buffer:void 0,a=(s?s.isBuffer:void 0)||o,t.exports=a),_n.exports;var t,e,n,o,i,r,s,a}var Tn,Nn,Pn,jn,Dn,kn,Ln,$n,In,Mn,Rn,Fn,Wn,Bn,zn,Un,qn,Vn,Hn,Xn,Yn,Gn,Zn,Jn,Kn,Qn,to,eo,no,oo,io,ro,so,ao,lo,co,uo,ho,po,fo,mo,go,vo,bo,yo,wo,Co,Eo,So,xo={exports:{}};function Oo(){if(Pn)return Nn;Pn=1;var t=function(){if(Sn)return En;Sn=1;var t=ce(),e=mn(),n=hn(),o={};return o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,En=function(i){return n(i)&&e(i.length)&&!!o[t(i)]}}(),e=On?xn:(On=1,xn=function(t){return function(e){return t(e)}}),n=function(){return Tn||(Tn=1,t=xo,e=xo.exports,n=se(),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||r&&r.binding&&r.binding("util")}catch(t){}}(),t.exports=s),xo.exports;var t,e,n,o,i,r,s}(),o=n&&n.isTypedArray,i=o?e(o):t;return Nn=i}function _o(){if(Dn)return jn;return Dn=1,jn=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}}function Ao(){if(Ln)return kn;Ln=1;var t=Ee(),e=oe(),n=Object.prototype.hasOwnProperty;return kn=function(o,i,r){var s=o[i];n.call(o,i)&&e(s,r)&&(void 0!==r||i in o)||t(o,i,r)}}function To(){if(Wn)return Fn;Wn=1;var t=/^(?:0|[1-9]\d*)$/;return Fn=function(e,n){var o=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==o||"symbol"!=o&&t.test(e))&&e>-1&&e%1==0&&e<n}}function No(){if(zn)return Bn;zn=1;var t=Rn?Mn:(Rn=1,Mn=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}),e=pn(),n=fn(),o=An(),i=To(),r=Oo(),s=Object.prototype.hasOwnProperty;return Bn=function(a,l){var c=n(a),d=!c&&e(a),u=!c&&!d&&o(a),h=!c&&!d&&!u&&r(a),p=c||d||u||h,f=p?t(a.length,String):[],m=f.length;for(var g in a)!l&&!s.call(a,g)||p&&("length"==g||u&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||i(g,m))||f.push(g);return f}}function Po(){if(Hn)return Vn;Hn=1;var t=de(),e=dn(),n=qn?Un:(qn=1,Un=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}),o=Object.prototype.hasOwnProperty;return Vn=function(i){if(!t(i))return n(i);var r=e(i),s=[];for(var a in i)("constructor"!=a||!r&&o.call(i,a))&&s.push(a);return s}}function jo(){if(Yn)return Xn;Yn=1;var t=No(),e=Po(),n=gn();return Xn=function(o){return n(o)?t(o,!0):e(o)}}function Do(){if(Zn)return Gn;Zn=1;var t=function(){if(In)return $n;In=1;var t=Ao(),e=Ee();return $n=function(n,o,i,r){var s=!i;i||(i={});for(var a=-1,l=o.length;++a<l;){var c=o[a],d=r?r(i[c],n[c],c,i,n):void 0;void 0===d&&(d=n[c]),s?e(i,c,d):t(i,c,d)}return i}}(),e=jo();return Gn=function(n){return t(n,e(n))}}function ko(){if(Kn)return Jn;Kn=1;var t,e,n,o,i,r,s,a=Se(),l=(Oe||(Oe=1,t=rn,e=rn.exports,n=ae(),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o?n.Buffer:void 0,s=r?r.allocUnsafe:void 0,t.exports=function(t,e){if(e)return t.slice();var n=t.length,o=s?s(n):new t.constructor(n);return t.copy(o),o}),rn.exports),c=an(),d=ke?De:(ke=1,De=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}),u=un(),h=pn(),p=fn(),f=function(){if(on)return nn;on=1;var t=gn(),e=hn();return nn=function(n){return e(n)&&t(n)}}(),m=An(),g=ue(),v=de(),b=function(){if(Cn)return wn;Cn=1;var t=ce(),e=cn(),n=hn(),o=Function.prototype,i=Object.prototype,r=o.toString,s=i.hasOwnProperty,a=r.call(Object);return wn=function(o){if(!n(o)||"[object Object]"!=t(o))return!1;var i=e(o);if(null===i)return!0;var l=s.call(i,"constructor")&&i.constructor;return"function"==typeof l&&l instanceof l&&r.call(l)==a}}(),y=Oo(),w=_o(),C=Do();return Jn=function(t,e,n,o,i,r,s){var E=w(t,n),S=w(e,n),x=s.get(S);if(x)a(t,n,x);else{var O=r?r(E,S,n+"",t,e,s):void 0,_=void 0===O;if(_){var A=p(S),T=!A&&m(S),N=!A&&!T&&y(S);O=S,A||T||N?p(E)?O=E:f(E)?O=d(E):T?(_=!1,O=l(S,!0)):N?(_=!1,O=c(S,!0)):O=[]:b(S)||h(S)?(O=E,h(E)?O=C(E):v(E)&&!g(E)||(O=u(S))):_=!1}_&&(s.set(S,O),i(O,S,o,r,s),s.delete(S)),a(t,n,O)}}}function Lo(){if(no)return eo;return no=1,eo=function(t){return t}}function $o(){if(so)return ro;so=1;var t=io?oo:(io=1,oo=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}),e=Math.max;return ro=function(n,o,i){return o=e(void 0===o?n.length-1:o,0),function(){for(var r=arguments,s=-1,a=e(r.length-o,0),l=Array(a);++s<a;)l[s]=r[o+s];s=-1;for(var c=Array(o+1);++s<o;)c[s]=r[s];return c[o]=i(l),t(n,this,c)}},ro}function Io(){if(uo)return co;uo=1;var t=lo?ao:(lo=1,ao=function(t){return function(){return t}}),e=Ce(),n=Lo();return co=e?function(n,o){return e(n,"toString",{configurable:!0,enumerable:!1,value:t(o),writable:!0})}:n}function Mo(){if(mo)return fo;mo=1;var t=Io(),e=function(){if(po)return ho;po=1;var t=Date.now;return ho=function(e){var n=0,o=0;return function(){var i=t(),r=16-(i-o);if(o=i,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}},ho}(),n=e(t);return fo=n}function Ro(){if(Co)return wo;Co=1;var t=function(){if(vo)return go;vo=1;var t=Lo(),e=$o(),n=Mo();return go=function(o,i){return n(e(o,i,t),o+"")}}(),e=function(){if(yo)return bo;yo=1;var t=oe(),e=gn(),n=To(),o=de();return bo=function(i,r,s){if(!o(s))return!1;var a=typeof r;return!!("number"==a?e(s)&&n(r,s.length):"string"==a&&r in s)&&t(s[r],i)}}();return wo=function(n){return t((function(t,o){var i=-1,r=o.length,s=r>1?o[r-1]:void 0,a=r>2?o[2]:void 0;for(s=n.length>3&&"function"==typeof s?(r--,s):void 0,a&&e(o[0],o[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var l=o[i];l&&n(t,l,i,s)}return t}))}}const Fo=ne(function(){if(So)return Eo;So=1;var t=function(){if(to)return Qn;to=1;var t=we(),e=Se(),n=xe(),o=ko(),i=de(),r=jo(),s=_o();return Qn=function a(l,c,d,u,h){l!==c&&n(c,(function(n,r){if(h||(h=new t),i(n))o(l,c,r,d,a,u,h);else{var p=u?u(s(l,r),n,r+"",l,c,h):void 0;void 0===p&&(p=n),e(l,r,p)}}),r)},Qn}(),e=Ro()((function(e,n,o,i){t(e,n,o,i)}));return Eo=e}()),Wo=()=>crypto.randomUUID().slice(0,8).slice(0,8),Bo=(t="",e)=>{if(!e)return!1;const n=/[|\\{}()[\]^*$+?.]/g;let o="string"==typeof e?[e]:e;o=o.map((t=>"*"===t?"":t.replace(n,"\\$&")));let i=!0;return o.length&&(i=!new RegExp(o.join("|"),"i").exec(t)),i},zo=t=>{const e=t.className?.match(Li);return e&&Di[e[0]]},Uo=t=>Array.from(new Set(t)),qo=t=>t?.attrs?.id||t?.id||Wo(),Vo=(t,e)=>Fo({},t,e,((t,e)=>Array.isArray(t)?null!=e?Uo(t.concat(e)):e:Array.isArray(e)?null!=t?Uo(e.concat(t)):e:void 0)),Ho=t=>{let e;if(null===t||!("object"==typeof t)||t instanceof Promise)return t;if(t instanceof Date)return e=new Date,e.setTime(t.getTime()),e;if(Array.isArray(t)){e=[];for(let n=0,o=t.length;n<o;n++)e[n]=Ho(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=Ho(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},Xo=(t,e)=>t/e*100,Yo=t=>`${t.toString()}%`,Go=Object.create(null,{get:{value:t=>{const e=window.sessionStorage?.getItem(t);try{return JSON.parse(e)}catch(n){return e}}},set:{value:(t,e)=>{try{return window.sessionStorage?.setItem(t,JSON.stringify(e))}catch(n){}}}}),Zo=t=>/^(stage|row|column|field)s./.test(t);function Jo(t,e=Vi){let n;return function(...o){n&&clearTimeout(n),n=setTimeout((()=>t.apply(this,o)),e)}}function Ko(t){return t}function Qo(){}function ti(t=Object.create(null)){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return Object.create(null)}return t}const ei=t=>t?Ho(ti(t)):yr();function ni(t,e,n,o={}){if(!e||!t[n][e])return o;o[`${n}.${e}`]=t[n][e];const i=Fi.get(n);if(i){const r=t[n][e].data?.children||[];for(const e of r)ni(t,e,i,o)}return o}const oi=c,ii=d,ri=oi,si="formeo-sprite",ai=[{name:"cssPreload",src:"//cdnjs.cloudflare.com/ajax/libs/loadCSS/2.0.1/cssrelpreload.min.js"},{name:"mutationObserver",src:"//cdn.jsdelivr.net/npm/mutationobserver-shim/dist/mutationobserver.min.js"},{name:"fetch",src:"https://unpkg.com/unfetch/polyfill"}],li=`../../lib/icons/${si}.svg`,ci=li,di="undefined"!=typeof process&&"development"===process.env?.NODE_ENV||!1?ci:`https://cdn.jsdelivr.net/npm/formeo@${ii}/dist/${si}.svg`,ui=`https://draggable.github.io/formeo/assets/img/${si}.svg`,hi=`https://cdn.jsdelivr.net/npm/formeo@${ii}/dist/formeo.min.css`,pi="f-panel",fi="control-group",mi=`${ri}-stage`,gi=`${ri}-row`,vi=`${ri}-column`,bi=`${ri}-field`,yi="custom-column-widths",wi="column-preset",Ci="resizing-columns",Ei=new Map([[mi,gi],[gi,vi],[vi,bi]]),Si=["stage","row","column","field"],xi=Si.map((t=>`${t}s`));new Map(xi.map(((t,e)=>[t,Si[e]])));const Oi=new RegExp(`^${xi.join("|")}.`),_i=[...Si],Ai=[...xi],Ti=new Map(Ai.map(((t,e)=>[t,_i[e]]))),Ni=_i.reduce(((t,e)=>(t[e]=e,t)),{}),Pi=[{name:"controls",className:fi},{name:"stage",className:mi},{name:"row",className:gi},{name:"column",className:vi},{name:"field",className:bi}],ji={controls:fi,stage:mi,row:gi,column:vi,field:bi},Di=Object.entries(ji).reduce(((t,[e,n])=>(t[n]=e,t)),{}),ki=Object.values(ji),Li=new RegExp(`${ki.join("|")}`,"g"),{childTypeMapVals:$i,childTypeIndexMapVals:Ii}=Pi.reduce(((t,{name:e},n,o)=>{const{name:i}=o[n+1]||{};return i&&(t.childTypeMapVals.push([e,i]),t.childTypeIndexMapVals.push([`${e}s`,`${i}s`])),t}),{childTypeMapVals:[],childTypeIndexMapVals:[]}),Mi=$i.slice().map((t=>t.slice().reverse())).reverse(),Ri=new Map($i),Fi=new Map(Ii),Wi=new Map(Mi.slice()),Bi=new Map([[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]].reduce(((t,e,n)=>(t.push([n,e]),t)),[])),zi=`${oi}-formData`,Ui=`${oi}-locale`,qi=333,Vi=Math.round(166.5),Hi=Math.round(666),Xi="formeoSaved",Yi="formeoUpdated",Gi="formeoUpdatedStage",Zi="formeoUpdatedRow",Ji="formeoUpdatedColumn",Ki="formeoUpdatedField",Qi="formeoOnRender",tr="formeoAddedRow",er="formeoAddedColumn",nr="formeoAddedField",or="formeoRemovedRow",ir="formeoRemovedColumn",rr="formeoRemovedField",sr={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},ar={equals:"="},lr=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],cr=["isChecked","isNotChecked"],dr=["isVisible","isNotVisible"],ur=["value"],hr={comparison:sr,assignment:ar,logical:{and:"&&",or:"||"}},pr="if",fr="then",mr=()=>({[pr]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[fr]:[{target:"",targetProperty:"",assignment:"",value:""}]}),gr=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)|(\b[0-9a-f]{8}\b)/g,vr=/\bcol-\w+-\d+/g,br="f-i-",yr=()=>({id:qo(),stages:{[qo()]:{}},rows:{},columns:{},fields:{}}),wr=["selected","checked"],Cr=wr.toReversed(),Er="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map((t=>`\\s${t}\\s`)),Sr=new RegExp(`(?!${Er.join("|")})\\w\\S*`,"g"),xr=/\s+/g;function Or(t){if("string"!=typeof t)return t;if(t.trim().match(xr))return t;return t.replace(Sr,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const _r=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),Ar=t=>{if(Array.isArray(t))return t;const e=/[.[\]]/g,n=[];let o=0,i=e.exec(t);for(;null!==i;)n.push(t.slice(o,i.index)),o=i.index+i[0].length,i=e.exec(t);return o<t.length&&n.push(t.slice(o)),n.filter(Boolean)},Tr=(t,e="-")=>Ar(t).join(e);var Nr,Pr,jr,Dr,kr,Lr,$r,Ir,Mr,Rr,Fr,Wr,Br,zr,Ur,qr,Vr,Hr,Xr,Yr,Gr,Zr,Jr,Kr;function Qr(){if(Pr)return Nr;Pr=1;var t=ce(),e=hn();return Nr=function(n){return"symbol"==typeof n||e(n)&&"[object Symbol]"==t(n)}}function ts(){if(Ir)return $r;Ir=1;var t=function(){if(Lr)return kr;Lr=1;var t=ye();function e(n,o){if("function"!=typeof n||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");var i=function(){var t=arguments,e=o?o.apply(this,t):t[0],r=i.cache;if(r.has(e))return r.get(e);var s=n.apply(this,t);return i.cache=r.set(e,s)||r,s};return i.cache=new(e.Cache||t),i}return e.Cache=t,kr=e}();return $r=function(e){var n=t(e,(function(t){return 500===o.size&&o.clear(),t})),o=n.cache;return n}}function es(){if(zr)return Br;zr=1;var t=le(),e=Wr?Fr:(Wr=1,Fr=function(t,e){for(var n=-1,o=null==t?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i}),n=fn(),o=Qr(),i=t?t.prototype:void 0,r=i?i.toString:void 0;return Br=function t(i){if("string"==typeof i)return i;if(n(i))return e(i,t)+"";if(o(i))return r?r.call(i):"";var s=i+"";return"0"==s&&1/i==-1/0?"-0":s},Br}function ns(){if(Hr)return Vr;Hr=1;var t=fn(),e=function(){if(Dr)return jr;Dr=1;var t=fn(),e=Qr(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;return jr=function(i,r){if(t(i))return!1;var s=typeof i;return!("number"!=s&&"symbol"!=s&&"boolean"!=s&&null!=i&&!e(i))||o.test(i)||!n.test(i)||null!=r&&i in Object(r)}}(),n=function(){if(Rr)return Mr;Rr=1;var t=ts(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,o=t((function(t){var o=[];return 46===t.charCodeAt(0)&&o.push(""),t.replace(e,(function(t,e,i,r){o.push(i?r.replace(n,"$1"):e||t)})),o}));return Mr=o}(),o=function(){if(qr)return Ur;qr=1;var t=es();return Ur=function(e){return null==e?"":t(e)}}();return Vr=function(i,r){return t(i)?i:e(i,r)?[i]:n(o(i))}}function os(){if(Yr)return Xr;Yr=1;var t=Qr();return Xr=function(e){if("string"==typeof e||t(e))return e;var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}}const is=ne(function(){if(Kr)return Jr;Kr=1;var t=function(){if(Zr)return Gr;Zr=1;var t=ns(),e=os();return Gr=function(n,o){for(var i=0,r=(o=t(o,n)).length;null!=n&&i<r;)n=n[e(o[i++])];return i&&i==r?n:void 0}}();return Jr=function(e,n,o){var i=null==e?void 0:t(e,n);return void 0===i?o:i}}());var rs,ss,as,ls;var cs=function(){if(ls)return as;ls=1;var t=function(){if(ss)return rs;ss=1;var t=Ao(),e=ns(),n=To(),o=de(),i=os();return rs=function(r,s,a,l){if(!o(r))return r;for(var c=-1,d=(s=e(s,r)).length,u=d-1,h=r;null!=h&&++c<d;){var p=i(s[c]),f=a;if("__proto__"===p||"constructor"===p||"prototype"===p)return r;if(c!=u){var m=h[p];void 0===(f=l?l(m,p,h):void 0)&&(f=o(m)?m:n(s[c+1])?[]:{})}t(h,p,f),h=h[p]}return r}}();return as=function(e,n,o){return null==e?e:t(e,n,o)}}();const ds=is,us=ne(cs);function hs(...t){return t.flat().reduce(((t,e)=>(t[e]=e,t)),{})}var ps,fs,ms,gs,vs,bs,ys,ws,Cs,Es,Ss,xs,Os,_s,As,Ts,Ns,Ps,js,Ds,ks,Ls,$s,Is,Ms,Rs,Fs,Ws,Bs,zs,Us,qs,Vs,Hs,Xs,Ys,Gs,Zs,Js,Ks,Qs,ta,ea,na,oa,ia,ra,sa,aa,la,ca,da,ua,ha;function pa(){if(bs)return vs;bs=1;var t=ye(),e=fs?ps:(fs=1,ps=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}),n=gs?ms:(gs=1,ms=function(t){return this.__data__.has(t)});function o(e){var n=-1,o=null==e?0:e.length;for(this.__data__=new t;++n<o;)this.add(e[n])}return o.prototype.add=o.prototype.push=e,o.prototype.has=n,vs=o}function fa(){if(xs)return Ss;xs=1;var t=pa(),e=ws?ys:(ws=1,ys=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}),n=Es?Cs:(Es=1,Cs=function(t,e){return t.has(e)});return Ss=function(o,i,r,s,a,l){var c=1&r,d=o.length,u=i.length;if(d!=u&&!(c&&u>d))return!1;var h=l.get(o),p=l.get(i);if(h&&p)return h==i&&p==o;var f=-1,m=!0,g=2&r?new t:void 0;for(l.set(o,i),l.set(i,o);++f<d;){var v=o[f],b=i[f];if(s)var y=c?s(b,v,f,i,o,l):s(v,b,f,o,i,l);if(void 0!==y){if(y)continue;m=!1;break}if(g){if(!e(i,(function(t,e){if(!n(g,e)&&(v===t||a(v,t,r,s,l)))return g.push(e)}))){m=!1;break}}else if(v!==b&&!a(v,b,r,s,l)){m=!1;break}}return l.delete(o),l.delete(i),m}}function ma(){if(Ps)return Ns;Ps=1;var t=le(),e=sn(),n=oe(),o=fa(),i=_s?Os:(_s=1,Os=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}),r=Ts?As:(Ts=1,As=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}),s=t?t.prototype:void 0,a=s?s.valueOf:void 0;return Ns=function(t,s,l,c,d,u,h){switch(l){case"[object DataView]":if(t.byteLength!=s.byteLength||t.byteOffset!=s.byteOffset)return!1;t=t.buffer,s=s.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=s.byteLength||!u(new e(t),new e(s)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+t,+s);case"[object Error]":return t.name==s.name&&t.message==s.message;case"[object RegExp]":case"[object String]":return t==s+"";case"[object Map]":var p=i;case"[object Set]":var f=1&c;if(p||(p=r),t.size!=s.size&&!f)return!1;var m=h.get(t);if(m)return m==s;c|=2,h.set(t,s);var g=o(p(t),p(s),c,d,u,h);return h.delete(t),g;case"[object Symbol]":if(a)return a.call(t)==a.call(s)}return!1}}function ga(){if(Ls)return ks;Ls=1;var t=Ds?js:(Ds=1,js=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}),e=fn();return ks=function(n,o,i){var r=o(n);return e(n)?r:t(r,i(n))}}function va(){if(Ws)return Fs;Ws=1;var t=Is?$s:(Is=1,$s=function(t,e){for(var n=-1,o=null==t?0:t.length,i=0,r=[];++n<o;){var s=t[n];e(s,n,t)&&(r[i++]=s)}return r}),e=Rs?Ms:(Rs=1,Ms=function(){return[]}),n=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols;return Fs=o?function(e){return null==e?[]:(e=Object(e),t(o(e),(function(t){return n.call(e,t)})))}:e}function ba(){if(qs)return Us;qs=1;var t=dn(),e=function(){if(zs)return Bs;zs=1;var t=ln()(Object.keys,Object);return Bs=t}(),n=Object.prototype.hasOwnProperty;return Us=function(o){if(!t(o))return e(o);var i=[];for(var r in Object(o))n.call(o,r)&&"constructor"!=r&&i.push(r);return i}}function ya(){if(Ys)return Xs;Ys=1;var t=ga(),e=va(),n=function(){if(Hs)return Vs;Hs=1;var t=No(),e=ba(),n=gn();return Vs=function(o){return n(o)?t(o):e(o)}}();return Xs=function(o){return t(o,n,e)}}function wa(){if(sa)return ra;sa=1;var t=function(){if(Ks)return Js;Ks=1;var t=fe()(ae(),"DataView");return Js=t}(),e=me(),n=function(){if(ta)return Qs;ta=1;var t=fe()(ae(),"Promise");return Qs=t}(),o=function(){if(na)return ea;na=1;var t=fe()(ae(),"Set");return ea=t}(),i=function(){if(ia)return oa;ia=1;var t=fe()(ae(),"WeakMap");return oa=t}(),r=ce(),s=pe(),a="[object Map]",l="[object Promise]",c="[object Set]",d="[object WeakMap]",u="[object DataView]",h=s(t),p=s(e),f=s(n),m=s(o),g=s(i),v=r;return(t&&v(new t(new ArrayBuffer(1)))!=u||e&&v(new e)!=a||n&&v(n.resolve())!=l||o&&v(new o)!=c||i&&v(new i)!=d)&&(v=function(t){var e=r(t),n="[object Object]"==e?t.constructor:void 0,o=n?s(n):"";if(o)switch(o){case h:return u;case p:return a;case f:return l;case m:return c;case g:return d}return e}),ra=v}function Ca(){if(la)return aa;la=1;var t=we(),e=fa(),n=ma(),o=function(){if(Zs)return Gs;Zs=1;var t=ya(),e=Object.prototype.hasOwnProperty;return Gs=function(n,o,i,r,s,a){var l=1&i,c=t(n),d=c.length;if(d!=t(o).length&&!l)return!1;for(var u=d;u--;){var h=c[u];if(!(l?h in o:e.call(o,h)))return!1}var p=a.get(n),f=a.get(o);if(p&&f)return p==o&&f==n;var m=!0;a.set(n,o),a.set(o,n);for(var g=l;++u<d;){var v=n[h=c[u]],b=o[h];if(r)var y=l?r(b,v,h,o,n,a):r(v,b,h,n,o,a);if(!(void 0===y?v===b||s(v,b,i,r,a):y)){m=!1;break}g||(g="constructor"==h)}if(m&&!g){var w=n.constructor,C=o.constructor;w==C||!("constructor"in n)||!("constructor"in o)||"function"==typeof w&&w instanceof w&&"function"==typeof C&&C instanceof C||(m=!1)}return a.delete(n),a.delete(o),m}}(),i=wa(),r=fn(),s=An(),a=Oo(),l="[object Arguments]",c="[object Array]",d="[object Object]",u=Object.prototype.hasOwnProperty;return aa=function(h,p,f,m,g,v){var b=r(h),y=r(p),w=b?c:i(h),C=y?c:i(p),E=(w=w==l?d:w)==d,S=(C=C==l?d:C)==d,x=w==C;if(x&&s(h)){if(!s(p))return!1;b=!0,E=!1}if(x&&!E)return v||(v=new t),b||a(h)?e(h,p,f,m,g,v):n(h,p,w,f,m,g,v);if(!(1&f)){var O=E&&u.call(h,"__wrapped__"),_=S&&u.call(p,"__wrapped__");if(O||_){var A=O?h.value():h,T=_?p.value():p;return v||(v=new t),g(A,T,f,m,v)}}return!!x&&(v||(v=new t),o(h,p,f,m,g,v))}}const Ea=ne(function(){if(ha)return ua;ha=1;var t=function(){if(da)return ca;da=1;var t=Ca(),e=hn();return ca=function n(o,i,r,s,a){return o===i||(null==o||null==i||!e(o)&&!e(i)?o!=o&&i!=i:t(o,i,r,s,n,a))},ca}();return ua=function(e,n){return t(e,n)}}()),Sa=(t,e)=>void 0===t?"added":void 0===e?"removed":Ea(t,e)?"unchanged":"changed";class xa{constructor(t,e=Object.create(null)){this.name=t,this.data=e,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(t,e)=>JSON.stringify(t,null,e);get=t=>ds(this.data,t);set(t,e){const n=ds(this.data,t),o=us(this.data,t,e),i=Array.isArray(t)?t.join("."):t,r=Object.keys(this.setCallbacks).filter((t=>new RegExp(t).test(i))),s={newVal:e,oldVal:n,path:t};for(const a of r)for(const t of this.setCallbacks[a])t(s);if(!this.disableEvents){const i={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+t,value:e,data:o,changeType:Sa(n,e),src:this.dom};if(n&&(i.previousValue=n),Cu.formeoUpdated(i),this.name){const t={stage:Gi,row:Zi,column:Ji,field:Ki}[this.name];t&&Cu.formeoUpdated(i,t)}}return o}addSetCallback(t,e){this.setCallbacks[t]?this.setCallbacks[t].push(e):this.setCallbacks[t]=[e]}removeSetCallback(t,e){this.setCallbacks[t]=this.setCallbacks[t].filter((t=>t!==e))}add=(t,e=Object.create(null))=>{const{id:n}=e,o=t||n||qo();return this.set(o,e)};remove=t=>{const e=Ar(t),n=e.pop(),o=this.get(e);return Array.isArray(o)?o.splice(Number(n),1):o&&delete o[n],o};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=n?.data?n.getData():n,t)),{});setCallbacks={};configVal=Object.create(null)}class Oa extends xa{load=t=>{const e=ti(t);this.empty();for(const[n,o]of Object.entries(e))this.add(n,o);return this.data};get=t=>t?ds(this.data,t):this.add();add=(t,e=Object.create(null))=>{const n=t||qo(),o=this.Component({...e,id:n});this.data[n]=o,this.active=o;const i={row:tr,column:er,field:nr}[this.name];return i&&Cu.formeoUpdated({entity:o,componentId:n,componentType:this.name,data:o.data},i),o};remove=t=>{if(Array.isArray(t))for(const e of t)this.get(e).remove();else this.get(t).remove();return this.data};delete=t=>(delete this.data[t],t);clearAll=(t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)};set config(t){this.configVal=Vo(this.configVal,Ho(t))}get config(){return this.configVal}conditionMap=new Map}function _a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Aa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_a(Object(n),!0).forEach((function(e){Na(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ta(t){return(Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Na(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pa(){return Pa=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Pa.apply(this,arguments)}function ja(t,e){if(null==t)return{};var n,o,i=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Da(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var ka=Da(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),La=Da(/Edge/i),$a=Da(/firefox/i),Ia=Da(/safari/i)&&!Da(/chrome/i)&&!Da(/android/i),Ma=Da(/iP(ad|od|hone)/i),Ra=Da(/chrome/i)&&Da(/android/i),Fa={capture:!1,passive:!1};function Wa(t,e,n){t.addEventListener(e,n,!ka&&Fa)}function Ba(t,e,n){t.removeEventListener(e,n,!ka&&Fa)}function za(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function Ua(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function qa(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&za(t,e):za(t,e))||o&&t===n)return t;if(t===n)break}while(t=Ua(t))}return null}var Va,Ha=/\s+/g;function Xa(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(Ha," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(Ha," ")}}function Ya(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function Ga(t,e){var n="";if("string"==typeof t)n=t;else do{var o=Ya(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Za(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function Ja(){var t=document.scrollingElement;return t||document.documentElement}function Ka(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==Ja()?(s=(r=t.getBoundingClientRect()).top,a=r.left,l=r.bottom,c=r.right,d=r.height,u=r.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!ka))do{if(i&&i.getBoundingClientRect&&("none"!==Ya(i,"transform")||n&&"static"!==Ya(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(Ya(i,"border-top-width")),a-=h.left+parseInt(Ya(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=Ga(i||t),f=p&&p.a,m=p&&p.d;p&&(l=(s/=m)+(d/=m),c=(a/=f)+(u/=f))}return{top:s,left:a,bottom:l,right:c,width:u,height:d}}}function Qa(t,e,n){for(var o=il(t,!0),i=Ka(t)[e];o;){if(!(i>=Ka(o)[n]))return o;if(o===Ja())break;o=il(o,!1)}return!1}function tl(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==lc.ghost&&(o||s[r]!==lc.dragged)&&qa(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function el(t,e){for(var n=t.lastElementChild;n&&(n===lc.ghost||"none"===Ya(n,"display")||e&&!za(n,e));)n=n.previousElementSibling;return n||null}function nl(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===lc.clone||e&&!za(t,e)||n++;return n}function ol(t){var e=0,n=0,o=Ja();if(t)do{var i=Ga(t),r=i.a,s=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*s}while(t!==o&&(t=t.parentNode));return[e,n]}function il(t,e){if(!t||!t.getBoundingClientRect)return Ja();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Ya(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return Ja();if(o||e)return n;o=!0}}}while(n=n.parentNode);return Ja()}function rl(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function sl(t,e){return function(){if(!Va){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),Va=setTimeout((function(){Va=void 0}),e)}}}function al(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function ll(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function cl(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if(qa(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=Ka(i);o.left=Math.min(null!==(r=o.left)&&void 0!==r?r:1/0,c.left),o.top=Math.min(null!==(s=o.top)&&void 0!==s?s:1/0,c.top),o.right=Math.max(null!==(a=o.right)&&void 0!==a?a:-1/0,c.right),o.bottom=Math.max(null!==(l=o.bottom)&&void 0!==l?l:-1/0,c.bottom)}})),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var dl="Sortable"+(new Date).getTime();function ul(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==Ya(t,"display")&&t!==lc.ghost){e.push({target:t,rect:Ka(t)});var n=Aa({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=Ga(t,!0);o&&(n.top-=o.f,n.left-=o.e)}t.fromRect=n}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(e,{target:t}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof n&&n());var i=!1,r=0;e.forEach((function(t){var e=0,n=t.target,s=n.fromRect,a=Ka(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,u=Ga(n,!0);u&&(a.top-=u.f,a.left-=u.e),n.toRect=a,n.thisAnimationDuration&&rl(l,a)&&!rl(s,a)&&(d.top-a.top)/(d.left-a.left)==(s.top-a.top)/(s.left-a.left)&&(e=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(d,l,c,o.options)),rl(a,s)||(n.prevFromRect=s,n.prevToRect=a,e||(e=o.options.animation),o.animate(n,d,a,e)),e&&(i=!0,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),i?t=setTimeout((function(){"function"==typeof n&&n()}),r):"function"==typeof n&&n(),e=[]},animate:function(t,e,n,o){if(o){Ya(t,"transition",""),Ya(t,"transform","");var i=Ga(this.el),r=i&&i.a,s=i&&i.d,a=(e.left-n.left)/(r||1),l=(e.top-n.top)/(s||1);t.animatingX=!!a,t.animatingY=!!l,Ya(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),Ya(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Ya(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){Ya(t,"transition",""),Ya(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var hl=[],pl={initializeByDefault:!0},fl={mount:function(t){for(var e in pl)pl.hasOwnProperty(e)&&!(e in t)&&(t[e]=pl[e]);hl.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),hl.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";hl.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](Aa({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](Aa({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in hl.forEach((function(o){var i=o.pluginName;if(t.options[i]||o.initializeByDefault){var r=new o(t,e,t.options);r.sortable=t,r.options=t.options,t[i]=r,Pa(n,r.defaults)}})),t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);void 0!==r&&(t.options[i]=r)}},getEventProperties:function(t,e){var n={};return hl.forEach((function(o){"function"==typeof o.eventProperties&&Pa(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return hl.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var ml=["evt"],gl=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=ja(n,ml);fl.pluginEvent.bind(lc)(t,e,Aa({dragEl:bl,parentEl:yl,ghostEl:wl,rootEl:Cl,nextEl:El,lastDownEl:Sl,cloneEl:xl,cloneHidden:Ol,dragStarted:Rl,putSortable:jl,activeSortable:lc.active,originalEvent:o,oldIndex:_l,oldDraggableIndex:Tl,newIndex:Al,newDraggableIndex:Nl,hideGhostForTarget:ic,unhideGhostForTarget:rc,cloneNowHidden:function(){Ol=!0},cloneNowShown:function(){Ol=!1},dispatchSortableEvent:function(t){vl({sortable:e,name:t,originalEvent:o})}},i))};function vl(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,s=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,u=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[dl]){var m,g=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||ka||La?(m=document.createEvent("Event")).initEvent(o,!0,!0):m=new CustomEvent(o,{bubbles:!0,cancelable:!0}),m.to=s||n,m.from=a||n,m.item=i||n,m.clone=r,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=u,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var b=Aa(Aa({},f),fl.getEventProperties(o,e));for(var y in b)m[y]=b[y];n&&n.dispatchEvent(m),g[v]&&g[v].call(e,m)}}(Aa({putSortable:jl,cloneEl:xl,targetEl:bl,rootEl:Cl,oldIndex:_l,oldDraggableIndex:Tl,newIndex:Al,newDraggableIndex:Nl},t))}var bl,yl,wl,Cl,El,Sl,xl,Ol,_l,Al,Tl,Nl,Pl,jl,Dl,kl,Ll,$l,Il,Ml,Rl,Fl,Wl,Bl,zl,Ul=!1,ql=!1,Vl=[],Hl=!1,Xl=!1,Yl=[],Gl=!1,Zl=[],Jl="undefined"!=typeof document,Kl=Ma,Ql=La||ka?"cssFloat":"float",tc=Jl&&!Ra&&!Ma&&"draggable"in document.createElement("div"),ec=function(){if(Jl){if(ka)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),nc=function(t,e){var n=Ya(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=tl(t,0,e),r=tl(t,1,e),s=i&&Ya(i),a=r&&Ya(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ka(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ka(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var d="left"===s.float?"left":"right";return!r||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=o&&"none"===n[Ql]||r&&"none"===n[Ql]&&l+c>o)?"vertical":"horizontal"},oc=function(t){function e(t,n){return function(o,i,r,s){var a=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,s),n)(o,i,r,s);var l=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==Ta(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},ic=function(){!ec&&wl&&Ya(wl,"display","none")},rc=function(){!ec&&wl&&Ya(wl,"display","")};Jl&&!Ra&&document.addEventListener("click",(function(t){if(ql)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ql=!1,!1}),!0);var sc=function(t){if(bl){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,Vl.some((function(t){var e=t[dl].options.emptyInsertThreshold;if(e&&!el(t)){var n=Ka(t),o=i>=n.left-e&&i<=n.right+e,a=r>=n.top-e&&r<=n.bottom+e;return o&&a?s=t:void 0}})),s);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[dl]._onDragOver(n)}}var i,r,s},ac=function(t){bl&&bl.parentNode[dl]._isOutsideThisEl(t.target)};function lc(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Pa({},e),t[dl]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return nc(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==lc.supportPointer&&"PointerEvent"in window&&!Ia,emptyInsertThreshold:5};for(var o in fl.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in oc(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&tc,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Wa(t,"pointerdown",this._onTapStart):(Wa(t,"mousedown",this._onTapStart),Wa(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Wa(t,"dragover",this),Wa(t,"dragenter",this)),Vl.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Pa(this,ul())}function cc(t,e,n,o,i,r,s,a){var l,c,d=t[dl],u=d.options.onMove;return!window.CustomEvent||ka||La?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=i||e,l.relatedRect=r||Ka(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),u&&(c=u.call(d,l,s)),c}function dc(t){t.draggable=!1}function uc(){Gl=!1}function hc(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function pc(t){return setTimeout(t,0)}function fc(t){return clearTimeout(t)}lc.prototype={constructor:lc,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Fl=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,bl):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=o.filter;if(function(t){Zl.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Zl.push(o)}}(n),!bl&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Ia||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=qa(a,o.draggable,n,!1))&&a.animated||Sl===a)){if(_l=nl(a),Tl=nl(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return vl({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),gl("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=qa(l,o.trim(),n,!1))return vl({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),gl("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!qa(l,o.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,s=i.options,a=r.ownerDocument;if(n&&!bl&&n.parentNode===r){var l=Ka(n);if(Cl=r,yl=(bl=n).parentNode,El=bl.nextSibling,Sl=n,Pl=s.group,lc.dragged=bl,Dl={target:bl,clientX:(e||t).clientX,clientY:(e||t).clientY},Il=Dl.clientX-l.left,Ml=Dl.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,bl.style["will-change"]="all",o=function(){gl("delayEnded",i,{evt:t}),lc.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!$a&&i.nativeDraggable&&(bl.draggable=!0),i._triggerDragStart(t,e),vl({sortable:i,name:"choose",originalEvent:t}),Xa(bl,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Za(bl,t.trim(),dc)})),Wa(a,"dragover",sc),Wa(a,"mousemove",sc),Wa(a,"touchmove",sc),Wa(a,"mouseup",i._onDrop),Wa(a,"touchend",i._onDrop),Wa(a,"touchcancel",i._onDrop),$a&&this.nativeDraggable&&(this.options.touchStartThreshold=4,bl.draggable=!0),gl("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(La||ka))o();else{if(lc.eventCanceled)return void this._onDrop();Wa(a,"mouseup",i._disableDelayedDrag),Wa(a,"touchend",i._disableDelayedDrag),Wa(a,"touchcancel",i._disableDelayedDrag),Wa(a,"mousemove",i._delayedDragTouchMoveHandler),Wa(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Wa(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,s.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){bl&&dc(bl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Ba(t,"mouseup",this._disableDelayedDrag),Ba(t,"touchend",this._disableDelayedDrag),Ba(t,"touchcancel",this._disableDelayedDrag),Ba(t,"mousemove",this._delayedDragTouchMoveHandler),Ba(t,"touchmove",this._delayedDragTouchMoveHandler),Ba(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Wa(document,"pointermove",this._onTouchMove):Wa(document,e?"touchmove":"mousemove",this._onTouchMove):(Wa(bl,"dragend",this),Wa(Cl,"dragstart",this._onDragStart));try{document.selection?pc((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(Ul=!1,Cl&&bl){gl("dragStarted",this,{evt:e}),this.nativeDraggable&&Wa(document,"dragover",ac);var n=this.options;!t&&Xa(bl,n.dragClass,!1),Xa(bl,n.ghostClass,!0),lc.active=this,t&&this._appendGhost(),vl({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(kl){this._lastX=kl.clientX,this._lastY=kl.clientY,ic();for(var t=document.elementFromPoint(kl.clientX,kl.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(kl.clientX,kl.clientY))!==e;)e=t;if(bl.parentNode[dl]._isOutsideThisEl(t),e)do{if(e[dl]){if(e[dl]._onDragOver({clientX:kl.clientX,clientY:kl.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=Ua(e));rc()}},_onTouchMove:function(t){if(Dl){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=wl&&Ga(wl,!0),s=wl&&r&&r.a,a=wl&&r&&r.d,l=Kl&&zl&&ol(zl),c=(i.clientX-Dl.clientX+o.x)/(s||1)+(l?l[0]-Yl[0]:0)/(s||1),d=(i.clientY-Dl.clientY+o.y)/(a||1)+(l?l[1]-Yl[1]:0)/(a||1);if(!lc.active&&!Ul){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(wl){r?(r.e+=c-(Ll||0),r.f+=d-($l||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Ya(wl,"webkitTransform",u),Ya(wl,"mozTransform",u),Ya(wl,"msTransform",u),Ya(wl,"transform",u),Ll=c,$l=d,kl=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!wl){var t=this.options.fallbackOnBody?document.body:Cl,e=Ka(bl,!0,Kl,!0,t),n=this.options;if(Kl){for(zl=t;"static"===Ya(zl,"position")&&"none"===Ya(zl,"transform")&&zl!==document;)zl=zl.parentNode;zl!==document.body&&zl!==document.documentElement?(zl===document&&(zl=Ja()),e.top+=zl.scrollTop,e.left+=zl.scrollLeft):zl=Ja(),Yl=ol(zl)}Xa(wl=bl.cloneNode(!0),n.ghostClass,!1),Xa(wl,n.fallbackClass,!0),Xa(wl,n.dragClass,!0),Ya(wl,"transition",""),Ya(wl,"transform",""),Ya(wl,"box-sizing","border-box"),Ya(wl,"margin",0),Ya(wl,"top",e.top),Ya(wl,"left",e.left),Ya(wl,"width",e.width),Ya(wl,"height",e.height),Ya(wl,"opacity","0.8"),Ya(wl,"position",Kl?"absolute":"fixed"),Ya(wl,"zIndex","100000"),Ya(wl,"pointerEvents","none"),lc.ghost=wl,t.appendChild(wl),Ya(wl,"transform-origin",Il/parseInt(wl.style.width)*100+"% "+Ml/parseInt(wl.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;gl("dragStart",this,{evt:t}),lc.eventCanceled?this._onDrop():(gl("setupClone",this),lc.eventCanceled||((xl=ll(bl)).removeAttribute("id"),xl.draggable=!1,xl.style["will-change"]="",this._hideClone(),Xa(xl,this.options.chosenClass,!1),lc.clone=xl),n.cloneId=pc((function(){gl("clone",n),lc.eventCanceled||(n.options.removeCloneOnHide||Cl.insertBefore(xl,bl),n._hideClone(),vl({sortable:n,name:"clone"}))})),!e&&Xa(bl,i.dragClass,!0),e?(ql=!0,n._loopId=setInterval(n._emulateDragOver,50)):(Ba(document,"mouseup",n._onDrop),Ba(document,"touchend",n._onDrop),Ba(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,bl)),Wa(document,"drop",n),Ya(bl,"transform","translateZ(0)")),Ul=!0,n._dragStartId=pc(n._dragStarted.bind(n,e,t)),Wa(document,"selectstart",n),Rl=!0,Ia&&Ya(document.body,"user-select","none"))},_onDragOver:function(t){var e,n,o,i,r=this.el,s=t.target,a=this.options,l=a.group,c=lc.active,d=Pl===l,u=a.sort,h=jl||c,p=this,f=!1;if(!Gl){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=qa(s,a.draggable,r,!0),N("dragOver"),lc.eventCanceled)return f;if(bl.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return j(!1);if(ql=!1,c&&!a.disabled&&(d?u||(o=yl!==Cl):jl===this||(this.lastPutMode=Pl.checkPull(this,c,bl,t))&&l.checkPut(this,c,bl,t))){if(i="vertical"===this._getDirection(t,s),e=Ka(bl),N("dragOverValid"),lc.eventCanceled)return f;if(o)return yl=Cl,P(),this._hideClone(),N("revert"),lc.eventCanceled||(El?Cl.insertBefore(bl,El):Cl.appendChild(bl)),j(!0);var m=el(r,a.draggable);if(!m||function(t,e,n){var o=Ka(el(n.el,n.options.draggable)),i=cl(n.el,n.options,wl),r=10;return e?t.clientX>i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,i,this)&&!m.animated){if(m===bl)return j(!1);if(m&&r===t.target&&(s=m),s&&(n=Ka(s)),!1!==cc(Cl,r,bl,e,s,n,t,!!s))return P(),m&&m.nextSibling?r.insertBefore(bl,m.nextSibling):r.appendChild(bl),yl=r,D(),j(!0)}else if(m&&function(t,e,n){var o=Ka(tl(n.el,0,n.options,!0)),i=cl(n.el,n.options,wl),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}(t,i,this)){var g=tl(r,0,a,!0);if(g===bl)return j(!1);if(n=Ka(s=g),!1!==cc(Cl,r,bl,e,s,n,t,!1))return P(),r.insertBefore(bl,g),yl=r,D(),j(!0)}else if(s.parentNode===r){n=Ka(s);var v,b,y,w=bl.parentNode!==r,C=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,s=n?e.left:e.top,a=n?e.right:e.bottom,l=n?e.width:e.height;return o===s||i===a||o+r/2===s+l/2}(bl.animated&&bl.toRect||e,s.animated&&s.toRect||n,i),E=i?"top":"left",S=Qa(s,"top","top")||Qa(bl,"top","top"),x=S?S.scrollTop:void 0;if(Fl!==s&&(b=n[E],Hl=!1,Xl=!C&&a.invertSwap||w),v=function(t,e,n,o,i,r,s,a){var l=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,u=o?n.bottom:n.right,h=!1;if(!s)if(a&&Bl<c*i){if(!Hl&&(1===Wl?l>d+c*r/2:l<u-c*r/2)&&(Hl=!0),Hl)h=!0;else if(1===Wl?l<d+Bl:l>u-Bl)return-Wl}else if(l>d+c*(1-i)/2&&l<u-c*(1-i)/2)return function(t){return nl(bl)<nl(t)?1:-1}(e);if((h=h||s)&&(l<d+c*r/2||l>u-c*r/2))return l>d+c/2?1:-1;return 0}(t,s,n,i,C?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Xl,Fl===s),0!==v){var O=nl(bl);do{O-=v,y=yl.children[O]}while(y&&("none"===Ya(y,"display")||y===wl))}if(0===v||y===s)return j(!1);Fl=s,Wl=v;var _=s.nextElementSibling,A=!1,T=cc(Cl,r,bl,e,s,n,t,A=1===v);if(!1!==T)return 1!==T&&-1!==T||(A=1===T),Gl=!0,setTimeout(uc,30),P(),A&&!_?r.appendChild(bl):s.parentNode.insertBefore(bl,A?_:s),S&&al(S,0,x-S.scrollTop),yl=bl.parentNode,void 0===b||Xl||(Bl=Math.abs(b-Ka(s)[E])),D(),j(!0)}if(r.contains(bl))return j(!1)}return!1}function N(a,l){gl(a,p,Aa({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:u,fromSortable:h,target:s,completed:j,onMove:function(n,o){return cc(Cl,r,bl,e,n,Ka(n),t,o)},changed:D},l))}function P(){N("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function j(e){return N("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(Xa(bl,jl?jl.options.ghostClass:c.options.ghostClass,!1),Xa(bl,a.ghostClass,!0)),jl!==p&&p!==lc.active?jl=p:p===lc.active&&jl&&(jl=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){N("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===bl&&!bl.animated||s===r&&!s.animated)&&(Fl=null),a.dragoverBubble||t.rootEl||s===document||(bl.parentNode[dl]._isOutsideThisEl(t.target),!e&&sc(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function D(){Al=nl(bl),Nl=nl(bl,a.draggable),vl({sortable:p,name:"change",toEl:r,newIndex:Al,newDraggableIndex:Nl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ba(document,"mousemove",this._onTouchMove),Ba(document,"touchmove",this._onTouchMove),Ba(document,"pointermove",this._onTouchMove),Ba(document,"dragover",sc),Ba(document,"mousemove",sc),Ba(document,"touchmove",sc)},_offUpEvents:function(){var t=this.el.ownerDocument;Ba(t,"mouseup",this._onDrop),Ba(t,"touchend",this._onDrop),Ba(t,"pointerup",this._onDrop),Ba(t,"touchcancel",this._onDrop),Ba(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Al=nl(bl),Nl=nl(bl,n.draggable),gl("drop",this,{evt:t}),yl=bl&&bl.parentNode,Al=nl(bl),Nl=nl(bl,n.draggable),lc.eventCanceled||(Ul=!1,Xl=!1,Hl=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),fc(this.cloneId),fc(this._dragStartId),this.nativeDraggable&&(Ba(document,"drop",this),Ba(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ia&&Ya(document.body,"user-select",""),Ya(bl,"transform",""),t&&(Rl&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),wl&&wl.parentNode&&wl.parentNode.removeChild(wl),(Cl===yl||jl&&"clone"!==jl.lastPutMode)&&xl&&xl.parentNode&&xl.parentNode.removeChild(xl),bl&&(this.nativeDraggable&&Ba(bl,"dragend",this),dc(bl),bl.style["will-change"]="",Rl&&!Ul&&Xa(bl,jl?jl.options.ghostClass:this.options.ghostClass,!1),Xa(bl,this.options.chosenClass,!1),vl({sortable:this,name:"unchoose",toEl:yl,newIndex:null,newDraggableIndex:null,originalEvent:t}),Cl!==yl?(Al>=0&&(vl({rootEl:yl,name:"add",toEl:yl,fromEl:Cl,originalEvent:t}),vl({sortable:this,name:"remove",toEl:yl,originalEvent:t}),vl({rootEl:yl,name:"sort",toEl:yl,fromEl:Cl,originalEvent:t}),vl({sortable:this,name:"sort",toEl:yl,originalEvent:t})),jl&&jl.save()):Al!==_l&&Al>=0&&(vl({sortable:this,name:"update",toEl:yl,originalEvent:t}),vl({sortable:this,name:"sort",toEl:yl,originalEvent:t})),lc.active&&(null!=Al&&-1!==Al||(Al=_l,Nl=Tl),vl({sortable:this,name:"end",toEl:yl,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){gl("nulling",this),Cl=bl=yl=wl=El=xl=Sl=Ol=Dl=kl=Rl=Al=Nl=_l=Tl=Fl=Wl=jl=Pl=lc.dragged=lc.ghost=lc.clone=lc.active=null,Zl.forEach((function(t){t.checked=!0})),Zl.length=Ll=$l=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":bl&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)qa(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||hc(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];qa(i,this.options.draggable,o,!1)&&(n[t]=i)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return qa(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=fl.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&oc(n)},destroy:function(){gl("destroy",this);var t=this.el;t[dl]=null,Ba(t,"mousedown",this._onTapStart),Ba(t,"touchstart",this._onTapStart),Ba(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ba(t,"dragover",this),Ba(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Vl.splice(Vl.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Ol){if(gl("hideClone",this),lc.eventCanceled)return;Ya(xl,"display","none"),this.options.removeCloneOnHide&&xl.parentNode&&xl.parentNode.removeChild(xl),Ol=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(Ol){if(gl("showClone",this),lc.eventCanceled)return;bl.parentNode!=Cl||this.options.group.revertClone?El?Cl.insertBefore(xl,El):Cl.appendChild(xl):Cl.insertBefore(xl,bl),this.options.group.revertClone&&this.animate(bl,xl),Ya(xl,"display",""),Ol=!1}}else this._hideClone()}},Jl&&Wa(document,"touchmove",(function(t){(lc.active||Ul)&&t.cancelable&&t.preventDefault()})),lc.utils={on:Wa,off:Ba,css:Ya,find:Za,is:function(t,e){return!!qa(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:sl,closest:qa,toggleClass:Xa,clone:ll,index:nl,nextTick:pc,cancelNextTick:fc,detectDirection:nc,getChild:tl,expando:dl},lc.get=function(t){return t[dl]},lc.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(lc.utils=Aa(Aa({},lc.utils),t.utils)),fl.mount(t)}))},lc.create=function(t,e){return new lc(t,e)},lc.version="1.15.3";var mc,gc,vc,bc,yc,wc,Cc=[],Ec=!1;function Sc(){Cc.forEach((function(t){clearInterval(t.pid)})),Cc=[]}function xc(){clearInterval(wc)}var Oc=sl((function(t,e,n,o){if(e.scroll){var i,r=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=Ja(),d=!1;gc!==n&&(gc=n,Sc(),mc=e.scroll,i=e.scrollFn,!0===mc&&(mc=il(n,!0)));var u=0,h=mc;do{var p=h,f=Ka(p),m=f.top,g=f.bottom,v=f.left,b=f.right,y=f.width,w=f.height,C=void 0,E=void 0,S=p.scrollWidth,x=p.scrollHeight,O=Ya(p),_=p.scrollLeft,A=p.scrollTop;p===c?(C=y<S&&("auto"===O.overflowX||"scroll"===O.overflowX||"visible"===O.overflowX),E=w<x&&("auto"===O.overflowY||"scroll"===O.overflowY||"visible"===O.overflowY)):(C=y<S&&("auto"===O.overflowX||"scroll"===O.overflowX),E=w<x&&("auto"===O.overflowY||"scroll"===O.overflowY));var T=C&&(Math.abs(b-r)<=a&&_+y<S)-(Math.abs(v-r)<=a&&!!_),N=E&&(Math.abs(g-s)<=a&&A+w<x)-(Math.abs(m-s)<=a&&!!A);if(!Cc[u])for(var P=0;P<=u;P++)Cc[P]||(Cc[P]={});Cc[u].vx==T&&Cc[u].vy==N&&Cc[u].el===p||(Cc[u].el=p,Cc[u].vx=T,Cc[u].vy=N,clearInterval(Cc[u].pid),0==T&&0==N||(d=!0,Cc[u].pid=setInterval(function(){o&&0===this.layer&&lc.active._onTouchMove(yc);var e=Cc[this.layer].vy?Cc[this.layer].vy*l:0,n=Cc[this.layer].vx?Cc[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(lc.dragged.parentNode[dl],n,e,t,yc,Cc[this.layer].el)||al(Cc[this.layer].el,n,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=il(h,!1)));Ec=d}}),30),_c=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,s=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var l=n||i;s();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function Ac(){}function Tc(){}Ac.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=tl(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:_c},Pa(Ac,{pluginName:"revertOnSpill"}),Tc.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:_c},Pa(Tc,{pluginName:"removeOnSpill"}),lc.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?Wa(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Wa(document,"pointermove",this._handleFallbackAutoScroll):e.touches?Wa(document,"touchmove",this._handleFallbackAutoScroll):Wa(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?Ba(document,"dragover",this._handleAutoScroll):(Ba(document,"pointermove",this._handleFallbackAutoScroll),Ba(document,"touchmove",this._handleFallbackAutoScroll),Ba(document,"mousemove",this._handleFallbackAutoScroll)),xc(),Sc(),clearTimeout(Va),Va=void 0},nulling:function(){yc=gc=mc=Ec=wc=vc=bc=null,Cc.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if(yc=t,e||this.options.forceAutoScrollFallback||La||ka||Ia){Oc(t,this.options,r,e);var s=il(r,!0);!Ec||wc&&o===vc&&i===bc||(wc&&xc(),wc=setInterval((function(){var r=il(document.elementFromPoint(o,i),!0);r!==s&&(s=r,Sc()),Oc(t,n.options,r,e)}),10),vc=o,bc=i)}else{if(!this.options.bubbleScroll||il(r,!0)===Ja())return void Sc();Oc(t,this.options,il(r,!1),!1)}}},Pa(t,{pluginName:"scroll",initializeByDefault:!0})}),lc.mount(Tc,Ac);const Nc={getStyle:(t,e=!1)=>{let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n},fadeOut:(t,e=250)=>{const n=1/(e/60);t.style.opacity=1,function e(){const o=Number(t.style.opacity)-n;o>0?(t.style.opacity=o,window.requestAnimationFrame(e)):t.remove()}()},slideDown:(t,e=250,n=!1)=>{t.style.display="block";const o=Nc.getStyle(t),i=Number.parseInt(o.height,10),r=i/(e/60);t.style.height="0px",function e(){const o=Number.parseFloat(t.style.height),s=o+r;o<i?(t.style.height=`${s}px`,window.requestAnimationFrame(e)):(t.style.height="auto",n&&n(t))}()},slideUp:(t,e=250,n=!1)=>{const o=Nc.getStyle(t),i=Number.parseInt(o.height,10),r=o.overflow;t.style.overflow="hidden",t.style.height=`${i}px`;const s=o.minHeight;t.style.minHeight="auto";const a=parseFloat(i/(e/60)).toFixed(2);!function e(){const o=Number.parseInt(t.style.height,10)-a;o>0?(t.style.height=`${o}px`,window.requestAnimationFrame(e)):(t.style.overflow=r,t.style.display="none",t.style.minHeight=s,delete t.style.height,n&&n(t))}()},slideToggle:(t,e=250,n="none"===Nc.getStyle(t,"display"))=>{n?Nc.slideDown(t,e):Nc.slideUp(t,e)}},Pc=t=>Number.isInteger(Number(t)),jc=t=>{let e=0,n=t;for(;n?.previousElementSibling;)n=n.previousElementSibling,e++;return e},Dc=(t,e,n)=>{const o=n.split("||"),i=Uo(e).map((e=>t.find((t=>{const n=o.find((e=>!!ds(t,e)));return n&&ds(t,n)===e})))).filter(Boolean).concat(t);return Uo(i)},kc=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},Lc=(t,e)=>{const n=[];return kc(t,((t,o)=>n.push(e(t,o)))),n},$c={},Ic=t=>{if($c[t])return $c[t];const e=({className:"class"}[t]||t).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return $c[t]=e,e},Mc=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),Rc=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Fc={capitalize:Mc,safeAttrName:Ic,forEach:kc,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:Lc,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:jc,isInt:Pc,get:ds,orderObjectsBy:Dc,isIE:Rc},Wc={glyphicons:t=>`<span class="glyphicon glyphicon-${t}" aria-hidden="true"></span>`,"font-awesome":t=>{const[e,n]=t.split(" ");return`<i class="${e} fa-${n}"></i>`},fontello:t=>`<i class="${br}${t}">${t}</i>`},Bc=new Set(["input","textarea","select"]),zc=(t={})=>{let e=t?.attrs?.name||t?.name;if(e)return e;const n=qo(t);let o=t.config?.label||t.attrs?.label||t?.label;return o&&("object"==typeof o&&(o=Uc.create(o).textContent),/^<.+>.+<.+>$/gim.test(o)&&(o=(t=>{const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""})(o)),e=`${n}-${_r(((t,e,n="…")=>{if(t.length<=e)return t;const o=t.slice(0,e),i=o.lastIndexOf(" ");let r=`${i>0?o.slice(0,i):o}`;return n&&(r+=n),r})(o,24,null))}`),e||n};const Uc=new class{constructor(t=Object.create(null)){this.options=t}set setOptions(t){this.options=Vo(this.options,t)}processElemArg(t){let e,n=t;if("string"==typeof n)return e=n,n={tag:e},n;if(n.attrs){const{tag:t,...o}=n.attrs;if(t)if("string"==typeof t)e=t;else{e=(t.find((t=>!0===t.selected))||t[0]).value}n.attrs=o}return n.tag=e||n.tag||"div",n}render=t=>(t.id=`f-${t.id||qo()}`,this.create(t));create=(t,e=!1)=>{if(!t)return;if(this.isDOMElement(t))return t;const n=this,o=["children","content"],{className:i,options:r,dataset:s,...a}=this.processElemArg(t);let l;o.push("tag");const{tag:c}=a;let d;const u={attrs:{},className:[Fc.get(a,"config.inputWrap")],children:[],config:{}};let h=document.createElement(c);const p={string:t=>{h.innerHTML+=t},object:t=>t&&h.appendChild(n.create(t,e)),node:t=>h.appendChild(t),component:t=>h.appendChild(t.dom),array:t=>{for(const e of t)l=n.childType(e),p[l](e)},function:t=>{t=t(),l=n.childType(t),p[l](t)},undefined:()=>null,boolean:()=>null};if(i&&(a.attrs=Vo(a.attrs,{className:i})),r){const t=this.processOptions(r,a,e);if(!this.holdsContent(h)||"button"===c)return Fc.forEach(t,(t=>{u.children.push(n.create(t,e))})),a.attrs.className&&(u.className=a.attrs.className),u.id=a.id,u.config={...a.config},this.create(u,e);p.array.call(this,t),a.content=void 0,o.push("options")}if(a.attrs&&(n.processAttrs(a,h,e),o.push("attrs")),a.config){if(a.config.label&&(a.config.label&&"button"!==c||["radio","checkbox"].includes(Fc.get(a,"attrs.type")))&&!e){const t=n.label(a);if(!a.config.hideLabel){const e=[t,h];n.labelAfter(a)&&e.reverse(),u.children.push(e)}}o.push("config")}if(a.content||a.children){const t=a.content||a.children;l=n.childType(t),p[l],p[l].call(this,t)}if(s){for(const t in s)Object.hasOwn(s,t)&&(h.dataset[t]="function"==typeof s[t]?s[t]():s[t]);o.push("dataset")}a.action&&(this.actionHandler(h,a.action),o.push("action"));const f=Fc.subtract(o,Object.keys(a));for(d=f.length-1;d>=0;d--)h[f[d]]=a[f[d]];return u.children.length&&(h=this.create(u)),h};onRender=(t,e,n=333)=>{const o=Date.now(),i=()=>{!t.parentElement&&Date.now()-o<n?window.requestAnimationFrame(i):t.parentElement&&e(t)};i()};actionHandler(t,e){const n={onRender:Uc.onRender,render:Uc.onRender},o=["focus","blur"];return Object.entries(e).map((([e,i])=>(Array.isArray(i)?i:[i]).map((i=>{const r=n[e]||(t=>(e,n)=>e.addEventListener(t,n,o.includes(t)))(e);return r(t,i)}))))}get icons(){if(this.iconSymbols)return this.iconSymbols;const t=document.querySelectorAll(`#${si} svg symbol`);return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(br,"")]={tag:"svg",attrs:{className:["svg-icon",n=e.id]},children:[{tag:"use",attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink","xlink:href":`#${n}`}}]},t}),{}),this.cachedIcons={},this.iconSymbols}icon(t,e){if(!t)return;const n=`${t}?${new URLSearchParams(e).toString()}`;if(this.cachedIcons?.[n])return this.cachedIcons[n];const o=this.icons[t];if(o){if(e){const t=Vo(o,e);return this.cachedIcons[n]=Uc.create(t).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=Uc.create(o).outerHTML,this.cachedIcons[n]}return Wc[Uc.options.iconFont]?.(t)||t}processAttrs(t,e,n){const{attrs:o={}}=t;if(!n&&!o.name&&null!==o.name&&this.isInput(t.tag)){const n=zc(t);n&&e.setAttribute("name",n)}for(const i of Object.keys(o)){const t=Fc.safeAttrName(i),n=this.processAttrValue(o[i]);!1!==n&&e.setAttribute(t,n)}}processAttrValue(t){if("function"==typeof t)return t();if("boolean"==typeof t)return t?"":t;let e=t||"";if(Array.isArray(e))if("object"==typeof e[0]){const t=e.filter((t=>!0===t.selected));e=t.length?t[0].value:e[0].value}else e=e.join(" ");return e}toggleElementsByStr=(t,e)=>{const n=[];return Uc.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n};elementsContainText=(t,e,n)=>{const o=[];return kc(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());n?.(t,i),i&&o.push(t)})),o};generateOption=({type:t="option",label:e,value:o,i:i=0,selected:r})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:o||`${t}-${i}`,["option"===t?"selected":"checked"]:r||!i},config:{label:e||n.get("labelCount",{label:n.get("option"),count:i})}});processOptions(t,e,n){const{action:o,attrs:i={}}=e,r=i.type||e.tag,s=i.id||e.id;return t.map(((t,a)=>{const{label:l,value:c,...d}=t,u=()=>{const u={tag:"input",attrs:{name:s,type:r,value:c||"",id:`${s}-${a}`,...d},action:o},h={tag:"label",attrs:{for:`${s}-${a}`},children:l},p={children:[u,h],className:[`f-${r}`]};return i.className&&(e.config.inputWrap=i.className),e.config.inline&&p.className.push(`f-${r}-inline`),t.selected&&(u.attrs.checked=!0),n&&(h.attrs.contenteditable=!0),p},h={select:()=>{const e=t.attrs||t,n={attrs:e,...t,...e},{label:o,checked:i,selected:r,attrs:s}=n;return{tag:"option",attrs:{...s,selected:!(!i&&!r)},children:o}},button:t=>{const{type:n,label:o,className:i,id:r}=t;return{...e,attrs:{type:n},className:i,id:r||qo(),options:void 0,children:o,action:e.action}},checkbox:u,radio:u};return h[r]?.(t)}))}holdsContent(t){return-1!==t.outerHTML.indexOf("/")}isBlockInput(t){return!this.isInput(t)&&this.holdsContent(t)}isInput(t){let e=t;return"string"!=typeof e&&(e=e.tagName),Bc.has(e)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=Fc.get(t,"attrs.type"),n=Fc.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});label(t,e){const n=Fc.get(t,"attrs.required");let{config:{label:o=""}}=t;const{id:i,attrs:r}=t;"function"==typeof o&&(o=o());const s={tag:"label",attrs:{for:i||r?.id},className:[],children:[o,n&&this.requiredMark()],action:{}};return e&&(s.attrs.for=void 0,s.attrs.contenteditable=!0,s.fMap=e),s}childType(t){return void 0===t?t:[["array",t=>Array.isArray(t)],["node",t=>t instanceof window.Node||t instanceof window.HTMLElement],["component",()=>t?.dom],[typeof t,()=>!0]].find((e=>e[1](t)))[0]}getStyle(t,e=!1){let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n}getElement(t){return{node:()=>t,object:()=>document.getElementById(t.id),string:()=>document.getElementById(t)}[this.childType(t)]()}empty(t){for(;t.firstChild;)this.remove(t.firstChild);return t}removeEmpty=t=>{const e=t.parentElement,n=zo(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length)return this.isStage(e)?this.emptyClass(e):this.removeEmpty(e)};remove(t){const e=zo(t);return e?gu.remove(`${e}s.${t.id}`):t.parentElement.removeChild(t)}removeClasses(t,e){const n={string:t=>t.classList.remove(e),array:t=>{for(const n of e)t.classList.remove(n)}};n.object=n.string,Fc.forEach(t,n[this.childType(e)])}addClasses(t,e){const n={string:t=>t.classList.add(e),array:t=>{for(const n of e)t.classList.add(n)}};Fc.forEach(t,n[this.childType(e)])}formGroup(t,e=""){return{className:["f-field-group",e],children:t}}coords(t){const e=t.getBoundingClientRect(),n=document.body.getBoundingClientRect();return{pageX:e.left+e.width/2,pageY:e.top-n.top-e.height/2}}clearStage(t){t.classList.add("removing-all-fields");Nc.slideUp(t,600,(()=>{Uc.empty(t),t.classList.remove("removing-all-fields"),Uc.emptyClass(t),Nc.slideDown(t,300)}))}toggleSortable(t,e){let n=e;const o=zo(t);if(!o)return;const i=zo(t.parentElement),r=Uc[o].get(t.id).sortable;n||(n=!r.option("disabled")),r.option("disabled",n),i&&["rows","columns","stages"].includes(i)&&this.toggleSortable(t.parentElement,n)}emptyClass(t){const e=t.getElementsByClassName(Ei.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}btnTemplate=({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e});isControls=t=>zo(t)===fi;isStage=t=>zo(t)===mi;isRow=t=>zo(t)===gi;isColumn=t=>zo(t)===vi;isField=t=>zo(t)===bi;asComponent=t=>gu[`${zo(t)}s`].get(t.id);isDOMElement(t){return t instanceof window.Element||t instanceof window.HTMLElement||!(!t||"object"!=typeof t||1!==t.nodeType||"string"!=typeof t.nodeName)}},qc="f-autocomplete",Vc=`${qc}-display-field`,Hc=`${qc}-list`,Xc="highlight-component",Yc=`${Hc}-item`,Gc=["config.label","config.controlId"],Zc=[...Gc,"config.legend","name"],Jc=t=>Gc.reduce(((e,n)=>e||t.get(n)),null),Kc=t=>Zc.reduce(((e,n)=>e||t.get(n)),null)||Or(t.name),Qc=new Map([["condition.source",Jc],["if.condition.source",Jc],["if.condition.target",Jc],["then.condition.target",Kc],["condition.target",Kc]]),td=({id:t,...e},n)=>{const{name:o,label:i}=e;if(!o)return i;return Qc.get(n)(e)},ed=t=>(t.classList.contains(Yc)||(t=t.parentElement),t),nd=({value:t,textLabel:e,htmlLabel:n,componentType:o,depth:i=0},r)=>{const s={tag:"li",children:n,dataset:{value:t,label:e},className:[Yc,`${Yc}-depth-${i}`,`component-type-${o}`],action:{mousedown:({target:t})=>{t=ed(t),r.setValue(t),r.selectOption(t),r.hideList()},mouseover:({target:t})=>{t=ed(t),r.removeHighlight(),r.highlightComponent(t)},mouseleave:({target:t})=>{t=ed(t),r.removeHighlight()}}};return Uc.create(s)},od=t=>{const e=t.value,n=[],o=gu.flatList(),i=Object.entries(o).reduce(((o,[i,r])=>{const s=td(r,t.key);if(s){const a=r.name,l={tag:"span",content:` ${Or(a)}`,className:"component-type"},c=`${a}.${s}`;n.push(c);const d=((t,e)=>{const n=t.reduce(((t,n)=>t+(n===e)),0);return n>1?`(${n})`:""})(n,c),u=[`${s} `,{tag:"span",content:d,className:"component-label-count"},l],h=[s,d].join(" ").trim();if(r.isCheckable){const e=((t,e)=>{const n=t.data.options.map(((n,o)=>{const i=`${t.address}.options[${o}]`,r=n.label,s=n.label;return nd({value:i,textLabel:r,htmlLabel:s,componentType:"option",depth:1},e)}));return Uc.create({tag:"ul",attrs:{className:[Hc,"options-list"]},children:n})})(r,t);u.push(e)}const p=(({selectedId:t,...e})=>(e.value===t&&(e.selected=!0),e))({value:i,textLabel:h,htmlLabel:u,componentType:a,selectedId:e});o.push(nd(p,t))}return o}),[]);return i};class id{lastCache=Date.now();optionsCache=null;constructor({key:t,value:e,className:n,onChange:o=Qo}){this.key=t,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=e,this.onChange=o||Qo,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(t,e){if(e in t)return t[e];if(e in t.dom){const n=t.dom[e];return"function"==typeof n?n.bind(t.dom):n}},set:(t,e,n)=>(e in t?t[e]=n:t.dom[e]=n,!0)})}get isAddress(){return Zo(this.value)}get valueComponent(){return Zo(this.value)&&gu.getAddress(this.value)}build(){const t=t=>{const e=this.list,n=this.getActiveOption();let o=new Map([[38,()=>{const t=this.getPreviousOption(n);t&&this.selectOption(t)}],[40,()=>{const t=this.getNextOption(n);t&&this.selectOption(t)}],[13,()=>{n&&(this.selectOption(n),this.setValue(n),"none"===e.style.display?this.showList(n):this.hideList()),t.preventDefault()}],[27,()=>{this.hideList()}]]).get(t.keyCode);return o||(o=()=>!1),o()},e={focus:({target:e})=>{this.updateOptions(),e.parentElement.classList.add(`${qc}-focused`);const n=Uc.toggleElementsByStr(this.list.querySelectorAll(`.${Yc}-depth-0`),e.value);e.addEventListener("keydown",t);const o=this.list.querySelector(".active-option")||n[0];this.showList(o)},blur:({target:e})=>{e.parentElement.classList.remove(`${qc}-focused`),e.removeEventListener("keydown",t),this.hideList()},input:t=>{const{value:e}=t.target,n=Uc.toggleElementsByStr(this.list.querySelectorAll("li"),e);if(0===e.length&&this.clearValue(),0===n.length)this.hideList();else{const t=this.getActiveOption()||n[0];this.showList(t)}this.setValue({dataset:{label:e,value:e}})}};return this.displayField=Uc.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:Vc,value:this.label||this.value,placeholder:n.get(`${this.key}.placeholder`)}}),this.hiddenField=Uc.create({tag:"input",attrs:{type:"hidden",className:qc,value:this.value}}),this.list=Uc.create({tag:"ul",attrs:{className:Hc}}),this.clearButton=Uc.create({tag:"span",content:Uc.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=Uc.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[qc,this.className].flat(),action:{onRender:t=>{this.stage=t.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Zo(this.value))return this.value;const t=this.value&&gu.getAddress(this.value);return t&&td(t,`${this.key}`)||this.value}updateOptions(){let t=this.optionsCache;const e=Date.now();(e-this.lastCache>5*Hi||!t)&&(Uc.empty(this.list),t=this.generateOptions(),this.lastCache=e),this.list.children.length||this.list.append(...t)}generateOptions(){return this.optionsCache=od(this),this.optionsCache}setListPosition(){const{offsetHeight:t,offsetWidth:e}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),o=this.displayField.getBoundingClientRect(),i={position:"absolute",top:o.y+t-n.y+"px",left:o.x+window.scrollX-n.x+2+"px",width:`${e}px`};Object.assign(this.list.style,i)}showList(t,e=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(t),Nc.slideDown(e,Vi)}hideList(t=this.list){Nc.slideUp(t,Vi),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(t=this.list){const e=t.querySelector(".active-option");return"none"!==e?.style.display?e:null}getPreviousOption(t){let e=t;do{e=e?e.previousSibling:null}while(null!=e&&"none"===e.style.display);return e}getNextOption(t){let e=t;do{e=e?e.nextSibling:null}while(null!=e&&"none"===e.style.display);return e}selectOption(t,e=this.list){const n=e.querySelectorAll("li");for(const o of n){const{dataset:{value:t}}=o;if(o.classList.remove("active-option"),Zo(t)){const e=gu.getAddress(t);e?.dom?.classList.remove(Xc)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(Xc);for(const e of t)e.classList.remove(Xc)}highlightComponent(t){const{dataset:{value:e}}=t;if(Zo(e)){const{componentAddress:t,isOptionAddress:n,optionIndex:o}=Ar(e).reduce(((t,e)=>"options"===e?(t.isOptionAddress=!0,t):t.isOptionAddress?(t.optionIndex=+e,t):(t.componentAddress.push(e),t)),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),i=gu.getAddress(t);if(i?.dom&&(i.dom.classList.add(Xc),n)){const t=i.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio");t[o]?.classList.add(Xc)}}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(t){const{label:e,value:n}=t.dataset;this.displayField.value=e,this.hiddenField.value=n,this.value=n,this.clearButton.classList.toggle("hidden",!n.length),this.onChange?.({target:this.hiddenField})}}function rd({key:t,value:e,type:o="text",checked:i}){const r={tag:"input",attrs:{type:o,value:e,placeholder:n.get(`${t}.placeholder`)||Or(t)},className:[t.replace(/\./g,"-")],config:{}};return i&&(r.attrs.checked=!0),r}function sd(t){const e=n.get(t);if(e)return e;const o=t.split(".");return n.get(o[o.length-1])}const ad={autocomplete:(...t)=>new id(...t).createProxy(),string:({key:t,value:e})=>rd({key:t,value:e}),boolean:({key:t,value:e})=>rd({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:!!e}),number:({key:t,value:e})=>rd({key:t,value:e,type:"number"}),array:({key:t,value:e})=>({tag:"select",attrs:{placeholder:sd(`placeholder.${t}`)},className:[t.replace(/\./g,"-")],options:e}),object:t=>Object.entries(t).map((([t,e])=>ad[Uc.childType(e)]({key:t,value:e})))},ld={boolean:(t,e)=>({click:({target:n})=>{if("radio"===n.type){const t=e.data.options.map((t=>({...t,selected:!1})));e.set("options",t)}e.set(t,n.checked),e.updatePreview()}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n),e.debouncedUpdatePreview()}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n)),e.debouncedUpdatePreview()}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n),e.debouncedUpdatePreview()}}),object:()=>({})},cd="hidden-property",dd=/\.options\[\d+\]$/,ud={"if-sourceProperty":hs(ur,cr,dr),"if-targetProperty":hs(ur),"then-targetProperty":hs(ur,cr,dr),...Object.entries(hr).reduce(((t,[e,n])=>(t[`if-${e}`]=n,t[`then-${e}`]=n,t)),{})},hd={assignment:fd,comparison:fd,logical:fd,source:({key:t,value:e,onChange:n,conditionType:o})=>ad.autocomplete({key:`${o}.condition.${t}`,value:e,onChange:n,className:`condition-${t}`}),sourceProperty:fd,targetProperty:fd,target:t=>hd.source(t),value:({key:t,value:e,onChange:n},o)=>{const i=ad.string({key:`condition.${t}`,value:e});return i.action={input:n},i}};function pd({key:t,value:e,conditionType:o}){const i=ud[`${o}-${t}`];return Object.entries(i||{}).map((([o,i])=>function({fieldName:t,fieldValue:e,key:o,optionValue:i}){return{label:n.get(`${t}.${o}`)||Or(o).toLowerCase(),value:i,selected:i===e}}({fieldName:t,fieldValue:e,key:o,optionValue:i})))}function fd({key:t,value:e,onChange:n,conditionType:o}){const i=pd({key:t,value:e,conditionType:o}),r=ad.array({key:`condition.${t}`,value:i});return r.action={change:n},r}const md={sourceProperty:t=>{const e=t.get("source"),n=t.get("sourceProperty"),o=!!e.value,i=!!e.value.match(dd);return yd(i,n),!o},comparison:t=>{const e=t.get("source"),n=t.get("sourceProperty"),o=!!e.value,i=!!e.value.match(dd);return!o||i||"value"!==n.value},assignment:t=>{const e=t.get("target"),n=t.get("targetProperty");return!!!e.value||n.value.startsWith("is")},targetProperty:t=>{const e=t.get("target"),n=t.get("targetProperty"),o=!!e.value.match(dd);return yd(o,n),i=e.value,!Oi.test(i);var i},target:t=>{const e=t.get("source"),n=t.get("sourceProperty");return!(!n||!!e?.value)||n&&"value"!==n?.value},value:t=>{const e=t.get("target"),n=t.get("targetProperty");return void 0!==n&&(!(!e||e.value)||(o=t.get("comparison"),!!o?.classList.contains(cd)||(n.value===vd||n.value.startsWith("is"))));var o}},gd=t=>{for(const[e,n]of t){const o=!!md[e]?.(t)||!1;n.classList.toggle(cd,o)}},vd="isChecked",bd=t=>t.value.endsWith("Checked"),yd=(t,e)=>{if(t&&bd(e))return null;const n=Array.from(e.querySelectorAll("option")),o=[];for(const i of n){const e=bd(i),n=t?!e:e;n&&o.push(i.value),i.classList.toggle("hidden-option",n)}o.includes(e.value)&&(e.value=t?vd:n.find((t=>!bd(t)))?.value||e.value)};class wd{constructor({conditionValues:t,conditionType:e,conditionCount:n,index:o},i){this.values=new Map(function(t,e=lr){return e.reduce(((e,n)=>(void 0!==t[n]&&e.push([n,t[n]]),e)),[])}(t)),this.conditionType=e,this.parent=i,this.baseAddress=`${i.address}.${e}`,this.fields=new Map,this.conditionCount=n,this.index=o,this.dom=this.generateDom()}setConditionIndex(t){this.index=t}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const t=gu.getAddress(this.baseAddress);t.splice(this.index,1),gu.setAddress(this.baseAddress,t),Nc.slideUp(this.dom,Vi,(()=>{this.dom.remove()}))}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:n.get(`condition.type.${this.conditionType}`)}}generateDom(){const t=[];for(const[n,o]of this.values){const e=t=>this.onChangeCondition({key:n,target:t.target}),i={key:n,value:o,conditionType:this.conditionType,onChange:e},r=hd[n](i,this.values),s=r.dom||Uc.create(r);this.fields.set(n,r.dom?r:s),t.push(s)}const e={children:[this.label(),...t,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:t=>{this.processUiState()}}};return Uc.create(e)}generateConditionTypeActionButtons(){const t=[],e="manage-condition-type",o=t=>`${t}-condition-type`,i=Uc.btnTemplate({title:n.get(`remove${this.conditionType}Condition`),className:[e,o("remove")],content:Uc.icon("minus"),action:{click:()=>this.destroy(),mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}}});t.push(i);const r=Uc.btnTemplate({title:n.get(`add${this.conditionType}Condition`),className:[e,o("add")],content:Uc.icon("plus"),action:{click:()=>{const t=this.parent.addConditionType(this.conditionType),e={changedProperty:null,dataPath:t.address,value:t.value,src:t.dom};this.updateDataDebounced(e)}}});return t.push(r),t}get value(){return Array.from(this.fields).reduce(((t,[e,n])=>(t[e]=n.value,t)),{})}processUiState(){gd(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=Jo((t=>{Cu.formeoUpdated(t),gu.setAddress(t.dataPath,t.value)}));onChangeCondition=({key:t,target:e})=>{const n={changedProperty:t,dataPath:this.address,value:this.value,src:e};gd(this.fields),this.updateDataDebounced(n)}}const Cd=new Map([["attrs",({itemKey:t})=>t],["options",({itemKey:t,key:e})=>`${t}.${e}`]]),Ed=(t,e)=>{if("select"===e.controlId){const n=e.editPanels.get("options"),[o,i]=t?wr:Cr,r=n.data.map((({[o]:t,...e})=>({[i]:t,...e})));n.setData(r)}},Sd=new Map([["attrs-multiple",t=>({change:({target:e})=>{"select"===t.field.controlId&&Ed(e.checked,t.field)}})]]);class xd{constructor({key:t,index:e,field:n,panel:o,data:i}){this.field=n,this.itemKey=t,this.itemIndex=e,this.panel=o,this.panelName=o.name,this.isDisabled=n.isDisabledProp(t,this.panelName),this.isHidden=this.isDisabled&&n.config.panels[this.panelName].hideDisabled,this.isLocked=n.isLockedProp(t,this.panelName),this.address=`${n.indexName}.${n.id}.${t}`,this.itemSlug=Tr(t),this.conditionTypeWrap=new Map,void 0!==i&&void 0===this.field.get(this.itemKey)&&this.field.set(this.itemKey,i);const r=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&r.push("hidden-property"),this.dom=Uc.create({tag:"li",className:r,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const t=this.field.get(this.itemKey);return t?.constructor===Object?Dc(Object.entries(t),wr,"0"):[[this.itemKey,t]]}findOrCreateConditionTypeWrap(t){let e=this.conditionTypeWrap.get(t);return e||(e=Uc.create({className:`type-conditions-wrap ${t}-conditions-wrap`}),this.conditionTypeWrap.set(t,e),e)}itemInputs(){const t=Uc.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map((([t,e])=>"conditions"===this.panelName?this.generateConditionFields(t,e):this.itemInput(t,e)))});return this.inputs&&this.inputs.replaceWith(t),this.inputs=t,t}addConditionType=(t,e)=>{const n=this.findOrCreateConditionTypeWrap(t);let o=e;if(!o){const[e]=mr()[t],i=n.children.length;"if"===t&&(e.logical="||"),o={conditionValues:e,conditionCount:i,index:i}}const i=new wd({conditionType:t,...o},this);return n.appendChild(i.dom),i};removeConditionType=(t,e)=>{const n=this.conditionTypeWrap.get(t),o=n.children[e];o.destroy(),n.removeChild(o.dom)};generateConditionFields=(t,e)=>(this.conditions=new Map,e.forEach(((n,o)=>{const i=this.addConditionType(t,{index:o,conditionCount:e.length,conditionValues:n});this.conditions.set(o,i)})),this.findOrCreateConditionTypeWrap(t));get itemControls(){if(this.isLocked){return{className:`${this.panelName}-prop-controls prop-controls`,content:[]}}const t={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{Nc.slideUp(this.dom,qi,(t=>{this.field.remove(this.itemKey),t.remove(),this.panel.updateProps()}))},mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}},content:Uc.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=Uc.childType(e)||"string",o=Cd.get(this.panelName)?.({itemKey:this.itemKey,key:t})||this.itemKey,i=o.split(".").filter(Number.isNaN).join(".")||t,r=ad[n]({key:t,value:e}),s=`${this.field.shortId}-${Tr(o).replace(/-\d+-(selected)/g,"-$1")}`,a={label:"options"!==this.panelName&&(sd(i)||Or(i)),labelAfter:!1},l={name:"checkbox"===r.attrs.type?`${s}[]`:s};l.disabled=this.isDisabled,l.locked=this.isLocked;const c=Sd.get(this.itemSlug)?.(this),d=function(t,e={}){const n={...t};for(const o in e)Object.hasOwn(e,o)&&(Object.hasOwn(n,o)?Array.isArray(n[o])?n[o].push(e[o]):n[o]=[n[o],e[o]]:n[o]=e[o]);return n}(ld[n](o,this.field),c||{}),u=Vo(ad[n]({key:t,value:e}),{action:d,attrs:l,config:a});return wr.includes(t)?{className:"f-addon",children:u}:u}}const Od={multiple:(t,e)=>{Ed(!!t,e)}};class _d{constructor(t,e,n){this.type=Uc.childType(t),this.name=e,this.component=n,this.panelConfig=this.getPanelConfig(this.data)}get data(){const t=this.component.get(this.name);return"object"===this.type?Object.entries(t):t}getPanelConfig(t){return this.props=this.createProps(t),this.editButtons=this.createEditButtons(),{config:{label:n.get(`panel.label.${this.name}`)},attrs:{className:`${pi} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(t=this.data){this.editPanelItems=Array.from(t).map(((t,e)=>{const n="array"===this.type,o=n?`[${e}]`:`.${t[0]}`,i=n?t:{[t[0]]:t[1]};return new xd({key:`${this.name}${o}`,data:i,field:this.component,index:e,panel:this})}));const e={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},editGroup:this.name,isSortable:"options"===this.name,content:this.editPanelItems};return Uc.create(e)}updateProps(){const t=this.createProps();this.props.replaceWith(t),this.props=t}createEditButtons(){const t=this.name,e=n.get(`panelEditButtons.${t}`),o={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition},i=[];if("conditions"===t){n.current&&!n.current.clearAll&&n.put("clearAll","Clear All");const e={...Uc.btnTemplate({content:[Uc.icon("bin"),n.get("clearAll")],title:n.get("clearAll")}),className:`clear-all-${t}`,action:{click:()=>{this.clearAllItems()}}};i.push(e)}const r={...Uc.btnTemplate({content:e,title:e}),className:`add-${t}`,action:{click:e=>{const i={btnCoords:Uc.coords(e.target),addAction:o[t]};"attrs"===t&&(i.isDisabled=this.component.isDisabledProp,i.isLocked=this.component.isLockedProp,i.message={attr:n.get(`action.add.${t}.attr`),value:n.get(`action.add.${t}.value`)});const r=Or(t),s=new window.CustomEvent(`onAdd${r}`,{detail:i});Ou.add[t](i),document.dispatchEvent(s)}}};i.push(r);return{className:"panel-action-buttons",content:i}}addAttribute=(t,e)=>{let o=e;const i=Ic(t),r=`attrs.${i}`;n.current[r]||n.put(r,Mc(t)),"string"==typeof o&&["true","false"].includes(o)&&(o=JSON.parse(o)),this.component.set(`attrs.${t}`,o),Od[i]?.(o,this.component);const s=this.props.querySelector(`.${this.component.name}-attrs-${i}`),a=new xd({key:r,data:{[i]:o},field:this.component,panel:this});s?s.replaceWith(a.dom):this.props.appendChild(a.dom),this.component.resizePanelWrap()};addOption=()=>{const t=this.component.data.config.controlId,e=this.component.get("options"),o="select"===t?"option":t,i=n.get("newOptionLabel",{type:o})||"New Option",r=`${this.name}[${this.data.length}]`,s=e[e.length-1],a={...e.length?s:{},label:i};"button"!==t&&(a.value=_r(i));const l=new xd({key:r,data:a,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(l),this.props.appendChild(l.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=t=>{const e=`conditions[${this.component.get("conditions").length}]`,n=new xd({key:e,data:t.template,field:this.component,panel:this});this.props.appendChild(n.dom),this.component.set(e,t.template),this.component.resizePanelWrap()};clearAllItems=()=>{const t="array"===this.type?[]:{},e={type:this.name,removeAction:()=>{this.component.set(this.name,t),this.updateProps()}};Ou.remove[this.name](e);const n=Or(this.name),o=new window.CustomEvent(`onRemove${n}`,{detail:e});document.dispatchEvent(o)};setData(t){this.data=t,this.component.set(this.name,t),this.updateProps()}}const Ad=Object.freeze({type:"field",displayType:"slider"}),Td=t=>({transform:`translateX(${t?`${t}px`:0})`});class Nd{constructor(t){this.opts=Vo(Ad,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const e=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const n=new window.ResizeObserver((([{contentRect:{width:t}}])=>{this.currentWidth!==t&&(this.toggleTabbedLayout(),this.currentWidth=t,this.nav.setTranslateX(this.activePanelIndex,!1))})),o=window.setTimeout((()=>{n.observe(e),window.clearTimeout(o)}),Hi)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(Uc.getStyle(t,"width"),10)>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||Ad.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const t=Uc.create({className:"panels",content:this.opts.panels.map((({config:t,...e})=>e))});return"field"===this.opts.type&&this.sortableProperties(t),this.panelsWrap=t,this.panels=t.children,this.currentPanel=this.panels[this.activePanelIndex],t}sortableProperties(t){const e=t.getElementsByClassName("field-edit-group");return Fc.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&lc.create(t,{animation:150,group:{name:`edit-${t.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:t=>{this.propertySave(t.to),this.resizePanels()}})}))}createPanelNavLabels(){const t=this.opts.panels.map((t=>({tag:"h5",action:{click:t=>{const e=jc(t.target);this.nav.setTranslateX(e,!1),this.nav.groupChange(e)}},content:t.config.label}))),e={className:"panel-labels",content:{content:t}},[n]=t;return n.className="active-tab",Uc.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:n.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:Uc.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:n.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:Uc.icon("triangle-left")};return Uc.create({tag:"nav",attrs:{className:"panel-nav"},content:[e,this.labels,t]})}get isTabbed(){return"tabbed"===this.panelDisplay}navActions(){const t={},e=this.currentPanel.parentElement,n=this.labels.firstChild,o=n.children,i=this.currentPanel.parentElement.childNodes;this.activePanelIndex=jc(this.currentPanel);let r={nav:0,panel:0},s={...r};t.groupChange=t=>(this.activePanelIndex=t,this.currentPanel=i[t],Uc.removeClasses(i,"active-panel"),Uc.removeClasses(o,"active-tab"),this.currentPanel.classList.add("active-panel"),o[t].classList.add("active-tab"),this.currentPanel);const a=({offset:t,reset:o,duration:i=Vi,animate:r=!this.isTabbed})=>{const a=[Td(s.panel),Td(t.panel)],l=[Td(s.nav),Td(this.isTabbed?0:t.nav)];if(o){const[t]=a,[e]=l;a.push(t),l.push(e)}const c={easing:"ease-in-out",duration:r?i:0,fill:"forwards"},d=e.animate(a,c);n.animate(l,c);const u=()=>{d.removeEventListener("finish",u),o||(s=t)};d.addEventListener("finish",u)};return t.setTranslateX=(t=this.activePanelIndex,o=!0)=>{var i;i=t,r={nav:-n.offsetWidth*i,panel:-e.offsetWidth*i},a({offset:r,animate:o})},t.refresh=(e=this.activePanelIndex)=>{this.activePanelIndex!==e&&t.groupChange(e),t.setTranslateX(this.activePanelIndex,!1),this.resizePanels()},t.nextGroup=()=>{const e=this.activePanelIndex+1;if(e!==i.length){const o=i[e];r={nav:-n.offsetWidth*e,panel:-o.offsetLeft},a({offset:r}),t.groupChange(e)}else r={nav:s.nav-8,panel:s.panel-8},a({offset:r,reset:!0});return this.currentPanel},t.prevGroup=()=>{if(0!==this.activePanelIndex){const e=this.activePanelIndex-1,o=i[e];r={nav:-n.offsetWidth*e,panel:-o.offsetLeft},a({offset:r}),t.groupChange(e)}else r={nav:8,panel:8},a({offset:r,reset:!0})},t}}let Pd=null;const jd=hs(ur);class Dd extends xa{constructor(t,e={}){const n={...e,id:e.id||qo()};super(t,n),this.id=n.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=t,this.indexName=`${t}s`,this.config=gu[`${this.name}s`].config,Vo(this.config,n.config),this.address=`${this.name}s.${this.id}`,this.dataPath=`${this.address}.`,this.editPanels=new Map,this.eventListeners=new Map,this.initEventHandlers()}initEventHandlers(){this.config.events&&Object.entries(this.config.events).forEach((([t,e])=>{this.addEventListener(t,e)}))}addEventListener(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,[]),this.eventListeners.get(t).push(e)}removeEventListener(t,e){if(!this.eventListeners?.has(t))return;const n=this.eventListeners.get(t),o=n.indexOf(e);o>-1&&n.splice(o,1)}dispatchComponentEvent(t,e={}){const n={component:this,target:this,type:t,timestamp:Date.now(),...e};return this.eventListeners?.has(t)&&this.eventListeners.get(t).forEach((t=>{try{"function"==typeof t&&t(n)}catch(e){}})),n}set(t,e){const n=this.get(t),o=super.set(t,e);return n!==e&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:t,oldValue:n,newValue:e}),o}get js(){return this.data}get json(){return this.data}remove=t=>{if(t){const e=Ar(t),n=e.pop(),o=this.get(e);return Array.isArray(o)?Pc(n)?o.splice(Number(n),1):this.set(e,o.filter((t=>t!==n))):delete o[n],o}if("stage"===this.name)return null;const e=this.parent,n=this.children;this.dispatchComponentEvent("onRemove",{path:t,parent:e,children:[...n]}),kc(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(gu.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths();const o={row:or,column:ir,field:rr}[this.name];return o&&Cu.formeoUpdated({componentId:this.id,componentType:this.name,parent:e},o),gu[`${this.name}s`].delete(this.id)};empty(){const t=this.children.map((t=>(t.remove(),t)));return this.dom.classList.add("empty"),t}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const t=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{gu.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),gu.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...Uc.btnTemplate({content:Uc.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>Uc.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&Uc.icon("component-corner",{className:"bottom-left"}),Uc.icon(`handle-${this.name}`),Or(this.name),(this.isColumn||this.isRow)&&Uc.icon("component-corner",{className:"bottom-right"})].filter(Boolean)});toggleEdit(t=!this.isEditing){this.isEditing=t;const e=this.dom,n="editing",o=`${n}-${this.name}`,i=this.dom.querySelector(`.${this.name}-edit`);Nc.slideToggle(i,qi,t),"field"===this.name&&(Nc.slideToggle(this.preview,qi,!t),e.parentElement.classList.toggle(`column-${o}`,t)),e.classList.toggle(n,t),e.classList.toggle(o,t)}get buttons(){if(this.actionButtons)return this.actionButtons;const t={handle:(t=`handle-${this.name}`)=>({...Uc.btnTemplate({content:Uc.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...Uc.btnTemplate({content:Uc.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...Uc.btnTemplate({content:Uc.icon(t)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(t="remove")=>({...Uc.btnTemplate({content:Uc.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{Nc.slideUp(this.dom,qi,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...Uc.btnTemplate({content:Uc.icon(t)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),"column"===this.name&&this.parent.autoColumnWidths()}}})},{buttons:e,disabled:n}=this.config.actionButtons,o=e.filter((t=>!n.includes(t))).map((e=>t[e]?.()||e));return this.actionButtons=o,this.actionButtons}get index(){return jc(this.dom)}removeClasses=t=>{const e={string:()=>this.dom.classList.remove(t),array:()=>t.map((t=>this.dom.classList.remove(t)))};return e.object=e.string,e[Uc.childType(t)](this.dom)};get parentType(){return Wi.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${ji[t]}`);return e&&Uc.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=Ri.get(this.name);return Lc(t,(t=>gu.getAddress(`${e}s.${t.id}`))).filter(Boolean)}loadChildren=(t=this.data.children)=>t.map((t=>this.addChild({id:t})));get domChildren(){const t=this.dom.querySelector(".children");return t?t.children:[]}addChild(t={},e=this.domChildren.length){let n=t;"object"!=typeof t&&(n={id:n});const o=this.dom.querySelector(".children"),{id:i=qo()}=n,r=Ri.get(this.name);if(!r)return null;const s=`${r}s`,a=gu.getAddress(`${s}.${i}`)||gu[s].add(i,n);e>=o.children.length?o.appendChild(a.dom):o.children[e].before(a.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:a,child:a,index:e}),a.dispatchComponentEvent("onAdd",{parent:this,target:a,index:e,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:a});const l=a.get("children");return l?.length&&a.loadChildren(l),this.removeClasses("empty"),this.saveChildOrder(),a}saveChildOrder=()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t};onAdd({from:t,to:e,item:n,newIndex:o}){t.classList.contains(fi)||(t=t.parentElement);const i=zo(t),r=zo(e.parentElement),s=new Map([[-2,()=>{const t=this.addChild({},o).addChild();return t.addChild.bind(t)}],[-1,()=>{const t=this.addChild({},o);return t.addChild.bind(t)}],[0,()=>this.addChild.bind(this)],[1,t=>{const e=jc(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),a={controls:async()=>{if(!Pd){const{default:t}=await Promise.resolve().then((()=>iu));Pd=t}const{controlData:{meta:{id:t},...e}}=Pd.get(n.id);us(e,"config.controlId",t);const i=t.startsWith("layout-")?t.replace(/^layout-/,""):"field",r=ds({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${i}`),a=s.get(r)();Uc.remove(n);return a(e,o)},row:()=>{const t=(s.get({stage:-1,row:0,column:1}[r])||Ko)();return t?.({id:n.id},o)},column:()=>{const t=(s.get({stage:-2,row:-1}[r])||Ko)();return t?.(n.id)}},l=a[i]?.(n,o);return this.dispatchComponentEvent("onAdd",{from:t,to:e,item:n,newIndex:o,fromType:i,toType:r,addedComponent:l,addedVia:"dragDrop"}),(()=>{this.saveChildOrder(),this.removeClasses("empty")})(),l}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:t}}){return t.classList.contains(vi)&&t.classList.remove("column-editing-field"),"stage"===this.name||this.children.length?(this.emptyClass(),this.saveChildOrder()):this.remove()}onEnd=({to:{parentElement:t},from:{parentElement:e}})=>{t?.classList.remove(`hovering-${zo(t)}`),e?.classList.remove(`hovering-${zo(e)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:t}=this.config;if(!t)return null;t.onRender&&Uc.onRender(this.dom,t.onRender)}set config(t){const e=ds(t,"all"),n=ds(this.data,"config.controlId"),o=[e,n&&ds(t,n),ds(t,this.id)].reduce(((t,e)=>e?Vo(t,e):t),this.configVal);this.configVal=o}get config(){return this.configVal}runConditions=()=>{const t=this.get("conditions");if(!t?.length)return null;return t.map((t=>{const e=this.processConditions(t.if),n=this.processResults(t.then);return e.map((t=>this.evaluateConditions(t)&&this.execResults(n)))}))};getComponent(t){const[e,n]=t.split("."),o=gu[e];return n===this.id?this:o?.get(n)}value=(t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!jd[i]].some(Boolean)?t:e?o.set(jd[i],e):o.get(jd[i])};getResult=t=>({"=":(t,e,n)=>t.set(e,n)}[t]);processResults=t=>t.map((({operator:t,target:e,value:n})=>{const o=this.getComponent(e);return{target:o,propertyPath:o&&e.split(".").slice(2,e.length).join("."),action:this.getResult(t),value:this.value(n)}}));execResults=t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)};execResult=({target:t,action:e,value:n,_propertyPath:o})=>new Promise(((o,i)=>{try{return o(e(t,n))}catch(r){return i(r)}}));cloneData=()=>{const t={...Ho(this.data),id:qo()};return"field"!==this.name&&(t.children=[]),t};clone=(t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),this.dispatchComponentEvent("onClone",{original:this,clone:e,parent:t}),e};cloneChildren(t){for(const e of this.children)e?.clone(t)}createChildWrap=t=>Uc.create({tag:"ul",attrs:{className:"children"},children:t});get isRow(){return this.name===Ni.row}get isColumn(){return this.name===Ni.column}get isField(){return this.name===Ni.field}isDisabledProp=(t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get("config.disabled")).includes(t)};isLockedProp=(t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get("config.locked")).includes(t)};get editWindow(){const t={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},e=this.editPanels.size;return e&&(t.className.push(`panel-count-${e}`),t.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),t.action={onRender:()=>{if(0===e){const t=this.dom.querySelector(".edit-toggle"),e=this.dom.querySelector(`.${this.name}-actions`),n=e.getElementsByTagName("button");e.style.maxWidth=n.length*n[0].clientWidth+"px",Uc.remove(t)}else this.resizePanelWrap()}},Uc.create(t)}updateEditPanels=()=>{if(!this.config)return null;const t=["object","array"],e=Uo([...this.config.panels.order,...Object.keys(this.data)]),n=["children","config","meta","action","events",...this.config.panels.disabled],o=e.filter((t=>!n.includes(t)));for(const r of o){const e=this.get(r),n=Uc.childType(e);if(t.includes(n)){const t=new _d(e,r,this);this.editPanels.set(t.name,t)}}const i={panels:Array.from(this.editPanels.values()).map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"};this.panels=new Nd(i),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class kd{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(t){const e=t.querySelector(".children");if(!e)return 0;const n=e.children.length,o=Uc.getStyle(e,"gap")||"0px",i=parseFloat(o,10)||0;return this.totalGapWidth=i*(n-1),e.offsetWidth-this.totalGapWidth}validateResizeTarget(t,e){return t&&e&&t.offsetWidth&&e.offsetWidth}onStart(t){if(t.preventDefault(),this.resized=!1,0!==t.button)return;const e=t.target.parentElement,n=e.nextSibling||e.previousSibling,o=e.closest(`.${gi}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(Ci),this.columnPreset=o.querySelector(`.${wi}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(vr,""),n.className=n.className.replace(vr,""),this.colStartWidth=e.offsetWidth,this.sibStartWidth=n.offsetWidth,this.rowWidth=this.getRowWidth(o),this.rowWidth<=0)this.cleanup();else{this.column=e,this.sibling=n,this.row=o;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(i){this.cleanup()}}else this.cleanup()}calculateNewWidths(t){const e=this.colStartWidth+t-this.startX,n=this.sibStartWidth-t+this.startX,o=parseFloat(Xo(e,this.rowWidth)),i=parseFloat(Xo(n,this.rowWidth));return o<10||i<10?null:{colWidth:Yo(o.toFixed(1)),siblingColWidth:Yo(i.toFixed(1))}}onMove(t){t.preventDefault();const{column:e,sibling:n}=this,o="touchmove"===t.type?t.touches[0].clientX:t.clientX,i=this.calculateNewWidths(o);if(!i)return;const{colWidth:r,siblingColWidth:s}=i;e.dataset.colWidth=r,n.dataset.colWidth=s,e.style.width=r,n.style.width=s,this.resized=!0}onStop(){const{column:t,sibling:e}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),gu.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),gu.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(Ci),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(Ci),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${yi}`);const n=this.row.querySelector(".children").children,o=Lc(n,(t=>Xo(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=Uc.create({tag:"option",attrs:{className:yi,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const Ld=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[Uc.icon("triangle-down"),Uc.icon("triangle-up")]}),$d=()=>({className:"column-edit group-config"});class Id extends Dd{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[vi]}),...t});const e=this.createChildWrap();this.dom=Uc.create({tag:"li",className:[vi,"empty"],dataset:{hoverTag:n.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),$d(),Ld(new kd),e]}),this.processConfig(),Cu.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),lc.create(e,{animation:150,fallbackClass:"field-moving",group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:t=>{t.from!==t.to&&t.from.classList.remove("hovering-column")},draggable:`.${bi}`,handle:".item-move"})}processConfig(){const t=Fc.get(this.data,"config.width");t&&this.setDomWidth(t)}refreshFieldPanels=()=>{for(const t of this.children)t.panels.nav.refresh()};setDomWidth=t=>{this.dom.dataset.colWidth=t,this.dom.style.width=t};setWidth=t=>(this.setDomWidth(t),this.set("config.width",t))}const Md={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const Rd=new class extends Oa{constructor(t){super("columns",t),this.config={all:Md}}Component(t){return new Id(t)}};class Fd extends Dd{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[gi]}),...t});const e=this.createChildWrap();this.dom=Uc.create({tag:"li",className:[gi,"empty"],dataset:{hoverTag:n.get("row"),editingHoverTag:n.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),lc.create(e,{animation:150,fallbackClass:"column-moving",group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${vi}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:n.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:n.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:n.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:n.get("row.makeInputGroup"),description:n.get("row.makeInputGroupDesc")}},o={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Title"},config:{label:{children:["Row Title",{tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}}]}},action:{input:({target:{value:t}})=>this.set("config.legend",t)},className:""}},i=Uc.formGroup([t,o]),r={tag:"label",content:n.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=Uc.create(this.columnPresetControlConfig);const s={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},a=[e,"hr",i,"hr",Uc.formGroup([r,s],"row")];return Uc.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=a.map((t=>Uc.create(t)));t.append(...e)}}})}onAdd(...t){super.onAdd(...t),this.autoColumnWidths()}onRemove(...t){super.onRemove(...t),this.autoColumnWidths()}autoColumnWidths=()=>{const t=this.children;if(!t.length)return;const e=Number.parseFloat((100/t.length).toFixed(1))/1;for(const n of t){n.removeClasses(vr);const t=n.dom,o=Yo(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),Vi);document.dispatchEvent(Cu.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>Uc.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)};setColumnWidths=t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))};get getColumnPresetOptions(){const t=this.children,e=Bi.get(t.length-1)||[],n=t.map((t=>{const e=t.get("config.width")||"";return Number(e.replace("%","")).toFixed(1)})).join(",");if(e.length){const t=e.slice();return!t.find((t=>t.value===n))&&t.push({value:n,label:n.replace(/,/g," | "),className:yi}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:n.get("defineColumnLayout"),className:wi},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const Wd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const Bd=new class extends Oa{constructor(t){super("rows",t),this.config={all:Wd}}Component(t){return new Fd(t)}};class zd extends Dd{constructor(t){super("stage",{conditions:[mr()],children:[],...t}),this.updateEditPanels(),this.debouncedUpdateEditPanels=Jo(this.updateEditPanels),n.get("Untitled Form"),n.get("Untitled Form"),n.get("Form Title"),n.get("Form novalidate"),n.get("Tags");const e=this.createChildWrap();this.dom=Uc.create({attrs:{className:[mi,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),lc.create(e,{animation:150,fallbackClass:"row-moving",group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{Ud.active=this},onSort:this.onSort.bind(this),draggable:`.${gi}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),Nc.slideUp(this.dom,qi,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),Nc.slideDown(this.dom,qi)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);"column"===e?.name&&e.parent.autoColumnWidths()}}const Ud=new class extends Oa{constructor(t){super("stages",t),this.config={all:{actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}}}}Component(t){return new zd(t)}},qd={js:new Set,css:new Set},Vd=(t,e,n=Qo)=>new Promise((o=>fetch(t).then((t=>{if(!t.ok)return o(n(t));o(e?e(t):t)})).catch((t=>n(t))))),Hd=(t,e)=>{t.removeEventListener("load",Hd),e(t.src)},Xd=(t,e)=>{t.removeEventListener("load",Xd),e(t.src)},Yd=t=>new Promise(((e,n)=>{if(qd.js.has(t))return e(t);qd.js.add(t);const o=Uc.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:t},action:{load:()=>Xd(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Gd=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(qd.css.has(t))return e(t);qd.css.add(t);const o=Uc.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Hd(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Zd=async(t=di)=>{if(document.getElementById(si))return;const e=async t=>(t=>{let e=document.getElementById(si);return e||(e=Uc.create({id:si,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e})(await t.text());return Vd(t,e,(()=>Vd(ui,e)))},Jd={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Yd(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Gd(t)));return Promise.all(e)}},Kd=t=>{const e=Object.entries(t).map((([t,e])=>Jd[t](e)));return Promise.all(e)},Qd=()=>{const t=document.getElementById(si);return"hidden"===window.getComputedStyle(t).visibility};class tu{controlCache=new Set;constructor({events:t={},dependencies:e={},controlAction:n,...o}){this.events=t,this.controlData=o,this.controlAction=n,this.dependencies=e,this.id=o.id||qo()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}get dom(){const{meta:t,config:e}=this.controlData,n=this.i18n(e.label)||e.label,o={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:Uc.icon(t.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:t})=>{const e=t.closest(`.${fi}`);return e&&ou.panels.nav.refresh(jc(e))},click:({target:t})=>{const e=t.closest(".field-control")?.id;e&&ou.addElement(e)}}};return Uc.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return Kd(this.dependencies)}i18n(t,e){const o=n.locale,i=this.definition?.i18n,r=i?.[o]||{};return(r[t]?.()??r[t])||n.get(t,e)}}const eu=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}});let nu=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${fi}`);return e&&this.panels.nav.refresh(jc(e))},click:({target:t})=>{this.addElement(t.parentElement.id)}}}async init(t,e=!1){return await this.applyOptions(t),this.buildDOM(e),this}registerControls(t){return this.controls=[],t.map((t=>{const e="function"==typeof t?new t:new tu(t);return this.add(e),this.controls.push(e.dom),e.promise()}))}groupLabel=t=>n.get(t)||t||"";groupElements(){let t=this.options.groups.slice(),e=this.controls.slice(),n=[];const o=[];return t=Dc(t,this.groupOrder,"id"),t=t.filter((t=>Bo(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:[fi,pi],id:`${t.id}-${fi}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=Uo(e.concat(t.elementOrder));t.elementOrder=n}return e=Dc(e,t.elementOrder,"meta.id"),n.content=e.filter((e=>{const{controlData:n}=this.get(e.id),i=n.meta.id||"";let r=!0;return r=[Bo(i,this.options.disable.elements),n.meta.group===t.id,!o.includes(i)].every((t=>!0===t)),r&&o.push(i),r})),n})),n}add(t=Object.create(null)){const e=Ho(t);return this.data.set(e.id,e),e.controlData.meta.id&&this.data.set(e.controlData.meta.id,e.controlData),e}get(t){return Ho(this.data.get(t))}formActions(){if(!0===this.options.disable.formActions)return null;const t={...Uc.btnTemplate({content:[Uc.icon("bin"),n.get("clear")],title:n.get("clearAll")}),className:["clear-form"],action:{click:t=>{Bd.size?(Cu.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:n.get("confirmClearAll"),clearAllAction:()=>{Ud.clearAll().then((()=>{const e={src:t.target};Cu.formeoCleared(e)}))},btnCoords:Uc.coords(t.target)}}),document.dispatchEvent(Cu.confirmClearAll)):window.alert(n.get("cannotClearFields"))}}},e={...Uc.btnTemplate({content:[Uc.icon("floppy-disk"),n.get("save")],title:n.get("save")}),className:["save-form"],action:{click:async({target:t})=>{const{default:e}=await Promise.resolve().then((()=>vu)),{formData:n}=e,o={action:()=>{},coords:Uc.coords(t),message:"",button:t};return Ou.click.btn(o),Ou.save.form(n)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:t,saveBtn:e}).reduce(((t,[e,n])=>(this.options.disable.formActions.includes(e)||t.push(n),t)),[])}}buildDOM(t){const e=this.groupElements(),o=this.formActions(),{displayType:i}=this.options.panels;this.panels=new Nd({panels:e,type:"controls",displayType:i});const r=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],s=Uc.create({className:r,content:[this.panels.panelNav,this.panels.panelsWrap]}),a=["formeo-controls"];t&&a.push("formeo-sticky");const l=Uc.create({className:a,content:[s,o]}),c=l.getElementsByClassName("control-group");this.dom=l,this.groups=c;const[d]=c;this.currentGroup=d,this.actions={filter:t=>{const e=""!==t,o=this.controls;let i=s.querySelector(".filtered-term");if(Uc.toggleElementsByStr(o,t),e){const e=n.get("controls.filteringTerm",t);l.classList.add("filtered"),i?i.textContent=e:(i=Uc.create({tag:"h5",className:"filtered-term",content:e}),s.insertBefore(i,s.firstChild))}else i&&(l.classList.remove("filtered"),i.remove())},addElement:this.addElement,addGroup:t=>{}};for(let n=c.length-1;n>=0;n--){const t=`formeo-controls-${c[n]}`;this.options.sortable||window.localStorage.removeItem(t),lc.create(c[n],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:async({item:t})=>{const{controlData:e}=this.get(t.id);if(this.options.ghostPreview){const{default:n}=await Promise.resolve().then((()=>lu));t.innerHTML="",t.appendChild(new n(e).preview)}},onEnd:({from:t,item:e,clone:n})=>{t.contains(n)&&t.replaceChild(e,n)},sort:this.options.sortable,store:{get:()=>{const e=window.localStorage.getItem(t);return e?e.split("|"):[]},set:e=>{const n=e.toArray();window.localStorage.setItem(t,n.join("|"))}}})}return l}layoutTypes={row:()=>Ud.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:t=>this.layoutTypes.column().addChild(t)};addElement=t=>{const{meta:{group:e,id:n},...o}=ds(this.get(t),"controlData");return us(o,"config.controlId",n),"layout"===e?this.layoutTypes[n.replace("layout-","")]():this.layoutTypes.field(o)};applyOptions=async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=Vo(eu,t);this.container=e,this.groupOrder=Uo(o.concat(["common","html","layout"])),this.options=i;const[r,s,a]=await Promise.all([Promise.resolve().then((()=>Uu)),Promise.resolve().then((()=>Xu)),Promise.resolve().then((()=>Ju))]),l=[r.default,s.default,a.default].flat();return Promise.all(this.registerControls([...l,...n]))}};const ou=new nu,iu=Object.freeze(Object.defineProperty({__proto__:null,Controls:nu,default:ou},Symbol.toStringTag,{value:"Module"})),ru=new Set(["checkbox","radio"]),su=new Set(["radio","checkbox","select-one","select-multiple"]);class au extends Dd{constructor(t=Object.create(null)){super("field",{...t}),this.debouncedUpdateEditPanels=Jo(this.updateEditPanels),this.debouncedUpdatePreview=Jo(this.updatePreview),this.label=Uc.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const e=this.getActionButtons(),o=this.actionButtons.some((t=>"edit"===t.meta?.id));this.updateEditPanels();const i=Uc.create({tag:"li",attrs:{className:bi},id:this.id,children:[this.label,this.getComponentTag(),e,o&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:n.get("field")}});this.dom=i,this.isEditing=!1}get labelConfig(){if(!!this.get("config.hideLabel"))return null;const t=this.get("config.editorLabel")||this.get("config.label"),e=this.get("attrs.required"),n=this.config.label.disableHTML;return{className:"prev-label",children:[{...(()=>{const e={tag:"label",attrs:{}};return n?(e.tag="input",e.attrs.value=t,e):(e.attrs.contenteditable=!0,e.children=t,e)})(),action:{input:({target:{innerHTML:t,innerText:e}})=>{super.set("config.label",n?e:t)}}},e&&Uc.requiredMark()]}}setData=(t,e)=>super.set(t,e);set(t,e){const n=this.setData(t,e);return this.debouncedUpdatePreview(),n}updateLabel(){if(!this.label)return null;const t=Uc.create(this.labelConfig);this.label.replaceWith(t),this.label=t}updatePreview=()=>{this.updateLabel();const t=this.fieldPreview();this.preview.replaceWith(t),this.preview=t};get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{type:n}=e;if(su.has(n)){const t=this.preview.querySelectorAll(":checked"),e=this.get("options"),n=void 0!==e?.[0]?.selected?"selected":"checked",o=e.reduce(((t,e)=>(t[e.value]=e,t[e.value][n]=!1,t)),{});for(const i of t)o[i.value][n]=i.value===o[i.value].value;return super.set("options",Object.values(o)),this.debouncedUpdateEditPanels()}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:({target:t})=>{if(["input","meter","progress","button"].includes(t.tagName.toLowerCase()))return super.set("attrs.value",t.value),this.debouncedUpdateEditPanels();if(t.contentEditable&&!t.type?.startsWith("select-")){const e=t.parentElement.classList;if(e.contains("f-checkbox")||e.contains("f-radio")){const e=t.parentElement,n=jc(e);return this.setData(`options[${n}].label`,t.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",t.innerHTML||t.value)}}}}fieldPreview(){const{action:t={},...e}=Ho(this.data);e.id=`prev-${this.id}`,e.action=Object.entries(t).reduce(((t,[e,n])=>(t[e]=n.bind(this),t)),{}),this.data?.config.editableContent&&(e.attrs={...e.attrs,contenteditable:!0});const n={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:Uc.create(e,!0),action:this.defaultPreviewActions};return Uc.create(n,!0)}get isCheckable(){return ru.has(this.get("config.controlId"))}}const lu=Object.freeze(Object.defineProperty({__proto__:null,default:au},Symbol.toStringTag,{value:"Module"}));const cu=new class extends Oa{constructor(t){super("fields",t),this.config={all:{actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}}}}Component(t){return new au(t)}get=t=>{let e=t&&ds(this.data,t);if(!e){const n=ou.get(t);n&&(e=this.add(null,n.controlData))}return e};getData=()=>Object.entries(this.data).reduce(((t,[e,n])=>{const{conditions:o,...i}=n?.getData()||n;if(o?.length){let t=!0;if(1===o.length){const[e]=o;t=Boolean(e.if[0].source)}t&&(i.conditions=o)}return t[e]=i,t}),{});load=(t=Object.create(null))=>{const e=ti(t);this.empty();for(const[n,o]of Object.entries(e)){const{meta:t,...e}=o;t?.id&&us(e,"config.controlId",t?.id),this.add(n,e)}return this.data}},du=Ud,uu=Bd,hu=Rd,pu=cu,fu=ou;class mu extends xa{constructor(){super("components"),this.disableEvents=!0,this.stages=du,this.rows=uu,this.columns=hu,this.fields=pu,this.controls=fu}load=(t,e)=>{this.empty();const n=((t,e=!1)=>t?Ho(ti(t)):e&&Go.get(zi)||yr())(t,e.sessionStorage);this.opts=e,this.set("id",n.id),this.add("stages",du.load(n.stages)),this.add("rows",uu.load(n.rows)),this.add("columns",hu.load(n.columns)),this.add("fields",pu.load(n.fields));for(const o of Object.values(this.get("stages")))o.loadChildren();return this.data};flatList(){const t={};for(const e of Object.keys(this.data.stages))ni(this.data,e,"stages",t);return t}getChildData=({type:t,id:e})=>{const n=this.get(t,e);if(n)return n.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${ii}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:Ud.getData(),rows:Bd.getData(),columns:Rd.getData(),fields:cu.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;du.config=e,uu.config=n,hu.config=o,pu.config=i}getIndex(t){return this[t]||this[Ti.get(t)]}setAddress(t,e){if(!Zo(t))return;const[n,o,...i]=Array.isArray(t)?t:Ar(t),r=this.getIndex(n).get(o);return r?.set(i,e),r}getAddress(t){if(!Zo(t))return;const[e,n,...o]=Array.isArray(t)?t:Ar(t),i=this.getIndex(e).get(n);return!o.length||i?o.length?i.get(o):i:void 0}}const gu=new mu,vu=Object.freeze(Object.defineProperty({__proto__:null,Columns:hu,Components:mu,Controls:fu,Fields:pu,Rows:uu,Stages:du,default:gu},Symbol.toStringTag,{value:"Module"})),bu="no-transition",yu={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onChange:t=>Cu.opts?.debug&&void 0,onUpdate:t=>Cu.opts?.debug&&void 0,onUpdateStage:t=>Cu.opts?.debug&&void 0,onUpdateRow:t=>Cu.opts?.debug&&void 0,onUpdateColumn:t=>Cu.opts?.debug&&void 0,onUpdateField:t=>Cu.opts?.debug&&void 0,onAddRow:t=>Cu.opts?.debug&&void 0,onAddColumn:t=>Cu.opts?.debug&&void 0,onAddField:t=>Cu.opts?.debug&&void 0,onRemoveRow:t=>Cu.opts?.debug&&void 0,onRemoveColumn:t=>Cu.opts?.debug&&void 0,onRemoveField:t=>Cu.opts?.debug&&void 0,onRender:t=>Cu.opts?.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},wu=({src:t,...e},n=Yi)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:Cu.opts?.debug||Cu.opts?.bubbles});if(o.data=(t||document).dispatchEvent(o),n===Yi){const n=new window.CustomEvent("formeoChanged",{detail:e,bubbles:Cu.opts?.debug||Cu.opts?.bubbles});(t||document).dispatchEvent(n)}return o},Cu={init:function(t){return this.opts={...yu,...t},this},formeoSaved:t=>wu(t,Xi),formeoUpdated:(t,e)=>wu(t,e||Yi),formeoCleared:t=>wu(t,"formeoCleared"),formeoOnRender:t=>wu(t,Qi),formeoConditionUpdated:t=>wu(t,"formeoConditionUpdated"),formeoAddedRow:t=>wu(t,tr),formeoAddedColumn:t=>wu(t,er),formeoAddedField:t=>wu(t,nr),formeoRemovedRow:t=>wu(t,or),formeoRemovedColumn:t=>wu(t,ir),formeoRemovedField:t=>wu(t,rr)},Eu=function(t,e=Hi){let n=0;return function(...o){const i=Date.now();i-n>=e&&(n=i,t.apply(this,o))}}((()=>{const t={timeStamp:window.performance.now(),type:Yi,detail:gu.formData};Cu.opts.onUpdate(t),Cu.opts.onChange!==Cu.opts.onUpdate&&Cu.opts.onChange(t)}),Vi);let Su;document.addEventListener(Yi,Eu),document.addEventListener(Gi,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onUpdate(i),Cu.opts.onUpdateStage(i)})),document.addEventListener(Zi,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onUpdate(i),Cu.opts.onUpdateRow(i)})),document.addEventListener(Ji,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onUpdate(i),Cu.opts.onUpdateColumn(i)})),document.addEventListener(Ki,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onUpdate(i),Cu.opts.onUpdateField(i)})),document.addEventListener(tr,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onAddRow(i)})),document.addEventListener(er,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onAddColumn(i)})),document.addEventListener(nr,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onAddField(i)})),document.addEventListener(or,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onRemoveRow(i)})),document.addEventListener(ir,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onRemoveColumn(i)})),document.addEventListener(rr,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Cu.opts.onRemoveField(i)})),document.addEventListener(Qi,(t=>{const{timeStamp:e,type:n,detail:o}=t;Cu.opts.onRender({timeStamp:e,type:n,detail:o})})),document.addEventListener("confirmClearAll",(t=>{t={timeStamp:t.timeStamp,type:t.type,confirmationMessage:t.detail.confirmationMessage,clearAllAction:t.detail.clearAllAction,btnCoords:t.detail.btnCoords},Cu.opts.confirmClearAll(t)})),document.addEventListener(Xi,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};Cu.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{Cu.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){Su=Su||window.requestAnimationFrame((()=>{Su=!1;for(const t of Object.values(hu.data))t.dom.classList.add(bu),fu.dom.classList.add(bu),fu.panels.nav.refresh(),t.refreshFieldPanels()}))}));const xu={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(n.get("attributeNotPermitted",e||"")),Ou.add.attrs(t);let o;e&&(o=String(window.prompt(t.message.value,"")),t.addAction(e,o))},option:t=>{t.addAction()},condition:t=>{t.addAction(t)}},remove:{attrs:t=>{t.removeAction()},options:t=>{t.removeAction()},conditions:t=>{t.removeAction()}},click:{btn:t=>{t.action()}},save:{form:Ko}},Ou={init:function(t){const e=Object.keys(xu);return this.opts=e.reduce(((e,n)=>(e[n]={...xu[n],...t[n]},e)),t),this},add:{attrs:t=>Ou.opts.add.attr(t),options:t=>Ou.opts.add.option(t),conditions:t=>(t.template=t.template||mr(),Ou.opts.add.condition(t))},remove:{attrs:t=>Ou.opts.remove.attrs(t),options:t=>Ou.opts.remove.options(t),conditions:t=>Ou.opts.remove.conditions(t)},click:{btn:t=>Ou.opts.click.btn(t)},save:{form:t=>(Ou.opts.sessionStorage&&Go.set(zi,t),Cu.formeoSaved({formData:t}),Ou.opts.save.form(t))}};n.addLanguage("en-US",void 0);const _u={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:di,style:hi,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Rc(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}};let Au=class{constructor({formData:t,...e},n){const o=Vo(_u.editor,e),{actions:i,events:r,debug:s,config:a,editorContainer:c,...d}=o;c&&(this.editorContainer="string"==typeof c?document.querySelector(c):c),this.opts=d,Uc.setOptions=d,gu.config=a,this.userFormData=n||t,this.Components=gu,this.dom=Uc,Cu.init({debug:s,...r}),Ou.init({debug:s,sessionStorage:d.sessionStorage,...i}),this.tooltip=new l,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(t={}){this.userFormData=ei(t),this.load(this.userFormData,this.opts)}loadData(t={}){this.formData=t}get json(){return this.Components.json}clear(){this.userFormData=yr(),this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources);const t=[];this.opts.polyfills&&(t=>{const e=Array.isArray(t)?ai.filter((({name:e})=>-1!==t.indexOf(e))):ai;Promise.all(e.map((({src:t})=>Yd(t))))})(this.opts.polyfills),await Zd(this.opts.svgSprite),t.push((async t=>{if(!Qd()&&(await Gd(t),!Qd()))return await Gd("https://draggable.github.io/formeo/assets/css/formeo.min.css")})(this.opts.style)),t.push(n.init({...this.opts.i18n,locale:window.sessionStorage?.getItem(Ui)}));const e=await Promise.all(t);return this.opts.allowEdit&&this.init(),e}init(){return ou.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=gu.get("id"),this.i18n={setLang:t=>{window.sessionStorage?.setItem(Ui,t);n.setCurrent(t).then((()=>{this.init()}),console.error)}},this.opts.onLoad?.(this)}))}load(t=this.userFormData,e=this.opts){this.Components.load(t,e),this.render()}render(){if(!this.controls)return window.requestAnimationFrame((()=>this.render()));if(this.stages=Object.values(gu.get("stages")),this.opts.controlOnLeft)for(const e of this.stages)e.dom.style.order=1;const t={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map((({dom:t})=>t))]};n.current.dir&&(t.attrs.dir=n.current.dir,Uc.dir=n.current.dir),this.editor=Uc.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(Uc.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Cu.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Cu.formeoLoaded)}};const Tu="f-",Nu=t=>"string"==typeof t?document.querySelector(t):t,Pu=t=>{const e=t.match(gr);return e?.[0]||t``},ju=t=>{if(!t)return!1;if(t.hasAttribute("hidden")||t.parentElement.hasAttribute("hidden"))return!1;const e=window.getComputedStyle(t);return!("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)},Du={isChecked:t=>t.checked,isNotChecked:t=>!t.checked,value:t=>t.value,isVisible:t=>ju(t),isNotVisible:t=>!ju(t)},ku={equals:Ea,notEquals:(t,e)=>!Ea(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},Lu=Object.entries(sr).reduce(((t,[e,n])=>(t[n]=ku[e],t[e]=ku[e],t)),{}),$u={equals:(t,{targetProperty:e,value:n})=>{t[`_${e}`]=t[e],t[e]=n}},Iu=Object.entries(ar).reduce(((t,[e,n])=>(t[n]=$u[e],t[e]=$u[e],t)),{}),Mu={isChecked:t=>{t.checked=!0},isNotChecked:t=>{t.checked=!1},value:(t,{assignment:e,...n})=>{const o=Iu[e]?.(t,n),i=new Event("input",{bubbles:!0});return t.dispatchEvent(i),o},isNotVisible:t=>{void 0===t?._required&&(t._required=t.required),t.parentElement.setAttribute("hidden",!0),t.required=!1},isVisible:t=>{t.parentElement.removeAttribute("hidden"),t.required=t._required}};let Ru=class{constructor(t,e){const{renderContainer:n,elements:o,formData:i}=(({editorContainer:t,renderContainer:e,formData:n,...o})=>({elements:{},...o,renderContainer:Nu(e),editorContainer:Nu(t),formData:ei(n)}))(t);this.container=n,this.form=ei(e||i),this.dom=Uc,this.components=Object.create(null),this.elements=o}get formData(){return this.form}set formData(t){this.form=ei(t)}get userData(){const t=new FormData(this.renderedForm),e={};for(const[n,o]of t.entries())e[n]?Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]:e[n]=o;return e}set userData(t={}){const e=this.container.querySelector("form");for(const n of Object.keys(t)){const o=e.elements[n];if(o.length&&"checkbox"===o[0].type){const e=Array.isArray(t[n])?t[n]:[t[n]];for(const t of o)t.checked=e.includes(t.value)}else if(o.length&&"radio"===o[0].type)for(const e of o)e.checked=e.value===t[n];else o.type&&(o.value=t[n])}}render(t=this.form){const e=this.getRenderedForm(t),n=this.container.querySelector(".formeo-render");n?n.replaceWith(e):this.container.appendChild(e)}getRenderedForm(t=this.form){this.form=ei(t);const e=document.getElementsByClassName("formeo-render").length,n={tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${e}`,children:this.processedData};return this.renderedForm=Uc.render(n),this.applyConditions(),this.renderedForm}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]);prefixId=t=>Tu+t;processColumn=({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`});processRows=t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]);cacheComponent=t=>(this.components[Pu(t.id)]=t,t);processRow=(t,e="row")=>{const{config:n,id:o}=t,i=[`formeo-${e}-wrap`],r={...t,children:this.processColumns(t.id),id:this.prefixId(o)};this.cacheComponent(r);const s=[{condition:n.legend,result:()=>({tag:n.fieldset?"legend":"h3",children:n.legend})},{condition:!0,result:()=>r},{condition:n.inputGroup,result:()=>this.addButton(o)}].reduce(((t,{condition:e,result:n})=>(e&&t.push(n()),t)),[]);return n.inputGroup&&i.push(`${Tu}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:i,children:s}};cloneComponentData=t=>{const{children:e=[],id:n,...o}=this.components[t];return{...o,id:qo(n),children:e?.length&&e.map((({id:t})=>this.cloneComponentData(Pu(t))))}};addButton=t=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=Uc.create(this.cloneComponentData(t));n.insertBefore(o,n.lastChild);const i=Uc.create(Uc.btnTemplate({className:"remove-input-group",children:Uc.icon("remove"),action:{mouseover:({target:t})=>t.parentElement.classList.add("will-remove"),mouseleave:({target:t})=>t.parentElement.classList.remove("will-remove"),click:({target:t})=>t.parentElement.remove()}}));o.appendChild(i)}}});processColumns=t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t))));processFields=t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const n=e.config?.controlId||e.meta?.id,{action:o={},dependencies:i={}}=this.elements[n]||{};i&&Kd(i);const r=Vo({action:o},e);return this.cacheComponent({...r,id:this.prefixId(t)})}));get processedData(){return Object.values(this.form.stages).map((t=>(t.children=this.processRows(t.id),t.className=mi,this.components[Pu(t.id)]=t,t)))}handleComponentCondition=(t,e,n)=>{if(t.length){for(const o of t)this.handleComponentCondition(o,e,n);return}const o=Fu(t);o&&t.addEventListener(o,(t=>{if(this.evaluateCondition(e,t))for(const e of n)this.execResult(e,t)}),!1);const i={target:t};if(this.evaluateCondition(e,i))for(const r of n)this.execResult(r,i)};applyConditions=()=>{for(const{conditions:t}of Object.values(this.components))if(t)for(const e of t){const{if:t,then:n}=e;for(const e of t){const{source:t,target:o}=e;if(Zo(t)){const{component:o,options:i}=this.getComponent(t),r=i||o;this.handleComponentCondition(r,e,n)}if(Zo(o)){const{component:t,options:i}=this.getComponent(o),r=i||t;this.handleComponentCondition(r,e,n)}}}};evaluateCondition=({source:t,sourceProperty:e,targetProperty:n,comparison:o,target:i})=>{const r=this.getComponentProperty(t,e);if("boolean"==typeof r)return r;const s=String(Zo(i)?this.getComponentProperty(i,n):i);return Lu[o]?.(r,s)};execResult=({target:t,targetProperty:e,assignment:n,value:o})=>{if(Zo(t)){const{component:i,option:r}=this.getComponent(t),s=r||i;Mu[e]?.(s,{targetProperty:e,assignment:n,value:o})}};getComponentProperty=(t,e)=>{const{component:n,option:o}=this.getComponent(t),i=o||n;return Du[e]?.(i)||i[e]};getComponent=t=>{const e={component:null};if(!Zo(t))return null;const[,n,o,i]=Ar(t),r=this.renderedForm.querySelector(`#${Tu}${n}`);if(!r)return e;if(e.component=r,o){const t=r.querySelectorAll("input"),n=t[i];return e.options=t,e.option=n,e}return e};getComponents=t=>{const e=[],n=t.slice(t.indexOf(".")+1);return e.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),e}};const Fu=t=>{const[e]=[["input",t=>["textarea","text"].includes(t.type)],["change",t=>["select"].includes(t.tagName.toLowerCase())||["checkbox","radio"].includes(t.type)]].find((e=>e[1](t)))||[!1];return e};void 0!==window&&(window.FormeoEditor=Au,window.FormeoRenderer=Ru);const Wu=Au,Bu=Ru,zu=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}],Uu=Object.freeze(Object.defineProperty({__proto__:null,default:zu},Symbol.toStringTag,{value:"Module"})),qu=["button","submit","reset"].map((t=>({label:t,value:t})));qu[0].selected=!0;const Vu=({type:t,isMultiple:e=!1,count:o=3})=>Array.from({length:o},((t,e)=>e+1)).map((o=>{const i="checkbox"===t||e?"checked":"selected";return{label:n.get("labelCount",{label:Or(t),count:o}),value:`${t}-${o}`,[i]:!o}}));const Hu=[class extends tu{constructor(t={}){const e={tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:n.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:n.get("button"),type:qu,className:[{label:"default",value:"",selected:!0},{label:"primary",value:"primary"},{label:"danger",value:"error"},{label:"success",value:"success"},{label:"warning",value:"warning"}]}]};super(Vo(e,t))}},class extends tu{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:n.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends tu{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:n.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends tu{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:n.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends tu{constructor(){super({tag:"textarea",config:{label:n.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends tu{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:n.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends tu{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:n.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends tu{constructor(t={}){const e={tag:"select",config:{label:n.get("controls.form.select")},attrs:{required:!1,className:"",multiple:!1},meta:{group:"common",icon:"select",id:"select"},options:Vu({type:"option",isMultiple:t.attrs?.multiple})};super(Vo(e,t))}},class extends tu{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:n.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:Vu({type:"checkbox",count:1})})}},class extends tu{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:n.get("controls.form.radio-group"),disabled:["attrs.type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:Vu({type:"radio"})})}}],Xu=Object.freeze(Object.defineProperty({__proto__:null,default:Hu},Symbol.toStringTag,{value:"Module"})),Yu=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),Gu="controls.html.header";const Zu=[class extends tu{constructor(){super({tag:Yu[0],attrs:{tag:Yu.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:n.get(Gu),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:n.get(Gu),action:{}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(Gu)}},class extends tu{constructor(){super({tag:"p",attrs:{className:""},config:{label:n.get("controls.html.paragraph"),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"paragraph",id:"paragraph"},content:"Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment."})}},class extends tu{constructor(){super({tag:"hr",config:{label:n.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends tu{constructor(t){super(Vo({tag:"textarea",config:{label:"WYSIWYG",editableContent:!0},meta:{group:"html",icon:"rich-text",id:"tinymce"},attrs:{required:!1},dependencies:{js:"https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"},action:{onRender:t=>{const e=`#${t.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}},controlAction:{click:()=>{},onRender:()=>{}}},t))}}],Ju=Object.freeze(Object.defineProperty({__proto__:null,default:Zu},Symbol.toStringTag,{value:"Module"}));exports.FormeoEditor=Wu,exports.FormeoRenderer=Bu;
|