zod-form-kit
Version:
UI-agnostic form generation library based on Zod schemas with extensible adapter pattern
63 lines • 60.7 kB
JavaScript
(function(O,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react"),require("zod")):typeof define=="function"&&define.amd?define(["exports","react","zod"],j):(O=typeof globalThis<"u"?globalThis:O||self,j(O["zod-form-kit"]={},O.React,O.z))})(this,function(O,j,V){"use strict";var Hr=Object.defineProperty;var zr=(O,j,V)=>j in O?Hr(O,j,{enumerable:!0,configurable:!0,writable:!0,value:V}):O[j]=V;var ke=(O,j,V)=>zr(O,typeof j!="symbol"?j+"":j,V);var he={exports:{}},X={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ie;function $t(){if(Ie)return X;Ie=1;var t=j,a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),e=Object.prototype.hasOwnProperty,r=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(u,d,c){var l,h={},v=null,p=null;c!==void 0&&(v=""+c),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(p=d.ref);for(l in d)e.call(d,l)&&!s.hasOwnProperty(l)&&(h[l]=d[l]);if(u&&u.defaultProps)for(l in d=u.defaultProps,d)h[l]===void 0&&(h[l]=d[l]);return{$$typeof:a,type:u,key:v,ref:p,props:h,_owner:r.current}}return X.Fragment=i,X.jsx=o,X.jsxs=o,X}var Q={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var $e;function Lt(){return $e||($e=1,process.env.NODE_ENV!=="production"&&function(){var t=j,a=Symbol.for("react.element"),i=Symbol.for("react.portal"),e=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g=Symbol.iterator,S="@@iterator";function y(n){if(n===null||typeof n!="object")return null;var m=g&&n[g]||n[S];return typeof m=="function"?m:null}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(n){{for(var m=arguments.length,b=new Array(m>1?m-1:0),E=1;E<m;E++)b[E-1]=arguments[E];x("error",n,b)}}function x(n,m,b){{var E=R.ReactDebugCurrentFrame,A=E.getStackAddendum();A!==""&&(m+="%s",b=b.concat([A]));var T=b.map(function(M){return String(M)});T.unshift("Warning: "+m),Function.prototype.apply.call(console[n],console,T)}}var D=!1,k=!1,w=!1,C=!1,U=!1,q;q=Symbol.for("react.module.reference");function _r(n){return!!(typeof n=="string"||typeof n=="function"||n===e||n===s||U||n===r||n===c||n===l||C||n===p||D||k||w||typeof n=="object"&&n!==null&&(n.$$typeof===v||n.$$typeof===h||n.$$typeof===o||n.$$typeof===u||n.$$typeof===d||n.$$typeof===q||n.getModuleId!==void 0))}function Sr(n,m,b){var E=n.displayName;if(E)return E;var A=m.displayName||m.name||"";return A!==""?b+"("+A+")":b}function mt(n){return n.displayName||"Context"}function B(n){if(n==null)return null;if(typeof n.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case e:return"Fragment";case i:return"Portal";case s:return"Profiler";case r:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case u:var m=n;return mt(m)+".Consumer";case o:var b=n;return mt(b._context)+".Provider";case d:return Sr(n,n.render,"ForwardRef");case h:var E=n.displayName||null;return E!==null?E:B(n.type)||"Memo";case v:{var A=n,T=A._payload,M=A._init;try{return B(M(T))}catch{return null}}}return null}var K=Object.assign,ee=0,pt,gt,bt,yt,_t,St,Et;function jt(){}jt.__reactDisabledLog=!0;function Er(){{if(ee===0){pt=console.log,gt=console.info,bt=console.warn,yt=console.error,_t=console.group,St=console.groupCollapsed,Et=console.groupEnd;var n={configurable:!0,enumerable:!0,value:jt,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}ee++}}function jr(){{if(ee--,ee===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},n,{value:pt}),info:K({},n,{value:gt}),warn:K({},n,{value:bt}),error:K({},n,{value:yt}),group:K({},n,{value:_t}),groupCollapsed:K({},n,{value:St}),groupEnd:K({},n,{value:Et})})}ee<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var xe=R.ReactCurrentDispatcher,Ae;function ue(n,m,b){{if(Ae===void 0)try{throw Error()}catch(A){var E=A.stack.trim().match(/\n( *(at )?)/);Ae=E&&E[1]||""}return`
`+Ae+n}}var we=!1,ce;{var Rr=typeof WeakMap=="function"?WeakMap:Map;ce=new Rr}function Rt(n,m){if(!n||we)return"";{var b=ce.get(n);if(b!==void 0)return b}var E;we=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var T;T=xe.current,xe.current=null,Er();try{if(m){var M=function(){throw Error()};if(Object.defineProperty(M.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(M,[])}catch($){E=$}Reflect.construct(n,[],M)}else{try{M.call()}catch($){E=$}n.call(M.prototype)}}else{try{throw Error()}catch($){E=$}n()}}catch($){if($&&E&&typeof $.stack=="string"){for(var F=$.stack.split(`
`),I=E.stack.split(`
`),P=F.length-1,N=I.length-1;P>=1&&N>=0&&F[P]!==I[N];)N--;for(;P>=1&&N>=0;P--,N--)if(F[P]!==I[N]){if(P!==1||N!==1)do if(P--,N--,N<0||F[P]!==I[N]){var Z=`
`+F[P].replace(" at new "," at ");return n.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",n.displayName)),typeof n=="function"&&ce.set(n,Z),Z}while(P>=1&&N>=0);break}}}finally{we=!1,xe.current=T,jr(),Error.prepareStackTrace=A}var J=n?n.displayName||n.name:"",G=J?ue(J):"";return typeof n=="function"&&ce.set(n,G),G}function Vr(n,m,b){return Rt(n,!1)}function Or(n){var m=n.prototype;return!!(m&&m.isReactComponent)}function de(n,m,b){if(n==null)return"";if(typeof n=="function")return Rt(n,Or(n));if(typeof n=="string")return ue(n);switch(n){case c:return ue("Suspense");case l:return ue("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case d:return Vr(n.render);case h:return de(n.type,m,b);case v:{var E=n,A=E._payload,T=E._init;try{return de(T(A),m,b)}catch{}}}return""}var te=Object.prototype.hasOwnProperty,Vt={},Ot=R.ReactDebugCurrentFrame;function fe(n){if(n){var m=n._owner,b=de(n.type,n._source,m?m.type:null);Ot.setExtraStackFrame(b)}else Ot.setExtraStackFrame(null)}function Fr(n,m,b,E,A){{var T=Function.call.bind(te);for(var M in n)if(T(n,M)){var F=void 0;try{if(typeof n[M]!="function"){var I=Error((E||"React class")+": "+b+" type `"+M+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[M]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw I.name="Invariant Violation",I}F=n[M](m,M,E,b,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){F=P}F&&!(F instanceof Error)&&(fe(A),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",b,M,typeof F),fe(null)),F instanceof Error&&!(F.message in Vt)&&(Vt[F.message]=!0,fe(A),_("Failed %s type: %s",b,F.message),fe(null))}}}var Mr=Array.isArray;function Te(n){return Mr(n)}function xr(n){{var m=typeof Symbol=="function"&&Symbol.toStringTag,b=m&&n[Symbol.toStringTag]||n.constructor.name||"Object";return b}}function Ar(n){try{return Ft(n),!1}catch{return!0}}function Ft(n){return""+n}function Mt(n){if(Ar(n))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",xr(n)),Ft(n)}var xt=R.ReactCurrentOwner,wr={key:!0,ref:!0,__self:!0,__source:!0},At,wt;function Tr(n){if(te.call(n,"ref")){var m=Object.getOwnPropertyDescriptor(n,"ref").get;if(m&&m.isReactWarning)return!1}return n.ref!==void 0}function Cr(n){if(te.call(n,"key")){var m=Object.getOwnPropertyDescriptor(n,"key").get;if(m&&m.isReactWarning)return!1}return n.key!==void 0}function Pr(n,m){typeof n.ref=="string"&&xt.current}function Nr(n,m){{var b=function(){At||(At=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};b.isReactWarning=!0,Object.defineProperty(n,"key",{get:b,configurable:!0})}}function Dr(n,m){{var b=function(){wt||(wt=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};b.isReactWarning=!0,Object.defineProperty(n,"ref",{get:b,configurable:!0})}}var kr=function(n,m,b,E,A,T,M){var F={$$typeof:a,type:n,key:m,ref:b,props:M,_owner:T};return F._store={},Object.defineProperty(F._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(F,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(F,"_source",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.freeze&&(Object.freeze(F.props),Object.freeze(F)),F};function Ir(n,m,b,E,A){{var T,M={},F=null,I=null;b!==void 0&&(Mt(b),F=""+b),Cr(m)&&(Mt(m.key),F=""+m.key),Tr(m)&&(I=m.ref,Pr(m,A));for(T in m)te.call(m,T)&&!wr.hasOwnProperty(T)&&(M[T]=m[T]);if(n&&n.defaultProps){var P=n.defaultProps;for(T in P)M[T]===void 0&&(M[T]=P[T])}if(F||I){var N=typeof n=="function"?n.displayName||n.name||"Unknown":n;F&&Nr(M,N),I&&Dr(M,N)}return kr(n,F,I,A,E,xt.current,M)}}var Ce=R.ReactCurrentOwner,Tt=R.ReactDebugCurrentFrame;function z(n){if(n){var m=n._owner,b=de(n.type,n._source,m?m.type:null);Tt.setExtraStackFrame(b)}else Tt.setExtraStackFrame(null)}var Pe;Pe=!1;function Ne(n){return typeof n=="object"&&n!==null&&n.$$typeof===a}function Ct(){{if(Ce.current){var n=B(Ce.current.type);if(n)return`
Check the render method of \``+n+"`."}return""}}function $r(n){return""}var Pt={};function Lr(n){{var m=Ct();if(!m){var b=typeof n=="string"?n:n.displayName||n.name;b&&(m=`
Check the top-level render call using <`+b+">.")}return m}}function Nt(n,m){{if(!n._store||n._store.validated||n.key!=null)return;n._store.validated=!0;var b=Lr(m);if(Pt[b])return;Pt[b]=!0;var E="";n&&n._owner&&n._owner!==Ce.current&&(E=" It was passed a child from "+B(n._owner.type)+"."),z(n),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',b,E),z(null)}}function Dt(n,m){{if(typeof n!="object")return;if(Te(n))for(var b=0;b<n.length;b++){var E=n[b];Ne(E)&&Nt(E,m)}else if(Ne(n))n._store&&(n._store.validated=!0);else if(n){var A=y(n);if(typeof A=="function"&&A!==n.entries)for(var T=A.call(n),M;!(M=T.next()).done;)Ne(M.value)&&Nt(M.value,m)}}}function Ur(n){{var m=n.type;if(m==null||typeof m=="string")return;var b;if(typeof m=="function")b=m.propTypes;else if(typeof m=="object"&&(m.$$typeof===d||m.$$typeof===h))b=m.propTypes;else return;if(b){var E=B(m);Fr(b,n.props,"prop",E,n)}else if(m.PropTypes!==void 0&&!Pe){Pe=!0;var A=B(m);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",A||"Unknown")}typeof m.getDefaultProps=="function"&&!m.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Zr(n){{for(var m=Object.keys(n.props),b=0;b<m.length;b++){var E=m[b];if(E!=="children"&&E!=="key"){z(n),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),z(null);break}}n.ref!==null&&(z(n),_("Invalid attribute `ref` supplied to `React.Fragment`."),z(null))}}var kt={};function It(n,m,b,E,A,T){{var M=_r(n);if(!M){var F="";(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(F+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var I=$r();I?F+=I:F+=Ct();var P;n===null?P="null":Te(n)?P="array":n!==void 0&&n.$$typeof===a?(P="<"+(B(n.type)||"Unknown")+" />",F=" Did you accidentally export a JSX literal instead of a component?"):P=typeof n,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,F)}var N=Ir(n,m,b,A,T);if(N==null)return N;if(M){var Z=m.children;if(Z!==void 0)if(E)if(Te(Z)){for(var J=0;J<Z.length;J++)Dt(Z[J],n);Object.freeze&&Object.freeze(Z)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Dt(Z,n)}if(te.call(m,"key")){var G=B(n),$=Object.keys(m).filter(function(Yr){return Yr!=="key"}),De=$.length>0?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}";if(!kt[G+De]){var Gr=$.length>0?"{"+$.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,De,G,Gr,G),kt[G+De]=!0}}return n===e?Zr(N):Ur(N),N}}function Wr(n,m,b){return It(n,m,b,!0)}function qr(n,m,b){return It(n,m,b,!1)}var Br=qr,Kr=Wr;Q.Fragment=e,Q.jsx=Br,Q.jsxs=Kr}()),Q}process.env.NODE_ENV==="production"?he.exports=$t():he.exports=Lt();var f=he.exports;class Le{constructor(a,i){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=e=>{var r,s;this.listeners.add(e);const o=(s=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:s.call(r,e,this);return()=>{this.listeners.delete(e),o==null||o()}},this.setState=e=>{var r,s,o;const u=this.state;this.state=(r=this.options)!=null&&r.updateFn?this.options.updateFn(u)(e):e(u),(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),this._flush()},this._flush=()=>{if(this._batching)return;const e=++this._flushing;this.listeners.forEach(r=>{this._flushing===e&&r()})},this.batch=e=>{if(this._batching)return e();this._batching=!0,e(),this._batching=!1,this._flush()},this.state=a,this.options=i}}function re(t,a){return typeof t=="function"?t(a):t}function Ue(t,a){return pe(a).reduce((e,r)=>{if(e===null)return null;if(typeof e<"u")return e[r]},t)}function ve(t,a,i){const e=pe(a);function r(s){if(!e.length)return re(i,s);const o=e.shift();if(typeof o=="string")return typeof s=="object"?(s===null&&(s={}),{...s,[o]:r(s[o])}):{[o]:r()};if(Array.isArray(s)&&o!==void 0){const u=s.slice(0,o);return[...u.length?u:new Array(o),r(s[o]),...s.slice(o+1)]}return[...new Array(o),r()]}return r(t)}function Ut(t,a){const i=pe(a);function e(r){if(!r)return;if(i.length===1){const o=i[0];if(Array.isArray(r)&&typeof o=="number")return r.filter((c,l)=>l!==o);const{[o]:u,...d}=r;return d}const s=i.shift();if(typeof s=="string"&&typeof r=="object")return{...r,[s]:e(r[s])};if(typeof s=="number"&&Array.isArray(r)){if(s>=r.length)return r;const o=r.slice(0,s);return[...o.length?o:new Array(s),e(r[s]),...r.slice(s+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return e(t)}const Zt=/^(\d*)$/gm,Wt=/\.(\d*)\./gm,qt=/^(\d*)\./gm,Bt=/\.(\d*$)/gm,Kt=/\.{2,}/gm,me="__int__",ne=`${me}$1`;function pe(t){if(typeof t!="string")throw new Error("Path must be a string.");return t.replaceAll("[",".").replaceAll("]","").replace(Zt,ne).replace(Wt,`.${ne}.`).replace(qt,`${ne}.`).replace(Bt,`.${ne}`).replace(Kt,".").split(".").map(a=>a.indexOf(me)===0?parseInt(a.substring(me.length),10):a)}function Gt(t){return!(Array.isArray(t)&&t.length===0)}function ge(t,a){const{asyncDebounceMs:i}=a,{onChangeAsync:e,onBlurAsync:r,onSubmitAsync:s,onBlurAsyncDebounceMs:o,onChangeAsyncDebounceMs:u}=a.validators||{},d=i??0,c={cause:"change",validate:e,debounceMs:u??d},l={cause:"blur",validate:r,debounceMs:o??d},h={cause:"submit",validate:s,debounceMs:0},v=p=>({...p,debounceMs:0});switch(t){case"submit":return[v(c),v(l),h];case"blur":return[l];case"change":return[c];case"server":default:return[]}}function be(t,a){const{onChange:i,onBlur:e,onSubmit:r}=a.validators||{},s={cause:"change",validate:i},o={cause:"blur",validate:e},u={cause:"submit",validate:r},d={cause:"server",validate:()=>{}};switch(t){case"submit":return[s,o,u,d];case"server":return[d];case"blur":return[o,d];case"change":default:return[s,d]}}function ye(t){return{values:t.values??{},errors:t.errors??[],errorMap:t.errorMap??{},fieldMeta:t.fieldMeta??{},canSubmit:t.canSubmit??!0,isFieldsValid:t.isFieldsValid??!1,isFieldsValidating:t.isFieldsValidating??!1,isFormValid:t.isFormValid??!1,isFormValidating:t.isFormValidating??!1,isSubmitted:t.isSubmitted??!1,isSubmitting:t.isSubmitting??!1,isTouched:t.isTouched??!1,isPristine:t.isPristine??!0,isDirty:t.isDirty??!1,isValid:t.isValid??!1,isValidating:t.isValidating??!1,submissionAttempts:t.submissionAttempts??0,validationMetaMap:t.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}}}class Yt{constructor(a){var i;this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const{onMount:e}=this.options.validators||{};if(!e)return;const r=this.runValidator({validate:e,value:{value:this.state.values,formApi:this},type:"validate"});r&&this.store.setState(s=>({...s,errorMap:{...s.errorMap,onMount:r}}))},this.update=e=>{if(!e)return;const r=this.options;this.options=e,this.store.batch(()=>{const s=e.defaultValues&&e.defaultValues!==r.defaultValues&&!this.state.isTouched,o=e.defaultState!==r.defaultState&&!this.state.isTouched;this.store.setState(()=>ye(Object.assign({},this.state,o?e.defaultState:{},s?{values:e.defaultValues}:{})))})},this.reset=()=>{const{fieldMeta:e}=this.state,r=this.resetFieldMeta(e);this.store.setState(()=>{var s;return ye({...this.options.defaultState,values:this.options.defaultValues??((s=this.options.defaultState)==null?void 0:s.values),fieldMeta:r})})},this.validateAllFields=async e=>{const r=[];return this.store.batch(()=>{Object.values(this.fieldInfo).forEach(o=>{if(!o.instance)return;const u=o.instance;r.push(Promise.resolve().then(()=>u.validate(e))),o.instance.state.meta.isTouched||o.instance.setMeta(d=>({...d,isTouched:!0}))})}),(await Promise.all(r)).flat()},this.validateArrayFieldsStartingFrom=async(e,r,s)=>{const o=this.getFieldValue(e),u=Array.isArray(o)?Math.max(o.length-1,0):null,d=[`${e}[${r}]`];for(let v=r+1;v<=(u??0);v++)d.push(`${e}[${v}]`);const c=Object.keys(this.fieldInfo).filter(v=>d.some(p=>v.startsWith(p))),l=[];return this.store.batch(()=>{c.forEach(v=>{l.push(Promise.resolve().then(()=>this.validateField(v,s)))})}),(await Promise.all(l)).flat()},this.validateField=(e,r)=>{var s;const o=(s=this.fieldInfo[e])==null?void 0:s.instance;return o?(o.state.meta.isTouched||o.setMeta(u=>({...u,isTouched:!0})),o.validate(r)):[]},this.validateSync=e=>{const r=be(e,this.options);let s=!1;this.store.batch(()=>{for(const u of r){if(!u.validate)continue;const d=Ze(this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this},type:"validate"})),c=ie(u.cause);this.state.errorMap[c]!==d&&this.store.setState(l=>({...l,errorMap:{...l.errorMap,[c]:d}})),d&&(s=!0)}});const o=ie("submit");return this.state.errorMap[o]&&e!=="submit"&&!s&&this.store.setState(u=>({...u,errorMap:{...u.errorMap,[o]:void 0}})),{hasErrored:s}},this.validateAsync=async e=>{const r=ge(e,this.options);this.state.isFormValidating||this.store.setState(u=>({...u,isFormValidating:!0}));const s=[];for(const u of r){if(!u.validate)continue;const d=ie(u.cause),c=this.state.validationMetaMap[d];c==null||c.lastAbortController.abort();const l=new AbortController;this.state.validationMetaMap[d]={lastAbortController:l},s.push(new Promise(async h=>{let v;try{v=await new Promise((g,S)=>{setTimeout(async()=>{if(l.signal.aborted)return g(void 0);try{g(await this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this,signal:l.signal},type:"validateAsync"}))}catch(y){S(y)}},u.debounceMs)})}catch(g){v=g}const p=Ze(v);this.store.setState(g=>({...g,errorMap:{...g.errorMap,[ie(e)]:p}})),h(p)}))}let o=[];return s.length&&(o=await Promise.all(s)),this.store.setState(u=>({...u,isFormValidating:!1})),o.filter(Boolean)},this.validate=e=>{const{hasErrored:r}=this.validateSync(e);return r&&!this.options.asyncAlways?this.state.errors:this.validateAsync(e)},this.handleSubmit=async()=>{var e,r,s,o,u,d;if(this.store.setState(l=>({...l,isSubmitted:!1,submissionAttempts:l.submissionAttempts+1})),!this.state.canSubmit)return;this.store.setState(l=>({...l,isSubmitting:!0}));const c=()=>{this.store.setState(l=>({...l,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){c(),(r=(e=this.options).onSubmitInvalid)==null||r.call(e,{value:this.state.values,formApi:this});return}if(await this.validate("submit"),!this.state.isValid){c(),(o=(s=this.options).onSubmitInvalid)==null||o.call(s,{value:this.state.values,formApi:this});return}try{await((d=(u=this.options).onSubmit)==null?void 0:d.call(u,{value:this.state.values,formApi:this})),this.store.batch(()=>{this.store.setState(l=>({...l,isSubmitted:!0})),c()})}catch(l){throw c(),l}},this.getFieldValue=e=>Ue(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFieldInfo=e=>{var r;return(r=this.fieldInfo)[e]||(r[e]={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}})},this.setFieldMeta=(e,r)=>{this.store.setState(s=>({...s,fieldMeta:{...s.fieldMeta,[e]:re(r,s.fieldMeta[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((r,s)=>{const o=s;return r[o]={isValidating:!1,isTouched:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{}},r},{}),this.setFieldValue=(e,r,s)=>{const o=(s==null?void 0:s.dontUpdateMeta)??!1;this.store.batch(()=>{o||this.setFieldMeta(e,u=>({...u,isTouched:!0,isDirty:!0})),this.store.setState(u=>({...u,values:ve(u.values,e,r)}))})},this.deleteField=e=>{this.store.setState(r=>{const s={...r};return s.values=Ut(s.values,e),delete s.fieldMeta[e],s}),delete this.fieldInfo[e]},this.pushFieldValue=(e,r,s)=>{this.setFieldValue(e,o=>[...Array.isArray(o)?o:[],r],s),this.validateField(e,"change")},this.insertFieldValue=async(e,r,s,o)=>{this.setFieldValue(e,u=>[...u.slice(0,r),s,...u.slice(r)],o),await this.validateField(e,"change")},this.replaceFieldValue=async(e,r,s,o)=>{this.setFieldValue(e,u=>u.map((d,c)=>c===r?s:d),o),await this.validateField(e,"change"),await this.validateArrayFieldsStartingFrom(e,r,"change")},this.removeFieldValue=async(e,r,s)=>{const o=this.getFieldValue(e),u=Array.isArray(o)?Math.max(o.length-1,0):null;if(this.setFieldValue(e,d=>d.filter((c,l)=>l!==r),s),u!==null){const d=`${e}[${u}]`;Object.keys(this.fieldInfo).filter(l=>l.startsWith(d)).forEach(l=>this.deleteField(l))}await this.validateField(e,"change"),await this.validateArrayFieldsStartingFrom(e,r,"change")},this.swapFieldValues=(e,r,s,o)=>{this.setFieldValue(e,u=>{const d=u[r],c=u[s];return ve(ve(u,`${r}`,c),`${s}`,d)},o),this.validateField(e,"change"),this.validateField(`${e}[${r}]`,"change"),this.validateField(`${e}[${s}]`,"change")},this.moveFieldValues=(e,r,s,o)=>{this.setFieldValue(e,u=>(u.splice(s,0,u.splice(r,1)[0]),u),o),this.validateField(e,"change"),this.validateField(`${e}[${r}]`,"change"),this.validateField(`${e}[${s}]`,"change")},this.store=new Le(ye({...a==null?void 0:a.defaultState,values:(a==null?void 0:a.defaultValues)??((i=a==null?void 0:a.defaultState)==null?void 0:i.values),isFormValid:!0}),{onUpdate:()=>{var e,r;let{state:s}=this.store;const o=Object.values(s.fieldMeta),u=o.some(_=>_==null?void 0:_.isValidating),d=!o.some(_=>(_==null?void 0:_.errorMap)&&Gt(Object.values(_.errorMap).filter(Boolean))),c=o.some(_=>_==null?void 0:_.isTouched),l=o.some(_=>_==null?void 0:_.isDirty),h=!l,v=u||s.isFormValidating;s.errors=Object.values(s.errorMap).filter(_=>_!==void 0);const p=s.errors.length===0,g=d&&p,S=s.submissionAttempts===0&&!c||!v&&!s.isSubmitting&&g;s={...s,isFieldsValidating:u,isFieldsValid:d,isFormValid:p,isValid:g,canSubmit:S,isTouched:c,isPristine:h,isDirty:l},this.state=s,this.store.state=this.state;const y=((e=this.options.transform)==null?void 0:e.deps)??[];(y.length!==this.prevTransformArray.length||y.some((_,x)=>_!==this.prevTransformArray[x]))&&((r=this.options.transform)==null||r.fn(this),this.store.state=this.state,this.prevTransformArray=y)}}),this.state=this.store.state,this.update(a||{})}runValidator(a){const i=this.options.validatorAdapter;return i&&typeof a.validate!="function"?i()[a.type](a.value,a.validate):a.validate(a.value)}setErrorMap(a){this.store.setState(i=>({...i,errorMap:{...i.errorMap,...a}}))}}function Ze(t){if(t)return typeof t!="string"?"Invalid Form Values":t}function ie(t){switch(t){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}class Ht{constructor(a){this.options={},this.mount=()=>{const i=this.getInfo();i.instance=this;const e=this.form.store.subscribe(()=>{this.store.batch(()=>{const s=this.getValue(),o=this.getMeta();s!==this.state.value&&this.store.setState(u=>({...u,value:s})),o!==this.state.meta&&this.store.setState(u=>({...u,meta:o}))})});this.update(this.options);const{onMount:r}=this.options.validators||{};if(r){const s=this.runValidator({validate:r,value:{value:this.state.value,fieldApi:this},type:"validate"});s&&this.setMeta(o=>({...o,errorMap:{...o==null?void 0:o.errorMap,onMount:s}}))}return()=>{e()}},this.update=i=>{if(this.state.value===void 0){const e=Ue(i.form.options.defaultValues,i.name);i.defaultValue!==void 0?this.setValue(i.defaultValue,{dontUpdateMeta:!0}):e!==void 0&&this.setValue(e,{dontUpdateMeta:!0})}this._getMeta()===void 0&&this.setMeta(this.state.meta),this.options=i},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(i,e)=>{this.form.setFieldValue(this.name,i,e),this.validate("change")},this._getMeta=()=>this.form.getFieldMeta(this.name),this.getMeta=()=>this._getMeta()??{isValidating:!1,isTouched:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...this.options.defaultMeta},this.setMeta=i=>this.form.setFieldMeta(this.name,i),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(i,e)=>this.form.pushFieldValue(this.name,i,e),this.insertValue=(i,e,r)=>this.form.insertFieldValue(this.name,i,e,r),this.replaceValue=(i,e,r)=>this.form.replaceFieldValue(this.name,i,e,r),this.removeValue=(i,e)=>this.form.removeFieldValue(this.name,i,e),this.swapValues=(i,e,r)=>this.form.swapFieldValues(this.name,i,e,r),this.moveValue=(i,e,r)=>this.form.moveFieldValues(this.name,i,e,r),this.getLinkedFields=i=>{const e=Object.values(this.form.fieldInfo),r=[];for(const s of e){if(!s.instance)continue;const{onChangeListenTo:o,onBlurListenTo:u}=s.instance.options.validators||{};i==="change"&&(o!=null&&o.includes(this.name))&&r.push(s.instance),i==="blur"&&(u!=null&&u.includes(this.name))&&r.push(s.instance)}return r},this.validateSync=i=>{const e=be(i,this.options),s=this.getLinkedFields(i).reduce((d,c)=>{const l=be(i,c.options);return l.forEach(h=>{h.field=c}),d.concat(l)},[]);let o=!1;this.form.store.batch(()=>{const d=(c,l)=>{const h=We(c.runValidator({validate:l.validate,value:{value:c.getValue(),fieldApi:c},type:"validate"})),v=Y(l.cause);c.state.meta.errorMap[v]!==h&&c.setMeta(p=>({...p,errorMap:{...p.errorMap,[Y(l.cause)]:h}})),h&&(o=!0)};for(const c of e)c.validate&&d(this,c);for(const c of s)c.validate&&d(c.field,c)});const u=Y("submit");return this.state.meta.errorMap[u]&&i!=="submit"&&!o&&this.setMeta(d=>({...d,errorMap:{...d.errorMap,[u]:void 0}})),{hasErrored:o}},this.validateAsync=async i=>{const e=ge(i,this.options),r=this.getLinkedFields(i),s=r.reduce((l,h)=>{const v=ge(i,h.options);return v.forEach(p=>{p.field=h}),l.concat(v)},[]);this.state.meta.isValidating||this.setMeta(l=>({...l,isValidating:!0}));for(const l of r)l.setMeta(h=>({...h,isValidating:!0}));const o=[],u=[],d=(l,h,v)=>{const p=Y(h.cause),g=l.getInfo().validationMetaMap[p];g==null||g.lastAbortController.abort();const S=new AbortController;this.getInfo().validationMetaMap[p]={lastAbortController:S},v.push(new Promise(async y=>{let R;try{R=await new Promise((x,D)=>{setTimeout(async()=>{if(S.signal.aborted)return x(void 0);try{x(await this.runValidator({validate:h.validate,value:{value:l.getValue(),fieldApi:l,signal:S.signal},type:"validateAsync"}))}catch(k){D(k)}},h.debounceMs)})}catch(x){R=x}if(S.signal.aborted)return y(void 0);const _=We(R);l.setMeta(x=>({...x,errorMap:{...x==null?void 0:x.errorMap,[Y(i)]:_}})),y(_)}))};for(const l of e)l.validate&&d(this,l,o);for(const l of s)l.validate&&d(l.field,l,u);let c=[];(o.length||u.length)&&(c=await Promise.all(o),await Promise.all(u)),this.setMeta(l=>({...l,isValidating:!1}));for(const l of r)l.setMeta(h=>({...h,isValidating:!1}));return c.filter(Boolean)},this.validate=i=>{var e;if(!this.state.meta.isTouched)return[];try{this.form.validate(i)}catch{}const{hasErrored:r}=this.validateSync(i);return r&&!this.options.asyncAlways?((e=this.getInfo().validationMetaMap[Y(i)])==null||e.lastAbortController.abort(),this.state.meta.errors):this.validateAsync(i)},this.handleChange=i=>{this.setValue(i)},this.handleBlur=()=>{this.state.meta.isTouched||(this.setMeta(e=>({...e,isTouched:!0})),this.validate("change")),this.validate("blur")},this.form=a.form,this.name=a.name,a.defaultValue!==void 0&&this.form.setFieldValue(this.name,a.defaultValue,{dontUpdateMeta:!0}),this.store=new Le({value:this.getValue(),meta:this._getMeta()??{isValidating:!1,isTouched:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...a.defaultMeta}},{onUpdate:()=>{const i=this.store.state;i.meta.errors=Object.values(i.meta.errorMap).filter(e=>e!==void 0),i.meta.isPristine=!i.meta.isDirty,this.prevState=i,this.state=i}}),this.state=this.store.state,this.prevState=this.state,this.options=a}runValidator(a){const i=[this.form.options.validatorAdapter,this.options.validatorAdapter];for(const e of i)if(e&&typeof a.validate!="function")return e()[a.type](a.value,a.validate);return a.validate(a.value)}setErrorMap(a){this.setMeta(i=>({...i,errorMap:{...i.errorMap,...a}}))}}function We(t){if(t)return typeof t!="string"?"Invalid Form Values":t}function Y(t){switch(t){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}var _e={exports:{}},Se={},ae={exports:{}},Ee={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qe;function zt(){if(qe)return Ee;qe=1;var t=j;function a(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var i=typeof Object.is=="function"?Object.is:a,e=t.useState,r=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function u(h,v){var p=v(),g=e({inst:{value:p,getSnapshot:v}}),S=g[0].inst,y=g[1];return s(function(){S.value=p,S.getSnapshot=v,d(S)&&y({inst:S})},[h,p,v]),r(function(){return d(S)&&y({inst:S}),h(function(){d(S)&&y({inst:S})})},[h]),o(p),p}function d(h){var v=h.getSnapshot;h=h.value;try{var p=v();return!i(h,p)}catch{return!0}}function c(h,v){return v()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:u;return Ee.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:l,Ee}var je={};/**
* @license React
* use-sync-external-store-shim.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Be;function Jt(){return Be||(Be=1,process.env.NODE_ENV!=="production"&&function(){function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}function a(p,g){l||r.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var S=g();if(!h){var y=g();s(S,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}y=o({inst:{value:S,getSnapshot:g}});var R=y[0].inst,_=y[1];return d(function(){R.value=S,R.getSnapshot=g,i(R)&&_({inst:R})},[p,S,g]),u(function(){return i(R)&&_({inst:R}),p(function(){i(R)&&_({inst:R})})},[p]),c(S),S}function i(p){var g=p.getSnapshot;p=p.value;try{var S=g();return!s(p,S)}catch{return!0}}function e(p,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=j,s=typeof Object.is=="function"?Object.is:t,o=r.useState,u=r.useEffect,d=r.useLayoutEffect,c=r.useDebugValue,l=!1,h=!1,v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?e:a;je.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),je}var Ke;function Ge(){return Ke||(Ke=1,process.env.NODE_ENV==="production"?ae.exports=zt():ae.exports=Jt()),ae.exports}/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ye;function Xt(){if(Ye)return Se;Ye=1;var t=j,a=Ge();function i(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var e=typeof Object.is=="function"?Object.is:i,r=a.useSyncExternalStore,s=t.useRef,o=t.useEffect,u=t.useMemo,d=t.useDebugValue;return Se.useSyncExternalStoreWithSelector=function(c,l,h,v,p){var g=s(null);if(g.current===null){var S={hasValue:!1,value:null};g.current=S}else S=g.current;g=u(function(){function R(w){if(!_){if(_=!0,x=w,w=v(w),p!==void 0&&S.hasValue){var C=S.value;if(p(C,w))return D=C}return D=w}if(C=D,e(x,w))return C;var U=v(w);return p!==void 0&&p(C,U)?(x=w,C):(x=w,D=U)}var _=!1,x,D,k=h===void 0?null:h;return[function(){return R(l())},k===null?void 0:function(){return R(k())}]},[l,h,v,p]);var y=r(c,g[0],g[1]);return o(function(){S.hasValue=!0,S.value=y},[y]),d(y),y},Se}var Re={};/**
* @license React
* use-sync-external-store-shim/with-selector.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var He;function Qt(){return He||(He=1,process.env.NODE_ENV!=="production"&&function(){function t(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=j,i=Ge(),e=typeof Object.is=="function"?Object.is:t,r=i.useSyncExternalStore,s=a.useRef,o=a.useEffect,u=a.useMemo,d=a.useDebugValue;Re.useSyncExternalStoreWithSelector=function(c,l,h,v,p){var g=s(null);if(g.current===null){var S={hasValue:!1,value:null};g.current=S}else S=g.current;g=u(function(){function R(w){if(!_){if(_=!0,x=w,w=v(w),p!==void 0&&S.hasValue){var C=S.value;if(p(C,w))return D=C}return D=w}if(C=D,e(x,w))return C;var U=v(w);return p!==void 0&&p(C,U)?(x=w,C):(x=w,D=U)}var _=!1,x,D,k=h===void 0?null:h;return[function(){return R(l())},k===null?void 0:function(){return R(k())}]},[l,h,v,p]);var y=r(c,g[0],g[1]);return o(function(){S.hasValue=!0,S.value=y},[y]),d(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Re}process.env.NODE_ENV==="production"?_e.exports=Xt():_e.exports=Qt();var er=_e.exports;function Ve(t,a=i=>i){return er.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,a,tr)}function tr(t,a){if(Object.is(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;if(t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(const[e,r]of t)if(!a.has(e)||!Object.is(r,a.get(e)))return!1;return!0}if(t instanceof Set&&a instanceof Set){if(t.size!==a.size)return!1;for(const e of t)if(!a.has(e))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(a).length)return!1;for(let e=0;e<i.length;e++)if(!Object.prototype.hasOwnProperty.call(a,i[e])||!Object.is(t[i[e]],a[i[e]]))return!1;return!0}const se=typeof window<"u"?j.useLayoutEffect:j.useEffect;function ze(t){const[a]=j.useState(()=>{const e=new Ht({...t,form:t.form,name:t.name});return e.Field=Je,e});return se(a.mount,[a]),se(()=>{a.update(t)}),Ve(a.store,t.mode==="array"?i=>[i.meta,Object.keys(i.value??[]).length]:void 0),a}const Je=({children:t,...a})=>{const i=ze(a);return f.jsx(f.Fragment,{children:re(t,i)})};function rr(t){const[a]=j.useState(()=>{const i=new Yt(t),e=i;return e.Field=function(s){return f.jsx(Je,{...s,form:i})},e.useField=r=>ze({...r,form:i}),e.useStore=r=>Ve(i.store,r),e.Subscribe=r=>re(r.children,Ve(i.store,r.selector)),e});return se(a.mount,[]),a.useStore(i=>i.isSubmitting),se(()=>{a.update(t)}),a}function Xe({name:t,label:a,value:i="",onChange:e,error:r,required:s,options:o={},className:u=""}){var c;const d=nr(o.format);return f.jsxs("div",{className:`field string-field ${u}`,children:[f.jsx("label",{htmlFor:t,id:t+"-label",className:`field-label ${s?"required":""}`,children:a}),f.jsx("input",{id:t,name:t,type:d,value:i,onChange:l=>e(l.target.value),minLength:o.minLength,maxLength:o.maxLength,pattern:(c=o.pattern)==null?void 0:c.source,className:`field-input ${r?"error":""}`,required:s,readOnly:o.readonly,"aria-labelledby":t+"-label"}),r&&f.jsx("span",{className:"field-error",children:r})]})}function nr(t){switch(t){case"email":return"email";case"url":return"url";default:return"text"}}function Qe({name:t,label:a,value:i=0,onChange:e,error:r,required:s,options:o={},className:u=""}){return f.jsxs("div",{className:`field number-field ${u}`,children:[f.jsx("label",{htmlFor:t,id:t+"-label",className:`field-label ${s?"required":""}`,children:a}),f.jsx("input",{id:t,name:t,type:"number",value:i,onChange:d=>e(Number(d.target.value)),min:o.min,max:o.max,step:o.step,className:`field-input ${r?"error":""}`,required:s,"aria-labelledby":t+"-label"}),r&&f.jsx("span",{className:"field-error",children:r})]})}function et({name:t,label:a,value:i=!1,onChange:e,error:r,className:s=""}){return f.jsxs("div",{className:`field boolean-field ${s}`,children:[f.jsxs("label",{className:"field-label checkbox-label",children:[f.jsx("input",{id:t,name:t,type:"checkbox",checked:i,onChange:o=>e(o.target.checked),className:`field-input ${r?"error":""}`}),a]}),r&&f.jsx("span",{className:"field-error",children:r})]})}function tt({name:t,label:a,value:i,onChange:e,error:r,required:s,className:o=""}){const u=c=>c?c.toISOString().split("T")[0]:"",d=c=>{const l=c.target.value?new Date(c.target.value):new Date;e(l)};return f.jsxs("div",{className:`field date-field ${o}`,children:[f.jsxs("label",{htmlFor:t,className:"field-label",children:[a,s&&f.jsx("span",{className:"required",children:"*"})]}),f.jsx("input",{id:t,name:t,type:"date",value:u(i),onChange:d,className:`field-input ${r?"error":""}`,required:s}),r&&f.jsx("span",{className:"field-error",children:r})]})}function ir({value:t="",onChange:a,error:i,required:e,label:r,name:s,values:o=[]}){return f.jsxs("div",{className:"field enum-field",children:[f.jsx("label",{className:`field-label ${e?"required":""}`,htmlFor:s,id:`${s}-label`,children:r}),f.jsxs("select",{id:s,name:s,value:t,onChange:u=>a(u.target.value),className:`field-input ${i?"error":""}`,"aria-labelledby":`${s}-label`,required:e,children:[f.jsx("option",{value:"",children:"Select an option..."}),o.map(u=>f.jsx("option",{value:u,children:u},u))]}),i&&f.jsx("div",{className:"field-error",children:i})]})}function rt({value:t=[],onChange:a,error:i,required:e,label:r,itemSchema:s,form:o,path:u,options:d}){const c=(d==null?void 0:d.minItems)||0,l=(d==null?void 0:d.maxItems)||1/0,h=t.length<l,v=t.length>c,p=()=>{if(h){const y=S(s);a([...t,y])}},g=y=>{if(v){const R=t.filter((_,x)=>x!==y);a(R)}},S=y=>{switch(y.type){case"string":return"";case"number":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return null}};return f.jsxs("div",{className:"array-field",children:[f.jsxs("div",{className:"array-header",children:[f.jsxs("label",{className:"array-label",children:[r," ",e&&f.jsx("span",{className:"required",children:"*"})]}),h&&f.jsx("button",{type:"button",onClick:p,className:"add-button",children:"Add Item"})]}),i&&f.jsx("div",{className:"error-message",children:i}),f.jsx("div",{className:"array-items",children:t.map((y,R)=>f.jsxs("div",{className:"array-item",children:[f.jsx(H,{schema:s,form:o,path:`${u}.${R}`,label:`Item ${R+1}`}),v&&f.jsx("button",{type:"button",onClick:()=>g(R),className:"remove-button",children:"Remove"})]},R))}),t.length===0&&f.jsx("div",{className:"array-empty",children:'No items. Click "Add Item" to get started.'})]})}function nt({error:t,required:a,label:i,properties:e,form:r,path:s,zodSchema:o}){const u=e||{};return f.jsxs("div",{className:"object-field",children:[f.jsxs("label",{className:"object-label",children:[i," ",a&&f.jsx("span",{className:"required",children:"*"})]}),f.jsx("div",{className:"object-properties",children:Object.entries(u).map(([d,c])=>{if(!c)return null;const l=s?`${s}.${d}`:d;return f.jsx(H,{schema:c,form:r,path:l,label:d,zodSchema:o},d)})})]})}function it({value:t={},onChange:a,error:i,required:e,label:r,name:s,discriminator:o,variants:u,form:d,path:c}){const l=t==null?void 0:t[o],h=Object.keys(u),v=y=>{const R=u[y],_={[o]:y,...p(R)};a(_)},p=y=>{if(y.type==="object"&&y.properties){const R={};return Object.entries(y.properties).forEach(([_,x])=>{_!==o&&(R[_]=g(x))}),R}return{}},g=y=>{switch(y.type){case"string":return"";case"number":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return null}},S=l?u[l]:null;return f.jsxs("div",{className:"discriminated-union-field",children:[f.jsxs("label",{className:"union-label",children:[r," ",e&&f.jsx("span",{className:"required",children:"*"})]}),f.jsxs("div",{className:"variant-selector",children:[f.jsx("label",{htmlFor:`${s}-variant`,children:"Type:"}),f.jsxs("select",{id:`${s}-variant`,value:l||"",onChange:y=>v(y.target.value),className:"variant-select",children:[f.jsx("option",{value:"",children:"Select a type..."}),h.map(y=>f.jsx("option",{value:y,children:y},y))]},`${s}-variant-${l||"none"}`)]}),S&&f.jsx("div",{className:"variant-fields",children:f.jsx(H,{schema:S,form:d,path:c})})]})}class ar{constructor(a={}){ke(this,"registry");ke(this,"config");this.config={fallbackToDefaults:!0,...a},this.registry={fieldRenderers:new Map,patternRenderers:[],uiAdapters:new Map,defaultAdapter:this.config.defaultAdapter},this.registerDefaultRenderers()}registerDefaultRenderers(){this.registry.fieldRenderers.set("string",Xe),this.registry.fieldRenderers.set("number",Qe),this.registry.fieldRenderers.set("boolean",et),this.registry.fieldRenderers.set("date",tt),this.registry.fieldRenderers.set("enum",ir),this.registry.fieldRenderers.set("array",rt),this.registry.fieldRenderers.set("object",nt),this.registry.fieldRenderers.set("discriminatedUnion",it)}registerFieldRenderer(a,i){this.registry.fieldRenderers.set(a,i)}registerSchemaPatternRenderer(a,i,e,r=0){const s=typeof i=="function"?i:(o,u,d)=>{try{return o instanceof V.z.ZodLiteral&&i instanceof V.z.ZodLiteral?o._def.value===i._def.value:o instanceof V.z.ZodObject&&i instanceof V.z.ZodObject?this.compareZodObjectSchemas(o,i):o instanceof V.z.ZodNumber&&i instanceof V.z.ZodNumber?this.compareZodNumberSchemas(o,i):o instanceof V.z.ZodString&&i instanceof V.z.ZodString?this.compareZodStringSchemas(o,i):o.constructor===i.constructor}catch{return!1}};this.registry.patternRenderers=this.registry.patternRenderers.filter(o=>o.id!==a),this.registry.patternRenderers.push({id:a,matcher:s,component:e,priority:r}),this.registry.patternRenderers.sort((o,u)=>u.priority-o.priority)}compareZodObjectSchemas(a,i){const e=a.shape,r=i.shape;for(const[s,o]of Object.entries(r)){const u=e[s];if(!u)return!1;const d=o,c=u;if(d instanceof V.z.ZodLiteral){if(!(c instanceof V.z.ZodLiteral)||c._def.value!==d._def.value)return!1}else if(c.constructor!==d.constructor)return!1}return!0}compareZodNumberSchemas(a,i){const e=a._def.checks||[],r=i._def.checks||[];if(r.length===0)return!0;const s=d=>{const c={};return d.forEach(l=>{l.kind==="min"&&(c.min=l.value),l.kind==="max"&&(c.max=l.value),l.kind==="int"&&(c.int=!0),l.kind==="multipleOf"&&(c.multipleOf=l.value)}),c},o=s(e),u=s(r);for(const[d,c]of Object.entries(u))if(o[d]!==c)return!1;return!0}compareZodStringSchemas(a,i){const e=a._def.checks||[],r=i._def.checks||[];if(r.length===0)return!0;const s=d=>{const c={};return d.forEach(l=>{l.kind==="min"&&(c.min=l.value),l.kind==="max"&&(c.max=l.value),l.kind==="email"&&(c.email=!0),l.kind==="url"&&(c.url=!0),l.kind==="uuid"&&(c.uuid=!0),l.kind==="regex"&&(c.regex=l.regex.toString()),l.kind==="length"&&(c.length=l.value)}),c},o=s(e),u=s(r);for(const[d,c]of Object.entries(u))if(o[d]!==c)return!1;return!0}registerUIAdapter(a){this.registry.uiAdapters.set(a.name,a),Object.entries(a.components).forEach(([i,e])=>{this.registry.fieldRenderers.set(i,e)}),this.registry.defaultAdapter||(this.registry.defaultAdapter=a.name)}getRegisteredRenderer(a){return this.registry.fieldRenderers.get(a)}getUIAdapter(a){return this.registry.uiAdapters.get(a)}getDefaultAdapter(){if(this.registry.defaultAdapter)return this.registry.uiAdapters.get(this.registry.defaultAdapter)}setDefaultAdapter(a){if(this.registry.uiAdapters.has(a)){this.registry.defaultAdapter=a;const i=this.registry.uiAdapters.get(a);i&&Object.entries(i.components).forEach(([e,r])=>{this.registry.fieldRenderers.set(e,r)})}else throw new Error(`UI adapter "${a}" not found`)}getMatchingPatternRenderer(a,i,e){for(const r of this.registry.patternRenderers)if(r.matcher(a,i,e))return r.component}removeSchemaPatternRenderer(a){const i=this.registry.patternRenderers.length;return this.registry.patternRenderers=this.registry.patternRenderers.filter(e=>e.id!==a),this.registry.patternRenderers.length<i}getAllFieldRenderers(){return new Map(this.registry.fieldRenderers)}getAllUIAdapters(){return new Map(this.registry.uiAdapters)}getAllPatternRenderers(){return[...this.registry.patternRenderers]}clearCustomFieldRenderers(){this.registry.fieldRenderers.clear(),this.registerDefaultRenderers()}clearUIAdapters(){this.registry.uiAdapters.clear(),this.registry.defaultAdapter=void 0}clearPatternRenderers(){this.registry.patternRenderers=[]}reset(){this.registry={fieldRenderers:new Map,patternRenderers:[],uiAdapters:new Map,defaultAdapter:this.config.defaultAdapter},this.registerDefaultRenderers()}hasFieldRenderer(a){return this.registry.fieldRenderers.has(a)}hasUIAdapter(a){return this.registry.uiAdapters.has(a)}hasPatternRenderer(a){return this.registry.patternRenderers.some(i=>i.id===a)}getRegistry(){return{fieldRenderers:new Map(this.registry.fieldRenderers),patternRenderers:[...this.registry.patternRenderers],uiAdapters:new Map(this.registry.uiAdapters),defaultAdapter:this.registry.defaultAdapter}}getConfig(){return{...this.config}}updateConfig(a){this.config={...this.config,...a}}}const L=new ar,at=(t,a)=>{L.registerFieldRenderer(t,a)},oe=t=>{L.registerUIAdapter(t)},Oe=t=>L.getRegisteredRenderer(t),st=t=>L.getUIAdapter(t),ot=()=>L.getDefaultAdapter(),le=t=>{L.setDefaultAdapter(t)},lt=(t,a,i,e)=>{L.registerSchemaPatternRenderer(t,a,i,e)},Fe=(t,a,i)=>L.getMatchingPatternRenderer(t,a,i),ut=t=>L.removeSchemaPatternRenderer(t),ct=()=>L.getAllPatternRenderers(),dt=()=>{L.clearPatternRenderers()},sr=(t,a)=>{if(!a||!t)return t;const i=a.split(".");let e=t;for(const r of i)if(e instanceof V.z.ZodObject)e=e.shape[r];else return;return e};function H({schema:t,form:a,path:i,label:e,zodSchema:r,isRoot:s=!1}){const o=i||t.name||"";if(s&&t.type==="object"&&t.properties)return f.jsx("div",{className:"root-object-fields",children:Object.entries(t.properties).map(([h,v])=>v?f.jsx(H,{schema:v,form:a,path:h,label:h,zodSchema:r,isRoot:!1},h):(console.warn(`FieldRenderer: Schema for property '${h}' is undefined`),null))});const u=sr(r,o);let d;if(u&&(d=Fe(u,t)),d)return f.jsx(a.Field,{name:o,validators:{onChange:u?({value:h,fieldApi:v})=>{var R,_,x,D,k,w,C,U;const p=(_=(R=v==null?void 0:v.state)==null?void 0:R.meta)==null?void 0:_.isTouched,g=((k=(D=(x=v==null?void 0:v.state)==null?void 0:x.meta)==null?void 0:D.errors)==null?void 0:k.length)>0,S=(C=(w=v==null?void 0:v.state)==null?void 0:w.meta)==null?void 0:C.isSubmitted;if(p||g||S)try{u.parse(h);return}catch(q){return q instanceof V.z.ZodError&&((U=q.errors[0])==null?void 0:U.message)||"Validation error"}}:void 0},children:h=>{const v={value:h.state.value,onChange:p=>h.handleChange(p),error:h.state.meta.errors.join(", ")||void 0,required:t.required,label:e||i.split(".").pop()||"",name:o,zodSchema:u,parsedField:t,form:a,path:o};return j.createElement(d,v)}});const c=t.type,l=Oe(c);return l?f.jsx(a.Field,{name:o,validators:{onChange:u?({value:h,fieldApi:v})=>{var R,_,x,D,k,w,C,U;const p=(_=(R=v==null?void 0:v.state)==null?void 0:R.meta)==null?void 0:_.isTouched,g=((k=(D=(x=v==null?void 0:v.state)==null?void 0:x.meta)==null?void 0:D.errors)==null?void 0:k.length)>0,S=(C=(w=v==null?void 0:v.state)==null?void 0:w.meta)==null?void 0:C.isSubmitted;if(p||g||S)try{u.parse(h);return}catch(q){return q instanceof V.z.ZodError&&((U=q.errors[0])==null?void 0:U.message)||"Validation error"}}:void 0},children:h=>{const v={value:h.state.value,onChange:p=>h.handleChange(p),error:h.state.meta.errors.join(", ")||void 0,required:t.required,label:e||i.split(".").pop()||"",name:o};switch(t.type){case"string":return j.createElement(l,{...v,options:t.options});case"number":return j.createElement(l,{...v,options:t.options});case"boolean":return j.createElement(l,v);case"date":return j.createElement(l,v);case"enum":return j.createElement(l,{...v,values:t.values});case"array":return j.createElement(l,{...v,itemSchema:t.items,form:a,path:o,options:t.options});case"object":return j.createElement(l,{...v,properties:t.properties||{},form:a,path:o,zodSchema:r});case"discriminatedUnion":return j.createElement(l,{...v,discriminator:t.discriminator,variants:t.variants,form:a,path:o,zodSchema:r});default:return f.jsxs("div",{children:["Unsupported field type: ",t.type]})}}}):f.jsxs("div",{children:["Unsupported field type: ",t.type]})}function W(t){if(t instanceof V.z.ZodOptional||t instanceof V.z.ZodNullable)return{...W(t._def.innerType),required:!1};if(t instanceof V.z.ZodDefault)return{...W(t._def.innerType),defaultValue:t._def.defaultValue()};if(t instanceof V.z.ZodObject){const a=t.shape;return{type:"object",properties:Object.fromEntries(Object.entries(a).map(([e,r])=>[e,W(r)])),required:!0}}if(t instanceof V.z.ZodDiscriminatedUnion){const a=t.options,i=t.discriminator;return{type:"discriminatedUnion",variants:Object.fromEntries(a.map(r=>[r.shape[i].value,W(r)])),required:!0,discriminator:i}}if(t instanceof V.z.ZodString)return{type:"string",required:!0};if(t instanceof V.z.ZodNumber)return{type:"number",required:!0};if(t instanceof V.z.ZodBoolean)return{type:"boolean",required:!0};if(t instanceof V.z.ZodDate)return{type:"date",required:!0};if(t instanceof V.z.ZodEnum)return{type:"enum",values:t.options,required:!0};if(t instanceof V.z.ZodArray)return{type:"array",items:W(t.element),required:!0};if(t instanceof V.z.ZodUnion)return W(t.options[0]);if(t instanceof V.z.ZodLiteral)return{type:"string",required:!0,literalValue:t.value};if(t instanceof V.z.ZodRecord)return{type:"object",required:!0,isRecord:!0};throw new Error(`Unsupported schema type: ${t.constructor.name}`)}const Me=t=>{if(t instanceof V.z.ZodObject){const a={};return Object.entries(t.shape).forEach(([i,e])=>{if(e instanceof V.z.ZodDefault)a[i]=e._def.defaultValue();else if(e instanceof V.z.ZodOptional)a[i]=void 0;else if(e instanceof V.z.ZodString)a[i]="";else if(e instanceof V.z.ZodNumber)a[i]=0;else if(e instanceof V.z.ZodBoolean)a[i]=!1;else if(e instanceof V.z.ZodArray)a[i]=[];else if(e instanceof V.z.ZodObject)a[i]=Me(e);else if(e instanceof V.z.ZodEnum)a[i]=e.options[0];else if(e instanceof V.z.ZodDiscriminatedUnion){const r=e.options[0];if(r instanceof V.z.ZodObject){const s=e.discriminator,o=r.shape[s].value;a[i]={[s]:o,...Me(r)}}}else a[i]=void 0}),a}return{}};function ft({schema:t,onSubmit:a,defaultValues:i={},className:e="",registerUIAdapter:r}){r&&(oe(r),le(r.name)),j.useLayoutEffect(()=>{r&&(oe(r),le(r.name))},[r]);const o={...Me(t),...i},u=rr({defaultValues:o,onSubmit:async({value:c})=>{try{const l=t.parse(c);await a(l)}catch(l){if(l instanceof V.z.ZodError){console.error("Validation error:",l);return}throw l}}}),d=W(t);return f.jsxs("form",{onSubmit:c=>{c.preventDefault(),c.stopPropagation(),u.handleSubmit()},className:`form-generator ${e}`,role:"form",children:[f.jsx(H,{schema:d,form:u,path:"",zodSchema:t,isRoot:!0}),f.jsx(u.Subscribe,{selector:c=>({canSubmit:c.canSubmit,isSubmitting:c.isSubmitting}),children:({canSubmit:c,isSubmitting:l})=>f.jsx("button",{type:"submit",disabled:!c||l,className:"submit-button",children:l?"Submitting...":"Submit"})})]})}const or=ft;function ht(){const t=j.useCallback((h,v)=>{at(h,v)},[]),a=j.useCallback(h=>{oe(h)},[]),i=j.useCallback(h=>Oe(h),[]),e=j.useCallback(h=>st(h),[]),r=j.useCallback(()=>ot(),[]),s=j.useCallback(h=>{le(h)},[]),o=j.useCallback((h,v,p,g)=>{lt(h,v,p,g)},[]),u=j.useCallback((h,v,p)=>Fe(h,v,p),[]),d=j.useCallback(h=>ut(h),[]),c=j.useCallback(()=>ct(),[]),l=j.useCallback(()=>{dt()},[]);return{registerFieldRenderer:t,registerUIAdapter:a,getRegisteredRenderer:i,getUIAdapter:e,getDefaultAdapter:r,setDefaultAdapter:s,registerSchemaPatternRenderer:o,getMatchingPatternRenderer:u,removeSchemaPatternRenderer:d,getAllPatternRenderers:c,clearPatternRenderers:l,registry:L}}const vt=j.createContext(void 0);function lr({children:t,config:a}){const i=ht();return f.jsx(vt.Provider,{value:i,children:t})}function ur(){const t=j.useContext(vt);if(t===void 0)throw new Error("usePluginContext must be used within a PluginProvider");return t}function cr({name:t,label:a,value:i="",onChange:e,error:r,required:s,options:o={},className:u=""}){var c;const d=gr(o.format);return f.jsxs("div",{className:`field string-field ${u}`,children:[f.jsxs("label",{htmlFor:t,className:"field-label",children:[a,s&&f.jsx("span",{className:"required",children:"*"})]}),f.jsx("input",{id:t,name:t,type:d,value:i,onChange:l=>e(l.target.value),minLength:o.minLength,maxLength:o.maxLength,pattern:(c=o.pattern)==null?void 0:c.source,className:`field-input ${r?"error":""}`,required:s,readOnly:o.readonly}),r&&f.jsx("span",{className:"field-error",children:r})]})}function dr({name:t,label:a,value:i=0,onChange:e,error:r,required:s,options:o={},className:u=""}){return f.jsxs("div",{className:`field number-field ${u}`,children:[f.jsxs("label",{htmlFor:t,className:"field-label",children:[a,s&&f.jsx("span",{className:"required",children:"*"})]}),f.jsx("input",{id:t,name:t,type:"number",value:i,onChange:d=>e(Number(d.target.value)),min:o.min,max:o.max,step:o.step,className:`field-input ${r?"error":""}`,required:s,readOnly:o.readonly}),r&&f.jsx("span",{className:"field-error",children:r})]})}function fr({name:t,label:a,value:i=!1,onChange:e,error:r,required:s,className:o=""}){return f.jsxs("div",{className:`field boolean-field ${o}`,children:[f.jsxs("label",{className:"field-label",children:[f.jsx("input",{type:"checkbox",name:t,checked:i,onChange:u=>e(u.target.checked),required:s,className:r?"error":""}),a,s&&f.jsx("span",{className:"required",children:"*"})]}),r&&f.jsx("span",{className:"field-error",children:r})]})}function hr({name:t,label:a,value:i=null,onChange:e,error:r,required:s,className:o=""}){const u=i?i.toISOString().split("T")[0]:"";return f.jsxs("div",{className:`field date-field ${o}`,children:[f.jsxs("label",{htmlFor:t,className:"field-label",children:[a,s&&f.jsx("span",{className:"required",children:"*"})]}),f.jsx("input",{id:t,name:t,type:"date",value:u,onChange:d=>e(d.target.value?new Date(d.target.value):null),className:`field-input ${r?"error":""}`,required:s}),r&&f.jsx("span",{className:"field-error",children:r})]})}function vr({name:t,label:a,value:i=[],onChange:e,error:r,required:s,itemSchema:o,errors:u,path:d,options:c={},className:l=""}){const h=()=>{const S=[...i,br(o)];e(d,S)},v=S=>{const y=i.filter((R,_)=>_!==S);e(d,y)},p=!c.maxLength||i.length<c.maxLength,g=!c.minLength||i.length>c.minLength;return f.jsxs("div",{className:`field array-field ${l}`,children:[f.jsxs("div",{className:"array-header",children:[f.jsxs("label",{className:"field-label",children:[a,s&&f.jsx("span",{className:"required",children:"*"})]}),f.jsx("button",{type:"button",onClick:h,disabled:!p,className:"add-button",children:"Add Item"})]}),f.jsx("div",{className:"array-items",children:i.map((S,y)=>f.jsxs("div",{className:"array-item",children:[f.jsx("div",{className:"item-content",children:f.jsxs("span",{children:["Item ",y+1]})}),g&&f.jsx("button",{type:"button",onClick:()=>v(y),className:"remove-button",children:"Remove"})]},y))}),r&&f.jsx("span",{className:"field-error",children:r})]})}function mr({name:t,label:a,value:i={},onChange:e,error:r,required:s,properties:o,errors:u,path:d,className:c=""}){return f.jsxs("div",{className:`field object-field ${c}`,children:[a&&f.jsxs("div",{className:"object-label",children:[a,s&&f.jsx("span",{className:"required",children:"*"})]}),f.jsx("div",{className:"object-properties",children:Object.entries(o).map(([l,h])=>f.jsxs("div",{className:"property-field",children:[f.jsx("label",{className:"property-label",children:l}),f.jsxs("span",{children:["Property: ",l]})]},l))}),r&&f.jsx("span",{className:"field-error",children:r})]})}function pr({name:t,label:a,value:i={},onChange:e,error:r,required:s,discriminator:o,variants:u,errors:d,path:c,className:l=""}){const h=i[o],v=Object.keys(u),p=g=>{const S={[o]:g};e(c,S)};return f.jsxs("div",{className:`field discriminated-union-field ${l}`,children:[a&&f.jsxs("div",{className:"union-label",children:[a,s&&f.jsx("span",{className:"required",children:"*"})]}),f.jsxs("div",{className:"variant-selector",children:[f.jsx("label",{className:"field-label",children:"Type"}),f.jsxs("select",{value:h||"",onChange:g=>p(g.target.value),className:"field-input",children:[f.jsx("option",{value:"",children:"Select type..."}),v.map(g=>f.jsx("option",{value:g,children:g},g))]})]}),h&&u[h]&&f.jsx("div",{className:"variant-fields",children:f.jsxs("span",{children:["Variant: ",h]})}),r&&f.jsx("span",{className:"field-error",children:r})]})}function gr(t){switch(t){case"email":return"email";case"url":return"url";default:return"text"}}function br(t){if(t.defaultValue!==void 0)return t.defaultValue;switch(t.type){case"string":return"";case"number":return 0;case"boolean":return!1;case"date":return new Date;case"array":return[];case"object":return{};default:return null}}const yr={name:"radix",components:{string:cr,number:dr,boolean:fr,date:hr,array:vr,object:mr,discriminatedUnion:pr}};O.ArrayField=rt,O.BooleanField=et,O.DateField=tt,O.DiscriminatedUnionField=it,O.FieldRenderer=H,O.FormGenerator=or,O.NumberField=Qe,O.ObjectField=nt,O.PluginProvider=lr,O.StringField=Xe,O.ZodForm=ft,O.clearPatternRenderers=dt,O.getAllPatternRenderers=ct,O.getDefaultAdapter=ot,O.getMatchingPatternRenderer=Fe,O.getRegisteredRenderer=Oe,O.getUIAdapter=st,O.parseZodSchema=W,O.pluginRegistry=L,O.radixAdapter=yr,O.registerFieldRenderer=at,O.registerSchemaPatternRenderer=lt,O.registerUIAdapter=oe,O.removeSchemaPatternRenderer=ut,O.setDefaultAdapter=le,O.usePluginContext=ur,O.usePluginSystem=ht,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});