formeo 2.1.7 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 2.1.6
4
+ Version: 2.2.0
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
8
- "use strict";var t=Object.defineProperty,e=(e,n,o)=>((e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o)(e,"symbol"!=typeof n?n+"":n,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class o{constructor(t=n){this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}processConfig(t){const{location:e,...o}={...n,...t},i=e.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,e={}){e="string"==typeof e?o.processFile(e):e,this.applyLanguage(t,e),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 o.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,e=!0){const n=this;return new Promise((function(i,r){if(-1!==n.loaded.indexOf(t)&&e)return n.applyLanguage(n.langs[t]),i(n.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}}([n.config.location,t,n.config.extension].join("")).then((e=>{const r=o.processFile(e);return n.applyLanguage(t,r),n.loaded.push(t),i(n.langs[t])})).catch((e=>{const o=n.applyLanguage(t);i(o)}))}))}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 i=new o,r="formeo",s=[{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"}],a="control-group",l=`${r}-stage`,c=`${r}-row`,d=`${r}-column`,h=`${r}-field`,u="custom-column-widths",p="column-preset",m="resizing-columns",g=new Map([[l,c],[c,d],[d,h]]),f=["external","stages","rows","columns","fields"],v=["stage","row","column","field"].reduce(((t,e)=>({...t,[e]:e})),{}),b=[{name:"controls",className:a},{name:"stage",className:l},{name:"row",className:c},{name:"column",className:d},{name:"field",className:h}],y={controls:a,stage:l,row:c,column:d,field:h},w=Object.entries(y).reduce(((t,[e,n])=>({...t,[n]:e})),{}),x=Object.values(y),C=new RegExp(`${x.join("|")}`,"g"),S=b.map((({name:t},e,n)=>{const{name:o}=n[e+1]||{};return o&&[t,o]})).filter(Boolean),E=S.slice().map((t=>t.slice().reverse())).reverse(),O=new Map(S),_=new Map(E.slice()),M=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)),[])),N=[{type:"added",condition:(t,e)=>Boolean(void 0===t&&e)}],A=`${r}-formData`,j=`${r}-locale`,k=333,D=Math.round(166.5),P=Math.round(666),z="formeoSaved",T="formeoUpdated",L="formeoOnRender",$=["label","logical","source","thenTarget","sourceProperty","comparison","target","targetProperty","assignment","value"],H={value:"attrs.value",checked:"attrs.checked",isVisible:"config.isVisible",isNotVisible:"config.isNotVisible"},V={comparison:{equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},assignment:{equals:"="},logical:{and:"&&",or:"||"},property:H},I=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)/gi,F=/\bcol-\w+-\d+/g,B="f-i-";var R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function W(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var q=function(){this.__data__=[],this.size=0};var U=function(t,e){return t===e||t!=t&&e!=e},X=U;var G=function(t,e){for(var n=t.length;n--;)if(X(t[n][0],e))return n;return-1},Y=G,Z=Array.prototype.splice;var J=G;var K=G;var Q=G;var tt=q,et=function(t){var e=this.__data__,n=Y(e,t);return!(n<0)&&(n==e.length-1?e.pop():Z.call(e,n,1),--this.size,!0)},nt=function(t){var e=this.__data__,n=J(e,t);return n<0?void 0:e[n][1]},ot=function(t){return K(this.__data__,t)>-1},it=function(t,e){var n=this.__data__,o=Q(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function rt(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])}}rt.prototype.clear=tt,rt.prototype.delete=et,rt.prototype.get=nt,rt.prototype.has=ot,rt.prototype.set=it;var st=rt,at=st;var lt=function(){this.__data__=new at,this.size=0};var ct=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};var dt=function(t){return this.__data__.get(t)};var ht=function(t){return this.__data__.has(t)},ut="object"==typeof R&&R&&R.Object===Object&&R,pt=ut,mt="object"==typeof self&&self&&self.Object===Object&&self,gt=pt||mt||Function("return this")(),ft=gt.Symbol,vt=ft,bt=Object.prototype,yt=bt.hasOwnProperty,wt=bt.toString,xt=vt?vt.toStringTag:void 0;var Ct=function(t){var e=yt.call(t,xt),n=t[xt];try{t[xt]=void 0;var o=!0}catch(r){}var i=wt.call(t);return o&&(e?t[xt]=n:delete t[xt]),i},St=Object.prototype.toString;var Et=Ct,Ot=function(t){return St.call(t)},_t=ft?ft.toStringTag:void 0;var Mt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":_t&&_t in Object(t)?Et(t):Ot(t)};var Nt=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},At=Mt,jt=Nt;var kt,Dt=function(t){if(!jt(t))return!1;var e=At(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Pt=gt["__core-js_shared__"],zt=(kt=/[^.]+$/.exec(Pt&&Pt.keys&&Pt.keys.IE_PROTO||""))?"Symbol(src)_1."+kt:"";var Tt=function(t){return!!zt&&zt in t},Lt=Function.prototype.toString;var $t=function(t){if(null!=t){try{return Lt.call(t)}catch(e){}try{return t+""}catch(e){}}return""},Ht=Dt,Vt=Tt,It=Nt,Ft=$t,Bt=/^\[object .+?Constructor\]$/,Rt=Function.prototype,Wt=Object.prototype,qt=Rt.toString,Ut=Wt.hasOwnProperty,Xt=RegExp("^"+qt.call(Ut).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Gt=function(t){return!(!It(t)||Vt(t))&&(Ht(t)?Xt:Bt).test(Ft(t))},Yt=function(t,e){return null==t?void 0:t[e]};var Zt=function(t,e){var n=Yt(t,e);return Gt(n)?n:void 0},Jt=Zt(gt,"Map"),Kt=Zt(Object,"create"),Qt=Kt;var te=function(){this.__data__=Qt?Qt(null):{},this.size=0};var ee=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ne=Kt,oe=Object.prototype.hasOwnProperty;var ie=function(t){var e=this.__data__;if(ne){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return oe.call(e,t)?e[t]:void 0},re=Kt,se=Object.prototype.hasOwnProperty;var ae=Kt;var le=te,ce=ee,de=ie,he=function(t){var e=this.__data__;return re?void 0!==e[t]:se.call(e,t)},ue=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ae&&void 0===e?"__lodash_hash_undefined__":e,this};function pe(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])}}pe.prototype.clear=le,pe.prototype.delete=ce,pe.prototype.get=de,pe.prototype.has=he,pe.prototype.set=ue;var me=pe,ge=st,fe=Jt;var ve=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var be=function(t,e){var n=t.__data__;return ve(e)?n["string"==typeof e?"string":"hash"]:n.map},ye=be;var we=be;var xe=be;var Ce=be;var Se=function(){this.size=0,this.__data__={hash:new me,map:new(fe||ge),string:new me}},Ee=function(t){var e=ye(this,t).delete(t);return this.size-=e?1:0,e},Oe=function(t){return we(this,t).get(t)},_e=function(t){return xe(this,t).has(t)},Me=function(t,e){var n=Ce(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function Ne(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])}}Ne.prototype.clear=Se,Ne.prototype.delete=Ee,Ne.prototype.get=Oe,Ne.prototype.has=_e,Ne.prototype.set=Me;var Ae=Ne,je=st,ke=Jt,De=Ae;var Pe=st,ze=lt,Te=ct,Le=dt,$e=ht,He=function(t,e){var n=this.__data__;if(n instanceof je){var o=n.__data__;if(!ke||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new De(o)}return n.set(t,e),this.size=n.size,this};function Ve(t){var e=this.__data__=new Pe(t);this.size=e.size}Ve.prototype.clear=ze,Ve.prototype.delete=Te,Ve.prototype.get=Le,Ve.prototype.has=$e,Ve.prototype.set=He;var Ie=Ve,Fe=Zt,Be=function(){try{var t=Fe(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),Re=Be;var We=function(t,e,n){"__proto__"==e&&Re?Re(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},qe=We,Ue=U;var Xe=function(t,e,n){(void 0!==n&&!Ue(t[e],n)||void 0===n&&!(e in t))&&qe(t,e,n)};var Ge,Ye,Ze,Je,Ke,Qe,tn,en=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}}(),nn={exports:{}};Ge=nn,Ze=gt,Je=(Ye=nn.exports)&&!Ye.nodeType&&Ye,Ke=Je&&Ge&&!Ge.nodeType&&Ge,Qe=Ke&&Ke.exports===Je?Ze.Buffer:void 0,tn=Qe?Qe.allocUnsafe:void 0,Ge.exports=function(t,e){if(e)return t.slice();var n=t.length,o=tn?tn(n):new t.constructor(n);return t.copy(o),o};var on=nn.exports,rn=gt.Uint8Array,sn=rn;var an=function(t){var e=new t.constructor(t.byteLength);return new sn(e).set(new sn(t)),e};var ln=function(t,e){var n=e?an(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};var cn=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e},dn=Nt,hn=Object.create,un=function(){function t(){}return function(e){if(!dn(e))return{};if(hn)return hn(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var pn=function(t,e){return function(n){return t(e(n))}},mn=pn(Object.getPrototypeOf,Object),gn=Object.prototype;var fn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||gn)},vn=un,bn=mn,yn=fn;var wn=function(t){return"function"!=typeof t.constructor||yn(t)?{}:vn(bn(t))};var xn=function(t){return null!=t&&"object"==typeof t},Cn=Mt,Sn=xn;var En=function(t){return Sn(t)&&"[object Arguments]"==Cn(t)},On=xn,_n=Object.prototype,Mn=_n.hasOwnProperty,Nn=_n.propertyIsEnumerable,An=En(function(){return arguments}())?En:function(t){return On(t)&&Mn.call(t,"callee")&&!Nn.call(t,"callee")},jn=Array.isArray;var kn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Dn=Dt,Pn=kn;var zn=function(t){return null!=t&&Pn(t.length)&&!Dn(t)},Tn=zn,Ln=xn;var $n=function(t){return Ln(t)&&Tn(t)},Hn={exports:{}};var Vn=function(){return!1};!function(t,e){var n=gt,o=Vn,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}(Hn,Hn.exports);var In=Hn.exports,Fn=Mt,Bn=mn,Rn=xn,Wn=Function.prototype,qn=Object.prototype,Un=Wn.toString,Xn=qn.hasOwnProperty,Gn=Un.call(Object);var Yn=function(t){if(!Rn(t)||"[object Object]"!=Fn(t))return!1;var e=Bn(t);if(null===e)return!0;var n=Xn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Un.call(n)==Gn},Zn=Mt,Jn=kn,Kn=xn,Qn={};Qn["[object Float32Array]"]=Qn["[object Float64Array]"]=Qn["[object Int8Array]"]=Qn["[object Int16Array]"]=Qn["[object Int32Array]"]=Qn["[object Uint8Array]"]=Qn["[object Uint8ClampedArray]"]=Qn["[object Uint16Array]"]=Qn["[object Uint32Array]"]=!0,Qn["[object Arguments]"]=Qn["[object Array]"]=Qn["[object ArrayBuffer]"]=Qn["[object Boolean]"]=Qn["[object DataView]"]=Qn["[object Date]"]=Qn["[object Error]"]=Qn["[object Function]"]=Qn["[object Map]"]=Qn["[object Number]"]=Qn["[object Object]"]=Qn["[object RegExp]"]=Qn["[object Set]"]=Qn["[object String]"]=Qn["[object WeakMap]"]=!1;var to=function(t){return Kn(t)&&Jn(t.length)&&!!Qn[Zn(t)]};var eo=function(t){return function(e){return t(e)}},no={exports:{}};!function(t,e){var n=ut,o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o&&n.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||r&&r.binding&&r.binding("util")}catch(e){}}();t.exports=s}(no,no.exports);var oo=no.exports,io=to,ro=eo,so=oo&&oo.isTypedArray,ao=so?ro(so):io;var lo=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},co=We,ho=U,uo=Object.prototype.hasOwnProperty;var po=function(t,e,n){var o=t[e];uo.call(t,e)&&ho(o,n)&&(void 0!==n||e in t)||co(t,e,n)},mo=po,go=We;var fo=function(t,e,n,o){var i=!n;n||(n={});for(var r=-1,s=e.length;++r<s;){var a=e[r],l=o?o(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),i?go(n,a,l):mo(n,a,l)}return n};var vo=/^(?:0|[1-9]\d*)$/;var bo=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&vo.test(t))&&t>-1&&t%1==0&&t<e},yo=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},wo=An,xo=jn,Co=In,So=bo,Eo=ao,Oo=Object.prototype.hasOwnProperty;var _o=function(t,e){var n=xo(t),o=!n&&wo(t),i=!n&&!o&&Co(t),r=!n&&!o&&!i&&Eo(t),s=n||o||i||r,a=s?yo(t.length,String):[],l=a.length;for(var c in t)!e&&!Oo.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||So(c,l))||a.push(c);return a};var Mo=Nt,No=fn,Ao=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},jo=Object.prototype.hasOwnProperty;var ko=_o,Do=function(t){if(!Mo(t))return Ao(t);var e=No(t),n=[];for(var o in t)("constructor"!=o||!e&&jo.call(t,o))&&n.push(o);return n},Po=zn;var zo=function(t){return Po(t)?ko(t,!0):Do(t)},To=fo,Lo=zo;var $o=Xe,Ho=on,Vo=ln,Io=cn,Fo=wn,Bo=An,Ro=jn,Wo=$n,qo=In,Uo=Dt,Xo=Nt,Go=Yn,Yo=ao,Zo=lo,Jo=function(t){return To(t,Lo(t))};var Ko=Ie,Qo=Xe,ti=en,ei=function(t,e,n,o,i,r,s){var a=Zo(t,n),l=Zo(e,n),c=s.get(l);if(c)$o(t,n,c);else{var d=r?r(a,l,n+"",t,e,s):void 0,h=void 0===d;if(h){var u=Ro(l),p=!u&&qo(l),m=!u&&!p&&Yo(l);d=l,u||p||m?Ro(a)?d=a:Wo(a)?d=Io(a):p?(h=!1,d=Ho(l,!0)):m?(h=!1,d=Vo(l,!0)):d=[]:Go(l)||Bo(l)?(d=a,Bo(a)?d=Jo(a):Xo(a)&&!Uo(a)||(d=Fo(l))):h=!1}h&&(s.set(l,d),i(d,l,o,r,s),s.delete(l)),$o(t,n,d)}},ni=Nt,oi=zo,ii=lo;var ri=function t(e,n,o,i,r){e!==n&&ti(n,(function(s,a){if(r||(r=new Ko),ni(s))ei(e,n,a,o,t,i,r);else{var l=i?i(ii(e,a),s,a+"",e,n,r):void 0;void 0===l&&(l=s),Qo(e,a,l)}}),oi)};var si=function(t){return t};var ai=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)},li=Math.max;var ci=function(t,e,n){return e=li(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,r=li(o.length-e,0),s=Array(r);++i<r;)s[i]=o[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=o[i];return a[e]=n(s),ai(t,this,a)}};var di=function(t){return function(){return t}},hi=Be,ui=hi?function(t,e){return hi(t,"toString",{configurable:!0,enumerable:!1,value:di(e),writable:!0})}:si,pi=Date.now;var mi=function(t){var e=0,n=0;return function(){var o=pi(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ui),gi=si,fi=ci,vi=mi;var bi=U,yi=zn,wi=bo,xi=Nt;var Ci=function(t,e){return vi(fi(t,e,gi),t+"")},Si=function(t,e,n){if(!xi(n))return!1;var o=typeof e;return!!("number"==o?yi(n)&&wi(e,n.length):"string"==o&&e in n)&&bi(n[e],t)};var Ei=ri;const Oi=W(function(t){return Ci((function(e,n){var o=-1,i=n.length,r=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(i--,r):void 0,s&&Si(n[0],n[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++o<i;){var a=n[o];a&&t(e,a,o,r)}return e}))}((function(t,e,n,o){Ei(t,e,n,o)}))),_i=()=>crypto.randomUUID(),Mi=(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},Ni=t=>{var e;const n=null==(e=t.className)?void 0:e.match(C);return n&&w[n[0]]},Ai=t=>Array.from(new Set(t)),ji=t=>{let e;if(t){const{attrs:n={}}=t;e=n.id||t.id||_i(),t.id=e}else e=_i();return e},ki=(t,e,n=Object.create(null))=>Oi({},t,e,((t,e)=>{if(Array.isArray(t))return Array.isArray(e)?Ai(n.mergeArray?t.concat(e):e):e})),Di=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]=Di(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=Di(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},Pi=(t,e)=>t/e*100,zi=t=>`${t.toString()}%`,Ti=Object.create(null,{get:{value:t=>{var e;const n=null==(e=window.sessionStorage)?void 0:e.getItem(t);try{return JSON.parse(n)}catch(o){return n}}},set:{value:(t,e)=>{var n;try{return null==(n=window.sessionStorage)?void 0:n.setItem(t,JSON.stringify(e))}catch(o){}}}}),Li=t=>f.some((e=>new RegExp(`^${e}.`).test(t))),$i=t=>t.startsWith("external");function Hi(t,e){let n=!1;return function(){if(!n){t(...arguments),n=!0;const o=setTimeout((()=>{n=!1,clearTimeout(o)}),e)}}}function Vi(t){return t}function Ii(){}var Fi=Mt,Bi=xn;var Ri=function(t){return"symbol"==typeof t||Bi(t)&&"[object Symbol]"==Fi(t)},Wi=jn,qi=Ri,Ui=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xi=/^\w*$/;var Gi=function(t,e){if(Wi(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!qi(t))||(Xi.test(t)||!Ui.test(t)||null!=e&&t in Object(e))},Yi=Ae;function Zi(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],r=n.cache;if(r.has(i))return r.get(i);var s=t.apply(this,o);return n.cache=r.set(i,s)||r,s};return n.cache=new(Zi.Cache||Yi),n}Zi.Cache=Yi;var Ji=Zi;var Ki=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qi=/\\(\\)?/g,tr=function(t){var e=Ji(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ki,(function(t,n,o,i){e.push(o?i.replace(Qi,"$1"):n||t)})),e}));var er=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},nr=jn,or=Ri,ir=ft?ft.prototype:void 0,rr=ir?ir.toString:void 0;var sr=function t(e){if("string"==typeof e)return e;if(nr(e))return er(e,t)+"";if(or(e))return rr?rr.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},ar=sr;var lr=jn,cr=Gi,dr=tr,hr=function(t){return null==t?"":ar(t)};var ur=function(t,e){return lr(t)?t:cr(t,e)?[t]:dr(hr(t))},pr=Ri;var mr=function(t){if("string"==typeof t||pr(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},gr=po,fr=ur,vr=bo,br=Nt,yr=mr;var wr=function(t,e,n,o){if(!br(t))return t;for(var i=-1,r=(e=fr(e,t)).length,s=r-1,a=t;null!=a&&++i<r;){var l=yr(e[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=s){var d=a[l];void 0===(c=o?o(d,l,a):void 0)&&(c=br(d)?d:vr(e[i+1])?[]:{})}gr(a,l,c),a=a[l]}return t};const xr=W((function(t,e,n){return null==t?t:wr(t,e,n)}));var Cr=ur,Sr=mr;var Er=function(t,e){for(var n=0,o=(e=Cr(e,t)).length;null!=t&&n<o;)t=t[Sr(e[n++])];return n&&n==o?t:void 0};const Or=W((function(t,e,n){var o=null==t?void 0:Er(t,e);return void 0===o?n:o})),_r=xr,Mr=t=>{const e={...t},n={string:()=>"",boolean:()=>!1,object:t=>Mr(t)};for(const o of Object.keys(t)){const i=typeof t[o];n[i]&&(e[o]=n[i](t[o]))}return e},Nr="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`)),Ar=new RegExp(`(?!${Nr.join("|")})\\w\\S*`,"g"),jr=/\s+/g;function kr(t){if("string"!=typeof t)return t;if(t.trim().match(jr))return t;return t.replace(Ar,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const Dr=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),Pr=t=>Number.isInteger(Number(t)),zr=(t,e)=>{const n=e||t.parentElement;return Array.prototype.slice.call(n.childNodes).indexOf(t)},Tr=(t,e,n)=>{const o=n.split("||"),i=Ai(e).map((e=>t.find((t=>{const n=o.find((e=>!!Or(t,e)));return n&&Or(t,n)===e})))).filter(Boolean).concat(t);return Ai(i)},Lr=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},$r=(t,e)=>{const n=[];return Lr(t,((t,o)=>n.push(e(t,o)))),n},Hr={},Vr=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),Ir=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Fr={capitalize:Vr,safeAttrName:t=>{if(Hr[t])return Hr[t];const e=({className:"class"}[t]||t).replace(/^\d/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Hr[t]=e,e},forEach:Lr,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:$r,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:zr,isInt:Pr,get:Or,orderObjectsBy:Tr,isIE:Ir},Br={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=Br.getStyle(t),i=parseInt(o.height,10),r=i/(e/60);t.style.height="0px",function e(){const o=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=Br.getStyle(t),i=parseInt(o.height),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=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"===Br.getStyle(t,"display"))=>{n?Br.slideDown(t,e):Br.slideUp(t,e)}},Rr="no-transition",Wr={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onUpdate:t=>Ur.opts.debug&&void 0,onUpdateStage:t=>Ur.opts.debug&&void 0,onUpdateRow:t=>Ur.opts.debug&&void 0,onUpdateColumn:t=>Ur.opts.debug&&void 0,onUpdateField:t=>Ur.opts.debug&&void 0,onRender:t=>Ur.opts.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},qr=({src:t,...e},n=T)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:Ur.opts.debug||Ur.opts.bubbles});return o.data=(t||document).dispatchEvent(o),o},Ur={init:function(t){return this.opts={...Wr,...t},this},formeoSaved:t=>qr(t,z),formeoUpdated:t=>qr(t,T),formeoCleared:t=>qr(t,"formeoCleared"),formeoOnRender:t=>qr(t,L),formeoConditionUpdated:t=>qr(t,"formeoConditionUpdated")},Xr=Hi((()=>{Ur.opts.onUpdate({timeStamp:window.performance.now(),type:T,detail:_d.formData})}),D);let Gr;document.addEventListener(T,Xr),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;Ur.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;Ur.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;Ur.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;Ur.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener(L,(t=>{const{timeStamp:e,type:n,detail:o}=t;Ur.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},Ur.opts.confirmClearAll(t)})),document.addEventListener(z,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};Ur.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{Ur.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){Gr=Gr||window.requestAnimationFrame((()=>{Gr=!1,Object.values(xd.data).forEach((t=>{t.dom.classList.add(Rr),Sd.dom.classList.add(Rr),Sd.panels.nav.refresh(),t.refreshFieldPanels()}))}))}));var Yr=Ae,Zr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Jr=function(t){return this.__data__.has(t)};function Kr(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Yr;++e<n;)this.add(t[e])}Kr.prototype.add=Kr.prototype.push=Zr,Kr.prototype.has=Jr;var Qr=Kr,ts=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},es=function(t,e){return t.has(e)};var ns=function(t,e,n,o,i,r){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(t),d=r.get(e);if(c&&d)return c==e&&d==t;var h=-1,u=!0,p=2&n?new Qr:void 0;for(r.set(t,e),r.set(e,t);++h<a;){var m=t[h],g=e[h];if(o)var f=s?o(g,m,h,e,t,r):o(m,g,h,t,e,r);if(void 0!==f){if(f)continue;u=!1;break}if(p){if(!ts(e,(function(t,e){if(!es(p,e)&&(m===t||i(m,t,n,o,r)))return p.push(e)}))){u=!1;break}}else if(m!==g&&!i(m,g,n,o,r)){u=!1;break}}return r.delete(t),r.delete(e),u};var os=rn,is=U,rs=ns,ss=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n},as=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},ls=ft?ft.prototype:void 0,cs=ls?ls.valueOf:void 0;var ds=function(t,e,n,o,i,r,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!r(new os(t),new os(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return is(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=ss;case"[object Set]":var l=1&o;if(a||(a=as),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;o|=2,s.set(t,e);var d=rs(a(t),a(e),o,i,r,s);return s.delete(t),d;case"[object Symbol]":if(cs)return cs.call(t)==cs.call(e)}return!1};var hs=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t},us=jn;var ps=function(t,e,n){var o=e(t);return us(t)?o:hs(o,n(t))};var ms=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},gs=function(){return[]},fs=Object.prototype.propertyIsEnumerable,vs=Object.getOwnPropertySymbols,bs=vs?function(t){return null==t?[]:(t=Object(t),ms(vs(t),(function(e){return fs.call(t,e)})))}:gs,ys=pn(Object.keys,Object),ws=fn,xs=ys,Cs=Object.prototype.hasOwnProperty;var Ss=_o,Es=function(t){if(!ws(t))return xs(t);var e=[];for(var n in Object(t))Cs.call(t,n)&&"constructor"!=n&&e.push(n);return e},Os=zn;var _s=ps,Ms=bs,Ns=function(t){return Os(t)?Ss(t):Es(t)};var As=function(t){return _s(t,Ns,Ms)},js=Object.prototype.hasOwnProperty;var ks=function(t,e,n,o,i,r){var s=1&n,a=As(t),l=a.length;if(l!=As(e).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in e:js.call(e,d)))return!1}var h=r.get(t),u=r.get(e);if(h&&u)return h==e&&u==t;var p=!0;r.set(t,e),r.set(e,t);for(var m=s;++c<l;){var g=t[d=a[c]],f=e[d];if(o)var v=s?o(f,g,d,e,t,r):o(g,f,d,t,e,r);if(!(void 0===v?g===f||i(g,f,n,o,r):v)){p=!1;break}m||(m="constructor"==d)}if(p&&!m){var b=t.constructor,y=e.constructor;b==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(p=!1)}return r.delete(t),r.delete(e),p},Ds=Zt(gt,"DataView"),Ps=Jt,zs=Zt(gt,"Promise"),Ts=Zt(gt,"Set"),Ls=Zt(gt,"WeakMap"),$s=Mt,Hs=$t,Vs="[object Map]",Is="[object Promise]",Fs="[object Set]",Bs="[object WeakMap]",Rs="[object DataView]",Ws=Hs(Ds),qs=Hs(Ps),Us=Hs(zs),Xs=Hs(Ts),Gs=Hs(Ls),Ys=$s;(Ds&&Ys(new Ds(new ArrayBuffer(1)))!=Rs||Ps&&Ys(new Ps)!=Vs||zs&&Ys(zs.resolve())!=Is||Ts&&Ys(new Ts)!=Fs||Ls&&Ys(new Ls)!=Bs)&&(Ys=function(t){var e=$s(t),n="[object Object]"==e?t.constructor:void 0,o=n?Hs(n):"";if(o)switch(o){case Ws:return Rs;case qs:return Vs;case Us:return Is;case Xs:return Fs;case Gs:return Bs}return e});var Zs=Ie,Js=ns,Ks=ds,Qs=ks,ta=Ys,ea=jn,na=In,oa=ao,ia="[object Arguments]",ra="[object Array]",sa="[object Object]",aa=Object.prototype.hasOwnProperty;var la=function(t,e,n,o,i,r){var s=ea(t),a=ea(e),l=s?ra:ta(t),c=a?ra:ta(e),d=(l=l==ia?sa:l)==sa,h=(c=c==ia?sa:c)==sa,u=l==c;if(u&&na(t)){if(!na(e))return!1;s=!0,d=!1}if(u&&!d)return r||(r=new Zs),s||oa(t)?Js(t,e,n,o,i,r):Ks(t,e,l,n,o,i,r);if(!(1&n)){var p=d&&aa.call(t,"__wrapped__"),m=h&&aa.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,f=m?e.value():e;return r||(r=new Zs),i(g,f,n,o,r)}}return!!u&&(r||(r=new Zs),Qs(t,e,n,o,i,r))},ca=xn;var da=function t(e,n,o,i,r){return e===n||(null==e||null==n||!ca(e)&&!ca(n)?e!=e&&n!=n:la(e,n,o,i,t,r))},ha=da;const ua=W((function(t,e){return ha(t,e)}));class pa{constructor(t,n=Object.create(null)){e(this,"toJSON",((t,e)=>JSON.stringify(t,null,e))),e(this,"get",(t=>Or(this.data,t))),e(this,"getChangeType",((t,e)=>{const n=N.find((({condition:n})=>n(t,e)))||{type:"unknown"};return n.desc="added"===n.type?`${t} to ${e}`:e,n})),e(this,"add",((t,e=Object.create(null))=>{const{id:n}=e,o=t||n||ji();return this.set(o,e)})),e(this,"remove",(t=>{const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?o.splice(Number(n),1):delete o[n],o})),e(this,"getData",(()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=(null==n?void 0:n.data)?n.getData():n,t)),{}))),e(this,"setCallbacks",{}),e(this,"configVal",Object.create(null)),this.name=t,this.data=n,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}set(t,e){const n=Or(this.data,t);if(ua(n,e))return this.data;const o=_r(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=this.getChangeType(n,e),r={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+t,value:e,data:o,change:`${i.type}: ${i.desc}`,src:this.dom};n&&(r.previousValue=n),Ur.formeoUpdated(r)}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))}empty(){this.data=Object.create(null)}}
8
+ "use strict";var t=Object.defineProperty,e=(e,n,o)=>((e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o)(e,"symbol"!=typeof n?n+"":n,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class o{constructor(t=n){this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}processConfig(t){const{location:e,...o}={...n,...t},i=e.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,e={}){e="string"==typeof e?o.processFile(e):e,this.applyLanguage(t,e),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 o.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,e=!0){const n=this;return new Promise((function(i,r){if(-1!==n.loaded.indexOf(t)&&e)return n.applyLanguage(n.langs[t]),i(n.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}}([n.config.location,t,n.config.extension].join("")).then((e=>{const r=o.processFile(e);return n.applyLanguage(t,r),n.loaded.push(t),i(n.langs[t])})).catch((e=>{const o=n.applyLanguage(t);i(o)}))}))}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 i=new o,r="2.2.0",s="formeo",a="formeo-sprite",l=[{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"}],c=`https://cdn.jsdelivr.net/npm/formeo@${r}/dist/${a}.svg`,d=`https://draggable.github.io/formeo/assets/img/${a}.svg`,u=`https://cdn.jsdelivr.net/npm/formeo@${r}/dist/formeo.min.css`,h="control-group",p=`${s}-stage`,m=`${s}-row`,f=`${s}-column`,g=`${s}-field`,v="custom-column-widths",b="column-preset",y="resizing-columns",w=new Map([[p,m],[m,f],[f,g]]),C=["external","stages","rows","columns","fields"],E=["stage","row","column","field"].reduce(((t,e)=>({...t,[e]:e})),{}),S=[{name:"controls",className:h},{name:"stage",className:p},{name:"row",className:m},{name:"column",className:f},{name:"field",className:g}],O={controls:h,stage:p,row:m,column:f,field:g},x=Object.entries(O).reduce(((t,[e,n])=>({...t,[n]:e})),{}),N=Object.values(O),_=new RegExp(`${N.join("|")}`,"g"),A=S.map((({name:t},e,n)=>{const{name:o}=n[e+1]||{};return o&&[t,o]})).filter(Boolean),j=A.slice().map((t=>t.slice().reverse())).reverse(),P=new Map(A),T=new Map(j.slice()),D=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)),[])),k=[{type:"added",condition:(t,e)=>Boolean(void 0===t&&e)}],$=`${s}-formData`,L=`${s}-locale`,I=333,M=Math.round(166.5),F=Math.round(666),R="formeoSaved",W="formeoUpdated",B="formeoOnRender",z=["label","logical","source","thenTarget","sourceProperty","comparison","target","targetProperty","assignment","value"],q={value:"attrs.value",checked:"attrs.checked",isVisible:"config.isVisible",isNotVisible:"config.isNotVisible"},U={comparison:{equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},assignment:{equals:"="},logical:{and:"&&",or:"||"},property:q},X=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)/gi,H=/\bcol-\w+-\d+/g,Y="f-i-";var G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function V(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var J=function(){this.__data__=[],this.size=0};var K=function(t,e){return t===e||t!=t&&e!=e},Z=K;var Q=function(t,e){for(var n=t.length;n--;)if(Z(t[n][0],e))return n;return-1},tt=Q,et=Array.prototype.splice;var nt=Q;var ot=Q;var it=Q;var rt=J,st=function(t){var e=this.__data__,n=tt(e,t);return!(n<0)&&(n==e.length-1?e.pop():et.call(e,n,1),--this.size,!0)},at=function(t){var e=this.__data__,n=nt(e,t);return n<0?void 0:e[n][1]},lt=function(t){return ot(this.__data__,t)>-1},ct=function(t,e){var n=this.__data__,o=it(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function dt(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])}}dt.prototype.clear=rt,dt.prototype.delete=st,dt.prototype.get=at,dt.prototype.has=lt,dt.prototype.set=ct;var ut=dt,ht=ut;var pt=function(){this.__data__=new ht,this.size=0};var mt=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};var ft=function(t){return this.__data__.get(t)};var gt=function(t){return this.__data__.has(t)},vt="object"==typeof G&&G&&G.Object===Object&&G,bt=vt,yt="object"==typeof self&&self&&self.Object===Object&&self,wt=bt||yt||Function("return this")(),Ct=wt.Symbol,Et=Ct,St=Object.prototype,Ot=St.hasOwnProperty,xt=St.toString,Nt=Et?Et.toStringTag:void 0;var _t=function(t){var e=Ot.call(t,Nt),n=t[Nt];try{t[Nt]=void 0;var o=!0}catch(r){}var i=xt.call(t);return o&&(e?t[Nt]=n:delete t[Nt]),i},At=Object.prototype.toString;var jt=_t,Pt=function(t){return At.call(t)},Tt=Ct?Ct.toStringTag:void 0;var Dt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Tt&&Tt in Object(t)?jt(t):Pt(t)};var kt=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},$t=Dt,Lt=kt;var It,Mt=function(t){if(!Lt(t))return!1;var e=$t(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Ft=wt["__core-js_shared__"],Rt=(It=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||""))?"Symbol(src)_1."+It:"";var Wt=function(t){return!!Rt&&Rt in t},Bt=Function.prototype.toString;var zt=function(t){if(null!=t){try{return Bt.call(t)}catch(e){}try{return t+""}catch(e){}}return""},qt=Mt,Ut=Wt,Xt=kt,Ht=zt,Yt=/^\[object .+?Constructor\]$/,Gt=Function.prototype,Vt=Object.prototype,Jt=Gt.toString,Kt=Vt.hasOwnProperty,Zt=RegExp("^"+Jt.call(Kt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Qt=function(t){return!(!Xt(t)||Ut(t))&&(qt(t)?Zt:Yt).test(Ht(t))},te=function(t,e){return null==t?void 0:t[e]};var ee=function(t,e){var n=te(t,e);return Qt(n)?n:void 0},ne=ee(wt,"Map"),oe=ee(Object,"create"),ie=oe;var re=function(){this.__data__=ie?ie(null):{},this.size=0};var se=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ae=oe,le=Object.prototype.hasOwnProperty;var ce=function(t){var e=this.__data__;if(ae){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return le.call(e,t)?e[t]:void 0},de=oe,ue=Object.prototype.hasOwnProperty;var he=oe;var pe=re,me=se,fe=ce,ge=function(t){var e=this.__data__;return de?void 0!==e[t]:ue.call(e,t)},ve=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=he&&void 0===e?"__lodash_hash_undefined__":e,this};function be(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])}}be.prototype.clear=pe,be.prototype.delete=me,be.prototype.get=fe,be.prototype.has=ge,be.prototype.set=ve;var ye=be,we=ut,Ce=ne;var Ee=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Se=function(t,e){var n=t.__data__;return Ee(e)?n["string"==typeof e?"string":"hash"]:n.map},Oe=Se;var xe=Se;var Ne=Se;var _e=Se;var Ae=function(){this.size=0,this.__data__={hash:new ye,map:new(Ce||we),string:new ye}},je=function(t){var e=Oe(this,t).delete(t);return this.size-=e?1:0,e},Pe=function(t){return xe(this,t).get(t)},Te=function(t){return Ne(this,t).has(t)},De=function(t,e){var n=_e(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function ke(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])}}ke.prototype.clear=Ae,ke.prototype.delete=je,ke.prototype.get=Pe,ke.prototype.has=Te,ke.prototype.set=De;var $e=ke,Le=ut,Ie=ne,Me=$e;var Fe=ut,Re=pt,We=mt,Be=ft,ze=gt,qe=function(t,e){var n=this.__data__;if(n instanceof Le){var o=n.__data__;if(!Ie||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Me(o)}return n.set(t,e),this.size=n.size,this};function Ue(t){var e=this.__data__=new Fe(t);this.size=e.size}Ue.prototype.clear=Re,Ue.prototype.delete=We,Ue.prototype.get=Be,Ue.prototype.has=ze,Ue.prototype.set=qe;var Xe=Ue,He=ee,Ye=function(){try{var t=He(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ge=Ye;var Ve=function(t,e,n){"__proto__"==e&&Ge?Ge(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Je=Ve,Ke=K;var Ze=function(t,e,n){(void 0!==n&&!Ke(t[e],n)||void 0===n&&!(e in t))&&Je(t,e,n)};var Qe,tn,en,nn,on,rn,sn,an=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}}(),ln={exports:{}};Qe=ln,en=wt,nn=(tn=ln.exports)&&!tn.nodeType&&tn,on=nn&&Qe&&!Qe.nodeType&&Qe,rn=on&&on.exports===nn?en.Buffer:void 0,sn=rn?rn.allocUnsafe:void 0,Qe.exports=function(t,e){if(e)return t.slice();var n=t.length,o=sn?sn(n):new t.constructor(n);return t.copy(o),o};var cn=ln.exports,dn=wt.Uint8Array,un=dn;var hn=function(t){var e=new t.constructor(t.byteLength);return new un(e).set(new un(t)),e};var pn=function(t,e){var n=e?hn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};var mn=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e},fn=kt,gn=Object.create,vn=function(){function t(){}return function(e){if(!fn(e))return{};if(gn)return gn(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var bn=function(t,e){return function(n){return t(e(n))}},yn=bn(Object.getPrototypeOf,Object),wn=Object.prototype;var Cn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||wn)},En=vn,Sn=yn,On=Cn;var xn=function(t){return"function"!=typeof t.constructor||On(t)?{}:En(Sn(t))};var Nn=function(t){return null!=t&&"object"==typeof t},_n=Dt,An=Nn;var jn=function(t){return An(t)&&"[object Arguments]"==_n(t)},Pn=Nn,Tn=Object.prototype,Dn=Tn.hasOwnProperty,kn=Tn.propertyIsEnumerable,$n=jn(function(){return arguments}())?jn:function(t){return Pn(t)&&Dn.call(t,"callee")&&!kn.call(t,"callee")},Ln=Array.isArray;var In=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Mn=Mt,Fn=In;var Rn=function(t){return null!=t&&Fn(t.length)&&!Mn(t)},Wn=Rn,Bn=Nn;var zn=function(t){return Bn(t)&&Wn(t)},qn={exports:{}};var Un=function(){return!1};!function(t,e){var n=wt,o=Un,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}(qn,qn.exports);var Xn=qn.exports,Hn=Dt,Yn=yn,Gn=Nn,Vn=Function.prototype,Jn=Object.prototype,Kn=Vn.toString,Zn=Jn.hasOwnProperty,Qn=Kn.call(Object);var to=function(t){if(!Gn(t)||"[object Object]"!=Hn(t))return!1;var e=Yn(t);if(null===e)return!0;var n=Zn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Kn.call(n)==Qn},eo=Dt,no=In,oo=Nn,io={};io["[object Float32Array]"]=io["[object Float64Array]"]=io["[object Int8Array]"]=io["[object Int16Array]"]=io["[object Int32Array]"]=io["[object Uint8Array]"]=io["[object Uint8ClampedArray]"]=io["[object Uint16Array]"]=io["[object Uint32Array]"]=!0,io["[object Arguments]"]=io["[object Array]"]=io["[object ArrayBuffer]"]=io["[object Boolean]"]=io["[object DataView]"]=io["[object Date]"]=io["[object Error]"]=io["[object Function]"]=io["[object Map]"]=io["[object Number]"]=io["[object Object]"]=io["[object RegExp]"]=io["[object Set]"]=io["[object String]"]=io["[object WeakMap]"]=!1;var ro=function(t){return oo(t)&&no(t.length)&&!!io[eo(t)]};var so=function(t){return function(e){return t(e)}},ao={exports:{}};!function(t,e){var n=vt,o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o&&n.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||r&&r.binding&&r.binding("util")}catch(e){}}();t.exports=s}(ao,ao.exports);var lo=ao.exports,co=ro,uo=so,ho=lo&&lo.isTypedArray,po=ho?uo(ho):co;var mo=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},fo=Ve,go=K,vo=Object.prototype.hasOwnProperty;var bo=function(t,e,n){var o=t[e];vo.call(t,e)&&go(o,n)&&(void 0!==n||e in t)||fo(t,e,n)},yo=bo,wo=Ve;var Co=function(t,e,n,o){var i=!n;n||(n={});for(var r=-1,s=e.length;++r<s;){var a=e[r],l=o?o(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),i?wo(n,a,l):yo(n,a,l)}return n};var Eo=/^(?:0|[1-9]\d*)$/;var So=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Eo.test(t))&&t>-1&&t%1==0&&t<e},Oo=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},xo=$n,No=Ln,_o=Xn,Ao=So,jo=po,Po=Object.prototype.hasOwnProperty;var To=function(t,e){var n=No(t),o=!n&&xo(t),i=!n&&!o&&_o(t),r=!n&&!o&&!i&&jo(t),s=n||o||i||r,a=s?Oo(t.length,String):[],l=a.length;for(var c in t)!e&&!Po.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ao(c,l))||a.push(c);return a};var Do=kt,ko=Cn,$o=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},Lo=Object.prototype.hasOwnProperty;var Io=To,Mo=function(t){if(!Do(t))return $o(t);var e=ko(t),n=[];for(var o in t)("constructor"!=o||!e&&Lo.call(t,o))&&n.push(o);return n},Fo=Rn;var Ro=function(t){return Fo(t)?Io(t,!0):Mo(t)},Wo=Co,Bo=Ro;var zo=Ze,qo=cn,Uo=pn,Xo=mn,Ho=xn,Yo=$n,Go=Ln,Vo=zn,Jo=Xn,Ko=Mt,Zo=kt,Qo=to,ti=po,ei=mo,ni=function(t){return Wo(t,Bo(t))};var oi=Xe,ii=Ze,ri=an,si=function(t,e,n,o,i,r,s){var a=ei(t,n),l=ei(e,n),c=s.get(l);if(c)zo(t,n,c);else{var d=r?r(a,l,n+"",t,e,s):void 0,u=void 0===d;if(u){var h=Go(l),p=!h&&Jo(l),m=!h&&!p&&ti(l);d=l,h||p||m?Go(a)?d=a:Vo(a)?d=Xo(a):p?(u=!1,d=qo(l,!0)):m?(u=!1,d=Uo(l,!0)):d=[]:Qo(l)||Yo(l)?(d=a,Yo(a)?d=ni(a):Zo(a)&&!Ko(a)||(d=Ho(l))):u=!1}u&&(s.set(l,d),i(d,l,o,r,s),s.delete(l)),zo(t,n,d)}},ai=kt,li=Ro,ci=mo;var di=function t(e,n,o,i,r){e!==n&&ri(n,(function(s,a){if(r||(r=new oi),ai(s))si(e,n,a,o,t,i,r);else{var l=i?i(ci(e,a),s,a+"",e,n,r):void 0;void 0===l&&(l=s),ii(e,a,l)}}),li)};var ui=function(t){return t};var hi=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)},pi=Math.max;var mi=function(t,e,n){return e=pi(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,r=pi(o.length-e,0),s=Array(r);++i<r;)s[i]=o[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=o[i];return a[e]=n(s),hi(t,this,a)}};var fi=function(t){return function(){return t}},gi=Ye,vi=gi?function(t,e){return gi(t,"toString",{configurable:!0,enumerable:!1,value:fi(e),writable:!0})}:ui,bi=Date.now;var yi=function(t){var e=0,n=0;return function(){var o=bi(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(vi),wi=ui,Ci=mi,Ei=yi;var Si=K,Oi=Rn,xi=So,Ni=kt;var _i=function(t,e){return Ei(Ci(t,e,wi),t+"")},Ai=function(t,e,n){if(!Ni(n))return!1;var o=typeof e;return!!("number"==o?Oi(n)&&xi(e,n.length):"string"==o&&e in n)&&Si(n[e],t)};var ji=di;const Pi=V(function(t){return _i((function(e,n){var o=-1,i=n.length,r=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(i--,r):void 0,s&&Ai(n[0],n[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++o<i;){var a=n[o];a&&t(e,a,o,r)}return e}))}((function(t,e,n,o){ji(t,e,n,o)}))),Ti=()=>crypto.randomUUID(),Di=(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},ki=t=>{var e;const n=null==(e=t.className)?void 0:e.match(_);return n&&x[n[0]]},$i=t=>Array.from(new Set(t)),Li=t=>{let e;if(t){const{attrs:n={}}=t;e=n.id||t.id||Ti(),t.id=e}else e=Ti();return e},Ii=(t,e,n=Object.create(null))=>Pi({},t,e,((t,e)=>{if(Array.isArray(t))return Array.isArray(e)?$i(n.mergeArray?t.concat(e):e):e})),Mi=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]=Mi(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=Mi(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},Fi=(t,e)=>t/e*100,Ri=t=>`${t.toString()}%`,Wi=Object.create(null,{get:{value:t=>{var e;const n=null==(e=window.sessionStorage)?void 0:e.getItem(t);try{return JSON.parse(n)}catch(o){return n}}},set:{value:(t,e)=>{var n;try{return null==(n=window.sessionStorage)?void 0:n.setItem(t,JSON.stringify(e))}catch(o){}}}}),Bi=t=>C.some((e=>new RegExp(`^${e}.`).test(t))),zi=t=>t.startsWith("external");function qi(t,e){let n=!1;return function(){if(!n){t(...arguments),n=!0;const o=setTimeout((()=>{n=!1,clearTimeout(o)}),e)}}}function Ui(t){return t}function Xi(){}var Hi=Dt,Yi=Nn;var Gi=function(t){return"symbol"==typeof t||Yi(t)&&"[object Symbol]"==Hi(t)},Vi=Ln,Ji=Gi,Ki=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zi=/^\w*$/;var Qi=function(t,e){if(Vi(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ji(t))||(Zi.test(t)||!Ki.test(t)||null!=e&&t in Object(e))},tr=$e;function er(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],r=n.cache;if(r.has(i))return r.get(i);var s=t.apply(this,o);return n.cache=r.set(i,s)||r,s};return n.cache=new(er.Cache||tr),n}er.Cache=tr;var nr=er;var or=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ir=/\\(\\)?/g,rr=function(t){var e=nr(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(or,(function(t,n,o,i){e.push(o?i.replace(ir,"$1"):n||t)})),e}));var sr=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},ar=Ln,lr=Gi,cr=Ct?Ct.prototype:void 0,dr=cr?cr.toString:void 0;var ur=function t(e){if("string"==typeof e)return e;if(ar(e))return sr(e,t)+"";if(lr(e))return dr?dr.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},hr=ur;var pr=Ln,mr=Qi,fr=rr,gr=function(t){return null==t?"":hr(t)};var vr=function(t,e){return pr(t)?t:mr(t,e)?[t]:fr(gr(t))},br=Gi;var yr=function(t){if("string"==typeof t||br(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},wr=bo,Cr=vr,Er=So,Sr=kt,Or=yr;var xr=function(t,e,n,o){if(!Sr(t))return t;for(var i=-1,r=(e=Cr(e,t)).length,s=r-1,a=t;null!=a&&++i<r;){var l=Or(e[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=s){var d=a[l];void 0===(c=o?o(d,l,a):void 0)&&(c=Sr(d)?d:Er(e[i+1])?[]:{})}wr(a,l,c),a=a[l]}return t};const Nr=V((function(t,e,n){return null==t?t:xr(t,e,n)}));var _r=vr,Ar=yr;var jr=function(t,e){for(var n=0,o=(e=_r(e,t)).length;null!=t&&n<o;)t=t[Ar(e[n++])];return n&&n==o?t:void 0};const Pr=V((function(t,e,n){var o=null==t?void 0:jr(t,e);return void 0===o?n:o})),Tr=Nr,Dr=t=>{const e={...t},n={string:()=>"",boolean:()=>!1,object:t=>Dr(t)};for(const o of Object.keys(t)){const i=typeof t[o];n[i]&&(e[o]=n[i](t[o]))}return e},kr=t=>Number.isInteger(Number(t)),$r=(t,e)=>{const n=e||t.parentElement;return Array.prototype.slice.call(n.childNodes).indexOf(t)},Lr=(t,e,n)=>{const o=n.split("||"),i=$i(e).map((e=>t.find((t=>{const n=o.find((e=>!!Pr(t,e)));return n&&Pr(t,n)===e})))).filter(Boolean).concat(t);return $i(i)},Ir=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},Mr=(t,e)=>{const n=[];return Ir(t,((t,o)=>n.push(e(t,o)))),n},Fr={},Rr=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),Wr=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Br={capitalize:Rr,safeAttrName:t=>{if(Fr[t])return Fr[t];const e=({className:"class"}[t]||t).replace(/^\d/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Fr[t]=e,e},forEach:Ir,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:Mr,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:$r,isInt:kr,get:Pr,orderObjectsBy:Lr,isIE:Wr},zr={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=zr.getStyle(t),i=parseInt(o.height,10),r=i/(e/60);t.style.height="0px",function e(){const o=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=zr.getStyle(t),i=parseInt(o.height),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=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"===zr.getStyle(t,"display"))=>{n?zr.slideDown(t,e):zr.slideUp(t,e)}},qr="no-transition",Ur={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onUpdate:t=>Hr.opts.debug&&void 0,onUpdateStage:t=>Hr.opts.debug&&void 0,onUpdateRow:t=>Hr.opts.debug&&void 0,onUpdateColumn:t=>Hr.opts.debug&&void 0,onUpdateField:t=>Hr.opts.debug&&void 0,onRender:t=>Hr.opts.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},Xr=({src:t,...e},n=W)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:Hr.opts.debug||Hr.opts.bubbles});return o.data=(t||document).dispatchEvent(o),o},Hr={init:function(t){return this.opts={...Ur,...t},this},formeoSaved:t=>Xr(t,R),formeoUpdated:t=>Xr(t,W),formeoCleared:t=>Xr(t,"formeoCleared"),formeoOnRender:t=>Xr(t,B),formeoConditionUpdated:t=>Xr(t,"formeoConditionUpdated")},Yr=qi((()=>{Hr.opts.onUpdate({timeStamp:window.performance.now(),type:W,detail:Dd.formData})}),M);let Gr;document.addEventListener(W,Yr),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;Hr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;Hr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;Hr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;Hr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener(B,(t=>{const{timeStamp:e,type:n,detail:o}=t;Hr.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},Hr.opts.confirmClearAll(t)})),document.addEventListener(R,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};Hr.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{Hr.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){Gr=Gr||window.requestAnimationFrame((()=>{Gr=!1,Object.values(_d.data).forEach((t=>{t.dom.classList.add(qr),jd.dom.classList.add(qr),jd.panels.nav.refresh(),t.refreshFieldPanels()}))}))}));var Vr=$e,Jr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Kr=function(t){return this.__data__.has(t)};function Zr(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Vr;++e<n;)this.add(t[e])}Zr.prototype.add=Zr.prototype.push=Jr,Zr.prototype.has=Kr;var Qr=Zr,ts=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},es=function(t,e){return t.has(e)};var ns=function(t,e,n,o,i,r){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(t),d=r.get(e);if(c&&d)return c==e&&d==t;var u=-1,h=!0,p=2&n?new Qr:void 0;for(r.set(t,e),r.set(e,t);++u<a;){var m=t[u],f=e[u];if(o)var g=s?o(f,m,u,e,t,r):o(m,f,u,t,e,r);if(void 0!==g){if(g)continue;h=!1;break}if(p){if(!ts(e,(function(t,e){if(!es(p,e)&&(m===t||i(m,t,n,o,r)))return p.push(e)}))){h=!1;break}}else if(m!==f&&!i(m,f,n,o,r)){h=!1;break}}return r.delete(t),r.delete(e),h};var os=dn,is=K,rs=ns,ss=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n},as=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},ls=Ct?Ct.prototype:void 0,cs=ls?ls.valueOf:void 0;var ds=function(t,e,n,o,i,r,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!r(new os(t),new os(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return is(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=ss;case"[object Set]":var l=1&o;if(a||(a=as),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;o|=2,s.set(t,e);var d=rs(a(t),a(e),o,i,r,s);return s.delete(t),d;case"[object Symbol]":if(cs)return cs.call(t)==cs.call(e)}return!1};var us=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t},hs=Ln;var ps=function(t,e,n){var o=e(t);return hs(t)?o:us(o,n(t))};var ms=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},fs=function(){return[]},gs=Object.prototype.propertyIsEnumerable,vs=Object.getOwnPropertySymbols,bs=vs?function(t){return null==t?[]:(t=Object(t),ms(vs(t),(function(e){return gs.call(t,e)})))}:fs,ys=bn(Object.keys,Object),ws=Cn,Cs=ys,Es=Object.prototype.hasOwnProperty;var Ss=To,Os=function(t){if(!ws(t))return Cs(t);var e=[];for(var n in Object(t))Es.call(t,n)&&"constructor"!=n&&e.push(n);return e},xs=Rn;var Ns=ps,_s=bs,As=function(t){return xs(t)?Ss(t):Os(t)};var js=function(t){return Ns(t,As,_s)},Ps=Object.prototype.hasOwnProperty;var Ts=function(t,e,n,o,i,r){var s=1&n,a=js(t),l=a.length;if(l!=js(e).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in e:Ps.call(e,d)))return!1}var u=r.get(t),h=r.get(e);if(u&&h)return u==e&&h==t;var p=!0;r.set(t,e),r.set(e,t);for(var m=s;++c<l;){var f=t[d=a[c]],g=e[d];if(o)var v=s?o(g,f,d,e,t,r):o(f,g,d,t,e,r);if(!(void 0===v?f===g||i(f,g,n,o,r):v)){p=!1;break}m||(m="constructor"==d)}if(p&&!m){var b=t.constructor,y=e.constructor;b==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(p=!1)}return r.delete(t),r.delete(e),p},Ds=ee(wt,"DataView"),ks=ne,$s=ee(wt,"Promise"),Ls=ee(wt,"Set"),Is=ee(wt,"WeakMap"),Ms=Dt,Fs=zt,Rs="[object Map]",Ws="[object Promise]",Bs="[object Set]",zs="[object WeakMap]",qs="[object DataView]",Us=Fs(Ds),Xs=Fs(ks),Hs=Fs($s),Ys=Fs(Ls),Gs=Fs(Is),Vs=Ms;(Ds&&Vs(new Ds(new ArrayBuffer(1)))!=qs||ks&&Vs(new ks)!=Rs||$s&&Vs($s.resolve())!=Ws||Ls&&Vs(new Ls)!=Bs||Is&&Vs(new Is)!=zs)&&(Vs=function(t){var e=Ms(t),n="[object Object]"==e?t.constructor:void 0,o=n?Fs(n):"";if(o)switch(o){case Us:return qs;case Xs:return Rs;case Hs:return Ws;case Ys:return Bs;case Gs:return zs}return e});var Js=Xe,Ks=ns,Zs=ds,Qs=Ts,ta=Vs,ea=Ln,na=Xn,oa=po,ia="[object Arguments]",ra="[object Array]",sa="[object Object]",aa=Object.prototype.hasOwnProperty;var la=function(t,e,n,o,i,r){var s=ea(t),a=ea(e),l=s?ra:ta(t),c=a?ra:ta(e),d=(l=l==ia?sa:l)==sa,u=(c=c==ia?sa:c)==sa,h=l==c;if(h&&na(t)){if(!na(e))return!1;s=!0,d=!1}if(h&&!d)return r||(r=new Js),s||oa(t)?Ks(t,e,n,o,i,r):Zs(t,e,l,n,o,i,r);if(!(1&n)){var p=d&&aa.call(t,"__wrapped__"),m=u&&aa.call(e,"__wrapped__");if(p||m){var f=p?t.value():t,g=m?e.value():e;return r||(r=new Js),i(f,g,n,o,r)}}return!!h&&(r||(r=new Js),Qs(t,e,n,o,i,r))},ca=Nn;var da=function t(e,n,o,i,r){return e===n||(null==e||null==n||!ca(e)&&!ca(n)?e!=e&&n!=n:la(e,n,o,i,t,r))},ua=da;const ha=V((function(t,e){return ua(t,e)}));class pa{constructor(t,n=Object.create(null)){e(this,"toJSON",((t,e)=>JSON.stringify(t,null,e))),e(this,"get",(t=>Pr(this.data,t))),e(this,"getChangeType",((t,e)=>{const n=k.find((({condition:n})=>n(t,e)))||{type:"unknown"};return n.desc="added"===n.type?`${t} to ${e}`:e,n})),e(this,"add",((t,e=Object.create(null))=>{const{id:n}=e,o=t||n||Li();return this.set(o,e)})),e(this,"remove",(t=>{const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?o.splice(Number(n),1):delete o[n],o})),e(this,"getData",(()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=(null==n?void 0:n.data)?n.getData():n,t)),{}))),e(this,"setCallbacks",{}),e(this,"configVal",Object.create(null)),this.name=t,this.data=n,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}set(t,e){const n=Pr(this.data,t);if(ha(n,e))return this.data;const o=Tr(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=this.getChangeType(n,e),r={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+t,value:e,data:o,change:`${i.type}: ${i.desc}`,src:this.dom};n&&(r.previousValue=n),Hr.formeoUpdated(r)}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))}empty(){this.data=Object.create(null)}}
9
9
  /**!
10
10
  * Sortable 1.15.3
11
11
  * @author RubaXa <trash@rubaxa.org>
12
12
  * @author owenm <owen23355@gmail.com>
13
13
  * @license MIT
14
- */function ma(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 ga(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ma(Object(n),!0).forEach((function(e){va(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ma(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function fa(t){return(fa="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 va(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ba(){return ba=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},ba.apply(this,arguments)}function ya(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 wa(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var xa=wa(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ca=wa(/Edge/i),Sa=wa(/firefox/i),Ea=wa(/safari/i)&&!wa(/chrome/i)&&!wa(/android/i),Oa=wa(/iP(ad|od|hone)/i),_a=wa(/chrome/i)&&wa(/android/i),Ma={capture:!1,passive:!1};function Na(t,e,n){t.addEventListener(e,n,!xa&&Ma)}function Aa(t,e,n){t.removeEventListener(e,n,!xa&&Ma)}function ja(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 Da(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&ja(t,e):ja(t,e))||o&&t===n)return t;if(t===n)break}while(t=ka(t))}return null}var Pa,za=/\s+/g;function Ta(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(za," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(za," ")}}function La(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 $a(t,e){var n="";if("string"==typeof t)n=t;else do{var o=La(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 Ha(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 Va(){var t=document.scrollingElement;return t||document.documentElement}function Ia(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,h;if(t!==window&&t.parentNode&&t!==Va()?(s=(r=t.getBoundingClientRect()).top,a=r.left,l=r.bottom,c=r.right,d=r.height,h=r.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!xa))do{if(i&&i.getBoundingClientRect&&("none"!==La(i,"transform")||n&&"static"!==La(i,"position"))){var u=i.getBoundingClientRect();s-=u.top+parseInt(La(i,"border-top-width")),a-=u.left+parseInt(La(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=$a(i||t),m=p&&p.a,g=p&&p.d;p&&(l=(s/=g)+(d/=g),c=(a/=m)+(h/=m))}return{top:s,left:a,bottom:l,right:c,width:h,height:d}}}function Fa(t,e,n){for(var o=Ua(t,!0),i=Ia(t)[e];o;){if(!(i>=Ia(o)[n]))return o;if(o===Va())break;o=Ua(o,!1)}return!1}function Ba(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==Zl.ghost&&(o||s[r]!==Zl.dragged)&&Da(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function Ra(t,e){for(var n=t.lastElementChild;n&&(n===Zl.ghost||"none"===La(n,"display")||e&&!ja(n,e));)n=n.previousElementSibling;return n||null}function Wa(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Zl.clone||e&&!ja(t,e)||n++;return n}function qa(t){var e=0,n=0,o=Va();if(t)do{var i=$a(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 Ua(t,e){if(!t||!t.getBoundingClientRect)return Va();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=La(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 Va();if(o||e)return n;o=!0}}}while(n=n.parentNode);return Va()}function Xa(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 Ga(t,e){return function(){if(!Pa){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),Pa=setTimeout((function(){Pa=void 0}),e)}}}function Ya(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Za(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 Ja(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if(Da(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=Ia(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 Ka="Sortable"+(new Date).getTime();function Qa(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==La(t,"display")&&t!==Zl.ghost){e.push({target:t,rect:Ia(t)});var n=ga({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=$a(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=Ia(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,h=$a(n,!0);h&&(a.top-=h.f,a.left-=h.e),n.toRect=a,n.thisAnimationDuration&&Xa(l,a)&&!Xa(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)),Xa(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){La(t,"transition",""),La(t,"transform","");var i=$a(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,La(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),La(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),La(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){La(t,"transition",""),La(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var tl=[],el={initializeByDefault:!0},nl={mount:function(t){for(var e in el)el.hasOwnProperty(e)&&!(e in t)&&(t[e]=el[e]);tl.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),tl.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";tl.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](ga({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](ga({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in tl.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,ba(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 tl.forEach((function(o){"function"==typeof o.eventProperties&&ba(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return tl.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var ol=["evt"],il=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=ya(n,ol);nl.pluginEvent.bind(Zl)(t,e,ga({dragEl:sl,parentEl:al,ghostEl:ll,rootEl:cl,nextEl:dl,lastDownEl:hl,cloneEl:ul,cloneHidden:pl,dragStarted:_l,putSortable:yl,activeSortable:Zl.active,originalEvent:o,oldIndex:ml,oldDraggableIndex:fl,newIndex:gl,newDraggableIndex:vl,hideGhostForTarget:Ul,unhideGhostForTarget:Xl,cloneNowHidden:function(){pl=!0},cloneNowShown:function(){pl=!1},dispatchSortableEvent:function(t){rl({sortable:e,name:t,originalEvent:o})}},i))};function rl(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,h=t.newDraggableIndex,u=t.originalEvent,p=t.putSortable,m=t.extraEventProperties;if(e=e||n&&n[Ka]){var g,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||xa||Ca?(g=document.createEvent("Event")).initEvent(o,!0,!0):g=new CustomEvent(o,{bubbles:!0,cancelable:!0}),g.to=s||n,g.from=a||n,g.item=i||n,g.clone=r,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=h,g.originalEvent=u,g.pullMode=p?p.lastPutMode:void 0;var b=ga(ga({},m),nl.getEventProperties(o,e));for(var y in b)g[y]=b[y];n&&n.dispatchEvent(g),f[v]&&f[v].call(e,g)}}(ga({putSortable:yl,cloneEl:ul,targetEl:sl,rootEl:cl,oldIndex:ml,oldDraggableIndex:fl,newIndex:gl,newDraggableIndex:vl},t))}var sl,al,ll,cl,dl,hl,ul,pl,ml,gl,fl,vl,bl,yl,wl,xl,Cl,Sl,El,Ol,_l,Ml,Nl,Al,jl,kl=!1,Dl=!1,Pl=[],zl=!1,Tl=!1,Ll=[],$l=!1,Hl=[],Vl="undefined"!=typeof document,Il=Oa,Fl=Ca||xa?"cssFloat":"float",Bl=Vl&&!_a&&!Oa&&"draggable"in document.createElement("div"),Rl=function(){if(Vl){if(xa)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Wl=function(t,e){var n=La(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Ba(t,0,e),r=Ba(t,1,e),s=i&&La(i),a=r&&La(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ia(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ia(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[Fl]||r&&"none"===n[Fl]&&l+c>o)?"vertical":"horizontal"},ql=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"==fa(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},Ul=function(){!Rl&&ll&&La(ll,"display","none")},Xl=function(){!Rl&&ll&&La(ll,"display","")};Vl&&!_a&&document.addEventListener("click",(function(t){if(Dl)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Dl=!1,!1}),!0);var Gl=function(t){if(sl){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,Pl.some((function(t){var e=t[Ka].options.emptyInsertThreshold;if(e&&!Ra(t)){var n=Ia(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[Ka]._onDragOver(n)}}var i,r,s},Yl=function(t){sl&&sl.parentNode[Ka]._isOutsideThisEl(t.target)};function Zl(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=ba({},e),t[Ka]=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 Wl(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!==Zl.supportPointer&&"PointerEvent"in window&&!Ea,emptyInsertThreshold:5};for(var o in nl.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in ql(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&Bl,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Na(t,"pointerdown",this._onTapStart):(Na(t,"mousedown",this._onTapStart),Na(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Na(t,"dragover",this),Na(t,"dragenter",this)),Pl.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),ba(this,Qa())}function Jl(t,e,n,o,i,r,s,a){var l,c,d=t[Ka],h=d.options.onMove;return!window.CustomEvent||xa||Ca?(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||Ia(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),h&&(c=h.call(d,l,s)),c}function Kl(t){t.draggable=!1}function Ql(){$l=!1}function tc(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 ec(t){return setTimeout(t,0)}function nc(t){return clearTimeout(t)}Zl.prototype={constructor:Zl,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Ml=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,sl):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){Hl.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Hl.push(o)}}(n),!sl&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Ea||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Da(a,o.draggable,n,!1))&&a.animated||hl===a)){if(ml=Wa(a),fl=Wa(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return rl({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),il("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=Da(l,o.trim(),n,!1))return rl({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),il("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!Da(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&&!sl&&n.parentNode===r){var l=Ia(n);if(cl=r,al=(sl=n).parentNode,dl=sl.nextSibling,hl=n,bl=s.group,Zl.dragged=sl,wl={target:sl,clientX:(e||t).clientX,clientY:(e||t).clientY},El=wl.clientX-l.left,Ol=wl.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,sl.style["will-change"]="all",o=function(){il("delayEnded",i,{evt:t}),Zl.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Sa&&i.nativeDraggable&&(sl.draggable=!0),i._triggerDragStart(t,e),rl({sortable:i,name:"choose",originalEvent:t}),Ta(sl,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Ha(sl,t.trim(),Kl)})),Na(a,"dragover",Gl),Na(a,"mousemove",Gl),Na(a,"touchmove",Gl),Na(a,"mouseup",i._onDrop),Na(a,"touchend",i._onDrop),Na(a,"touchcancel",i._onDrop),Sa&&this.nativeDraggable&&(this.options.touchStartThreshold=4,sl.draggable=!0),il("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Ca||xa))o();else{if(Zl.eventCanceled)return void this._onDrop();Na(a,"mouseup",i._disableDelayedDrag),Na(a,"touchend",i._disableDelayedDrag),Na(a,"touchcancel",i._disableDelayedDrag),Na(a,"mousemove",i._delayedDragTouchMoveHandler),Na(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Na(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(){sl&&Kl(sl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Aa(t,"mouseup",this._disableDelayedDrag),Aa(t,"touchend",this._disableDelayedDrag),Aa(t,"touchcancel",this._disableDelayedDrag),Aa(t,"mousemove",this._delayedDragTouchMoveHandler),Aa(t,"touchmove",this._delayedDragTouchMoveHandler),Aa(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Na(document,"pointermove",this._onTouchMove):Na(document,e?"touchmove":"mousemove",this._onTouchMove):(Na(sl,"dragend",this),Na(cl,"dragstart",this._onDragStart));try{document.selection?ec((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(kl=!1,cl&&sl){il("dragStarted",this,{evt:e}),this.nativeDraggable&&Na(document,"dragover",Yl);var n=this.options;!t&&Ta(sl,n.dragClass,!1),Ta(sl,n.ghostClass,!0),Zl.active=this,t&&this._appendGhost(),rl({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(xl){this._lastX=xl.clientX,this._lastY=xl.clientY,Ul();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(sl.parentNode[Ka]._isOutsideThisEl(t),e)do{if(e[Ka]){if(e[Ka]._onDragOver({clientX:xl.clientX,clientY:xl.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=ka(e));Xl()}},_onTouchMove:function(t){if(wl){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=ll&&$a(ll,!0),s=ll&&r&&r.a,a=ll&&r&&r.d,l=Il&&jl&&qa(jl),c=(i.clientX-wl.clientX+o.x)/(s||1)+(l?l[0]-Ll[0]:0)/(s||1),d=(i.clientY-wl.clientY+o.y)/(a||1)+(l?l[1]-Ll[1]:0)/(a||1);if(!Zl.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(ll){r?(r.e+=c-(Cl||0),r.f+=d-(Sl||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");La(ll,"webkitTransform",h),La(ll,"mozTransform",h),La(ll,"msTransform",h),La(ll,"transform",h),Cl=c,Sl=d,xl=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ll){var t=this.options.fallbackOnBody?document.body:cl,e=Ia(sl,!0,Il,!0,t),n=this.options;if(Il){for(jl=t;"static"===La(jl,"position")&&"none"===La(jl,"transform")&&jl!==document;)jl=jl.parentNode;jl!==document.body&&jl!==document.documentElement?(jl===document&&(jl=Va()),e.top+=jl.scrollTop,e.left+=jl.scrollLeft):jl=Va(),Ll=qa(jl)}Ta(ll=sl.cloneNode(!0),n.ghostClass,!1),Ta(ll,n.fallbackClass,!0),Ta(ll,n.dragClass,!0),La(ll,"transition",""),La(ll,"transform",""),La(ll,"box-sizing","border-box"),La(ll,"margin",0),La(ll,"top",e.top),La(ll,"left",e.left),La(ll,"width",e.width),La(ll,"height",e.height),La(ll,"opacity","0.8"),La(ll,"position",Il?"absolute":"fixed"),La(ll,"zIndex","100000"),La(ll,"pointerEvents","none"),Zl.ghost=ll,t.appendChild(ll),La(ll,"transform-origin",El/parseInt(ll.style.width)*100+"% "+Ol/parseInt(ll.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;il("dragStart",this,{evt:t}),Zl.eventCanceled?this._onDrop():(il("setupClone",this),Zl.eventCanceled||((ul=Za(sl)).removeAttribute("id"),ul.draggable=!1,ul.style["will-change"]="",this._hideClone(),Ta(ul,this.options.chosenClass,!1),Zl.clone=ul),n.cloneId=ec((function(){il("clone",n),Zl.eventCanceled||(n.options.removeCloneOnHide||cl.insertBefore(ul,sl),n._hideClone(),rl({sortable:n,name:"clone"}))})),!e&&Ta(sl,i.dragClass,!0),e?(Dl=!0,n._loopId=setInterval(n._emulateDragOver,50)):(Aa(document,"mouseup",n._onDrop),Aa(document,"touchend",n._onDrop),Aa(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,sl)),Na(document,"drop",n),La(sl,"transform","translateZ(0)")),kl=!0,n._dragStartId=ec(n._dragStarted.bind(n,e,t)),Na(document,"selectstart",n),_l=!0,Ea&&La(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=Zl.active,d=bl===l,h=a.sort,u=yl||c,p=this,m=!1;if(!$l){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=Da(s,a.draggable,r,!0),A("dragOver"),Zl.eventCanceled)return m;if(sl.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return k(!1);if(Dl=!1,c&&!a.disabled&&(d?h||(o=al!==cl):yl===this||(this.lastPutMode=bl.checkPull(this,c,sl,t))&&l.checkPut(this,c,sl,t))){if(i="vertical"===this._getDirection(t,s),e=Ia(sl),A("dragOverValid"),Zl.eventCanceled)return m;if(o)return al=cl,j(),this._hideClone(),A("revert"),Zl.eventCanceled||(dl?cl.insertBefore(sl,dl):cl.appendChild(sl)),k(!0);var g=Ra(r,a.draggable);if(!g||function(t,e,n){var o=Ia(Ra(n.el,n.options.draggable)),i=Ja(n.el,n.options,ll),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)&&!g.animated){if(g===sl)return k(!1);if(g&&r===t.target&&(s=g),s&&(n=Ia(s)),!1!==Jl(cl,r,sl,e,s,n,t,!!s))return j(),g&&g.nextSibling?r.insertBefore(sl,g.nextSibling):r.appendChild(sl),al=r,D(),k(!0)}else if(g&&function(t,e,n){var o=Ia(Ba(n.el,0,n.options,!0)),i=Ja(n.el,n.options,ll),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 f=Ba(r,0,a,!0);if(f===sl)return k(!1);if(n=Ia(s=f),!1!==Jl(cl,r,sl,e,s,n,t,!1))return j(),r.insertBefore(sl,f),al=r,D(),k(!0)}else if(s.parentNode===r){n=Ia(s);var v,b,y,w=sl.parentNode!==r,x=!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}(sl.animated&&sl.toRect||e,s.animated&&s.toRect||n,i),C=i?"top":"left",S=Fa(s,"top","top")||Fa(sl,"top","top"),E=S?S.scrollTop:void 0;if(Ml!==s&&(b=n[C],zl=!1,Tl=!x&&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,h=o?n.bottom:n.right,u=!1;if(!s)if(a&&Al<c*i){if(!zl&&(1===Nl?l>d+c*r/2:l<h-c*r/2)&&(zl=!0),zl)u=!0;else if(1===Nl?l<d+Al:l>h-Al)return-Nl}else if(l>d+c*(1-i)/2&&l<h-c*(1-i)/2)return function(t){return Wa(sl)<Wa(t)?1:-1}(e);if((u=u||s)&&(l<d+c*r/2||l>h-c*r/2))return l>d+c/2?1:-1;return 0}(t,s,n,i,x?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Tl,Ml===s),0!==v){var O=Wa(sl);do{O-=v,y=al.children[O]}while(y&&("none"===La(y,"display")||y===ll))}if(0===v||y===s)return k(!1);Ml=s,Nl=v;var _=s.nextElementSibling,M=!1,N=Jl(cl,r,sl,e,s,n,t,M=1===v);if(!1!==N)return 1!==N&&-1!==N||(M=1===N),$l=!0,setTimeout(Ql,30),j(),M&&!_?r.appendChild(sl):s.parentNode.insertBefore(sl,M?_:s),S&&Ya(S,0,E-S.scrollTop),al=sl.parentNode,void 0===b||Tl||(Al=Math.abs(b-Ia(s)[C])),D(),k(!0)}if(r.contains(sl))return k(!1)}return!1}function A(a,l){il(a,p,ga({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:h,fromSortable:u,target:s,completed:k,onMove:function(n,o){return Jl(cl,r,sl,e,n,Ia(n),t,o)},changed:D},l))}function j(){A("dragOverAnimationCapture"),p.captureAnimationState(),p!==u&&u.captureAnimationState()}function k(e){return A("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==u&&(Ta(sl,yl?yl.options.ghostClass:c.options.ghostClass,!1),Ta(sl,a.ghostClass,!0)),yl!==p&&p!==Zl.active?yl=p:p===Zl.active&&yl&&(yl=null),u===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){A("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(s===sl&&!sl.animated||s===r&&!s.animated)&&(Ml=null),a.dragoverBubble||t.rootEl||s===document||(sl.parentNode[Ka]._isOutsideThisEl(t.target),!e&&Gl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function D(){gl=Wa(sl),vl=Wa(sl,a.draggable),rl({sortable:p,name:"change",toEl:r,newIndex:gl,newDraggableIndex:vl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Aa(document,"mousemove",this._onTouchMove),Aa(document,"touchmove",this._onTouchMove),Aa(document,"pointermove",this._onTouchMove),Aa(document,"dragover",Gl),Aa(document,"mousemove",Gl),Aa(document,"touchmove",Gl)},_offUpEvents:function(){var t=this.el.ownerDocument;Aa(t,"mouseup",this._onDrop),Aa(t,"touchend",this._onDrop),Aa(t,"pointerup",this._onDrop),Aa(t,"touchcancel",this._onDrop),Aa(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;gl=Wa(sl),vl=Wa(sl,n.draggable),il("drop",this,{evt:t}),al=sl&&sl.parentNode,gl=Wa(sl),vl=Wa(sl,n.draggable),Zl.eventCanceled||(kl=!1,Tl=!1,zl=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),nc(this.cloneId),nc(this._dragStartId),this.nativeDraggable&&(Aa(document,"drop",this),Aa(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ea&&La(document.body,"user-select",""),La(sl,"transform",""),t&&(_l&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),ll&&ll.parentNode&&ll.parentNode.removeChild(ll),(cl===al||yl&&"clone"!==yl.lastPutMode)&&ul&&ul.parentNode&&ul.parentNode.removeChild(ul),sl&&(this.nativeDraggable&&Aa(sl,"dragend",this),Kl(sl),sl.style["will-change"]="",_l&&!kl&&Ta(sl,yl?yl.options.ghostClass:this.options.ghostClass,!1),Ta(sl,this.options.chosenClass,!1),rl({sortable:this,name:"unchoose",toEl:al,newIndex:null,newDraggableIndex:null,originalEvent:t}),cl!==al?(gl>=0&&(rl({rootEl:al,name:"add",toEl:al,fromEl:cl,originalEvent:t}),rl({sortable:this,name:"remove",toEl:al,originalEvent:t}),rl({rootEl:al,name:"sort",toEl:al,fromEl:cl,originalEvent:t}),rl({sortable:this,name:"sort",toEl:al,originalEvent:t})),yl&&yl.save()):gl!==ml&&gl>=0&&(rl({sortable:this,name:"update",toEl:al,originalEvent:t}),rl({sortable:this,name:"sort",toEl:al,originalEvent:t})),Zl.active&&(null!=gl&&-1!==gl||(gl=ml,vl=fl),rl({sortable:this,name:"end",toEl:al,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){il("nulling",this),cl=sl=al=ll=dl=ul=hl=pl=wl=xl=_l=gl=vl=ml=fl=Ml=Nl=yl=bl=Zl.dragged=Zl.ghost=Zl.clone=Zl.active=null,Hl.forEach((function(t){t.checked=!0})),Hl.length=Cl=Sl=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":sl&&(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++)Da(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||tc(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];Da(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 Da(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=nl.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&ql(n)},destroy:function(){il("destroy",this);var t=this.el;t[Ka]=null,Aa(t,"mousedown",this._onTapStart),Aa(t,"touchstart",this._onTapStart),Aa(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Aa(t,"dragover",this),Aa(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Pl.splice(Pl.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!pl){if(il("hideClone",this),Zl.eventCanceled)return;La(ul,"display","none"),this.options.removeCloneOnHide&&ul.parentNode&&ul.parentNode.removeChild(ul),pl=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(pl){if(il("showClone",this),Zl.eventCanceled)return;sl.parentNode!=cl||this.options.group.revertClone?dl?cl.insertBefore(ul,dl):cl.appendChild(ul):cl.insertBefore(ul,sl),this.options.group.revertClone&&this.animate(sl,ul),La(ul,"display",""),pl=!1}}else this._hideClone()}},Vl&&Na(document,"touchmove",(function(t){(Zl.active||kl)&&t.cancelable&&t.preventDefault()})),Zl.utils={on:Na,off:Aa,css:La,find:Ha,is:function(t,e){return!!Da(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:Ga,closest:Da,toggleClass:Ta,clone:Za,index:Wa,nextTick:ec,cancelNextTick:nc,detectDirection:Wl,getChild:Ba,expando:Ka},Zl.get=function(t){return t[Ka]},Zl.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&&(Zl.utils=ga(ga({},Zl.utils),t.utils)),nl.mount(t)}))},Zl.create=function(t,e){return new Zl(t,e)},Zl.version="1.15.3";var oc,ic,rc,sc,ac,lc,cc=[],dc=!1;function hc(){cc.forEach((function(t){clearInterval(t.pid)})),cc=[]}function uc(){clearInterval(lc)}var pc=Ga((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=Va(),d=!1;ic!==n&&(ic=n,hc(),oc=e.scroll,i=e.scrollFn,!0===oc&&(oc=Ua(n,!0)));var h=0,u=oc;do{var p=u,m=Ia(p),g=m.top,f=m.bottom,v=m.left,b=m.right,y=m.width,w=m.height,x=void 0,C=void 0,S=p.scrollWidth,E=p.scrollHeight,O=La(p),_=p.scrollLeft,M=p.scrollTop;p===c?(x=y<S&&("auto"===O.overflowX||"scroll"===O.overflowX||"visible"===O.overflowX),C=w<E&&("auto"===O.overflowY||"scroll"===O.overflowY||"visible"===O.overflowY)):(x=y<S&&("auto"===O.overflowX||"scroll"===O.overflowX),C=w<E&&("auto"===O.overflowY||"scroll"===O.overflowY));var N=x&&(Math.abs(b-r)<=a&&_+y<S)-(Math.abs(v-r)<=a&&!!_),A=C&&(Math.abs(f-s)<=a&&M+w<E)-(Math.abs(g-s)<=a&&!!M);if(!cc[h])for(var j=0;j<=h;j++)cc[j]||(cc[j]={});cc[h].vx==N&&cc[h].vy==A&&cc[h].el===p||(cc[h].el=p,cc[h].vx=N,cc[h].vy=A,clearInterval(cc[h].pid),0==N&&0==A||(d=!0,cc[h].pid=setInterval(function(){o&&0===this.layer&&Zl.active._onTouchMove(ac);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(Zl.dragged.parentNode[Ka],n,e,t,ac,cc[this.layer].el)||Ya(cc[this.layer].el,n,e)}.bind({layer:h}),24))),h++}while(e.bubbleScroll&&u!==c&&(u=Ua(u,!1)));dc=d}}),30),mc=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 gc(){}function fc(){}gc.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=Ba(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:mc},ba(gc,{pluginName:"revertOnSpill"}),fc.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:mc},ba(fc,{pluginName:"removeOnSpill"}),Zl.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?Na(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Na(document,"pointermove",this._handleFallbackAutoScroll):e.touches?Na(document,"touchmove",this._handleFallbackAutoScroll):Na(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?Aa(document,"dragover",this._handleAutoScroll):(Aa(document,"pointermove",this._handleFallbackAutoScroll),Aa(document,"touchmove",this._handleFallbackAutoScroll),Aa(document,"mousemove",this._handleFallbackAutoScroll)),uc(),hc(),clearTimeout(Pa),Pa=void 0},nulling:function(){ac=ic=oc=dc=lc=rc=sc=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(ac=t,e||this.options.forceAutoScrollFallback||Ca||xa||Ea){pc(t,this.options,r,e);var s=Ua(r,!0);!dc||lc&&o===rc&&i===sc||(lc&&uc(),lc=setInterval((function(){var r=Ua(document.elementFromPoint(o,i),!0);r!==s&&(s=r,hc()),pc(t,n.options,r,e)}),10),rc=o,sc=i)}else{if(!this.options.bubbleScroll||Ua(r,!0)===Va())return void hc();pc(t,this.options,Ua(r,!1),!1)}}},ba(t,{pluginName:"scroll",initializeByDefault:!0})}),Zl.mount(fc,gc);const vc={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(i.get("attributeNotPermitted",e||"")),bc.add.attrs(t);let n;e&&(n=String(window.prompt(t.message.value,"")),t.addAction(e,n))},option:t=>{t.addAction()},condition:t=>{t.addAction(t)}},click:{btn:t=>{t.action()}},save:{form:Vi}},bc={init:function(t){const e=Object.keys(vc);return this.opts=e.reduce(((e,n)=>(e[n]={...vc[n],...t[n]},e)),t),this},add:{attrs:t=>bc.opts.add.attr(t),options:t=>bc.opts.add.option(t),conditions:t=>(t.template={if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]},bc.opts.add.condition(t))},click:{btn:t=>bc.opts.click.btn(t)},save:{form:t=>(bc.opts.sessionStorage&&Ti.set(A,t),Ur.formeoSaved({formData:t}),bc.opts.save.form(t))}},yc=Object.freeze({type:"field",displayType:"slider"}),wc=t=>({transform:`translateX(${t?`${t}px`:0})`});class xc{constructor(t){e(this,"toggleTabbedLayout",(()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t})),e(this,"resizePanels",(()=>{this.toggleTabbedLayout();const t=this.panelsWrap.style,e=Nd.getStyle(this.currentPanel,"height");return t.height=e,e})),this.opts=ki(yc,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const n=this.createPanelsWrap();this.nav=this.navActions();const o=new window.ResizeObserver((([{contentRect:{width:t}}])=>{this.currentWidth!==t&&(this.toggleTabbedLayout(),this.currentWidth=t,this.nav.setTranslateX(this.activePanelIndex,!1))})),i=window.setTimeout((()=>{o.observe(n),window.clearTimeout(i)}),P)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(Nd.getStyle(t,"width"))>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||yc.displayType,this.panelDisplay}createPanelsWrap(){const t=Nd.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 Fr.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Zl.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=zr(t.target,t.target.parentElement);this.currentPanel=this.panels[e];const n=t.target.parentElement.childNodes;this.nav.refresh(e),Nd.removeClasses(n,"active-tab"),t.target.classList.add("active-tab")}},content:t.config.label}))),e={className:"panel-labels",content:{content:t}},[n]=t;return n.className="active-tab",Nd.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:i.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:Nd.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:i.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:Nd.icon("triangle-left")};return Nd.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=this.currentPanel.parentElement.childNodes;this.activePanelIndex=zr(this.currentPanel,e);let i={nav:0,panel:0},r={...i};t.groupChange=t=>{const e=n.children;return Nd.removeClasses(o,"active-panel"),Nd.removeClasses(e,"active-tab"),this.currentPanel=o[t],this.currentPanel.classList.add("active-panel"),e[t].classList.add("active-tab"),this.currentPanel};const s=({offset:t,reset:o,duration:i=D,animate:s=!this.isTabbed})=>{const a=[wc(r.panel),wc(t.panel)],l=[wc(r.nav),wc(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:s?i:0,fill:"forwards"},d=e.animate(a,c);n.animate(l,c);const h=()=>{this.panelsWrap.style.height=Nd.getStyle(this.currentPanel,"height"),d.removeEventListener("finish",h),o||(r=t)};d.addEventListener("finish",h)};return t.setTranslateX=(t=this.activePanelIndex,o=!0)=>{var r;r=t,i={nav:-n.offsetWidth*r,panel:-e.offsetWidth*r},s({offset:i,animate:o})},t.refresh=(e=this.activePanelIndex)=>{this.activePanelIndex!==e&&(this.activePanelIndex=e,t.groupChange(e)),t.setTranslateX(this.activePanelIndex),this.resizePanels()},t.nextGroup=()=>{const e=this.activePanelIndex+1;if(e!==o.length){const o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex++}else i={nav:r.nav-8,panel:r.panel-8},s({offset:i,reset:!0});return this.currentPanel},t.prevGroup=()=>{if(0!==this.activePanelIndex){const e=this.activePanelIndex-1,o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex--}else i={nav:8,panel:8},s({offset:i,reset:!0})},t}}const Cc="f-autocomplete",Sc="highlight-component";let Ec,Oc=Date.now();const _c=({name:t,id:e,...n})=>["config.label","attrs.id","meta.id"].reduce(((t,e)=>(t||(t=n.get(e)),t)),null)||"external"===t&&((...t)=>i.get(t.join("."))||kr(t.join(" ")))(t,e);class Mc{constructor(t,e,n){this.key=t,this.className=t.replace(/\./g,"-"),this.value=e,this.events=[],this.i18nKey=n,this.build()}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(`${this.className}-focused`);const n=Nd.toggleElementsByStr(this.list.querySelectorAll("li"),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(`${this.className}-focused`),e.removeEventListener("keydown",t),this.hideList()},input:t=>{const e=Nd.toggleElementsByStr(this.list.querySelectorAll("li"),t.target.value);if(0===t.target.value.length&&this.clearValue(),0===e.length)this.hideList();else{const t=this.getActiveOption()||e[0];this.showList(t)}this.hiddenField.value=t.target.value,this.value=t.target.value,this.runEvent("onChange",{target:this.hiddenField})}};return this.displayField=Nd.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:`${Cc}-display-field`,value:this.label||this.value,placeholder:i.get(`${this.i18nKey}.${this.key}.placeholder`)}}),this.hiddenField=Nd.create({tag:"input",attrs:{type:"hidden",className:this.className,value:this.value}}),this.list=Nd.create({tag:"ul",attrs:{className:`${Cc}-list`}}),this.dom=Nd.create({children:[this.displayField,this.hiddenField,this.list],className:this.className,action:{onRender:()=>{const t=this.value&&_d.getAddress(this.value);this.label=t&&_c(t),this.label&&(this.displayField.value=this.label),this.updateOptions()}}}),this.dom}updateOptions(){const t=Date.now();t-Oc>P&&(Nd.empty(this.list),this.generateOptions(),Oc=t);(Ec||this.generateOptions()).forEach((t=>this.list.appendChild(t)))}generateOptions(){const t=(t=>{const e=[],n=_d.flatList();return Object.entries(n).map((([n,o])=>{const i=_c(o);if(i){const r={tag:"span",content:` ${kr(o.name)}`,className:"component-type"},s=`${o.name}.${i}`;e.push(s);const a=((t,e)=>t.reduce(((t,n)=>t+(n===e)),0))(e,s),l={tag:"span",content:a>1&&`(${a})`,className:"component-label-count"};return Nd.makeOption([n,[`${i} `,l,r]],t)}})).filter(Boolean)})(),e=t=>{const e=`${Cc}-list-item`;return t.classList.contains(e)||(t=t.parentElement),t};return Ec=t.map((t=>{const n=t.value;let[o]=t.label;o=o.trim();const i={tag:"li",children:t.label,dataset:{value:n,label:o},className:`${Cc}-list-item`,action:{mousedown:({target:t})=>{t=e(t),this.setValue(t),this.selectOption(t),this.hideList()},mouseover:({target:t})=>{t=e(t),this.removeHighlight(),this.highlightComponent(t)}}};return Nd.create(i)})),Ec}hideList(t=this.list){Br.slideUp(t,D),this.removeHighlight()}showList(t,e=this.list){this.selectOption(t),Br.slideDown(e,D)}getActiveOption(t=this.list){const e=t.getElementsByClassName("active-option")[0];return e&&"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(let o=0;o<n.length;o++){const{dataset:{value:t}}=n[o];if(n[o].classList.remove("active-option"),t){const e=_d.getAddress(t);e.dom&&e.dom.classList.remove(Sc)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(Sc);for(let e=0;e<t.length;e++)t[e].classList.remove(Sc)}highlightComponent(t){const{dataset:{value:e}}=t;if(e){const t=_d.getAddress(e);t.dom&&t.dom.classList.add(Sc)}}clearValue(){this.selectOption(null),this.displayField.value="",this.hiddenField.value="",this.value="",this.runEvent("onChange",{target:this.hiddenField})}setValue(t){const{label:e,value:n}=t.dataset;this.displayField.value=e,this.hiddenField.value=n,this.value=n,this.runEvent("onChange",{target:this.hiddenField})}addEvent(t,e){this.events.push([t,e])}runEvent(t,e){this.events.forEach((([n,o])=>{n===t&&o(e)}))}}const Nc=(t,e)=>{const n=(t=>{const e=$i(t),n={"field.property":H,...V},o=e?(i=t,_d.getAddress(i).getData()):n[t];var i;return Object.keys(o).reduce(((t,e)=>(t[e]=e,t)),{})})(t);return Object.entries(n).reduce(((n,[o,r])=>{if("id"!==o){const s={tag:"option",content:i.get(`${t}.${o}`)||o.toLowerCase(),attrs:{value:r}};e===r&&(s.attrs.selected=!0),n.push(Nd.create(s))}return n}),[])},Ac=(t,e)=>{Nd.empty(t),e.forEach((e=>t.add(e)))},jc=({key:t,value:e,type:n="text",checked:o})=>{const r={tag:"input",attrs:{type:n,value:e,placeholder:i.get(`${t}.placeholder`)||kr(t)},className:t.replace(/\./g,"-"),config:{}};return o&&(r.attrs.checked=!0),r},kc=t=>{const e=i.get(t);if(e)return e;const n=t.split(".");return i.get(n[n.length-1])},Dc={autocomplete:(t,e,n)=>new Mc(t,e,n),string:(t,e)=>jc({key:t,value:e}),boolean:(t,e)=>jc({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:e}),number:(t,e)=>jc({key:t,value:e,type:"number"}),array:(t,e=[])=>({tag:"select",attrs:{placeholder:kc(`placeholder.${t}`)},className:t.replace(/\./g,"-"),options:e}),object:t=>Object.entries(t).map((([t,e])=>Dc[Nd.childType(e)](t,e)))},Pc=["selected","checked"],zc={boolean:(t,e)=>({click:({target:{checked:n}})=>{var o,i;"radio"===(null==(i=null==(o=e.data)?void 0:o.attrs)?void 0:i.type)&&e.set("options",e.data.options.map((t=>({...t,selected:!1})))),e.set(t,n),e.updatePreview()}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n)}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n)),e.updatePreview()}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n),e.updatePreview()}}),object:()=>({})};class Tc{constructor({key:t,data:n,index:o,field:r}){e(this,"generateConditionFields",((t,e)=>{const n={tag:"label",className:`condition-label ${t}-condition-label`,content:i.get(t)||t};return e.map(((e,o)=>{const i=[],r=Object.entries(e).map((([e,n])=>{const r=this.conditionInput(e,n,t,o);return r&&i.push([r.className,n.trim()].filter(Boolean).join("-")),r})).filter(Boolean),s=Tr(r,$.map((t=>`condition-${t}`)),"className||dom.className");return this.processConditionUIState(s),o||s.unshift(n),this.itemFieldGroups.push(s),{children:s,className:`f-condition-row ${t}-condition-row ${i.join(" ")}`}}))})),e(this,"processConditionUIState",(t=>{const e=e=>(e=e.split("|"),t.filter((t=>e.includes(t.className)))),n=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.style.display="none"})),clearTimeout(e)}),k)},o=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.removeAttribute("style")})),clearTimeout(e)}),k)},i=new Map([["condition-source",t=>{const i=e("condition-sourceProperty"),r=i[0],s=$i(t.value)?t.value:"field.property",a=Nc(s,r.value);return Ac(r,a),t.value?o(i):n(i)}],["condition-target",t=>{const i=e("condition-targetProperty");return Li(t.value)&&t.value?o(i):n(i)}],["condition-sourceProperty",t=>{const i=e("condition-comparison|condition-targetProperty|condition-target"),r=t.value;return(t=>/^is|^has/.test(t))(r.substring(r.lastIndexOf(".")+1,r.length))?n(i):o(i)}]]);t.forEach((t=>{const e=i.get(t.className);e&&e(t)}))})),e(this,"conditionInput",((t,e,n,o)=>{const i=this.field,r=`${this.itemKey}.${n}.${o}`,s=`${this.field.id}.${r}`,a=`${i.name}s.${s}.${t}`,l=(t,e,n)=>{const o=Nc(n||t,e),i=Dc.array(`condition.${t}`);i.action={change:c,onRender:t=>c({target:t})};const r=Nd.create(i);return Ac(r,o),r},c=({target:t})=>{const e=t.closest(".f-condition-row"),n=new RegExp(`${t.className}(?:\\S?)+`,"gm");e.className=e.className.replace(n,""),e.classList.add([t.className,t.value].filter(Boolean).join("-"));const o={dataPath:a,value:t.value,src:t};Ur.formeoUpdated(o),_d.setAddress(a,t.value);const i=t.closest(".f-condition-row"),r=zr(i);this.processConditionUIState(this.itemFieldGroups[r])},d={comparison:t=>l("comparison",t),logical:t=>l("logical",t),source:(t,e="source")=>{const o=Dc.autocomplete(`condition.${e}`,t,n);return _d.setConditionMap(t,i),o.addEvent("onChange",(t=>{_d.removeConditionMap(_d.getAddress(a)),c(t),_d.setConditionMap(t.target.value,i)})),o},sourceProperty:t=>l("sourceProperty",t,"field.property"),targetProperty:t=>l("targetProperty",t,"field.property"),target:t=>d.source(t,"target"),value:t=>{const e=Dc.string("condition.value",t);return e.action={input:c},Nd.create(e)},assignment:t=>l("assignment",t)};if(d[t])return d[t](e)})),this.itemValues=Tr(Object.entries(n),Pc,"0");const[s,a]=t.split(".");this.field=r,this.itemKey=t,this.itemIndex=o,this.panelName=s,this.isDisabled=r.isDisabledProp(a,s),this.isHidden=this.isDisabled&&r.config.panels[s].hideDisabled,this.isLocked=r.isLockedProp(a,s),this.dom=Nd.create({tag:"li",className:[`field-${t.replace(/\./g,"-")}`,"prop-wrap",this.isHidden&&"hidden-property"],children:{className:"field-prop",children:[this.itemInputs,this.itemControls]}})}get itemInputs(){this.itemFieldGroups=[];return{className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map((([t,e])=>{let n="conditions"===this.panelName?this.generateConditionFields(t,e):this.itemInput(t,e);return["selected","checked"].includes(t)&&(n={className:"f-addon",children:n}),n}))}}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:()=>{Br.slideUp(this.dom,250,(t=>{this.field.remove(this.itemKey),Nd.remove(t),this.field.resizePanelWrap()}))}},content:Nd.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=Nd.childType(e)||"string",o={config:{},attrs:{},...Dc[n](t,e)},i=this.itemKey.replace(/.\d+$/,(e=>`${e}.${t}`)),r=i.split(".").filter(Number.isNaN).join("."),[s,a]=[[...this.itemKey.split("."),t],[t]].map((t=>[this.field.id,...t].filter(Boolean).join("-")));return o.config={...o.config,label:"options"!==this.panelName&&kc(r),labelAfter:!1},o.attrs={...o.attrs,name:"checkbox"===o.attrs.type?`${a}[]`:a,id:s,disabled:this.isDisabled,locked:this.isLocked},o.action={...zc[n](i,this.field)},o}}class Lc{constructor(t,n,o){e(this,"addAttribute",((t,e)=>{const n=Dr(t),o=`attrs.${n}`;i.current[o]||i.put(o,Vr(t)),"string"==typeof e&&["true","false"].includes(e)&&(e=JSON.parse(e)),this.field.set(`attrs.${t}`,e);const r=this.props.querySelector(`.field-attrs-${n}`),s=new Tc({key:o,data:{[n]:e},field:this.field});r?this.props.replaceChild(s.dom,r):this.props.appendChild(s.dom),this.field.resizePanelWrap()})),e(this,"addOption",(()=>{const t=this.field.data.meta.id,e=this.field.get("options"),n="select"===t?"option":t,o=i.get("newOptionLabel",{type:n})||"New Option",r=`options.${this.data.length}`,s={...e.length?Mr(e[e.length-1]):{},label:o,value:Dr(o)},a=new Tc({key:r,data:s,field:this.field,index:this.props.children.length});this.editPanelItems.push(a),this.props.appendChild(a.dom),this.field.set(r,s),this.field.resizePanelWrap()})),e(this,"addCondition",(t=>{const e=`conditions.${this.field.get("conditions").length}`,n=this.props.querySelector(`.field-${e.replace(".","-")}`),o=new Tc({key:e,data:t.template,field:this.field});n?this.props.replaceChild(o.dom,n):this.props.appendChild(o.dom),this.field.set(e,t.template),this.field.resizePanelWrap()})),this.type=Nd.childType(t),this.data="object"===this.type?Object.entries(t):t,this.name=n,this.field=o,this.panelConfig=this.getPanelConfig(this.data)}getPanelConfig(t){return this.props=this.createProps(t),this.editButtons=this.createEditButtons(),{id:`${this.field.id}-${this.name}-panel`,config:{label:i.get(`panel.label.${this.name}`)},attrs:{className:`f-panel ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(t){this.editPanelItems=Array.from(t).map(((t,e)=>{const n="array"===this.type,o=[this.name,n?String(e):t[0]].join("."),i=n?t:{[t[0]]:t[1]};return new Tc({key:o,data:i,field:this.field})}));const e={tag:"ul",attrs:{className:["field-edit-group",`field-edit-${this.name}`]},editGroup:this.name,isSortable:"options"===this.name,content:this.editPanelItems};return Nd.create(e)}createEditButtons(){const t=this,e=this.name,n=i.get(`panelEditButtons.${e}`),o={attrs:t.addAttribute,options:t.addOption,conditions:t.addCondition};return{className:"panel-action-buttons",content:[{...Nd.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:n=>{const r={btnCoords:Nd.coords(n.target),addAction:o[e]};"attrs"===e&&(r.isDisabled=t.field.isDisabledProp,r.isLocked=t.field.isLockedProp,r.message={attr:i.get(`action.add.${e}.attr`),value:i.get(`action.add.${e}.value`)});const s=kr(e),a=new window.CustomEvent(`onAdd${s}`,{detail:r});bc.add[e](r),document.dispatchEvent(a)}}}]}}}class $c extends pa{constructor(t,n={},o){super(t,{...n,id:n.id||ji()}),e(this,"mutationHandler",(t=>t.map((t=>{})))),e(this,"remove",(t=>{if(t){const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?Pr(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 Lr(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(_d.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),_d[`${this.name}s`].delete(this.id)})),e(this,"emptyClass",(()=>this.dom.classList.toggle("empty",!this.children.length))),e(this,"getComponentTag",(()=>Nd.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&Nd.icon("component-corner",["bottom-left"]),Nd.icon(`handle-${this.name}`),kr(this.name),(this.isColumn||this.isRow)&&Nd.icon("component-corner",["bottom-right"])].filter(Boolean)}))),e(this,"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[Nd.childType(t)](this.dom)})),e(this,"loadChildren",((t=this.data.children)=>t.map((t=>this.addChild({id:t}))))),e(this,"saveChildOrder",(()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t})),e(this,"onSort",(()=>this.saveChildOrder())),e(this,"onEnd",(({to:{parentElement:t},from:{parentElement:e}})=>{null==t||t.classList.remove(`hovering-${Ni(t)}`),null==e||e.classList.remove(`hovering-${Ni(e)}`)})),e(this,"runConditions",(()=>{const t=this.get("conditions");if(!(null==t?void 0: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)))}))})),e(this,"value",((t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!H[i]].some(Boolean)?t:e?o.set(H[i],e):o.get(H[i])})),e(this,"getResult",(t=>({"=":(t,e,n)=>t.set(e,n)}[t]))),e(this,"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)}})))),e(this,"execResults",(t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)})),e(this,"execResult",(({target:t,action:e,value:n,propertyPath:o})=>new Promise(((o,i)=>{try{return o(e(t,n))}catch(r){return i(r)}})))),e(this,"cloneData",(()=>{const t={...Di(this.data),id:ji()};return"field"!==this.name&&(t.children=[]),t})),e(this,"clone",((t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),e})),e(this,"createChildWrap",(t=>Nd.create({tag:"ul",attrs:{className:"children"},children:t}))),this.id=this.data.id,this.name=t,this.config=_d[`${this.name}s`].config,ki(this.config,n.config),this.dataPath=`${this.name}s.${this.id}.`,this.observer=new MutationObserver(this.mutationHandler),this.render=o}observe(t){this.observer.disconnect(),this.observer.observe(t,{childList:!0})}get js(){return this.data}get json(){return this.data}empty(){const t=this.children.map((t=>t.remove()));return this.data.children=this.data.children.filter((e=>-1===t.indexOf(e))),this.dom.classList.add("empty"),t}getActionButtons(){const t=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:({target:e})=>{_d.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),_d.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...Nd.btnTemplate({content:Nd.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}toggleEdit(t=!this.isEditing){this.isEditing=t;const e=this.dom,n="editing",o=`${n}-${this.name}`,i=this.dom.querySelector(`.${this.name}-edit`);Br.slideToggle(i,k,t),"field"===this.name&&(Br.slideToggle(this.preview,k,!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}`)=>({...Nd.btnTemplate({content:Nd.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...Nd.btnTemplate({content:Nd.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...Nd.btnTemplate({content:Nd.icon(t)}),className:["item-edit-toggle"],meta:{id:"edit"},action:{click:t=>{this.toggleEdit()}}}),remove:(t="remove")=>({...Nd.btnTemplate({content:Nd.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:(t,e)=>{Br.slideUp(this.dom,k,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...Nd.btnTemplate({content:Nd.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=>{var n;return(null==(n=t[e])?void 0:n.call(t))||e}));return this.actionButtons=o,this.actionButtons}get index(){return zr(this.dom)}get parentType(){return _.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${y[t]}`);return e&&Nd.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=O.get(this.name);return $r(t,(t=>_d.getAddress(`${e}s.${t.id}`))).filter(Boolean)}get domChildren(){const t=this.dom.querySelector(".children");return t?t.children:[]}addChild(t={},e=this.domChildren.length){var n,o;let i=t;"object"!=typeof t&&(i={id:i});const r=this.dom.querySelector(".children"),{id:s=ji()}=i,a=O.get(this.name);if(!a)return null;const l=`${a}s`,c=_d.getAddress(`${l}.${s}`)||_d[l].add(s,i);r.insertBefore(c.dom,r.children[e]),null==(o=null==(n=this.config.events)?void 0:n.onAddChild)||o.call(n,{parent:this,child:c});const d=c.get("children");return(null==d?void 0:d.length)&&c.loadChildren(d),this.removeClasses("empty"),this.saveChildOrder(),c}onAdd({from:t,to:e,item:n,newIndex:o}){var i;t.classList.contains(a)||(t=t.parentElement);const r=Ni(t),s=Ni(e.parentElement),l=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=zr(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),c={controls:()=>{const{controlData:t}=od.get(n.id),{meta:{id:e}}=t,i=e.startsWith("layout-")?e.replace(/^layout-/,""):"field",r=Or({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}`),s=l.get(r)();Nd.remove(n);return s(t,o)},row:()=>{const t=(l.get({stage:-1,row:0,column:1}[s])||Vi)();return null==t?void 0:t({id:n.id},o)},column:()=>{const t=(l.get({stage:-2,row:-1}[s])||Vi)();return null==t?void 0:t(n.id)}},d=null==(i=c[r])?void 0:i.call(c,n,o);return(()=>{this.saveChildOrder(),this.removeClasses("empty")})(),d}onRemove({from:{parentElement:t}}){return t.classList.contains(d)&&t.classList.remove("column-editing-field"),"stage"===this.name||this.children.length?(this.emptyClass(),this.saveChildOrder()):this.remove()}onRender(){const{events:t}=this.config;if(!t)return null;t.onRender&&Nd.onRender(this.dom,t.onRender)}set config(t){const e=Or(this.data,"meta.id"),n=[Or(t,"all"),e&&Or(t,e),Or(t,this.id)].reduce(((t,e)=>e?ki(t,e):t),this.configVal);this.configVal=n}get config(){return this.configVal}getComponent(t){const[e,n]=t.split("."),o=_d[e];return n===this.id?this:null==o?void 0:o.get(n)}cloneChildren(t){for(const e of this.children)null==e||e.clone(t)}get isRow(){return this.name===v.row}get isColumn(){return this.name===v.column}get isField(){return this.name===v.field}}class Hc extends $c{constructor(t=Object.create(null)){super("field",{conditions:[{if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]}],...t}),e(this,"updateConditionsPanel",(()=>{const t=setTimeout((()=>{const e=this.editPanels.find((({name:t})=>"conditions"===t));if(!e)return null;const n=e.createProps(),o=this.dom.querySelector(".field-edit-conditions");o.parentElement.replaceChild(n,o),clearTimeout(t)}),k)})),e(this,"updatePreview",Hi((()=>{if(!this.preview.parentElement)return null;this.updateLabel();const t=Nd.create(this.fieldPreview(),!0);this.preview.parentElement.replaceChild(t,this.preview),this.preview=t}),k)),e(this,"isDisabledProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get(`config.disabled${kr(e)}`)).includes(t)})),e(this,"isLockedProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get(`config.locked${kr(e)}`)).includes(t)})),this.label=Nd.create(this.labelConfig),this.preview=Nd.create({}),this.editPanels=[];const n=this.getActionButtons(),o=this.actionButtons.some((t=>{var e;return"edit"===(null==(e=t.meta)?void 0:e.id)}));let r={tag:"li",attrs:{className:h},id:this.id,children:[this.label,this.getComponentTag(),n,o&&this.fieldEdit,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:i.get("field")}};r=Nd.create(r),this.observe(r),this.dom=r,this.isEditing=!1,this.onRender(r)}get labelConfig(){if(!!this.get("config.hideLabel"))return;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,value:o}})=>{super.set("config.label",n?o:t);const i=_d.getConditionMap(`fields.${this.id}`);if(i)return i.updateConditionSourceLabel(`${this.name}s.${this.id}`,n?o:e)}}},e&&Nd.requiredMark()]}}updateConditionSourceLabel(t,e){const n=this.editPanels.find((({name:t})=>"conditions"===t));if(!n)return null;for(const{itemFieldGroups:o}of n.editPanelItems)for(const n of o){const o=n.find((e=>e.value===t));o&&(o.displayField.value=e)}}set(...t){const[e,n]=t,o=super.set(e,n);return this.updatePreview(),o}updateLabel(){if(!this.label)return null;const t=Nd.create(this.labelConfig);this.label.parentElement.replaceChild(t,this.label),this.label=t}get fieldEdit(){this.editPanels=[];const t=["object","array"],e=["config","meta","action","events",...this.config.panels.disabled],n=Ai([...this.config.panels.order,...Object.keys(this.data)]).filter((t=>!e.includes(t))),o={className:["field-edit","slide-toggle","formeo-panels-wrap"]};for(const s of n){const e=this.get(s),n=Nd.childType(e);if(t.includes(n)){const t=new Lc(e,s,this);this.editPanels.push(t)}}const i={panels:this.editPanels.map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"},r=this.editPanels.length;return r&&(this.panels=new xc(i),o.className.push(`panel-count-${r}`),o.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh,o.action={onRender:()=>{if(this.resizePanelWrap(),!r){const t=this.dom,e=t.querySelector(".item-edit-toggle"),n=t.querySelector(".field-actions"),o=n.getElementsByTagName("button");n.style.maxWidth=o.length*o[0].clientWidth+"px",Nd.remove(e)}}}),o}get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{checked:n,type:o}=e;if(["checkbox","radio"].includes(o)){const t=+e.id.split("-").pop();"radio"===o&&this.set("options",this.get("options").map((t=>({...t,selected:!1}))));const i="checkbox"===o?"checked":"selected";this.set(`options.${t}.${i}`,n)}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:t=>{["input","meter","progress","button"].includes(this.data.tag)&&super.set("attrs.value",t.target.value),t.target.contentEditable&&super.set("content",t.target.innerHTML)}}}fieldPreview(){var t;const e=Di(this.data),{action:n={}}=od.get(e.meta.id);e.id=`prev-${this.id}`,e.action=n,(null==(t=this.data)?void 0:t.config.editableContent)&&(e.attrs={...e.attrs,contenteditable:!0});return{attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:Nd.create(e,!0),action:this.defaultPreviewActions}}}const Vc={js:new Set,css:new Set},Ic=(t,e)=>{t.removeEventListener("load",Ic),t.rel="stylesheet",e(t.src)},Fc=(t,e)=>{t.removeEventListener("load",Fc),e(t.src)},Bc=t=>new Promise(((e,n)=>{if(Vc.js.has(t))return e(t);Vc.js.add(t);const o=Nd.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:`//${t.replace(/^https?:\/\//,"")}`},action:{load:()=>Fc(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Rc=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(Vc.css.has(t))return e(t);Vc.css.add(t);const o=Nd.create({tag:"link",attrs:{rel:"preload",href:t,as:"style"},action:{load:()=>Ic(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Wc=t=>("string"==typeof t?Promise.resolve(t):t.text()).then((t=>{const e="formeo-sprite";let n=document.getElementById(e);return n||(n=Nd.create({id:e,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(n,document.body.childNodes[0])),n})),qc=(t,e,n=Ii)=>new Promise(((o,i)=>fetch(t).then((t=>o(e?e(t):t))).catch((t=>i(new Error(n(t))))))),Uc={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Bc(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Rc(t)));return Promise.all(e)}},Xc=t=>{const e=Object.entries(t).map((([t,e])=>Uc[t](e)));return Promise.all(e)};class Gc{constructor({events:t={},dependencies:n={},controlAction:o,...i}){e(this,"controlCache",new Set),this.events=t,this.controlData=i,this.controlAction=o,this.dependencies=n,this.id=i.id||ji()}get controlId(){var t;return null==(t=this.controlData.meta)?void 0:t.id}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:Nd.icon(t.icon)},n],action:{focus:({target:t})=>{const e=t.closest(`.${a}`);return e&&od.panels.nav.refresh(zr(e))},click:({target:t})=>{od.addElement(t.parentElement.id)}}};return Nd.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return Xc(this.dependencies)}i18n(t,e){var n,o;const r=i.locale,s=null==(n=this.definition)?void 0:n.i18n,a=(null==s?void 0:s[r])||{};return((null==(o=a[t])?void 0:o.call(a))??a[t])||i.get(t,e)}}const Yc=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}];const Zc=(t,e=3)=>Array.from({length:e},((t,e)=>e+1)).map((e=>{const n="checkbox"===t?"checked":"selected";return{label:i.get("labelCount",{label:kr(t),count:e}),value:`${t}-${e}`,[n]:!e}}));const Jc=[class extends Gc{constructor(){super({tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:i.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:i.get("button"),type:["button","submit","reset"].map(((t,e)=>({label:t,type:t}))),className:[{label:"default",value:"",selected:!0},{label:"primary",value:"primary"},{label:"danger",value:"error"},{label:"success",value:"success"},{label:"warning",value:"warning"}]}]})}},class extends Gc{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:i.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends Gc{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:i.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends Gc{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:i.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends Gc{constructor(){super({tag:"textarea",config:{label:i.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends Gc{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:i.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends Gc{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:i.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends Gc{constructor(){super({tag:"select",config:{label:i.get("controls.form.select")},attrs:{required:!1,className:""},meta:{group:"common",icon:"select",id:"select"},options:Zc("option")})}},class extends Gc{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:i.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:Zc("checkbox",1)})}},class extends Gc{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:i.get("controls.form.radio-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:Zc("radio")})}}],Kc=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),Qc="controls.html.header";const td=[class extends Gc{constructor(){super({tag:Kc[0],attrs:{tag:Kc.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:i.get(Qc),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:i.get(Qc),action:{onRender:t=>{},click:t=>{}}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(Qc)}},class extends Gc{constructor(){super({tag:"p",attrs:{className:""},config:{label:i.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 Gc{constructor(){super({tag:"hr",config:{label:i.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends Gc{constructor(t){super(ki({tag:"textarea",config:{label:"WYSIWYG",editableContent:!0},meta:{group:"html",icon:"rich-text",id:"tinymce"},attrs:{required:!1},dependencies:{js:"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))}}],ed=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"}}),nd=[...Jc,...td,...Yc];const od=new class{constructor(){e(this,"groupLabel",(t=>i.get(t)||t||"")),e(this,"addElement",(t=>{const e=Or(this.get(t),"controlData"),{meta:{group:n,id:o}}=e,i={row:()=>yd.active.addChild(),column:()=>i.row().addChild(),field:t=>i.column().addChild(t)};return"layout"!==n?i.field(e):i[o.replace("layout-","")]()})),e(this,"applyOptions",(async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=ki(ed,t);return this.container=e,this.groupOrder=Ai(o.concat(["common","html","layout"])),this.options=i,Promise.all(this.registerControls([...nd,...n]))})),this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${a}`);return e&&this.panels.nav.refresh(zr(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((async t=>{let e;return e="function"==typeof t?new t:new Gc(t),this.add(e),this.controls.push(e.dom),e.promise()}))}groupElements(){let t=this.options.groups.slice(),e=this.controls.slice(),n=[];const o=[];return t=Tr(t,this.groupOrder,"id"),t=t.filter((t=>Mi(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:a,id:`${t.id}-${a}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=Ai(e.concat(t.elementOrder));t.elementOrder=n}return e=Tr(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=[Mi(i,this.options.disable.elements),n.meta.group===t.id,!o.includes(n.meta.id)].every((t=>!0===t)),r&&o.push(i),r})),n})),n}add(t=Object.create(null)){const e=Di(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 this.data.get(t)}formActions(){if(!0===this.options.disable.formActions)return null;const t={...Nd.btnTemplate({content:[Nd.icon("bin"),i.get("clear")],title:i.get("clearAll")}),className:["clear-form"],action:{click:t=>{wd.size?(Ur.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:i.get("confirmClearAll"),clearAllAction:()=>{yd.clearAll().then((()=>{const e={src:t.target};Ur.formeoCleared(e)}))},btnCoords:Nd.coords(t.target)}}),document.dispatchEvent(Ur.confirmClearAll)):window.alert(i.get("cannotClearFields"))}}},e={...Nd.btnTemplate({content:[Nd.icon("floppy-disk"),i.get("save")],title:i.get("save")}),className:["save-form"],action:{click:({target:t})=>{const{formData:e}=_d,n={action:()=>{},coords:Nd.coords(t),message:"",button:t};return bc.click.btn(n),bc.save.form(e)}}};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(),n=this.formActions(),{displayType:o}=this.options.panels;this.panels=new xc({panels:e,type:"controls",displayType:o});const r=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],s=Nd.create({className:r,content:[this.panels.panelNav,this.panels.panelsWrap]}),a=["formeo-controls"];t&&a.push("formeo-sticky");const l=Nd.create({className:a,content:[s,n]}),c=l.getElementsByClassName("control-group");this.dom=l,this.groups=c;const[d]=c;this.currentGroup=d,this.actions={filter:t=>{const e=""!==t,n=this.controls;let o=s.querySelector(".filtered-term");if(Nd.toggleElementsByStr(n,t),e){const e=i.get("controls.filteringTerm",t);l.classList.add("filtered"),o?o.textContent=e:(o=Nd.create({tag:"h5",className:"filtered-term",content:e}),s.insertBefore(o,s.firstChild))}else o&&(l.classList.remove("filtered"),o.remove())},addElement:this.addElement,addGroup:t=>{}};for(let i=c.length-1;i>=0;i--){const t=`formeo-controls-${c[i]}`;this.options.sortable||window.localStorage.removeItem(t),Zl.create(c[i],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:({item:t})=>{const{controlData:e}=this.get(t.id);this.options.ghostPreview&&(t.innerHTML="",t.appendChild(new Hc(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}};class id extends pa{constructor(){super(...arguments),e(this,"load",((t=Object.create(null))=>(this.empty(),"string"==typeof t&&(t=JSON.parse(t)),Object.entries(t).forEach((([t,e])=>this.add(t,e))),this.data))),e(this,"get",(t=>t?Or(this.data,t):this.add())),e(this,"add",((t,e=Object.create(null))=>{const n=t||ji(),o=this.Component({...e,id:n});return this.set(n,o),this.active=o,o})),e(this,"remove",(t=>(Array.isArray(t)?t.forEach((t=>{this.get(t).remove()})):this.get(t).remove(),this.data))),e(this,"delete",(t=>(delete this.data[t],t))),e(this,"clearAll",((t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)})),e(this,"conditionMap",new Map)}set config(t){this.configVal=ki(this.configVal,Di(t))}get config(){return this.configVal}}class rd extends $c{constructor(t,e){super("stage",{...Object.freeze({children:[]}),...t},e);const n=this.createChildWrap();this.dom=Nd.create({attrs:{className:[l,"empty"],id:this.id},children:n}),Zl.create(n,{animation:150,fallbackClass:"row-moving",forceFallback:!0,group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{sd.active=this},onSort:this.onSort.bind(this),draggable:`.${c}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),Br.slideUp(this.dom,k,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),Br.slideDown(this.dom,k)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const sd=new class extends id{constructor(t){super("stages",t)}Component(t){return new rd(t)}};class ad extends $c{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[c]}),...t}),e(this,"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(F);const t=n.dom,o=zi(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),D);document.dispatchEvent(Ur.columnResized)}this.updateColumnPreset()})),e(this,"updateColumnPreset",(()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>Nd.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)})),e(this,"setColumnWidths",(t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))}));const n=this.createChildWrap();this.dom=Nd.create({tag:"li",className:[c,"empty"],dataset:{hoverTag:i.get("row"),editingHoverTag:i.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,n]}),Zl.create(n,{animation:150,fallbackClass:"column-moving",forceFallback:!0,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:`.${d}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:i.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:i.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:i.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:i.get("row.makeInputGroup"),description:i.get("row.makeInputGroupDesc")}},n={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Legend"},action:{input:({target:{value:t}})=>this.set("config.legend",t)},className:""}},o=Nd.formGroup([t,n]),r={tag:"label",content:i.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=Nd.create(this.columnPresetControlConfig);const s={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},a=[e,"hr",o,"hr",Nd.formGroup([r,s],"row")];return Nd.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=a.map((t=>Nd.create(t)));t.append(...e)}}})}onAdd(...t){super.onAdd(...t),this.autoColumnWidths()}onRemove(...t){super.onRemove(...t),this.autoColumnWidths()}get getColumnPresetOptions(){const t=this.children,e=M.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:u}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:i.get("defineColumnLayout"),className:p},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const ld={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const cd=new class extends id{constructor(t){super("rows",t),this.config={all:ld}}Component(t){return new ad(t)}};class dd{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=Nd.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(`.${c}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(m),this.columnPreset=o.querySelector(`.${p}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(F,""),n.className=n.className.replace(F,""),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(Pi(e,this.rowWidth)),i=parseFloat(Pi(n,this.rowWidth));return o<10||i<10?null:{colWidth:zi(o.toFixed(1)),siblingColWidth:zi(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(),_d.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),_d.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(m),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(m),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${u}`);const n=this.row.querySelector(".children").children,o=$r(n,(t=>Pi(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=Nd.create({tag:"option",attrs:{className:u,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const hd=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[Nd.icon("triangle-down"),Nd.icon("triangle-up")]}),ud=()=>({className:"column-edit group-config"});class pd extends $c{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[d]}),...t}),e(this,"refreshFieldPanels",(()=>{this.children.forEach((t=>t.panels.nav.refresh()))})),e(this,"setWidth",(t=>(this.dom.dataset.colWidth=t,this.dom.style.width=t,this.set("config.width",t))));const n=this.createChildWrap();this.dom=Nd.create({tag:"li",className:[d,"empty"],dataset:{hoverTag:i.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),ud(),hd(new dd),n]}),this.processConfig(this.dom),Ur.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Zl.create(n,{animation:150,fallbackClass:"field-moving",forceFallback:!0,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:`.${h}`,handle:".item-move"})}processConfig(t){const e=Fr.get(this.data,"config.width");e&&(t.dataset.colWidth=e,t.style.width=e)}}const md={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const gd=new class extends id{constructor(t){super("columns",t),this.config={all:md}}Component(t){return new pd(t)}},fd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}};const vd=new class extends id{constructor(t){super("fields",t),e(this,"get",(t=>{let e=t&&Or(this.data,t);if(!e){const n=od.get(t);n&&(e=this.add(null,n.controlData))}return e})),this.config={all:fd}}Component(t){return new Hc(t)}};const bd=new class extends id{constructor(t){super("externals",t)}Component(t){return new $c("external",t)}},yd=sd,wd=cd,xd=gd,Cd=vd,Sd=od,Ed=bd,Od={id:ji()};const _d=new class extends pa{constructor(t){super("components"),e(this,"sessionFormData",(()=>{var t;if(null==(t=this.opts)?void 0:t.sessionStorage)return Ti.get(A)})),e(this,"load",((t,e=this.opts||Object.create(null))=>{let n=t;this.empty(),"string"==typeof t&&(n=JSON.parse(t)),this.opts=e;const{stages:o={[ji()]:{}},rows:i,columns:r,fields:s,id:a=ji()}={...this.sessionFormData(),...n};this.set("id",a),this.add("stages",yd.load(o)),this.add("rows",wd.load(i)),this.add("columns",xd.load(r)),this.add("fields",Cd.load(s)),this.add("externals",Ed.load(e.external));for(const l of Object.values(this.get("stages")))l.loadChildren();return this.data})),this.opts=t,this.data=Od,this.disableEvents=!0,this.stages=yd,this.rows=wd,this.columns=xd,this.fields=Cd,this.controls=Sd,this.externals=Ed}flatList(t=this.data,e=Object.create(null)){return Object.entries(t).reduce(((t,[e,n])=>{if("object"==typeof n)for(const[o,i]of Object.entries(n))t[`${e}.${o}`]=i;return t}),e)}get json(){return window.JSON.stringify(this.formData)}get formData(){return{id:this.get("id"),stages:sd.getData(),rows:cd.getData(),columns:gd.getData(),fields:vd.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;yd.config=e,wd.config=n,xd.config=o,Cd.config=i}setAddress(t,e){const[n,o,...i]=Array.isArray(t)?t:t.split("."),r=this[n.replace(/s?$/,"s")].get(o);return null==r||r.set(i,e),r}getAddress(t){if(!Li(t))return;const[e,n,...o]=Array.isArray(t)?t:t.split("."),i=this[e.replace(/s?$/,"s")].get(n);return o.length?i.get(o):i}getConditionMap(t){if(Li(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.get(e[1])}}setConditionMap(t,e){if(Li(t)){const n=t.split(".");return n.every((t=>Boolean(t)))&&this[n[0]].conditionMap.set(n[1],e)}}removeConditionMap(t){if(Li(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.delete(e[1])}}},Md={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="${B}${t}">${t}</i>`};const Nd=new class{constructor(){e(this,"render",(t=>(t.id=`f-${t.id||ji()}`,this.create(t)))),e(this,"create",((t,e=!1)=>{let n=t;if(!n)return;n=this.processTagName(n);const o=this;let i;const{tag:r}=n,s=["children","content"];let a;const l={attrs:{},className:[Fr.get(n,"config.inputWrap")||"f-field-group"],children:[],config:{}};let c=document.createElement(r);const d={string:t=>{c.innerHTML+=t},object:t=>t&&c.appendChild(o.create(t,e)),node:t=>c.appendChild(t),component:t=>c.appendChild(t.dom),array:t=>{for(const e of t)i=o.childType(e),d[i](e)},function:t=>{t=t(),i=o.childType(t),d[i](t)},undefined:()=>null,boolean:()=>null};if(s.push("tag"),n.className){const{className:t}=n;n.attrs=Object.assign({},n.attrs,{className:t}),delete n.className}if(n.options){let{options:t}=n;if(t=this.processOptions(t,n,e),!this.holdsContent(c)||"button"===r)return Fr.forEach(t,(t=>{l.children.push(o.create(t,e))})),n.attrs.className&&(l.className=n.attrs.className),l.config=Object.assign({},n.config),this.create(l,e);d.array.call(this,t),delete n.content,s.push("options")}if("OPTION"===c.tagName){const t=setTimeout((()=>{c.selected=!1,clearTimeout(t)}),0)}if(n.attrs&&(o.processAttrs(n,c,e),s.push("attrs")),n.config){if(n.config.label&&(n.config.label&&"button"!==r||["radio","checkbox"].includes(Fr.get(n,"attrs.type")))&&!e){const t=o.label(n);if(!n.config.hideLabel){const e=[...o.labelAfter(n)?[c,t]:[t,c]];l.children.push(e)}}s.push("config")}if(n.content||n.children){const t=n.content||n.children;i=o.childType(t),d[i],d[i].call(this,t)}if(n.dataset){for(const t in n.dataset)Object.hasOwn(n.dataset,t)&&(c.dataset[t]="function"==typeof n.dataset[t]?n.dataset[t]():n.dataset[t]);s.push("dataset")}n.action&&(this.actionHandler(c,n.action),s.push("action"));const h=Fr.subtract(s,Object.keys(n));for(a=h.length-1;a>=0;a--)c[h[a]]=n[h[a]];return l.children.length&&(c=this.create(l)),c})),e(this,"onRender",((t,e)=>{t.parentElement?e(t):window.requestAnimationFrame((()=>this.onRender(t,e)))})),e(this,"toggleElementsByStr",((t,e)=>{const n=[];return Nd.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n})),e(this,"elementsContainText",((t,e,n)=>{const o=[];return Lr(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());null==n||n(t,i),i&&o.push(t)})),o})),e(this,"generateOption",(({type:t="option",label:e,value:n,i:o=0,selected:r})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:n||`${t}-${o}`,["option"===t?"selected":"checked"]:r||!o},config:{label:e||i.get("labelCount",{label:i.get("option"),count:o})}}))),e(this,"makeOption",(([t,e],n,o)=>{const r={value:t,label:i.get(`${o}.${e}`)||e};return t===n&&(r.selected=!0),r})),e(this,"requiredMark",(()=>({tag:"span",className:"text-error",children:"*"}))),e(this,"removeEmpty",(t=>{const e=t.parentElement,n=Ni(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length){if(!this.isStage(e))return this.removeEmpty(e);this.emptyClass(e)}})),e(this,"btnTemplate",(({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e}))),e(this,"isControls",(t=>Ni(t)===a)),e(this,"isStage",(t=>Ni(t)===l)),e(this,"isRow",(t=>Ni(t)===c)),e(this,"isColumn",(t=>Ni(t)===d)),e(this,"isField",(t=>Ni(t)===h)),e(this,"asComponent",(t=>_d[`${Ni(t)}s`].get(t.id))),this.options=Object.create(null),this.styleSheet=(()=>{const t=document.createElement("style");return t.setAttribute("media","screen"),t.setAttribute("type","text/css"),t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet})()}set setOptions(t){this.options=ki(Object.assign({},this.options,t))}processTagName(t){let e;if("string"==typeof t&&(e=t,t={tag:e}),t.attrs){const{tag:n,...o}=t.attrs;if(n)if("string"==typeof n)e=n;else{e=(n.find((t=>!0===t.selected))||n[0]).value}t.attrs=o}return t.tag=e||t.tag||"div",t}actionHandler(t,e){const n={onRender:Nd.onRender,render:Nd.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("#formeo-sprite svg symbol");return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(B,"")]=Nd.create({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.iconSymbols}icon(t=null,e=[]){var n;if(!t)return;const o=this.icons[t];if(o){const t=o.cloneNode(!0);return t.classList.add(...e),t.outerHTML}return(null==(n=Md[Nd.options.iconFont])?void 0:n.call(Md,t))||t}processAttrs(t,e,n){const{attrs:o={}}=t;n||!o.name&&this.isInput(t.tag)&&e.setAttribute("name",ji(t));for(const i of Object.keys(o)){const t=Fr.safeAttrName(i);let n=o[i]||"";if(Array.isArray(n))if("object"==typeof n[0]){const t=n.filter((t=>!0===t.selected));n=t.length?t[0].value:n[0].value}else n=n.join(" ");if(n)if("OPTION"===e.tagName&&"selected"===t){const o=setTimeout((()=>{e.setAttribute(t,n),clearTimeout(o)}),0)}else e.setAttribute(t,n)}}processOptions(t,e,n){const{action:o,attrs:i}=e,r=i.type||e.tag,s=i.id||e.id;return t.map(((t,i)=>{var a;const{label:l,...c}=t,d=()=>{const a={tag:"input",attrs:{name:s,type:r,value:t.value||"",id:`${s}-${i}`,...c},action:o},l={tag:"label",attrs:{for:`${s}-${i}`},config:{inputWrap:"form-check"},children:t.label},d={children:[a,l],className:[`f-${r}`]};return e.attrs.className&&(e.config.inputWrap=e.attrs.className),e.config.inline&&d.className.push(`f-${r}-inline`),t.selected&&(a.attrs.checked=!0),n&&(l.attrs.contenteditable=!0),d},h={select:()=>({tag:"option",attrs:t,children:t.label}),button:t=>{const{type:n,label:o,className:i,id:r}=t;return{...e,attrs:{type:n},className:i,id:r||ji(),options:void 0,children:o,action:e.action}},checkbox:d,radio:d};return null==(a=h[r])?void 0:a.call(h,t)}))}holdsContent(t){return-1!==t.outerHTML.indexOf("/")}isBlockInput(t){return!this.isInput(t)&&this.holdsContent(t)}isInput(t){return"string"!=typeof t&&(t=t.tagName),-1!==["input","textarea","select"].indexOf(t)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=Fr.get(t,"attrs.type"),n=Fr.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}label(t,e){const n=Fr.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||(null==r?void 0:r.id)},className:[],children:[o,n&&this.requiredMark()],action:{}};return e&&(delete s.attrs.for,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",()=>null==t?void 0: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}remove(t){const e=Ni(t);return e?_d.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,Fr.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)}};Fr.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");Br.slideUp(t,600,(()=>{Nd.empty(t),t.classList.remove("removing-all-fields"),Nd.emptyClass(t),Br.slideDown(t,300)}))}toggleSortable(t,e){const n=Ni(t);if(!n)return;const o=Ni(t.parentElement),i=Nd[n].get(t.id).sortable;e||(e=!i.option("disabled")),i.option("disabled",e),o&&["rows","columns","stages"].includes(o)&&this.toggleSortable(t.parentElement,e)}emptyClass(t){const e=t.getElementsByClassName(g.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}};i.addLanguage("en-US",void 0);const Ad={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,external:{},svgSprite:null,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Ir(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"}}}};let jd=class{constructor({formData:t,...e},n){const o=ki(Ad.editor,e),{actions:i,events:r,debug:s,config:a,editorContainer:l,...c}=o;l&&(this.editorContainer="string"==typeof l?document.querySelector(l):l),this.opts=c,Nd.setOptions=c,_d.config=a,this.userFormData=n||t,this.Components=_d,this.dom=Nd,Ur.init({debug:s,...r}),bc.init({debug:s,sessionStorage:c.sessionStorage,...i}),this.loadResources().then((()=>{c.allowEdit&&this.init()}))}get formData(){return this.Components.formData}set formData(t={}){this.load({...this.userFormData,...t},this.opts)}get json(){return this.Components.json}loadResources(){var t;const e=[];return this.opts.polyfills&&(t=>{const e=Array.isArray(t)?s.filter((({name:e})=>-1!==t.indexOf(e))):s;Promise.all(e.map((({src:t})=>Bc(t))))})(this.opts.polyfills),this.opts.style&&e.push(Rc(this.opts.style)),this.opts.svgSprite?e.push(qc(this.opts.svgSprite,Wc,(()=>qc("https://draggable.github.io/formeo/assets/img/formeo-sprite.svg",Wc)))):e.push(Wc('<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol id="f-i-autocomplete" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M6,5h1v1H6V5z M4,4H3v1h1V4z M6,4H5v1h1V4z M2,5v1h1V5H2z M3,7h1V6H3V7z M5,7h1V6H5V7z M4,5v1h1V5H4z M2,14h1v-1H2V14z M4,14h1v-1H4V14z M6,14h1v-1H6V14z M9,13H8v1h1V13z M16,3.5v4C16,8.3,15.3,9,14.5,9H14v3v3c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V3.5 C0,2.7,0.7,2,1.5,2h3H8V1.5V1H7H6V0.5V0h2.5H11v0.5V1h-1H9v0.5V2h3h2.5C15.3,2,16,2.7,16,3.5z M13,12H7H1v3h12V12z M3,11v-1H2v1H3z M5,11v-1H4v1H5z M15,3.5C15,3.2,14.8,3,14.5,3H9v2.5V8H8.5H8V7.5V7H7V6h1V5.5V5H7V4h1V3.5V3H1.5C1.2,3,1,3.2,1,3.5v4 C1,7.8,1.2,8,1.5,8H8v1H6v0.5V10h2.5H11V9.5V9H9V8h5.5C14.8,8,15,7.8,15,7.5V3.5z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-bin" xmlns="http://www.w3.org/2000/svg"><path d="M4 10v20c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-20h-22zM10 28h-2v-14h2v14zM14 28h-2v-14h2v14zM18 28h-2v-14h2v14zM22 28h-2v-14h2v14zM26.5 4h-6.5v-2.5c0-.825-.675-1.5-1.5-1.5h-7c-.825 0-1.5.675-1.5 1.5v2.5h-6.5c-.825 0-1.5.675-1.5 1.5v2.5h26v-2.5c0-.825-.675-1.5-1.5-1.5zM18 4h-6v-1.975h6v1.975z"/></symbol><symbol id="f-i-button" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><metadata id="acmetadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="acrect4140" d="M 0.4765625,4 A 0.47706934,0.47706934 0 0 0 0,4.4765625 L 0,11.523438 A 0.47706934,0.47706934 0 0 0 0.4765625,12 L 15.523438,12 A 0.47706934,0.47706934 0 0 0 16,11.523438 L 16,4.4765625 A 0.47706934,0.47706934 0 0 0 15.523438,4 L 0.4765625,4 Z m 0.4765625,0.953125 14.09375,0 0,6.09375 -14.09375,0 0,-6.09375 z"/><g id="aclayer1"><g id="actext4203"><g id="acg4212" transform="translate(0.10112835,0.1001358)"><path id="acpath4208" d="m 6.0690374,6.4093857 q -0.5371093,0 -0.8544922,0.4003906 -0.3149414,0.4003906 -0.3149414,1.0913086 0,0.6884766 0.3149414,1.0888672 0.3173829,0.4003906 0.8544922,0.4003906 0.5371094,0 0.8496094,-0.4003906 0.3149414,-0.4003906 0.3149414,-1.0888672 0,-0.690918 -0.3149414,-1.0913086 -0.3125,-0.4003906 -0.8496094,-0.4003906 z m 0,-0.4003906 q 0.7666016,0 1.225586,0.5151367 0.4589843,0.5126953 0.4589843,1.3769531 0,0.8618164 -0.4589843,1.3769531 -0.4589844,0.5126953 -1.225586,0.5126953 -0.7690429,0 -1.2304687,-0.5126953 -0.4589844,-0.5126953 -0.4589844,-1.3769531 0,-0.8642578 0.4589844,-1.3769531 0.4614258,-0.5151367 1.2304687,-0.5151367 z"/><path id="acpath4210" d="m 8.5250921,6.074913 0.4931641,0 0,1.5405274 1.6357418,-1.5405274 0.634766,0 -1.809082,1.6992188 1.938477,1.9458008 -0.649415,0 -1.7504878,-1.7553711 0,1.7553711 -0.4931641,0 0,-3.6450196 z"/></g></g></g></symbol><symbol viewBox="0 0 32 32" id="f-i-calendar" xmlns="http://www.w3.org/2000/svg"><path d="M12.048 16.961c-0.178 0.257-0.395 0.901-0.652 1.059-0.257 0.157-0.547 0.267-0.869 0.328-0.323 0.062-0.657 0.089-1.002 0.079v1.527h2.467v6.046h1.991v-9.996h-1.584c-0.056 0.381-0.173 0.7-0.351 0.957zM23 8h2c0.553 0 1-0.448 1-1v-6c0-0.552-0.447-1-1-1h-2c-0.553 0-1 0.448-1 1v6c0 0.552 0.447 1 1 1zM7 8h2c0.552 0 1-0.448 1-1v-6c0-0.552-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1v6c0 0.552 0.448 1 1 1zM30 4h-2v5c0 0.552-0.447 1-1 1h-6c-0.553 0-1-0.448-1-1v-5h-8v5c0 0.552-0.448 1-1 1h-6c-0.552 0-1-0.448-1-1v-5h-2c-1.104 0-2 0.896-2 2v24c0 1.104 0.896 2 2 2h28c1.104 0 2-0.896 2-2v-24c0-1.104-0.896-2-2-2zM30 29c0 0.553-0.447 1-1 1h-26c-0.552 0-1-0.447-1-1v-16c0-0.552 0.448-1 1-1h26c0.553 0 1 0.448 1 1v16zM15.985 17.982h4.968c-0.936 1.152-1.689 2.325-2.265 3.705-0.575 1.381-0.638 2.818-0.749 4.312h2.131c0.009-0.666-0.195-1.385-0.051-2.156 0.146-0.771 0.352-1.532 0.617-2.285 0.267-0.752 0.598-1.461 0.996-2.127 0.396-0.667 0.853-1.229 1.367-1.686v-1.742h-7.015v1.979z"/></symbol><symbol id="f-i-checkbox" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M13.5,5v8c0,0.8-0.7,1.5-1.5,1.5H3c-0.8,0-1.5-0.7-1.5-1.5V4c0-0.8,0.7-1.5,1.5-1.5h9c0.7,0,1.3,0.5,1.5,1.2l2.4-1.4L13.5,5 z M12.5,6.2L7.7,12L2.8,5.5l4.9,1.6l4.8-2.9V4c0-0.3-0.2-0.5-0.5-0.5H3C2.7,3.5,2.5,3.7,2.5,4v9c0,0.3,0.2,0.5,0.5,0.5h9 c0.3,0,0.5-0.2,0.5-0.5V6.2z"/></symbol><symbol id="f-i-checkbox-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M6,5v1h9V5H6z M15,14v-1H6v1H15z M6,10h9V9H6V10z M4,12l-2.5,1.5L0,13l1.5,2L4,12z M4,8 L1.5,9.5L0,9l1.5,2L4,8z M4,4L1.5,5.5L0,5l1.5,2L4,4z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-columns" xmlns="http://www.w3.org/2000/svg"><metadata id="agmetadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="agrect4860-3-5" d="M 16,0.5 A 0.50004997,0.50004997 0 0 0 15.5,0 l -5,0 -5,0 -5,0 A 0.50004997,0.50004997 0 0 0 0,0.5 l 0,15 A 0.50004997,0.50004997 0 0 0 0.5,16 l 5,0 5,0 5,0 A 0.50004997,0.50004997 0 0 0 16,15.5 l 0,-15 z M 15,1 15,15 11,15 11,1 15,1 Z M 10,1 10,15 6,15 6,1 10,1 Z M 5,1 5,15 1,15 1,1 5,1 Z"/></symbol><symbol viewBox="0 0 2.1166668 2.1167197" id="f-i-component-corner" xmlns="http://www.w3.org/2000/svg"><g id="ahg2" transform="translate(-0.52916668)"><path class="ahcorner-fill" stroke="none" fill="inherit" d="M 0.52916668,5.3011818e-5 V 2.1167198 H 2.6458337 V 1.9849449 C 1.5496647,1.9849298 0.66092868,1.0962219 0.66094168,5.3011818e-5 Z m 0.131775,0 L 2.6458337,1.9849449 Z"/><path class="ahcorner-stroke" stroke-width="0.250546px" fill="none" stroke="inherit" d="m 2.645783,1.9848683 v 0 C 1.5496137,1.9848532 0.66100516,1.0962232 0.66101817,5.4327518e-5 v 0"/></g></symbol><symbol viewBox="0 0 32 32" id="f-i-copy" xmlns="http://www.w3.org/2000/svg"><path d="M20 8v-8h-14l-6 6v18h12v8h20v-24h-12zM6 2.828v3.172h-3.172l3.172-3.172zM2 22v-14h6v-6h10v6l-6 6v8h-10zM18 10.828v3.172h-3.172l3.172-3.172zM30 30h-16v-14h6v-6h10v20z"/></symbol><symbol id="f-i-divider" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><metadata id="ajmetadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><rect y="7" x="0" height="1" width="15" id="ajrect4182"/></symbol><symbol viewBox="0 0 28 32" id="f-i-edit" xmlns="http://www.w3.org/2000/svg"><path d="M22 2l-4 4 6 6 4-4-6-6zM0 24l0.021 6.018 5.979-0.018 16-16-6-6-16 16zM6 28h-4v-4h2v2h2v2z"/></symbol><symbol fill="#000000" viewBox="0 0 24 24" id="f-i-email" xmlns="http://www.w3.org/2000/svg"><path d="M12,2 C17.4292399,2 21.8479317,6.32667079 21.9961582,11.7200952 L22,12 L22,13 C22,15.1729208 20.477434,17 18.5,17 C17.3269391,17 16.3139529,16.3570244 15.6839382,15.3803024 C14.770593,16.3757823 13.4581934,17 12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.6887547,7 16.8818181,9.12230671 16.9953805,11.7831104 L17,12 L17,13 C17,14.1407877 17.7160103,15 18.5,15 C19.2447902,15 19.928229,14.2245609 19.9947109,13.1689341 L20,13 L20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 C13.1630948,20 14.2892822,19.7522618 15.3225159,19.2798331 C15.8247876,19.0501777 16.4181317,19.271177 16.647787,19.7734487 C16.8774423,20.2757205 16.656443,20.8690646 16.1541713,21.0987199 C14.861218,21.689901 13.4515463,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M12,9 C10.3431458,9 9,10.3431458 9,12 C9,13.6568542 10.3431458,15 12,15 C13.6568542,15 15,13.6568542 15,12 C15,10.3431458 13.6568542,9 12,9 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-floppy-disk" xmlns="http://www.w3.org/2000/svg"><path d="M28 0h-28v32h32v-28l-4-4zM16 4h4v8h-4v-8zM28 28h-24v-24h2v10h18v-10h2.343l1.657 1.657v22.343z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle" xmlns="http://www.w3.org/2000/svg"><metadata id="aqmetadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="translate(0,-2)" id="aqg4220"><rect id="aqrect4191" width="2" height="2" x="2" y="7"/><rect id="aqrect4191-2" width="2" height="2" x="7" y="7"/><rect id="aqrect4191-4" width="2" height="2" x="12" y="7"/></g><g transform="translate(0,2)" id="aqg4220-6"><rect id="aqrect4191-40" width="2" height="2" x="2" y="7"/><rect id="aqrect4191-2-3" width="2" height="2" x="7" y="7"/><rect id="aqrect4191-4-9" width="2" height="2" x="12" y="7"/></g></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-column" xmlns="http://www.w3.org/2000/svg"><metadata id="anmetadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g id="ang1" transform="rotate(90,9.25,9.25)"><rect id="anrect4191-27" width="2" height="2" x="2" y="7"/><rect id="anrect4191-2-0" width="2" height="2" x="7" y="7"/><rect id="anrect4191-2-9-9" width="2" height="2" x="12" y="7"/><rect id="anrect4191-27-6" width="2" height="2" x="2" y="12"/><rect id="anrect4191-2-0-0" width="2" height="2" x="7" y="12"/><rect id="anrect4191-2-9-9-6" width="2" height="2" x="12" y="12"/></g></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-field" xmlns="http://www.w3.org/2000/svg"><metadata id="aometadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g id="aog1" transform="translate(0,-2.5)"><rect id="aorect4191-2-0" width="2" height="2" x="7" y="-11.5" transform="rotate(90)"/><rect id="aorect4191-2-9-9" width="2" height="2" x="12" y="-11.5" transform="rotate(90)"/><rect id="aorect4191-2-0-0" width="2" height="2" x="7" y="-6.5" transform="rotate(90)"/><rect id="aorect4191-2-9-9-6" width="2" height="2" x="12" y="-6.5" transform="rotate(90)"/></g></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-row" xmlns="http://www.w3.org/2000/svg"><metadata id="apmetadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g id="apg1" transform="translate(0,-2.5)"><rect id="aprect4191-27" width="2" height="2" x="2" y="7"/><rect id="aprect4191-2-0" width="2" height="2" x="7" y="7"/><rect id="aprect4191-2-9-9" width="2" height="2" x="12" y="7"/><rect id="aprect4191-27-6" width="2" height="2" x="2" y="12"/><rect id="aprect4191-2-0-0" width="2" height="2" x="7" y="12"/><rect id="aprect4191-2-9-9-6" width="2" height="2" x="12" y="12"/></g></symbol><symbol viewBox="0 0 448 512" id="f-i-hash" xmlns="http://www.w3.org/2000/svg"><g id="aricomoon-ignore"/><path fill="#000" d="M448 192v-64h-80.064l16-128h-64l-16 128h-127.968l16-128h-64l-16 128h-111.968v64h103.968l-15.968 128h-88v64h80l-16 128h64l16-128h127.968l-16 128h64.032l16-128h112v-64h-104l15.936-128h88.064zM279.968 320h-127.968l15.968-128h127.968l-15.968 128z"/></symbol><symbol viewBox="0 0 28 28" id="f-i-header" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M26.281 26q-0.688 0-2.070-0.055t-2.086-0.055q-0.688 0-2.063 0.055t-2.063 0.055q-0.375 0-0.578-0.32t-0.203-0.711q0-0.484 0.266-0.719t0.609-0.266 0.797-0.109 0.703-0.234q0.516-0.328 0.516-2.188l-0.016-6.109q0-0.328-0.016-0.484-0.203-0.063-0.781-0.063h-10.547q-0.594 0-0.797 0.063-0.016 0.156-0.016 0.484l-0.016 5.797q0 2.219 0.578 2.562 0.25 0.156 0.75 0.203t0.891 0.055 0.703 0.234 0.313 0.711q0 0.406-0.195 0.75t-0.57 0.344q-0.734 0-2.18-0.055t-2.164-0.055q-0.672 0-2 0.055t-1.984 0.055q-0.359 0-0.555-0.328t-0.195-0.703q0-0.469 0.242-0.703t0.562-0.273 0.742-0.117 0.656-0.234q0.516-0.359 0.516-2.234l-0.016-0.891v-12.703q0-0.047 0.008-0.406t0-0.57-0.023-0.602-0.055-0.656-0.102-0.57-0.172-0.492-0.25-0.281q-0.234-0.156-0.703-0.187t-0.828-0.031-0.641-0.219-0.281-0.703q0-0.406 0.187-0.75t0.562-0.344q0.719 0 2.164 0.055t2.164 0.055q0.656 0 1.977-0.055t1.977-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.266 0.68t-0.602 0.227-0.773 0.063-0.672 0.203q-0.547 0.328-0.547 2.5l0.016 5q0 0.328 0.016 0.5 0.203 0.047 0.609 0.047h10.922q0.391 0 0.594-0.047 0.016-0.172 0.016-0.5l0.016-5q0-2.172-0.547-2.5-0.281-0.172-0.914-0.195t-1.031-0.203-0.398-0.773q0-0.406 0.195-0.75t0.586-0.344q0.688 0 2.063 0.055t2.063 0.055q0.672 0 2.016-0.055t2.016-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.273 0.688t-0.625 0.227-0.805 0.047-0.688 0.195q-0.547 0.359-0.547 2.516l0.016 14.734q0 1.859 0.531 2.188 0.25 0.156 0.719 0.211t0.836 0.070 0.648 0.242 0.281 0.695q0 0.406-0.187 0.75t-0.562 0.344z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-hidden" xmlns="http://www.w3.org/2000/svg"><metadata id="atmetadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="atpath5816" d="M 1,5 2,5 2,4 1,4 Z"/><path id="atpath5814" d="M 3,5 4,5 4,4 3,4 Z"/><path id="atpath5812" d="M 5,5 6,5 6,4 5,4 Z"/><path id="atpath5810" d="M 7,5 8,5 8,4 7,4 Z"/><path id="atpath5808" d="M 9,5 10,5 10,4 9,4 Z"/><path id="atpath5806" d="m 11,5 1,0 0,-1 -1,0 z"/><path id="atpath5804" d="m 13,5 1,0 0,-1 -1,0 z"/><path id="atpath5800" d="M 0,6 1,6 1,5 0,5 Z"/><path id="atpath5798" d="m 15,6.9997352 1,0 0,-1 -1,0 z"/><path id="atpath5796" d="M 0,8 1,8 1,7 0,7 Z"/><path id="atpath5794" d="m 15,8.9997352 1,0 0,-1 -1,0 z"/><path id="atpath5792" d="m 0,10 1,0 0,-1.0000001 -1,0 z"/><path id="atpath5790" d="m 15,10.999735 1,0 0,-0.9999998 -1,0 z"/><path id="atpath5786" d="m 2,12 1,0 0,-1 -1,0 z"/><path id="atpath5784" d="m 4,12 1,0 0,-1 -1,0 z"/><path id="atpath5782" d="m 6,12 1,0 0,-1 -1,0 z"/><path id="atpath5780" d="m 8,12 1,0 0,-1 -1,0 z"/><path id="atpath5778" d="m 10,12 1,0 0,-1 -1,0 z"/><path id="atpath5776" d="m 12,12 1,0 0,-1 -1,0 z"/><path id="atrect5768" d="m 14,12 1,0 0,-1 -1,0 z"/><path d="m 15,5 1,0 0,-1 -1,0 z" id="atpath5827"/><path d="m 0,12 1,0 0,-1 -1,0 z" id="atpath5829"/></symbol><symbol viewBox="0 0 384 512" id="f-i-menu" xmlns="http://www.w3.org/2000/svg"><g id="auicomoon-ignore"/><path d="M0 96v64h384v-64h-384zM0 288h384v-64h-384v64zM0 416h384v-64h-384v64z"/></symbol><symbol viewBox="0 0 16 32" id="f-i-minus" xmlns="http://www.w3.org/2000/svg"><path d="M0 14v4h16v-4h-16z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move" xmlns="http://www.w3.org/2000/svg"><path d="M287.744 94.736v129.008h128v-64l96.256 96.256-96.256 96.24v-65.488h-128v129.008h64.496l-96.24 96.24-96.256-96.24h64v-129.008h-128v64.992l-95.744-95.744 95.744-95.744v63.488h128v-129.008h-62.496l94.752-94.736 94.752 94.736h-63.008z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move-vertical" xmlns="http://www.w3.org/2000/svg"><metadata id="awmetadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="3440" inkscape:window-height="1416" id="awnamedview6" showgrid="false" inkscape:zoom="1.84375" inkscape:cx="421.4312" inkscape:cy="218.56484" inkscape:window-x="0" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="svg2" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"/><path d="m 287.744,94.736 0,321.024 64.496,0 L 256,512 l -96.256,-96.24 64,0 0,-321.024 -62.496,0 L 256,0 350.752,94.736 Z" id="awpath4" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:connector-curvature="0" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" sodipodi:nodetypes="ccccccccccc"/></symbol><symbol viewBox="0 0 20 28" id="f-i-paragraph" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M19.969 2.953v1.141q0 0.453-0.289 0.953t-0.664 0.5q-0.781 0-0.844 0.016-0.406 0.094-0.5 0.484-0.047 0.172-0.047 1v18q0 0.391-0.281 0.672t-0.672 0.281h-1.687q-0.391 0-0.672-0.281t-0.281-0.672v-19.031h-2.234v19.031q0 0.391-0.273 0.672t-0.68 0.281h-1.687q-0.406 0-0.68-0.281t-0.273-0.672v-7.75q-2.297-0.187-3.828-0.922-1.969-0.906-3-2.797-1-1.828-1-4.047 0-2.594 1.375-4.469 1.375-1.844 3.266-2.484 1.734-0.578 6.516-0.578h7.484q0.391 0 0.672 0.281t0.281 0.672z"/></symbol><symbol id="f-i-phone-receiver" viewBox="0 0 578.106 578.106" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g><g><path d="M577.83,456.128c1.225,9.385-1.635,17.545-8.568,24.48l-81.396,80.781 c-3.672,4.08-8.465,7.551-14.381,10.404c-5.916,2.857-11.729,4.693-17.439,5.508c-0.408,0-1.635,0.105-3.676,0.309 c-2.037,0.203-4.689,0.307-7.953,0.307c-7.754,0-20.301-1.326-37.641-3.979s-38.555-9.182-63.645-19.584 c-25.096-10.404-53.553-26.012-85.376-46.818c-31.823-20.805-65.688-49.367-101.592-85.68 c-28.56-28.152-52.224-55.08-70.992-80.783c-18.768-25.705-33.864-49.471-45.288-71.299 c-11.425-21.828-19.993-41.616-25.705-59.364S4.59,177.362,2.55,164.51s-2.856-22.95-2.448-30.294 c0.408-7.344,0.612-11.424,0.612-12.24c0.816-5.712,2.652-11.526,5.508-17.442s6.324-10.71,10.404-14.382L98.022,8.756 c5.712-5.712,12.24-8.568,19.584-8.568c5.304,0,9.996,1.53,14.076,4.59s7.548,6.834,10.404,11.322l65.484,124.236 c3.672,6.528,4.692,13.668,3.06,21.42c-1.632,7.752-5.1,14.28-10.404,19.584l-29.988,29.988c-0.816,0.816-1.53,2.142-2.142,3.978 s-0.918,3.366-0.918,4.59c1.632,8.568,5.304,18.36,11.016,29.376c4.896,9.792,12.444,21.726,22.644,35.802 s24.684,30.293,43.452,48.653c18.36,18.77,34.68,33.354,48.96,43.76c14.277,10.4,26.215,18.053,35.803,22.949 c9.588,4.896,16.932,7.854,22.031,8.871l7.648,1.531c0.816,0,2.145-0.307,3.979-0.918c1.836-0.613,3.162-1.326,3.979-2.143 l34.883-35.496c7.348-6.527,15.912-9.791,25.705-9.791c6.938,0,12.443,1.223,16.523,3.672h0.611l118.115,69.768 C571.098,441.238,576.197,447.968,577.83,456.128z"/></g></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></symbol><symbol id="f-i-radio-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M5,6h10V5H5V6z M15,9H5v1h10V9z M15,14v-1H5v1H15z M1.5,7C0.7,7,0,6.3,0,5.5S0.7,4,1.5,4 S3,4.7,3,5.5S2.3,7,1.5,7z M1.5,5C1.2,5,1,5.2,1,5.5S1.2,6,1.5,6S2,5.8,2,5.5S1.8,5,1.5,5z M1.5,11.1C0.7,11.1,0,10.4,0,9.6 s0.7-1.5,1.5-1.5S3,8.7,3,9.6S2.3,11.1,1.5,11.1z M1.5,9.1C1.2,9.1,1,9.3,1,9.6s0.2,0.5,0.5,0.5S2,9.8,2,9.6S1.8,9.1,1.5,9.1z M1.5,15C0.7,15,0,14.3,0,13.5S0.7,12,1.5,12S3,12.7,3,13.5S2.3,15,1.5,15z M1.5,13C1.2,13,1,13.2,1,13.5S1.2,14,1.5,14 S2,13.8,2,13.5S1.8,13,1.5,13z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-remove" xmlns="http://www.w3.org/2000/svg"><metadata id="bbmetadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g id="bblayer1"><g transform="translate(170.37199,5.9577983)" id="bbg4172"><path id="bbrect4155" d="m -159.9194,-18.102955 87.322034,0 0,510.915285 -87.322034,0 z" transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)"/><path id="bbrect4155-5" d="m 193.69366,-139.19925 87.32204,0 0,510.91528 -87.32204,0 z" transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)"/></g></g></symbol><symbol id="f-i-rich-text" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M15,1H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V2C16,1.4,15.6,1,15,1z M1,3.1h0.8v0.3H1V3.1z M1,3.6h0.8 v0.3H1V3.6z M15,14H1V5.1h14V14z M15,4.9H1V4.6h14V4.9z M15,4.4H1V4.1h0.8v0.2h1.5V4.1h1.3v0.2H6V4.1h1.3v0.2h1.5V4.1H10v0.2h1.5 V4.1h1.3v0.2h1.5V4.1H15V4.4z M4.5,3.6v0.3H3.3V3.6H4.5z M3.3,3.4V3.1h1.3v0.3H3.3z M7.3,3.6v0.3H6V3.6H7.3z M6,3.4V3.1h1.3v0.3H6z M10,3.6v0.3H8.8V3.6H10z M8.8,3.4V3.1H10v0.3H8.8z M12.8,3.6v0.3h-1.3V3.6H12.8z M11.5,3.4V3.1h1.3v0.3H11.5z M15,3.9h-0.8V3.6H15 V3.9z M15,3.4h-0.8V3.1H15V3.4z M15,2.9h-0.8V2.8h-1.5v0.2h-1.3V2.8H10v0.2H8.8V2.8H7.3v0.2H6V2.8H4.5v0.2H3.3V2.8H1.8v0.2H1V2.6h14 V2.9z M15,2.4H1V2.1h14V2.4z M3,12v-1h10v1H3z M13,10H3V9h10V10z M11,8H3V7h8V8z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-rows" xmlns="http://www.w3.org/2000/svg"><metadata id="bdmetadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="matrix(0,1,-1,0,3.0984025,11.835155)" id="bdg7209"><path id="bdrect4860-3-5" d="m 4.1640625,-12.402344 a 0.50004997,0.50004997 0 0 0 -0.5,-0.5 l -5,0 -5,0 -5.0000005,0 a 0.50004997,0.50004997 0 0 0 -0.5,0.5 l 0,15.0000002 a 0.50004997,0.50004997 0 0 0 0.5,0.5 l 4.9648442,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 4.9648437,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 5,0 a 0.50004997,0.50004997 0 0 0 0.5,-0.5 l 0,-15.0000002 z m -1,0.5 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4.0000005,0 0,-14.0000002 4.0000005,0 z"/></g></symbol><symbol id="f-i-select" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="beXMLID_1_" d="M0,0v14h0c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1h0V5h4V0H0z M1,1h10v3H1V1z M1,7h10v3H1V7z M1,14v-3h10v3H1z M15,4h-3V1h3V4z M2,2h1v1H2V2z M2,12h1v1H2V12z M4,12h1v1H4V12z M6,12h1v1H6V12z M9,12v1H8v-1H9z M2,8h1v1H2V8z M4,8h1v1H4V8z M6,8 h1v1H6V8z M13.5,3.1l-1-1.1h1.9L13.5,3.1z M2,6V5h1v1H2L2,6z M4,6V5h1v1H4L4,6z"/></symbol><symbol viewBox="0 0 448 512" id="f-i-settings" xmlns="http://www.w3.org/2000/svg"><g id="bficomoon-ignore"/><path d="M223.969 175c-44.703 0-80.969 36.266-80.969 81 0 44.688 36.266 81.031 80.969 81.031 44.719 0 80.719-36.344 80.719-81.031-0-44.734-36-81-80.719-81zM386.313 302.531l-14.594 35.156 29.469 57.875-36.094 36.094-59.218-27.969-35.156 14.438-17.844 54.625-2.281 7.25h-51.016l-22.078-61.656-35.156-14.5-57.952 29.344-36.078-36.063 27.938-59.25-14.484-35.125-61.767-20.156v-50.984l61.703-22.109 14.485-35.094-25.953-51.234-3.422-6.719 36.031-36.031 59.297 27.922 35.109-14.516 17.828-54.594 2.297-7.234h51l22.094 61.734 35.063 14.516 58.031-29.406 36.063 36.031-27.938 59.203 14.438 35.172 61.875 20.125v50.969l-61.688 22.187z"/></symbol><symbol id="f-i-text-input" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bgXMLID_10_" d="M15,4H4.5V3H6V2H4.5h-1H2v1h1.5v1H1C0.4,4,0,4.5,0,5v6c0,0.6,0.4,1,1,1h2.5v1H2v1h4v-1H4.5v-1H15 c0.6,0,1-0.4,1-1V5C16,4.5,15.6,4,15,4z M1,11V5h2.5v6H1z M15,11H4.5V5H15V11z"/></symbol><symbol id="f-i-textarea" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bhXMLID_1_" d="M3,11v-1h8v1H3L3,11z M3,7h10V6H3V7L3,7z M3,8v1h10V8H3L3,8z M13,4H3v1h10V4L13,4z M16,14V2c0-0.6-0.4-1-1-1 H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14C15.6,15,16,14.6,16,14z M15,2v12H1V2H15z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-down" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0 12l11.992 11.992 11.992-11.992h-23.984z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-left" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0 15.996l11.992 11.992v-23.984l-11.992 11.992z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-right" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0.002 4.008l11.992 11.992-11.992 11.992v-23.984z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-up" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M11.992 8l-11.992 11.992h23.984l-11.992-11.992z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-upload" xmlns="http://www.w3.org/2000/svg"><g id="bmicomoon-ignore"/><path d="M240 352h-240v128h480v-128h-240zM448 416h-64v-32h64v32zM112 160l128-128 128 128h-80v160h-96v-160z"/></symbol></svg>')),e.push(i.init({...this.opts.i18n,locale:null==(t=window.sessionStorage)?void 0:t.getItem(j)})),Promise.all(e)}init(){od.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=_d.get("id"),this.i18n={setLang:t=>{var e;null==(e=window.sessionStorage)||e.setItem(j,t);i.setCurrent(t).then((()=>{this.init()}),console.error)}},this.render()}))}load(t=this.userFormData,e=this.opts){return this.Components.load(t,e)}render(){if(!this.controls)return window.requestAnimationFrame((()=>this.render()));if(this.stages=Object.values(_d.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))]};i.current.dir&&(t.attrs.dir=i.current.dir,Nd.dir=i.current.dir),this.editor=Nd.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(Nd.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Ur.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Ur.formeoLoaded)}};const kd=t=>{const e=t.match(I);return(null==e?void 0:e[0])||t},Dd=t=>t.replace(I,ji());let Pd=class{constructor(t,n={}){e(this,"render",((t=this.form)=>{this.form=t;const e=document.getElementsByClassName("formeo-render").length,n={id:this.form.id,className:`formeo-render formeo formeo-rendered-${e}`,children:this.processedData};this.renderedForm=Nd.render(n),this.applyConditions();const o=this.container.querySelector(".formeo-render");o?o.replaceWith(this.renderedForm):this.container.appendChild(this.renderedForm)})),e(this,"orderChildren",((t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]))),e(this,"prefixId",(t=>"f-"+t)),e(this,"processColumn",(({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`}))),e(this,"processRows",(t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]))),e(this,"cacheComponent",(t=>(this.components[kd(t.id)]=t,t))),e(this,"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("f-input-group-wrap"),{tag:n.fieldset?"fieldset":"div",id:ji(),className:i,children:s}})),e(this,"cloneComponentData",(t=>{const{children:e=[],id:n,...o}=this.components[t];return Object.assign({},o,{id:Dd(n),children:e.length&&e.map((({id:t})=>this.cloneComponentData(kd(t))))})})),e(this,"addButton",(t=>Nd.render({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=Nd.render(this.cloneComponentData(t));n.insertBefore(o,n.lastChild),o.appendChild(Nd.render(Nd.btnTemplate({className:"remove-input-group",children:Nd.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()}})))}}}))),e(this,"processColumns",(t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t)))))),e(this,"processFieldsOrig",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>this.cacheComponent(Object.assign({},e,{id:this.prefixId(t)})))))),e(this,"processFields",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const{action:n={},dependencies:o={}}=this.elements[e.meta.id]||{};o&&Xc(o);const i=ki({action:n},e);return this.cacheComponent({...i,id:this.prefixId(t)})})))),e(this,"applyConditions",(()=>{Object.values(this.components).forEach((({conditions:t})=>{t&&t.forEach(((t,e)=>{const{if:n,then:o}=t;n.forEach((t=>{const{source:e,...n}=t;if(Li(e)){this.getComponents(e).forEach((t=>{const e=zd(t);e&&t.addEventListener(e,(t=>this.evaluateCondition(n,t)&&o.forEach((e=>this.execResult(e,t)))),!1);const i={target:t};this.evaluateCondition(n,i)&&o.forEach((t=>this.execResult(t,i)))}))}}))}))}))})),e(this,"evaluateCondition",(({sourceProperty:t,targetProperty:e,comparison:n,target:o},i)=>{var r;const s={equals:ua,notEquals:(t,e)=>!ua(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},a=String(i.target[t]),l=String(Li(o)?this.getComponent(o)[e]:o);return null==(r=s[n])?void 0:r.call(s,a,l)})),e(this,"execResult",(({assignment:t,target:e,targetProperty:n,value:o})=>{var i;const r={equals:t=>{var e;const i={value:()=>{t[n]=o},isNotVisible:()=>{t.parentElement.setAttribute("hidden",!0),t.required=!1},isVisible:()=>{t.parentElement.removeAttribute("hidden"),t.required=t._required}};null==(e=i[n])||e.call(i)}};if(Li(e)){const n=this.getComponent(e);n&&void 0===n._required&&(n._required=n.required),null==(i=r[t])||i.call(r,n)}})),e(this,"getComponent",(t=>{const e=t.slice(t.indexOf(".")+1);return $i(t)?this.external[e]:this.renderedForm.querySelector(`#f-${e}`)})),e(this,"getComponents",(t=>{const e=[],n=t.slice(t.indexOf(".")+1);return $i(t)?e.push(this.external[n]):e.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),e}));const{renderContainer:o,external:i,elements:r}=(({editorContainer:t,renderContainer:e,...n})=>{const o=t=>"string"==typeof t?document.querySelector(t):t;return{...n,renderContainer:o(e),editorContainer:o(t)}})(t);this.container=o,this.form=n,this.external=i,this.dom=Nd,this.components=Object.create(null),this.elements=r}get processedData(){return Object.values(this.form.stages).map((t=>(t.children=this.processRows(t.id),t.className=l,Nd.render(t))))}};const zd=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=jd,window.FormeoRenderer=Pd);const Td=jd,Ld=Pd;exports.FormeoEditor=Td,exports.FormeoRenderer=Ld;
14
+ */function ma(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 fa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ma(Object(n),!0).forEach((function(e){va(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ma(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ga(t){return(ga="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 va(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ba(){return ba=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},ba.apply(this,arguments)}function ya(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 wa(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Ca=wa(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ea=wa(/Edge/i),Sa=wa(/firefox/i),Oa=wa(/safari/i)&&!wa(/chrome/i)&&!wa(/android/i),xa=wa(/iP(ad|od|hone)/i),Na=wa(/chrome/i)&&wa(/android/i),_a={capture:!1,passive:!1};function Aa(t,e,n){t.addEventListener(e,n,!Ca&&_a)}function ja(t,e,n){t.removeEventListener(e,n,!Ca&&_a)}function Pa(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 Ta(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Da(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&Pa(t,e):Pa(t,e))||o&&t===n)return t;if(t===n)break}while(t=Ta(t))}return null}var ka,$a=/\s+/g;function La(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace($a," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace($a," ")}}function Ia(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 Ma(t,e){var n="";if("string"==typeof t)n=t;else do{var o=Ia(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 Ra(){var t=document.scrollingElement;return t||document.documentElement}function Wa(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==Ra()?(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,!Ca))do{if(i&&i.getBoundingClientRect&&("none"!==Ia(i,"transform")||n&&"static"!==Ia(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(Ia(i,"border-top-width")),a-=h.left+parseInt(Ia(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=Ma(i||t),m=p&&p.a,f=p&&p.d;p&&(l=(s/=f)+(d/=f),c=(a/=m)+(u/=m))}return{top:s,left:a,bottom:l,right:c,width:u,height:d}}}function Ba(t,e,n){for(var o=Ha(t,!0),i=Wa(t)[e];o;){if(!(i>=Wa(o)[n]))return o;if(o===Ra())break;o=Ha(o,!1)}return!1}function za(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==Jl.ghost&&(o||s[r]!==Jl.dragged)&&Da(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function qa(t,e){for(var n=t.lastElementChild;n&&(n===Jl.ghost||"none"===Ia(n,"display")||e&&!Pa(n,e));)n=n.previousElementSibling;return n||null}function Ua(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Jl.clone||e&&!Pa(t,e)||n++;return n}function Xa(t){var e=0,n=0,o=Ra();if(t)do{var i=Ma(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 Ha(t,e){if(!t||!t.getBoundingClientRect)return Ra();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Ia(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 Ra();if(o||e)return n;o=!0}}}while(n=n.parentNode);return Ra()}function Ya(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 Ga(t,e){return function(){if(!ka){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),ka=setTimeout((function(){ka=void 0}),e)}}}function Va(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Ja(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 Ka(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if(Da(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=Wa(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 Za="Sortable"+(new Date).getTime();function Qa(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==Ia(t,"display")&&t!==Jl.ghost){e.push({target:t,rect:Wa(t)});var n=fa({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=Ma(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=Wa(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,u=Ma(n,!0);u&&(a.top-=u.f,a.left-=u.e),n.toRect=a,n.thisAnimationDuration&&Ya(l,a)&&!Ya(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)),Ya(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){Ia(t,"transition",""),Ia(t,"transform","");var i=Ma(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,Ia(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),Ia(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Ia(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){Ia(t,"transition",""),Ia(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var tl=[],el={initializeByDefault:!0},nl={mount:function(t){for(var e in el)el.hasOwnProperty(e)&&!(e in t)&&(t[e]=el[e]);tl.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),tl.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";tl.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](fa({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](fa({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in tl.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,ba(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 tl.forEach((function(o){"function"==typeof o.eventProperties&&ba(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return tl.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var ol=["evt"],il=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=ya(n,ol);nl.pluginEvent.bind(Jl)(t,e,fa({dragEl:sl,parentEl:al,ghostEl:ll,rootEl:cl,nextEl:dl,lastDownEl:ul,cloneEl:hl,cloneHidden:pl,dragStarted:Nl,putSortable:yl,activeSortable:Jl.active,originalEvent:o,oldIndex:ml,oldDraggableIndex:gl,newIndex:fl,newDraggableIndex:vl,hideGhostForTarget:Hl,unhideGhostForTarget:Yl,cloneNowHidden:function(){pl=!0},cloneNowShown:function(){pl=!1},dispatchSortableEvent:function(t){rl({sortable:e,name:t,originalEvent:o})}},i))};function rl(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,m=t.extraEventProperties;if(e=e||n&&n[Za]){var f,g=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Ca||Ea?(f=document.createEvent("Event")).initEvent(o,!0,!0):f=new CustomEvent(o,{bubbles:!0,cancelable:!0}),f.to=s||n,f.from=a||n,f.item=i||n,f.clone=r,f.oldIndex=l,f.newIndex=c,f.oldDraggableIndex=d,f.newDraggableIndex=u,f.originalEvent=h,f.pullMode=p?p.lastPutMode:void 0;var b=fa(fa({},m),nl.getEventProperties(o,e));for(var y in b)f[y]=b[y];n&&n.dispatchEvent(f),g[v]&&g[v].call(e,f)}}(fa({putSortable:yl,cloneEl:hl,targetEl:sl,rootEl:cl,oldIndex:ml,oldDraggableIndex:gl,newIndex:fl,newDraggableIndex:vl},t))}var sl,al,ll,cl,dl,ul,hl,pl,ml,fl,gl,vl,bl,yl,wl,Cl,El,Sl,Ol,xl,Nl,_l,Al,jl,Pl,Tl=!1,Dl=!1,kl=[],$l=!1,Ll=!1,Il=[],Ml=!1,Fl=[],Rl="undefined"!=typeof document,Wl=xa,Bl=Ea||Ca?"cssFloat":"float",zl=Rl&&!Na&&!xa&&"draggable"in document.createElement("div"),ql=function(){if(Rl){if(Ca)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Ul=function(t,e){var n=Ia(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=za(t,0,e),r=za(t,1,e),s=i&&Ia(i),a=r&&Ia(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Wa(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Wa(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[Bl]||r&&"none"===n[Bl]&&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"==ga(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},Hl=function(){!ql&&ll&&Ia(ll,"display","none")},Yl=function(){!ql&&ll&&Ia(ll,"display","")};Rl&&!Na&&document.addEventListener("click",(function(t){if(Dl)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Dl=!1,!1}),!0);var Gl=function(t){if(sl){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,kl.some((function(t){var e=t[Za].options.emptyInsertThreshold;if(e&&!qa(t)){var n=Wa(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[Za]._onDragOver(n)}}var i,r,s},Vl=function(t){sl&&sl.parentNode[Za]._isOutsideThisEl(t.target)};function Jl(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=ba({},e),t[Za]=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 Ul(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!==Jl.supportPointer&&"PointerEvent"in window&&!Oa,emptyInsertThreshold:5};for(var o in nl.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&&zl,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Aa(t,"pointerdown",this._onTapStart):(Aa(t,"mousedown",this._onTapStart),Aa(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Aa(t,"dragover",this),Aa(t,"dragenter",this)),kl.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),ba(this,Qa())}function Kl(t,e,n,o,i,r,s,a){var l,c,d=t[Za],u=d.options.onMove;return!window.CustomEvent||Ca||Ea?(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||Wa(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),u&&(c=u.call(d,l,s)),c}function Zl(t){t.draggable=!1}function Ql(){Ml=!1}function tc(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 ec(t){return setTimeout(t,0)}function nc(t){return clearTimeout(t)}Jl.prototype={constructor:Jl,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(_l=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,sl):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),!sl&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Oa||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Da(a,o.draggable,n,!1))&&a.animated||ul===a)){if(ml=Ua(a),gl=Ua(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return rl({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),il("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=Da(l,o.trim(),n,!1))return rl({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),il("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!Da(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&&!sl&&n.parentNode===r){var l=Wa(n);if(cl=r,al=(sl=n).parentNode,dl=sl.nextSibling,ul=n,bl=s.group,Jl.dragged=sl,wl={target:sl,clientX:(e||t).clientX,clientY:(e||t).clientY},Ol=wl.clientX-l.left,xl=wl.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,sl.style["will-change"]="all",o=function(){il("delayEnded",i,{evt:t}),Jl.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Sa&&i.nativeDraggable&&(sl.draggable=!0),i._triggerDragStart(t,e),rl({sortable:i,name:"choose",originalEvent:t}),La(sl,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Fa(sl,t.trim(),Zl)})),Aa(a,"dragover",Gl),Aa(a,"mousemove",Gl),Aa(a,"touchmove",Gl),Aa(a,"mouseup",i._onDrop),Aa(a,"touchend",i._onDrop),Aa(a,"touchcancel",i._onDrop),Sa&&this.nativeDraggable&&(this.options.touchStartThreshold=4,sl.draggable=!0),il("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Ea||Ca))o();else{if(Jl.eventCanceled)return void this._onDrop();Aa(a,"mouseup",i._disableDelayedDrag),Aa(a,"touchend",i._disableDelayedDrag),Aa(a,"touchcancel",i._disableDelayedDrag),Aa(a,"mousemove",i._delayedDragTouchMoveHandler),Aa(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Aa(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(){sl&&Zl(sl),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?Aa(document,"pointermove",this._onTouchMove):Aa(document,e?"touchmove":"mousemove",this._onTouchMove):(Aa(sl,"dragend",this),Aa(cl,"dragstart",this._onDragStart));try{document.selection?ec((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(Tl=!1,cl&&sl){il("dragStarted",this,{evt:e}),this.nativeDraggable&&Aa(document,"dragover",Vl);var n=this.options;!t&&La(sl,n.dragClass,!1),La(sl,n.ghostClass,!0),Jl.active=this,t&&this._appendGhost(),rl({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Cl){this._lastX=Cl.clientX,this._lastY=Cl.clientY,Hl();for(var t=document.elementFromPoint(Cl.clientX,Cl.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Cl.clientX,Cl.clientY))!==e;)e=t;if(sl.parentNode[Za]._isOutsideThisEl(t),e)do{if(e[Za]){if(e[Za]._onDragOver({clientX:Cl.clientX,clientY:Cl.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=Ta(e));Yl()}},_onTouchMove:function(t){if(wl){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=ll&&Ma(ll,!0),s=ll&&r&&r.a,a=ll&&r&&r.d,l=Wl&&Pl&&Xa(Pl),c=(i.clientX-wl.clientX+o.x)/(s||1)+(l?l[0]-Il[0]:0)/(s||1),d=(i.clientY-wl.clientY+o.y)/(a||1)+(l?l[1]-Il[1]:0)/(a||1);if(!Jl.active&&!Tl){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(ll){r?(r.e+=c-(El||0),r.f+=d-(Sl||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,")");Ia(ll,"webkitTransform",u),Ia(ll,"mozTransform",u),Ia(ll,"msTransform",u),Ia(ll,"transform",u),El=c,Sl=d,Cl=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ll){var t=this.options.fallbackOnBody?document.body:cl,e=Wa(sl,!0,Wl,!0,t),n=this.options;if(Wl){for(Pl=t;"static"===Ia(Pl,"position")&&"none"===Ia(Pl,"transform")&&Pl!==document;)Pl=Pl.parentNode;Pl!==document.body&&Pl!==document.documentElement?(Pl===document&&(Pl=Ra()),e.top+=Pl.scrollTop,e.left+=Pl.scrollLeft):Pl=Ra(),Il=Xa(Pl)}La(ll=sl.cloneNode(!0),n.ghostClass,!1),La(ll,n.fallbackClass,!0),La(ll,n.dragClass,!0),Ia(ll,"transition",""),Ia(ll,"transform",""),Ia(ll,"box-sizing","border-box"),Ia(ll,"margin",0),Ia(ll,"top",e.top),Ia(ll,"left",e.left),Ia(ll,"width",e.width),Ia(ll,"height",e.height),Ia(ll,"opacity","0.8"),Ia(ll,"position",Wl?"absolute":"fixed"),Ia(ll,"zIndex","100000"),Ia(ll,"pointerEvents","none"),Jl.ghost=ll,t.appendChild(ll),Ia(ll,"transform-origin",Ol/parseInt(ll.style.width)*100+"% "+xl/parseInt(ll.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;il("dragStart",this,{evt:t}),Jl.eventCanceled?this._onDrop():(il("setupClone",this),Jl.eventCanceled||((hl=Ja(sl)).removeAttribute("id"),hl.draggable=!1,hl.style["will-change"]="",this._hideClone(),La(hl,this.options.chosenClass,!1),Jl.clone=hl),n.cloneId=ec((function(){il("clone",n),Jl.eventCanceled||(n.options.removeCloneOnHide||cl.insertBefore(hl,sl),n._hideClone(),rl({sortable:n,name:"clone"}))})),!e&&La(sl,i.dragClass,!0),e?(Dl=!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,sl)),Aa(document,"drop",n),Ia(sl,"transform","translateZ(0)")),Tl=!0,n._dragStartId=ec(n._dragStarted.bind(n,e,t)),Aa(document,"selectstart",n),Nl=!0,Oa&&Ia(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=Jl.active,d=bl===l,u=a.sort,h=yl||c,p=this,m=!1;if(!Ml){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=Da(s,a.draggable,r,!0),j("dragOver"),Jl.eventCanceled)return m;if(sl.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return T(!1);if(Dl=!1,c&&!a.disabled&&(d?u||(o=al!==cl):yl===this||(this.lastPutMode=bl.checkPull(this,c,sl,t))&&l.checkPut(this,c,sl,t))){if(i="vertical"===this._getDirection(t,s),e=Wa(sl),j("dragOverValid"),Jl.eventCanceled)return m;if(o)return al=cl,P(),this._hideClone(),j("revert"),Jl.eventCanceled||(dl?cl.insertBefore(sl,dl):cl.appendChild(sl)),T(!0);var f=qa(r,a.draggable);if(!f||function(t,e,n){var o=Wa(qa(n.el,n.options.draggable)),i=Ka(n.el,n.options,ll),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)&&!f.animated){if(f===sl)return T(!1);if(f&&r===t.target&&(s=f),s&&(n=Wa(s)),!1!==Kl(cl,r,sl,e,s,n,t,!!s))return P(),f&&f.nextSibling?r.insertBefore(sl,f.nextSibling):r.appendChild(sl),al=r,D(),T(!0)}else if(f&&function(t,e,n){var o=Wa(za(n.el,0,n.options,!0)),i=Ka(n.el,n.options,ll),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=za(r,0,a,!0);if(g===sl)return T(!1);if(n=Wa(s=g),!1!==Kl(cl,r,sl,e,s,n,t,!1))return P(),r.insertBefore(sl,g),al=r,D(),T(!0)}else if(s.parentNode===r){n=Wa(s);var v,b,y,w=sl.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}(sl.animated&&sl.toRect||e,s.animated&&s.toRect||n,i),E=i?"top":"left",S=Ba(s,"top","top")||Ba(sl,"top","top"),O=S?S.scrollTop:void 0;if(_l!==s&&(b=n[E],$l=!1,Ll=!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(!$l&&(1===Al?l>d+c*r/2:l<u-c*r/2)&&($l=!0),$l)h=!0;else if(1===Al?l<d+jl:l>u-jl)return-Al}else if(l>d+c*(1-i)/2&&l<u-c*(1-i)/2)return function(t){return Ua(sl)<Ua(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,Ll,_l===s),0!==v){var x=Ua(sl);do{x-=v,y=al.children[x]}while(y&&("none"===Ia(y,"display")||y===ll))}if(0===v||y===s)return T(!1);_l=s,Al=v;var N=s.nextElementSibling,_=!1,A=Kl(cl,r,sl,e,s,n,t,_=1===v);if(!1!==A)return 1!==A&&-1!==A||(_=1===A),Ml=!0,setTimeout(Ql,30),P(),_&&!N?r.appendChild(sl):s.parentNode.insertBefore(sl,_?N:s),S&&Va(S,0,O-S.scrollTop),al=sl.parentNode,void 0===b||Ll||(jl=Math.abs(b-Wa(s)[E])),D(),T(!0)}if(r.contains(sl))return T(!1)}return!1}function j(a,l){il(a,p,fa({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:u,fromSortable:h,target:s,completed:T,onMove:function(n,o){return Kl(cl,r,sl,e,n,Wa(n),t,o)},changed:D},l))}function P(){j("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function T(e){return j("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(La(sl,yl?yl.options.ghostClass:c.options.ghostClass,!1),La(sl,a.ghostClass,!0)),yl!==p&&p!==Jl.active?yl=p:p===Jl.active&&yl&&(yl=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){j("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===sl&&!sl.animated||s===r&&!s.animated)&&(_l=null),a.dragoverBubble||t.rootEl||s===document||(sl.parentNode[Za]._isOutsideThisEl(t.target),!e&&Gl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function D(){fl=Ua(sl),vl=Ua(sl,a.draggable),rl({sortable:p,name:"change",toEl:r,newIndex:fl,newDraggableIndex:vl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){ja(document,"mousemove",this._onTouchMove),ja(document,"touchmove",this._onTouchMove),ja(document,"pointermove",this._onTouchMove),ja(document,"dragover",Gl),ja(document,"mousemove",Gl),ja(document,"touchmove",Gl)},_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;fl=Ua(sl),vl=Ua(sl,n.draggable),il("drop",this,{evt:t}),al=sl&&sl.parentNode,fl=Ua(sl),vl=Ua(sl,n.draggable),Jl.eventCanceled||(Tl=!1,Ll=!1,$l=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),nc(this.cloneId),nc(this._dragStartId),this.nativeDraggable&&(ja(document,"drop",this),ja(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Oa&&Ia(document.body,"user-select",""),Ia(sl,"transform",""),t&&(Nl&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),ll&&ll.parentNode&&ll.parentNode.removeChild(ll),(cl===al||yl&&"clone"!==yl.lastPutMode)&&hl&&hl.parentNode&&hl.parentNode.removeChild(hl),sl&&(this.nativeDraggable&&ja(sl,"dragend",this),Zl(sl),sl.style["will-change"]="",Nl&&!Tl&&La(sl,yl?yl.options.ghostClass:this.options.ghostClass,!1),La(sl,this.options.chosenClass,!1),rl({sortable:this,name:"unchoose",toEl:al,newIndex:null,newDraggableIndex:null,originalEvent:t}),cl!==al?(fl>=0&&(rl({rootEl:al,name:"add",toEl:al,fromEl:cl,originalEvent:t}),rl({sortable:this,name:"remove",toEl:al,originalEvent:t}),rl({rootEl:al,name:"sort",toEl:al,fromEl:cl,originalEvent:t}),rl({sortable:this,name:"sort",toEl:al,originalEvent:t})),yl&&yl.save()):fl!==ml&&fl>=0&&(rl({sortable:this,name:"update",toEl:al,originalEvent:t}),rl({sortable:this,name:"sort",toEl:al,originalEvent:t})),Jl.active&&(null!=fl&&-1!==fl||(fl=ml,vl=gl),rl({sortable:this,name:"end",toEl:al,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){il("nulling",this),cl=sl=al=ll=dl=hl=ul=pl=wl=Cl=Nl=fl=vl=ml=gl=_l=Al=yl=bl=Jl.dragged=Jl.ghost=Jl.clone=Jl.active=null,Fl.forEach((function(t){t.checked=!0})),Fl.length=El=Sl=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":sl&&(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++)Da(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||tc(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];Da(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 Da(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=nl.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Xl(n)},destroy:function(){il("destroy",this);var t=this.el;t[Za]=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(),kl.splice(kl.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!pl){if(il("hideClone",this),Jl.eventCanceled)return;Ia(hl,"display","none"),this.options.removeCloneOnHide&&hl.parentNode&&hl.parentNode.removeChild(hl),pl=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(pl){if(il("showClone",this),Jl.eventCanceled)return;sl.parentNode!=cl||this.options.group.revertClone?dl?cl.insertBefore(hl,dl):cl.appendChild(hl):cl.insertBefore(hl,sl),this.options.group.revertClone&&this.animate(sl,hl),Ia(hl,"display",""),pl=!1}}else this._hideClone()}},Rl&&Aa(document,"touchmove",(function(t){(Jl.active||Tl)&&t.cancelable&&t.preventDefault()})),Jl.utils={on:Aa,off:ja,css:Ia,find:Fa,is:function(t,e){return!!Da(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:Ga,closest:Da,toggleClass:La,clone:Ja,index:Ua,nextTick:ec,cancelNextTick:nc,detectDirection:Ul,getChild:za,expando:Za},Jl.get=function(t){return t[Za]},Jl.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&&(Jl.utils=fa(fa({},Jl.utils),t.utils)),nl.mount(t)}))},Jl.create=function(t,e){return new Jl(t,e)},Jl.version="1.15.3";var oc,ic,rc,sc,ac,lc,cc=[],dc=!1;function uc(){cc.forEach((function(t){clearInterval(t.pid)})),cc=[]}function hc(){clearInterval(lc)}var pc=Ga((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=Ra(),d=!1;ic!==n&&(ic=n,uc(),oc=e.scroll,i=e.scrollFn,!0===oc&&(oc=Ha(n,!0)));var u=0,h=oc;do{var p=h,m=Wa(p),f=m.top,g=m.bottom,v=m.left,b=m.right,y=m.width,w=m.height,C=void 0,E=void 0,S=p.scrollWidth,O=p.scrollHeight,x=Ia(p),N=p.scrollLeft,_=p.scrollTop;p===c?(C=y<S&&("auto"===x.overflowX||"scroll"===x.overflowX||"visible"===x.overflowX),E=w<O&&("auto"===x.overflowY||"scroll"===x.overflowY||"visible"===x.overflowY)):(C=y<S&&("auto"===x.overflowX||"scroll"===x.overflowX),E=w<O&&("auto"===x.overflowY||"scroll"===x.overflowY));var A=C&&(Math.abs(b-r)<=a&&N+y<S)-(Math.abs(v-r)<=a&&!!N),j=E&&(Math.abs(g-s)<=a&&_+w<O)-(Math.abs(f-s)<=a&&!!_);if(!cc[u])for(var P=0;P<=u;P++)cc[P]||(cc[P]={});cc[u].vx==A&&cc[u].vy==j&&cc[u].el===p||(cc[u].el=p,cc[u].vx=A,cc[u].vy=j,clearInterval(cc[u].pid),0==A&&0==j||(d=!0,cc[u].pid=setInterval(function(){o&&0===this.layer&&Jl.active._onTouchMove(ac);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(Jl.dragged.parentNode[Za],n,e,t,ac,cc[this.layer].el)||Va(cc[this.layer].el,n,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=Ha(h,!1)));dc=d}}),30),mc=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 fc(){}function gc(){}fc.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=za(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:mc},ba(fc,{pluginName:"revertOnSpill"}),gc.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:mc},ba(gc,{pluginName:"removeOnSpill"}),Jl.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?Aa(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Aa(document,"pointermove",this._handleFallbackAutoScroll):e.touches?Aa(document,"touchmove",this._handleFallbackAutoScroll):Aa(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)),hc(),uc(),clearTimeout(ka),ka=void 0},nulling:function(){ac=ic=oc=dc=lc=rc=sc=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(ac=t,e||this.options.forceAutoScrollFallback||Ea||Ca||Oa){pc(t,this.options,r,e);var s=Ha(r,!0);!dc||lc&&o===rc&&i===sc||(lc&&hc(),lc=setInterval((function(){var r=Ha(document.elementFromPoint(o,i),!0);r!==s&&(s=r,uc()),pc(t,n.options,r,e)}),10),rc=o,sc=i)}else{if(!this.options.bubbleScroll||Ha(r,!0)===Ra())return void uc();pc(t,this.options,Ha(r,!1),!1)}}},ba(t,{pluginName:"scroll",initializeByDefault:!0})}),Jl.mount(gc,fc);const vc={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(i.get("attributeNotPermitted",e||"")),bc.add.attrs(t);let n;e&&(n=String(window.prompt(t.message.value,"")),t.addAction(e,n))},option:t=>{t.addAction()},condition:t=>{t.addAction(t)}},click:{btn:t=>{t.action()}},save:{form:Ui}},bc={init:function(t){const e=Object.keys(vc);return this.opts=e.reduce(((e,n)=>(e[n]={...vc[n],...t[n]},e)),t),this},add:{attrs:t=>bc.opts.add.attr(t),options:t=>bc.opts.add.option(t),conditions:t=>(t.template={if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]},bc.opts.add.condition(t))},click:{btn:t=>bc.opts.click.btn(t)},save:{form:t=>(bc.opts.sessionStorage&&Wi.set($,t),Hr.formeoSaved({formData:t}),bc.opts.save.form(t))}},yc=Object.freeze({type:"field",displayType:"slider"}),wc=t=>({transform:`translateX(${t?`${t}px`:0})`});class Cc{constructor(t){e(this,"toggleTabbedLayout",(()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t})),e(this,"resizePanels",(()=>{this.toggleTabbedLayout();const t=this.panelsWrap.style,e=$d.getStyle(this.currentPanel,"height");return t.height=e,e})),this.opts=Ii(yc,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const n=this.createPanelsWrap();this.nav=this.navActions();const o=new window.ResizeObserver((([{contentRect:{width:t}}])=>{this.currentWidth!==t&&(this.toggleTabbedLayout(),this.currentWidth=t,this.nav.setTranslateX(this.activePanelIndex,!1))})),i=window.setTimeout((()=>{o.observe(n),window.clearTimeout(i)}),F)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt($d.getStyle(t,"width"))>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||yc.displayType,this.panelDisplay}createPanelsWrap(){const t=$d.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 Br.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Jl.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=$r(t.target,t.target.parentElement);this.currentPanel=this.panels[e];const n=t.target.parentElement.childNodes;this.nav.refresh(e),$d.removeClasses(n,"active-tab"),t.target.classList.add("active-tab")}},content:t.config.label}))),e={className:"panel-labels",content:{content:t}},[n]=t;return n.className="active-tab",$d.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:i.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:$d.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:i.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:$d.icon("triangle-left")};return $d.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=this.currentPanel.parentElement.childNodes;this.activePanelIndex=$r(this.currentPanel,e);let i={nav:0,panel:0},r={...i};t.groupChange=t=>{const e=n.children;return $d.removeClasses(o,"active-panel"),$d.removeClasses(e,"active-tab"),this.currentPanel=o[t],this.currentPanel.classList.add("active-panel"),e[t].classList.add("active-tab"),this.currentPanel};const s=({offset:t,reset:o,duration:i=M,animate:s=!this.isTabbed})=>{const a=[wc(r.panel),wc(t.panel)],l=[wc(r.nav),wc(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:s?i:0,fill:"forwards"},d=e.animate(a,c);n.animate(l,c);const u=()=>{this.panelsWrap.style.height=$d.getStyle(this.currentPanel,"height"),d.removeEventListener("finish",u),o||(r=t)};d.addEventListener("finish",u)};return t.setTranslateX=(t=this.activePanelIndex,o=!0)=>{var r;r=t,i={nav:-n.offsetWidth*r,panel:-e.offsetWidth*r},s({offset:i,animate:o})},t.refresh=(e=this.activePanelIndex)=>{this.activePanelIndex!==e&&(this.activePanelIndex=e,t.groupChange(e)),t.setTranslateX(this.activePanelIndex),this.resizePanels()},t.nextGroup=()=>{const e=this.activePanelIndex+1;if(e!==o.length){const o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex++}else i={nav:r.nav-8,panel:r.panel-8},s({offset:i,reset:!0});return this.currentPanel},t.prevGroup=()=>{if(0!==this.activePanelIndex){const e=this.activePanelIndex-1,o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex--}else i={nav:8,panel:8},s({offset:i,reset:!0})},t}}const Ec="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`)),Sc=new RegExp(`(?!${Ec.join("|")})\\w\\S*`,"g"),Oc=/\s+/g;function xc(t){if("string"!=typeof t)return t;if(t.trim().match(Oc))return t;return t.replace(Sc,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const Nc=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),_c="f-autocomplete",Ac="highlight-component";let jc,Pc=Date.now();const Tc=({name:t,id:e,...n})=>["config.label","attrs.id","meta.id"].reduce(((t,e)=>(t||(t=n.get(e)),t)),null)||"external"===t&&((...t)=>i.get(t.join("."))||xc(t.join(" ")))(t,e);class Dc{constructor(t,e,n){this.key=t,this.className=t.replace(/\./g,"-"),this.value=e,this.events=[],this.i18nKey=n,this.build()}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(`${this.className}-focused`);const n=$d.toggleElementsByStr(this.list.querySelectorAll("li"),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(`${this.className}-focused`),e.removeEventListener("keydown",t),this.hideList()},input:t=>{const e=$d.toggleElementsByStr(this.list.querySelectorAll("li"),t.target.value);if(0===t.target.value.length&&this.clearValue(),0===e.length)this.hideList();else{const t=this.getActiveOption()||e[0];this.showList(t)}this.hiddenField.value=t.target.value,this.value=t.target.value,this.runEvent("onChange",{target:this.hiddenField})}};return this.displayField=$d.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:`${_c}-display-field`,value:this.label||this.value,placeholder:i.get(`${this.i18nKey}.${this.key}.placeholder`)}}),this.hiddenField=$d.create({tag:"input",attrs:{type:"hidden",className:this.className,value:this.value}}),this.list=$d.create({tag:"ul",attrs:{className:`${_c}-list`}}),this.dom=$d.create({children:[this.displayField,this.hiddenField,this.list],className:this.className,action:{onRender:()=>{const t=this.value&&Dd.getAddress(this.value);this.label=t&&Tc(t),this.label&&(this.displayField.value=this.label),this.updateOptions()}}}),this.dom}updateOptions(){const t=Date.now();t-Pc>F&&($d.empty(this.list),this.generateOptions(),Pc=t);(jc||this.generateOptions()).forEach((t=>this.list.appendChild(t)))}generateOptions(){const t=(t=>{const e=[],n=Dd.flatList();return Object.entries(n).map((([n,o])=>{const i=Tc(o);if(i){const r={tag:"span",content:` ${xc(o.name)}`,className:"component-type"},s=`${o.name}.${i}`;e.push(s);const a=((t,e)=>t.reduce(((t,n)=>t+(n===e)),0))(e,s),l={tag:"span",content:a>1&&`(${a})`,className:"component-label-count"};return $d.makeOption([n,[`${i} `,l,r]],t)}})).filter(Boolean)})(),e=t=>{const e=`${_c}-list-item`;return t.classList.contains(e)||(t=t.parentElement),t};return jc=t.map((t=>{const n=t.value;let[o]=t.label;o=o.trim();const i={tag:"li",children:t.label,dataset:{value:n,label:o},className:`${_c}-list-item`,action:{mousedown:({target:t})=>{t=e(t),this.setValue(t),this.selectOption(t),this.hideList()},mouseover:({target:t})=>{t=e(t),this.removeHighlight(),this.highlightComponent(t)}}};return $d.create(i)})),jc}hideList(t=this.list){zr.slideUp(t,M),this.removeHighlight()}showList(t,e=this.list){this.selectOption(t),zr.slideDown(e,M)}getActiveOption(t=this.list){const e=t.getElementsByClassName("active-option")[0];return e&&"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(let o=0;o<n.length;o++){const{dataset:{value:t}}=n[o];if(n[o].classList.remove("active-option"),t){const e=Dd.getAddress(t);e.dom&&e.dom.classList.remove(Ac)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(Ac);for(let e=0;e<t.length;e++)t[e].classList.remove(Ac)}highlightComponent(t){const{dataset:{value:e}}=t;if(e){const t=Dd.getAddress(e);t.dom&&t.dom.classList.add(Ac)}}clearValue(){this.selectOption(null),this.displayField.value="",this.hiddenField.value="",this.value="",this.runEvent("onChange",{target:this.hiddenField})}setValue(t){const{label:e,value:n}=t.dataset;this.displayField.value=e,this.hiddenField.value=n,this.value=n,this.runEvent("onChange",{target:this.hiddenField})}addEvent(t,e){this.events.push([t,e])}runEvent(t,e){this.events.forEach((([n,o])=>{n===t&&o(e)}))}}const kc=(t,e)=>{const n=(t=>{const e=zi(t),n={"field.property":q,...U},o=e?(i=t,Dd.getAddress(i).getData()):n[t];var i;return Object.keys(o).reduce(((t,e)=>(t[e]=e,t)),{})})(t);return Object.entries(n).reduce(((n,[o,r])=>{if("id"!==o){const s={tag:"option",content:i.get(`${t}.${o}`)||o.toLowerCase(),attrs:{value:r}};e===r&&(s.attrs.selected=!0),n.push($d.create(s))}return n}),[])},$c=(t,e)=>{$d.empty(t),e.forEach((e=>t.add(e)))},Lc=({key:t,value:e,type:n="text",checked:o})=>{const r={tag:"input",attrs:{type:n,value:e,placeholder:i.get(`${t}.placeholder`)||xc(t)},className:t.replace(/\./g,"-"),config:{}};return o&&(r.attrs.checked=!0),r},Ic=t=>{const e=i.get(t);if(e)return e;const n=t.split(".");return i.get(n[n.length-1])},Mc={autocomplete:(t,e,n)=>new Dc(t,e,n),string:(t,e)=>Lc({key:t,value:e}),boolean:(t,e)=>Lc({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:e}),number:(t,e)=>Lc({key:t,value:e,type:"number"}),array:(t,e=[])=>({tag:"select",attrs:{placeholder:Ic(`placeholder.${t}`)},className:t.replace(/\./g,"-"),options:e}),object:t=>Object.entries(t).map((([t,e])=>Mc[$d.childType(e)](t,e)))},Fc=["selected","checked"],Rc={boolean:(t,e)=>({click:({target:{checked:n}})=>{var o,i;"radio"===(null==(i=null==(o=e.data)?void 0:o.attrs)?void 0:i.type)&&e.set("options",e.data.options.map((t=>({...t,selected:!1})))),e.set(t,n),e.updatePreview()}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n)}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n)),e.updatePreview()}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n),e.updatePreview()}}),object:()=>({})};class Wc{constructor({key:t,data:n,index:o,field:r}){e(this,"generateConditionFields",((t,e)=>{const n={tag:"label",className:`condition-label ${t}-condition-label`,content:i.get(t)||t};return e.map(((e,o)=>{const i=[],r=Object.entries(e).map((([e,n])=>{const r=this.conditionInput(e,n,t,o);return r&&i.push([r.className,n.trim()].filter(Boolean).join("-")),r})).filter(Boolean),s=Lr(r,z.map((t=>`condition-${t}`)),"className||dom.className");return this.processConditionUIState(s),o||s.unshift(n),this.itemFieldGroups.push(s),{children:s,className:`f-condition-row ${t}-condition-row ${i.join(" ")}`}}))})),e(this,"processConditionUIState",(t=>{const e=e=>(e=e.split("|"),t.filter((t=>e.includes(t.className)))),n=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.style.display="none"})),clearTimeout(e)}),I)},o=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.removeAttribute("style")})),clearTimeout(e)}),I)},i=new Map([["condition-source",t=>{const i=e("condition-sourceProperty"),r=i[0],s=zi(t.value)?t.value:"field.property",a=kc(s,r.value);return $c(r,a),t.value?o(i):n(i)}],["condition-target",t=>{const i=e("condition-targetProperty");return Bi(t.value)&&t.value?o(i):n(i)}],["condition-sourceProperty",t=>{const i=e("condition-comparison|condition-targetProperty|condition-target"),r=t.value;return(t=>/^is|^has/.test(t))(r.substring(r.lastIndexOf(".")+1,r.length))?n(i):o(i)}]]);t.forEach((t=>{const e=i.get(t.className);e&&e(t)}))})),e(this,"conditionInput",((t,e,n,o)=>{const i=this.field,r=`${this.itemKey}.${n}.${o}`,s=`${this.field.id}.${r}`,a=`${i.name}s.${s}.${t}`,l=(t,e,n)=>{const o=kc(n||t,e),i=Mc.array(`condition.${t}`);i.action={change:c,onRender:t=>c({target:t})};const r=$d.create(i);return $c(r,o),r},c=({target:t})=>{const e=t.closest(".f-condition-row"),n=new RegExp(`${t.className}(?:\\S?)+`,"gm");e.className=e.className.replace(n,""),e.classList.add([t.className,t.value].filter(Boolean).join("-"));const o={dataPath:a,value:t.value,src:t};Hr.formeoUpdated(o),Dd.setAddress(a,t.value);const i=t.closest(".f-condition-row"),r=$r(i);this.processConditionUIState(this.itemFieldGroups[r])},d={comparison:t=>l("comparison",t),logical:t=>l("logical",t),source:(t,e="source")=>{const o=Mc.autocomplete(`condition.${e}`,t,n);return Dd.setConditionMap(t,i),o.addEvent("onChange",(t=>{Dd.removeConditionMap(Dd.getAddress(a)),c(t),Dd.setConditionMap(t.target.value,i)})),o},sourceProperty:t=>l("sourceProperty",t,"field.property"),targetProperty:t=>l("targetProperty",t,"field.property"),target:t=>d.source(t,"target"),value:t=>{const e=Mc.string("condition.value",t);return e.action={input:c},$d.create(e)},assignment:t=>l("assignment",t)};if(d[t])return d[t](e)})),this.itemValues=Lr(Object.entries(n),Fc,"0");const[s,a]=t.split(".");this.field=r,this.itemKey=t,this.itemIndex=o,this.panelName=s,this.isDisabled=r.isDisabledProp(a,s),this.isHidden=this.isDisabled&&r.config.panels[s].hideDisabled,this.isLocked=r.isLockedProp(a,s),this.dom=$d.create({tag:"li",className:[`field-${t.replace(/\./g,"-")}`,"prop-wrap",this.isHidden&&"hidden-property"],children:{className:"field-prop",children:[this.itemInputs,this.itemControls]}})}get itemInputs(){this.itemFieldGroups=[];return{className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map((([t,e])=>{let n="conditions"===this.panelName?this.generateConditionFields(t,e):this.itemInput(t,e);return["selected","checked"].includes(t)&&(n={className:"f-addon",children:n}),n}))}}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:()=>{zr.slideUp(this.dom,250,(t=>{this.field.remove(this.itemKey),$d.remove(t),this.field.resizePanelWrap()}))}},content:$d.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=$d.childType(e)||"string",o={config:{},attrs:{},...Mc[n](t,e)},i=this.itemKey.replace(/.\d+$/,(e=>`${e}.${t}`)),r=i.split(".").filter(Number.isNaN).join("."),[s,a]=[[...this.itemKey.split("."),t],[t]].map((t=>[this.field.id,...t].filter(Boolean).join("-")));return o.config={...o.config,label:"options"!==this.panelName&&Ic(r),labelAfter:!1},o.attrs={...o.attrs,name:"checkbox"===o.attrs.type?`${a}[]`:a,id:s,disabled:this.isDisabled,locked:this.isLocked},o.action={...Rc[n](i,this.field)},o}}class Bc{constructor(t,n,o){e(this,"addAttribute",((t,e)=>{const n=Nc(t),o=`attrs.${n}`;i.current[o]||i.put(o,Rr(t)),"string"==typeof e&&["true","false"].includes(e)&&(e=JSON.parse(e)),this.field.set(`attrs.${t}`,e);const r=this.props.querySelector(`.field-attrs-${n}`),s=new Wc({key:o,data:{[n]:e},field:this.field});r?this.props.replaceChild(s.dom,r):this.props.appendChild(s.dom),this.field.resizePanelWrap()})),e(this,"addOption",(()=>{const t=this.field.data.meta.id,e=this.field.get("options"),n="select"===t?"option":t,o=i.get("newOptionLabel",{type:n})||"New Option",r=`options.${this.data.length}`,s={...e.length?Dr(e[e.length-1]):{},label:o,value:Nc(o)},a=new Wc({key:r,data:s,field:this.field,index:this.props.children.length});this.editPanelItems.push(a),this.props.appendChild(a.dom),this.field.set(r,s),this.field.resizePanelWrap()})),e(this,"addCondition",(t=>{const e=`conditions.${this.field.get("conditions").length}`,n=this.props.querySelector(`.field-${e.replace(".","-")}`),o=new Wc({key:e,data:t.template,field:this.field});n?this.props.replaceChild(o.dom,n):this.props.appendChild(o.dom),this.field.set(e,t.template),this.field.resizePanelWrap()})),this.type=$d.childType(t),this.data="object"===this.type?Object.entries(t):t,this.name=n,this.field=o,this.panelConfig=this.getPanelConfig(this.data)}getPanelConfig(t){return this.props=this.createProps(t),this.editButtons=this.createEditButtons(),{id:`${this.field.id}-${this.name}-panel`,config:{label:i.get(`panel.label.${this.name}`)},attrs:{className:`f-panel ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(t){this.editPanelItems=Array.from(t).map(((t,e)=>{const n="array"===this.type,o=[this.name,n?String(e):t[0]].join("."),i=n?t:{[t[0]]:t[1]};return new Wc({key:o,data:i,field:this.field})}));const e={tag:"ul",attrs:{className:["field-edit-group",`field-edit-${this.name}`]},editGroup:this.name,isSortable:"options"===this.name,content:this.editPanelItems};return $d.create(e)}createEditButtons(){const t=this,e=this.name,n=i.get(`panelEditButtons.${e}`),o={attrs:t.addAttribute,options:t.addOption,conditions:t.addCondition};return{className:"panel-action-buttons",content:[{...$d.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:n=>{const r={btnCoords:$d.coords(n.target),addAction:o[e]};"attrs"===e&&(r.isDisabled=t.field.isDisabledProp,r.isLocked=t.field.isLockedProp,r.message={attr:i.get(`action.add.${e}.attr`),value:i.get(`action.add.${e}.value`)});const s=xc(e),a=new window.CustomEvent(`onAdd${s}`,{detail:r});bc.add[e](r),document.dispatchEvent(a)}}}]}}}class zc extends pa{constructor(t,n={},o){super(t,{...n,id:n.id||Li()}),e(this,"mutationHandler",(t=>t.map((t=>{})))),e(this,"remove",(t=>{if(t){const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?kr(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 Ir(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(Dd.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),Dd[`${this.name}s`].delete(this.id)})),e(this,"emptyClass",(()=>this.dom.classList.toggle("empty",!this.children.length))),e(this,"getComponentTag",(()=>$d.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&$d.icon("component-corner",["bottom-left"]),$d.icon(`handle-${this.name}`),xc(this.name),(this.isColumn||this.isRow)&&$d.icon("component-corner",["bottom-right"])].filter(Boolean)}))),e(this,"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[$d.childType(t)](this.dom)})),e(this,"loadChildren",((t=this.data.children)=>t.map((t=>this.addChild({id:t}))))),e(this,"saveChildOrder",(()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t})),e(this,"onSort",(()=>this.saveChildOrder())),e(this,"onEnd",(({to:{parentElement:t},from:{parentElement:e}})=>{null==t||t.classList.remove(`hovering-${ki(t)}`),null==e||e.classList.remove(`hovering-${ki(e)}`)})),e(this,"runConditions",(()=>{const t=this.get("conditions");if(!(null==t?void 0: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)))}))})),e(this,"value",((t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!q[i]].some(Boolean)?t:e?o.set(q[i],e):o.get(q[i])})),e(this,"getResult",(t=>({"=":(t,e,n)=>t.set(e,n)}[t]))),e(this,"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)}})))),e(this,"execResults",(t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)})),e(this,"execResult",(({target:t,action:e,value:n,propertyPath:o})=>new Promise(((o,i)=>{try{return o(e(t,n))}catch(r){return i(r)}})))),e(this,"cloneData",(()=>{const t={...Mi(this.data),id:Li()};return"field"!==this.name&&(t.children=[]),t})),e(this,"clone",((t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),e})),e(this,"createChildWrap",(t=>$d.create({tag:"ul",attrs:{className:"children"},children:t}))),this.id=this.data.id,this.name=t,this.config=Dd[`${this.name}s`].config,Ii(this.config,n.config),this.dataPath=`${this.name}s.${this.id}.`,this.observer=new MutationObserver(this.mutationHandler),this.render=o}observe(t){this.observer.disconnect(),this.observer.observe(t,{childList:!0})}get js(){return this.data}get json(){return this.data}empty(){const t=this.children.map((t=>t.remove()));return this.data.children=this.data.children.filter((e=>-1===t.indexOf(e))),this.dom.classList.add("empty"),t}getActionButtons(){const t=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:({target:e})=>{Dd.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),Dd.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...$d.btnTemplate({content:$d.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}toggleEdit(t=!this.isEditing){this.isEditing=t;const e=this.dom,n="editing",o=`${n}-${this.name}`,i=this.dom.querySelector(`.${this.name}-edit`);zr.slideToggle(i,I,t),"field"===this.name&&(zr.slideToggle(this.preview,I,!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}`)=>({...$d.btnTemplate({content:$d.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...$d.btnTemplate({content:$d.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...$d.btnTemplate({content:$d.icon(t)}),className:["item-edit-toggle"],meta:{id:"edit"},action:{click:t=>{this.toggleEdit()}}}),remove:(t="remove")=>({...$d.btnTemplate({content:$d.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:(t,e)=>{zr.slideUp(this.dom,I,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...$d.btnTemplate({content:$d.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=>{var n;return(null==(n=t[e])?void 0:n.call(t))||e}));return this.actionButtons=o,this.actionButtons}get index(){return $r(this.dom)}get parentType(){return T.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${O[t]}`);return e&&$d.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=P.get(this.name);return Mr(t,(t=>Dd.getAddress(`${e}s.${t.id}`))).filter(Boolean)}get domChildren(){const t=this.dom.querySelector(".children");return t?t.children:[]}addChild(t={},e=this.domChildren.length){var n,o;let i=t;"object"!=typeof t&&(i={id:i});const r=this.dom.querySelector(".children"),{id:s=Li()}=i,a=P.get(this.name);if(!a)return null;const l=`${a}s`,c=Dd.getAddress(`${l}.${s}`)||Dd[l].add(s,i);r.insertBefore(c.dom,r.children[e]),null==(o=null==(n=this.config.events)?void 0:n.onAddChild)||o.call(n,{parent:this,child:c});const d=c.get("children");return(null==d?void 0:d.length)&&c.loadChildren(d),this.removeClasses("empty"),this.saveChildOrder(),c}onAdd({from:t,to:e,item:n,newIndex:o}){var i;t.classList.contains(h)||(t=t.parentElement);const r=ki(t),s=ki(e.parentElement),a=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=$r(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),l={controls:()=>{const{controlData:t}=cd.get(n.id),{meta:{id:e}}=t,i=e.startsWith("layout-")?e.replace(/^layout-/,""):"field",r=Pr({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}`),s=a.get(r)();$d.remove(n);return s(t,o)},row:()=>{const t=(a.get({stage:-1,row:0,column:1}[s])||Ui)();return null==t?void 0:t({id:n.id},o)},column:()=>{const t=(a.get({stage:-2,row:-1}[s])||Ui)();return null==t?void 0:t(n.id)}},c=null==(i=l[r])?void 0:i.call(l,n,o);return(()=>{this.saveChildOrder(),this.removeClasses("empty")})(),c}onRemove({from:{parentElement:t}}){return t.classList.contains(f)&&t.classList.remove("column-editing-field"),"stage"===this.name||this.children.length?(this.emptyClass(),this.saveChildOrder()):this.remove()}onRender(){const{events:t}=this.config;if(!t)return null;t.onRender&&$d.onRender(this.dom,t.onRender)}set config(t){const e=Pr(this.data,"meta.id"),n=[Pr(t,"all"),e&&Pr(t,e),Pr(t,this.id)].reduce(((t,e)=>e?Ii(t,e):t),this.configVal);this.configVal=n}get config(){return this.configVal}getComponent(t){const[e,n]=t.split("."),o=Dd[e];return n===this.id?this:null==o?void 0:o.get(n)}cloneChildren(t){for(const e of this.children)null==e||e.clone(t)}get isRow(){return this.name===E.row}get isColumn(){return this.name===E.column}get isField(){return this.name===E.field}}class qc extends zc{constructor(t=Object.create(null)){super("field",{conditions:[{if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]}],...t}),e(this,"updateConditionsPanel",(()=>{const t=setTimeout((()=>{const e=this.editPanels.find((({name:t})=>"conditions"===t));if(!e)return null;const n=e.createProps(),o=this.dom.querySelector(".field-edit-conditions");o.parentElement.replaceChild(n,o),clearTimeout(t)}),I)})),e(this,"updatePreview",qi((()=>{if(!this.preview.parentElement)return null;this.updateLabel();const t=$d.create(this.fieldPreview(),!0);this.preview.parentElement.replaceChild(t,this.preview),this.preview=t}),I)),e(this,"isDisabledProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get(`config.disabled${xc(e)}`)).includes(t)})),e(this,"isLockedProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get(`config.locked${xc(e)}`)).includes(t)})),this.label=$d.create(this.labelConfig),this.preview=$d.create({}),this.editPanels=[];const n=this.getActionButtons(),o=this.actionButtons.some((t=>{var e;return"edit"===(null==(e=t.meta)?void 0:e.id)}));let r={tag:"li",attrs:{className:g},id:this.id,children:[this.label,this.getComponentTag(),n,o&&this.fieldEdit,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:i.get("field")}};r=$d.create(r),this.observe(r),this.dom=r,this.isEditing=!1,this.onRender(r)}get labelConfig(){if(!!this.get("config.hideLabel"))return;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,value:o}})=>{super.set("config.label",n?o:t);const i=Dd.getConditionMap(`fields.${this.id}`);if(i)return i.updateConditionSourceLabel(`${this.name}s.${this.id}`,n?o:e)}}},e&&$d.requiredMark()]}}updateConditionSourceLabel(t,e){const n=this.editPanels.find((({name:t})=>"conditions"===t));if(!n)return null;for(const{itemFieldGroups:o}of n.editPanelItems)for(const n of o){const o=n.find((e=>e.value===t));o&&(o.displayField.value=e)}}set(...t){const[e,n]=t,o=super.set(e,n);return this.updatePreview(),o}updateLabel(){if(!this.label)return null;const t=$d.create(this.labelConfig);this.label.parentElement.replaceChild(t,this.label),this.label=t}get fieldEdit(){this.editPanels=[];const t=["object","array"],e=["config","meta","action","events",...this.config.panels.disabled],n=$i([...this.config.panels.order,...Object.keys(this.data)]).filter((t=>!e.includes(t))),o={className:["field-edit","slide-toggle","formeo-panels-wrap"]};for(const s of n){const e=this.get(s),n=$d.childType(e);if(t.includes(n)){const t=new Bc(e,s,this);this.editPanels.push(t)}}const i={panels:this.editPanels.map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"},r=this.editPanels.length;return r&&(this.panels=new Cc(i),o.className.push(`panel-count-${r}`),o.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh,o.action={onRender:()=>{if(this.resizePanelWrap(),!r){const t=this.dom,e=t.querySelector(".item-edit-toggle"),n=t.querySelector(".field-actions"),o=n.getElementsByTagName("button");n.style.maxWidth=o.length*o[0].clientWidth+"px",$d.remove(e)}}}),o}get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{checked:n,type:o}=e;if(["checkbox","radio"].includes(o)){const t=+e.id.split("-").pop();"radio"===o&&this.set("options",this.get("options").map((t=>({...t,selected:!1}))));const i="checkbox"===o?"checked":"selected";this.set(`options.${t}.${i}`,n)}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:t=>{["input","meter","progress","button"].includes(this.data.tag)&&super.set("attrs.value",t.target.value),t.target.contentEditable&&super.set("content",t.target.innerHTML)}}}fieldPreview(){var t;const e=Mi(this.data),{action:n={}}=cd.get(e.meta.id);e.id=`prev-${this.id}`,e.action=n,(null==(t=this.data)?void 0:t.config.editableContent)&&(e.attrs={...e.attrs,contenteditable:!0});return{attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:$d.create(e,!0),action:this.defaultPreviewActions}}}const Uc={js:new Set,css:new Set},Xc=(t,e,n=Xi)=>new Promise((o=>fetch(t).then((t=>{if(!t.ok)return o(n(t));o(e?e(t):t)})).catch((t=>n(t))))),Hc=(t,e)=>{t.removeEventListener("load",Hc),e(t.src)},Yc=(t,e)=>{t.removeEventListener("load",Yc),e(t.src)},Gc=t=>new Promise(((e,n)=>{if(Uc.js.has(t))return e(t);Uc.js.add(t);const o=$d.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:t},action:{load:()=>Yc(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Vc=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(Uc.css.has(t))return e(t);Uc.css.add(t);const o=$d.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Hc(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Jc=async(t=c)=>{if(document.getElementById(a))return;const e=async t=>(t=>{let e=document.getElementById(a);return e||(e=$d.create({id:a,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e})(await t.text());return Xc(t,e,(()=>Xc(d,e)))},Kc={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Gc(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Vc(t)));return Promise.all(e)}},Zc=t=>{const e=Object.entries(t).map((([t,e])=>Kc[t](e)));return Promise.all(e)},Qc=()=>{const t=document.getElementById(a);return"hidden"===window.getComputedStyle(t).visibility};class td{constructor({events:t={},dependencies:n={},controlAction:o,...i}){e(this,"controlCache",new Set),this.events=t,this.controlData=i,this.controlAction=o,this.dependencies=n,this.id=i.id||Li()}get controlId(){var t;return null==(t=this.controlData.meta)?void 0:t.id}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:$d.icon(t.icon)},n],action:{focus:({target:t})=>{const e=t.closest(`.${h}`);return e&&cd.panels.nav.refresh($r(e))},click:({target:t})=>{cd.addElement(t.parentElement.id)}}};return $d.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return Zc(this.dependencies)}i18n(t,e){var n,o;const r=i.locale,s=null==(n=this.definition)?void 0:n.i18n,a=(null==s?void 0:s[r])||{};return((null==(o=a[t])?void 0:o.call(a))??a[t])||i.get(t,e)}}const ed=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}];const nd=(t,e=3)=>Array.from({length:e},((t,e)=>e+1)).map((e=>{const n="checkbox"===t?"checked":"selected";return{label:i.get("labelCount",{label:xc(t),count:e}),value:`${t}-${e}`,[n]:!e}}));const od=[class extends td{constructor(){super({tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:i.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:i.get("button"),type:["button","submit","reset"].map(((t,e)=>({label:t,type:t}))),className:[{label:"default",value:"",selected:!0},{label:"primary",value:"primary"},{label:"danger",value:"error"},{label:"success",value:"success"},{label:"warning",value:"warning"}]}]})}},class extends td{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:i.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends td{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:i.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends td{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:i.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends td{constructor(){super({tag:"textarea",config:{label:i.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends td{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:i.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends td{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:i.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends td{constructor(){super({tag:"select",config:{label:i.get("controls.form.select")},attrs:{required:!1,className:""},meta:{group:"common",icon:"select",id:"select"},options:nd("option")})}},class extends td{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:i.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:nd("checkbox",1)})}},class extends td{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:i.get("controls.form.radio-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:nd("radio")})}}],id=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),rd="controls.html.header";const sd=[class extends td{constructor(){super({tag:id[0],attrs:{tag:id.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:i.get(rd),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:i.get(rd),action:{}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(rd)}},class extends td{constructor(){super({tag:"p",attrs:{className:""},config:{label:i.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 td{constructor(){super({tag:"hr",config:{label:i.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends td{constructor(t){super(Ii({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))}}],ad=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"}}),ld=[...od,...sd,...ed];const cd=new class{constructor(){e(this,"groupLabel",(t=>i.get(t)||t||"")),e(this,"addElement",(t=>{const e=Pr(this.get(t),"controlData"),{meta:{group:n,id:o}}=e,i={row:()=>xd.active.addChild(),column:()=>i.row().addChild(),field:t=>i.column().addChild(t)};return"layout"!==n?i.field(e):i[o.replace("layout-","")]()})),e(this,"applyOptions",(async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=Ii(ad,t);return this.container=e,this.groupOrder=$i(o.concat(["common","html","layout"])),this.options=i,Promise.all(this.registerControls([...ld,...n]))})),this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${h}`);return e&&this.panels.nav.refresh($r(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((async t=>{let e;return e="function"==typeof t?new t:new td(t),this.add(e),this.controls.push(e.dom),e.promise()}))}groupElements(){let t=this.options.groups.slice(),e=this.controls.slice(),n=[];const o=[];return t=Lr(t,this.groupOrder,"id"),t=t.filter((t=>Di(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:h,id:`${t.id}-${h}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=$i(e.concat(t.elementOrder));t.elementOrder=n}return e=Lr(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=[Di(i,this.options.disable.elements),n.meta.group===t.id,!o.includes(n.meta.id)].every((t=>!0===t)),r&&o.push(i),r})),n})),n}add(t=Object.create(null)){const e=Mi(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 this.data.get(t)}formActions(){if(!0===this.options.disable.formActions)return null;const t={...$d.btnTemplate({content:[$d.icon("bin"),i.get("clear")],title:i.get("clearAll")}),className:["clear-form"],action:{click:t=>{Nd.size?(Hr.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:i.get("confirmClearAll"),clearAllAction:()=>{xd.clearAll().then((()=>{const e={src:t.target};Hr.formeoCleared(e)}))},btnCoords:$d.coords(t.target)}}),document.dispatchEvent(Hr.confirmClearAll)):window.alert(i.get("cannotClearFields"))}}},e={...$d.btnTemplate({content:[$d.icon("floppy-disk"),i.get("save")],title:i.get("save")}),className:["save-form"],action:{click:({target:t})=>{const{formData:e}=Dd,n={action:()=>{},coords:$d.coords(t),message:"",button:t};return bc.click.btn(n),bc.save.form(e)}}};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(),n=this.formActions(),{displayType:o}=this.options.panels;this.panels=new Cc({panels:e,type:"controls",displayType:o});const r=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],s=$d.create({className:r,content:[this.panels.panelNav,this.panels.panelsWrap]}),a=["formeo-controls"];t&&a.push("formeo-sticky");const l=$d.create({className:a,content:[s,n]}),c=l.getElementsByClassName("control-group");this.dom=l,this.groups=c;const[d]=c;this.currentGroup=d,this.actions={filter:t=>{const e=""!==t,n=this.controls;let o=s.querySelector(".filtered-term");if($d.toggleElementsByStr(n,t),e){const e=i.get("controls.filteringTerm",t);l.classList.add("filtered"),o?o.textContent=e:(o=$d.create({tag:"h5",className:"filtered-term",content:e}),s.insertBefore(o,s.firstChild))}else o&&(l.classList.remove("filtered"),o.remove())},addElement:this.addElement,addGroup:t=>{}};for(let i=c.length-1;i>=0;i--){const t=`formeo-controls-${c[i]}`;this.options.sortable||window.localStorage.removeItem(t),Jl.create(c[i],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:({item:t})=>{const{controlData:e}=this.get(t.id);this.options.ghostPreview&&(t.innerHTML="",t.appendChild(new qc(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}};class dd extends pa{constructor(){super(...arguments),e(this,"load",((t=Object.create(null))=>(this.empty(),"string"==typeof t&&(t=JSON.parse(t)),Object.entries(t).forEach((([t,e])=>this.add(t,e))),this.data))),e(this,"get",(t=>t?Pr(this.data,t):this.add())),e(this,"add",((t,e=Object.create(null))=>{const n=t||Li(),o=this.Component({...e,id:n});return this.set(n,o),this.active=o,o})),e(this,"remove",(t=>(Array.isArray(t)?t.forEach((t=>{this.get(t).remove()})):this.get(t).remove(),this.data))),e(this,"delete",(t=>(delete this.data[t],t))),e(this,"clearAll",((t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)})),e(this,"conditionMap",new Map)}set config(t){this.configVal=Ii(this.configVal,Mi(t))}get config(){return this.configVal}}class ud extends zc{constructor(t,e){super("stage",{...Object.freeze({children:[]}),...t},e);const n=this.createChildWrap();this.dom=$d.create({attrs:{className:[p,"empty"],id:this.id},children:n}),Jl.create(n,{animation:150,fallbackClass:"row-moving",forceFallback:!0,group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{hd.active=this},onSort:this.onSort.bind(this),draggable:`.${m}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),zr.slideUp(this.dom,I,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),zr.slideDown(this.dom,I)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const hd=new class extends dd{constructor(t){super("stages",t)}Component(t){return new ud(t)}};class pd extends zc{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[m]}),...t}),e(this,"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(H);const t=n.dom,o=Ri(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),M);document.dispatchEvent(Hr.columnResized)}this.updateColumnPreset()})),e(this,"updateColumnPreset",(()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>$d.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)})),e(this,"setColumnWidths",(t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))}));const n=this.createChildWrap();this.dom=$d.create({tag:"li",className:[m,"empty"],dataset:{hoverTag:i.get("row"),editingHoverTag:i.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,n]}),Jl.create(n,{animation:150,fallbackClass:"column-moving",forceFallback:!0,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:`.${f}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:i.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:i.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:i.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:i.get("row.makeInputGroup"),description:i.get("row.makeInputGroupDesc")}},n={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Legend"},action:{input:({target:{value:t}})=>this.set("config.legend",t)},className:""}},o=$d.formGroup([t,n]),r={tag:"label",content:i.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=$d.create(this.columnPresetControlConfig);const s={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},a=[e,"hr",o,"hr",$d.formGroup([r,s],"row")];return $d.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=a.map((t=>$d.create(t)));t.append(...e)}}})}onAdd(...t){super.onAdd(...t),this.autoColumnWidths()}onRemove(...t){super.onRemove(...t),this.autoColumnWidths()}get getColumnPresetOptions(){const t=this.children,e=D.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:v}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:i.get("defineColumnLayout"),className:b},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const md={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const fd=new class extends dd{constructor(t){super("rows",t),this.config={all:md}}Component(t){return new pd(t)}};class gd{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=$d.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(`.${m}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(y),this.columnPreset=o.querySelector(`.${b}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(H,""),n.className=n.className.replace(H,""),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(Fi(e,this.rowWidth)),i=parseFloat(Fi(n,this.rowWidth));return o<10||i<10?null:{colWidth:Ri(o.toFixed(1)),siblingColWidth:Ri(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(),Dd.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),Dd.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(y),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(y),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${v}`);const n=this.row.querySelector(".children").children,o=Mr(n,(t=>Fi(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=$d.create({tag:"option",attrs:{className:v,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const vd=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[$d.icon("triangle-down"),$d.icon("triangle-up")]}),bd=()=>({className:"column-edit group-config"});class yd extends zc{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[f]}),...t}),e(this,"refreshFieldPanels",(()=>{this.children.forEach((t=>t.panels.nav.refresh()))})),e(this,"setWidth",(t=>(this.dom.dataset.colWidth=t,this.dom.style.width=t,this.set("config.width",t))));const n=this.createChildWrap();this.dom=$d.create({tag:"li",className:[f,"empty"],dataset:{hoverTag:i.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),bd(),vd(new gd),n]}),this.processConfig(this.dom),Hr.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Jl.create(n,{animation:150,fallbackClass:"field-moving",forceFallback:!0,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:`.${g}`,handle:".item-move"})}processConfig(t){const e=Br.get(this.data,"config.width");e&&(t.dataset.colWidth=e,t.style.width=e)}}const wd={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const Cd=new class extends dd{constructor(t){super("columns",t),this.config={all:wd}}Component(t){return new yd(t)}},Ed={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}};const Sd=new class extends dd{constructor(t){super("fields",t),e(this,"get",(t=>{let e=t&&Pr(this.data,t);if(!e){const n=cd.get(t);n&&(e=this.add(null,n.controlData))}return e})),this.config={all:Ed}}Component(t){return new qc(t)}};const Od=new class extends dd{constructor(t){super("externals",t)}Component(t){return new zc("external",t)}},xd=hd,Nd=fd,_d=Cd,Ad=Sd,jd=cd,Pd=Od,Td={id:Li()};const Dd=new class extends pa{constructor(t){super("components"),e(this,"sessionFormData",(()=>{var t;if(null==(t=this.opts)?void 0:t.sessionStorage)return Wi.get($)})),e(this,"load",((t,e=this.opts||Object.create(null))=>{let n=t;this.empty(),"string"==typeof t&&(n=JSON.parse(t)),this.opts=e;const{stages:o={[Li()]:{}},rows:i,columns:r,fields:s,id:a=Li()}={...this.sessionFormData(),...n};this.set("id",a),this.add("stages",xd.load(o)),this.add("rows",Nd.load(i)),this.add("columns",_d.load(r)),this.add("fields",Ad.load(s)),this.add("externals",Pd.load(e.external));for(const l of Object.values(this.get("stages")))l.loadChildren();return this.data})),this.opts=t,this.data=Td,this.disableEvents=!0,this.stages=xd,this.rows=Nd,this.columns=_d,this.fields=Ad,this.controls=jd,this.externals=Pd}flatList(t=this.data,e=Object.create(null)){return Object.entries(t).reduce(((t,[e,n])=>{if("object"==typeof n)for(const[o,i]of Object.entries(n))t[`${e}.${o}`]=i;return t}),e)}get json(){return window.JSON.stringify(this.formData)}get formData(){return{id:this.get("id"),stages:hd.getData(),rows:fd.getData(),columns:Cd.getData(),fields:Sd.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;xd.config=e,Nd.config=n,_d.config=o,Ad.config=i}setAddress(t,e){const[n,o,...i]=Array.isArray(t)?t:t.split("."),r=this[n.replace(/s?$/,"s")].get(o);return null==r||r.set(i,e),r}getAddress(t){if(!Bi(t))return;const[e,n,...o]=Array.isArray(t)?t:t.split("."),i=this[e.replace(/s?$/,"s")].get(n);return o.length?i.get(o):i}getConditionMap(t){if(Bi(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.get(e[1])}}setConditionMap(t,e){if(Bi(t)){const n=t.split(".");return n.every((t=>Boolean(t)))&&this[n[0]].conditionMap.set(n[1],e)}}removeConditionMap(t){if(Bi(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.delete(e[1])}}},kd={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="${Y}${t}">${t}</i>`};const $d=new class{constructor(){e(this,"render",(t=>(t.id=`f-${t.id||Li()}`,this.create(t)))),e(this,"create",((t,e=!1)=>{let n=t;if(!n)return;n=this.processTagName(n);const o=this;let i;const{tag:r}=n,s=["children","content"];let a;const l={attrs:{},className:[Br.get(n,"config.inputWrap")||"f-field-group"],children:[],config:{}};let c=document.createElement(r);const d={string:t=>{c.innerHTML+=t},object:t=>t&&c.appendChild(o.create(t,e)),node:t=>c.appendChild(t),component:t=>c.appendChild(t.dom),array:t=>{for(const e of t)i=o.childType(e),d[i](e)},function:t=>{t=t(),i=o.childType(t),d[i](t)},undefined:()=>null,boolean:()=>null};if(s.push("tag"),n.className){const{className:t}=n;n.attrs=Object.assign({},n.attrs,{className:t}),delete n.className}if(n.options){let{options:t}=n;if(t=this.processOptions(t,n,e),!this.holdsContent(c)||"button"===r)return Br.forEach(t,(t=>{l.children.push(o.create(t,e))})),n.attrs.className&&(l.className=n.attrs.className),l.config=Object.assign({},n.config),this.create(l,e);d.array.call(this,t),delete n.content,s.push("options")}if("OPTION"===c.tagName){const t=setTimeout((()=>{c.selected=!1,clearTimeout(t)}),0)}if(n.attrs&&(o.processAttrs(n,c,e),s.push("attrs")),n.config){if(n.config.label&&(n.config.label&&"button"!==r||["radio","checkbox"].includes(Br.get(n,"attrs.type")))&&!e){const t=o.label(n);if(!n.config.hideLabel){const e=[...o.labelAfter(n)?[c,t]:[t,c]];l.children.push(e)}}s.push("config")}if(n.content||n.children){const t=n.content||n.children;i=o.childType(t),d[i],d[i].call(this,t)}if(n.dataset){for(const t in n.dataset)Object.hasOwn(n.dataset,t)&&(c.dataset[t]="function"==typeof n.dataset[t]?n.dataset[t]():n.dataset[t]);s.push("dataset")}n.action&&(this.actionHandler(c,n.action),s.push("action"));const u=Br.subtract(s,Object.keys(n));for(a=u.length-1;a>=0;a--)c[u[a]]=n[u[a]];return l.children.length&&(c=this.create(l)),c})),e(this,"onRender",((t,e)=>{t.parentElement?e(t):window.requestAnimationFrame((()=>this.onRender(t,e)))})),e(this,"toggleElementsByStr",((t,e)=>{const n=[];return $d.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n})),e(this,"elementsContainText",((t,e,n)=>{const o=[];return Ir(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());null==n||n(t,i),i&&o.push(t)})),o})),e(this,"generateOption",(({type:t="option",label:e,value:n,i:o=0,selected:r})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:n||`${t}-${o}`,["option"===t?"selected":"checked"]:r||!o},config:{label:e||i.get("labelCount",{label:i.get("option"),count:o})}}))),e(this,"makeOption",(([t,e],n,o)=>{const r={value:t,label:i.get(`${o}.${e}`)||e};return t===n&&(r.selected=!0),r})),e(this,"requiredMark",(()=>({tag:"span",className:"text-error",children:"*"}))),e(this,"removeEmpty",(t=>{const e=t.parentElement,n=ki(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length){if(!this.isStage(e))return this.removeEmpty(e);this.emptyClass(e)}})),e(this,"btnTemplate",(({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e}))),e(this,"isControls",(t=>ki(t)===h)),e(this,"isStage",(t=>ki(t)===p)),e(this,"isRow",(t=>ki(t)===m)),e(this,"isColumn",(t=>ki(t)===f)),e(this,"isField",(t=>ki(t)===g)),e(this,"asComponent",(t=>Dd[`${ki(t)}s`].get(t.id))),this.options=Object.create(null),this.styleSheet=(()=>{const t=document.createElement("style");return t.setAttribute("media","screen"),t.setAttribute("type","text/css"),t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet})()}set setOptions(t){this.options=Ii(Object.assign({},this.options,t))}processTagName(t){let e;if("string"==typeof t&&(e=t,t={tag:e}),t.attrs){const{tag:n,...o}=t.attrs;if(n)if("string"==typeof n)e=n;else{e=(n.find((t=>!0===t.selected))||n[0]).value}t.attrs=o}return t.tag=e||t.tag||"div",t}actionHandler(t,e){const n={onRender:$d.onRender,render:$d.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(`#${a} svg symbol`);return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(Y,"")]=$d.create({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.iconSymbols}icon(t=null,e=[]){var n;if(!t)return;const o=this.icons[t];if(o){const t=o.cloneNode(!0);return t.classList.add(...e),t.outerHTML}return(null==(n=kd[$d.options.iconFont])?void 0:n.call(kd,t))||t}processAttrs(t,e,n){const{attrs:o={}}=t;n||!o.name&&this.isInput(t.tag)&&e.setAttribute("name",Li(t));for(const i of Object.keys(o)){const t=Br.safeAttrName(i);let n=o[i]||"";if(Array.isArray(n))if("object"==typeof n[0]){const t=n.filter((t=>!0===t.selected));n=t.length?t[0].value:n[0].value}else n=n.join(" ");if(n)if("OPTION"===e.tagName&&"selected"===t){const o=setTimeout((()=>{e.setAttribute(t,n),clearTimeout(o)}),0)}else e.setAttribute(t,n)}}processOptions(t,e,n){const{action:o,attrs:i}=e,r=i.type||e.tag,s=i.id||e.id;return t.map(((t,i)=>{var a;const{label:l,...c}=t,d=()=>{const a={tag:"input",attrs:{name:s,type:r,value:t.value||"",id:`${s}-${i}`,...c},action:o},l={tag:"label",attrs:{for:`${s}-${i}`},config:{inputWrap:"form-check"},children:t.label},d={children:[a,l],className:[`f-${r}`]};return e.attrs.className&&(e.config.inputWrap=e.attrs.className),e.config.inline&&d.className.push(`f-${r}-inline`),t.selected&&(a.attrs.checked=!0),n&&(l.attrs.contenteditable=!0),d},u={select:()=>({tag:"option",attrs:t,children:t.label}),button:t=>{const{type:n,label:o,className:i,id:r}=t;return{...e,attrs:{type:n},className:i,id:r||Li(),options:void 0,children:o,action:e.action}},checkbox:d,radio:d};return null==(a=u[r])?void 0:a.call(u,t)}))}holdsContent(t){return-1!==t.outerHTML.indexOf("/")}isBlockInput(t){return!this.isInput(t)&&this.holdsContent(t)}isInput(t){return"string"!=typeof t&&(t=t.tagName),-1!==["input","textarea","select"].indexOf(t)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=Br.get(t,"attrs.type"),n=Br.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}label(t,e){const n=Br.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||(null==r?void 0:r.id)},className:[],children:[o,n&&this.requiredMark()],action:{}};return e&&(delete s.attrs.for,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",()=>null==t?void 0: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}remove(t){const e=ki(t);return e?Dd.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,Br.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)}};Br.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");zr.slideUp(t,600,(()=>{$d.empty(t),t.classList.remove("removing-all-fields"),$d.emptyClass(t),zr.slideDown(t,300)}))}toggleSortable(t,e){const n=ki(t);if(!n)return;const o=ki(t.parentElement),i=$d[n].get(t.id).sortable;e||(e=!i.option("disabled")),i.option("disabled",e),o&&["rows","columns","stages"].includes(o)&&this.toggleSortable(t.parentElement,e)}emptyClass(t){const e=t.getElementsByClassName(w.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}};i.addLanguage("en-US",void 0);const Ld={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,external:{},svgSprite:c,style:u,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Wr(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"}}}};let Id=class{constructor({formData:t,...e},n){const o=Ii(Ld.editor,e),{actions:i,events:r,debug:s,config:a,editorContainer:l,...c}=o;l&&(this.editorContainer="string"==typeof l?document.querySelector(l):l),this.opts=c,$d.setOptions=c,Dd.config=a,this.userFormData=n||t,this.Components=Dd,this.dom=$d,Hr.init({debug:s,...r}),bc.init({debug:s,sessionStorage:c.sessionStorage,...i}),document.addEventListener("DOMContentLoaded",this.loadResources.bind(this))}get formData(){return this.Components.formData}set formData(t={}){this.load({...this.userFormData,...t},this.opts)}get json(){return this.Components.json}async loadResources(){var t;document.removeEventListener("DOMContentLoaded",this.loadResources);const e=[];this.opts.polyfills&&(t=>{const e=Array.isArray(t)?l.filter((({name:e})=>-1!==t.indexOf(e))):l;Promise.all(e.map((({src:t})=>Gc(t))))})(this.opts.polyfills),await Jc(this.opts.svgSprite),e.push((async t=>{if(!Qc()&&(await Vc(t),!Qc()))return await Vc("https://draggable.github.io/formeo/assets/css/formeo.min.css")})(this.opts.style)),e.push(i.init({...this.opts.i18n,locale:null==(t=window.sessionStorage)?void 0:t.getItem(L)}));const n=await Promise.all(e);return this.opts.allowEdit&&this.init(),n}init(){cd.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=Dd.get("id"),this.i18n={setLang:t=>{var e;null==(e=window.sessionStorage)||e.setItem(L,t);i.setCurrent(t).then((()=>{this.init()}),console.error)}},this.render()}))}load(t=this.userFormData,e=this.opts){return this.Components.load(t,e)}render(){if(!this.controls)return window.requestAnimationFrame((()=>this.render()));if(this.stages=Object.values(Dd.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))]};i.current.dir&&(t.attrs.dir=i.current.dir,$d.dir=i.current.dir),this.editor=$d.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&($d.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Hr.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Hr.formeoLoaded)}};const Md=t=>{const e=t.match(X);return(null==e?void 0:e[0])||t},Fd=t=>t.replace(X,Li());let Rd=class{constructor(t,n={}){e(this,"render",((t=this.form)=>{this.form=t;const e=document.getElementsByClassName("formeo-render").length,n={id:this.form.id,className:`formeo-render formeo formeo-rendered-${e}`,children:this.processedData};this.renderedForm=$d.render(n),this.applyConditions();const o=this.container.querySelector(".formeo-render");o?o.replaceWith(this.renderedForm):this.container.appendChild(this.renderedForm)})),e(this,"orderChildren",((t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]))),e(this,"prefixId",(t=>"f-"+t)),e(this,"processColumn",(({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`}))),e(this,"processRows",(t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]))),e(this,"cacheComponent",(t=>(this.components[Md(t.id)]=t,t))),e(this,"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("f-input-group-wrap"),{tag:n.fieldset?"fieldset":"div",id:Li(),className:i,children:s}})),e(this,"cloneComponentData",(t=>{const{children:e=[],id:n,...o}=this.components[t];return Object.assign({},o,{id:Fd(n),children:e.length&&e.map((({id:t})=>this.cloneComponentData(Md(t))))})})),e(this,"addButton",(t=>$d.render({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=$d.render(this.cloneComponentData(t));n.insertBefore(o,n.lastChild),o.appendChild($d.render($d.btnTemplate({className:"remove-input-group",children:$d.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()}})))}}}))),e(this,"processColumns",(t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t)))))),e(this,"processFieldsOrig",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>this.cacheComponent(Object.assign({},e,{id:this.prefixId(t)})))))),e(this,"processFields",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const{action:n={},dependencies:o={}}=this.elements[e.meta.id]||{};o&&Zc(o);const i=Ii({action:n},e);return this.cacheComponent({...i,id:this.prefixId(t)})})))),e(this,"applyConditions",(()=>{Object.values(this.components).forEach((({conditions:t})=>{t&&t.forEach(((t,e)=>{const{if:n,then:o}=t;n.forEach((t=>{const{source:e,...n}=t;if(Bi(e)){this.getComponents(e).forEach((t=>{const e=Wd(t);e&&t.addEventListener(e,(t=>this.evaluateCondition(n,t)&&o.forEach((e=>this.execResult(e,t)))),!1);const i={target:t};this.evaluateCondition(n,i)&&o.forEach((t=>this.execResult(t,i)))}))}}))}))}))})),e(this,"evaluateCondition",(({sourceProperty:t,targetProperty:e,comparison:n,target:o},i)=>{var r;const s={equals:ha,notEquals:(t,e)=>!ha(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},a=String(i.target[t]),l=String(Bi(o)?this.getComponent(o)[e]:o);return null==(r=s[n])?void 0:r.call(s,a,l)})),e(this,"execResult",(({assignment:t,target:e,targetProperty:n,value:o})=>{var i;const r={equals:t=>{var e;const i={value:()=>{t[n]=o},isNotVisible:()=>{t.parentElement.setAttribute("hidden",!0),t.required=!1},isVisible:()=>{t.parentElement.removeAttribute("hidden"),t.required=t._required}};null==(e=i[n])||e.call(i)}};if(Bi(e)){const n=this.getComponent(e);n&&void 0===n._required&&(n._required=n.required),null==(i=r[t])||i.call(r,n)}})),e(this,"getComponent",(t=>{const e=t.slice(t.indexOf(".")+1);return zi(t)?this.external[e]:this.renderedForm.querySelector(`#f-${e}`)})),e(this,"getComponents",(t=>{const e=[],n=t.slice(t.indexOf(".")+1);return zi(t)?e.push(this.external[n]):e.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),e}));const{renderContainer:o,external:i,elements:r}=(({editorContainer:t,renderContainer:e,...n})=>{const o=t=>"string"==typeof t?document.querySelector(t):t;return{...n,renderContainer:o(e),editorContainer:o(t)}})(t);this.container=o,this.form=n,this.external=i,this.dom=$d,this.components=Object.create(null),this.elements=r}get processedData(){return Object.values(this.form.stages).map((t=>(t.children=this.processRows(t.id),t.className=p,$d.render(t))))}};const Wd=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=Id,window.FormeoRenderer=Rd);const Bd=Id,zd=Rd;exports.FormeoEditor=Bd,exports.FormeoRenderer=zd;