formeo 2.1.7 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/demo/assets/css/demo.min.css +2 -2
- package/dist/demo/assets/css/demo.min.css.gz +0 -0
- package/dist/demo/assets/css/formeo.min.css +2 -2
- package/dist/demo/assets/css/formeo.min.css.gz +0 -0
- package/dist/demo/assets/js/demo.min.js +2 -2
- package/dist/demo/assets/js/demo.min.js.gz +0 -0
- package/dist/demo/assets/js/formeo.min.js +3 -3
- package/dist/demo/assets/js/formeo.min.js.gz +0 -0
- package/dist/demo/index.html +1 -1
- package/dist/formeo-sprite.svg +1 -0
- package/dist/formeo.cjs.js +3 -3
- package/dist/formeo.es.js +98 -82
- package/dist/formeo.min.css +2 -2
- package/dist/formeo.min.js +14 -0
- package/dist/formeo.umd.js +3 -3
- package/package.json +1 -1
package/dist/formeo.umd.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
formeo - https://formeo.io
|
|
4
|
-
Version: 2.1.
|
|
4
|
+
Version: 2.1.7
|
|
5
5
|
Author: Draggable https://draggable.io
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).formeo={})}(this,(function(t){"use strict";var e=Object.defineProperty,n=(t,n,o)=>((t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o)(t,"symbol"!=typeof n?n+"":n,o);const o={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class i{constructor(t=o){this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}processConfig(t){const{location:e,...n}={...o,...t},i=e.replace(/\/?$/,"/");this.config={location:i,...n};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?i.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 i.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(o,r){if(-1!==n.loaded.indexOf(t)&&e)return n.applyLanguage(n.langs[t]),o(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=i.processFile(e);return n.applyLanguage(t,r),n.loaded.push(t),o(n.langs[t])})).catch((e=>{const i=n.applyLanguage(t);o(i)}))}))}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 r=new i,s="formeo",a=[{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"}],l="control-group",c=`${s}-stage`,d=`${s}-row`,h=`${s}-column`,u=`${s}-field`,p="custom-column-widths",m="column-preset",g="resizing-columns",f=new Map([[c,d],[d,h],[h,u]]),v=["external","stages","rows","columns","fields"],b=["stage","row","column","field"].reduce(((t,e)=>({...t,[e]:e})),{}),y=[{name:"controls",className:l},{name:"stage",className:c},{name:"row",className:d},{name:"column",className:h},{name:"field",className:u}],w={controls:l,stage:c,row:d,column:h,field:u},x=Object.entries(w).reduce(((t,[e,n])=>({...t,[n]:e})),{}),C=Object.values(w),S=new RegExp(`${C.join("|")}`,"g"),E=y.map((({name:t},e,n)=>{const{name:o}=n[e+1]||{};return o&&[t,o]})).filter(Boolean),O=E.slice().map((t=>t.slice().reverse())).reverse(),_=new Map(E),M=new Map(O.slice()),N=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)),[])),A=[{type:"added",condition:(t,e)=>Boolean(void 0===t&&e)}],j=`${s}-formData`,k=`${s}-locale`,D=333,P=Math.round(166.5),T=Math.round(666),z="formeoSaved",L="formeoUpdated",$="formeoOnRender",H=["label","logical","source","thenTarget","sourceProperty","comparison","target","targetProperty","assignment","value"],V={value:"attrs.value",checked:"attrs.checked",isVisible:"config.isVisible",isNotVisible:"config.isNotVisible"},I={comparison:{equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},assignment:{equals:"="},logical:{and:"&&",or:"||"},property:V},F=/(\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,B=/\bcol-\w+-\d+/g,R="f-i-";var W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function q(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var U=function(){this.__data__=[],this.size=0};var X=function(t,e){return t===e||t!=t&&e!=e},G=X;var Y=function(t,e){for(var n=t.length;n--;)if(G(t[n][0],e))return n;return-1},Z=Y,J=Array.prototype.splice;var K=Y;var Q=Y;var tt=Y;var et=U,nt=function(t){var e=this.__data__,n=Z(e,t);return!(n<0)&&(n==e.length-1?e.pop():J.call(e,n,1),--this.size,!0)},ot=function(t){var e=this.__data__,n=K(e,t);return n<0?void 0:e[n][1]},it=function(t){return Q(this.__data__,t)>-1},rt=function(t,e){var n=this.__data__,o=tt(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function st(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])}}st.prototype.clear=et,st.prototype.delete=nt,st.prototype.get=ot,st.prototype.has=it,st.prototype.set=rt;var at=st,lt=at;var ct=function(){this.__data__=new lt,this.size=0};var dt=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};var ht=function(t){return this.__data__.get(t)};var ut=function(t){return this.__data__.has(t)},pt="object"==typeof W&&W&&W.Object===Object&&W,mt=pt,gt="object"==typeof self&&self&&self.Object===Object&&self,ft=mt||gt||Function("return this")(),vt=ft.Symbol,bt=vt,yt=Object.prototype,wt=yt.hasOwnProperty,xt=yt.toString,Ct=bt?bt.toStringTag:void 0;var St=function(t){var e=wt.call(t,Ct),n=t[Ct];try{t[Ct]=void 0;var o=!0}catch(r){}var i=xt.call(t);return o&&(e?t[Ct]=n:delete t[Ct]),i},Et=Object.prototype.toString;var Ot=St,_t=function(t){return Et.call(t)},Mt=vt?vt.toStringTag:void 0;var Nt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Mt&&Mt in Object(t)?Ot(t):_t(t)};var At=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},jt=Nt,kt=At;var Dt,Pt=function(t){if(!kt(t))return!1;var e=jt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Tt=ft["__core-js_shared__"],zt=(Dt=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||""))?"Symbol(src)_1."+Dt:"";var Lt=function(t){return!!zt&&zt in t},$t=Function.prototype.toString;var Ht=function(t){if(null!=t){try{return $t.call(t)}catch(e){}try{return t+""}catch(e){}}return""},Vt=Pt,It=Lt,Ft=At,Bt=Ht,Rt=/^\[object .+?Constructor\]$/,Wt=Function.prototype,qt=Object.prototype,Ut=Wt.toString,Xt=qt.hasOwnProperty,Gt=RegExp("^"+Ut.call(Xt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Yt=function(t){return!(!Ft(t)||It(t))&&(Vt(t)?Gt:Rt).test(Bt(t))},Zt=function(t,e){return null==t?void 0:t[e]};var Jt=function(t,e){var n=Zt(t,e);return Yt(n)?n:void 0},Kt=Jt(ft,"Map"),Qt=Jt(Object,"create"),te=Qt;var ee=function(){this.__data__=te?te(null):{},this.size=0};var ne=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},oe=Qt,ie=Object.prototype.hasOwnProperty;var re=function(t){var e=this.__data__;if(oe){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ie.call(e,t)?e[t]:void 0},se=Qt,ae=Object.prototype.hasOwnProperty;var le=Qt;var ce=ee,de=ne,he=re,ue=function(t){var e=this.__data__;return se?void 0!==e[t]:ae.call(e,t)},pe=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=le&&void 0===e?"__lodash_hash_undefined__":e,this};function me(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])}}me.prototype.clear=ce,me.prototype.delete=de,me.prototype.get=he,me.prototype.has=ue,me.prototype.set=pe;var ge=me,fe=at,ve=Kt;var be=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var ye=function(t,e){var n=t.__data__;return be(e)?n["string"==typeof e?"string":"hash"]:n.map},we=ye;var xe=ye;var Ce=ye;var Se=ye;var Ee=function(){this.size=0,this.__data__={hash:new ge,map:new(ve||fe),string:new ge}},Oe=function(t){var e=we(this,t).delete(t);return this.size-=e?1:0,e},_e=function(t){return xe(this,t).get(t)},Me=function(t){return Ce(this,t).has(t)},Ne=function(t,e){var n=Se(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function Ae(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])}}Ae.prototype.clear=Ee,Ae.prototype.delete=Oe,Ae.prototype.get=_e,Ae.prototype.has=Me,Ae.prototype.set=Ne;var je=Ae,ke=at,De=Kt,Pe=je;var Te=at,ze=ct,Le=dt,$e=ht,He=ut,Ve=function(t,e){var n=this.__data__;if(n instanceof ke){var o=n.__data__;if(!De||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Pe(o)}return n.set(t,e),this.size=n.size,this};function Ie(t){var e=this.__data__=new Te(t);this.size=e.size}Ie.prototype.clear=ze,Ie.prototype.delete=Le,Ie.prototype.get=$e,Ie.prototype.has=He,Ie.prototype.set=Ve;var Fe=Ie,Be=Jt,Re=function(){try{var t=Be(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),We=Re;var qe=function(t,e,n){"__proto__"==e&&We?We(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Ue=qe,Xe=X;var Ge=function(t,e,n){(void 0!==n&&!Xe(t[e],n)||void 0===n&&!(e in t))&&Ue(t,e,n)};var Ye,Ze,Je,Ke,Qe,tn,en,nn=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}}(),on={exports:{}};Ye=on,Je=ft,Ke=(Ze=on.exports)&&!Ze.nodeType&&Ze,Qe=Ke&&Ye&&!Ye.nodeType&&Ye,tn=Qe&&Qe.exports===Ke?Je.Buffer:void 0,en=tn?tn.allocUnsafe:void 0,Ye.exports=function(t,e){if(e)return t.slice();var n=t.length,o=en?en(n):new t.constructor(n);return t.copy(o),o};var rn=on.exports,sn=ft.Uint8Array,an=sn;var ln=function(t){var e=new t.constructor(t.byteLength);return new an(e).set(new an(t)),e};var cn=function(t,e){var n=e?ln(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};var dn=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e},hn=At,un=Object.create,pn=function(){function t(){}return function(e){if(!hn(e))return{};if(un)return un(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var mn=function(t,e){return function(n){return t(e(n))}},gn=mn(Object.getPrototypeOf,Object),fn=Object.prototype;var vn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||fn)},bn=pn,yn=gn,wn=vn;var xn=function(t){return"function"!=typeof t.constructor||wn(t)?{}:bn(yn(t))};var Cn=function(t){return null!=t&&"object"==typeof t},Sn=Nt,En=Cn;var On=function(t){return En(t)&&"[object Arguments]"==Sn(t)},_n=Cn,Mn=Object.prototype,Nn=Mn.hasOwnProperty,An=Mn.propertyIsEnumerable,jn=On(function(){return arguments}())?On:function(t){return _n(t)&&Nn.call(t,"callee")&&!An.call(t,"callee")},kn=jn,Dn=Array.isArray;var Pn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Tn=Pt,zn=Pn;var Ln=function(t){return null!=t&&zn(t.length)&&!Tn(t)},$n=Ln,Hn=Cn;var Vn=function(t){return Hn(t)&&$n(t)},In={exports:{}};var Fn=function(){return!1};!function(t,e){var n=ft,o=Fn,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}(In,In.exports);var Bn=In.exports,Rn=Nt,Wn=gn,qn=Cn,Un=Function.prototype,Xn=Object.prototype,Gn=Un.toString,Yn=Xn.hasOwnProperty,Zn=Gn.call(Object);var Jn=function(t){if(!qn(t)||"[object Object]"!=Rn(t))return!1;var e=Wn(t);if(null===e)return!0;var n=Yn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Gn.call(n)==Zn},Kn=Nt,Qn=Pn,to=Cn,eo={};eo["[object Float32Array]"]=eo["[object Float64Array]"]=eo["[object Int8Array]"]=eo["[object Int16Array]"]=eo["[object Int32Array]"]=eo["[object Uint8Array]"]=eo["[object Uint8ClampedArray]"]=eo["[object Uint16Array]"]=eo["[object Uint32Array]"]=!0,eo["[object Arguments]"]=eo["[object Array]"]=eo["[object ArrayBuffer]"]=eo["[object Boolean]"]=eo["[object DataView]"]=eo["[object Date]"]=eo["[object Error]"]=eo["[object Function]"]=eo["[object Map]"]=eo["[object Number]"]=eo["[object Object]"]=eo["[object RegExp]"]=eo["[object Set]"]=eo["[object String]"]=eo["[object WeakMap]"]=!1;var no=function(t){return to(t)&&Qn(t.length)&&!!eo[Kn(t)]};var oo=function(t){return function(e){return t(e)}},io={exports:{}};!function(t,e){var n=pt,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}(io,io.exports);var ro=io.exports,so=no,ao=oo,lo=ro&&ro.isTypedArray,co=lo?ao(lo):so;var ho=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},uo=qe,po=X,mo=Object.prototype.hasOwnProperty;var go=function(t,e,n){var o=t[e];mo.call(t,e)&&po(o,n)&&(void 0!==n||e in t)||uo(t,e,n)},fo=go,vo=qe;var bo=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?vo(n,a,l):fo(n,a,l)}return n};var yo=/^(?:0|[1-9]\d*)$/;var wo=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&yo.test(t))&&t>-1&&t%1==0&&t<e},xo=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},Co=kn,So=Dn,Eo=Bn,Oo=wo,_o=co,Mo=Object.prototype.hasOwnProperty;var No=function(t,e){var n=So(t),o=!n&&Co(t),i=!n&&!o&&Eo(t),r=!n&&!o&&!i&&_o(t),s=n||o||i||r,a=s?xo(t.length,String):[],l=a.length;for(var c in t)!e&&!Mo.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Oo(c,l))||a.push(c);return a};var Ao=At,jo=vn,ko=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},Do=Object.prototype.hasOwnProperty;var Po=No,To=function(t){if(!Ao(t))return ko(t);var e=jo(t),n=[];for(var o in t)("constructor"!=o||!e&&Do.call(t,o))&&n.push(o);return n},zo=Ln;var Lo=function(t){return zo(t)?Po(t,!0):To(t)},$o=bo,Ho=Lo;var Vo=Ge,Io=rn,Fo=cn,Bo=dn,Ro=xn,Wo=kn,qo=Dn,Uo=Vn,Xo=Bn,Go=Pt,Yo=At,Zo=Jn,Jo=co,Ko=ho,Qo=function(t){return $o(t,Ho(t))};var ti=Fe,ei=Ge,ni=nn,oi=function(t,e,n,o,i,r,s){var a=Ko(t,n),l=Ko(e,n),c=s.get(l);if(c)Vo(t,n,c);else{var d=r?r(a,l,n+"",t,e,s):void 0,h=void 0===d;if(h){var u=qo(l),p=!u&&Xo(l),m=!u&&!p&&Jo(l);d=l,u||p||m?qo(a)?d=a:Uo(a)?d=Bo(a):p?(h=!1,d=Io(l,!0)):m?(h=!1,d=Fo(l,!0)):d=[]:Zo(l)||Wo(l)?(d=a,Wo(a)?d=Qo(a):Yo(a)&&!Go(a)||(d=Ro(l))):h=!1}h&&(s.set(l,d),i(d,l,o,r,s),s.delete(l)),Vo(t,n,d)}},ii=At,ri=Lo,si=ho;var ai=function t(e,n,o,i,r){e!==n&&ni(n,(function(s,a){if(r||(r=new ti),ii(s))oi(e,n,a,o,t,i,r);else{var l=i?i(si(e,a),s,a+"",e,n,r):void 0;void 0===l&&(l=s),ei(e,a,l)}}),ri)};var li=function(t){return t};var ci=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)},di=Math.max;var hi=function(t,e,n){return e=di(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,r=di(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),ci(t,this,a)}};var ui=function(t){return function(){return t}},pi=Re,mi=pi?function(t,e){return pi(t,"toString",{configurable:!0,enumerable:!1,value:ui(e),writable:!0})}:li,gi=Date.now;var fi=function(t){var e=0,n=0;return function(){var o=gi(),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=fi(mi),bi=li,yi=hi,wi=vi;var xi=X,Ci=Ln,Si=wo,Ei=At;var Oi=function(t,e){return wi(yi(t,e,bi),t+"")},_i=function(t,e,n){if(!Ei(n))return!1;var o=typeof e;return!!("number"==o?Ci(n)&&Si(e,n.length):"string"==o&&e in n)&&xi(n[e],t)};var Mi=ai;const Ni=q(function(t){return Oi((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&&_i(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){Mi(t,e,n,o)}))),Ai=()=>crypto.randomUUID(),ji=(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(S);return n&&x[n[0]]},Di=t=>Array.from(new Set(t)),Pi=t=>{let e;if(t){const{attrs:n={}}=t;e=n.id||t.id||Ai(),t.id=e}else e=Ai();return e},Ti=(t,e,n=Object.create(null))=>Ni({},t,e,((t,e)=>{if(Array.isArray(t))return Array.isArray(e)?Di(n.mergeArray?t.concat(e):e):e})),zi=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]=zi(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=zi(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},Li=(t,e)=>t/e*100,$i=t=>`${t.toString()}%`,Hi=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){}}}}),Vi=t=>v.some((e=>new RegExp(`^${e}.`).test(t))),Ii=t=>t.startsWith("external");function Fi(t,e){let n=!1;return function(){if(!n){t(...arguments),n=!0;const o=setTimeout((()=>{n=!1,clearTimeout(o)}),e)}}}function Bi(t){return t}function Ri(){}var Wi=Nt,qi=Cn;var Ui=function(t){return"symbol"==typeof t||qi(t)&&"[object Symbol]"==Wi(t)},Xi=Dn,Gi=Ui,Yi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zi=/^\w*$/;var Ji=function(t,e){if(Xi(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Gi(t))||(Zi.test(t)||!Yi.test(t)||null!=e&&t in Object(e))},Ki=je;function Qi(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(Qi.Cache||Ki),n}Qi.Cache=Ki;var tr=Qi;var er=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nr=/\\(\\)?/g,or=function(t){var e=tr(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(er,(function(t,n,o,i){e.push(o?i.replace(nr,"$1"):n||t)})),e}));var ir=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},rr=Dn,sr=Ui,ar=vt?vt.prototype:void 0,lr=ar?ar.toString:void 0;var cr=function t(e){if("string"==typeof e)return e;if(rr(e))return ir(e,t)+"";if(sr(e))return lr?lr.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},dr=cr;var hr=Dn,ur=Ji,pr=or,mr=function(t){return null==t?"":dr(t)};var gr=function(t,e){return hr(t)?t:ur(t,e)?[t]:pr(mr(t))},fr=Ui;var vr=function(t){if("string"==typeof t||fr(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},br=go,yr=gr,wr=wo,xr=At,Cr=vr;var Sr=function(t,e,n,o){if(!xr(t))return t;for(var i=-1,r=(e=yr(e,t)).length,s=r-1,a=t;null!=a&&++i<r;){var l=Cr(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=xr(d)?d:wr(e[i+1])?[]:{})}br(a,l,c),a=a[l]}return t};const Er=q((function(t,e,n){return null==t?t:Sr(t,e,n)}));var Or=gr,_r=vr;var Mr=function(t,e){for(var n=0,o=(e=Or(e,t)).length;null!=t&&n<o;)t=t[_r(e[n++])];return n&&n==o?t:void 0};const Nr=q((function(t,e,n){var o=null==t?void 0:Mr(t,e);return void 0===o?n:o})),Ar=Er,jr=t=>{const e={...t},n={string:()=>"",boolean:()=>!1,object:t=>jr(t)};for(const o of Object.keys(t)){const i=typeof t[o];n[i]&&(e[o]=n[i](t[o]))}return e},kr="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`)),Dr=new RegExp(`(?!${kr.join("|")})\\w\\S*`,"g"),Pr=/\s+/g;function Tr(t){if("string"!=typeof t)return t;if(t.trim().match(Pr))return t;return t.replace(Dr,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const zr=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),Lr=t=>Number.isInteger(Number(t)),$r=(t,e)=>{const n=e||t.parentElement;return Array.prototype.slice.call(n.childNodes).indexOf(t)},Hr=(t,e,n)=>{const o=n.split("||"),i=Di(e).map((e=>t.find((t=>{const n=o.find((e=>!!Nr(t,e)));return n&&Nr(t,n)===e})))).filter(Boolean).concat(t);return Di(i)},Vr=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},Ir=(t,e)=>{const n=[];return Vr(t,((t,o)=>n.push(e(t,o)))),n},Fr={},Br=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),Rr=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Wr={capitalize:Br,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:Vr,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:Ir,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:$r,isInt:Lr,get:Nr,orderObjectsBy:Hr,isIE:Rr},qr={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=qr.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=qr.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"===qr.getStyle(t,"display"))=>{n?qr.slideDown(t,e):qr.slideUp(t,e)}},Ur="no-transition",Xr={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onUpdate:t=>Yr.opts.debug&&void 0,onUpdateStage:t=>Yr.opts.debug&&void 0,onUpdateRow:t=>Yr.opts.debug&&void 0,onUpdateColumn:t=>Yr.opts.debug&&void 0,onUpdateField:t=>Yr.opts.debug&&void 0,onRender:t=>Yr.opts.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},Gr=({src:t,...e},n=L)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:Yr.opts.debug||Yr.opts.bubbles});return o.data=(t||document).dispatchEvent(o),o},Yr={init:function(t){return this.opts={...Xr,...t},this},formeoSaved:t=>Gr(t,z),formeoUpdated:t=>Gr(t,L),formeoCleared:t=>Gr(t,"formeoCleared"),formeoOnRender:t=>Gr(t,$),formeoConditionUpdated:t=>Gr(t,"formeoConditionUpdated")},Zr=Fi((()=>{Yr.opts.onUpdate({timeStamp:window.performance.now(),type:L,detail:Ad.formData})}),P);let Jr;document.addEventListener(L,Zr),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener($,(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.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},Yr.opts.confirmClearAll(t)})),document.addEventListener(z,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};Yr.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{Yr.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){Jr=Jr||window.requestAnimationFrame((()=>{Jr=!1,Object.values(Ed.data).forEach((t=>{t.dom.classList.add(Ur),_d.dom.classList.add(Ur),_d.panels.nav.refresh(),t.refreshFieldPanels()}))}))}));var Kr=je,Qr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ts=function(t){return this.__data__.has(t)};function es(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Kr;++e<n;)this.add(t[e])}es.prototype.add=es.prototype.push=Qr,es.prototype.has=ts;var ns=es,os=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},is=function(t,e){return t.has(e)};var rs=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 ns: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(!os(e,(function(t,e){if(!is(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 ss=sn,as=X,ls=rs,cs=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n},ds=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},hs=vt?vt.prototype:void 0,us=hs?hs.valueOf:void 0;var ps=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 ss(t),new ss(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return as(+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=cs;case"[object Set]":var l=1&o;if(a||(a=ds),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=ls(a(t),a(e),o,i,r,s);return s.delete(t),d;case"[object Symbol]":if(us)return us.call(t)==us.call(e)}return!1};var ms=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t},gs=Dn;var fs=function(t,e,n){var o=e(t);return gs(t)?o:ms(o,n(t))};var vs=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},bs=function(){return[]},ys=Object.prototype.propertyIsEnumerable,ws=Object.getOwnPropertySymbols,xs=ws?function(t){return null==t?[]:(t=Object(t),vs(ws(t),(function(e){return ys.call(t,e)})))}:bs,Cs=mn(Object.keys,Object),Ss=vn,Es=Cs,Os=Object.prototype.hasOwnProperty;var _s=No,Ms=function(t){if(!Ss(t))return Es(t);var e=[];for(var n in Object(t))Os.call(t,n)&&"constructor"!=n&&e.push(n);return e},Ns=Ln;var As=fs,js=xs,ks=function(t){return Ns(t)?_s(t):Ms(t)};var Ds=function(t){return As(t,ks,js)},Ps=Object.prototype.hasOwnProperty;var Ts=function(t,e,n,o,i,r){var s=1&n,a=Ds(t),l=a.length;if(l!=Ds(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 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},zs=Jt(ft,"DataView"),Ls=Kt,$s=Jt(ft,"Promise"),Hs=Jt(ft,"Set"),Vs=Jt(ft,"WeakMap"),Is=Nt,Fs=Ht,Bs="[object Map]",Rs="[object Promise]",Ws="[object Set]",qs="[object WeakMap]",Us="[object DataView]",Xs=Fs(zs),Gs=Fs(Ls),Ys=Fs($s),Zs=Fs(Hs),Js=Fs(Vs),Ks=Is;(zs&&Ks(new zs(new ArrayBuffer(1)))!=Us||Ls&&Ks(new Ls)!=Bs||$s&&Ks($s.resolve())!=Rs||Hs&&Ks(new Hs)!=Ws||Vs&&Ks(new Vs)!=qs)&&(Ks=function(t){var e=Is(t),n="[object Object]"==e?t.constructor:void 0,o=n?Fs(n):"";if(o)switch(o){case Xs:return Us;case Gs:return Bs;case Ys:return Rs;case Zs:return Ws;case Js:return qs}return e});var Qs=Fe,ta=rs,ea=ps,na=Ts,oa=Ks,ia=Dn,ra=Bn,sa=co,aa="[object Arguments]",la="[object Array]",ca="[object Object]",da=Object.prototype.hasOwnProperty;var ha=function(t,e,n,o,i,r){var s=ia(t),a=ia(e),l=s?la:oa(t),c=a?la:oa(e),d=(l=l==aa?ca:l)==ca,h=(c=c==aa?ca:c)==ca,u=l==c;if(u&&ra(t)){if(!ra(e))return!1;s=!0,d=!1}if(u&&!d)return r||(r=new Qs),s||sa(t)?ta(t,e,n,o,i,r):ea(t,e,l,n,o,i,r);if(!(1&n)){var p=d&&da.call(t,"__wrapped__"),m=h&&da.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,f=m?e.value():e;return r||(r=new Qs),i(g,f,n,o,r)}}return!!u&&(r||(r=new Qs),na(t,e,n,o,i,r))},ua=Cn;var pa=function t(e,n,o,i,r){return e===n||(null==e||null==n||!ua(e)&&!ua(n)?e!=e&&n!=n:ha(e,n,o,i,t,r))},ma=pa;const ga=q((function(t,e){return ma(t,e)}));class fa{constructor(t,e=Object.create(null)){n(this,"toJSON",((t,e)=>JSON.stringify(t,null,e))),n(this,"get",(t=>Nr(this.data,t))),n(this,"getChangeType",((t,e)=>{const n=A.find((({condition:n})=>n(t,e)))||{type:"unknown"};return n.desc="added"===n.type?`${t} to ${e}`:e,n})),n(this,"add",((t,e=Object.create(null))=>{const{id:n}=e,o=t||n||Pi();return this.set(o,e)})),n(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})),n(this,"getData",(()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=(null==n?void 0:n.data)?n.getData():n,t)),{}))),n(this,"setCallbacks",{}),n(this,"configVal",Object.create(null)),this.name=t,this.data=e,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}set(t,e){const n=Nr(this.data,t);if(ga(n,e))return this.data;const o=Ar(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),Yr.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
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).formeo={})}(this,(function(t){"use strict";var e=Object.defineProperty,n=(t,n,o)=>((t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o)(t,"symbol"!=typeof n?n+"":n,o);const o={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class i{constructor(t=o){this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}processConfig(t){const{location:e,...n}={...o,...t},i=e.replace(/\/?$/,"/");this.config={location:i,...n};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?i.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 i.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(o,r){if(-1!==n.loaded.indexOf(t)&&e)return n.applyLanguage(n.langs[t]),o(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=i.processFile(e);return n.applyLanguage(t,r),n.loaded.push(t),o(n.langs[t])})).catch((e=>{const i=n.applyLanguage(t);o(i)}))}))}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 r=new i,s="2.1.7",a="formeo",l="formeo-sprite",c=[{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"}],d=`https://cdn.jsdelivr.net/npm/formeo@${s}/dist/${l}.svg`,u=`https://draggable.github.io/formeo/assets/img/${l}.svg`,h=`https://cdn.jsdelivr.net/npm/formeo@${s}/dist/formeo.min.css`,p="control-group",f=`${a}-stage`,m=`${a}-row`,g=`${a}-column`,v=`${a}-field`,b="custom-column-widths",y="column-preset",w="resizing-columns",C=new Map([[f,m],[m,g],[g,v]]),E=["external","stages","rows","columns","fields"],S=["stage","row","column","field"].reduce(((t,e)=>({...t,[e]:e})),{}),O=[{name:"controls",className:p},{name:"stage",className:f},{name:"row",className:m},{name:"column",className:g},{name:"field",className:v}],x={controls:p,stage:f,row:m,column:g,field:v},N=Object.entries(x).reduce(((t,[e,n])=>({...t,[n]:e})),{}),_=Object.values(x),A=new RegExp(`${_.join("|")}`,"g"),j=O.map((({name:t},e,n)=>{const{name:o}=n[e+1]||{};return o&&[t,o]})).filter(Boolean),P=j.slice().map((t=>t.slice().reverse())).reverse(),T=new Map(j),D=new Map(P.slice()),k=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)),[])),$=[{type:"added",condition:(t,e)=>Boolean(void 0===t&&e)}],L=`${a}-formData`,I=`${a}-locale`,M=333,F=Math.round(166.5),R=Math.round(666),W="formeoSaved",B="formeoUpdated",z="formeoOnRender",q=["label","logical","source","thenTarget","sourceProperty","comparison","target","targetProperty","assignment","value"],U={value:"attrs.value",checked:"attrs.checked",isVisible:"config.isVisible",isNotVisible:"config.isNotVisible"},X={comparison:{equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},assignment:{equals:"="},logical:{and:"&&",or:"||"},property:U},H=/(\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,Y=/\bcol-\w+-\d+/g,G="f-i-";var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function J(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K=function(){this.__data__=[],this.size=0};var Z=function(t,e){return t===e||t!=t&&e!=e},Q=Z;var tt=function(t,e){for(var n=t.length;n--;)if(Q(t[n][0],e))return n;return-1},et=tt,nt=Array.prototype.splice;var ot=tt;var it=tt;var rt=tt;var st=K,at=function(t){var e=this.__data__,n=et(e,t);return!(n<0)&&(n==e.length-1?e.pop():nt.call(e,n,1),--this.size,!0)},lt=function(t){var e=this.__data__,n=ot(e,t);return n<0?void 0:e[n][1]},ct=function(t){return it(this.__data__,t)>-1},dt=function(t,e){var n=this.__data__,o=rt(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function ut(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])}}ut.prototype.clear=st,ut.prototype.delete=at,ut.prototype.get=lt,ut.prototype.has=ct,ut.prototype.set=dt;var ht=ut,pt=ht;var ft=function(){this.__data__=new pt,this.size=0};var mt=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};var gt=function(t){return this.__data__.get(t)};var vt=function(t){return this.__data__.has(t)},bt="object"==typeof V&&V&&V.Object===Object&&V,yt=bt,wt="object"==typeof self&&self&&self.Object===Object&&self,Ct=yt||wt||Function("return this")(),Et=Ct.Symbol,St=Et,Ot=Object.prototype,xt=Ot.hasOwnProperty,Nt=Ot.toString,_t=St?St.toStringTag:void 0;var At=function(t){var e=xt.call(t,_t),n=t[_t];try{t[_t]=void 0;var o=!0}catch(r){}var i=Nt.call(t);return o&&(e?t[_t]=n:delete t[_t]),i},jt=Object.prototype.toString;var Pt=At,Tt=function(t){return jt.call(t)},Dt=Et?Et.toStringTag:void 0;var kt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Dt&&Dt in Object(t)?Pt(t):Tt(t)};var $t=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},Lt=kt,It=$t;var Mt,Ft=function(t){if(!It(t))return!1;var e=Lt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Rt=Ct["__core-js_shared__"],Wt=(Mt=/[^.]+$/.exec(Rt&&Rt.keys&&Rt.keys.IE_PROTO||""))?"Symbol(src)_1."+Mt:"";var Bt=function(t){return!!Wt&&Wt in t},zt=Function.prototype.toString;var qt=function(t){if(null!=t){try{return zt.call(t)}catch(e){}try{return t+""}catch(e){}}return""},Ut=Ft,Xt=Bt,Ht=$t,Yt=qt,Gt=/^\[object .+?Constructor\]$/,Vt=Function.prototype,Jt=Object.prototype,Kt=Vt.toString,Zt=Jt.hasOwnProperty,Qt=RegExp("^"+Kt.call(Zt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var te=function(t){return!(!Ht(t)||Xt(t))&&(Ut(t)?Qt:Gt).test(Yt(t))},ee=function(t,e){return null==t?void 0:t[e]};var ne=function(t,e){var n=ee(t,e);return te(n)?n:void 0},oe=ne(Ct,"Map"),ie=ne(Object,"create"),re=ie;var se=function(){this.__data__=re?re(null):{},this.size=0};var ae=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},le=ie,ce=Object.prototype.hasOwnProperty;var de=function(t){var e=this.__data__;if(le){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ce.call(e,t)?e[t]:void 0},ue=ie,he=Object.prototype.hasOwnProperty;var pe=ie;var fe=se,me=ae,ge=de,ve=function(t){var e=this.__data__;return ue?void 0!==e[t]:he.call(e,t)},be=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=pe&&void 0===e?"__lodash_hash_undefined__":e,this};function ye(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])}}ye.prototype.clear=fe,ye.prototype.delete=me,ye.prototype.get=ge,ye.prototype.has=ve,ye.prototype.set=be;var we=ye,Ce=ht,Ee=oe;var Se=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Oe=function(t,e){var n=t.__data__;return Se(e)?n["string"==typeof e?"string":"hash"]:n.map},xe=Oe;var Ne=Oe;var _e=Oe;var Ae=Oe;var je=function(){this.size=0,this.__data__={hash:new we,map:new(Ee||Ce),string:new we}},Pe=function(t){var e=xe(this,t).delete(t);return this.size-=e?1:0,e},Te=function(t){return Ne(this,t).get(t)},De=function(t){return _e(this,t).has(t)},ke=function(t,e){var n=Ae(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function $e(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])}}$e.prototype.clear=je,$e.prototype.delete=Pe,$e.prototype.get=Te,$e.prototype.has=De,$e.prototype.set=ke;var Le=$e,Ie=ht,Me=oe,Fe=Le;var Re=ht,We=ft,Be=mt,ze=gt,qe=vt,Ue=function(t,e){var n=this.__data__;if(n instanceof Ie){var o=n.__data__;if(!Me||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Fe(o)}return n.set(t,e),this.size=n.size,this};function Xe(t){var e=this.__data__=new Re(t);this.size=e.size}Xe.prototype.clear=We,Xe.prototype.delete=Be,Xe.prototype.get=ze,Xe.prototype.has=qe,Xe.prototype.set=Ue;var He=Xe,Ye=ne,Ge=function(){try{var t=Ye(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ve=Ge;var Je=function(t,e,n){"__proto__"==e&&Ve?Ve(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Ke=Je,Ze=Z;var Qe=function(t,e,n){(void 0!==n&&!Ze(t[e],n)||void 0===n&&!(e in t))&&Ke(t,e,n)};var tn,en,nn,on,rn,sn,an,ln=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}}(),cn={exports:{}};tn=cn,nn=Ct,on=(en=cn.exports)&&!en.nodeType&&en,rn=on&&tn&&!tn.nodeType&&tn,sn=rn&&rn.exports===on?nn.Buffer:void 0,an=sn?sn.allocUnsafe:void 0,tn.exports=function(t,e){if(e)return t.slice();var n=t.length,o=an?an(n):new t.constructor(n);return t.copy(o),o};var dn=cn.exports,un=Ct.Uint8Array,hn=un;var pn=function(t){var e=new t.constructor(t.byteLength);return new hn(e).set(new hn(t)),e};var fn=function(t,e){var n=e?pn(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},gn=$t,vn=Object.create,bn=function(){function t(){}return function(e){if(!gn(e))return{};if(vn)return vn(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var yn=function(t,e){return function(n){return t(e(n))}},wn=yn(Object.getPrototypeOf,Object),Cn=Object.prototype;var En=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Cn)},Sn=bn,On=wn,xn=En;var Nn=function(t){return"function"!=typeof t.constructor||xn(t)?{}:Sn(On(t))};var _n=function(t){return null!=t&&"object"==typeof t},An=kt,jn=_n;var Pn=function(t){return jn(t)&&"[object Arguments]"==An(t)},Tn=_n,Dn=Object.prototype,kn=Dn.hasOwnProperty,$n=Dn.propertyIsEnumerable,Ln=Pn(function(){return arguments}())?Pn:function(t){return Tn(t)&&kn.call(t,"callee")&&!$n.call(t,"callee")},In=Ln,Mn=Array.isArray;var Fn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Rn=Ft,Wn=Fn;var Bn=function(t){return null!=t&&Wn(t.length)&&!Rn(t)},zn=Bn,qn=_n;var Un=function(t){return qn(t)&&zn(t)},Xn={exports:{}};var Hn=function(){return!1};!function(t,e){var n=Ct,o=Hn,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}(Xn,Xn.exports);var Yn=Xn.exports,Gn=kt,Vn=wn,Jn=_n,Kn=Function.prototype,Zn=Object.prototype,Qn=Kn.toString,to=Zn.hasOwnProperty,eo=Qn.call(Object);var no=function(t){if(!Jn(t)||"[object Object]"!=Gn(t))return!1;var e=Vn(t);if(null===e)return!0;var n=to.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Qn.call(n)==eo},oo=kt,io=Fn,ro=_n,so={};so["[object Float32Array]"]=so["[object Float64Array]"]=so["[object Int8Array]"]=so["[object Int16Array]"]=so["[object Int32Array]"]=so["[object Uint8Array]"]=so["[object Uint8ClampedArray]"]=so["[object Uint16Array]"]=so["[object Uint32Array]"]=!0,so["[object Arguments]"]=so["[object Array]"]=so["[object ArrayBuffer]"]=so["[object Boolean]"]=so["[object DataView]"]=so["[object Date]"]=so["[object Error]"]=so["[object Function]"]=so["[object Map]"]=so["[object Number]"]=so["[object Object]"]=so["[object RegExp]"]=so["[object Set]"]=so["[object String]"]=so["[object WeakMap]"]=!1;var ao=function(t){return ro(t)&&io(t.length)&&!!so[oo(t)]};var lo=function(t){return function(e){return t(e)}},co={exports:{}};!function(t,e){var n=bt,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}(co,co.exports);var uo=co.exports,ho=ao,po=lo,fo=uo&&uo.isTypedArray,mo=fo?po(fo):ho;var go=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},vo=Je,bo=Z,yo=Object.prototype.hasOwnProperty;var wo=function(t,e,n){var o=t[e];yo.call(t,e)&&bo(o,n)&&(void 0!==n||e in t)||vo(t,e,n)},Co=wo,Eo=Je;var So=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?Eo(n,a,l):Co(n,a,l)}return n};var Oo=/^(?:0|[1-9]\d*)$/;var xo=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Oo.test(t))&&t>-1&&t%1==0&&t<e},No=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},_o=In,Ao=Mn,jo=Yn,Po=xo,To=mo,Do=Object.prototype.hasOwnProperty;var ko=function(t,e){var n=Ao(t),o=!n&&_o(t),i=!n&&!o&&jo(t),r=!n&&!o&&!i&&To(t),s=n||o||i||r,a=s?No(t.length,String):[],l=a.length;for(var c in t)!e&&!Do.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Po(c,l))||a.push(c);return a};var $o=$t,Lo=En,Io=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},Mo=Object.prototype.hasOwnProperty;var Fo=ko,Ro=function(t){if(!$o(t))return Io(t);var e=Lo(t),n=[];for(var o in t)("constructor"!=o||!e&&Mo.call(t,o))&&n.push(o);return n},Wo=Bn;var Bo=function(t){return Wo(t)?Fo(t,!0):Ro(t)},zo=So,qo=Bo;var Uo=Qe,Xo=dn,Ho=fn,Yo=mn,Go=Nn,Vo=In,Jo=Mn,Ko=Un,Zo=Yn,Qo=Ft,ti=$t,ei=no,ni=mo,oi=go,ii=function(t){return zo(t,qo(t))};var ri=He,si=Qe,ai=ln,li=function(t,e,n,o,i,r,s){var a=oi(t,n),l=oi(e,n),c=s.get(l);if(c)Uo(t,n,c);else{var d=r?r(a,l,n+"",t,e,s):void 0,u=void 0===d;if(u){var h=Jo(l),p=!h&&Zo(l),f=!h&&!p&&ni(l);d=l,h||p||f?Jo(a)?d=a:Ko(a)?d=Yo(a):p?(u=!1,d=Xo(l,!0)):f?(u=!1,d=Ho(l,!0)):d=[]:ei(l)||Vo(l)?(d=a,Vo(a)?d=ii(a):ti(a)&&!Qo(a)||(d=Go(l))):u=!1}u&&(s.set(l,d),i(d,l,o,r,s),s.delete(l)),Uo(t,n,d)}},ci=$t,di=Bo,ui=go;var hi=function t(e,n,o,i,r){e!==n&&ai(n,(function(s,a){if(r||(r=new ri),ci(s))li(e,n,a,o,t,i,r);else{var l=i?i(ui(e,a),s,a+"",e,n,r):void 0;void 0===l&&(l=s),si(e,a,l)}}),di)};var pi=function(t){return t};var fi=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)},mi=Math.max;var gi=function(t,e,n){return e=mi(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,r=mi(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),fi(t,this,a)}};var vi=function(t){return function(){return t}},bi=Ge,yi=bi?function(t,e){return bi(t,"toString",{configurable:!0,enumerable:!1,value:vi(e),writable:!0})}:pi,wi=Date.now;var Ci=function(t){var e=0,n=0;return function(){var o=wi(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},Ei=Ci(yi),Si=pi,Oi=gi,xi=Ei;var Ni=Z,_i=Bn,Ai=xo,ji=$t;var Pi=function(t,e){return xi(Oi(t,e,Si),t+"")},Ti=function(t,e,n){if(!ji(n))return!1;var o=typeof e;return!!("number"==o?_i(n)&&Ai(e,n.length):"string"==o&&e in n)&&Ni(n[e],t)};var Di=hi;const ki=J(function(t){return Pi((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&&Ti(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){Di(t,e,n,o)}))),$i=()=>crypto.randomUUID(),Li=(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},Ii=t=>{var e;const n=null==(e=t.className)?void 0:e.match(A);return n&&N[n[0]]},Mi=t=>Array.from(new Set(t)),Fi=t=>{let e;if(t){const{attrs:n={}}=t;e=n.id||t.id||$i(),t.id=e}else e=$i();return e},Ri=(t,e,n=Object.create(null))=>ki({},t,e,((t,e)=>{if(Array.isArray(t))return Array.isArray(e)?Mi(n.mergeArray?t.concat(e):e):e})),Wi=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]=Wi(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=Wi(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},Bi=(t,e)=>t/e*100,zi=t=>`${t.toString()}%`,qi=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){}}}}),Ui=t=>E.some((e=>new RegExp(`^${e}.`).test(t))),Xi=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 Yi(t){return t}function Gi(){}var Vi=kt,Ji=_n;var Ki=function(t){return"symbol"==typeof t||Ji(t)&&"[object Symbol]"==Vi(t)},Zi=Mn,Qi=Ki,tr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,er=/^\w*$/;var nr=function(t,e){if(Zi(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Qi(t))||(er.test(t)||!tr.test(t)||null!=e&&t in Object(e))},or=Le;function ir(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(ir.Cache||or),n}ir.Cache=or;var rr=ir;var sr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ar=/\\(\\)?/g,lr=function(t){var e=rr(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(sr,(function(t,n,o,i){e.push(o?i.replace(ar,"$1"):n||t)})),e}));var cr=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},dr=Mn,ur=Ki,hr=Et?Et.prototype:void 0,pr=hr?hr.toString:void 0;var fr=function t(e){if("string"==typeof e)return e;if(dr(e))return cr(e,t)+"";if(ur(e))return pr?pr.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},mr=fr;var gr=Mn,vr=nr,br=lr,yr=function(t){return null==t?"":mr(t)};var wr=function(t,e){return gr(t)?t:vr(t,e)?[t]:br(yr(t))},Cr=Ki;var Er=function(t){if("string"==typeof t||Cr(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},Sr=wo,Or=wr,xr=xo,Nr=$t,_r=Er;var Ar=function(t,e,n,o){if(!Nr(t))return t;for(var i=-1,r=(e=Or(e,t)).length,s=r-1,a=t;null!=a&&++i<r;){var l=_r(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=Nr(d)?d:xr(e[i+1])?[]:{})}Sr(a,l,c),a=a[l]}return t};const jr=J((function(t,e,n){return null==t?t:Ar(t,e,n)}));var Pr=wr,Tr=Er;var Dr=function(t,e){for(var n=0,o=(e=Pr(e,t)).length;null!=t&&n<o;)t=t[Tr(e[n++])];return n&&n==o?t:void 0};const kr=J((function(t,e,n){var o=null==t?void 0:Dr(t,e);return void 0===o?n:o})),$r=jr,Lr=t=>{const e={...t},n={string:()=>"",boolean:()=>!1,object:t=>Lr(t)};for(const o of Object.keys(t)){const i=typeof t[o];n[i]&&(e[o]=n[i](t[o]))}return e},Ir=t=>Number.isInteger(Number(t)),Mr=(t,e)=>{const n=e||t.parentElement;return Array.prototype.slice.call(n.childNodes).indexOf(t)},Fr=(t,e,n)=>{const o=n.split("||"),i=Mi(e).map((e=>t.find((t=>{const n=o.find((e=>!!kr(t,e)));return n&&kr(t,n)===e})))).filter(Boolean).concat(t);return Mi(i)},Rr=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},Wr=(t,e)=>{const n=[];return Rr(t,((t,o)=>n.push(e(t,o)))),n},Br={},zr=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),qr=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Ur={capitalize:zr,safeAttrName:t=>{if(Br[t])return Br[t];const e=({className:"class"}[t]||t).replace(/^\d/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Br[t]=e,e},forEach:Rr,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:Wr,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:Mr,isInt:Ir,get:kr,orderObjectsBy:Fr,isIE:qr},Xr={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=Xr.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=Xr.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"===Xr.getStyle(t,"display"))=>{n?Xr.slideDown(t,e):Xr.slideUp(t,e)}},Hr="no-transition",Yr={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onUpdate:t=>Vr.opts.debug&&void 0,onUpdateStage:t=>Vr.opts.debug&&void 0,onUpdateRow:t=>Vr.opts.debug&&void 0,onUpdateColumn:t=>Vr.opts.debug&&void 0,onUpdateField:t=>Vr.opts.debug&&void 0,onRender:t=>Vr.opts.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},Gr=({src:t,...e},n=B)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:Vr.opts.debug||Vr.opts.bubbles});return o.data=(t||document).dispatchEvent(o),o},Vr={init:function(t){return this.opts={...Yr,...t},this},formeoSaved:t=>Gr(t,W),formeoUpdated:t=>Gr(t,B),formeoCleared:t=>Gr(t,"formeoCleared"),formeoOnRender:t=>Gr(t,z),formeoConditionUpdated:t=>Gr(t,"formeoConditionUpdated")},Jr=Hi((()=>{Vr.opts.onUpdate({timeStamp:window.performance.now(),type:B,detail:Ld.formData})}),F);let Kr;document.addEventListener(B,Jr),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;Vr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;Vr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;Vr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;Vr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener(z,(t=>{const{timeStamp:e,type:n,detail:o}=t;Vr.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},Vr.opts.confirmClearAll(t)})),document.addEventListener(W,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};Vr.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{Vr.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){Kr=Kr||window.requestAnimationFrame((()=>{Kr=!1,Object.values(Pd.data).forEach((t=>{t.dom.classList.add(Hr),Dd.dom.classList.add(Hr),Dd.panels.nav.refresh(),t.refreshFieldPanels()}))}))}));var Zr=Le,Qr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ts=function(t){return this.__data__.has(t)};function es(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Zr;++e<n;)this.add(t[e])}es.prototype.add=es.prototype.push=Qr,es.prototype.has=ts;var ns=es,os=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},is=function(t,e){return t.has(e)};var rs=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 ns:void 0;for(r.set(t,e),r.set(e,t);++u<a;){var f=t[u],m=e[u];if(o)var g=s?o(m,f,u,e,t,r):o(f,m,u,t,e,r);if(void 0!==g){if(g)continue;h=!1;break}if(p){if(!os(e,(function(t,e){if(!is(p,e)&&(f===t||i(f,t,n,o,r)))return p.push(e)}))){h=!1;break}}else if(f!==m&&!i(f,m,n,o,r)){h=!1;break}}return r.delete(t),r.delete(e),h};var ss=un,as=Z,ls=rs,cs=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n},ds=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},us=Et?Et.prototype:void 0,hs=us?us.valueOf:void 0;var ps=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 ss(t),new ss(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return as(+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=cs;case"[object Set]":var l=1&o;if(a||(a=ds),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=ls(a(t),a(e),o,i,r,s);return s.delete(t),d;case"[object Symbol]":if(hs)return hs.call(t)==hs.call(e)}return!1};var fs=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t},ms=Mn;var gs=function(t,e,n){var o=e(t);return ms(t)?o:fs(o,n(t))};var vs=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},bs=function(){return[]},ys=Object.prototype.propertyIsEnumerable,ws=Object.getOwnPropertySymbols,Cs=ws?function(t){return null==t?[]:(t=Object(t),vs(ws(t),(function(e){return ys.call(t,e)})))}:bs,Es=yn(Object.keys,Object),Ss=En,Os=Es,xs=Object.prototype.hasOwnProperty;var Ns=ko,_s=function(t){if(!Ss(t))return Os(t);var e=[];for(var n in Object(t))xs.call(t,n)&&"constructor"!=n&&e.push(n);return e},As=Bn;var js=gs,Ps=Cs,Ts=function(t){return As(t)?Ns(t):_s(t)};var Ds=function(t){return js(t,Ts,Ps)},ks=Object.prototype.hasOwnProperty;var $s=function(t,e,n,o,i,r){var s=1&n,a=Ds(t),l=a.length;if(l!=Ds(e).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in e:ks.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 f=s;++c<l;){var m=t[d=a[c]],g=e[d];if(o)var v=s?o(g,m,d,e,t,r):o(m,g,d,t,e,r);if(!(void 0===v?m===g||i(m,g,n,o,r):v)){p=!1;break}f||(f="constructor"==d)}if(p&&!f){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},Ls=ne(Ct,"DataView"),Is=oe,Ms=ne(Ct,"Promise"),Fs=ne(Ct,"Set"),Rs=ne(Ct,"WeakMap"),Ws=kt,Bs=qt,zs="[object Map]",qs="[object Promise]",Us="[object Set]",Xs="[object WeakMap]",Hs="[object DataView]",Ys=Bs(Ls),Gs=Bs(Is),Vs=Bs(Ms),Js=Bs(Fs),Ks=Bs(Rs),Zs=Ws;(Ls&&Zs(new Ls(new ArrayBuffer(1)))!=Hs||Is&&Zs(new Is)!=zs||Ms&&Zs(Ms.resolve())!=qs||Fs&&Zs(new Fs)!=Us||Rs&&Zs(new Rs)!=Xs)&&(Zs=function(t){var e=Ws(t),n="[object Object]"==e?t.constructor:void 0,o=n?Bs(n):"";if(o)switch(o){case Ys:return Hs;case Gs:return zs;case Vs:return qs;case Js:return Us;case Ks:return Xs}return e});var Qs=He,ta=rs,ea=ps,na=$s,oa=Zs,ia=Mn,ra=Yn,sa=mo,aa="[object Arguments]",la="[object Array]",ca="[object Object]",da=Object.prototype.hasOwnProperty;var ua=function(t,e,n,o,i,r){var s=ia(t),a=ia(e),l=s?la:oa(t),c=a?la:oa(e),d=(l=l==aa?ca:l)==ca,u=(c=c==aa?ca:c)==ca,h=l==c;if(h&&ra(t)){if(!ra(e))return!1;s=!0,d=!1}if(h&&!d)return r||(r=new Qs),s||sa(t)?ta(t,e,n,o,i,r):ea(t,e,l,n,o,i,r);if(!(1&n)){var p=d&&da.call(t,"__wrapped__"),f=u&&da.call(e,"__wrapped__");if(p||f){var m=p?t.value():t,g=f?e.value():e;return r||(r=new Qs),i(m,g,n,o,r)}}return!!h&&(r||(r=new Qs),na(t,e,n,o,i,r))},ha=_n;var pa=function t(e,n,o,i,r){return e===n||(null==e||null==n||!ha(e)&&!ha(n)?e!=e&&n!=n:ua(e,n,o,i,t,r))},fa=pa;const ma=J((function(t,e){return fa(t,e)}));class ga{constructor(t,e=Object.create(null)){n(this,"toJSON",((t,e)=>JSON.stringify(t,null,e))),n(this,"get",(t=>kr(this.data,t))),n(this,"getChangeType",((t,e)=>{const n=$.find((({condition:n})=>n(t,e)))||{type:"unknown"};return n.desc="added"===n.type?`${t} to ${e}`:e,n})),n(this,"add",((t,e=Object.create(null))=>{const{id:n}=e,o=t||n||Fi();return this.set(o,e)})),n(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})),n(this,"getData",(()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=(null==n?void 0:n.data)?n.getData():n,t)),{}))),n(this,"setCallbacks",{}),n(this,"configVal",Object.create(null)),this.name=t,this.data=e,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}set(t,e){const n=kr(this.data,t);if(ma(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),Vr.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 va(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 ba(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?va(Object(n),!0).forEach((function(e){wa(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):va(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ya(t){return(ya="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 wa(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xa(){return xa=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},xa.apply(this,arguments)}function Ca(t,e){if(null==t)return{};var n,o,i=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Sa(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Ea=Sa(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oa=Sa(/Edge/i),_a=Sa(/firefox/i),Ma=Sa(/safari/i)&&!Sa(/chrome/i)&&!Sa(/android/i),Na=Sa(/iP(ad|od|hone)/i),Aa=Sa(/chrome/i)&&Sa(/android/i),ja={capture:!1,passive:!1};function ka(t,e,n){t.addEventListener(e,n,!Ea&&ja)}function Da(t,e,n){t.removeEventListener(e,n,!Ea&&ja)}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 za(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 La,$a=/\s+/g;function Ha(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 Va(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 Ia(t,e){var n="";if("string"==typeof t)n=t;else do{var o=Va(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Fa(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function Ba(){var t=document.scrollingElement;return t||document.documentElement}function Ra(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,h;if(t!==window&&t.parentNode&&t!==Ba()?(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,!Ea))do{if(i&&i.getBoundingClientRect&&("none"!==Va(i,"transform")||n&&"static"!==Va(i,"position"))){var u=i.getBoundingClientRect();s-=u.top+parseInt(Va(i,"border-top-width")),a-=u.left+parseInt(Va(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=Ia(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 Wa(t,e,n){for(var o=Ya(t,!0),i=Ra(t)[e];o;){if(!(i>=Ra(o)[n]))return o;if(o===Ba())break;o=Ya(o,!1)}return!1}function qa(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==Ql.ghost&&(o||s[r]!==Ql.dragged)&&za(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function Ua(t,e){for(var n=t.lastElementChild;n&&(n===Ql.ghost||"none"===Va(n,"display")||e&&!Pa(n,e));)n=n.previousElementSibling;return n||null}function Xa(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Ql.clone||e&&!Pa(t,e)||n++;return n}function Ga(t){var e=0,n=0,o=Ba();if(t)do{var i=Ia(t),r=i.a,s=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*s}while(t!==o&&(t=t.parentNode));return[e,n]}function Ya(t,e){if(!t||!t.getBoundingClientRect)return Ba();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Va(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return Ba();if(o||e)return n;o=!0}}}while(n=n.parentNode);return Ba()}function Za(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 Ja(t,e){return function(){if(!La){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),La=setTimeout((function(){La=void 0}),e)}}}function Ka(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Qa(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 tl(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if(za(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=Ra(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 el="Sortable"+(new Date).getTime();function nl(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==Va(t,"display")&&t!==Ql.ghost){e.push({target:t,rect:Ra(t)});var n=ba({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=Ia(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=Ra(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,h=Ia(n,!0);h&&(a.top-=h.f,a.left-=h.e),n.toRect=a,n.thisAnimationDuration&&Za(l,a)&&!Za(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)),Za(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){Va(t,"transition",""),Va(t,"transform","");var i=Ia(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,Va(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),Va(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Va(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){Va(t,"transition",""),Va(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var ol=[],il={initializeByDefault:!0},rl={mount:function(t){for(var e in il)il.hasOwnProperty(e)&&!(e in t)&&(t[e]=il[e]);ol.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),ol.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";ol.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](ba({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](ba({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in ol.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,xa(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 ol.forEach((function(o){"function"==typeof o.eventProperties&&xa(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return ol.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var sl=["evt"],al=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=Ca(n,sl);rl.pluginEvent.bind(Ql)(t,e,ba({dragEl:cl,parentEl:dl,ghostEl:hl,rootEl:ul,nextEl:pl,lastDownEl:ml,cloneEl:gl,cloneHidden:fl,dragStarted:Al,putSortable:Cl,activeSortable:Ql.active,originalEvent:o,oldIndex:vl,oldDraggableIndex:yl,newIndex:bl,newDraggableIndex:wl,hideGhostForTarget:Yl,unhideGhostForTarget:Zl,cloneNowHidden:function(){fl=!0},cloneNowShown:function(){fl=!1},dispatchSortableEvent:function(t){ll({sortable:e,name:t,originalEvent:o})}},i))};function ll(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[el]){var g,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Ea||Oa?(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=ba(ba({},m),rl.getEventProperties(o,e));for(var y in b)g[y]=b[y];n&&n.dispatchEvent(g),f[v]&&f[v].call(e,g)}}(ba({putSortable:Cl,cloneEl:gl,targetEl:cl,rootEl:ul,oldIndex:vl,oldDraggableIndex:yl,newIndex:bl,newDraggableIndex:wl},t))}var cl,dl,hl,ul,pl,ml,gl,fl,vl,bl,yl,wl,xl,Cl,Sl,El,Ol,_l,Ml,Nl,Al,jl,kl,Dl,Pl,Tl=!1,zl=!1,Ll=[],$l=!1,Hl=!1,Vl=[],Il=!1,Fl=[],Bl="undefined"!=typeof document,Rl=Na,Wl=Oa||Ea?"cssFloat":"float",ql=Bl&&!Aa&&!Na&&"draggable"in document.createElement("div"),Ul=function(){if(Bl){if(Ea)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Xl=function(t,e){var n=Va(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=qa(t,0,e),r=qa(t,1,e),s=i&&Va(i),a=r&&Va(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ra(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ra(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[Wl]||r&&"none"===n[Wl]&&l+c>o)?"vertical":"horizontal"},Gl=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"==ya(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Yl=function(){!Ul&&hl&&Va(hl,"display","none")},Zl=function(){!Ul&&hl&&Va(hl,"display","")};Bl&&!Aa&&document.addEventListener("click",(function(t){if(zl)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),zl=!1,!1}),!0);var Jl=function(t){if(cl){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,Ll.some((function(t){var e=t[el].options.emptyInsertThreshold;if(e&&!Ua(t)){var n=Ra(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[el]._onDragOver(n)}}var i,r,s},Kl=function(t){cl&&cl.parentNode[el]._isOutsideThisEl(t.target)};function Ql(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=xa({},e),t[el]=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 Xl(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!==Ql.supportPointer&&"PointerEvent"in window&&!Ma,emptyInsertThreshold:5};for(var o in rl.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in Gl(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&ql,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?ka(t,"pointerdown",this._onTapStart):(ka(t,"mousedown",this._onTapStart),ka(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(ka(t,"dragover",this),ka(t,"dragenter",this)),Ll.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),xa(this,nl())}function tc(t,e,n,o,i,r,s,a){var l,c,d=t[el],h=d.options.onMove;return!window.CustomEvent||Ea||Oa?(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||Ra(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),h&&(c=h.call(d,l,s)),c}function ec(t){t.draggable=!1}function nc(){Il=!1}function oc(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 ic(t){return setTimeout(t,0)}function rc(t){return clearTimeout(t)}Ql.prototype={constructor:Ql,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(jl=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,cl):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),!cl&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Ma||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=za(a,o.draggable,n,!1))&&a.animated||ml===a)){if(vl=Xa(a),yl=Xa(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return ll({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),al("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=za(l,o.trim(),n,!1))return ll({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),al("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!za(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&&!cl&&n.parentNode===r){var l=Ra(n);if(ul=r,dl=(cl=n).parentNode,pl=cl.nextSibling,ml=n,xl=s.group,Ql.dragged=cl,Sl={target:cl,clientX:(e||t).clientX,clientY:(e||t).clientY},Ml=Sl.clientX-l.left,Nl=Sl.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,cl.style["will-change"]="all",o=function(){al("delayEnded",i,{evt:t}),Ql.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!_a&&i.nativeDraggable&&(cl.draggable=!0),i._triggerDragStart(t,e),ll({sortable:i,name:"choose",originalEvent:t}),Ha(cl,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Fa(cl,t.trim(),ec)})),ka(a,"dragover",Jl),ka(a,"mousemove",Jl),ka(a,"touchmove",Jl),ka(a,"mouseup",i._onDrop),ka(a,"touchend",i._onDrop),ka(a,"touchcancel",i._onDrop),_a&&this.nativeDraggable&&(this.options.touchStartThreshold=4,cl.draggable=!0),al("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Oa||Ea))o();else{if(Ql.eventCanceled)return void this._onDrop();ka(a,"mouseup",i._disableDelayedDrag),ka(a,"touchend",i._disableDelayedDrag),ka(a,"touchcancel",i._disableDelayedDrag),ka(a,"mousemove",i._delayedDragTouchMoveHandler),ka(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&ka(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(){cl&&ec(cl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Da(t,"mouseup",this._disableDelayedDrag),Da(t,"touchend",this._disableDelayedDrag),Da(t,"touchcancel",this._disableDelayedDrag),Da(t,"mousemove",this._delayedDragTouchMoveHandler),Da(t,"touchmove",this._delayedDragTouchMoveHandler),Da(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?ka(document,"pointermove",this._onTouchMove):ka(document,e?"touchmove":"mousemove",this._onTouchMove):(ka(cl,"dragend",this),ka(ul,"dragstart",this._onDragStart));try{document.selection?ic((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(Tl=!1,ul&&cl){al("dragStarted",this,{evt:e}),this.nativeDraggable&&ka(document,"dragover",Kl);var n=this.options;!t&&Ha(cl,n.dragClass,!1),Ha(cl,n.ghostClass,!0),Ql.active=this,t&&this._appendGhost(),ll({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(El){this._lastX=El.clientX,this._lastY=El.clientY,Yl();for(var t=document.elementFromPoint(El.clientX,El.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(El.clientX,El.clientY))!==e;)e=t;if(cl.parentNode[el]._isOutsideThisEl(t),e)do{if(e[el]){if(e[el]._onDragOver({clientX:El.clientX,clientY:El.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=Ta(e));Zl()}},_onTouchMove:function(t){if(Sl){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=hl&&Ia(hl,!0),s=hl&&r&&r.a,a=hl&&r&&r.d,l=Rl&&Pl&&Ga(Pl),c=(i.clientX-Sl.clientX+o.x)/(s||1)+(l?l[0]-Vl[0]:0)/(s||1),d=(i.clientY-Sl.clientY+o.y)/(a||1)+(l?l[1]-Vl[1]:0)/(a||1);if(!Ql.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(hl){r?(r.e+=c-(Ol||0),r.f+=d-(_l||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,")");Va(hl,"webkitTransform",h),Va(hl,"mozTransform",h),Va(hl,"msTransform",h),Va(hl,"transform",h),Ol=c,_l=d,El=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!hl){var t=this.options.fallbackOnBody?document.body:ul,e=Ra(cl,!0,Rl,!0,t),n=this.options;if(Rl){for(Pl=t;"static"===Va(Pl,"position")&&"none"===Va(Pl,"transform")&&Pl!==document;)Pl=Pl.parentNode;Pl!==document.body&&Pl!==document.documentElement?(Pl===document&&(Pl=Ba()),e.top+=Pl.scrollTop,e.left+=Pl.scrollLeft):Pl=Ba(),Vl=Ga(Pl)}Ha(hl=cl.cloneNode(!0),n.ghostClass,!1),Ha(hl,n.fallbackClass,!0),Ha(hl,n.dragClass,!0),Va(hl,"transition",""),Va(hl,"transform",""),Va(hl,"box-sizing","border-box"),Va(hl,"margin",0),Va(hl,"top",e.top),Va(hl,"left",e.left),Va(hl,"width",e.width),Va(hl,"height",e.height),Va(hl,"opacity","0.8"),Va(hl,"position",Rl?"absolute":"fixed"),Va(hl,"zIndex","100000"),Va(hl,"pointerEvents","none"),Ql.ghost=hl,t.appendChild(hl),Va(hl,"transform-origin",Ml/parseInt(hl.style.width)*100+"% "+Nl/parseInt(hl.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;al("dragStart",this,{evt:t}),Ql.eventCanceled?this._onDrop():(al("setupClone",this),Ql.eventCanceled||((gl=Qa(cl)).removeAttribute("id"),gl.draggable=!1,gl.style["will-change"]="",this._hideClone(),Ha(gl,this.options.chosenClass,!1),Ql.clone=gl),n.cloneId=ic((function(){al("clone",n),Ql.eventCanceled||(n.options.removeCloneOnHide||ul.insertBefore(gl,cl),n._hideClone(),ll({sortable:n,name:"clone"}))})),!e&&Ha(cl,i.dragClass,!0),e?(zl=!0,n._loopId=setInterval(n._emulateDragOver,50)):(Da(document,"mouseup",n._onDrop),Da(document,"touchend",n._onDrop),Da(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,cl)),ka(document,"drop",n),Va(cl,"transform","translateZ(0)")),Tl=!0,n._dragStartId=ic(n._dragStarted.bind(n,e,t)),ka(document,"selectstart",n),Al=!0,Ma&&Va(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=Ql.active,d=xl===l,h=a.sort,u=Cl||c,p=this,m=!1;if(!Il){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=za(s,a.draggable,r,!0),A("dragOver"),Ql.eventCanceled)return m;if(cl.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return k(!1);if(zl=!1,c&&!a.disabled&&(d?h||(o=dl!==ul):Cl===this||(this.lastPutMode=xl.checkPull(this,c,cl,t))&&l.checkPut(this,c,cl,t))){if(i="vertical"===this._getDirection(t,s),e=Ra(cl),A("dragOverValid"),Ql.eventCanceled)return m;if(o)return dl=ul,j(),this._hideClone(),A("revert"),Ql.eventCanceled||(pl?ul.insertBefore(cl,pl):ul.appendChild(cl)),k(!0);var g=Ua(r,a.draggable);if(!g||function(t,e,n){var o=Ra(Ua(n.el,n.options.draggable)),i=tl(n.el,n.options,hl),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===cl)return k(!1);if(g&&r===t.target&&(s=g),s&&(n=Ra(s)),!1!==tc(ul,r,cl,e,s,n,t,!!s))return j(),g&&g.nextSibling?r.insertBefore(cl,g.nextSibling):r.appendChild(cl),dl=r,D(),k(!0)}else if(g&&function(t,e,n){var o=Ra(qa(n.el,0,n.options,!0)),i=tl(n.el,n.options,hl),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=qa(r,0,a,!0);if(f===cl)return k(!1);if(n=Ra(s=f),!1!==tc(ul,r,cl,e,s,n,t,!1))return j(),r.insertBefore(cl,f),dl=r,D(),k(!0)}else if(s.parentNode===r){n=Ra(s);var v,b,y,w=cl.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}(cl.animated&&cl.toRect||e,s.animated&&s.toRect||n,i),C=i?"top":"left",S=Wa(s,"top","top")||Wa(cl,"top","top"),E=S?S.scrollTop:void 0;if(jl!==s&&(b=n[C],$l=!1,Hl=!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&&Dl<c*i){if(!$l&&(1===kl?l>d+c*r/2:l<h-c*r/2)&&($l=!0),$l)u=!0;else if(1===kl?l<d+Dl:l>h-Dl)return-kl}else if(l>d+c*(1-i)/2&&l<h-c*(1-i)/2)return function(t){return Xa(cl)<Xa(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,Hl,jl===s),0!==v){var O=Xa(cl);do{O-=v,y=dl.children[O]}while(y&&("none"===Va(y,"display")||y===hl))}if(0===v||y===s)return k(!1);jl=s,kl=v;var _=s.nextElementSibling,M=!1,N=tc(ul,r,cl,e,s,n,t,M=1===v);if(!1!==N)return 1!==N&&-1!==N||(M=1===N),Il=!0,setTimeout(nc,30),j(),M&&!_?r.appendChild(cl):s.parentNode.insertBefore(cl,M?_:s),S&&Ka(S,0,E-S.scrollTop),dl=cl.parentNode,void 0===b||Hl||(Dl=Math.abs(b-Ra(s)[C])),D(),k(!0)}if(r.contains(cl))return k(!1)}return!1}function A(a,l){al(a,p,ba({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 tc(ul,r,cl,e,n,Ra(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&&(Ha(cl,Cl?Cl.options.ghostClass:c.options.ghostClass,!1),Ha(cl,a.ghostClass,!0)),Cl!==p&&p!==Ql.active?Cl=p:p===Ql.active&&Cl&&(Cl=null),u===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){A("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(s===cl&&!cl.animated||s===r&&!s.animated)&&(jl=null),a.dragoverBubble||t.rootEl||s===document||(cl.parentNode[el]._isOutsideThisEl(t.target),!e&&Jl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function D(){bl=Xa(cl),wl=Xa(cl,a.draggable),ll({sortable:p,name:"change",toEl:r,newIndex:bl,newDraggableIndex:wl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Da(document,"mousemove",this._onTouchMove),Da(document,"touchmove",this._onTouchMove),Da(document,"pointermove",this._onTouchMove),Da(document,"dragover",Jl),Da(document,"mousemove",Jl),Da(document,"touchmove",Jl)},_offUpEvents:function(){var t=this.el.ownerDocument;Da(t,"mouseup",this._onDrop),Da(t,"touchend",this._onDrop),Da(t,"pointerup",this._onDrop),Da(t,"touchcancel",this._onDrop),Da(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;bl=Xa(cl),wl=Xa(cl,n.draggable),al("drop",this,{evt:t}),dl=cl&&cl.parentNode,bl=Xa(cl),wl=Xa(cl,n.draggable),Ql.eventCanceled||(Tl=!1,Hl=!1,$l=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),rc(this.cloneId),rc(this._dragStartId),this.nativeDraggable&&(Da(document,"drop",this),Da(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ma&&Va(document.body,"user-select",""),Va(cl,"transform",""),t&&(Al&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),hl&&hl.parentNode&&hl.parentNode.removeChild(hl),(ul===dl||Cl&&"clone"!==Cl.lastPutMode)&&gl&&gl.parentNode&&gl.parentNode.removeChild(gl),cl&&(this.nativeDraggable&&Da(cl,"dragend",this),ec(cl),cl.style["will-change"]="",Al&&!Tl&&Ha(cl,Cl?Cl.options.ghostClass:this.options.ghostClass,!1),Ha(cl,this.options.chosenClass,!1),ll({sortable:this,name:"unchoose",toEl:dl,newIndex:null,newDraggableIndex:null,originalEvent:t}),ul!==dl?(bl>=0&&(ll({rootEl:dl,name:"add",toEl:dl,fromEl:ul,originalEvent:t}),ll({sortable:this,name:"remove",toEl:dl,originalEvent:t}),ll({rootEl:dl,name:"sort",toEl:dl,fromEl:ul,originalEvent:t}),ll({sortable:this,name:"sort",toEl:dl,originalEvent:t})),Cl&&Cl.save()):bl!==vl&&bl>=0&&(ll({sortable:this,name:"update",toEl:dl,originalEvent:t}),ll({sortable:this,name:"sort",toEl:dl,originalEvent:t})),Ql.active&&(null!=bl&&-1!==bl||(bl=vl,wl=yl),ll({sortable:this,name:"end",toEl:dl,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){al("nulling",this),ul=cl=dl=hl=pl=gl=ml=fl=Sl=El=Al=bl=wl=vl=yl=jl=kl=Cl=xl=Ql.dragged=Ql.ghost=Ql.clone=Ql.active=null,Fl.forEach((function(t){t.checked=!0})),Fl.length=Ol=_l=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":cl&&(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++)za(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||oc(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];za(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 za(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=rl.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Gl(n)},destroy:function(){al("destroy",this);var t=this.el;t[el]=null,Da(t,"mousedown",this._onTapStart),Da(t,"touchstart",this._onTapStart),Da(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Da(t,"dragover",this),Da(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Ll.splice(Ll.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!fl){if(al("hideClone",this),Ql.eventCanceled)return;Va(gl,"display","none"),this.options.removeCloneOnHide&&gl.parentNode&&gl.parentNode.removeChild(gl),fl=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(fl){if(al("showClone",this),Ql.eventCanceled)return;cl.parentNode!=ul||this.options.group.revertClone?pl?ul.insertBefore(gl,pl):ul.appendChild(gl):ul.insertBefore(gl,cl),this.options.group.revertClone&&this.animate(cl,gl),Va(gl,"display",""),fl=!1}}else this._hideClone()}},Bl&&ka(document,"touchmove",(function(t){(Ql.active||Tl)&&t.cancelable&&t.preventDefault()})),Ql.utils={on:ka,off:Da,css:Va,find:Fa,is:function(t,e){return!!za(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:Ja,closest:za,toggleClass:Ha,clone:Qa,index:Xa,nextTick:ic,cancelNextTick:rc,detectDirection:Xl,getChild:qa,expando:el},Ql.get=function(t){return t[el]},Ql.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&&(Ql.utils=ba(ba({},Ql.utils),t.utils)),rl.mount(t)}))},Ql.create=function(t,e){return new Ql(t,e)},Ql.version="1.15.3";var sc,ac,lc,cc,dc,hc,uc=[],pc=!1;function mc(){uc.forEach((function(t){clearInterval(t.pid)})),uc=[]}function gc(){clearInterval(hc)}var fc=Ja((function(t,e,n,o){if(e.scroll){var i,r=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=Ba(),d=!1;ac!==n&&(ac=n,mc(),sc=e.scroll,i=e.scrollFn,!0===sc&&(sc=Ya(n,!0)));var h=0,u=sc;do{var p=u,m=Ra(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=Va(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(!uc[h])for(var j=0;j<=h;j++)uc[j]||(uc[j]={});uc[h].vx==N&&uc[h].vy==A&&uc[h].el===p||(uc[h].el=p,uc[h].vx=N,uc[h].vy=A,clearInterval(uc[h].pid),0==N&&0==A||(d=!0,uc[h].pid=setInterval(function(){o&&0===this.layer&&Ql.active._onTouchMove(dc);var e=uc[this.layer].vy?uc[this.layer].vy*l:0,n=uc[this.layer].vx?uc[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(Ql.dragged.parentNode[el],n,e,t,dc,uc[this.layer].el)||Ka(uc[this.layer].el,n,e)}.bind({layer:h}),24))),h++}while(e.bubbleScroll&&u!==c&&(u=Ya(u,!1)));pc=d}}),30),vc=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 bc(){}function yc(){}bc.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=qa(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:vc},xa(bc,{pluginName:"revertOnSpill"}),yc.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:vc},xa(yc,{pluginName:"removeOnSpill"}),Ql.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?ka(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ka(document,"pointermove",this._handleFallbackAutoScroll):e.touches?ka(document,"touchmove",this._handleFallbackAutoScroll):ka(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?Da(document,"dragover",this._handleAutoScroll):(Da(document,"pointermove",this._handleFallbackAutoScroll),Da(document,"touchmove",this._handleFallbackAutoScroll),Da(document,"mousemove",this._handleFallbackAutoScroll)),gc(),mc(),clearTimeout(La),La=void 0},nulling:function(){dc=ac=sc=pc=hc=lc=cc=null,uc.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if(dc=t,e||this.options.forceAutoScrollFallback||Oa||Ea||Ma){fc(t,this.options,r,e);var s=Ya(r,!0);!pc||hc&&o===lc&&i===cc||(hc&&gc(),hc=setInterval((function(){var r=Ya(document.elementFromPoint(o,i),!0);r!==s&&(s=r,mc()),fc(t,n.options,r,e)}),10),lc=o,cc=i)}else{if(!this.options.bubbleScroll||Ya(r,!0)===Ba())return void mc();fc(t,this.options,Ya(r,!1),!1)}}},xa(t,{pluginName:"scroll",initializeByDefault:!0})}),Ql.mount(yc,bc);const wc={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(r.get("attributeNotPermitted",e||"")),xc.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:Bi}},xc={init:function(t){const e=Object.keys(wc);return this.opts=e.reduce(((e,n)=>(e[n]={...wc[n],...t[n]},e)),t),this},add:{attrs:t=>xc.opts.add.attr(t),options:t=>xc.opts.add.option(t),conditions:t=>(t.template={if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]},xc.opts.add.condition(t))},click:{btn:t=>xc.opts.click.btn(t)},save:{form:t=>(xc.opts.sessionStorage&&Hi.set(j,t),Yr.formeoSaved({formData:t}),xc.opts.save.form(t))}},Cc=Object.freeze({type:"field",displayType:"slider"}),Sc=t=>({transform:`translateX(${t?`${t}px`:0})`});class Ec{constructor(t){n(this,"toggleTabbedLayout",(()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t})),n(this,"resizePanels",(()=>{this.toggleTabbedLayout();const t=this.panelsWrap.style,e=kd.getStyle(this.currentPanel,"height");return t.height=e,e})),this.opts=Ti(Cc,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const e=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(e),window.clearTimeout(i)}),T)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(kd.getStyle(t,"width"))>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||Cc.displayType,this.panelDisplay}createPanelsWrap(){const t=kd.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 Wr.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Ql.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),kd.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",kd.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:r.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:kd.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:r.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:kd.icon("triangle-left")};return kd.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 kd.removeClasses(o,"active-panel"),kd.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=P,animate:s=!this.isTabbed})=>{const a=[Sc(r.panel),Sc(t.panel)],l=[Sc(r.nav),Sc(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=kd.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 Oc="f-autocomplete",_c="highlight-component";let Mc,Nc=Date.now();const Ac=({name:t,id:e,...n})=>["config.label","attrs.id","meta.id"].reduce(((t,e)=>(t||(t=n.get(e)),t)),null)||"external"===t&&((...t)=>r.get(t.join("."))||Tr(t.join(" ")))(t,e);class jc{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=kd.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=kd.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=kd.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:`${Oc}-display-field`,value:this.label||this.value,placeholder:r.get(`${this.i18nKey}.${this.key}.placeholder`)}}),this.hiddenField=kd.create({tag:"input",attrs:{type:"hidden",className:this.className,value:this.value}}),this.list=kd.create({tag:"ul",attrs:{className:`${Oc}-list`}}),this.dom=kd.create({children:[this.displayField,this.hiddenField,this.list],className:this.className,action:{onRender:()=>{const t=this.value&&Ad.getAddress(this.value);this.label=t&&Ac(t),this.label&&(this.displayField.value=this.label),this.updateOptions()}}}),this.dom}updateOptions(){const t=Date.now();t-Nc>T&&(kd.empty(this.list),this.generateOptions(),Nc=t);(Mc||this.generateOptions()).forEach((t=>this.list.appendChild(t)))}generateOptions(){const t=(t=>{const e=[],n=Ad.flatList();return Object.entries(n).map((([n,o])=>{const i=Ac(o);if(i){const r={tag:"span",content:` ${Tr(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 kd.makeOption([n,[`${i} `,l,r]],t)}})).filter(Boolean)})(),e=t=>{const e=`${Oc}-list-item`;return t.classList.contains(e)||(t=t.parentElement),t};return Mc=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:`${Oc}-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 kd.create(i)})),Mc}hideList(t=this.list){qr.slideUp(t,P),this.removeHighlight()}showList(t,e=this.list){this.selectOption(t),qr.slideDown(e,P)}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=Ad.getAddress(t);e.dom&&e.dom.classList.remove(_c)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(_c);for(let e=0;e<t.length;e++)t[e].classList.remove(_c)}highlightComponent(t){const{dataset:{value:e}}=t;if(e){const t=Ad.getAddress(e);t.dom&&t.dom.classList.add(_c)}}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=Ii(t),n={"field.property":V,...I},o=e?(i=t,Ad.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,i])=>{if("id"!==o){const s={tag:"option",content:r.get(`${t}.${o}`)||o.toLowerCase(),attrs:{value:i}};e===i&&(s.attrs.selected=!0),n.push(kd.create(s))}return n}),[])},Dc=(t,e)=>{kd.empty(t),e.forEach((e=>t.add(e)))},Pc=({key:t,value:e,type:n="text",checked:o})=>{const i={tag:"input",attrs:{type:n,value:e,placeholder:r.get(`${t}.placeholder`)||Tr(t)},className:t.replace(/\./g,"-"),config:{}};return o&&(i.attrs.checked=!0),i},Tc=t=>{const e=r.get(t);if(e)return e;const n=t.split(".");return r.get(n[n.length-1])},zc={autocomplete:(t,e,n)=>new jc(t,e,n),string:(t,e)=>Pc({key:t,value:e}),boolean:(t,e)=>Pc({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:e}),number:(t,e)=>Pc({key:t,value:e,type:"number"}),array:(t,e=[])=>({tag:"select",attrs:{placeholder:Tc(`placeholder.${t}`)},className:t.replace(/\./g,"-"),options:e}),object:t=>Object.entries(t).map((([t,e])=>zc[kd.childType(e)](t,e)))},Lc=["selected","checked"],$c={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 Hc{constructor({key:t,data:e,index:o,field:i}){n(this,"generateConditionFields",((t,e)=>{const n={tag:"label",className:`condition-label ${t}-condition-label`,content:r.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=Hr(r,H.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(" ")}`}}))})),n(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)}),D)},o=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.removeAttribute("style")})),clearTimeout(e)}),D)},i=new Map([["condition-source",t=>{const i=e("condition-sourceProperty"),r=i[0],s=Ii(t.value)?t.value:"field.property",a=kc(s,r.value);return Dc(r,a),t.value?o(i):n(i)}],["condition-target",t=>{const i=e("condition-targetProperty");return Vi(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)}))})),n(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=zc.array(`condition.${t}`);i.action={change:c,onRender:t=>c({target:t})};const r=kd.create(i);return Dc(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};Yr.formeoUpdated(o),Ad.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=zc.autocomplete(`condition.${e}`,t,n);return Ad.setConditionMap(t,i),o.addEvent("onChange",(t=>{Ad.removeConditionMap(Ad.getAddress(a)),c(t),Ad.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=zc.string("condition.value",t);return e.action={input:c},kd.create(e)},assignment:t=>l("assignment",t)};if(d[t])return d[t](e)})),this.itemValues=Hr(Object.entries(e),Lc,"0");const[s,a]=t.split(".");this.field=i,this.itemKey=t,this.itemIndex=o,this.panelName=s,this.isDisabled=i.isDisabledProp(a,s),this.isHidden=this.isDisabled&&i.config.panels[s].hideDisabled,this.isLocked=i.isLockedProp(a,s),this.dom=kd.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:()=>{qr.slideUp(this.dom,250,(t=>{this.field.remove(this.itemKey),kd.remove(t),this.field.resizePanelWrap()}))}},content:kd.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=kd.childType(e)||"string",o={config:{},attrs:{},...zc[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&&Tc(r),labelAfter:!1},o.attrs={...o.attrs,name:"checkbox"===o.attrs.type?`${a}[]`:a,id:s,disabled:this.isDisabled,locked:this.isLocked},o.action={...$c[n](i,this.field)},o}}class Vc{constructor(t,e,o){n(this,"addAttribute",((t,e)=>{const n=zr(t),o=`attrs.${n}`;r.current[o]||r.put(o,Br(t)),"string"==typeof e&&["true","false"].includes(e)&&(e=JSON.parse(e)),this.field.set(`attrs.${t}`,e);const i=this.props.querySelector(`.field-attrs-${n}`),s=new Hc({key:o,data:{[n]:e},field:this.field});i?this.props.replaceChild(s.dom,i):this.props.appendChild(s.dom),this.field.resizePanelWrap()})),n(this,"addOption",(()=>{const t=this.field.data.meta.id,e=this.field.get("options"),n="select"===t?"option":t,o=r.get("newOptionLabel",{type:n})||"New Option",i=`options.${this.data.length}`,s={...e.length?jr(e[e.length-1]):{},label:o,value:zr(o)},a=new Hc({key:i,data:s,field:this.field,index:this.props.children.length});this.editPanelItems.push(a),this.props.appendChild(a.dom),this.field.set(i,s),this.field.resizePanelWrap()})),n(this,"addCondition",(t=>{const e=`conditions.${this.field.get("conditions").length}`,n=this.props.querySelector(`.field-${e.replace(".","-")}`),o=new Hc({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=kd.childType(t),this.data="object"===this.type?Object.entries(t):t,this.name=e,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:r.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 Hc({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 kd.create(e)}createEditButtons(){const t=this,e=this.name,n=r.get(`panelEditButtons.${e}`),o={attrs:t.addAttribute,options:t.addOption,conditions:t.addCondition};return{className:"panel-action-buttons",content:[{...kd.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:n=>{const i={btnCoords:kd.coords(n.target),addAction:o[e]};"attrs"===e&&(i.isDisabled=t.field.isDisabledProp,i.isLocked=t.field.isLockedProp,i.message={attr:r.get(`action.add.${e}.attr`),value:r.get(`action.add.${e}.value`)});const s=Tr(e),a=new window.CustomEvent(`onAdd${s}`,{detail:i});xc.add[e](i),document.dispatchEvent(a)}}}]}}}class Ic extends fa{constructor(t,e={},o){super(t,{...e,id:e.id||Pi()}),n(this,"mutationHandler",(t=>t.map((t=>{})))),n(this,"remove",(t=>{if(t){const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?Lr(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 Vr(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(Ad.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),Ad[`${this.name}s`].delete(this.id)})),n(this,"emptyClass",(()=>this.dom.classList.toggle("empty",!this.children.length))),n(this,"getComponentTag",(()=>kd.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&kd.icon("component-corner",["bottom-left"]),kd.icon(`handle-${this.name}`),Tr(this.name),(this.isColumn||this.isRow)&&kd.icon("component-corner",["bottom-right"])].filter(Boolean)}))),n(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[kd.childType(t)](this.dom)})),n(this,"loadChildren",((t=this.data.children)=>t.map((t=>this.addChild({id:t}))))),n(this,"saveChildOrder",(()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t})),n(this,"onSort",(()=>this.saveChildOrder())),n(this,"onEnd",(({to:{parentElement:t},from:{parentElement:e}})=>{null==t||t.classList.remove(`hovering-${ki(t)}`),null==e||e.classList.remove(`hovering-${ki(e)}`)})),n(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)))}))})),n(this,"value",((t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!V[i]].some(Boolean)?t:e?o.set(V[i],e):o.get(V[i])})),n(this,"getResult",(t=>({"=":(t,e,n)=>t.set(e,n)}[t]))),n(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)}})))),n(this,"execResults",(t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)})),n(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)}})))),n(this,"cloneData",(()=>{const t={...zi(this.data),id:Pi()};return"field"!==this.name&&(t.children=[]),t})),n(this,"clone",((t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),e})),n(this,"createChildWrap",(t=>kd.create({tag:"ul",attrs:{className:"children"},children:t}))),this.id=this.data.id,this.name=t,this.config=Ad[`${this.name}s`].config,Ti(this.config,e.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})=>{Ad.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),Ad.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...kd.btnTemplate({content:kd.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`);qr.slideToggle(i,D,t),"field"===this.name&&(qr.slideToggle(this.preview,D,!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}`)=>({...kd.btnTemplate({content:kd.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...kd.btnTemplate({content:kd.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...kd.btnTemplate({content:kd.icon(t)}),className:["item-edit-toggle"],meta:{id:"edit"},action:{click:t=>{this.toggleEdit()}}}),remove:(t="remove")=>({...kd.btnTemplate({content:kd.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:(t,e)=>{qr.slideUp(this.dom,D,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...kd.btnTemplate({content:kd.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 M.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${w[t]}`);return e&&kd.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=_.get(this.name);return Ir(t,(t=>Ad.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=Pi()}=i,a=_.get(this.name);if(!a)return null;const l=`${a}s`,c=Ad.getAddress(`${l}.${s}`)||Ad[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(l)||(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)]]),c={controls:()=>{const{controlData:t}=sd.get(n.id),{meta:{id:e}}=t,i=e.startsWith("layout-")?e.replace(/^layout-/,""):"field",r=Nr({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)();kd.remove(n);return s(t,o)},row:()=>{const t=(a.get({stage:-1,row:0,column:1}[s])||Bi)();return null==t?void 0:t({id:n.id},o)},column:()=>{const t=(a.get({stage:-2,row:-1}[s])||Bi)();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(h)&&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&&kd.onRender(this.dom,t.onRender)}set config(t){const e=Nr(this.data,"meta.id"),n=[Nr(t,"all"),e&&Nr(t,e),Nr(t,this.id)].reduce(((t,e)=>e?Ti(t,e):t),this.configVal);this.configVal=n}get config(){return this.configVal}getComponent(t){const[e,n]=t.split("."),o=Ad[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===b.row}get isColumn(){return this.name===b.column}get isField(){return this.name===b.field}}class Fc extends Ic{constructor(t=Object.create(null)){super("field",{conditions:[{if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]}],...t}),n(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)}),D)})),n(this,"updatePreview",Fi((()=>{if(!this.preview.parentElement)return null;this.updateLabel();const t=kd.create(this.fieldPreview(),!0);this.preview.parentElement.replaceChild(t,this.preview),this.preview=t}),D)),n(this,"isDisabledProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get(`config.disabled${Tr(e)}`)).includes(t)})),n(this,"isLockedProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get(`config.locked${Tr(e)}`)).includes(t)})),this.label=kd.create(this.labelConfig),this.preview=kd.create({}),this.editPanels=[];const e=this.getActionButtons(),o=this.actionButtons.some((t=>{var e;return"edit"===(null==(e=t.meta)?void 0:e.id)}));let i={tag:"li",attrs:{className:u},id:this.id,children:[this.label,this.getComponentTag(),e,o&&this.fieldEdit,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:r.get("field")}};i=kd.create(i),this.observe(i),this.dom=i,this.isEditing=!1,this.onRender(i)}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=Ad.getConditionMap(`fields.${this.id}`);if(i)return i.updateConditionSourceLabel(`${this.name}s.${this.id}`,n?o:e)}}},e&&kd.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=kd.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=Di([...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=kd.childType(e);if(t.includes(n)){const t=new Vc(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 Ec(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",kd.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=zi(this.data),{action:n={}}=sd.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:kd.create(e,!0),action:this.defaultPreviewActions}}}const Bc={js:new Set,css:new Set},Rc=(t,e)=>{t.removeEventListener("load",Rc),t.rel="stylesheet",e(t.src)},Wc=(t,e)=>{t.removeEventListener("load",Wc),e(t.src)},qc=t=>new Promise(((e,n)=>{if(Bc.js.has(t))return e(t);Bc.js.add(t);const o=kd.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:`//${t.replace(/^https?:\/\//,"")}`},action:{load:()=>Wc(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Uc=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(Bc.css.has(t))return e(t);Bc.css.add(t);const o=kd.create({tag:"link",attrs:{rel:"preload",href:t,as:"style"},action:{load:()=>Rc(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Xc=t=>("string"==typeof t?Promise.resolve(t):t.text()).then((t=>{const e="formeo-sprite";let n=document.getElementById(e);return n||(n=kd.create({id:e,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(n,document.body.childNodes[0])),n})),Gc=(t,e,n=Ri)=>new Promise(((o,i)=>fetch(t).then((t=>o(e?e(t):t))).catch((t=>i(new Error(n(t))))))),Yc={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>qc(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Uc(t)));return Promise.all(e)}},Zc=t=>{const e=Object.entries(t).map((([t,e])=>Yc[t](e)));return Promise.all(e)};class Jc{constructor({events:t={},dependencies:e={},controlAction:o,...i}){n(this,"controlCache",new Set),this.events=t,this.controlData=i,this.controlAction=o,this.dependencies=e,this.id=i.id||Pi()}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:kd.icon(t.icon)},n],action:{focus:({target:t})=>{const e=t.closest(`.${l}`);return e&&sd.panels.nav.refresh($r(e))},click:({target:t})=>{sd.addElement(t.parentElement.id)}}};return kd.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 i=r.locale,s=null==(n=this.definition)?void 0:n.i18n,a=(null==s?void 0:s[i])||{};return((null==(o=a[t])?void 0:o.call(a))??a[t])||r.get(t,e)}}const Kc=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}];const Qc=(t,e=3)=>Array.from({length:e},((t,e)=>e+1)).map((e=>{const n="checkbox"===t?"checked":"selected";return{label:r.get("labelCount",{label:Tr(t),count:e}),value:`${t}-${e}`,[n]:!e}}));const td=[class extends Jc{constructor(){super({tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:r.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:r.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 Jc{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:r.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:r.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:r.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends Jc{constructor(){super({tag:"textarea",config:{label:r.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends Jc{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:r.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:r.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends Jc{constructor(){super({tag:"select",config:{label:r.get("controls.form.select")},attrs:{required:!1,className:""},meta:{group:"common",icon:"select",id:"select"},options:Qc("option")})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:r.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:Qc("checkbox",1)})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:r.get("controls.form.radio-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:Qc("radio")})}}],ed=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),nd="controls.html.header";const od=[class extends Jc{constructor(){super({tag:ed[0],attrs:{tag:ed.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:r.get(nd),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:r.get(nd),action:{onRender:t=>{},click:t=>{}}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(nd)}},class extends Jc{constructor(){super({tag:"p",attrs:{className:""},config:{label:r.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 Jc{constructor(){super({tag:"hr",config:{label:r.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends Jc{constructor(t){super(Ti({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))}}],id=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"}}),rd=[...td,...od,...Kc];const sd=new class{constructor(){n(this,"groupLabel",(t=>r.get(t)||t||"")),n(this,"addElement",(t=>{const e=Nr(this.get(t),"controlData"),{meta:{group:n,id:o}}=e,i={row:()=>Cd.active.addChild(),column:()=>i.row().addChild(),field:t=>i.column().addChild(t)};return"layout"!==n?i.field(e):i[o.replace("layout-","")]()})),n(this,"applyOptions",(async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=Ti(id,t);return this.container=e,this.groupOrder=Di(o.concat(["common","html","layout"])),this.options=i,Promise.all(this.registerControls([...rd,...n]))})),this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${l}`);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 Jc(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=Hr(t,this.groupOrder,"id"),t=t.filter((t=>ji(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:l,id:`${t.id}-${l}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=Di(e.concat(t.elementOrder));t.elementOrder=n}return e=Hr(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=[ji(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=zi(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={...kd.btnTemplate({content:[kd.icon("bin"),r.get("clear")],title:r.get("clearAll")}),className:["clear-form"],action:{click:t=>{Sd.size?(Yr.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:r.get("confirmClearAll"),clearAllAction:()=>{Cd.clearAll().then((()=>{const e={src:t.target};Yr.formeoCleared(e)}))},btnCoords:kd.coords(t.target)}}),document.dispatchEvent(Yr.confirmClearAll)):window.alert(r.get("cannotClearFields"))}}},e={...kd.btnTemplate({content:[kd.icon("floppy-disk"),r.get("save")],title:r.get("save")}),className:["save-form"],action:{click:({target:t})=>{const{formData:e}=Ad,n={action:()=>{},coords:kd.coords(t),message:"",button:t};return xc.click.btn(n),xc.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 Ec({panels:e,type:"controls",displayType:o});const i=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],s=kd.create({className:i,content:[this.panels.panelNav,this.panels.panelsWrap]}),a=["formeo-controls"];t&&a.push("formeo-sticky");const l=kd.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(kd.toggleElementsByStr(n,t),e){const e=r.get("controls.filteringTerm",t);l.classList.add("filtered"),o?o.textContent=e:(o=kd.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 r=c.length-1;r>=0;r--){const t=`formeo-controls-${c[r]}`;this.options.sortable||window.localStorage.removeItem(t),Ql.create(c[r],{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 Fc(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 ad extends fa{constructor(){super(...arguments),n(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))),n(this,"get",(t=>t?Nr(this.data,t):this.add())),n(this,"add",((t,e=Object.create(null))=>{const n=t||Pi(),o=this.Component({...e,id:n});return this.set(n,o),this.active=o,o})),n(this,"remove",(t=>(Array.isArray(t)?t.forEach((t=>{this.get(t).remove()})):this.get(t).remove(),this.data))),n(this,"delete",(t=>(delete this.data[t],t))),n(this,"clearAll",((t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)})),n(this,"conditionMap",new Map)}set config(t){this.configVal=Ti(this.configVal,zi(t))}get config(){return this.configVal}}class ld extends Ic{constructor(t,e){super("stage",{...Object.freeze({children:[]}),...t},e);const n=this.createChildWrap();this.dom=kd.create({attrs:{className:[c,"empty"],id:this.id},children:n}),Ql.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:()=>{cd.active=this},onSort:this.onSort.bind(this),draggable:`.${d}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),qr.slideUp(this.dom,D,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),qr.slideDown(this.dom,D)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const cd=new class extends ad{constructor(t){super("stages",t)}Component(t){return new ld(t)}};class dd extends Ic{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[d]}),...t}),n(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(B);const t=n.dom,o=$i(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),P);document.dispatchEvent(Yr.columnResized)}this.updateColumnPreset()})),n(this,"updateColumnPreset",(()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>kd.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)})),n(this,"setColumnWidths",(t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))}));const e=this.createChildWrap();this.dom=kd.create({tag:"li",className:[d,"empty"],dataset:{hoverTag:r.get("row"),editingHoverTag:r.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),Ql.create(e,{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:`.${h}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:r.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:r.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:r.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:r.get("row.makeInputGroup"),description:r.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=kd.formGroup([t,n]),i={tag:"label",content:r.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=kd.create(this.columnPresetControlConfig);const s={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},a=[e,"hr",o,"hr",kd.formGroup([i,s],"row")];return kd.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=a.map((t=>kd.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=N.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:p}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:r.get("defineColumnLayout"),className:m},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const hd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const ud=new class extends ad{constructor(t){super("rows",t),this.config={all:hd}}Component(t){return new dd(t)}};class pd{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=kd.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(`.${d}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(g),this.columnPreset=o.querySelector(`.${m}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(B,""),n.className=n.className.replace(B,""),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(Li(e,this.rowWidth)),i=parseFloat(Li(n,this.rowWidth));return o<10||i<10?null:{colWidth:$i(o.toFixed(1)),siblingColWidth:$i(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(),Ad.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),Ad.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(g),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(g),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${p}`);const n=this.row.querySelector(".children").children,o=Ir(n,(t=>Li(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=kd.create({tag:"option",attrs:{className:p,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const md=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[kd.icon("triangle-down"),kd.icon("triangle-up")]}),gd=()=>({className:"column-edit group-config"});class fd extends Ic{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[h]}),...t}),n(this,"refreshFieldPanels",(()=>{this.children.forEach((t=>t.panels.nav.refresh()))})),n(this,"setWidth",(t=>(this.dom.dataset.colWidth=t,this.dom.style.width=t,this.set("config.width",t))));const e=this.createChildWrap();this.dom=kd.create({tag:"li",className:[h,"empty"],dataset:{hoverTag:r.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),gd(),md(new pd),e]}),this.processConfig(this.dom),Yr.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Ql.create(e,{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:`.${u}`,handle:".item-move"})}processConfig(t){const e=Wr.get(this.data,"config.width");e&&(t.dataset.colWidth=e,t.style.width=e)}}const vd={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const bd=new class extends ad{constructor(t){super("columns",t),this.config={all:vd}}Component(t){return new fd(t)}},yd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}};const wd=new class extends ad{constructor(t){super("fields",t),n(this,"get",(t=>{let e=t&&Nr(this.data,t);if(!e){const n=sd.get(t);n&&(e=this.add(null,n.controlData))}return e})),this.config={all:yd}}Component(t){return new Fc(t)}};const xd=new class extends ad{constructor(t){super("externals",t)}Component(t){return new Ic("external",t)}},Cd=cd,Sd=ud,Ed=bd,Od=wd,_d=sd,Md=xd,Nd={id:Pi()};const Ad=new class extends fa{constructor(t){super("components"),n(this,"sessionFormData",(()=>{var t;if(null==(t=this.opts)?void 0:t.sessionStorage)return Hi.get(j)})),n(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={[Pi()]:{}},rows:i,columns:r,fields:s,id:a=Pi()}={...this.sessionFormData(),...n};this.set("id",a),this.add("stages",Cd.load(o)),this.add("rows",Sd.load(i)),this.add("columns",Ed.load(r)),this.add("fields",Od.load(s)),this.add("externals",Md.load(e.external));for(const l of Object.values(this.get("stages")))l.loadChildren();return this.data})),this.opts=t,this.data=Nd,this.disableEvents=!0,this.stages=Cd,this.rows=Sd,this.columns=Ed,this.fields=Od,this.controls=_d,this.externals=Md}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:cd.getData(),rows:ud.getData(),columns:bd.getData(),fields:wd.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;Cd.config=e,Sd.config=n,Ed.config=o,Od.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(!Vi(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(Vi(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.get(e[1])}}setConditionMap(t,e){if(Vi(t)){const n=t.split(".");return n.every((t=>Boolean(t)))&&this[n[0]].conditionMap.set(n[1],e)}}removeConditionMap(t){if(Vi(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.delete(e[1])}}},jd={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="${R}${t}">${t}</i>`};const kd=new class{constructor(){n(this,"render",(t=>(t.id=`f-${t.id||Pi()}`,this.create(t)))),n(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:[Wr.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 Wr.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(Wr.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=Wr.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})),n(this,"onRender",((t,e)=>{t.parentElement?e(t):window.requestAnimationFrame((()=>this.onRender(t,e)))})),n(this,"toggleElementsByStr",((t,e)=>{const n=[];return kd.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n})),n(this,"elementsContainText",((t,e,n)=>{const o=[];return Vr(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());null==n||n(t,i),i&&o.push(t)})),o})),n(this,"generateOption",(({type:t="option",label:e,value:n,i:o=0,selected:i})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:n||`${t}-${o}`,["option"===t?"selected":"checked"]:i||!o},config:{label:e||r.get("labelCount",{label:r.get("option"),count:o})}}))),n(this,"makeOption",(([t,e],n,o)=>{const i={value:t,label:r.get(`${o}.${e}`)||e};return t===n&&(i.selected=!0),i})),n(this,"requiredMark",(()=>({tag:"span",className:"text-error",children:"*"}))),n(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)}})),n(this,"btnTemplate",(({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e}))),n(this,"isControls",(t=>ki(t)===l)),n(this,"isStage",(t=>ki(t)===c)),n(this,"isRow",(t=>ki(t)===d)),n(this,"isColumn",(t=>ki(t)===h)),n(this,"isField",(t=>ki(t)===u)),n(this,"asComponent",(t=>Ad[`${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=Ti(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:kd.onRender,render:kd.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(R,"")]=kd.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=jd[kd.options.iconFont])?void 0:n.call(jd,t))||t}processAttrs(t,e,n){const{attrs:o={}}=t;n||!o.name&&this.isInput(t.tag)&&e.setAttribute("name",Pi(t));for(const i of Object.keys(o)){const t=Wr.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||Pi(),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=Wr.get(t,"attrs.type"),n=Wr.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}label(t,e){const n=Wr.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?Ad.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,Wr.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)}};Wr.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");qr.slideUp(t,600,(()=>{kd.empty(t),t.classList.remove("removing-all-fields"),kd.emptyClass(t),qr.slideDown(t,300)}))}toggleSortable(t,e){const n=ki(t);if(!n)return;const o=ki(t.parentElement),i=kd[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(f.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}};r.addLanguage("en-US",void 0);const Dd={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:Rr(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"}}}};let Pd=class{constructor({formData:t,...e},n){const o=Ti(Dd.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,kd.setOptions=c,Ad.config=a,this.userFormData=n||t,this.Components=Ad,this.dom=kd,Yr.init({debug:s,...r}),xc.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)?a.filter((({name:e})=>-1!==t.indexOf(e))):a;Promise.all(e.map((({src:t})=>qc(t))))})(this.opts.polyfills),this.opts.style&&e.push(Uc(this.opts.style)),this.opts.svgSprite?e.push(Gc(this.opts.svgSprite,Xc,(()=>Gc("https://draggable.github.io/formeo/assets/img/formeo-sprite.svg",Xc)))):e.push(Xc('<?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(r.init({...this.opts.i18n,locale:null==(t=window.sessionStorage)?void 0:t.getItem(k)})),Promise.all(e)}init(){sd.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=Ad.get("id"),this.i18n={setLang:t=>{var e;null==(e=window.sessionStorage)||e.setItem(k,t);r.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(Ad.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))]};r.current.dir&&(t.attrs.dir=r.current.dir,kd.dir=r.current.dir),this.editor=kd.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(kd.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Yr.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Yr.formeoLoaded)}};const Td=t=>{const e=t.match(F);return(null==e?void 0:e[0])||t},zd=t=>t.replace(F,Pi());let Ld=class{constructor(t,e={}){n(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=kd.render(n),this.applyConditions();const o=this.container.querySelector(".formeo-render");o?o.replaceWith(this.renderedForm):this.container.appendChild(this.renderedForm)})),n(this,"orderChildren",((t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]))),n(this,"prefixId",(t=>"f-"+t)),n(this,"processColumn",(({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`}))),n(this,"processRows",(t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]))),n(this,"cacheComponent",(t=>(this.components[Td(t.id)]=t,t))),n(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:Pi(),className:i,children:s}})),n(this,"cloneComponentData",(t=>{const{children:e=[],id:n,...o}=this.components[t];return Object.assign({},o,{id:zd(n),children:e.length&&e.map((({id:t})=>this.cloneComponentData(Td(t))))})})),n(this,"addButton",(t=>kd.render({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=kd.render(this.cloneComponentData(t));n.insertBefore(o,n.lastChild),o.appendChild(kd.render(kd.btnTemplate({className:"remove-input-group",children:kd.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()}})))}}}))),n(this,"processColumns",(t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t)))))),n(this,"processFieldsOrig",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>this.cacheComponent(Object.assign({},e,{id:this.prefixId(t)})))))),n(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=Ti({action:n},e);return this.cacheComponent({...i,id:this.prefixId(t)})})))),n(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(Vi(e)){this.getComponents(e).forEach((t=>{const e=$d(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)))}))}}))}))}))})),n(this,"evaluateCondition",(({sourceProperty:t,targetProperty:e,comparison:n,target:o},i)=>{var r;const s={equals:ga,notEquals:(t,e)=>!ga(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},a=String(i.target[t]),l=String(Vi(o)?this.getComponent(o)[e]:o);return null==(r=s[n])?void 0:r.call(s,a,l)})),n(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(Vi(e)){const n=this.getComponent(e);n&&void 0===n._required&&(n._required=n.required),null==(i=r[t])||i.call(r,n)}})),n(this,"getComponent",(t=>{const e=t.slice(t.indexOf(".")+1);return Ii(t)?this.external[e]:this.renderedForm.querySelector(`#f-${e}`)})),n(this,"getComponents",(t=>{const e=[],n=t.slice(t.indexOf(".")+1);return Ii(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=e,this.external=i,this.dom=kd,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=c,kd.render(t))))}};const $d=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=Pd,window.FormeoRenderer=Ld);const Hd=Pd,Vd=Ld;t.FormeoEditor=Hd,t.FormeoRenderer=Vd,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
14
|
+
*/function va(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 ba(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?va(Object(n),!0).forEach((function(e){wa(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):va(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ya(t){return(ya="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 wa(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ca(){return Ca=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},Ca.apply(this,arguments)}function Ea(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 Sa(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Oa=Sa(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),xa=Sa(/Edge/i),Na=Sa(/firefox/i),_a=Sa(/safari/i)&&!Sa(/chrome/i)&&!Sa(/android/i),Aa=Sa(/iP(ad|od|hone)/i),ja=Sa(/chrome/i)&&Sa(/android/i),Pa={capture:!1,passive:!1};function Ta(t,e,n){t.addEventListener(e,n,!Oa&&Pa)}function Da(t,e,n){t.removeEventListener(e,n,!Oa&&Pa)}function ka(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 $a(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function La(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&ka(t,e):ka(t,e))||o&&t===n)return t;if(t===n)break}while(t=$a(t))}return null}var Ia,Ma=/\s+/g;function Fa(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(Ma," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(Ma," ")}}function Ra(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function Wa(t,e){var n="";if("string"==typeof t)n=t;else do{var o=Ra(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Ba(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 za(){var t=document.scrollingElement;return t||document.documentElement}function qa(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==za()?(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,!Oa))do{if(i&&i.getBoundingClientRect&&("none"!==Ra(i,"transform")||n&&"static"!==Ra(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(Ra(i,"border-top-width")),a-=h.left+parseInt(Ra(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=Wa(i||t),f=p&&p.a,m=p&&p.d;p&&(l=(s/=m)+(d/=m),c=(a/=f)+(u/=f))}return{top:s,left:a,bottom:l,right:c,width:u,height:d}}}function Ua(t,e,n){for(var o=Va(t,!0),i=qa(t)[e];o;){if(!(i>=qa(o)[n]))return o;if(o===za())break;o=Va(o,!1)}return!1}function Xa(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==Ql.ghost&&(o||s[r]!==Ql.dragged)&&La(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function Ha(t,e){for(var n=t.lastElementChild;n&&(n===Ql.ghost||"none"===Ra(n,"display")||e&&!ka(n,e));)n=n.previousElementSibling;return n||null}function Ya(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Ql.clone||e&&!ka(t,e)||n++;return n}function Ga(t){var e=0,n=0,o=za();if(t)do{var i=Wa(t),r=i.a,s=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*s}while(t!==o&&(t=t.parentNode));return[e,n]}function Va(t,e){if(!t||!t.getBoundingClientRect)return za();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Ra(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return za();if(o||e)return n;o=!0}}}while(n=n.parentNode);return za()}function Ja(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 Ka(t,e){return function(){if(!Ia){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),Ia=setTimeout((function(){Ia=void 0}),e)}}}function Za(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Qa(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 tl(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if(La(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=qa(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 el="Sortable"+(new Date).getTime();function nl(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==Ra(t,"display")&&t!==Ql.ghost){e.push({target:t,rect:qa(t)});var n=ba({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=Wa(t,!0);o&&(n.top-=o.f,n.left-=o.e)}t.fromRect=n}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(e,{target:t}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof n&&n());var i=!1,r=0;e.forEach((function(t){var e=0,n=t.target,s=n.fromRect,a=qa(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,u=Wa(n,!0);u&&(a.top-=u.f,a.left-=u.e),n.toRect=a,n.thisAnimationDuration&&Ja(l,a)&&!Ja(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)),Ja(a,s)||(n.prevFromRect=s,n.prevToRect=a,e||(e=o.options.animation),o.animate(n,d,a,e)),e&&(i=!0,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),i?t=setTimeout((function(){"function"==typeof n&&n()}),r):"function"==typeof n&&n(),e=[]},animate:function(t,e,n,o){if(o){Ra(t,"transition",""),Ra(t,"transform","");var i=Wa(this.el),r=i&&i.a,s=i&&i.d,a=(e.left-n.left)/(r||1),l=(e.top-n.top)/(s||1);t.animatingX=!!a,t.animatingY=!!l,Ra(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),Ra(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Ra(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){Ra(t,"transition",""),Ra(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var ol=[],il={initializeByDefault:!0},rl={mount:function(t){for(var e in il)il.hasOwnProperty(e)&&!(e in t)&&(t[e]=il[e]);ol.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),ol.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";ol.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](ba({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](ba({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in ol.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,Ca(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 ol.forEach((function(o){"function"==typeof o.eventProperties&&Ca(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return ol.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var sl=["evt"],al=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=Ea(n,sl);rl.pluginEvent.bind(Ql)(t,e,ba({dragEl:cl,parentEl:dl,ghostEl:ul,rootEl:hl,nextEl:pl,lastDownEl:fl,cloneEl:ml,cloneHidden:gl,dragStarted:jl,putSortable:El,activeSortable:Ql.active,originalEvent:o,oldIndex:vl,oldDraggableIndex:yl,newIndex:bl,newDraggableIndex:wl,hideGhostForTarget:Vl,unhideGhostForTarget:Jl,cloneNowHidden:function(){gl=!0},cloneNowShown:function(){gl=!1},dispatchSortableEvent:function(t){ll({sortable:e,name:t,originalEvent:o})}},i))};function ll(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,s=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,u=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[el]){var m,g=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Oa||xa?(m=document.createEvent("Event")).initEvent(o,!0,!0):m=new CustomEvent(o,{bubbles:!0,cancelable:!0}),m.to=s||n,m.from=a||n,m.item=i||n,m.clone=r,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=u,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var b=ba(ba({},f),rl.getEventProperties(o,e));for(var y in b)m[y]=b[y];n&&n.dispatchEvent(m),g[v]&&g[v].call(e,m)}}(ba({putSortable:El,cloneEl:ml,targetEl:cl,rootEl:hl,oldIndex:vl,oldDraggableIndex:yl,newIndex:bl,newDraggableIndex:wl},t))}var cl,dl,ul,hl,pl,fl,ml,gl,vl,bl,yl,wl,Cl,El,Sl,Ol,xl,Nl,_l,Al,jl,Pl,Tl,Dl,kl,$l=!1,Ll=!1,Il=[],Ml=!1,Fl=!1,Rl=[],Wl=!1,Bl=[],zl="undefined"!=typeof document,ql=Aa,Ul=xa||Oa?"cssFloat":"float",Xl=zl&&!ja&&!Aa&&"draggable"in document.createElement("div"),Hl=function(){if(zl){if(Oa)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Yl=function(t,e){var n=Ra(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Xa(t,0,e),r=Xa(t,1,e),s=i&&Ra(i),a=r&&Ra(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+qa(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+qa(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var d="left"===s.float?"left":"right";return!r||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=o&&"none"===n[Ul]||r&&"none"===n[Ul]&&l+c>o)?"vertical":"horizontal"},Gl=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"==ya(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},Vl=function(){!Hl&&ul&&Ra(ul,"display","none")},Jl=function(){!Hl&&ul&&Ra(ul,"display","")};zl&&!ja&&document.addEventListener("click",(function(t){if(Ll)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ll=!1,!1}),!0);var Kl=function(t){if(cl){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,Il.some((function(t){var e=t[el].options.emptyInsertThreshold;if(e&&!Ha(t)){var n=qa(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[el]._onDragOver(n)}}var i,r,s},Zl=function(t){cl&&cl.parentNode[el]._isOutsideThisEl(t.target)};function Ql(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=Ca({},e),t[el]=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 Yl(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!==Ql.supportPointer&&"PointerEvent"in window&&!_a,emptyInsertThreshold:5};for(var o in rl.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in Gl(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&Xl,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ta(t,"pointerdown",this._onTapStart):(Ta(t,"mousedown",this._onTapStart),Ta(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ta(t,"dragover",this),Ta(t,"dragenter",this)),Il.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Ca(this,nl())}function tc(t,e,n,o,i,r,s,a){var l,c,d=t[el],u=d.options.onMove;return!window.CustomEvent||Oa||xa?(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||qa(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),u&&(c=u.call(d,l,s)),c}function ec(t){t.draggable=!1}function nc(){Wl=!1}function oc(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 ic(t){return setTimeout(t,0)}function rc(t){return clearTimeout(t)}Ql.prototype={constructor:Ql,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Pl=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,cl):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){Bl.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Bl.push(o)}}(n),!cl&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!_a||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=La(a,o.draggable,n,!1))&&a.animated||fl===a)){if(vl=Ya(a),yl=Ya(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return ll({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),al("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=La(l,o.trim(),n,!1))return ll({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),al("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!La(l,o.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,s=i.options,a=r.ownerDocument;if(n&&!cl&&n.parentNode===r){var l=qa(n);if(hl=r,dl=(cl=n).parentNode,pl=cl.nextSibling,fl=n,Cl=s.group,Ql.dragged=cl,Sl={target:cl,clientX:(e||t).clientX,clientY:(e||t).clientY},_l=Sl.clientX-l.left,Al=Sl.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,cl.style["will-change"]="all",o=function(){al("delayEnded",i,{evt:t}),Ql.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Na&&i.nativeDraggable&&(cl.draggable=!0),i._triggerDragStart(t,e),ll({sortable:i,name:"choose",originalEvent:t}),Fa(cl,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Ba(cl,t.trim(),ec)})),Ta(a,"dragover",Kl),Ta(a,"mousemove",Kl),Ta(a,"touchmove",Kl),Ta(a,"mouseup",i._onDrop),Ta(a,"touchend",i._onDrop),Ta(a,"touchcancel",i._onDrop),Na&&this.nativeDraggable&&(this.options.touchStartThreshold=4,cl.draggable=!0),al("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(xa||Oa))o();else{if(Ql.eventCanceled)return void this._onDrop();Ta(a,"mouseup",i._disableDelayedDrag),Ta(a,"touchend",i._disableDelayedDrag),Ta(a,"touchcancel",i._disableDelayedDrag),Ta(a,"mousemove",i._delayedDragTouchMoveHandler),Ta(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Ta(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(){cl&&ec(cl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Da(t,"mouseup",this._disableDelayedDrag),Da(t,"touchend",this._disableDelayedDrag),Da(t,"touchcancel",this._disableDelayedDrag),Da(t,"mousemove",this._delayedDragTouchMoveHandler),Da(t,"touchmove",this._delayedDragTouchMoveHandler),Da(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Ta(document,"pointermove",this._onTouchMove):Ta(document,e?"touchmove":"mousemove",this._onTouchMove):(Ta(cl,"dragend",this),Ta(hl,"dragstart",this._onDragStart));try{document.selection?ic((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if($l=!1,hl&&cl){al("dragStarted",this,{evt:e}),this.nativeDraggable&&Ta(document,"dragover",Zl);var n=this.options;!t&&Fa(cl,n.dragClass,!1),Fa(cl,n.ghostClass,!0),Ql.active=this,t&&this._appendGhost(),ll({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Ol){this._lastX=Ol.clientX,this._lastY=Ol.clientY,Vl();for(var t=document.elementFromPoint(Ol.clientX,Ol.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ol.clientX,Ol.clientY))!==e;)e=t;if(cl.parentNode[el]._isOutsideThisEl(t),e)do{if(e[el]){if(e[el]._onDragOver({clientX:Ol.clientX,clientY:Ol.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=$a(e));Jl()}},_onTouchMove:function(t){if(Sl){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=ul&&Wa(ul,!0),s=ul&&r&&r.a,a=ul&&r&&r.d,l=ql&&kl&&Ga(kl),c=(i.clientX-Sl.clientX+o.x)/(s||1)+(l?l[0]-Rl[0]:0)/(s||1),d=(i.clientY-Sl.clientY+o.y)/(a||1)+(l?l[1]-Rl[1]:0)/(a||1);if(!Ql.active&&!$l){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(ul){r?(r.e+=c-(xl||0),r.f+=d-(Nl||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Ra(ul,"webkitTransform",u),Ra(ul,"mozTransform",u),Ra(ul,"msTransform",u),Ra(ul,"transform",u),xl=c,Nl=d,Ol=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ul){var t=this.options.fallbackOnBody?document.body:hl,e=qa(cl,!0,ql,!0,t),n=this.options;if(ql){for(kl=t;"static"===Ra(kl,"position")&&"none"===Ra(kl,"transform")&&kl!==document;)kl=kl.parentNode;kl!==document.body&&kl!==document.documentElement?(kl===document&&(kl=za()),e.top+=kl.scrollTop,e.left+=kl.scrollLeft):kl=za(),Rl=Ga(kl)}Fa(ul=cl.cloneNode(!0),n.ghostClass,!1),Fa(ul,n.fallbackClass,!0),Fa(ul,n.dragClass,!0),Ra(ul,"transition",""),Ra(ul,"transform",""),Ra(ul,"box-sizing","border-box"),Ra(ul,"margin",0),Ra(ul,"top",e.top),Ra(ul,"left",e.left),Ra(ul,"width",e.width),Ra(ul,"height",e.height),Ra(ul,"opacity","0.8"),Ra(ul,"position",ql?"absolute":"fixed"),Ra(ul,"zIndex","100000"),Ra(ul,"pointerEvents","none"),Ql.ghost=ul,t.appendChild(ul),Ra(ul,"transform-origin",_l/parseInt(ul.style.width)*100+"% "+Al/parseInt(ul.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;al("dragStart",this,{evt:t}),Ql.eventCanceled?this._onDrop():(al("setupClone",this),Ql.eventCanceled||((ml=Qa(cl)).removeAttribute("id"),ml.draggable=!1,ml.style["will-change"]="",this._hideClone(),Fa(ml,this.options.chosenClass,!1),Ql.clone=ml),n.cloneId=ic((function(){al("clone",n),Ql.eventCanceled||(n.options.removeCloneOnHide||hl.insertBefore(ml,cl),n._hideClone(),ll({sortable:n,name:"clone"}))})),!e&&Fa(cl,i.dragClass,!0),e?(Ll=!0,n._loopId=setInterval(n._emulateDragOver,50)):(Da(document,"mouseup",n._onDrop),Da(document,"touchend",n._onDrop),Da(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,cl)),Ta(document,"drop",n),Ra(cl,"transform","translateZ(0)")),$l=!0,n._dragStartId=ic(n._dragStarted.bind(n,e,t)),Ta(document,"selectstart",n),jl=!0,_a&&Ra(document.body,"user-select","none"))},_onDragOver:function(t){var e,n,o,i,r=this.el,s=t.target,a=this.options,l=a.group,c=Ql.active,d=Cl===l,u=a.sort,h=El||c,p=this,f=!1;if(!Wl){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=La(s,a.draggable,r,!0),j("dragOver"),Ql.eventCanceled)return f;if(cl.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return T(!1);if(Ll=!1,c&&!a.disabled&&(d?u||(o=dl!==hl):El===this||(this.lastPutMode=Cl.checkPull(this,c,cl,t))&&l.checkPut(this,c,cl,t))){if(i="vertical"===this._getDirection(t,s),e=qa(cl),j("dragOverValid"),Ql.eventCanceled)return f;if(o)return dl=hl,P(),this._hideClone(),j("revert"),Ql.eventCanceled||(pl?hl.insertBefore(cl,pl):hl.appendChild(cl)),T(!0);var m=Ha(r,a.draggable);if(!m||function(t,e,n){var o=qa(Ha(n.el,n.options.draggable)),i=tl(n.el,n.options,ul),r=10;return e?t.clientX>i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,i,this)&&!m.animated){if(m===cl)return T(!1);if(m&&r===t.target&&(s=m),s&&(n=qa(s)),!1!==tc(hl,r,cl,e,s,n,t,!!s))return P(),m&&m.nextSibling?r.insertBefore(cl,m.nextSibling):r.appendChild(cl),dl=r,D(),T(!0)}else if(m&&function(t,e,n){var o=qa(Xa(n.el,0,n.options,!0)),i=tl(n.el,n.options,ul),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=Xa(r,0,a,!0);if(g===cl)return T(!1);if(n=qa(s=g),!1!==tc(hl,r,cl,e,s,n,t,!1))return P(),r.insertBefore(cl,g),dl=r,D(),T(!0)}else if(s.parentNode===r){n=qa(s);var v,b,y,w=cl.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}(cl.animated&&cl.toRect||e,s.animated&&s.toRect||n,i),E=i?"top":"left",S=Ua(s,"top","top")||Ua(cl,"top","top"),O=S?S.scrollTop:void 0;if(Pl!==s&&(b=n[E],Ml=!1,Fl=!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&&Dl<c*i){if(!Ml&&(1===Tl?l>d+c*r/2:l<u-c*r/2)&&(Ml=!0),Ml)h=!0;else if(1===Tl?l<d+Dl:l>u-Dl)return-Tl}else if(l>d+c*(1-i)/2&&l<u-c*(1-i)/2)return function(t){return Ya(cl)<Ya(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,Fl,Pl===s),0!==v){var x=Ya(cl);do{x-=v,y=dl.children[x]}while(y&&("none"===Ra(y,"display")||y===ul))}if(0===v||y===s)return T(!1);Pl=s,Tl=v;var N=s.nextElementSibling,_=!1,A=tc(hl,r,cl,e,s,n,t,_=1===v);if(!1!==A)return 1!==A&&-1!==A||(_=1===A),Wl=!0,setTimeout(nc,30),P(),_&&!N?r.appendChild(cl):s.parentNode.insertBefore(cl,_?N:s),S&&Za(S,0,O-S.scrollTop),dl=cl.parentNode,void 0===b||Fl||(Dl=Math.abs(b-qa(s)[E])),D(),T(!0)}if(r.contains(cl))return T(!1)}return!1}function j(a,l){al(a,p,ba({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 tc(hl,r,cl,e,n,qa(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&&(Fa(cl,El?El.options.ghostClass:c.options.ghostClass,!1),Fa(cl,a.ghostClass,!0)),El!==p&&p!==Ql.active?El=p:p===Ql.active&&El&&(El=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){j("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===cl&&!cl.animated||s===r&&!s.animated)&&(Pl=null),a.dragoverBubble||t.rootEl||s===document||(cl.parentNode[el]._isOutsideThisEl(t.target),!e&&Kl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function D(){bl=Ya(cl),wl=Ya(cl,a.draggable),ll({sortable:p,name:"change",toEl:r,newIndex:bl,newDraggableIndex:wl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Da(document,"mousemove",this._onTouchMove),Da(document,"touchmove",this._onTouchMove),Da(document,"pointermove",this._onTouchMove),Da(document,"dragover",Kl),Da(document,"mousemove",Kl),Da(document,"touchmove",Kl)},_offUpEvents:function(){var t=this.el.ownerDocument;Da(t,"mouseup",this._onDrop),Da(t,"touchend",this._onDrop),Da(t,"pointerup",this._onDrop),Da(t,"touchcancel",this._onDrop),Da(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;bl=Ya(cl),wl=Ya(cl,n.draggable),al("drop",this,{evt:t}),dl=cl&&cl.parentNode,bl=Ya(cl),wl=Ya(cl,n.draggable),Ql.eventCanceled||($l=!1,Fl=!1,Ml=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),rc(this.cloneId),rc(this._dragStartId),this.nativeDraggable&&(Da(document,"drop",this),Da(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),_a&&Ra(document.body,"user-select",""),Ra(cl,"transform",""),t&&(jl&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),ul&&ul.parentNode&&ul.parentNode.removeChild(ul),(hl===dl||El&&"clone"!==El.lastPutMode)&&ml&&ml.parentNode&&ml.parentNode.removeChild(ml),cl&&(this.nativeDraggable&&Da(cl,"dragend",this),ec(cl),cl.style["will-change"]="",jl&&!$l&&Fa(cl,El?El.options.ghostClass:this.options.ghostClass,!1),Fa(cl,this.options.chosenClass,!1),ll({sortable:this,name:"unchoose",toEl:dl,newIndex:null,newDraggableIndex:null,originalEvent:t}),hl!==dl?(bl>=0&&(ll({rootEl:dl,name:"add",toEl:dl,fromEl:hl,originalEvent:t}),ll({sortable:this,name:"remove",toEl:dl,originalEvent:t}),ll({rootEl:dl,name:"sort",toEl:dl,fromEl:hl,originalEvent:t}),ll({sortable:this,name:"sort",toEl:dl,originalEvent:t})),El&&El.save()):bl!==vl&&bl>=0&&(ll({sortable:this,name:"update",toEl:dl,originalEvent:t}),ll({sortable:this,name:"sort",toEl:dl,originalEvent:t})),Ql.active&&(null!=bl&&-1!==bl||(bl=vl,wl=yl),ll({sortable:this,name:"end",toEl:dl,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){al("nulling",this),hl=cl=dl=ul=pl=ml=fl=gl=Sl=Ol=jl=bl=wl=vl=yl=Pl=Tl=El=Cl=Ql.dragged=Ql.ghost=Ql.clone=Ql.active=null,Bl.forEach((function(t){t.checked=!0})),Bl.length=xl=Nl=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":cl&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)La(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||oc(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];La(i,this.options.draggable,o,!1)&&(n[t]=i)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return La(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=rl.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Gl(n)},destroy:function(){al("destroy",this);var t=this.el;t[el]=null,Da(t,"mousedown",this._onTapStart),Da(t,"touchstart",this._onTapStart),Da(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Da(t,"dragover",this),Da(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Il.splice(Il.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!gl){if(al("hideClone",this),Ql.eventCanceled)return;Ra(ml,"display","none"),this.options.removeCloneOnHide&&ml.parentNode&&ml.parentNode.removeChild(ml),gl=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(gl){if(al("showClone",this),Ql.eventCanceled)return;cl.parentNode!=hl||this.options.group.revertClone?pl?hl.insertBefore(ml,pl):hl.appendChild(ml):hl.insertBefore(ml,cl),this.options.group.revertClone&&this.animate(cl,ml),Ra(ml,"display",""),gl=!1}}else this._hideClone()}},zl&&Ta(document,"touchmove",(function(t){(Ql.active||$l)&&t.cancelable&&t.preventDefault()})),Ql.utils={on:Ta,off:Da,css:Ra,find:Ba,is:function(t,e){return!!La(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:Ka,closest:La,toggleClass:Fa,clone:Qa,index:Ya,nextTick:ic,cancelNextTick:rc,detectDirection:Yl,getChild:Xa,expando:el},Ql.get=function(t){return t[el]},Ql.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&&(Ql.utils=ba(ba({},Ql.utils),t.utils)),rl.mount(t)}))},Ql.create=function(t,e){return new Ql(t,e)},Ql.version="1.15.3";var sc,ac,lc,cc,dc,uc,hc=[],pc=!1;function fc(){hc.forEach((function(t){clearInterval(t.pid)})),hc=[]}function mc(){clearInterval(uc)}var gc=Ka((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=za(),d=!1;ac!==n&&(ac=n,fc(),sc=e.scroll,i=e.scrollFn,!0===sc&&(sc=Va(n,!0)));var u=0,h=sc;do{var p=h,f=qa(p),m=f.top,g=f.bottom,v=f.left,b=f.right,y=f.width,w=f.height,C=void 0,E=void 0,S=p.scrollWidth,O=p.scrollHeight,x=Ra(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(m-s)<=a&&!!_);if(!hc[u])for(var P=0;P<=u;P++)hc[P]||(hc[P]={});hc[u].vx==A&&hc[u].vy==j&&hc[u].el===p||(hc[u].el=p,hc[u].vx=A,hc[u].vy=j,clearInterval(hc[u].pid),0==A&&0==j||(d=!0,hc[u].pid=setInterval(function(){o&&0===this.layer&&Ql.active._onTouchMove(dc);var e=hc[this.layer].vy?hc[this.layer].vy*l:0,n=hc[this.layer].vx?hc[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(Ql.dragged.parentNode[el],n,e,t,dc,hc[this.layer].el)||Za(hc[this.layer].el,n,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=Va(h,!1)));pc=d}}),30),vc=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 bc(){}function yc(){}bc.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=Xa(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:vc},Ca(bc,{pluginName:"revertOnSpill"}),yc.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:vc},Ca(yc,{pluginName:"removeOnSpill"}),Ql.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?Ta(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ta(document,"pointermove",this._handleFallbackAutoScroll):e.touches?Ta(document,"touchmove",this._handleFallbackAutoScroll):Ta(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?Da(document,"dragover",this._handleAutoScroll):(Da(document,"pointermove",this._handleFallbackAutoScroll),Da(document,"touchmove",this._handleFallbackAutoScroll),Da(document,"mousemove",this._handleFallbackAutoScroll)),mc(),fc(),clearTimeout(Ia),Ia=void 0},nulling:function(){dc=ac=sc=pc=uc=lc=cc=null,hc.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(dc=t,e||this.options.forceAutoScrollFallback||xa||Oa||_a){gc(t,this.options,r,e);var s=Va(r,!0);!pc||uc&&o===lc&&i===cc||(uc&&mc(),uc=setInterval((function(){var r=Va(document.elementFromPoint(o,i),!0);r!==s&&(s=r,fc()),gc(t,n.options,r,e)}),10),lc=o,cc=i)}else{if(!this.options.bubbleScroll||Va(r,!0)===za())return void fc();gc(t,this.options,Va(r,!1),!1)}}},Ca(t,{pluginName:"scroll",initializeByDefault:!0})}),Ql.mount(yc,bc);const wc={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(r.get("attributeNotPermitted",e||"")),Cc.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:Yi}},Cc={init:function(t){const e=Object.keys(wc);return this.opts=e.reduce(((e,n)=>(e[n]={...wc[n],...t[n]},e)),t),this},add:{attrs:t=>Cc.opts.add.attr(t),options:t=>Cc.opts.add.option(t),conditions:t=>(t.template={if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]},Cc.opts.add.condition(t))},click:{btn:t=>Cc.opts.click.btn(t)},save:{form:t=>(Cc.opts.sessionStorage&&qi.set(L,t),Vr.formeoSaved({formData:t}),Cc.opts.save.form(t))}},Ec=Object.freeze({type:"field",displayType:"slider"}),Sc=t=>({transform:`translateX(${t?`${t}px`:0})`});class Oc{constructor(t){n(this,"toggleTabbedLayout",(()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t})),n(this,"resizePanels",(()=>{this.toggleTabbedLayout();const t=this.panelsWrap.style,e=Md.getStyle(this.currentPanel,"height");return t.height=e,e})),this.opts=Ri(Ec,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const e=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(e),window.clearTimeout(i)}),R)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(Md.getStyle(t,"width"))>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||Ec.displayType,this.panelDisplay}createPanelsWrap(){const t=Md.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 Ur.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Ql.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=Mr(t.target,t.target.parentElement);this.currentPanel=this.panels[e];const n=t.target.parentElement.childNodes;this.nav.refresh(e),Md.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",Md.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:r.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:Md.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:r.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:Md.icon("triangle-left")};return Md.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=Mr(this.currentPanel,e);let i={nav:0,panel:0},r={...i};t.groupChange=t=>{const e=n.children;return Md.removeClasses(o,"active-panel"),Md.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=F,animate:s=!this.isTabbed})=>{const a=[Sc(r.panel),Sc(t.panel)],l=[Sc(r.nav),Sc(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=Md.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 xc="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`)),Nc=new RegExp(`(?!${xc.join("|")})\\w\\S*`,"g"),_c=/\s+/g;function Ac(t){if("string"!=typeof t)return t;if(t.trim().match(_c))return t;return t.replace(Nc,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const jc=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),Pc="f-autocomplete",Tc="highlight-component";let Dc,kc=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)=>r.get(t.join("."))||Ac(t.join(" ")))(t,e);class Lc{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=Md.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=Md.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=Md.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:`${Pc}-display-field`,value:this.label||this.value,placeholder:r.get(`${this.i18nKey}.${this.key}.placeholder`)}}),this.hiddenField=Md.create({tag:"input",attrs:{type:"hidden",className:this.className,value:this.value}}),this.list=Md.create({tag:"ul",attrs:{className:`${Pc}-list`}}),this.dom=Md.create({children:[this.displayField,this.hiddenField,this.list],className:this.className,action:{onRender:()=>{const t=this.value&&Ld.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-kc>R&&(Md.empty(this.list),this.generateOptions(),kc=t);(Dc||this.generateOptions()).forEach((t=>this.list.appendChild(t)))}generateOptions(){const t=(t=>{const e=[],n=Ld.flatList();return Object.entries(n).map((([n,o])=>{const i=$c(o);if(i){const r={tag:"span",content:` ${Ac(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 Md.makeOption([n,[`${i} `,l,r]],t)}})).filter(Boolean)})(),e=t=>{const e=`${Pc}-list-item`;return t.classList.contains(e)||(t=t.parentElement),t};return Dc=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:`${Pc}-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 Md.create(i)})),Dc}hideList(t=this.list){Xr.slideUp(t,F),this.removeHighlight()}showList(t,e=this.list){this.selectOption(t),Xr.slideDown(e,F)}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=Ld.getAddress(t);e.dom&&e.dom.classList.remove(Tc)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(Tc);for(let e=0;e<t.length;e++)t[e].classList.remove(Tc)}highlightComponent(t){const{dataset:{value:e}}=t;if(e){const t=Ld.getAddress(e);t.dom&&t.dom.classList.add(Tc)}}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 Ic=(t,e)=>{const n=(t=>{const e=Xi(t),n={"field.property":U,...X},o=e?(i=t,Ld.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,i])=>{if("id"!==o){const s={tag:"option",content:r.get(`${t}.${o}`)||o.toLowerCase(),attrs:{value:i}};e===i&&(s.attrs.selected=!0),n.push(Md.create(s))}return n}),[])},Mc=(t,e)=>{Md.empty(t),e.forEach((e=>t.add(e)))},Fc=({key:t,value:e,type:n="text",checked:o})=>{const i={tag:"input",attrs:{type:n,value:e,placeholder:r.get(`${t}.placeholder`)||Ac(t)},className:t.replace(/\./g,"-"),config:{}};return o&&(i.attrs.checked=!0),i},Rc=t=>{const e=r.get(t);if(e)return e;const n=t.split(".");return r.get(n[n.length-1])},Wc={autocomplete:(t,e,n)=>new Lc(t,e,n),string:(t,e)=>Fc({key:t,value:e}),boolean:(t,e)=>Fc({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:e}),number:(t,e)=>Fc({key:t,value:e,type:"number"}),array:(t,e=[])=>({tag:"select",attrs:{placeholder:Rc(`placeholder.${t}`)},className:t.replace(/\./g,"-"),options:e}),object:t=>Object.entries(t).map((([t,e])=>Wc[Md.childType(e)](t,e)))},Bc=["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 qc{constructor({key:t,data:e,index:o,field:i}){n(this,"generateConditionFields",((t,e)=>{const n={tag:"label",className:`condition-label ${t}-condition-label`,content:r.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=Fr(r,q.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(" ")}`}}))})),n(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)}),M)},o=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.removeAttribute("style")})),clearTimeout(e)}),M)},i=new Map([["condition-source",t=>{const i=e("condition-sourceProperty"),r=i[0],s=Xi(t.value)?t.value:"field.property",a=Ic(s,r.value);return Mc(r,a),t.value?o(i):n(i)}],["condition-target",t=>{const i=e("condition-targetProperty");return Ui(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)}))})),n(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=Ic(n||t,e),i=Wc.array(`condition.${t}`);i.action={change:c,onRender:t=>c({target:t})};const r=Md.create(i);return Mc(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};Vr.formeoUpdated(o),Ld.setAddress(a,t.value);const i=t.closest(".f-condition-row"),r=Mr(i);this.processConditionUIState(this.itemFieldGroups[r])},d={comparison:t=>l("comparison",t),logical:t=>l("logical",t),source:(t,e="source")=>{const o=Wc.autocomplete(`condition.${e}`,t,n);return Ld.setConditionMap(t,i),o.addEvent("onChange",(t=>{Ld.removeConditionMap(Ld.getAddress(a)),c(t),Ld.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=Wc.string("condition.value",t);return e.action={input:c},Md.create(e)},assignment:t=>l("assignment",t)};if(d[t])return d[t](e)})),this.itemValues=Fr(Object.entries(e),Bc,"0");const[s,a]=t.split(".");this.field=i,this.itemKey=t,this.itemIndex=o,this.panelName=s,this.isDisabled=i.isDisabledProp(a,s),this.isHidden=this.isDisabled&&i.config.panels[s].hideDisabled,this.isLocked=i.isLockedProp(a,s),this.dom=Md.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:()=>{Xr.slideUp(this.dom,250,(t=>{this.field.remove(this.itemKey),Md.remove(t),this.field.resizePanelWrap()}))}},content:Md.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=Md.childType(e)||"string",o={config:{},attrs:{},...Wc[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&&Rc(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 Uc{constructor(t,e,o){n(this,"addAttribute",((t,e)=>{const n=jc(t),o=`attrs.${n}`;r.current[o]||r.put(o,zr(t)),"string"==typeof e&&["true","false"].includes(e)&&(e=JSON.parse(e)),this.field.set(`attrs.${t}`,e);const i=this.props.querySelector(`.field-attrs-${n}`),s=new qc({key:o,data:{[n]:e},field:this.field});i?this.props.replaceChild(s.dom,i):this.props.appendChild(s.dom),this.field.resizePanelWrap()})),n(this,"addOption",(()=>{const t=this.field.data.meta.id,e=this.field.get("options"),n="select"===t?"option":t,o=r.get("newOptionLabel",{type:n})||"New Option",i=`options.${this.data.length}`,s={...e.length?Lr(e[e.length-1]):{},label:o,value:jc(o)},a=new qc({key:i,data:s,field:this.field,index:this.props.children.length});this.editPanelItems.push(a),this.props.appendChild(a.dom),this.field.set(i,s),this.field.resizePanelWrap()})),n(this,"addCondition",(t=>{const e=`conditions.${this.field.get("conditions").length}`,n=this.props.querySelector(`.field-${e.replace(".","-")}`),o=new qc({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=Md.childType(t),this.data="object"===this.type?Object.entries(t):t,this.name=e,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:r.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 qc({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 Md.create(e)}createEditButtons(){const t=this,e=this.name,n=r.get(`panelEditButtons.${e}`),o={attrs:t.addAttribute,options:t.addOption,conditions:t.addCondition};return{className:"panel-action-buttons",content:[{...Md.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:n=>{const i={btnCoords:Md.coords(n.target),addAction:o[e]};"attrs"===e&&(i.isDisabled=t.field.isDisabledProp,i.isLocked=t.field.isLockedProp,i.message={attr:r.get(`action.add.${e}.attr`),value:r.get(`action.add.${e}.value`)});const s=Ac(e),a=new window.CustomEvent(`onAdd${s}`,{detail:i});Cc.add[e](i),document.dispatchEvent(a)}}}]}}}class Xc extends ga{constructor(t,e={},o){super(t,{...e,id:e.id||Fi()}),n(this,"mutationHandler",(t=>t.map((t=>{})))),n(this,"remove",(t=>{if(t){const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?Ir(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 Rr(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(Ld.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),Ld[`${this.name}s`].delete(this.id)})),n(this,"emptyClass",(()=>this.dom.classList.toggle("empty",!this.children.length))),n(this,"getComponentTag",(()=>Md.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&Md.icon("component-corner",["bottom-left"]),Md.icon(`handle-${this.name}`),Ac(this.name),(this.isColumn||this.isRow)&&Md.icon("component-corner",["bottom-right"])].filter(Boolean)}))),n(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[Md.childType(t)](this.dom)})),n(this,"loadChildren",((t=this.data.children)=>t.map((t=>this.addChild({id:t}))))),n(this,"saveChildOrder",(()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t})),n(this,"onSort",(()=>this.saveChildOrder())),n(this,"onEnd",(({to:{parentElement:t},from:{parentElement:e}})=>{null==t||t.classList.remove(`hovering-${Ii(t)}`),null==e||e.classList.remove(`hovering-${Ii(e)}`)})),n(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)))}))})),n(this,"value",((t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!U[i]].some(Boolean)?t:e?o.set(U[i],e):o.get(U[i])})),n(this,"getResult",(t=>({"=":(t,e,n)=>t.set(e,n)}[t]))),n(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)}})))),n(this,"execResults",(t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)})),n(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)}})))),n(this,"cloneData",(()=>{const t={...Wi(this.data),id:Fi()};return"field"!==this.name&&(t.children=[]),t})),n(this,"clone",((t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),e})),n(this,"createChildWrap",(t=>Md.create({tag:"ul",attrs:{className:"children"},children:t}))),this.id=this.data.id,this.name=t,this.config=Ld[`${this.name}s`].config,Ri(this.config,e.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})=>{Ld.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),Ld.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...Md.btnTemplate({content:Md.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`);Xr.slideToggle(i,M,t),"field"===this.name&&(Xr.slideToggle(this.preview,M,!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}`)=>({...Md.btnTemplate({content:Md.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...Md.btnTemplate({content:Md.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...Md.btnTemplate({content:Md.icon(t)}),className:["item-edit-toggle"],meta:{id:"edit"},action:{click:t=>{this.toggleEdit()}}}),remove:(t="remove")=>({...Md.btnTemplate({content:Md.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:(t,e)=>{Xr.slideUp(this.dom,M,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...Md.btnTemplate({content:Md.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 Mr(this.dom)}get parentType(){return D.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${x[t]}`);return e&&Md.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=T.get(this.name);return Wr(t,(t=>Ld.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=Fi()}=i,a=T.get(this.name);if(!a)return null;const l=`${a}s`,c=Ld.getAddress(`${l}.${s}`)||Ld[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(p)||(t=t.parentElement);const r=Ii(t),s=Ii(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=Mr(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),l={controls:()=>{const{controlData:t}=hd.get(n.id),{meta:{id:e}}=t,i=e.startsWith("layout-")?e.replace(/^layout-/,""):"field",r=kr({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)();Md.remove(n);return s(t,o)},row:()=>{const t=(a.get({stage:-1,row:0,column:1}[s])||Yi)();return null==t?void 0:t({id:n.id},o)},column:()=>{const t=(a.get({stage:-2,row:-1}[s])||Yi)();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(g)&&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&&Md.onRender(this.dom,t.onRender)}set config(t){const e=kr(this.data,"meta.id"),n=[kr(t,"all"),e&&kr(t,e),kr(t,this.id)].reduce(((t,e)=>e?Ri(t,e):t),this.configVal);this.configVal=n}get config(){return this.configVal}getComponent(t){const[e,n]=t.split("."),o=Ld[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===S.row}get isColumn(){return this.name===S.column}get isField(){return this.name===S.field}}class Hc extends Xc{constructor(t=Object.create(null)){super("field",{conditions:[{if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]}],...t}),n(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)}),M)})),n(this,"updatePreview",Hi((()=>{if(!this.preview.parentElement)return null;this.updateLabel();const t=Md.create(this.fieldPreview(),!0);this.preview.parentElement.replaceChild(t,this.preview),this.preview=t}),M)),n(this,"isDisabledProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get(`config.disabled${Ac(e)}`)).includes(t)})),n(this,"isLockedProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get(`config.locked${Ac(e)}`)).includes(t)})),this.label=Md.create(this.labelConfig),this.preview=Md.create({}),this.editPanels=[];const e=this.getActionButtons(),o=this.actionButtons.some((t=>{var e;return"edit"===(null==(e=t.meta)?void 0:e.id)}));let i={tag:"li",attrs:{className:v},id:this.id,children:[this.label,this.getComponentTag(),e,o&&this.fieldEdit,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:r.get("field")}};i=Md.create(i),this.observe(i),this.dom=i,this.isEditing=!1,this.onRender(i)}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=Ld.getConditionMap(`fields.${this.id}`);if(i)return i.updateConditionSourceLabel(`${this.name}s.${this.id}`,n?o:e)}}},e&&Md.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=Md.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=Mi([...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=Md.childType(e);if(t.includes(n)){const t=new Uc(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 Oc(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",Md.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=Wi(this.data),{action:n={}}=hd.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:Md.create(e,!0),action:this.defaultPreviewActions}}}const Yc={js:new Set,css:new Set},Gc=(t,e,n=Gi)=>new Promise((o=>fetch(t).then((t=>{if(!t.ok)return o(n(t));o(e?e(t):t)})).catch((t=>n(t))))),Vc=(t,e)=>{t.removeEventListener("load",Vc),e(t.src)},Jc=(t,e)=>{t.removeEventListener("load",Jc),e(t.src)},Kc=t=>new Promise(((e,n)=>{if(Yc.js.has(t))return e(t);Yc.js.add(t);const o=Md.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:`//${t.replace(/^https?:\/\//,"")}`},action:{load:()=>Jc(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Zc=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(Yc.css.has(t))return e(t);Yc.css.add(t);const o=Md.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Vc(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Qc=async(t=d)=>{if(document.getElementById(l))return;const e=async t=>(t=>{let e=document.getElementById(l);return e||(e=Md.create({id:l,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e})(await t.text());return Gc(t,e,(()=>Gc(u,e)))},td={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Kc(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Zc(t)));return Promise.all(e)}},ed=t=>{const e=Object.entries(t).map((([t,e])=>td[t](e)));return Promise.all(e)},nd=()=>{const t=document.getElementById(l);return"hidden"===window.getComputedStyle(t).visibility};class od{constructor({events:t={},dependencies:e={},controlAction:o,...i}){n(this,"controlCache",new Set),this.events=t,this.controlData=i,this.controlAction=o,this.dependencies=e,this.id=i.id||Fi()}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:Md.icon(t.icon)},n],action:{focus:({target:t})=>{const e=t.closest(`.${p}`);return e&&hd.panels.nav.refresh(Mr(e))},click:({target:t})=>{hd.addElement(t.parentElement.id)}}};return Md.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return ed(this.dependencies)}i18n(t,e){var n,o;const i=r.locale,s=null==(n=this.definition)?void 0:n.i18n,a=(null==s?void 0:s[i])||{};return((null==(o=a[t])?void 0:o.call(a))??a[t])||r.get(t,e)}}const id=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}];const rd=(t,e=3)=>Array.from({length:e},((t,e)=>e+1)).map((e=>{const n="checkbox"===t?"checked":"selected";return{label:r.get("labelCount",{label:Ac(t),count:e}),value:`${t}-${e}`,[n]:!e}}));const sd=[class extends od{constructor(){super({tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:r.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:r.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 od{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:r.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends od{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:r.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends od{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:r.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends od{constructor(){super({tag:"textarea",config:{label:r.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends od{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:r.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends od{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:r.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends od{constructor(){super({tag:"select",config:{label:r.get("controls.form.select")},attrs:{required:!1,className:""},meta:{group:"common",icon:"select",id:"select"},options:rd("option")})}},class extends od{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:r.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:rd("checkbox",1)})}},class extends od{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:r.get("controls.form.radio-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:rd("radio")})}}],ad=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),ld="controls.html.header";const cd=[class extends od{constructor(){super({tag:ad[0],attrs:{tag:ad.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:r.get(ld),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:r.get(ld),action:{}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(ld)}},class extends od{constructor(){super({tag:"p",attrs:{className:""},config:{label:r.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 od{constructor(){super({tag:"hr",config:{label:r.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends od{constructor(t){super(Ri({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))}}],dd=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"}}),ud=[...sd,...cd,...id];const hd=new class{constructor(){n(this,"groupLabel",(t=>r.get(t)||t||"")),n(this,"addElement",(t=>{const e=kr(this.get(t),"controlData"),{meta:{group:n,id:o}}=e,i={row:()=>Ad.active.addChild(),column:()=>i.row().addChild(),field:t=>i.column().addChild(t)};return"layout"!==n?i.field(e):i[o.replace("layout-","")]()})),n(this,"applyOptions",(async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=Ri(dd,t);return this.container=e,this.groupOrder=Mi(o.concat(["common","html","layout"])),this.options=i,Promise.all(this.registerControls([...ud,...n]))})),this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${p}`);return e&&this.panels.nav.refresh(Mr(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 od(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=Fr(t,this.groupOrder,"id"),t=t.filter((t=>Li(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:p,id:`${t.id}-${p}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=Mi(e.concat(t.elementOrder));t.elementOrder=n}return e=Fr(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=[Li(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=Wi(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={...Md.btnTemplate({content:[Md.icon("bin"),r.get("clear")],title:r.get("clearAll")}),className:["clear-form"],action:{click:t=>{jd.size?(Vr.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:r.get("confirmClearAll"),clearAllAction:()=>{Ad.clearAll().then((()=>{const e={src:t.target};Vr.formeoCleared(e)}))},btnCoords:Md.coords(t.target)}}),document.dispatchEvent(Vr.confirmClearAll)):window.alert(r.get("cannotClearFields"))}}},e={...Md.btnTemplate({content:[Md.icon("floppy-disk"),r.get("save")],title:r.get("save")}),className:["save-form"],action:{click:({target:t})=>{const{formData:e}=Ld,n={action:()=>{},coords:Md.coords(t),message:"",button:t};return Cc.click.btn(n),Cc.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 Oc({panels:e,type:"controls",displayType:o});const i=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],s=Md.create({className:i,content:[this.panels.panelNav,this.panels.panelsWrap]}),a=["formeo-controls"];t&&a.push("formeo-sticky");const l=Md.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(Md.toggleElementsByStr(n,t),e){const e=r.get("controls.filteringTerm",t);l.classList.add("filtered"),o?o.textContent=e:(o=Md.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 r=c.length-1;r>=0;r--){const t=`formeo-controls-${c[r]}`;this.options.sortable||window.localStorage.removeItem(t),Ql.create(c[r],{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 pd extends ga{constructor(){super(...arguments),n(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))),n(this,"get",(t=>t?kr(this.data,t):this.add())),n(this,"add",((t,e=Object.create(null))=>{const n=t||Fi(),o=this.Component({...e,id:n});return this.set(n,o),this.active=o,o})),n(this,"remove",(t=>(Array.isArray(t)?t.forEach((t=>{this.get(t).remove()})):this.get(t).remove(),this.data))),n(this,"delete",(t=>(delete this.data[t],t))),n(this,"clearAll",((t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)})),n(this,"conditionMap",new Map)}set config(t){this.configVal=Ri(this.configVal,Wi(t))}get config(){return this.configVal}}class fd extends Xc{constructor(t,e){super("stage",{...Object.freeze({children:[]}),...t},e);const n=this.createChildWrap();this.dom=Md.create({attrs:{className:[f,"empty"],id:this.id},children:n}),Ql.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:()=>{md.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"),Xr.slideUp(this.dom,M,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),Xr.slideDown(this.dom,M)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const md=new class extends pd{constructor(t){super("stages",t)}Component(t){return new fd(t)}};class gd extends Xc{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[m]}),...t}),n(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(Y);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()}),F);document.dispatchEvent(Vr.columnResized)}this.updateColumnPreset()})),n(this,"updateColumnPreset",(()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>Md.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)})),n(this,"setColumnWidths",(t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))}));const e=this.createChildWrap();this.dom=Md.create({tag:"li",className:[m,"empty"],dataset:{hoverTag:r.get("row"),editingHoverTag:r.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),Ql.create(e,{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:`.${g}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:r.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:r.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:r.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:r.get("row.makeInputGroup"),description:r.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=Md.formGroup([t,n]),i={tag:"label",content:r.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=Md.create(this.columnPresetControlConfig);const s={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},a=[e,"hr",o,"hr",Md.formGroup([i,s],"row")];return Md.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=a.map((t=>Md.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=k.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:b}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:r.get("defineColumnLayout"),className:y},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const vd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const bd=new class extends pd{constructor(t){super("rows",t),this.config={all:vd}}Component(t){return new gd(t)}};class yd{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=Md.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(w),this.columnPreset=o.querySelector(`.${y}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(Y,""),n.className=n.className.replace(Y,""),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(Bi(e,this.rowWidth)),i=parseFloat(Bi(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(),Ld.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),Ld.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(w),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(w),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${b}`);const n=this.row.querySelector(".children").children,o=Wr(n,(t=>Bi(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=Md.create({tag:"option",attrs:{className:b,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const wd=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[Md.icon("triangle-down"),Md.icon("triangle-up")]}),Cd=()=>({className:"column-edit group-config"});class Ed extends Xc{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[g]}),...t}),n(this,"refreshFieldPanels",(()=>{this.children.forEach((t=>t.panels.nav.refresh()))})),n(this,"setWidth",(t=>(this.dom.dataset.colWidth=t,this.dom.style.width=t,this.set("config.width",t))));const e=this.createChildWrap();this.dom=Md.create({tag:"li",className:[g,"empty"],dataset:{hoverTag:r.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),Cd(),wd(new yd),e]}),this.processConfig(this.dom),Vr.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Ql.create(e,{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:`.${v}`,handle:".item-move"})}processConfig(t){const e=Ur.get(this.data,"config.width");e&&(t.dataset.colWidth=e,t.style.width=e)}}const Sd={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const Od=new class extends pd{constructor(t){super("columns",t),this.config={all:Sd}}Component(t){return new Ed(t)}},xd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}};const Nd=new class extends pd{constructor(t){super("fields",t),n(this,"get",(t=>{let e=t&&kr(this.data,t);if(!e){const n=hd.get(t);n&&(e=this.add(null,n.controlData))}return e})),this.config={all:xd}}Component(t){return new Hc(t)}};const _d=new class extends pd{constructor(t){super("externals",t)}Component(t){return new Xc("external",t)}},Ad=md,jd=bd,Pd=Od,Td=Nd,Dd=hd,kd=_d,$d={id:Fi()};const Ld=new class extends ga{constructor(t){super("components"),n(this,"sessionFormData",(()=>{var t;if(null==(t=this.opts)?void 0:t.sessionStorage)return qi.get(L)})),n(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={[Fi()]:{}},rows:i,columns:r,fields:s,id:a=Fi()}={...this.sessionFormData(),...n};this.set("id",a),this.add("stages",Ad.load(o)),this.add("rows",jd.load(i)),this.add("columns",Pd.load(r)),this.add("fields",Td.load(s)),this.add("externals",kd.load(e.external));for(const l of Object.values(this.get("stages")))l.loadChildren();return this.data})),this.opts=t,this.data=$d,this.disableEvents=!0,this.stages=Ad,this.rows=jd,this.columns=Pd,this.fields=Td,this.controls=Dd,this.externals=kd}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:md.getData(),rows:bd.getData(),columns:Od.getData(),fields:Nd.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;Ad.config=e,jd.config=n,Pd.config=o,Td.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(!Ui(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(Ui(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.get(e[1])}}setConditionMap(t,e){if(Ui(t)){const n=t.split(".");return n.every((t=>Boolean(t)))&&this[n[0]].conditionMap.set(n[1],e)}}removeConditionMap(t){if(Ui(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.delete(e[1])}}},Id={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="${G}${t}">${t}</i>`};const Md=new class{constructor(){n(this,"render",(t=>(t.id=`f-${t.id||Fi()}`,this.create(t)))),n(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:[Ur.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 Ur.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(Ur.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=Ur.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})),n(this,"onRender",((t,e)=>{t.parentElement?e(t):window.requestAnimationFrame((()=>this.onRender(t,e)))})),n(this,"toggleElementsByStr",((t,e)=>{const n=[];return Md.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n})),n(this,"elementsContainText",((t,e,n)=>{const o=[];return Rr(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());null==n||n(t,i),i&&o.push(t)})),o})),n(this,"generateOption",(({type:t="option",label:e,value:n,i:o=0,selected:i})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:n||`${t}-${o}`,["option"===t?"selected":"checked"]:i||!o},config:{label:e||r.get("labelCount",{label:r.get("option"),count:o})}}))),n(this,"makeOption",(([t,e],n,o)=>{const i={value:t,label:r.get(`${o}.${e}`)||e};return t===n&&(i.selected=!0),i})),n(this,"requiredMark",(()=>({tag:"span",className:"text-error",children:"*"}))),n(this,"removeEmpty",(t=>{const e=t.parentElement,n=Ii(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length){if(!this.isStage(e))return this.removeEmpty(e);this.emptyClass(e)}})),n(this,"btnTemplate",(({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e}))),n(this,"isControls",(t=>Ii(t)===p)),n(this,"isStage",(t=>Ii(t)===f)),n(this,"isRow",(t=>Ii(t)===m)),n(this,"isColumn",(t=>Ii(t)===g)),n(this,"isField",(t=>Ii(t)===v)),n(this,"asComponent",(t=>Ld[`${Ii(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=Ri(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:Md.onRender,render:Md.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(`#${l} svg symbol`);return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(G,"")]=Md.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=Id[Md.options.iconFont])?void 0:n.call(Id,t))||t}processAttrs(t,e,n){const{attrs:o={}}=t;n||!o.name&&this.isInput(t.tag)&&e.setAttribute("name",Fi(t));for(const i of Object.keys(o)){const t=Ur.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||Fi(),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=Ur.get(t,"attrs.type"),n=Ur.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}label(t,e){const n=Ur.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=Ii(t);return e?Ld.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,Ur.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)}};Ur.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");Xr.slideUp(t,600,(()=>{Md.empty(t),t.classList.remove("removing-all-fields"),Md.emptyClass(t),Xr.slideDown(t,300)}))}toggleSortable(t,e){const n=Ii(t);if(!n)return;const o=Ii(t.parentElement),i=Md[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(C.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}};r.addLanguage("en-US",void 0);const Fd={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,external:{},svgSprite:d,style:h,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:qr(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"}}}};let Rd=class{constructor({formData:t,...e},n){const o=Ri(Fd.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,Md.setOptions=c,Ld.config=a,this.userFormData=n||t,this.Components=Ld,this.dom=Md,Vr.init({debug:s,...r}),Cc.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)?c.filter((({name:e})=>-1!==t.indexOf(e))):c;Promise.all(e.map((({src:t})=>Kc(t))))})(this.opts.polyfills),await Qc(this.opts.svgSprite),e.push((async t=>{if(!nd()&&(await Zc(t),!nd()))return await Zc("https://draggable.github.io/formeo/assets/css/formeo.min.css")})(this.opts.style)),e.push(r.init({...this.opts.i18n,locale:null==(t=window.sessionStorage)?void 0:t.getItem(I)}));const n=await Promise.all(e);return this.opts.allowEdit&&this.init(),n}init(){hd.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=Ld.get("id"),this.i18n={setLang:t=>{var e;null==(e=window.sessionStorage)||e.setItem(I,t);r.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(Ld.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))]};r.current.dir&&(t.attrs.dir=r.current.dir,Md.dir=r.current.dir),this.editor=Md.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(Md.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Vr.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Vr.formeoLoaded)}};const Wd=t=>{const e=t.match(H);return(null==e?void 0:e[0])||t},Bd=t=>t.replace(H,Fi());let zd=class{constructor(t,e={}){n(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=Md.render(n),this.applyConditions();const o=this.container.querySelector(".formeo-render");o?o.replaceWith(this.renderedForm):this.container.appendChild(this.renderedForm)})),n(this,"orderChildren",((t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]))),n(this,"prefixId",(t=>"f-"+t)),n(this,"processColumn",(({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`}))),n(this,"processRows",(t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]))),n(this,"cacheComponent",(t=>(this.components[Wd(t.id)]=t,t))),n(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:Fi(),className:i,children:s}})),n(this,"cloneComponentData",(t=>{const{children:e=[],id:n,...o}=this.components[t];return Object.assign({},o,{id:Bd(n),children:e.length&&e.map((({id:t})=>this.cloneComponentData(Wd(t))))})})),n(this,"addButton",(t=>Md.render({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=Md.render(this.cloneComponentData(t));n.insertBefore(o,n.lastChild),o.appendChild(Md.render(Md.btnTemplate({className:"remove-input-group",children:Md.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()}})))}}}))),n(this,"processColumns",(t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t)))))),n(this,"processFieldsOrig",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>this.cacheComponent(Object.assign({},e,{id:this.prefixId(t)})))))),n(this,"processFields",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const{action:n={},dependencies:o={}}=this.elements[e.meta.id]||{};o&&ed(o);const i=Ri({action:n},e);return this.cacheComponent({...i,id:this.prefixId(t)})})))),n(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(Ui(e)){this.getComponents(e).forEach((t=>{const e=qd(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)))}))}}))}))}))})),n(this,"evaluateCondition",(({sourceProperty:t,targetProperty:e,comparison:n,target:o},i)=>{var r;const s={equals:ma,notEquals:(t,e)=>!ma(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},a=String(i.target[t]),l=String(Ui(o)?this.getComponent(o)[e]:o);return null==(r=s[n])?void 0:r.call(s,a,l)})),n(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(Ui(e)){const n=this.getComponent(e);n&&void 0===n._required&&(n._required=n.required),null==(i=r[t])||i.call(r,n)}})),n(this,"getComponent",(t=>{const e=t.slice(t.indexOf(".")+1);return Xi(t)?this.external[e]:this.renderedForm.querySelector(`#f-${e}`)})),n(this,"getComponents",(t=>{const e=[],n=t.slice(t.indexOf(".")+1);return Xi(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=e,this.external=i,this.dom=Md,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=f,Md.render(t))))}};const qd=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=Rd,window.FormeoRenderer=zd);const Ud=Rd,Xd=zd;t.FormeoEditor=Ud,t.FormeoRenderer=Xd,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|