@golemui/core 0.13.0 → 0.13.2

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/index.umd.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("rxjs");require("@standard-schema/spec");var rr=class{constructor(e){this.value=e}map(e){return W(e(this.value))}isOk(){return!0}},nr=class{constructor(e){this.error=e}map(e){return I(this.error)}isOk(){return!1}};function W(e){return new rr(e)}function I(e){return new nr(e)}var P=class _e{constructor(t){this.decodeFn=t,this["~standard"]={version:1,vendor:"ts.data.json",validate:r=>{let n=this.decode(r);return n.isOk()?{value:n.value}:{issues:[{message:n.error}]}}},this.decodeToPromise=this.decodePromise,this.chain=this.flatMap}parse(t){let r=this.decode(t);if(r.isOk())return r.value;throw r.error}decode(t){return this.decodeFn(t)}decodePromise(t){return new Promise((r,n)=>{let o=this.decode(t);return o.isOk()?r(o.value):n(o.error)})}map(t){return new _e(r=>{let n=this.decodeFn(r);return n.isOk()?W(t(n.value)):I(n.error)})}flatMap(t){return new _e(r=>{let n=this.decodeFn(r);return n.isOk()?t(n.value).decode(r):I(n.error)})}},or=(e,t,r)=>`<${e}> decoder failed at index "${t}" with error: ${r}`,q=(e,t)=>`${JSON.stringify(e)} is not a valid ${t}`;function Ve(e,t){return new P(r=>{if(r instanceof Array){let n=[];for(let o=0;o<r.length;o++){let i=e.decode(r[o]);if(i.isOk())n.push(i.value);else return I(or(t,o,i.error))}return W(n)}else return I(q(r,"array"))})}function ir(){return new P(e=>typeof e=="boolean"?W(e):I(q(e,"boolean")))}function gt(e){return new P(t=>e().decode(t))}var sr=(e,t)=>`${JSON.stringify(e)} is not exactly ${JSON.stringify(t)}`;function Se(e){return new P(t=>t===e?W(e):I(sr(t,e)))}function Ee(){return new P(e=>typeof e=="number"?W(e):I(q(e,"number")))}var dr=(e,t,r)=>`<${e}> decoder failed at key "${t}" with error: ${r}`;function se(e,t){return new P(r=>{if(r!==null&&typeof r=="object"){let n={};for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){let i,s=e[o];if(s instanceof P?i=s.decode(r[o]):i=s.decoder.decode(r[s.fromKey]),i.isOk())n[o]=i.value;else return I(dr(t,o,i.error))}return W(n)}else return I(q(r,t))})}var ur=(e,t)=>`<${e}> decoder failed because ${JSON.stringify(t)} can't be decoded with any of the provided oneOf decoders`;function x(e,t){return new P(r=>{for(let n=0;n<e.length;n++){let o=e[n].decode(r);if(o.isOk())return o}return I(ur(t,r))})}function S(e){return new P(t=>t===void 0?W(void 0):e.decode(t))}var cr=(e,t,r)=>`<${e}> record decoder failed at key "${t}" with error: ${r}`;function lr(e,t){return new P(r=>{if(r!==null&&typeof r=="object"){let n={};for(let o in r)if(Object.prototype.hasOwnProperty.call(r,o)){let i=e.decode(r[o]);if(i.isOk())n[o]=i.value;else return I(cr(t,o,i.error))}return W(n)}else return I(q(r,t))})}function C(){return new P(e=>typeof e=="string"?W(e):I(q(e,"string")))}function X(){return new P(e=>W(e))}function ar(e){return{...e,form:{uid:"",type:"flex",kind:"layout",children:e.form}}}const Be=se({states:S(lr(C(),"states")),form:gt(()=>we)},"FormDef"),He=e=>({formName:"",formDef:Be.parse({form:{kind:"layout",type:"flex",children:[]}}),flatForm:{},currentStates:[],calculatedWidgets:{},validations:{},touchedControls:{},injectedValidations:{},widgetFlags:{},widgetPropOverrides:{},data:{},meta:{},formHealth:{status:"ok"},touched:!1,lang:e}),mt=e=>!(typeof e!="object"||e===null||typeof e.key!="string");function fr(e){const t=new Intl.Locale(e).maximize().script;return["Arab","Hebr","Thaa","Syrc","Tfng","Adlm","Rohg"].includes(t||"")?"rtl":"ltr"}const yt=(e=navigator.language||"en-US")=>{const t=new Set;return{get lang(){return e},translate(n){return n},subscribe(n){return t.add(n),()=>{t.delete(n)}},setLang(n){e=n,t.forEach(o=>o(e))}}};function de(e,t){return new P(r=>{if(typeof r!="object"||r===null)return I(`<${t}> failed. Expected object literal, got "${typeof r}"`);const n={};for(const[o,i]of Object.entries(e)){const s=i.decoder.decode(r[o]);if(!s.isOk())return I(`<${t}> failed at "${o}" with ${s.error}`);if(n[o]=s.value,i.suffixed){for(const[u,c]of Object.entries(r))if(u.startsWith(o+".")){const h=i.decoder.decode(c);if(!h.isOk())return I(`<${t}> failed at "${u}" with ${h.error}`);n[u]=h.value}}}return W(n)})}const Ge=()=>crypto.randomUUID().slice(0,8),$t=e=>typeof e!="function"&&e.kind==="display",Q=e=>typeof e!="function"&&e.kind==="action",D=e=>typeof e!="function"&&e.kind==="input",fe=e=>typeof e!="function"&&e.kind==="layout",Y=e=>typeof e=="function",pr=se({in:Ve(C(),"In[]")},"In"),Ke=se({when:C()},"When"),ve=x([pr,Ke],"In | When"),hr=se({from:Ve(C(),"From[]")},"From"),Ie=x([hr,Ke],"Exclude"),Ue=x([ir(),Ke],"Bool | When"),gr=new P(e=>{const t=typeof e;return t==="function"?W(e):I(`Expected a function, got '${t}'`)}),j=e=>x([e,gr],""),Xe=de({load:{suffixed:!0,decoder:j(S(C()))},click:{suffixed:!0,decoder:j(S(C()))},change:{suffixed:!0,decoder:j(S(C()))},filter:{suffixed:!0,decoder:j(S(C()))},blur:{suffixed:!0,decoder:j(S(C()))}},"On"),mr=se({key:C(),default:S(C()),params:X()},"TranslationConfig"),At=x([C(),mr],"Localizable"),Ce=S(C()).map(e=>e||Ge()),yr=de({kind:{decoder:Se("display")},uid:{decoder:Ce},type:{decoder:C()},size:{suffixed:!0,decoder:S(Ee())},include:{decoder:S(ve)},exclude:{decoder:S(Ie)},props:{decoder:S(X())}},"DisplayWidget"),$r=de({kind:{decoder:Se("action")},uid:{decoder:Ce},type:{decoder:C()},size:{suffixed:!0,decoder:S(Ee())},include:{decoder:S(ve)},exclude:{decoder:S(Ie)},label:{suffixed:!0,decoder:j(At)},disabled:{suffixed:!0,decoder:S(Ue)},on:{decoder:S(Xe)},props:{decoder:S(X())}},"ActionWidget"),Ar=new P(e=>{const t=typeof e;if(t==="function"){const r=e,n=r(void 0);return r.uid=n.uid||Ge(),r.type=n.type,r.path=n.path,W(r)}else return I(`Expected a function, got '${t}'`)}),Sr=de({kind:{decoder:Se("input")},uid:{decoder:Ce},type:{decoder:C()},size:{suffixed:!0,decoder:S(Ee())},include:{decoder:S(ve)},exclude:{decoder:S(Ie)},disabled:{suffixed:!0,decoder:S(Ue)},readonly:{suffixed:!0,decoder:S(Ue)},on:{decoder:S(Xe)},props:{decoder:S(X())},label:{suffixed:!0,decoder:j(S(At))},path:{decoder:C()},defaultValue:{decoder:S(X())},validator:{suffixed:!0,decoder:j(S(X()))}},"InputWidget").map(e=>{const t={...e};if(e.uid||(t.uid=`${e.path}-${e.type}`),e.type==="repeater"){const r=e.props;r.template=we.parse(r.template)}return t}),Er=gt(()=>x([Ar,Sr,we,yr,$r],"FormWidget")),we=de({kind:{decoder:Se("layout")},uid:{decoder:Ce},type:{decoder:C()},size:{suffixed:!0,decoder:S(Ee())},include:{decoder:S(ve)},exclude:{decoder:S(Ie)},props:{decoder:S(X())},on:{decoder:S(Xe)},children:{decoder:Ve(Er,"FormWidget[]")}},"LayoutWidget"),G=class G{constructor(){this.widgetLoaders={},this._ready=!1}get ready(){return this._ready}setWidgetLoaders(t){this.widgetLoaders=t,this._ready=!0}async loadWidget(t){const r=this.widgetLoaders[t];if(!G.sharedCache.has(r)){const n=r().catch(o=>(G.sharedCache.delete(r),Promise.reject(o)));G.sharedCache.set(r,n)}return G.sharedCache.get(r)}};G.sharedCache=new Map;let pe=G;function St(e,t){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new TypeError("Schema validation must be synchronous");return r}function Et(e){return e.issues===void 0}const vr=e=>{throw new Error(`Unhandled case: ${JSON.stringify(e)}`)};function _(e,...t){return t.reduce((r,n)=>n(r),e)}function Ir(...e){return t=>e.reduceRight((r,n)=>n(r),t)}function Cr(e,t){const r=t.payload.widget.uid;if(!r)throw new Error("addWidget: widget must have a uid");return{...e,calculatedWidgets:{...e.calculatedWidgets,[r]:{source:t.payload.widget,current:{}}}}}const ne={calculateCurrentStateError:10,initializeParseError:20,initializeUidCollisionError:21,initializeUnknownError:22,widgetCouldNotBeLoaded:30},R=(e,t)=>{if(e===void 0)throw new Error("obj is undefined");return t.split(".").reduce((r,n)=>r===void 0||n===""?r:Array.isArray(r)?r[parseInt(n,10)]:r[n],e)},Oe=(e,t,r)=>{if(e===null)throw new Error("object is null");if(e===void 0)throw new Error("object is undefined");if(t==="")throw new Error("path cannot be empty");const n=t.split(".");let o=e;for(let s=0;s<n.length-1;s++){const u=n[s],c=n[s+1];(o[u]==null||typeof o[u]!="object")&&(o[u]=wr(c)?[]:{}),o=o[u]}const i=n[n.length-1];return o[i]=r,e};function wr(e){const t=Number(e);return Number.isInteger(t)&&t>=0&&t.toString()===e}const te=(e,t)=>(delete e[t],e);function Ne(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(r=>Ne(r));const t={};for(const r of Object.keys(e))t[r]=Ne(e[r]);return t}const F={FORM:"$form",META:"$meta",ERRORS:"$errors",FORM_IS_INVALID:"$formIsInvalid"},Or=e=>typeof e=="string"&&!e.includes(" ")&&(e.startsWith(`${F.FORM}.`)||e.startsWith(`${F.META}.`)||e.startsWith(`${F.ERRORS}.`)||e===F.FORM_IS_INVALID),Dr=[F.FORM,F.META,F.ERRORS].map(e=>e.replace("$","\\$")).join("|"),Fr=new RegExp(`\\{\\{(?:(?<scope>${Dr})\\.(?<path>[^}]+)|(?<isInvalid>\\${F.FORM_IS_INVALID}))\\}\\}`,"g"),Pr=(e,t)=>typeof e!="string"||!e.includes("{{$")?e:e.replace(Fr,(r,...n)=>{const o=n[n.length-1],{scope:i,path:s,isInvalid:u}=o;try{if(u===F.FORM_IS_INVALID)return t.resolveFormIsInvalid();if(i&&s)switch(i){case F.FORM:return t.resolveFormPath(s);case F.META:return t.resolveMetaPath(s);case F.ERRORS:return t.resolveErrorsPath(s);default:return r}}catch(c){return console.error(`Error resolving Expression: '${e}'`,c),r}return r}),Wr=(e,t)=>{const r=`${F.FORM}.`;if(e.startsWith(r))return t.resolveFormPath(e.replace(r,""));const n=`${F.META}.`;if(e.startsWith(n))return t.resolveMetaPath(e.replace(n,""));const o=`${F.ERRORS}.`;if(e.startsWith(o))return t.resolveErrorsPath(e.replace(o,""));if(e===F.FORM_IS_INVALID)return t.resolveFormIsInvalid()};function ze(e){return e.flatMap(t=>[t,...fe(t)?ze(t.children):[]])}function Je(e){return Object.entries(e.validations).reduce((r,[n,o])=>(o!==null&&(r.$formIsInvalid=!0,Oe(r.$errors,n,[...o])),r),{$formIsInvalid:!1,$errors:{}})}const Qe=32;let Le,p,g,y=e=>(p=0,g=e,y.newline=!1,e=E(),g[p]?z():e||""),z=(e="Unexpected token",t=p,r=g.slice(0,t).split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("rxjs");require("@standard-schema/spec");function at(e,t){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new TypeError("Schema validation must be synchronous");return r}function ft(e){return e.issues===void 0}var Qt=class{constructor(e){this.value=e}map(e){return T(e(this.value))}isOk(){return!0}},qt=class{constructor(e){this.error=e}map(e){return I(this.error)}isOk(){return!1}};function T(e){return new Qt(e)}function I(e){return new qt(e)}var F=class Fe{constructor(t){this.decodeFn=t,this["~standard"]={version:1,vendor:"ts.data.json",validate:r=>{let n=this.decode(r);return n.isOk()?{value:n.value}:{issues:[{message:n.error}]}}},this.decodeToPromise=this.decodePromise,this.chain=this.flatMap}parse(t){let r=this.decode(t);if(r.isOk())return r.value;throw r.error}decode(t){return this.decodeFn(t)}decodePromise(t){return new Promise((r,n)=>{let o=this.decode(t);return o.isOk()?r(o.value):n(o.error)})}map(t){return new Fe(r=>{let n=this.decodeFn(r);return n.isOk()?T(t(n.value)):I(n.error)})}flatMap(t){return new Fe(r=>{let n=this.decodeFn(r);return n.isOk()?t(n.value).decode(r):I(n.error)})}},Yt=(e,t,r)=>`<${e}> decoder failed at index "${t}" with error: ${r}`,Q=(e,t)=>`${JSON.stringify(e)} is not a valid ${t}`;function Le(e,t){return new F(r=>{if(r instanceof Array){let n=[];for(let o=0;o<r.length;o++){let i=e.decode(r[o]);if(i.isOk())n.push(i.value);else return I(Yt(t,o,i.error))}return T(n)}else return I(Q(r,"array"))})}function Zt(){return new F(e=>typeof e=="boolean"?T(e):I(Q(e,"boolean")))}function ht(e){return new F(t=>e().decode(t))}var xt=(e,t)=>`${JSON.stringify(e)} is not exactly ${JSON.stringify(t)}`;function $e(e){return new F(t=>t===e?T(e):I(xt(t,e)))}function Ae(){return new F(e=>typeof e=="number"?T(e):I(Q(e,"number")))}var bt=(e,t,r)=>`<${e}> decoder failed at key "${t}" with error: ${r}`;function ne(e,t){return new F(r=>{if(r!==null&&typeof r=="object"){let n={};for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){let i,s=e[o];if(s instanceof F?i=s.decode(r[o]):i=s.decoder.decode(r[s.fromKey]),i.isOk())n[o]=i.value;else return I(bt(t,o,i.error))}return T(n)}else return I(Q(r,t))})}var er=(e,t)=>`<${e}> decoder failed because ${JSON.stringify(t)} can't be decoded with any of the provided oneOf decoders`;function q(e,t){return new F(r=>{for(let n=0;n<e.length;n++){let o=e[n].decode(r);if(o.isOk())return o}return I(er(t,r))})}function S(e){return new F(t=>t===void 0?T(void 0):e.decode(t))}var tr=(e,t,r)=>`<${e}> record decoder failed at key "${t}" with error: ${r}`;function rr(e,t){return new F(r=>{if(r!==null&&typeof r=="object"){let n={};for(let o in r)if(Object.prototype.hasOwnProperty.call(r,o)){let i=e.decode(r[o]);if(i.isOk())n[o]=i.value;else return I(tr(t,o,i.error))}return T(n)}else return I(Q(r,t))})}function C(){return new F(e=>typeof e=="string"?T(e):I(Q(e,"string")))}function X(){return new F(e=>T(e))}function oe(e,t){return new F(r=>{if(typeof r!="object"||r===null)return I(`<${t}> failed. Expected object literal, got "${typeof r}"`);const n={};for(const[o,i]of Object.entries(e)){const s=i.decoder.decode(r[o]);if(!s.isOk())return I(`<${t}> failed at "${o}" with ${s.error}`);if(n[o]=s.value,i.suffixed){for(const[u,c]of Object.entries(r))if(u.startsWith(o+".")){const p=i.decoder.decode(c);if(!p.isOk())return I(`<${t}> failed at "${u}" with ${p.error}`);n[u]=p.value}}}return T(n)})}const je=()=>crypto.randomUUID().slice(0,8),nr=e=>typeof e!="function"&&e.kind==="display",ee=e=>typeof e!="function"&&e.kind==="action",D=e=>typeof e!="function"&&e.kind==="input",Te=e=>typeof e!="function"&&e.kind==="layout",ie=e=>typeof e=="function",or=ne({in:Le(C(),"In[]")},"In"),Me=ne({when:C()},"When"),Se=q([or,Me],"In | When"),ir=ne({from:Le(C(),"From[]")},"From"),Ee=q([ir,Me],"Exclude"),We=q([Zt(),Me],"Bool | When"),sr=new F(e=>{const t=typeof e;return t==="function"?T(e):I(`Expected a function, got '${t}'`)}),M=e=>q([e,sr],""),Ve=oe({load:{suffixed:!0,decoder:M(S(C()))},click:{suffixed:!0,decoder:M(S(C()))},change:{suffixed:!0,decoder:M(S(C()))},filter:{suffixed:!0,decoder:M(S(C()))},blur:{suffixed:!0,decoder:M(S(C()))}},"On"),dr=ne({key:C(),default:S(C()),params:X()},"TranslationConfig"),pt=q([C(),dr],"Localizable"),ve=S(C()).map(e=>e||je()),ur=oe({kind:{decoder:$e("display")},uid:{decoder:ve},type:{decoder:C()},size:{suffixed:!0,decoder:S(Ae())},include:{decoder:S(Se)},exclude:{decoder:S(Ee)},props:{decoder:S(X())}},"DisplayWidget"),cr=oe({kind:{decoder:$e("action")},uid:{decoder:ve},type:{decoder:C()},size:{suffixed:!0,decoder:S(Ae())},include:{decoder:S(Se)},exclude:{decoder:S(Ee)},label:{suffixed:!0,decoder:M(pt)},disabled:{suffixed:!0,decoder:S(We)},on:{decoder:S(Ve)},props:{decoder:S(X())}},"ActionWidget"),lr=new F(e=>{const t=typeof e;if(t==="function"){const r=e,n=r(void 0);return r.uid=n.uid||je(),r.type=n.type,r.path=n.path,T(r)}else return I(`Expected a function, got '${t}'`)}),ar=oe({kind:{decoder:$e("input")},uid:{decoder:ve},type:{decoder:C()},size:{suffixed:!0,decoder:S(Ae())},include:{decoder:S(Se)},exclude:{decoder:S(Ee)},disabled:{suffixed:!0,decoder:S(We)},readonly:{suffixed:!0,decoder:S(We)},on:{decoder:S(Ve)},props:{decoder:S(X())},label:{suffixed:!0,decoder:M(S(pt))},path:{decoder:C()},defaultValue:{decoder:S(X())},validator:{suffixed:!0,decoder:M(S(X()))}},"InputWidget").map(e=>{const t={...e};if(e.uid||(t.uid=`${e.path}-${e.type}`),e.type==="repeater"){const r=e.props;r.template=Be.parse(r.template)}return t}),fr=ht(()=>q([lr,ar,Be,ur,cr],"FormWidget")),Be=oe({kind:{decoder:$e("layout")},uid:{decoder:ve},type:{decoder:C()},size:{suffixed:!0,decoder:S(Ae())},include:{decoder:S(Se)},exclude:{decoder:S(Ee)},props:{decoder:S(X())},on:{decoder:S(Ve)},children:{decoder:Le(fr,"FormWidget[]")}},"LayoutWidget"),G=class G{constructor(){this.widgetLoaders={},this._ready=!1}get ready(){return this._ready}setWidgetLoaders(t){this.widgetLoaders=t,this._ready=!0}async loadWidget(t){const r=this.widgetLoaders[t];if(!G.sharedCache.has(r)){const n=r().catch(o=>(G.sharedCache.delete(r),Promise.reject(o)));G.sharedCache.set(r,n)}return G.sharedCache.get(r)}};G.sharedCache=new Map;let Re=G;function hr(e){return{...e,form:{uid:"",type:"flex",kind:"layout",children:e.form}}}const gt=ne({states:S(rr(C(),"states")),form:ht(()=>Be)},"FormDef"),mt=e=>({formName:"",formDef:gt.parse({form:{kind:"layout",type:"flex",children:[]}}),flatForm:{},currentStates:[],calculatedWidgets:{},validations:{},touchedControls:{},injectedValidations:{},widgetFlags:{},widgetPropOverrides:{},data:{},meta:{},formHealth:{status:"ok"},touched:!1,lang:e}),pr=e=>!(typeof e!="object"||e===null||typeof e.key!="string");function gr(e){const t=new Intl.Locale(e).maximize().script;return["Arab","Hebr","Thaa","Syrc","Tfng","Adlm","Rohg"].includes(t||"")?"rtl":"ltr"}const yt=(e=navigator.language||"en-US")=>{const t=new Set;return{get lang(){return e},translate(n){return n},subscribe(n){return t.add(n),()=>{t.delete(n)}},setLang(n){e=n,t.forEach(o=>o(e))}}},mr=e=>{throw new Error(`Unhandled case: ${JSON.stringify(e)}`)};function _(e,...t){return t.reduce((r,n)=>n(r),e)}function yr(e,t){const r=t.payload.widget.uid;if(!r)throw new Error("addWidget: widget must have a uid");return{...e,calculatedWidgets:{...e.calculatedWidgets,[r]:{source:t.payload.widget,current:{}}}}}const b={calculateCurrentStateError:10,initializeParseError:20,initializeUidCollisionError:21,initializeUnknownError:22,widgetCouldNotBeLoaded:30},k=(e,t)=>{if(e===void 0)throw new Error("obj is undefined");return t.split(".").reduce((r,n)=>r===void 0||n===""?r:Array.isArray(r)?r[parseInt(n,10)]:r[n],e)},He=(e,t,r)=>{if(e===null)throw new Error("object is null");if(e===void 0)throw new Error("object is undefined");if(t==="")throw new Error("path cannot be empty");const n=t.split(".");let o=e;for(let s=0;s<n.length-1;s++){const u=n[s],c=n[s+1];(o[u]==null||typeof o[u]!="object")&&(o[u]=$r(c)?[]:{}),o=o[u]}const i=n[n.length-1];return o[i]=r,e};function $r(e){const t=Number(e);return Number.isInteger(t)&&t>=0&&t.toString()===e}const ue=(e,t)=>(delete e[t],e);function ke(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(r=>ke(r));const t={};for(const r of Object.keys(e))t[r]=ke(e[r]);return t}const P={FORM:"$form",META:"$meta",ERRORS:"$errors",FORM_IS_INVALID:"$formIsInvalid"},Ar=e=>typeof e=="string"&&!e.includes(" ")&&(e.startsWith(`${P.FORM}.`)||e.startsWith(`${P.META}.`)||e.startsWith(`${P.ERRORS}.`)||e===P.FORM_IS_INVALID),Sr=[P.FORM,P.META,P.ERRORS].map(e=>e.replace("$","\\$")).join("|"),Er=new RegExp(`\\{\\{(?:(?<scope>${Sr})\\.(?<path>[^}]+)|(?<isInvalid>\\${P.FORM_IS_INVALID}))\\}\\}`,"g"),vr=(e,t)=>typeof e!="string"||!e.includes("{{$")?e:e.replace(Er,(r,...n)=>{const o=n[n.length-1],{scope:i,path:s,isInvalid:u}=o;try{if(u===P.FORM_IS_INVALID)return t.resolveFormIsInvalid();if(i&&s)switch(i){case P.FORM:return t.resolveFormPath(s);case P.META:return t.resolveMetaPath(s);case P.ERRORS:return t.resolveErrorsPath(s);default:return r}}catch(c){return console.error(`Error resolving Expression: '${e}'`,c),r}return r}),Ir=(e,t)=>{const r=`${P.FORM}.`;if(e.startsWith(r))return t.resolveFormPath(e.replace(r,""));const n=`${P.META}.`;if(e.startsWith(n))return t.resolveMetaPath(e.replace(n,""));const o=`${P.ERRORS}.`;if(e.startsWith(o))return t.resolveErrorsPath(e.replace(o,""));if(e===P.FORM_IS_INVALID)return t.resolveFormIsInvalid()};function Ge(e){return e.flatMap(t=>[t,...Te(t)?Ge(t.children):[]])}function Ke(e){return Object.entries(e.validations).reduce((r,[n,o])=>(o!==null&&(r.$formIsInvalid=!0,He(r.$errors,n,[...o])),r),{$formIsInvalid:!1,$errors:{}})}const Xe=32;let _e,h,g,y=e=>(h=0,g=e,y.newline=!1,e=E(),g[h]?z():e||""),z=(e="Unexpected token",t=h,r=g.slice(0,t).split(`
2
2
  `),n=r.pop(),o=g.slice(Math.max(0,t-40),t),i="̭",s=(g[t]||" ")+i,u=g.slice(t+1,t+20))=>{throw SyntaxError(`${e} at ${r.length+1}:${n.length+1}
3
3
  ${g[t-41]!==`
4
- `,""+o}${s}${u}`)},vt=(e,t=p)=>(Array.isArray(e)&&(e.loc=t),e),Z=(e,t=p,r)=>{for(;r=e(g.charCodeAt(p));)p+=r;return g.slice(t,p)},w=(e=1)=>g[p+=e],Me=e=>p=e,E=(e=0,t)=>{let r,n,o,i,s;for(t&&y.asi&&(y.newline=!1);(r=y.space())&&(s=y.newline,1)&&r!==t&&(o=(n&&r===91&&Le&&y.asi?.(n,e,E)||null)??((i=k[r])&&i(n,e))??(n&&s&&y.asi?.(n,e,E))??(!n&&Z(y.id)));)n=o;return t&&(r==t?(p++,t===125&&y.asi&&(y.newline=!0)):z("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),n},B=(e,t=p)=>{for(Le=!1;(e=g.charCodeAt(p))<=Qe;)y.asi&&e===10&&(y.newline=Le=!0),p++;return e},Tr=(e=p)=>{for(;g.charCodeAt(e)<=Qe;)e++;return g.charCodeAt(e)};y.id=e=>e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e==36||e==95||e>=192&&e!=215&&e!=247;let Rr=(e,t=e.length)=>g.substr(p,t)===e&&!y.id(g.charCodeAt(p+t)),k=[],ct={},T=(e,t=Qe,r,n=e.charCodeAt(0),o=e.length,i=k[n],s=e.toUpperCase()!==e,u,c)=>(t=ct[e]=!i&&ct[e]||t,k[n]=(h,A,m,f=p)=>(u=m,(m?e==m:(o<2||e.charCodeAt(1)===g.charCodeAt(p+1)&&(o<3||g.substr(p,o)==e))&&(!s||!y.id(g.charCodeAt(p+o)))&&(u=m=e))&&A<t&&(p+=o,(c=r(h))?vt(c,f):(p=f,u=0,!s&&!i&&!h&&z()),c)||i?.(h,A,u))),$=(e,t,r=!1)=>T(e,t,n=>n&&(o=>o&&[e,n,o])(E(t-(r?.5:0)))),H=(e,t,r)=>T(e,t,n=>!n&&(n=E(t-.5))&&[e,n]),ue=(e,t)=>T(e,200,r=>!r&&[,t]),It=(e,t,r)=>T(e,t,(n,o)=>(o=E(t-(r?.5:0)),n?.[0]!==e&&(n=[e,n||null]),o?.[0]===e?n.push(...o.slice(1)):n.push(o||null),n)),qe=(e,t)=>T(e[0],t,r=>!r&&[e,E(0,e.charCodeAt(1))||null]),Ct=(e,t)=>T(e[0],t,r=>r&&[e,r,E(0,e.charCodeAt(1))||null]),ce=(e,t,r,n=e.charCodeAt(0),o=e.length,i=k[n],s)=>k[n]=(u,c,h,A=p)=>!u&&(h?e==h:(o<2||g.substr(p,o)==e)&&(h=e))&&c<t&&!y.id(g.charCodeAt(p+o))&&(!y.prop||y.prop(p+o))&&(Me(p+o),(s=r())?vt(s,A):Me(A),s)||i?.(u,c,h);Object.defineProperty(y,"space",{configurable:!0,enumerable:!0,get:()=>B,set:e=>B=e});const je={},l=(e,t,r=je[e])=>je[e]=(...n)=>t(...n)||r?.(...n),d=e=>Array.isArray(e)?e[0]==null?(t=>()=>t)(e[1]):je[e[0]]?.(...e.slice(1))??z(`Unknown operator: ${e[0]}`,e?.loc):e===void 0?()=>{}:t=>t?.[e],he=46,oe=48,ge=57,kr=69,_r=101,Ur=43,Nr=45,ae=95,wt=110,Lr=97,Mr=102,jr=65,Vr=70,Ot=e=>e.indexOf("_")<0?e:e.replaceAll("_",""),xe=e=>{let t=Ot(Z(r=>r===he&&g.charCodeAt(p+1)!==he||r>=oe&&r<=ge||r===ae||((r===kr||r===_r)&&((r=g.charCodeAt(p+1))>=oe&&r<=ge||r===Ur||r===Nr)?2:0)));return g.charCodeAt(p)===wt?(w(),[,BigInt(t)]):(e=+t)!=e?z():[,e]},Br={2:e=>e===48||e===49||e===ae,8:e=>e>=48&&e<=55||e===ae,16:e=>e>=oe&&e<=ge||e>=Lr&&e<=Mr||e>=jr&&e<=Vr||e===ae};y.number=null;k[he]=e=>!e&&g.charCodeAt(p+1)!==he&&xe();for(let e=oe;e<=ge;e++)k[e]=t=>t?void 0:xe();k[oe]=e=>{if(e)return;const t=y.number;if(t){for(const[r,n]of Object.entries(t))if(r[0]==="0"&&g[p+1]?.toLowerCase()===r[1]){w(2);const o=Ot(Z(Br[n]));return g.charCodeAt(p)===wt?(w(),[,BigInt("0"+r[1]+o)]):[,parseInt(o,n)]}}return xe()};const Hr=92,lt=34,at=39,Gr={n:`
5
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},Dt=e=>(t,r,n="")=>{if(!(t||!y.string?.[String.fromCharCode(e)]))return w(),Z(o=>o-e&&(o===Hr?(n+=Gr[g[p+1]]||g[p+1],2):(n+=g[p],1))),g[p]===String.fromCharCode(e)?w():z("Bad string"),[,n]};k[lt]=Dt(lt);k[at]=Dt(at);y.string={'"':!0};const Kr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(e=>$(e,Kr,!0));const Ft=(e,t,r,n)=>typeof e=="string"?o=>t(o,e,o):e[0]==="."?(r=d(e[1]),n=e[2],o=>t(r(o),n,o)):e[0]==="[]"&&e.length===3?(r=d(e[1]),n=d(e[2]),o=>t(r(o),n(o),o)):e[0]==="()"&&e.length===2?Ft(e[1],t):(()=>{throw Error("Invalid assignment target")})(),ft={"=":(e,t,r)=>e[t]=r,"+=":(e,t,r)=>e[t]+=r,"-=":(e,t,r)=>e[t]-=r,"*=":(e,t,r)=>e[t]*=r,"/=":(e,t,r)=>e[t]/=r,"%=":(e,t,r)=>e[t]%=r,"|=":(e,t,r)=>e[t]|=r,"&=":(e,t,r)=>e[t]&=r,"^=":(e,t,r)=>e[t]^=r,">>=":(e,t,r)=>e[t]>>=r,"<<=":(e,t,r)=>e[t]<<=r};for(const e in ft)l(e,(t,r)=>(r=d(r),Ft(t,(n,o,i)=>ft[e](n,o,r(i)))));const Xr=30,zr=40,Jr=140;H("!",Jr);$("||",Xr);$("&&",zr);l("!",e=>(e=d(e),t=>!e(t)));l("||",(e,t)=>(e=d(e),t=d(t),r=>e(r)||t(r)));l("&&",(e,t)=>(e=d(e),t=d(t),r=>e(r)&&t(r)));const Qr=50,qr=60,xr=70,Pt=100,Yr=140;$("|",Qr);$("&",xr);$("^",qr);$(">>",Pt);$("<<",Pt);H("~",Yr);l("~",e=>(e=d(e),t=>~e(t)));l("|",(e,t)=>(e=d(e),t=d(t),r=>e(r)|t(r)));l("&",(e,t)=>(e=d(e),t=d(t),r=>e(r)&t(r)));l("^",(e,t)=>(e=d(e),t=d(t),r=>e(r)^t(r)));l(">>",(e,t)=>(e=d(e),t=d(t),r=>e(r)>>t(r)));l("<<",(e,t)=>(e=d(e),t=d(t),r=>e(r)<<t(r)));const De=90;$("<",De);$(">",De);$("<=",De);$(">=",De);l(">",(e,t)=>(e=d(e),t=d(t),r=>e(r)>t(r)));l("<",(e,t)=>(e=d(e),t=d(t),r=>e(r)<t(r)));l(">=",(e,t)=>(e=d(e),t=d(t),r=>e(r)>=t(r)));l("<=",(e,t)=>(e=d(e),t=d(t),r=>e(r)<=t(r)));const Wt=80;$("==",Wt);$("!=",Wt);l("==",(e,t)=>(e=d(e),t=d(t),r=>e(r)==t(r)));l("!=",(e,t)=>(e=d(e),t=d(t),r=>e(r)!=t(r)));const Tt=110,Ye=120,Rt=140;$("+",Tt);$("-",Tt);$("*",Ye);$("/",Ye);$("%",Ye);H("+",Rt);H("-",Rt);l("+",(e,t)=>t!==void 0?(e=d(e),t=d(t),r=>e(r)+t(r)):(e=d(e),r=>+e(r)));l("-",(e,t)=>t!==void 0?(e=d(e),t=d(t),r=>e(r)-t(r)):(e=d(e),r=>-e(r)));l("*",(e,t)=>(e=d(e),t=d(t),r=>e(r)*t(r)));l("/",(e,t)=>(e=d(e),t=d(t),r=>e(r)/t(r)));l("%",(e,t)=>(e=d(e),t=d(t),r=>e(r)%t(r)));const me=150;T("++",me,e=>e?["++",e,null]:["++",E(me-1)]);T("--",me,e=>e?["--",e,null]:["--",E(me-1)]);const Ze=(e,t,r,n)=>typeof e=="string"?o=>t(o,e):e[0]==="."?(r=d(e[1]),n=e[2],o=>t(r(o),n)):e[0]==="[]"&&e.length===3?(r=d(e[1]),n=d(e[2]),o=>t(r(o),n(o))):e[0]==="()"&&e.length===2?Ze(e[1],t):(()=>{throw Error("Invalid increment target")})();l("++",(e,t)=>Ze(e,t===null?(r,n)=>r[n]++:(r,n)=>++r[n]));l("--",(e,t)=>Ze(e,t===null?(r,n)=>r[n]--:(r,n)=>--r[n]));const Zr=5,br=10;It(",",br);It(";",Zr,!0);const kt=(...e)=>(e=e.map(d),t=>{let r;for(const n of e)r=n(t);return r});l(",",kt);l(";",kt);const en=170;qe("()",en);const V=e=>e?.[0]==="_"&&e[1]==="_"||e==="constructor"||e==="prototype",be=170;Ct("[]",be);$(".",be);Ct("()",be);const ye=e=>{throw Error(e)};l("[]",(e,t)=>t===void 0?(e=e?e[0]===","?e.slice(1):[e]:[],e=e.map(r=>r==null?(()=>{}):r[0]==="..."?(r=d(r[1]),n=>r(n)):(r=d(r),n=>[r(n)])),r=>e.flatMap(n=>n(r))):(t==null&&ye("Missing index"),e=d(e),t=d(t),r=>{const n=t(r);return V(n)?void 0:e(r)[n]}));l(".",(e,t)=>(e=d(e),t=t[0]?t:t[1],V(t)?()=>{}:r=>e(r)[t]));l("()",(e,t)=>{if(t===void 0)return e==null?ye("Empty ()"):d(e);const r=o=>o?.[0]===","&&o.slice(1).some(i=>i==null||r(i));r(t)&&ye("Empty argument");const n=t?t[0]===","?(t=t.slice(1).map(d),o=>t.map(i=>i(o))):(t=d(t),o=>[t(o)]):()=>[];return et(e,(o,i,s)=>o[i](...n(s)))});const J=e=>typeof e=="string"||Array.isArray(e)&&(e[0]==="."||e[0]==="?."||e[0]==="[]"&&e.length===3||e[0]==="?.[]"||e[0]==="()"&&e.length===2&&J(e[1])||e[0]==="{}"),et=(e,t,r,n)=>e==null?ye("Empty ()"):e[0]==="()"&&e.length==2?et(e[1],t):typeof e=="string"?o=>t(o,e,o):e[0]==="."?(r=d(e[1]),n=e[2],o=>t(r(o),n,o)):e[0]==="?."?(r=d(e[1]),n=e[2],o=>{const i=r(o);return i==null?void 0:t(i,n,o)}):e[0]==="[]"&&e.length===3?(r=d(e[1]),n=d(e[2]),o=>t(r(o),n(o),o)):e[0]==="?.[]"?(r=d(e[1]),n=d(e[2]),o=>{const i=r(o);return i==null?void 0:t(i,n(o),o)}):(e=d(e),o=>t([e(o)],0,o)),b=et,tn=32,rn=y.space;y.comment??={"//":`
6
- `,"/*":"*/"};let We;y.space=()=>{We||(We=Object.entries(y.comment).map(([o,i])=>[o,i,o.charCodeAt(0)]));for(var e;e=rn();){for(var t=0,r;r=We[t++];)if(e===r[2]&&g.substr(p,r[0].length)===r[0]){var n=p+r[0].length;if(r[1]===`
7
- `)for(;g.charCodeAt(n)>=tn;)n++;else{for(;g[n]&&g.substr(n,r[1].length)!==r[1];)n++;g[n]&&(n+=r[1].length)}Me(n),e=0;break}if(e)return e}return e};const _t=80;$("===",_t);$("!==",_t);l("===",(e,t)=>(e=d(e),t=d(t),r=>e(r)===t(r)));l("!==",(e,t)=>(e=d(e),t=d(t),r=>e(r)!==t(r)));const nn=30;$("??",nn);l("??",(e,t)=>(e=d(e),t=d(t),r=>e(r)??t(r)));const on=130,sn=20;$("**",on,!0);$("**=",sn,!0);l("**",(e,t)=>(e=d(e),t=d(t),r=>e(r)**t(r)));const dn=e=>{throw Error(e)};l("**=",(e,t)=>(J(e)||dn("Invalid assignment target"),t=d(t),b(e,(r,n,o)=>r[n]**=t(o))));const Ut=90;$("in",Ut);$("of",Ut);l("in",(e,t)=>(e=d(e),t=d(t),r=>e(r)in t(r)));const un=20,cn=100,ln=e=>{throw Error(e)};$(">>>",cn);$(">>>=",un,!0);l(">>>",(e,t)=>(e=d(e),t=d(t),r=>e(r)>>>t(r)));l(">>>=",(e,t)=>(J(e)||ln("Invalid assignment target"),t=d(t),b(e,(r,n,o)=>r[n]>>>=t(o))));const tt=5,an=10,fn=20,pn=e=>e[0]?.[0]===","?e[0].slice(1):e,$e=(e,t,r)=>{if(typeof e=="string"){r[e]=t;return}const[n,...o]=e,i=pn(o);if(n==="{}"){const s=[];for(const u of i){if(Array.isArray(u)&&u[0]==="..."){const f={};for(const O in t)s.includes(O)||(f[O]=t[O]);r[u[1]]=f;break}let c,h,A;typeof u=="string"?c=h=u:u[0]==="="?(typeof u[1]=="string"?c=h=u[1]:[,c,h]=u[1],A=u[2]):[,c,h]=u,s.push(c);let m=t[c];m===void 0&&A&&(m=d(A)(r)),$e(h,m,r)}}else if(n==="[]"){let s=0;for(const u of i){if(u===null){s++;continue}if(Array.isArray(u)&&u[0]==="..."){r[u[1]]=t.slice(s);break}let c=u,h;Array.isArray(u)&&u[0]==="="&&([,c,h]=u);let A=t[s++];A===void 0&&h&&(A=d(h)(r)),$e(c,A,r)}}},Nt=e=>{let t=E(an-1);return t?.[0]==="in"||t?.[0]==="of"?[t[0],[e,t[1]],t[2]]:t?.[0]===","?[e,...t.slice(1)]:[e,t]};ce("let",tt+1,()=>Nt("let"));ce("const",tt+1,()=>Nt("const"));ce("var",tt,()=>(B(),["var",E(fn)]));const Lt=(...e)=>(e=e.map(t=>{if(typeof t=="string")return r=>{r[t]=void 0};if(t[0]==="="){const[,r,n]=t,o=d(n);return typeof r=="string"?i=>{i[r]=o(i)}:i=>$e(r,o(i),i)}return d(t)}),t=>{for(const r of e)r(t)});l("let",Lt);l("const",Lt);l("var",e=>typeof e=="string"?t=>{t[e]=void 0}:()=>{});const rt=20,Fe=e=>{throw Error(e)};$("||=",rt,!0);$("&&=",rt,!0);$("??=",rt,!0);l("=",(e,t)=>{if(Array.isArray(e)&&(e[0]==="let"||e[0]==="const"||e[0]==="var")){const r=e[1];return t=d(t),typeof r=="string"?n=>{n[r]=t(n)}:n=>$e(r,t(n),n)}return J(e)||Fe("Invalid assignment target"),t=d(t),b(e,(r,n,o)=>r[n]=t(o))});l("||=",(e,t)=>(J(e)||Fe("Invalid assignment target"),t=d(t),b(e,(r,n,o)=>r[n]||=t(o))));l("&&=",(e,t)=>(J(e)||Fe("Invalid assignment target"),t=d(t),b(e,(r,n,o)=>r[n]&&=t(o))));l("??=",(e,t)=>(J(e)||Fe("Invalid assignment target"),t=d(t),b(e,(r,n,o)=>r[n]??=t(o))));ue("true",!0);ue("false",!1);ue("null",null);ce("undefined",200,()=>[]);ue("NaN",NaN);ue("Infinity",1/0);const Te=20;T("?",Te,(e,t,r)=>e&&(t=E(Te-1))&&Z(n=>n===58)&&(r=E(Te-1),["?",e,t,r]));l("?",(e,t,r)=>(e=d(e),t=d(t),r=d(r),n=>e(n)?t(n):r(n)));const hn=[],gn=20;$("=>",gn,!0);l("=>",(e,t)=>{e=e?.[0]==="()"?e[1]:e;const r=e?e[0]===","?e.slice(1):[e]:[];let n=-1,o=null;const i=r[r.length-1];Array.isArray(i)&&i[0]==="..."&&(n=r.length-1,o=i[1],r.length--);const s=t?.[0]==="{}";return t=d(s?["{",t[1]]:t),u=>(...c)=>{const h={};r.forEach((m,f)=>h[m]=c[f]),o&&(h[o]=c.slice(n));const A=new Proxy(h,{get:(m,f)=>f in m?m[f]:u?.[f],set:(m,f,O)=>((f in m?m:u)[f]=O,!0),has:(m,f)=>f in m||(u?f in u:!1)});try{const m=t(A);return s?void 0:m}catch(m){if(m===hn)return m[0];throw m}}});const mn=140;H("...",mn);l("...",e=>(e=d(e),t=>Object.entries(e(t))));const pt=170;T("?.",pt,(e,t)=>{if(!e)return;const r=B();return r===40?(w(),["?.()",e,E(0,41)||null]):r===91?(w(),["?.[]",e,E(0,93)]):(t=E(pt),t?["?.",e,t]:void 0)});l("?.",(e,t)=>(e=d(e),V(t)?()=>{}:r=>e(r)?.[t]));l("?.[]",(e,t)=>(e=d(e),t=d(t),r=>{const n=t(r);return V(n)?void 0:e(r)?.[n]}));l("?.()",(e,t)=>{const r=t?t[0]===","?(t=t.slice(1).map(d),o=>t.map(i=>i(o))):(t=d(t),o=>[t(o)]):()=>[];if(e[0]==="?."){const o=d(e[1]),i=e[2];return V(i)?()=>{}:s=>o(s)?.[i]?.(...r(s))}if(e[0]==="?.[]"){const o=d(e[1]),i=d(e[2]);return s=>{const u=o(s),c=i(s);return V(c)?void 0:u?.[c]?.(...r(s))}}if(e[0]==="."){const o=d(e[1]),i=e[2];return V(i)?()=>{}:s=>o(s)?.[i]?.(...r(s))}if(e[0]==="[]"&&e.length===3){const o=d(e[1]),i=d(e[2]);return s=>{const u=o(s),c=i(s);return V(c)?void 0:u?.[c]?.(...r(s))}}const n=d(e);return o=>n(o)?.(...r(o))});const ie=140;H("typeof",ie);H("void",ie);H("delete",ie);ce("new",ie,()=>Rr(".target")?(w(7),["new.target"]):["new",E(ie)]);l("typeof",e=>(e=d(e),t=>typeof e(t)));l("void",e=>(e=d(e),t=>(e(t),void 0)));l("delete",e=>{if(e[0]==="."){const t=d(e[1]),r=e[2];return n=>delete t(n)[r]}if(e[0]==="[]"){const t=d(e[1]),r=d(e[2]);return n=>delete t(n)[r(n)]}return()=>!0});l("new",e=>{const t=d(e?.[0]==="()"?e[1]:e),r=e?.[0]==="()"?e[2]:null,n=r?r[0]===","?(o=>i=>o.map(s=>s(i)))(r.slice(1).map(d)):(o=>i=>[o(i)])(d(r)):()=>[];return o=>new(t(o))(...n(o))});const nt=Symbol("accessor"),ot=20,yn=40,Mt=41,jt=123,Vt=125,Bt=e=>t=>{if(t)return;B();const r=Z(y.id);if(!r||(B(),g.charCodeAt(p)!==yn))return!1;w();const n=E(0,Mt);return B(),g.charCodeAt(p)!==jt?!1:(w(),[e,r,n,E(0,Vt)])};T("get",ot-1,Bt("get"));T("set",ot-1,Bt("set"));T("(",ot-1,e=>{if(!e||typeof e!="string")return;const t=E(0,Mt)||null;if(B(),g.charCodeAt(p)===jt)return w(),[":",e,["=>",["()",t],E(0,Vt)||null]]});l("get",(e,t)=>(t=t?d(t):()=>{},r=>[[nt,e,{get:function(){const n=Object.create(r||{});return n.this=this,t(n)}}]]));l("set",(e,t,r)=>(r=r?d(r):()=>{},n=>[[nt,e,{set:function(o){const i=Object.create(n||{});i.this=this,i[t]=o,r(i)}}]]));const $n=20,Ht=200;y.prop=e=>Tr(e)!==58;const An=e=>e==null||typeof e=="string"||[":",",","...","get","set"].includes(e[0]);qe("[]",Ht);qe("{}",Ht);$(":",$n-1,!0);l("{}",(e,t)=>{if(t!==void 0)return;if(!An(e))return d(["{",e]);e=e?e[0]!==","?[e]:e.slice(1):[];const r=e.map(n=>d(typeof n=="string"?[":",n,n]:n));return n=>{const o={},i={};for(const s of r.flatMap(u=>u(n)))if(s[0]===nt){const[,u,c]=s;i[u]={...i[u],...c,configurable:!0,enumerable:!0}}else o[s[0]]=s[1];for(const s in i)Object.defineProperty(o,s,i[s]);return o}});l("{",e=>(e=e?d(e):()=>{},t=>e(Object.create(t))));l(":",(e,t)=>(t=d(t),Array.isArray(e)?(e=d(e),r=>[[e(r),t(r)]]):r=>[[e,t(r)]]));const Sn=170,Ae=96,En=36,vn=123,In=92,Cn={n:`
8
- `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},ht=()=>{const e=[];for(let t="",r;(r=g.charCodeAt(p))!==Ae;)r?r===In?(w(),t+=Cn[g[p]]||g[p],w()):r===En&&g.charCodeAt(p+1)===vn?(t&&e.push([,t]),t="",w(2),e.push(E(0,125))):(t+=g[p],w(),r=g.charCodeAt(p),r===Ae&&t&&e.push([,t])):z("Unterminated template");return w(),e},wn=k[Ae];k[Ae]=(e,t)=>e&&t<Sn?y.asi&&y.newline?void 0:(w(),["``",e,...ht()]):e?wn?.(e,t):(w(),(r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r])(ht()));l("`",(...e)=>(e=e.map(d),t=>e.map(r=>r(t)).join("")));l("``",(e,...t)=>{e=d(e);const r=[],n=[];for(const i of t)Array.isArray(i)&&i[0]===void 0?r.push(i[1]):n.push(d(i));const o=Object.assign([...r],{raw:r});return i=>e(i)(o,...n.map(s=>s(i)))});y.string["'"]=!0;y.number={"0x":16,"0b":2,"0o":8};const Gt={log:(e,t)=>(t?console.log(t,e):console.log(e),e)};function N(e,t,r,n,o){const i=y(On(e));return d(i)({$form:t,$meta:r,$errors:n,$formIsInvalid:o,$log:Gt.log})===!0}function On(e){return e.replace(/\?\.(\d+)/g,"?.[$1]").replace(/\.(\d+)/g,"[$1]")}const L=e=>{let t=e.formDef.states;if(!t||Object.keys(t).length===0||e.formHealth.status==="errored")return e;const{$formIsInvalid:r,$errors:n}=Je(e);t=Dn(t);let o=[],i={status:"ok"};try{o=Object.keys(t).map(s=>{const u=t[s];let c;try{c=N(u,e.data,e.meta,n,r)}catch{c=!1}return c===!0?s:void 0}).filter(s=>s!==void 0)}catch(s){const u=s,c=ne.calculateCurrentStateError;i={status:"errored",message:`[${c}] ${u.message}`,code:c}}return{...e,currentStates:o,formHealth:i}};function Dn(e){const t={};function r(n){const o=n.split(":"),i=[];for(let s=0;s<o.length;s++)i.push(o.slice(0,s+1).join(":"));return i}for(const[n,o]of Object.entries(e)){const i=r(n),s=[];for(const u of i)e[u]&&s.push(`(${e[u]})`);t[n]=s.join(" && ")}return t}const Pe=Symbol("filterMap.skip");function it(e,t){const r=[];for(let n=0;n<e.length;n++){const o=t(e[n],n,e);o!==Pe&&r.push(o)}return r}function Fn(e,t,r){for(let n=0;n<e.length;n++)t(e[n],n,e)&&r(e[n],n,e)}function Kt(e,t,r,n){let o=n;for(let i=0;i<e.length;i++)t(e[i],i,e)&&(o=r(o,e[i],i,e));return o}function Xt(e,t,r){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n],n,e,t))return!1;return!0}function zt(e,t){const r=st(e.uid,t);return D(e)?{...e,uid:r,path:Pn(e.path,t)}:{...e,uid:r}}function st(e,t){if(t.length===0)throw new Error("Repeater indexes cannot be an empty array");const r=t.reduce((n,o)=>`${n}[${o}]`,"");return`${e}${r}`}function Pn(e,t){if(t.length===0)throw new Error("Repeater indexes cannot be an empty array");const r="items",n=e.split(`.${r}`),o=n.length-1;if(o!==t.length)throw new Error(`Path contains ${o} '${r}' occurrences, but ${t.length} indexes were provided.`);return n.reduce((i,s,u)=>u===0?s:`${i}.${t[u-1]}${s}`)}function re(e,t){let r=0;return e.replace(/\.items(\??)\./g,(n,o)=>{const i=t[r++];return i===void 0?n:`.${i}${o}.`})}const le=(e,t)=>r=>e(r)?t(r):r,K=e=>e!==void 0&&typeof e=="object"&&e!==null&&"when"in e,M=e=>{const{$formIsInvalid:t,$errors:r}=Je(e);return{...e,widgetFlags:{...Wn(e,r,t),...Tn(e,r,t)}}};function Wn(e,t,r){return it(Object.values(e.flatForm),n=>{if(n.uid?.includes("["))return Pe;if(Y(n)){const o=n({$form:e.data,errors:void 0,touched:void 0,translate:void 0});return o.uid=n.uid,o}return n}).filter(n=>!!(n.include&&("in"in n.include||"when"in n.include)||n.exclude&&("from"in n.exclude||"when"in n.exclude)||(D(n)||Q(n))&&K(n.disabled)||D(n)&&K(n.readonly))).reduce((n,o)=>(n[o.uid]=n[o.uid]||{},o.include&&"in"in o.include?n[o.uid].hidden=!o.include.in.some(i=>e.currentStates.includes(i)):o.include&&"when"in o.include&&(n[o.uid].hidden=!N(o.include.when,e.data,e.meta,t,r)),o.exclude&&"from"in o.exclude?n[o.uid].hidden=o.exclude.from.some(i=>e.currentStates.includes(i)):o.exclude&&"when"in o.exclude&&(n[o.uid].hidden=N(o.exclude.when,e.data,e.meta,t,r)),(D(o)||Q(o))&&K(o.disabled)&&(n[o.uid].disabled=N(o.disabled.when,e.data,e.meta,t,r)),D(o)&&K(o.readonly)&&(n[o.uid].readonly=N(o.readonly.when,e.data,e.meta,t,r)),n),{})}function Tn(e,t,r){return Kt(Object.values(e.flatForm),n=>!Y(n)&&n.type==="repeater",(n,o)=>({...n,...Jt(e,o,[],t,r)}),{})}function Jt(e,t,r,n,o){const i=t.props.template,s=R(e.data,t.path);if(!Array.isArray(s))return{};const u={};return s.forEach((c,h)=>{const A=[...r,h];ze([i]).forEach(m=>{let f;if(Y(m)?(f=m({$form:e.data,errors:void 0,touched:void 0,translate:void 0}),f.uid=m.uid):f=m,f.type==="repeater"){const ee=zt(f,A);Object.assign(u,Jt(e,ee,A,n,o));return}const O=st(f.uid,A);u[O]=u[O]||{},f.include&&"in"in f.include?u[O].hidden=!f.include.in.some(ee=>e.currentStates.includes(ee)):f.include&&"when"in f.include&&(u[O].hidden=!N(re(f.include.when,A),e.data,e.meta,n,o)),f.exclude&&"from"in f.exclude?u[O].hidden=f.exclude.from.some(ee=>e.currentStates.includes(ee)):f.exclude&&"when"in f.exclude&&(u[O].hidden=N(re(f.exclude.when,A),e.data,e.meta,n,o)),(D(f)||Q(f))&&K(f.disabled)&&(u[O].disabled=N(re(f.disabled.when,A),e.data,e.meta,n,o)),D(f)&&K(f.readonly)&&(u[O].readonly=N(re(f.readonly.when,A),e.data,e.meta,n,o))})}),u}const U=e=>t=>({...t,calculatedWidgets:Rn(t,e)});function Rn(e,t){const{$formIsInvalid:r,$errors:n}=Je(e),o=qn(e,t,r,n),i={};for(const s of Object.keys(e.calculatedWidgets)){if(e.widgetFlags[s]?.hidden)continue;const u=e.calculatedWidgets[s],c=u.source;if(Y(c)){i[s]=kn(s,c,e,t);continue}i[s]=_n(u,c,e,o)}return i}function kn(e,t,r,n){const o=t({$form:r.data,errors:t.path?r.validations[t.path]:void 0,touched:t.path?r.touchedControls[t.path]:void 0,translate:n.translate});return o.uid=e,{source:t,current:o}}function _n(e,t,r,n){const o=new Qn(t,e.current);return o.write("uid",t.uid),o.write("type",t.type),o.write("kind",t.kind),$t(t)?Un(o,n):Q(t)?Nn(o,n):D(t)?Ln(o,n):fe(t)&&Mn(o,n),jn(t,o,n,r),(Q(t)||D(t))&&Vn(t,o,n),fe(t)&&Bn(t,o,r),o.changed?{source:e.source,current:o.current}:e}function Un(e,t){v(e,t,"size"),v(e,t,"include"),v(e,t,"exclude")}function Nn(e,t){v(e,t,"size"),v(e,t,"include"),v(e,t,"exclude"),v(e,t,"label"),v(e,t,"disabled")}function Ln(e,t){v(e,t,"size"),v(e,t,"include"),v(e,t,"exclude"),v(e,t,"label"),v(e,t,"disabled"),v(e,t,"readonly"),v(e,t,"validator"),v(e,t,"path"),v(e,t,"defaultValue")}function Mn(e,t){v(e,t,"size"),v(e,t,"include"),v(e,t,"exclude")}function jn(e,t,r,n){const o=n.widgetPropOverrides[e.uid]??{},i={...e.props??{},...o};for(const s of xt(Object.keys(i)))Hn(t,r,s)}function Vn(e,t,r){const n=e.on??{};for(const o of xt(Object.keys(n)))Gn(t,r,o)}function Bn(e,t,r){const n=Zn(e.uid),o=Yn(e.children,n,r.widgetFlags);t.current.children=o;const i=t.previous.children??[];i.length===o.length&&o.every((u,c)=>i[c]&&i[c].uid===o[c].uid)||t.markChanged()}function v(e,t,r){const n=e.source;if(!xn(n,r))return;const o=ut(n,r,t.sortedStates);let i;switch(r){case"disabled":case"readonly":i=Xn(o,t,e.source.uid,r);break;default:i=qt(o,t)}e.write(r,i)}function Hn(e,t,r){const n=e.source.props,o=ut(n,r,t.sortedStates);let i=qt(o,t);const s=t.widgetPropOverrides[e.source.uid]?.[r];s!==void 0&&(i=s),e.write(`props.${r}`,i)}function Gn(e,t,r){const n=e.source.on,o=ut(n,r,t.sortedStates);e.write(`on.${r}`,zn(o,t))}function dt(e,t){return e({$form:t.$form,translate:t.localization.translate})}function Kn(e,t){return t.localization.translate(e.key,Jn(e.params,t),e.default)}function Qt(e,t){return Pr(e,{resolveFormPath:r=>R(t.$form,r)??e,resolveMetaPath:r=>R(t.$meta,r)??e,resolveErrorsPath:r=>R(t.$errors,r)??e,resolveFormIsInvalid:()=>String(t.$formIsInvalid)})}function qt(e,t){return typeof e=="function"?dt(e,t):mt(e)?Kn(e,t):typeof e=="string"?Qt(e,t):e}function Xn(e,t,r,n){return typeof e=="function"?dt(e,t):K(e)?t.widgetFlags[r]?.[n]:typeof e=="string"?Qt(e,t):e}function zn(e,t){return typeof e=="function"?dt(e,t):e}function ut(e,t,r){if(e){for(const n of r){const o=e[`${t}.${n}`];if(o!==void 0)return o}return e[t]}}function Jn(e,t){return e&&Object.keys(e).reduce((r,n)=>{const o=String(e[n]);return Or(o)?r[n]=Wr(o,{resolveFormPath:i=>R(t.$form,i)??o,resolveMetaPath:i=>R(t.$meta,i)??o,resolveErrorsPath:i=>R(t.$errors,i)??o,resolveFormIsInvalid:()=>t.$formIsInvalid}):r[n]=o,r},{})}class Qn{constructor(t,r){this._changed=!1,this.source=t,this.previous=r,this.current={}}get changed(){return this._changed}markChanged(){this._changed=!0}write(t,r){Oe(this.current,t,r),R(this.previous,t)!==r&&(this._changed=!0)}}function qn(e,t,r,n){return{sortedStates:[...e.currentStates].sort((o,i)=>i.length-o.length),widgetPropOverrides:e.widgetPropOverrides,widgetFlags:e.widgetFlags,$form:e.data,$meta:e.meta,$formIsInvalid:r,$errors:n,localization:t}}function xn(e,t){if(t in e)return!0;const r=`${t}.`;return Object.keys(e).some(n=>n.startsWith(r))}function xt(e){return Array.from(new Set(e.map(t=>t.split(".")[0])))}function Yn(e,t,r){const n=t.map(o=>`[${o}]`).join("");return e.filter(o=>{const i=o.uid+n,s=r[i];return!s||s.hidden!==!0})}const Zn=e=>[...e.matchAll(/\[(\d+)\]/g)].map(t=>parseInt(t[1],10)),bn=({lang:e},t)=>{const r={...He(e),formName:t.payload.formName};let n=t.payload.formDef,o={status:"ok"};if(typeof n=="string"){try{n=JSON.parse(n)}catch(u){const c=u,h=ne.initializeParseError;o={status:"errored",message:`[${h}] ${c.message}`,code:h}}if(o.status==="errored")return{...r,formHealth:o}}if(Array.isArray(n.form)){const u=n,c=u.form;u.form={uid:"",type:"flex",kind:"layout",children:c}}const i=Be.decode(n);if(i.isOk()){o={status:"ok"};let u={};try{u=ze([i.value.form]).reduce((c,h)=>{const A=h.uid;if(c[A])throw{existingWidget:c[A],newWidget:h};return c[A]=h,c},{})}catch(c){const h=ne.initializeUidCollisionError;o={status:"errored",message:`[${h}] ${eo(c.existingWidget,c.newWidget)}`,code:h},u={}}return{...r,formDef:i.value,flatForm:u,formHealth:o}}const s=ne.initializeUnknownError;return{...r,formHealth:{status:"errored",message:`[${s}] ${i.error}`,code:s}}};function eo(e,t){const r=n=>D(n)?` at "${n.path}"`:"";return`Duplicate UID "${t.uid}": Assigned to widget "${e.type}"${r(e)} and "${t.type}"${r(t)}.`}function to(e,t){return{...e,injectedValidations:{...e.injectedValidations,[t.payload.path]:t.payload.issues}}}const ro=(e,{payload:t})=>{let r;if("path"in t){if(r=Object.values(e.calculatedWidgets).find(({source:i})=>D(i)&&i.path===t.path),!r)return console.warn(`Input with path "${t.path}" not found`),e}else if(r=e.calculatedWidgets[t.uid],!r)return console.warn(`Widget with uid "${t.uid}" not found`),e;const n=r.source.uid,o=e.widgetPropOverrides[n]||{};return{...e,widgetPropOverrides:{...e.widgetPropOverrides,[n]:{...o,[t.prop]:t.value}}}};function no(e,t){return{...e,widgetFlags:{...te(e.widgetFlags,t.payload.uid)},calculatedWidgets:{...te(e.calculatedWidgets,t.payload.uid)},widgetPropOverrides:{...te(e.widgetPropOverrides,t.payload.uid)},touchedControls:{..._(e.touchedControls,r=>{const n=e.flatForm[t.payload.uid];return n&&D(n)?te(r,n.path):r})}}}const oo=(e,t)=>({...e,data:{...t.payload.data}}),io=(e,t)=>({...e,formHealth:t.payload.formHealth}),so=(e,t)=>({...e,lang:t.payload.lang}),uo=(e,t)=>({...e,meta:{...t.payload.meta}}),co=(e,t)=>{const r=R(e.data,t.payload.path);return t.type==="SET_WIDGET_DATA"||t.type==="SET_WIDGET_INITIAL_DATA"&&r===void 0?{...e,data:{...Oe(e.data,t.payload.path,t.payload.data)}}:e},Re=(e,t)=>r=>{const n=it(Object.values(r.calculatedWidgets),({current:i})=>D(i)?i:Pe),o=r.validations;return{...r,validations:n.reduce((i,s)=>{if(i[s.path]=null,s.validator){const u=e(s.validator,t),c=R(r.data,s.path),h=St(u,c);i[s.path]=Et(h)?null:h.issues.map(A=>A.message)}return Array.isArray(i[s.path])&&Array.isArray(o[s.path])&&Xt(i[s.path],o[s.path],(u,c)=>u===c)&&(i[s.path]=o[s.path]),i},{})}},lo=({validators:e,validateOn:t,localization:r})=>(n,o)=>{switch(o.type){case"INITIALIZE":return bn(n,o);case"SET_DATA":return _(oo(n,o),L,M,U(r));case"SET_META":return _(uo(n,o),L,M,U(r));case"SET_LANGUAGE":return _(so(n,o),U(r));case"ADD_WIDGET":return _(Cr(n,o),le(ke,L),le(ke,M),le(ke,U(r)));case"REMOVE_WIDGET":return _(no(n,o),L,M,U(r));case"SET_WIDGET_INITIAL_DATA":case"SET_WIDGET_DATA":return _(co(n,o),L,M,U(r));case"OVERRIDE_WIDGET_PROP":return _(ro(n,o),L,M,U(r),le(i=>{let s=!1,u="";"path"in o.payload?(s=!0,u=o.payload.path):D(i.calculatedWidgets[o.payload.uid].current)&&(s=!0,u=i.calculatedWidgets[o.payload.uid].current.path);const c=s&&i.touchedControls[u];return i.touched&&c},Re(e,r)));case"SET_FORM_HEALTH":return io(n,o);case"VALIDATE_ALL":return _({...n,touched:!0,touchedControls:Object.keys(n.calculatedWidgets).reduce((i,s)=>{const u=n.calculatedWidgets[s].source;return D(u)&&(i[u.path]=!0),i},{})},Re(e,r),L,M,U(r));case"ATTEMPT_VALIDATION":{const i=o.payload.reason,s=o.payload.path;return t==="eager"||i===t||t.includes(i)?_({...n,touched:!0,touchedControls:{...n.touchedControls,[s]:!0}},Re(e,r),L,M,U(r),c=>{const h=o.payload.uid,A=c.calculatedWidgets[h],m=A.source;if(Y(m)){const f=m({$form:c.data,errors:c.validations[s],touched:!0,translate:r.translate});return{...c,calculatedWidgets:{...c.calculatedWidgets,[h]:{source:A.source,current:f}}}}return c}):n}case"INJECT_VALIDATION_ISSUES":return to(n,o);default:return vr(o)}},ke=e=>e.formHealth.status==="ok";function Yt(e=[],t,r,n){const o=new a.BehaviorSubject(He(n.lang)),i=o.asObservable().pipe(a.distinctUntilChanged()),s=lo({validators:t,validateOn:r,localization:n});function u(m){const f=o.getValue(),O=s(f,m);o.next(O)}let c=u;const h={getState:()=>o.getValue(),dispatch:m=>c(m)};return c=e.map(m=>m(h)).reduceRight((m,f)=>f(m),u),{state$:i,dispatch:c,getState:()=>o.getValue()}}class ao{constructor(){this.widgetRegistry=new pe,this.store={},this.events$=new a.Subject,this.uuid=crypto.randomUUID(),this.itemRenderers={},this.dependencies={}}initialize(t,r=[],n,o,i,s=yt(),u){this.localization=s,this.dependencies=u,this.widgetRegistry.setWidgetLoaders(t),this.itemRenderers=i,this.store=Yt(r,n,o,s)}emitEvent(t,r,n){const i=this.store.getState().currentStates.filter(s=>r.on?.[`${t}.${s}`]!==void 0);if(i.length>0)i.forEach(s=>{const u=r.on?.[`${t}.${s}`];this.attemptValidation(t,u,r),u&&this.events$.next({name:u,data:this.store.getState().data,detail:n??void 0,callback:c=>{this.store.dispatch(c)}})});else{const s=r.on?.[t];this.attemptValidation(t,s,r),s&&this.events$.next({name:s,data:this.store.getState().data,detail:n,callback:u=>{this.store.dispatch(u)}})}}attemptValidation(t,r,n){n.kind!=="layout"&&(t==="change"?this.store.dispatch({type:"ATTEMPT_VALIDATION",payload:{reason:"change",path:n.path,uid:n.uid}}):t==="click"&&r==="submit"&&this.store.dispatch({type:"VALIDATE_ALL"}))}}function fo(e="GolemUI Form Store"){return t=>{const n=(typeof window<"u"?window.__REDUX_DEVTOOLS_EXTENSION__:void 0)?.connect({name:e});return n?.init(t.getState()),o=>i=>{o(i),n&&n.send(i,t.getState())}}}const po=a.pipe(a.map(e=>e.data),a.distinctUntilChanged()),ho=e=>a.pipe(po,a.map(t=>R(t,e)),a.distinctUntilChanged()),go=a.pipe(a.filter(e=>e.touched===!0),a.map(e=>e.validations),a.distinctUntilChanged()),mo=e=>a.pipe(go,a.map(t=>t[e]),a.distinctUntilChanged()),yo=a.pipe(a.filter(e=>e.touched===!0),a.map(e=>e.injectedValidations),a.distinctUntilChanged()),$o=e=>a.pipe(yo,a.map(t=>t[e]),a.distinctUntilChanged(),a.startWith(null)),Ao=a.pipe(a.map(e=>e.lang),a.distinctUntilChanged()),Zt=a.pipe(a.map(e=>e.calculatedWidgets),a.distinctUntilChanged()),So=e=>t=>a.combineLatest([t.pipe(Ao),t.pipe(Zt)]).pipe(a.map(([r,n])=>({lang:r,widget:n[e]})),a.filter(r=>r.widget!==void 0),a.distinctUntilChanged((r,n)=>r.lang===n.lang&&r.widget===n.widget),a.map(r=>r.widget.current)),Eo=e=>a.pipe(Zt,a.map(t=>t[e]),a.filter(t=>t!==void 0),a.map(t=>t.current.children),a.distinctUntilChanged()),bt=a.pipe(a.map(e=>e.widgetFlags),a.distinctUntilChanged()),vo=e=>a.pipe(bt,a.map(t=>t[e]),a.distinctUntilChanged()),Io=a.pipe(a.map(e=>e.touchedControls),a.distinctUntilChanged()),Co=e=>a.pipe(Io,a.map(t=>t[e]),a.distinctUntilChanged()),wo=a.pipe(a.map(e=>e.formHealth),a.distinctUntilChanged((e,t)=>!(e.status!==t.status||e.status==="errored"))),Oo=e=>e.pipe(wo);let er=!1;function Do(){er=!0}function tr(){return er}function Fo(e,t,r){if(!tr())return;const n=Object.keys(t??{}).filter(o=>o in r);if(n.length>0)throw new Error(`[GolemUI] Widget "${e}": prop keys [${n.join(", ")}] collide with widget fields`)}exports.Debug=Gt;exports.FormContext=ao;exports.SKIP=Pe;exports.WidgetRegistry=pe;exports.assertNoPropCollisions=Fo;exports.calculatedLayoutChildrenByUid$=Eo;exports.calculatedWidgetsByUid$=So;exports.cloneObject=Ne;exports.compose=Ir;exports.createFormStore=Yt;exports.createInitialState=He;exports.dataByPath$=ho;exports.defineForm=ar;exports.deleteKey=te;exports.devToolsMiddleware=fo;exports.enableDevMode=Do;exports.errorCodes=ne;exports.filterMap=it;exports.filterReduce=Kt;exports.filterTap=Fn;exports.formDefDecoder=Be;exports.formHealth=Oo;exports.get=R;exports.getDirectionFromLanguage=fr;exports.identityTranslator=yt;exports.injectedValidationByPath$=$o;exports.isActionWidget=Q;exports.isDevMode=tr;exports.isDisplayWidget=$t;exports.isFunctionWidget=Y;exports.isInputWidget=D;exports.isLayoutWidget=fe;exports.isStandardValidateSuccess=Et;exports.isTranslationConfig=mt;exports.layoutWidgetDecoder=we;exports.makeRepeaterItemConfig=zt;exports.pipe=_;exports.selectWidgetFlags=bt;exports.set=Oe;exports.shortUUID=Ge;exports.standardValidate=St;exports.toRepeaterItemUid=st;exports.touchedControlsByPath$=Co;exports.transformRepeaterItemWhenExpression=re;exports.validationByPath$=mo;exports.widgetFlagsByUid$=vo;exports.zipEvery=Xt;
4
+ `,""+o}${s}${u}`)},$t=(e,t=h)=>(Array.isArray(e)&&(e.loc=t),e),Y=(e,t=h,r)=>{for(;r=e(g.charCodeAt(h));)h+=r;return g.slice(t,h)},O=(e=1)=>g[h+=e],Ne=e=>h=e,E=(e=0,t)=>{let r,n,o,i,s;for(t&&y.asi&&(y.newline=!1);(r=y.space())&&(s=y.newline,1)&&r!==t&&(o=(n&&r===91&&_e&&y.asi?.(n,e,E)||null)??((i=R[r])&&i(n,e))??(n&&s&&y.asi?.(n,e,E))??(!n&&Y(y.id)));)n=o;return t&&(r==t?(h++,t===125&&y.asi&&(y.newline=!0)):z("Unclosed "+String.fromCharCode(t-(t>42?2:1)))),n},B=(e,t=h)=>{for(_e=!1;(e=g.charCodeAt(h))<=Xe;)y.asi&&e===10&&(y.newline=_e=!0),h++;return e},Cr=(e=h)=>{for(;g.charCodeAt(e)<=Xe;)e++;return g.charCodeAt(e)};y.id=e=>e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e==36||e==95||e>=192&&e!=215&&e!=247;let Or=(e,t=e.length)=>g.substr(h,t)===e&&!y.id(g.charCodeAt(h+t)),R=[],it={},W=(e,t=Xe,r,n=e.charCodeAt(0),o=e.length,i=R[n],s=e.toUpperCase()!==e,u,c)=>(t=it[e]=!i&&it[e]||t,R[n]=(p,A,m,f=h)=>(u=m,(m?e==m:(o<2||e.charCodeAt(1)===g.charCodeAt(h+1)&&(o<3||g.substr(h,o)==e))&&(!s||!y.id(g.charCodeAt(h+o)))&&(u=m=e))&&A<t&&(h+=o,(c=r(p))?$t(c,f):(h=f,u=0,!s&&!i&&!p&&z()),c)||i?.(p,A,u))),$=(e,t,r=!1)=>W(e,t,n=>n&&(o=>o&&[e,n,o])(E(t-(r?.5:0)))),H=(e,t,r)=>W(e,t,n=>!n&&(n=E(t-.5))&&[e,n]),se=(e,t)=>W(e,200,r=>!r&&[,t]),At=(e,t,r)=>W(e,t,(n,o)=>(o=E(t-(r?.5:0)),n?.[0]!==e&&(n=[e,n||null]),o?.[0]===e?n.push(...o.slice(1)):n.push(o||null),n)),ze=(e,t)=>W(e[0],t,r=>!r&&[e,E(0,e.charCodeAt(1))||null]),St=(e,t)=>W(e[0],t,r=>r&&[e,r,E(0,e.charCodeAt(1))||null]),de=(e,t,r,n=e.charCodeAt(0),o=e.length,i=R[n],s)=>R[n]=(u,c,p,A=h)=>!u&&(p?e==p:(o<2||g.substr(h,o)==e)&&(p=e))&&c<t&&!y.id(g.charCodeAt(h+o))&&(!y.prop||y.prop(h+o))&&(Ne(h+o),(s=r())?$t(s,A):Ne(A),s)||i?.(u,c,p);Object.defineProperty(y,"space",{configurable:!0,enumerable:!0,get:()=>B,set:e=>B=e});const Ue={},l=(e,t,r=Ue[e])=>Ue[e]=(...n)=>t(...n)||r?.(...n),d=e=>Array.isArray(e)?e[0]==null?(t=>()=>t)(e[1]):Ue[e[0]]?.(...e.slice(1))??z(`Unknown operator: ${e[0]}`,e?.loc):e===void 0?()=>{}:t=>t?.[e],fe=46,te=48,he=57,wr=69,Pr=101,Dr=43,Fr=45,ae=95,Et=110,Tr=97,Wr=102,Rr=65,kr=70,vt=e=>e.indexOf("_")<0?e:e.replaceAll("_",""),Je=e=>{let t=vt(Y(r=>r===fe&&g.charCodeAt(h+1)!==fe||r>=te&&r<=he||r===ae||((r===wr||r===Pr)&&((r=g.charCodeAt(h+1))>=te&&r<=he||r===Dr||r===Fr)?2:0)));return g.charCodeAt(h)===Et?(O(),[,BigInt(t)]):(e=+t)!=e?z():[,e]},_r={2:e=>e===48||e===49||e===ae,8:e=>e>=48&&e<=55||e===ae,16:e=>e>=te&&e<=he||e>=Tr&&e<=Wr||e>=Rr&&e<=kr||e===ae};y.number=null;R[fe]=e=>!e&&g.charCodeAt(h+1)!==fe&&Je();for(let e=te;e<=he;e++)R[e]=t=>t?void 0:Je();R[te]=e=>{if(e)return;const t=y.number;if(t){for(const[r,n]of Object.entries(t))if(r[0]==="0"&&g[h+1]?.toLowerCase()===r[1]){O(2);const o=vt(Y(_r[n]));return g.charCodeAt(h)===Et?(O(),[,BigInt("0"+r[1]+o)]):[,parseInt(o,n)]}}return Je()};const Nr=92,st=34,dt=39,Ur={n:`
5
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},It=e=>(t,r,n="")=>{if(!(t||!y.string?.[String.fromCharCode(e)]))return O(),Y(o=>o-e&&(o===Nr?(n+=Ur[g[h+1]]||g[h+1],2):(n+=g[h],1))),g[h]===String.fromCharCode(e)?O():z("Bad string"),[,n]};R[st]=It(st);R[dt]=It(dt);y.string={'"':!0};const Lr=20;"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map(e=>$(e,Lr,!0));const Ct=(e,t,r,n)=>typeof e=="string"?o=>t(o,e,o):e[0]==="."?(r=d(e[1]),n=e[2],o=>t(r(o),n,o)):e[0]==="[]"&&e.length===3?(r=d(e[1]),n=d(e[2]),o=>t(r(o),n(o),o)):e[0]==="()"&&e.length===2?Ct(e[1],t):(()=>{throw Error("Invalid assignment target")})(),ut={"=":(e,t,r)=>e[t]=r,"+=":(e,t,r)=>e[t]+=r,"-=":(e,t,r)=>e[t]-=r,"*=":(e,t,r)=>e[t]*=r,"/=":(e,t,r)=>e[t]/=r,"%=":(e,t,r)=>e[t]%=r,"|=":(e,t,r)=>e[t]|=r,"&=":(e,t,r)=>e[t]&=r,"^=":(e,t,r)=>e[t]^=r,">>=":(e,t,r)=>e[t]>>=r,"<<=":(e,t,r)=>e[t]<<=r};for(const e in ut)l(e,(t,r)=>(r=d(r),Ct(t,(n,o,i)=>ut[e](n,o,r(i)))));const jr=30,Mr=40,Vr=140;H("!",Vr);$("||",jr);$("&&",Mr);l("!",e=>(e=d(e),t=>!e(t)));l("||",(e,t)=>(e=d(e),t=d(t),r=>e(r)||t(r)));l("&&",(e,t)=>(e=d(e),t=d(t),r=>e(r)&&t(r)));const Br=50,Hr=60,Gr=70,Ot=100,Kr=140;$("|",Br);$("&",Gr);$("^",Hr);$(">>",Ot);$("<<",Ot);H("~",Kr);l("~",e=>(e=d(e),t=>~e(t)));l("|",(e,t)=>(e=d(e),t=d(t),r=>e(r)|t(r)));l("&",(e,t)=>(e=d(e),t=d(t),r=>e(r)&t(r)));l("^",(e,t)=>(e=d(e),t=d(t),r=>e(r)^t(r)));l(">>",(e,t)=>(e=d(e),t=d(t),r=>e(r)>>t(r)));l("<<",(e,t)=>(e=d(e),t=d(t),r=>e(r)<<t(r)));const Ie=90;$("<",Ie);$(">",Ie);$("<=",Ie);$(">=",Ie);l(">",(e,t)=>(e=d(e),t=d(t),r=>e(r)>t(r)));l("<",(e,t)=>(e=d(e),t=d(t),r=>e(r)<t(r)));l(">=",(e,t)=>(e=d(e),t=d(t),r=>e(r)>=t(r)));l("<=",(e,t)=>(e=d(e),t=d(t),r=>e(r)<=t(r)));const wt=80;$("==",wt);$("!=",wt);l("==",(e,t)=>(e=d(e),t=d(t),r=>e(r)==t(r)));l("!=",(e,t)=>(e=d(e),t=d(t),r=>e(r)!=t(r)));const Pt=110,Qe=120,Dt=140;$("+",Pt);$("-",Pt);$("*",Qe);$("/",Qe);$("%",Qe);H("+",Dt);H("-",Dt);l("+",(e,t)=>t!==void 0?(e=d(e),t=d(t),r=>e(r)+t(r)):(e=d(e),r=>+e(r)));l("-",(e,t)=>t!==void 0?(e=d(e),t=d(t),r=>e(r)-t(r)):(e=d(e),r=>-e(r)));l("*",(e,t)=>(e=d(e),t=d(t),r=>e(r)*t(r)));l("/",(e,t)=>(e=d(e),t=d(t),r=>e(r)/t(r)));l("%",(e,t)=>(e=d(e),t=d(t),r=>e(r)%t(r)));const pe=150;W("++",pe,e=>e?["++",e,null]:["++",E(pe-1)]);W("--",pe,e=>e?["--",e,null]:["--",E(pe-1)]);const qe=(e,t,r,n)=>typeof e=="string"?o=>t(o,e):e[0]==="."?(r=d(e[1]),n=e[2],o=>t(r(o),n)):e[0]==="[]"&&e.length===3?(r=d(e[1]),n=d(e[2]),o=>t(r(o),n(o))):e[0]==="()"&&e.length===2?qe(e[1],t):(()=>{throw Error("Invalid increment target")})();l("++",(e,t)=>qe(e,t===null?(r,n)=>r[n]++:(r,n)=>++r[n]));l("--",(e,t)=>qe(e,t===null?(r,n)=>r[n]--:(r,n)=>--r[n]));const Xr=5,zr=10;At(",",zr);At(";",Xr,!0);const Ft=(...e)=>(e=e.map(d),t=>{let r;for(const n of e)r=n(t);return r});l(",",Ft);l(";",Ft);const Jr=170;ze("()",Jr);const V=e=>e?.[0]==="_"&&e[1]==="_"||e==="constructor"||e==="prototype",Ye=170;St("[]",Ye);$(".",Ye);St("()",Ye);const ge=e=>{throw Error(e)};l("[]",(e,t)=>t===void 0?(e=e?e[0]===","?e.slice(1):[e]:[],e=e.map(r=>r==null?(()=>{}):r[0]==="..."?(r=d(r[1]),n=>r(n)):(r=d(r),n=>[r(n)])),r=>e.flatMap(n=>n(r))):(t==null&&ge("Missing index"),e=d(e),t=d(t),r=>{const n=t(r);return V(n)?void 0:e(r)[n]}));l(".",(e,t)=>(e=d(e),t=t[0]?t:t[1],V(t)?()=>{}:r=>e(r)[t]));l("()",(e,t)=>{if(t===void 0)return e==null?ge("Empty ()"):d(e);const r=o=>o?.[0]===","&&o.slice(1).some(i=>i==null||r(i));r(t)&&ge("Empty argument");const n=t?t[0]===","?(t=t.slice(1).map(d),o=>t.map(i=>i(o))):(t=d(t),o=>[t(o)]):()=>[];return Ze(e,(o,i,s)=>o[i](...n(s)))});const J=e=>typeof e=="string"||Array.isArray(e)&&(e[0]==="."||e[0]==="?."||e[0]==="[]"&&e.length===3||e[0]==="?.[]"||e[0]==="()"&&e.length===2&&J(e[1])||e[0]==="{}"),Ze=(e,t,r,n)=>e==null?ge("Empty ()"):e[0]==="()"&&e.length==2?Ze(e[1],t):typeof e=="string"?o=>t(o,e,o):e[0]==="."?(r=d(e[1]),n=e[2],o=>t(r(o),n,o)):e[0]==="?."?(r=d(e[1]),n=e[2],o=>{const i=r(o);return i==null?void 0:t(i,n,o)}):e[0]==="[]"&&e.length===3?(r=d(e[1]),n=d(e[2]),o=>t(r(o),n(o),o)):e[0]==="?.[]"?(r=d(e[1]),n=d(e[2]),o=>{const i=r(o);return i==null?void 0:t(i,n(o),o)}):(e=d(e),o=>t([e(o)],0,o)),Z=Ze,Qr=32,qr=y.space;y.comment??={"//":`
6
+ `,"/*":"*/"};let Oe;y.space=()=>{Oe||(Oe=Object.entries(y.comment).map(([o,i])=>[o,i,o.charCodeAt(0)]));for(var e;e=qr();){for(var t=0,r;r=Oe[t++];)if(e===r[2]&&g.substr(h,r[0].length)===r[0]){var n=h+r[0].length;if(r[1]===`
7
+ `)for(;g.charCodeAt(n)>=Qr;)n++;else{for(;g[n]&&g.substr(n,r[1].length)!==r[1];)n++;g[n]&&(n+=r[1].length)}Ne(n),e=0;break}if(e)return e}return e};const Tt=80;$("===",Tt);$("!==",Tt);l("===",(e,t)=>(e=d(e),t=d(t),r=>e(r)===t(r)));l("!==",(e,t)=>(e=d(e),t=d(t),r=>e(r)!==t(r)));const Yr=30;$("??",Yr);l("??",(e,t)=>(e=d(e),t=d(t),r=>e(r)??t(r)));const Zr=130,xr=20;$("**",Zr,!0);$("**=",xr,!0);l("**",(e,t)=>(e=d(e),t=d(t),r=>e(r)**t(r)));const br=e=>{throw Error(e)};l("**=",(e,t)=>(J(e)||br("Invalid assignment target"),t=d(t),Z(e,(r,n,o)=>r[n]**=t(o))));const Wt=90;$("in",Wt);$("of",Wt);l("in",(e,t)=>(e=d(e),t=d(t),r=>e(r)in t(r)));const en=20,tn=100,rn=e=>{throw Error(e)};$(">>>",tn);$(">>>=",en,!0);l(">>>",(e,t)=>(e=d(e),t=d(t),r=>e(r)>>>t(r)));l(">>>=",(e,t)=>(J(e)||rn("Invalid assignment target"),t=d(t),Z(e,(r,n,o)=>r[n]>>>=t(o))));const xe=5,nn=10,on=20,sn=e=>e[0]?.[0]===","?e[0].slice(1):e,me=(e,t,r)=>{if(typeof e=="string"){r[e]=t;return}const[n,...o]=e,i=sn(o);if(n==="{}"){const s=[];for(const u of i){if(Array.isArray(u)&&u[0]==="..."){const f={};for(const w in t)s.includes(w)||(f[w]=t[w]);r[u[1]]=f;break}let c,p,A;typeof u=="string"?c=p=u:u[0]==="="?(typeof u[1]=="string"?c=p=u[1]:[,c,p]=u[1],A=u[2]):[,c,p]=u,s.push(c);let m=t[c];m===void 0&&A&&(m=d(A)(r)),me(p,m,r)}}else if(n==="[]"){let s=0;for(const u of i){if(u===null){s++;continue}if(Array.isArray(u)&&u[0]==="..."){r[u[1]]=t.slice(s);break}let c=u,p;Array.isArray(u)&&u[0]==="="&&([,c,p]=u);let A=t[s++];A===void 0&&p&&(A=d(p)(r)),me(c,A,r)}}},Rt=e=>{let t=E(nn-1);return t?.[0]==="in"||t?.[0]==="of"?[t[0],[e,t[1]],t[2]]:t?.[0]===","?[e,...t.slice(1)]:[e,t]};de("let",xe+1,()=>Rt("let"));de("const",xe+1,()=>Rt("const"));de("var",xe,()=>(B(),["var",E(on)]));const kt=(...e)=>(e=e.map(t=>{if(typeof t=="string")return r=>{r[t]=void 0};if(t[0]==="="){const[,r,n]=t,o=d(n);return typeof r=="string"?i=>{i[r]=o(i)}:i=>me(r,o(i),i)}return d(t)}),t=>{for(const r of e)r(t)});l("let",kt);l("const",kt);l("var",e=>typeof e=="string"?t=>{t[e]=void 0}:()=>{});const be=20,Ce=e=>{throw Error(e)};$("||=",be,!0);$("&&=",be,!0);$("??=",be,!0);l("=",(e,t)=>{if(Array.isArray(e)&&(e[0]==="let"||e[0]==="const"||e[0]==="var")){const r=e[1];return t=d(t),typeof r=="string"?n=>{n[r]=t(n)}:n=>me(r,t(n),n)}return J(e)||Ce("Invalid assignment target"),t=d(t),Z(e,(r,n,o)=>r[n]=t(o))});l("||=",(e,t)=>(J(e)||Ce("Invalid assignment target"),t=d(t),Z(e,(r,n,o)=>r[n]||=t(o))));l("&&=",(e,t)=>(J(e)||Ce("Invalid assignment target"),t=d(t),Z(e,(r,n,o)=>r[n]&&=t(o))));l("??=",(e,t)=>(J(e)||Ce("Invalid assignment target"),t=d(t),Z(e,(r,n,o)=>r[n]??=t(o))));se("true",!0);se("false",!1);se("null",null);de("undefined",200,()=>[]);se("NaN",NaN);se("Infinity",1/0);const we=20;W("?",we,(e,t,r)=>e&&(t=E(we-1))&&Y(n=>n===58)&&(r=E(we-1),["?",e,t,r]));l("?",(e,t,r)=>(e=d(e),t=d(t),r=d(r),n=>e(n)?t(n):r(n)));const dn=[],un=20;$("=>",un,!0);l("=>",(e,t)=>{e=e?.[0]==="()"?e[1]:e;const r=e?e[0]===","?e.slice(1):[e]:[];let n=-1,o=null;const i=r[r.length-1];Array.isArray(i)&&i[0]==="..."&&(n=r.length-1,o=i[1],r.length--);const s=t?.[0]==="{}";return t=d(s?["{",t[1]]:t),u=>(...c)=>{const p={};r.forEach((m,f)=>p[m]=c[f]),o&&(p[o]=c.slice(n));const A=new Proxy(p,{get:(m,f)=>f in m?m[f]:u?.[f],set:(m,f,w)=>((f in m?m:u)[f]=w,!0),has:(m,f)=>f in m||(u?f in u:!1)});try{const m=t(A);return s?void 0:m}catch(m){if(m===dn)return m[0];throw m}}});const cn=140;H("...",cn);l("...",e=>(e=d(e),t=>Object.entries(e(t))));const ct=170;W("?.",ct,(e,t)=>{if(!e)return;const r=B();return r===40?(O(),["?.()",e,E(0,41)||null]):r===91?(O(),["?.[]",e,E(0,93)]):(t=E(ct),t?["?.",e,t]:void 0)});l("?.",(e,t)=>(e=d(e),V(t)?()=>{}:r=>e(r)?.[t]));l("?.[]",(e,t)=>(e=d(e),t=d(t),r=>{const n=t(r);return V(n)?void 0:e(r)?.[n]}));l("?.()",(e,t)=>{const r=t?t[0]===","?(t=t.slice(1).map(d),o=>t.map(i=>i(o))):(t=d(t),o=>[t(o)]):()=>[];if(e[0]==="?."){const o=d(e[1]),i=e[2];return V(i)?()=>{}:s=>o(s)?.[i]?.(...r(s))}if(e[0]==="?.[]"){const o=d(e[1]),i=d(e[2]);return s=>{const u=o(s),c=i(s);return V(c)?void 0:u?.[c]?.(...r(s))}}if(e[0]==="."){const o=d(e[1]),i=e[2];return V(i)?()=>{}:s=>o(s)?.[i]?.(...r(s))}if(e[0]==="[]"&&e.length===3){const o=d(e[1]),i=d(e[2]);return s=>{const u=o(s),c=i(s);return V(c)?void 0:u?.[c]?.(...r(s))}}const n=d(e);return o=>n(o)?.(...r(o))});const re=140;H("typeof",re);H("void",re);H("delete",re);de("new",re,()=>Or(".target")?(O(7),["new.target"]):["new",E(re)]);l("typeof",e=>(e=d(e),t=>typeof e(t)));l("void",e=>(e=d(e),t=>(e(t),void 0)));l("delete",e=>{if(e[0]==="."){const t=d(e[1]),r=e[2];return n=>delete t(n)[r]}if(e[0]==="[]"){const t=d(e[1]),r=d(e[2]);return n=>delete t(n)[r(n)]}return()=>!0});l("new",e=>{const t=d(e?.[0]==="()"?e[1]:e),r=e?.[0]==="()"?e[2]:null,n=r?r[0]===","?(o=>i=>o.map(s=>s(i)))(r.slice(1).map(d)):(o=>i=>[o(i)])(d(r)):()=>[];return o=>new(t(o))(...n(o))});const et=Symbol("accessor"),tt=20,ln=40,_t=41,Nt=123,Ut=125,Lt=e=>t=>{if(t)return;B();const r=Y(y.id);if(!r||(B(),g.charCodeAt(h)!==ln))return!1;O();const n=E(0,_t);return B(),g.charCodeAt(h)!==Nt?!1:(O(),[e,r,n,E(0,Ut)])};W("get",tt-1,Lt("get"));W("set",tt-1,Lt("set"));W("(",tt-1,e=>{if(!e||typeof e!="string")return;const t=E(0,_t)||null;if(B(),g.charCodeAt(h)===Nt)return O(),[":",e,["=>",["()",t],E(0,Ut)||null]]});l("get",(e,t)=>(t=t?d(t):()=>{},r=>[[et,e,{get:function(){const n=Object.create(r||{});return n.this=this,t(n)}}]]));l("set",(e,t,r)=>(r=r?d(r):()=>{},n=>[[et,e,{set:function(o){const i=Object.create(n||{});i.this=this,i[t]=o,r(i)}}]]));const an=20,jt=200;y.prop=e=>Cr(e)!==58;const fn=e=>e==null||typeof e=="string"||[":",",","...","get","set"].includes(e[0]);ze("[]",jt);ze("{}",jt);$(":",an-1,!0);l("{}",(e,t)=>{if(t!==void 0)return;if(!fn(e))return d(["{",e]);e=e?e[0]!==","?[e]:e.slice(1):[];const r=e.map(n=>d(typeof n=="string"?[":",n,n]:n));return n=>{const o={},i={};for(const s of r.flatMap(u=>u(n)))if(s[0]===et){const[,u,c]=s;i[u]={...i[u],...c,configurable:!0,enumerable:!0}}else o[s[0]]=s[1];for(const s in i)Object.defineProperty(o,s,i[s]);return o}});l("{",e=>(e=e?d(e):()=>{},t=>e(Object.create(t))));l(":",(e,t)=>(t=d(t),Array.isArray(e)?(e=d(e),r=>[[e(r),t(r)]]):r=>[[e,t(r)]]));const hn=170,ye=96,pn=36,gn=123,mn=92,yn={n:`
8
+ `,r:"\r",t:" ",b:"\b",f:"\f",v:"\v"},lt=()=>{const e=[];for(let t="",r;(r=g.charCodeAt(h))!==ye;)r?r===mn?(O(),t+=yn[g[h]]||g[h],O()):r===pn&&g.charCodeAt(h+1)===gn?(t&&e.push([,t]),t="",O(2),e.push(E(0,125))):(t+=g[h],O(),r=g.charCodeAt(h),r===ye&&t&&e.push([,t])):z("Unterminated template");return O(),e},$n=R[ye];R[ye]=(e,t)=>e&&t<hn?y.asi&&y.newline?void 0:(O(),["``",e,...lt()]):e?$n?.(e,t):(O(),(r=>r.length<2&&r[0]?.[0]===void 0?r[0]||[,""]:["`",...r])(lt()));l("`",(...e)=>(e=e.map(d),t=>e.map(r=>r(t)).join("")));l("``",(e,...t)=>{e=d(e);const r=[],n=[];for(const i of t)Array.isArray(i)&&i[0]===void 0?r.push(i[1]):n.push(d(i));const o=Object.assign([...r],{raw:r});return i=>e(i)(o,...n.map(s=>s(i)))});y.string["'"]=!0;y.number={"0x":16,"0b":2,"0o":8};const An={log:(e,t)=>(t?console.log(t,e):console.log(e),e)};function U(e,t,r,n,o){const i=y(Sn(e));return d(i)({$form:t,$meta:r,$errors:n,$formIsInvalid:o,$log:An.log})===!0}function Sn(e){return e.replace(/\?\.(\d+)/g,"?.[$1]").replace(/\.(\d+)/g,"[$1]")}const L=e=>{let t=e.formDef.states;if(!t||Object.keys(t).length===0||e.formHealth.status==="errored")return e;const{$formIsInvalid:r,$errors:n}=Ke(e);t=En(t);let o=[],i={status:"ok"};try{o=Object.keys(t).map(s=>{const u=t[s];let c;try{c=U(u,e.data,e.meta,n,r)}catch{c=!1}return c===!0?s:void 0}).filter(s=>s!==void 0)}catch(s){const u=s,c=b.calculateCurrentStateError;i={status:"errored",message:`[${c}] ${u.message}`,code:c}}return{...e,currentStates:o,formHealth:i}};function En(e){const t={};function r(n){const o=n.split(":"),i=[];for(let s=0;s<o.length;s++)i.push(o.slice(0,s+1).join(":"));return i}for(const[n,o]of Object.entries(e)){const i=r(n),s=[];for(const u of i)e[u]&&s.push(`(${e[u]})`);t[n]=s.join(" && ")}return t}const rt=Symbol("filterMap.skip");function Mt(e,t){const r=[];for(let n=0;n<e.length;n++){const o=t(e[n],n,e);o!==rt&&r.push(o)}return r}function vn(e,t,r){for(let n=0;n<e.length;n++)t(e[n],n,e)&&r(e[n],n,e)}function In(e,t,r,n){let o=n;for(let i=0;i<e.length;i++)t(e[i],i,e)&&(o=r(o,e[i],i,e));return o}function Cn(e,t,r){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n],n,e,t))return!1;return!0}function Vt(e,t){const r=Bt(e.uid,t);return D(e)?{...e,uid:r,path:On(e.path,t)}:{...e,uid:r}}function Bt(e,t){if(t.length===0)throw new Error("Repeater indexes cannot be an empty array");const r=t.reduce((n,o)=>`${n}[${o}]`,"");return`${e}${r}`}function On(e,t){if(t.length===0)throw new Error("Repeater indexes cannot be an empty array");const r="items",n=e.split(`.${r}`),o=n.length-1;if(o!==t.length)throw new Error(`Path contains ${o} '${r}' occurrences, but ${t.length} indexes were provided.`);return n.reduce((i,s,u)=>u===0?s:`${i}.${t[u-1]}${s}`)}function ce(e,t){let r=0;return e.replace(/\.items(\??)\./g,(n,o)=>{const i=t[r++];return i===void 0?n:`.${i}${o}.`})}const le=(e,t)=>r=>e(r)?t(r):r,K=e=>e!==void 0&&typeof e=="object"&&e!==null&&"when"in e,j=e=>{const{$formIsInvalid:t,$errors:r}=Ke(e);return{...e,widgetFlags:{...wn(e,r,t),...Pn(e,r,t)}}};function wn(e,t,r){return Mt(Object.values(e.flatForm),n=>{if(n.uid?.includes("["))return rt;if(ie(n)){const o=n({$form:e.data,errors:void 0,touched:void 0,translate:void 0});return o.uid=n.uid,o}return n}).filter(n=>!!(n.include&&("in"in n.include||"when"in n.include)||n.exclude&&("from"in n.exclude||"when"in n.exclude)||(D(n)||ee(n))&&K(n.disabled)||D(n)&&K(n.readonly))).reduce((n,o)=>(n[o.uid]=n[o.uid]||{},o.include&&"in"in o.include?n[o.uid].hidden=!o.include.in.some(i=>e.currentStates.includes(i)):o.include&&"when"in o.include&&(n[o.uid].hidden=!U(o.include.when,e.data,e.meta,t,r)),o.exclude&&"from"in o.exclude?n[o.uid].hidden=o.exclude.from.some(i=>e.currentStates.includes(i)):o.exclude&&"when"in o.exclude&&(n[o.uid].hidden=U(o.exclude.when,e.data,e.meta,t,r)),(D(o)||ee(o))&&K(o.disabled)&&(n[o.uid].disabled=U(o.disabled.when,e.data,e.meta,t,r)),D(o)&&K(o.readonly)&&(n[o.uid].readonly=U(o.readonly.when,e.data,e.meta,t,r)),n),{})}function Pn(e,t,r){return In(Object.values(e.flatForm),n=>!ie(n)&&n.type==="repeater",(n,o)=>({...n,...Ht(e,o,[],t,r)}),{})}function Ht(e,t,r,n,o){const i=t.props.template,s=k(e.data,t.path);if(!Array.isArray(s))return{};const u={};return s.forEach((c,p)=>{const A=[...r,p];Ge([i]).forEach(m=>{let f;if(ie(m)?(f=m({$form:e.data,errors:void 0,touched:void 0,translate:void 0}),f.uid=m.uid):f=m,f.type==="repeater"){const x=Vt(f,A);Object.assign(u,Ht(e,x,A,n,o));return}const w=Bt(f.uid,A);u[w]=u[w]||{},f.include&&"in"in f.include?u[w].hidden=!f.include.in.some(x=>e.currentStates.includes(x)):f.include&&"when"in f.include&&(u[w].hidden=!U(ce(f.include.when,A),e.data,e.meta,n,o)),f.exclude&&"from"in f.exclude?u[w].hidden=f.exclude.from.some(x=>e.currentStates.includes(x)):f.exclude&&"when"in f.exclude&&(u[w].hidden=U(ce(f.exclude.when,A),e.data,e.meta,n,o)),(D(f)||ee(f))&&K(f.disabled)&&(u[w].disabled=U(ce(f.disabled.when,A),e.data,e.meta,n,o)),D(f)&&K(f.readonly)&&(u[w].readonly=U(ce(f.readonly.when,A),e.data,e.meta,n,o))})}),u}const N=e=>t=>({...t,calculatedWidgets:Dn(t,e)});function Dn(e,t){const{$formIsInvalid:r,$errors:n}=Ke(e),o=Xn(e,t,r,n),i={};for(const s of Object.keys(e.calculatedWidgets)){if(e.widgetFlags[s]?.hidden)continue;const u=e.calculatedWidgets[s],c=u.source;if(ie(c)){i[s]=Fn(s,c,e,t);continue}i[s]=Tn(u,c,e,o)}return i}function Fn(e,t,r,n){const o=t({$form:r.data,errors:t.path?r.validations[t.path]:void 0,touched:t.path?r.touchedControls[t.path]:void 0,translate:n.translate});return o.uid=e,{source:t,current:o}}function Tn(e,t,r,n){const o=new Kn(t,e.current);return o.write("uid",t.uid),o.write("type",t.type),o.write("kind",t.kind),nr(t)?Wn(o,n):ee(t)?Rn(o,n):D(t)?kn(o,n):Te(t)&&_n(o,n),Nn(t,o,n,r),(ee(t)||D(t))&&Un(t,o,n),Te(t)&&Ln(t,o,r),o.changed?{source:e.source,current:o.current}:e}function Wn(e,t){v(e,t,"size"),v(e,t,"include"),v(e,t,"exclude")}function Rn(e,t){v(e,t,"size"),v(e,t,"include"),v(e,t,"exclude"),v(e,t,"label"),v(e,t,"disabled")}function kn(e,t){v(e,t,"size"),v(e,t,"include"),v(e,t,"exclude"),v(e,t,"label"),v(e,t,"disabled"),v(e,t,"readonly"),v(e,t,"validator"),v(e,t,"path"),v(e,t,"defaultValue")}function _n(e,t){v(e,t,"size"),v(e,t,"include"),v(e,t,"exclude")}function Nn(e,t,r,n){const o=n.widgetPropOverrides[e.uid]??{},i={...e.props??{},...o};for(const s of Xt(Object.keys(i)))jn(t,r,s)}function Un(e,t,r){const n=e.on??{};for(const o of Xt(Object.keys(n)))Mn(t,r,o)}function Ln(e,t,r){const n=Qn(e.uid),o=Jn(e.children,n,r.widgetFlags);t.current.children=o;const i=t.previous.children??[];i.length===o.length&&o.every((u,c)=>i[c]&&i[c].uid===o[c].uid)||t.markChanged()}function v(e,t,r){const n=e.source;if(!zn(n,r))return;const o=ot(n,r,t.sortedStates);let i;switch(r){case"disabled":case"readonly":i=Bn(o,t,e.source.uid,r);break;default:i=Kt(o,t)}e.write(r,i)}function jn(e,t,r){const n=e.source.props,o=ot(n,r,t.sortedStates);let i=Kt(o,t);const s=t.widgetPropOverrides[e.source.uid]?.[r];s!==void 0&&(i=s),e.write(`props.${r}`,i)}function Mn(e,t,r){const n=e.source.on,o=ot(n,r,t.sortedStates);e.write(`on.${r}`,Hn(o,t))}function nt(e,t){return e({$form:t.$form,translate:t.localization.translate})}function Vn(e,t){return t.localization.translate(e.key,Gn(e.params,t),e.default)}function Gt(e,t){return vr(e,{resolveFormPath:r=>k(t.$form,r)??e,resolveMetaPath:r=>k(t.$meta,r)??e,resolveErrorsPath:r=>k(t.$errors,r)??e,resolveFormIsInvalid:()=>String(t.$formIsInvalid)})}function Kt(e,t){return typeof e=="function"?nt(e,t):pr(e)?Vn(e,t):typeof e=="string"?Gt(e,t):e}function Bn(e,t,r,n){return typeof e=="function"?nt(e,t):K(e)?t.widgetFlags[r]?.[n]:typeof e=="string"?Gt(e,t):e}function Hn(e,t){return typeof e=="function"?nt(e,t):e}function ot(e,t,r){if(e){for(const n of r){const o=e[`${t}.${n}`];if(o!==void 0)return o}return e[t]}}function Gn(e,t){return e&&Object.keys(e).reduce((r,n)=>{const o=String(e[n]);return Ar(o)?r[n]=Ir(o,{resolveFormPath:i=>k(t.$form,i)??o,resolveMetaPath:i=>k(t.$meta,i)??o,resolveErrorsPath:i=>k(t.$errors,i)??o,resolveFormIsInvalid:()=>t.$formIsInvalid}):r[n]=o,r},{})}class Kn{constructor(t,r){this._changed=!1,this.source=t,this.previous=r,this.current={}}get changed(){return this._changed}markChanged(){this._changed=!0}write(t,r){He(this.current,t,r),k(this.previous,t)!==r&&(this._changed=!0)}}function Xn(e,t,r,n){return{sortedStates:[...e.currentStates].sort((o,i)=>i.length-o.length),widgetPropOverrides:e.widgetPropOverrides,widgetFlags:e.widgetFlags,$form:e.data,$meta:e.meta,$formIsInvalid:r,$errors:n,localization:t}}function zn(e,t){if(t in e)return!0;const r=`${t}.`;return Object.keys(e).some(n=>n.startsWith(r))}function Xt(e){return Array.from(new Set(e.map(t=>t.split(".")[0])))}function Jn(e,t,r){const n=t.map(o=>`[${o}]`).join("");return e.filter(o=>{const i=o.uid+n,s=r[i];return!s||s.hidden!==!0})}const Qn=e=>[...e.matchAll(/\[(\d+)\]/g)].map(t=>parseInt(t[1],10)),qn=({lang:e},t)=>{const r={...mt(e),formName:t.payload.formName};let n=t.payload.formDef,o={status:"ok"};if(typeof n=="string"){try{n=JSON.parse(n)}catch(u){const c=u,p=b.initializeParseError;o={status:"errored",message:`[${p}] ${c.message}`,code:p}}if(o.status==="errored")return{...r,formHealth:o}}if(Array.isArray(n.form)){const u=n,c=u.form;u.form={uid:"",type:"flex",kind:"layout",children:c}}const i=gt.decode(n);if(i.isOk()){o={status:"ok"};let u={};try{u=Ge([i.value.form]).reduce((c,p)=>{const A=p.uid;if(c[A])throw{existingWidget:c[A],newWidget:p};return c[A]=p,c},{})}catch(c){const p=b.initializeUidCollisionError;o={status:"errored",message:`[${p}] ${Yn(c.existingWidget,c.newWidget)}`,code:p},u={}}return{...r,formDef:i.value,flatForm:u,formHealth:o}}const s=b.initializeUnknownError;return{...r,formHealth:{status:"errored",message:`[${s}] ${i.error}`,code:s}}};function Yn(e,t){const r=n=>D(n)?` at "${n.path}"`:"";return`Duplicate UID "${t.uid}": Assigned to widget "${e.type}"${r(e)} and "${t.type}"${r(t)}.`}function Zn(e,t){return{...e,injectedValidations:{...e.injectedValidations,[t.payload.path]:t.payload.issues}}}const xn=(e,{payload:t})=>{let r;if("path"in t){if(r=Object.values(e.calculatedWidgets).find(({source:i})=>D(i)&&i.path===t.path),!r)return console.warn(`Input with path "${t.path}" not found`),e}else if(r=e.calculatedWidgets[t.uid],!r)return console.warn(`Widget with uid "${t.uid}" not found`),e;const n=r.source.uid,o=e.widgetPropOverrides[n]||{};return{...e,widgetPropOverrides:{...e.widgetPropOverrides,[n]:{...o,[t.prop]:t.value}}}};function bn(e,t){return{...e,widgetFlags:{...ue(e.widgetFlags,t.payload.uid)},calculatedWidgets:{...ue(e.calculatedWidgets,t.payload.uid)},widgetPropOverrides:{...ue(e.widgetPropOverrides,t.payload.uid)},touchedControls:{..._(e.touchedControls,r=>{const n=e.flatForm[t.payload.uid];return n&&D(n)?ue(r,n.path):r})}}}const eo=(e,t)=>({...e,data:{...t.payload.data}}),to=(e,t)=>({...e,formHealth:t.payload.formHealth}),ro=(e,t)=>({...e,lang:t.payload.lang}),no=(e,t)=>({...e,meta:{...t.payload.meta}}),oo=(e,t)=>{const r=k(e.data,t.payload.path);return t.type==="SET_WIDGET_DATA"||t.type==="SET_WIDGET_INITIAL_DATA"&&r===void 0?{...e,data:{...He(e.data,t.payload.path,t.payload.data)}}:e},Pe=(e,t)=>r=>{const n=Mt(Object.values(r.calculatedWidgets),({current:i})=>D(i)?i:rt),o=r.validations;return{...r,validations:n.reduce((i,s)=>{if(i[s.path]=null,s.validator){const u=e(s.validator,t),c=k(r.data,s.path),p=at(u,c);i[s.path]=ft(p)?null:p.issues.map(A=>A.message)}return Array.isArray(i[s.path])&&Array.isArray(o[s.path])&&Cn(i[s.path],o[s.path],(u,c)=>u===c)&&(i[s.path]=o[s.path]),i},{})}},io=({validators:e,validateOn:t,localization:r})=>(n,o)=>{switch(o.type){case"INITIALIZE":return qn(n,o);case"SET_DATA":return _(eo(n,o),L,j,N(r));case"SET_META":return _(no(n,o),L,j,N(r));case"SET_LANGUAGE":return _(ro(n,o),N(r));case"ADD_WIDGET":return _(yr(n,o),le(De,L),le(De,j),le(De,N(r)));case"REMOVE_WIDGET":return _(bn(n,o),L,j,N(r));case"SET_WIDGET_INITIAL_DATA":case"SET_WIDGET_DATA":return _(oo(n,o),L,j,N(r));case"OVERRIDE_WIDGET_PROP":return _(xn(n,o),L,j,N(r),le(i=>{let s=!1,u="";"path"in o.payload?(s=!0,u=o.payload.path):D(i.calculatedWidgets[o.payload.uid].current)&&(s=!0,u=i.calculatedWidgets[o.payload.uid].current.path);const c=s&&i.touchedControls[u];return i.touched&&c},Pe(e,r)));case"SET_FORM_HEALTH":return to(n,o);case"VALIDATE_ALL":return _({...n,touched:!0,touchedControls:Object.keys(n.calculatedWidgets).reduce((i,s)=>{const u=n.calculatedWidgets[s].source;return D(u)&&(i[u.path]=!0),i},{})},Pe(e,r),L,j,N(r));case"ATTEMPT_VALIDATION":{const i=o.payload.reason,s=o.payload.path;return t==="eager"||i===t||t.includes(i)?_({...n,touched:!0,touchedControls:{...n.touchedControls,[s]:!0}},Pe(e,r),L,j,N(r),c=>{const p=o.payload.uid,A=c.calculatedWidgets[p],m=A.source;if(ie(m)){const f=m({$form:c.data,errors:c.validations[s],touched:!0,translate:r.translate});return{...c,calculatedWidgets:{...c.calculatedWidgets,[p]:{source:A.source,current:f}}}}return c}):n}case"INJECT_VALIDATION_ISSUES":return Zn(n,o);default:return mr(o)}},De=e=>e.formHealth.status==="ok";function so(e=[],t,r,n){const o=new a.BehaviorSubject(mt(n.lang)),i=o.asObservable().pipe(a.distinctUntilChanged()),s=io({validators:t,validateOn:r,localization:n});function u(m){const f=o.getValue(),w=s(f,m);o.next(w)}let c=u;const p={getState:()=>o.getValue(),dispatch:m=>c(m)};return c=e.map(m=>m(p)).reduceRight((m,f)=>f(m),u),{state$:i,dispatch:c,getState:()=>o.getValue()}}class uo{constructor(){this.widgetRegistry=new Re,this.store={},this.events$=new a.Subject,this.uuid=crypto.randomUUID(),this.itemRenderers={},this.dependencies={}}initialize(t,r=[],n,o,i,s=yt(),u){this.localization=s,this.dependencies=u,this.widgetRegistry.setWidgetLoaders(t),this.itemRenderers=i,this.store=so(r,n,o,s)}emitEvent(t,r,n){const i=this.store.getState().currentStates.filter(s=>r.on?.[`${t}.${s}`]!==void 0);if(i.length>0)i.forEach(s=>{const u=r.on?.[`${t}.${s}`];this.attemptValidation(t,u,r),u&&this.events$.next({name:u,data:this.store.getState().data,detail:n??void 0,callback:c=>{this.store.dispatch(c)}})});else{const s=r.on?.[t];this.attemptValidation(t,s,r),s&&this.events$.next({name:s,data:this.store.getState().data,detail:n,callback:u=>{this.store.dispatch(u)}})}}attemptValidation(t,r,n){n.kind!=="layout"&&(t==="change"?this.store.dispatch({type:"ATTEMPT_VALIDATION",payload:{reason:"change",path:n.path,uid:n.uid}}):t==="click"&&r==="submit"&&this.store.dispatch({type:"VALIDATE_ALL"}))}}function co(e="GolemUI Form Store"){return t=>{const n=(typeof window<"u"?window.__REDUX_DEVTOOLS_EXTENSION__:void 0)?.connect({name:e});return n?.init(t.getState()),o=>i=>{o(i),n&&n.send(i,t.getState())}}}const lo=a.pipe(a.map(e=>e.data),a.distinctUntilChanged()),ao=e=>a.pipe(lo,a.map(t=>k(t,e)),a.distinctUntilChanged()),fo=a.pipe(a.filter(e=>e.touched===!0),a.map(e=>e.validations),a.distinctUntilChanged()),ho=e=>a.pipe(fo,a.map(t=>t[e]),a.distinctUntilChanged()),po=a.pipe(a.filter(e=>e.touched===!0),a.map(e=>e.injectedValidations),a.distinctUntilChanged()),go=e=>a.pipe(po,a.map(t=>t[e]),a.distinctUntilChanged(),a.startWith(null)),mo=a.pipe(a.map(e=>e.lang),a.distinctUntilChanged()),zt=a.pipe(a.map(e=>e.calculatedWidgets),a.distinctUntilChanged()),yo=e=>t=>a.combineLatest([t.pipe(mo),t.pipe(zt)]).pipe(a.map(([r,n])=>({lang:r,widget:n[e]})),a.filter(r=>r.widget!==void 0),a.distinctUntilChanged((r,n)=>r.lang===n.lang&&r.widget===n.widget),a.map(r=>r.widget.current)),$o=e=>a.pipe(zt,a.map(t=>t[e]),a.filter(t=>t!==void 0),a.map(t=>t.current.children),a.distinctUntilChanged());a.pipe(a.map(e=>e.widgetFlags),a.distinctUntilChanged());const Ao=a.pipe(a.map(e=>e.touchedControls),a.distinctUntilChanged()),So=e=>a.pipe(Ao,a.map(t=>t[e]),a.distinctUntilChanged()),Eo=a.pipe(a.map(e=>e.formHealth),a.distinctUntilChanged((e,t)=>!(e.status!==t.status||e.status==="errored"))),vo=e=>e.pipe(Eo);let Jt=!1;function Io(){Jt=!0}function Co(){return Jt}function Oo(e,t,r){if(!Co())return;const n=Object.keys(t??{}).filter(o=>o in r);if(n.length>0)throw new Error(`[GolemUI] Widget "${e}": prop keys [${n.join(", ")}] collide with widget fields`)}exports.FormContext=uo;exports.assertNoPropCollisions=Oo;exports.calculatedLayoutChildrenByUid$=$o;exports.calculatedWidgetsByUid$=yo;exports.cloneObject=ke;exports.dataByPath$=ao;exports.defineForm=hr;exports.devToolsMiddleware=co;exports.enableDevMode=Io;exports.errorCodes=b;exports.filterTap=vn;exports.formHealth=vo;exports.getDirectionFromLanguage=gr;exports.identityTranslator=yt;exports.injectedValidationByPath$=go;exports.isStandardValidateSuccess=ft;exports.makeRepeaterItemConfig=Vt;exports.shortUUID=je;exports.standardValidate=at;exports.touchedControlsByPath$=So;exports.validationByPath$=ho;
package/lib/form.d.ts CHANGED
@@ -34,5 +34,5 @@ export declare const formDefDecoder: import('ts.data.json').Decoder<{
34
34
  states: {
35
35
  [K: string]: string;
36
36
  } | undefined;
37
- form: LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, (LayoutWidget<string, any, any, /*elided*/ any> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]> | import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any>)[]>;
37
+ form: LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, (import('./form-widget').DisplayWidget<string, any, any> | import('./form-widget').ActionWidget<string, any, any> | import('./form-widget').FunctionWidget<string, any, any> | import('./form-widget').InputWidget<any, string, any, any, any> | LayoutWidget<string, any, any, /*elided*/ any>)[]>)[]>)[]>)[]>)[]>)[]>)[]>)[]>)[]>)[]>)[]>;
38
38
  }>;
@@ -1,14 +1,14 @@
1
- export * from './add-widget';
2
- export * from './calculate-current-state';
3
- export * from './calculate-widget-flags';
4
- export * from './calculate-widget-props';
5
- export * from './initialize';
6
- export * from './inject-validation-issues';
7
- export * from './override-widget-prop';
8
- export * from './remove-widget';
9
- export * from './set-data';
10
- export * from './set-form-health';
11
- export * from './set-language';
12
- export * from './set-meta';
13
- export * from './set-widget-data';
14
- export * from './validate-all';
1
+ export { addWidget } from './add-widget';
2
+ export { calculateCurrentState } from './calculate-current-state';
3
+ export { calculateWidgetFlags } from './calculate-widget-flags';
4
+ export { calculateWidgetProps } from './calculate-widget-props';
5
+ export { initialize } from './initialize';
6
+ export { injectValidationIssues } from './inject-validation-issues';
7
+ export { overrideWidgetProp } from './override-widget-prop';
8
+ export { removeWidget } from './remove-widget';
9
+ export { setData } from './set-data';
10
+ export { setFormHealth } from './set-form-health';
11
+ export { setLanguage } from './set-language';
12
+ export { setMeta } from './set-meta';
13
+ export { setWidgetData } from './set-widget-data';
14
+ export { validateAll } from './validate-all';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemui/core",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "type": "module",
5
5
  "main": "./index.umd.cjs",
6
6
  "module": "./index.js",
@@ -1,3 +0,0 @@
1
- export * from './widget-registry';
2
- export * from './form.context';
3
- export * from './with-widget.type';
@@ -1 +0,0 @@
1
- export * from './devtools/devtools.middleware';